@lmzhen/dsh-evolution-maintenance 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +10 -10
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -372,7 +372,7 @@ function formatPlan(validated, runId) {
372
372
  lines.push(`Maintenance scan ${runId}: verdict=${plan.verdict} (${plan.plan.length} recommendations, ${plan.notes.length} notes)`);
373
373
  const noteLines = plan.notes.length === 0 ? [] : ["Notes:", ...plan.notes.map((note) => `- ${sanitizeField(note)}`)];
374
374
  if (plan.verdict === "no_issues") {
375
- lines.push("No drift issues detected. Nothing to do.");
375
+ lines.push("未检测到漂移问题,无需处理。");
376
376
  lines.push(...noteLines);
377
377
  return lines.join("\n");
378
378
  }
@@ -400,7 +400,7 @@ async function runMaintain(runtime, options = {}) {
400
400
  if (!verifyPromptBundle(PROMPT_BUNDLE)) return {
401
401
  ok: false,
402
402
  recommendationCount: 0,
403
- error: "dsh-evolution prompt bundle integrity check failed; refusing to run maintain"
403
+ error: "dsh-evolution 提示词包完整性检查失败;拒绝运行 maintain"
404
404
  };
405
405
  const enrichment = options.enrichment?.();
406
406
  const readFailures = [];
@@ -415,19 +415,19 @@ async function runMaintain(runtime, options = {}) {
415
415
  if (readFailures.length > 0) return {
416
416
  ok: false,
417
417
  recommendationCount: 0,
418
- error: `maintenance scan could not read ${readFailures.length} listed skill(s) (${readFailures.slice(0, 10).join(", ")}${readFailures.length > 10 ? ", …" : ""}) and read no skill at all — the library was NOT audited; fix the unreadable skills (or their directory names) and run the scan again`
418
+ error: `维护扫描无法读取列出的 ${readFailures.length} 个技能(${readFailures.slice(0, 10).join(", ")}${readFailures.length > 10 ? ", …" : ""}),且一个技能都没读到 —— the library was NOT audited; fix the unreadable skills (or their directory names) and run the scan again`
419
419
  };
420
420
  if (runtime.rootExists && !await runtime.rootExists()) return {
421
421
  ok: false,
422
422
  recommendationCount: 0,
423
- error: `maintenance scan found an empty skill library, but the configured skill root does not exist${runtime.skillRoot ? ` (${runtime.skillRoot})` : ""} — point the skillsRoot config at a real directory (a literal \`~\` is not expanded) and run the scan again`
423
+ error: `维护扫描发现技能库为空,但配置的技能根目录不存在${runtime.skillRoot ? ` (${runtime.skillRoot})` : ""} —— point the skillsRoot config at a real directory (a literal \`~\` is not expanded) and run the scan again`
424
424
  };
425
425
  return {
426
426
  ok: true,
427
427
  recommendationCount: 0,
428
428
  runId: options.runId ?? randomUUID(),
429
429
  verdict: "no_issues",
430
- text: "Maintenance scan: empty skill library. Nothing to do."
430
+ text: "维护扫描:技能库为空,无需处理。"
431
431
  };
432
432
  }
433
433
  const { facts, report, signalsVersion, signature } = buildMaintainFacts(snapshots, enrichment?.usageObservedValue, options.redact);
@@ -442,7 +442,7 @@ ${MAINTAIN_OUTPUT_INSTRUCTION}`;
442
442
  if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > MAX_TIMER_DELAY_MS) return {
443
443
  ok: false,
444
444
  recommendationCount: 0,
445
- error: `maintain: --timeout must be a positive integer in ms, at most ${MAX_TIMER_DELAY_MS}; got ${String(timeoutMs)}`
445
+ error: `maintain:--timeout 必须是以毫秒为单位的正整数,最大 ${MAX_TIMER_DELAY_MS};收到 ${String(timeoutMs)}`
446
446
  };
447
447
  const signal = options.signal !== void 0 ? AbortSignal.any([AbortSignal.timeout(timeoutMs), options.signal]) : AbortSignal.timeout(timeoutMs);
448
448
  abortSignal = signal;
@@ -537,19 +537,19 @@ ${MAINTAIN_OUTPUT_INSTRUCTION}`;
537
537
  if (runResult.stopReason === "aborted") return {
538
538
  ok: false,
539
539
  recommendationCount: 0,
540
- error: "Maintenance scan was aborted (the run was cancelled before the subagent produced a plan) — retry when the session is idle; concurrent re-submission cancels the previous scan."
540
+ error: "维护扫描已中止(在子智能体产出计划之前运行被取消):请在会话空闲时重试;并发重交会取消上一次扫描。"
541
541
  };
542
542
  return {
543
543
  ok: false,
544
544
  recommendationCount: 0,
545
- error: "Maintain subagent returned no structured plan (the model did not emit the structured plan, or the run ended without one) — retry; if it repeats, raise --timeout or check the model output shape."
545
+ error: "维护子智能体没有返回结构化计划(模型没有产出结构化计划,或运行在产出前结束):请重试;若反复出现,请提高 --timeout 或检查模型的输出结构。"
546
546
  };
547
547
  }
548
548
  const validated = validateAndNormalizeMaintainPlan(raw, report, existingSignalIds(report));
549
549
  if (!validated.ok) return {
550
550
  ok: false,
551
551
  recommendationCount: 0,
552
- error: `Maintain plan rejected by validator: ${validated.errors.slice(0, 5).join("; ")}`
552
+ error: `维护计划被校验器拒绝:${validated.errors.slice(0, 5).join("; ")}`
553
553
  };
554
554
  const runId = options.runId ?? randomUUID();
555
555
  return {
@@ -576,7 +576,7 @@ ${MAINTAIN_OUTPUT_INSTRUCTION}`;
576
576
  return {
577
577
  ok: false,
578
578
  recommendationCount: 0,
579
- error: abortSignal?.aborted === true || name === "AbortError" || message === "This operation was aborted" ? "Maintenance scan was aborted (cancellation or timeout) before a plan was produced — retry, or raise the timeout (evolution-commands maintainTimeoutMs) on a slow/large library." : `Maintenance scan failed: ${message}`
579
+ error: abortSignal?.aborted === true || name === "AbortError" || message === "This operation was aborted" ? "维护扫描已中止(取消或超时),计划尚未产出 —— 在技能多、库大的场景下,请重试或提高超时(evolution-commands maintainTimeoutMs)。" : `Maintenance scan failed: ${message}`
580
580
  };
581
581
  }
582
582
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-maintenance",
3
3
  "description": "Deterministic maintenance-scan surface: skill-library snapshot assembly, drift signals and mechanical-facts rendering (design 011) (community build)",
4
- "version": "0.23.0",
4
+ "version": "0.25.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,7 +31,7 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.4",
34
- "@lmzhen/dsh-evolution-core": "^0.23.0"
34
+ "@lmzhen/dsh-evolution-core": "^0.25.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/dsh-agent": "^0.2.0-rc.1",