Release v0.7.1: Add approval-runs list alias, handle EPIPE, and improve summary hints
Binaries / Build & Release Binaries (push) Has been cancelled

This commit is contained in:
gitea committed 2026-08-25 15:19:11 +08:00
1 parent b998a0527e
commit e716f069ed
8 files changed
+84 -58

No files matched your search

+19 -2
View File
@@ -4,6 +4,13 @@ import { fileURLToPath } from "node:url";
import { runCli } from "./cli/runner.js";
import { isCompiledBinary, resolveAppRoot, resolveDefaultLauncher } from "./core/runtime.js";
process.stdout.on("error", (err: any) => {
if (err?.code === "EPIPE") process.exit(0);
});
process.stderr.on("error", (err: any) => {
if (err?.code === "EPIPE") process.exit(0);
});
const entryFile = fileURLToPath(import.meta.url);
const isCompiled = isCompiledBinary();
const appRoot = resolveAppRoot(entryFile, isCompiled);
@@ -15,6 +22,16 @@ const result = await runCli(Bun.argv.slice(2), {
launcher
});
if (result.stdout) process.stdout.write(result.stdout);
if (result.stderr) process.stderr.write(`${result.stderr}${result.stderr.endsWith("\n") ? "" : "\n"}`);
try {
if (result.stdout) process.stdout.write(result.stdout);
} catch (err: any) {
if (err?.code !== "EPIPE") throw err;
}
try {
if (result.stderr) process.stderr.write(`${result.stderr}${result.stderr.endsWith("\n") ? "" : "\n"}`);
} catch (err: any) {
if (err?.code !== "EPIPE") throw err;
}
process.exitCode = result.exitCode;
+11 -6
View File
@@ -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,