@lmzhen/dsh-evolution-commands 0.3.2 → 0.3.4

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 CHANGED
@@ -42,7 +42,7 @@ function apply(ctx, rawConfig = {}) {
42
42
  name: "evolution",
43
43
  description: "Self-evolution status and approval controls",
44
44
  recordInput: false,
45
- input: { hint: "pending | approve <id> | reject <id> | curator run|pause|resume|status|report|scope | restore | consolidate <target> <sources...> | skill restore <name> | skills health | learn [request] | maintain | restructure <name> \"<heading>\" <to_file> | replay" },
45
+ input: { hint: "pending | approve <id> | reject <id> | curator run|pause|resume|status|report|scope | restore | consolidate <target> <sources...> | skill restore <name> | skills health | learn [request] | maintain [--timeout ms] | restructure <name> \"<heading>\" <to_file> | replay" },
46
46
  async handler(invocation) {
47
47
  const input = invocation.rawInput?.trim() ?? "";
48
48
  const ok = (text) => ({
@@ -210,7 +210,10 @@ function apply(ctx, rawConfig = {}) {
210
210
  }), enrichment.usageObservedValue, void 0);
211
211
  return ok(`Maintenance facts (0-token preview):\n${facts}`);
212
212
  }
213
- if (input === "maintain") {
213
+ const maintainArgs = /^maintain(?: --timeout (\d+))?\s*$/.exec(input);
214
+ if (maintainArgs) {
215
+ const runTimeoutMs = maintainArgs[1] ? Number(maintainArgs[1]) : config.maintainTimeoutMs ?? 12e4;
216
+ if (!Number.isSafeInteger(runTimeoutMs) || runTimeoutMs <= 0) return err("Invalid --timeout value: expected a positive integer number of milliseconds (e.g. /evolution maintain --timeout 600000).");
214
217
  const cooldownMs = config.maintainCooldownMs ?? 13e4;
215
218
  const sinceLast = Date.now() - lastMaintainAt;
216
219
  if (cooldownMs > 0 && sinceLast < cooldownMs) return ok(`Maintenance cooldown active (${Math.ceil((cooldownMs - sinceLast) / 1e3)}s) — latest scan ${lastMaintainRunId}; re-running now would spend another model call.`);
@@ -225,6 +228,7 @@ function apply(ctx, rawConfig = {}) {
225
228
  subagents,
226
229
  parent: invocation.agent
227
230
  }, {
231
+ timeoutMs: runTimeoutMs,
228
232
  descriptions: () => enrichment.descriptions,
229
233
  supportFiles: () => enrichment.supportFiles,
230
234
  quality: () => enrichment.quality,
@@ -13,6 +13,9 @@ export interface Config {
13
13
  * spending another model call. Default 130s (>= maintain timeout 120s, so
14
14
  * the window also covers in-flight runs); transient (per-process). */
15
15
  maintainCooldownMs?: number | undefined;
16
+ /** Subagent deadline for one maintenance scan (ms). Default 120s; raise on
17
+ * slow providers or very large skill libraries (0.3.3). */
18
+ maintainTimeoutMs?: number | undefined;
16
19
  }
17
20
  export declare function apply(ctx: Context, rawConfig?: Config): void;
18
21
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-commands",
3
3
  "description": "Human commands for the evolution family (community build)",
4
- "version": "0.3.2",
4
+ "version": "0.3.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,8 +33,8 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.3.2",
37
- "@lmzhen/dsh-evolution-maintenance": "^0.3.2"
36
+ "@lmzhen/dsh-evolution-core": "^0.3.4",
37
+ "@lmzhen/dsh-evolution-maintenance": "^0.3.4"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.1",