Refine report data collection to support unlimited runs without 500 cap

This commit is contained in:
gitea committed 2026-10-16 17:36:36 +08:00
1 parent bea6a9cf4e
commit 04915c6ad6
7 files changed
+104 -21

No files matched your search

+16 -6
View File
@@ -95,6 +95,16 @@ export async function handleLocalReportCommand(action: string | undefined, args:
if (!result.validation.valid) throw new CliError("报告校验未通过,未生成渲染产物。请按 validation.issues 修正后重试。", 1);
}
function resolveMaxRuns(args: ParsedArgs): number | undefined {
return (
numberOption(args.options.limit) ??
numberOption(args.options.n) ??
numberOption(args.options.count) ??
numberOption(args.options["max-runs"]) ??
numberOption(args.options.maxRuns)
);
}
/** `seal-use report generate` / `ledger` / `data` — AI 审核报告。 */
export async function handleReportCommand(
action: string | undefined,
@@ -125,7 +135,7 @@ export async function handleReportCommand(
if ((!startDate || !endDate) && !month) {
throw usageError(
"Usage: seal-use report ledger --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD> [--templates <t1,t2...>] [--max-runs <n>] [--out <file.xlsx|csv>] [--corp <corpId>]"
"Usage: seal-use report ledger --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD> [--templates <t1,t2...>] [--limit <n>] [--out <file.xlsx|csv>] [--corp <corpId>]"
);
}
@@ -136,7 +146,7 @@ export async function handleReportCommand(
month,
corp: { id: corp.id, name: corp.name },
templates,
maxRuns: numberOption(args.options["max-runs"]) ?? numberOption(args.options.maxRuns)
maxRuns: resolveMaxRuns(args)
});
}
@@ -186,7 +196,7 @@ export async function handleReportCommand(
if (!ledgerPath && (!startDate || !endDate) && !month) {
throw usageError(
"Usage: seal-use report data (--ledger <台账.xlsx> | --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>) [--templates <t1,t2...>] [--max-runs <n>] [--corp <corpId>]"
"Usage: seal-use report data (--ledger <台账.xlsx> | --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>) [--templates <t1,t2...>] [--limit <n>] [--corp <corpId>]"
);
}
@@ -202,7 +212,7 @@ export async function handleReportCommand(
month,
templates,
ledgerPath,
maxRuns: numberOption(args.options["max-runs"]) ?? numberOption(args.options.maxRuns)
maxRuns: resolveMaxRuns(args)
}
);
printJson(result, outputOptions(args.options));
@@ -225,7 +235,7 @@ export async function handleReportCommand(
if (!ledgerPath && (!startDate || !endDate) && !month) {
throw usageError(
"Usage: seal-use report generate (--ledger <台账.xlsx> | --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>) [--templates <t1,t2...>] [--template <file>] [--report-id <RPT-...>] [--corp <corpId>]"
"Usage: seal-use report generate (--ledger <台账.xlsx> | --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>) [--templates <t1,t2...>] [--limit <n>] [--template <file>] [--report-id <RPT-...>] [--corp <corpId>]"
);
}
@@ -243,7 +253,7 @@ export async function handleReportCommand(
ledgerPath,
templatePath: stringOption(args.options.template),
reportId: stringOption(args.options["report-id"]) ?? stringOption(args.options.reportId),
maxRuns: numberOption(args.options["max-runs"]) ?? numberOption(args.options.maxRuns),
maxRuns: resolveMaxRuns(args),
allowUnreviewed: booleanOption(args.options["allow-unreviewed"]) ?? booleanOption(args.options.force)
}
) as MonthlyReportResult;