feat: 原生 Seal 授权续期自愈与本地 SQLite 分歧待办闭环
- 授权自愈: 引入长效会话 Cookie 备份池,支持 Seal 原生协助授权到期与 401 报错时平滑自动换发与静默续期; - 存储升级: 审核报告人工裁决底座迁移至 SQLite (~/.config/seal-use/state/reviews.sqlite),支持历史 JSONL 自动平滑导入与向后兼容双写; - 分歧待办: 新增 report review unreviewed 与 dismiss 命令,收集人机不一致单据并在日常企业命令完成后于 stderr 注入 Agent 动作指引; - 精密频控: 实现 30 天单据时效窗口过滤(陈年单据自动归档)、动态 5 小时滑动窗口频控与 24 小时人工拒审静音抑制协议; - 透明认知: 全面补充 Skill 路由与帮助手册,消除黑盒,透传数据边界与安全红线。
This commit is contained in:
1 parent
5c46c9bcc4
commit
8c9f102931
21 files changed
+1668
-50
No files matched your search
@@ -349,9 +349,27 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
|
||||
|
||||
const corp = (await import("./helpers.js")).selectCorp(stringOption(args.options.corp));
|
||||
|
||||
const maybePromptDivergences = async () => {
|
||||
if (area === "report" && action === "review") return;
|
||||
try {
|
||||
const { countUnreviewedDivergences, shouldPromptDivergence } = await import(
|
||||
"../domains/seal/reports/pipeline/review-store.js"
|
||||
);
|
||||
const count = countUnreviewedDivergences(corp.id, 30);
|
||||
if (count > 0 && shouldPromptDivergence(corp.id)) {
|
||||
console.error(
|
||||
`ℹ️ [review-reminder] 检测到企业「${corp.name}」在近 30 天内有 ${count} 笔本地未整理的审核分歧单据(数据仅保存在本机 SQLite,不上传云端)。\n👉 Agent 动作指引: 动态频控 5 小时内最多提醒一次。请在完成当前主任务后顺便询问用户是否抽空确认;若用户表示暂不处理,请立即执行: seal-use report review dismiss --corp ${corp.id} 静音 24 小时,切勿重复打扰。查看待整理详情: seal-use report review unreviewed --corp ${corp.id}`
|
||||
);
|
||||
}
|
||||
} catch {
|
||||
// 容错降级,不阻断主流程
|
||||
}
|
||||
};
|
||||
|
||||
const corpCommand = CORP_COMMANDS[area];
|
||||
if (corpCommand) {
|
||||
await corpCommand(args, corp);
|
||||
await maybePromptDivergences();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -359,6 +377,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
|
||||
if (clientCommand) {
|
||||
const client = await (await import("../core/http/factory.js")).createSealClient(corp);
|
||||
await clientCommand(args, corp, client);
|
||||
await maybePromptDivergences();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user