@lmzhen/dsh-evolution-maintenance 0.3.6 → 0.3.8
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.
- package/lib/index.js +14 -7
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -363,7 +363,7 @@ async function runMaintain(runtime, options = {}) {
|
|
|
363
363
|
const timeoutMs = options.timeoutMs ?? 12e4;
|
|
364
364
|
const agentOptions = { model: options.model ?? "deepseek-v4-pro" };
|
|
365
365
|
if (options.provider) agentOptions.provider = options.provider;
|
|
366
|
-
const
|
|
366
|
+
const runResult = await (await runtime.subagents.start("spawn", {
|
|
367
367
|
label: "dsh-evolution-maintain",
|
|
368
368
|
prompt: [{
|
|
369
369
|
type: "text",
|
|
@@ -423,11 +423,18 @@ async function runMaintain(runtime, options = {}) {
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
})).result
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
426
|
+
})).result;
|
|
427
|
+
const raw = runResult?.structured;
|
|
428
|
+
if (raw === void 0) {
|
|
429
|
+
if (runResult?.stopReason === "aborted") return {
|
|
430
|
+
ok: false,
|
|
431
|
+
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."
|
|
432
|
+
};
|
|
433
|
+
return {
|
|
434
|
+
ok: false,
|
|
435
|
+
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."
|
|
436
|
+
};
|
|
437
|
+
}
|
|
431
438
|
const validated = validateAndNormalizeMaintainPlan(raw, report, existingSignalIds(report));
|
|
432
439
|
if (!validated.ok) return {
|
|
433
440
|
ok: false,
|
|
@@ -446,7 +453,7 @@ async function runMaintain(runtime, options = {}) {
|
|
|
446
453
|
const message = error instanceof Error ? error.message : String(error);
|
|
447
454
|
return {
|
|
448
455
|
ok: false,
|
|
449
|
-
error: name === "AbortError" ? "Maintenance scan was aborted (
|
|
456
|
+
error: name === "AbortError" || /abort/i.test(`${String(name)} ${message}`) ? "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}`
|
|
450
457
|
};
|
|
451
458
|
}
|
|
452
459
|
}
|
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.3.
|
|
4
|
+
"version": "0.3.8",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
37
|
+
"@lmzhen/dsh-evolution-core": "^0.3.8"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|