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
@@ -0,0 +1,28 @@
|
||||
import { existsSync, readFileSync } from "node:fs"
|
||||
import { homedir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { compareSemVer } from "./semver.js"
|
||||
|
||||
// Keep local version inspection independent of the embedded Skill asset graph.
|
||||
export function getDefaultGlobalSkillDir(): string {
|
||||
return join(homedir(), ".agents", "skills", "seal-use")
|
||||
}
|
||||
|
||||
export function parseSkillVersion(markdown: string): string | undefined {
|
||||
const frontMatter = markdown.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/)?.[1]
|
||||
return frontMatter?.match(/^\s*version:\s*["']?(\d+\.\d+\.\d+(?:[-+][\w.+-]+)?)["']?\s*$/m)?.[1]
|
||||
}
|
||||
|
||||
export function readInstalledSkillVersion(skillFile = join(getDefaultGlobalSkillDir(), "SKILL.md")): string | undefined {
|
||||
try { return parseSkillVersion(readFileSync(skillFile, "utf8")) } catch { return undefined }
|
||||
}
|
||||
|
||||
export function getSkillVersionStatus(cliVersion: string, skillFile = join(getDefaultGlobalSkillDir(), "SKILL.md")) {
|
||||
const installed = existsSync(skillFile)
|
||||
const installedVersion = readInstalledSkillVersion(skillFile) ?? null
|
||||
const cliBaseVersion = cliVersion.match(/^v?(\d+\.\d+\.\d+)/)?.[1] ?? cliVersion
|
||||
const comparison = installedVersion ? compareSemVer(installedVersion, cliBaseVersion) : null
|
||||
const status = !installed ? "missing" : comparison === null ? "unknown" : comparison > 0 ? "skill_newer" : comparison < 0 ? "cli_newer" : "matched"
|
||||
const nextAction = status === "skill_newer" ? "seal-use update" : status === "cli_newer" || status === "missing" || status === "unknown" ? "seal-use skill install" : null
|
||||
return { cliVersion, cliBaseVersion, installedVersion, installed, status, nextAction }
|
||||
}
|
||||
Reference in new issue
Block a user