fix: 修复审核记录导出进度与后台等待机制
为审核记录导出增加可复用的本地后台任务及 status/wait/list,等待超时或观察进程退出后任务继续执行。 统一实时脱敏诊断输出,保留 stdout 单一 JSON;补齐高级参数、预览和筛选配置摘要。 默认保留合思未找到单据,分别统计单据与审核记录,并显式报告部分补取失败。 补充 CLI/Skill 版本诊断、技能路由及回归测试,修复企业列表加载开销和源码更新测试隔离。
This commit is contained in:
1 parent
477cc630b4
commit
db5a3f7139
24 files changed
+1239
-174
No files matched your search
+22
-3
@@ -15,6 +15,7 @@ import {
|
||||
} from "./parser.js";
|
||||
import { extractHelpRequest } from "./help.js";
|
||||
import { isNewerVersion } from "../core/semver.js";
|
||||
import { getSkillVersionStatus } from "../core/skill-version.js";
|
||||
import {
|
||||
formatConsoleOutput,
|
||||
joinOutput,
|
||||
@@ -48,6 +49,11 @@ const LOCAL_COMMANDS: Record<string, LocalCommand> = {
|
||||
changelog: dispatchUpdate,
|
||||
corps: async (args) => {
|
||||
const action = args.command[1];
|
||||
// Local discovery must not initialize onboarding, sync or the capability registry.
|
||||
if (!action || ["list", "search", "find"].includes(action)) {
|
||||
await (await import("./commands/corps/overview.js")).handleCorpOverview(action, args.command[2], args);
|
||||
return;
|
||||
}
|
||||
if (action === "regression" || action === "test-regression") {
|
||||
await (await import("./commands/test.js")).handleTestCommand("regression", args.command[2], args);
|
||||
return;
|
||||
@@ -130,7 +136,9 @@ async function runCliOnce(argv: string[], options: CliRunOptions): Promise<CliRe
|
||||
stdout.push(formatConsoleOutput(values));
|
||||
};
|
||||
console.error = (...values: unknown[]) => {
|
||||
stderr.push(formatConsoleOutput(values));
|
||||
const line = redactSensitiveText(formatConsoleOutput(values));
|
||||
stderr.push(line);
|
||||
options.onStderr?.(`${line}\n`);
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -144,9 +152,9 @@ async function runCliOnce(argv: string[], options: CliRunOptions): Promise<CliRe
|
||||
} catch (error) {
|
||||
const message = redactSensitiveText(error instanceof Error ? error.message : String(error));
|
||||
const classification = classifyCliError(error);
|
||||
stderr.push(message);
|
||||
console.error(message);
|
||||
if (classification.nextAction && !message.includes("Next action:")) {
|
||||
stderr.push(`👉 Next action: ${classification.nextAction}`);
|
||||
console.error(`👉 Next action: ${classification.nextAction}`);
|
||||
}
|
||||
return {
|
||||
stdout: joinOutput(stdout),
|
||||
@@ -218,6 +226,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
|
||||
|
||||
const payload = {
|
||||
...VERSION_INFO,
|
||||
skill: getSkillVersionStatus(VERSION_INFO.version),
|
||||
...(cache?.latestVersion
|
||||
? {
|
||||
latestVersion: cache.latestVersion,
|
||||
@@ -231,6 +240,10 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
|
||||
console.error(`💡 发现新版本可用: v${VERSION_INFO.version} -> v${cache.latestVersion}`);
|
||||
console.error(`👉 Next action: seal-use update\n`);
|
||||
}
|
||||
if (["skill_newer", "cli_newer", "unknown"].includes(payload.skill.status)) {
|
||||
console.error(`技能版本与 CLI 需要核对: CLI ${payload.skill.cliVersion}, Skill ${payload.skill.installedVersion ?? "无法识别"}`);
|
||||
console.error(`👉 Next action: ${payload.skill.nextAction}`);
|
||||
}
|
||||
|
||||
printJson(payload);
|
||||
|
||||
@@ -315,6 +328,12 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Local task observation and previews must not authenticate or contact a tenant.
|
||||
if (area === "approval-runs" && (action === "export" || action === "export-worker")) {
|
||||
await (await import("./commands/approval-runs-export.js")).handleApprovalRunsExportCommand(args, runtime);
|
||||
return;
|
||||
}
|
||||
|
||||
const corp = (await import("./helpers.js")).selectCorp(stringOption(args.options.corp));
|
||||
|
||||
const corpCommand = CORP_COMMANDS[area];
|
||||
|
||||
Reference in new issue
Block a user