为审核记录导出增加可复用的本地后台任务及 status/wait/list,等待超时或观察进程退出后任务继续执行。 统一实时脱敏诊断输出,保留 stdout 单一 JSON;补齐高级参数、预览和筛选配置摘要。 默认保留合思未找到单据,分别统计单据与审核记录,并显式报告部分补取失败。 补充 CLI/Skill 版本诊断、技能路由及回归测试,修复企业列表加载开销和源码更新测试隔离。
35 lines
961 B
TypeScript
Executable File
35 lines
961 B
TypeScript
Executable File
#!/usr/bin/env bun
|
|
|
|
import { fileURLToPath } from "node:url";
|
|
import { runCli } from "./cli/runner.js";
|
|
import { isCompiledBinary, performRuntimeSelfHealing, 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);
|
|
});
|
|
|
|
await performRuntimeSelfHealing();
|
|
|
|
const entryFile = fileURLToPath(import.meta.url);
|
|
const isCompiled = isCompiledBinary();
|
|
const appRoot = resolveAppRoot(entryFile, isCompiled);
|
|
const launcher = resolveDefaultLauncher(entryFile, isCompiled);
|
|
|
|
const result = await runCli(Bun.argv.slice(2), {
|
|
appRoot,
|
|
entryFile,
|
|
launcher,
|
|
onStderr: (text) => process.stderr.write(text)
|
|
});
|
|
|
|
try {
|
|
if (result.stdout) process.stdout.write(result.stdout);
|
|
} catch (err: any) {
|
|
if (err?.code !== "EPIPE") throw err;
|
|
}
|
|
|
|
process.exitCode = result.exitCode;
|