@lmzhen/dsh-evolution-commands 0.3.3 → 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.
Files changed (2) hide show
  1. package/lib/index.js +6 -3
  2. package/package.json +3 -3
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,7 +228,7 @@ function apply(ctx, rawConfig = {}) {
225
228
  subagents,
226
229
  parent: invocation.agent
227
230
  }, {
228
- timeoutMs: config.maintainTimeoutMs ?? 12e4,
231
+ timeoutMs: runTimeoutMs,
229
232
  descriptions: () => enrichment.descriptions,
230
233
  supportFiles: () => enrichment.supportFiles,
231
234
  quality: () => enrichment.quality,
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.3",
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.3",
37
- "@lmzhen/dsh-evolution-maintenance": "^0.3.3"
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",