Release v0.7.1: Add approval-runs list alias, handle EPIPE, and improve summary hints
Binaries / Build & Release Binaries (push) Has been cancelled
Binaries / Build & Release Binaries (push) Has been cancelled
This commit is contained in:
1 parent
b998a0527e
commit
e716f069ed
8 files changed
+84
-58
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import type { CorpConfig } from "../../core/config/types.js";
|
||||
import type { createSealClient } from "../../core/http/factory.js";
|
||||
import { runTool } from "../helpers.js";
|
||||
import { runTool, runToolResult } from "../helpers.js";
|
||||
import { booleanOption, numberOption, stringOption } from "../parser.js";
|
||||
import { outputOptions } from "../printer.js";
|
||||
import { outputOptions, printJson } from "../printer.js";
|
||||
import type { ParsedArgs } from "../types.js";
|
||||
|
||||
export async function handleApprovalRunsCommand(
|
||||
@@ -13,7 +13,7 @@ export async function handleApprovalRunsCommand(
|
||||
args: ParsedArgs
|
||||
) {
|
||||
if (action === "summary") {
|
||||
await runTool(
|
||||
const result = await runToolResult(
|
||||
"seal_approval_runs_summary",
|
||||
client,
|
||||
corp,
|
||||
@@ -30,13 +30,18 @@ export async function handleApprovalRunsCommand(
|
||||
sourceDocumentId: stringOption(args.options.sourceDocumentId),
|
||||
humanResult: stringOption(args.options.humanResult),
|
||||
query: stringOption(args.options.query)
|
||||
},
|
||||
outputOptions(args.options)
|
||||
}
|
||||
);
|
||||
if ((result as any)?.matched === 0 && (result as any)?.total > 0) {
|
||||
console.error(
|
||||
`提示:在 ${(result as any).date} 未匹配到记录(该企业共有 ${(result as any).total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-home approval-runs list --limit 10 查看最近记录。`
|
||||
);
|
||||
}
|
||||
printJson(result, outputOptions(args.options));
|
||||
return;
|
||||
}
|
||||
|
||||
if (action === "search") {
|
||||
if (action === "search" || action === "list") {
|
||||
await runTool(
|
||||
"seal_approval_runs_search",
|
||||
client,
|
||||
|
||||
Reference in new issue
Block a user