opencode-swarm 7.164.12 → 7.164.13

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 (97) hide show
  1. package/.opencode/skills/loop/SKILL.md +1 -1
  2. package/.opencode/skills/{plan → swarm-plan}/SKILL.md +1 -1
  3. package/dist/cli/{coder-settlement-yh1q5fr3.js → coder-settlement-em2fgg4p.js} +11 -11
  4. package/dist/cli/{config-doctor-bd4yzmh7.js → config-doctor-1m4mrybp.js} +3 -3
  5. package/dist/cli/{core-y0s1vmyc.js → core-zbzdffha.js} +2 -2
  6. package/dist/cli/{curation-policy-gs1qakn7.js → curation-policy-bqpmry2n.js} +5 -5
  7. package/dist/cli/{curator-drift-1sg9yk2m.js → curator-drift-hbc3w5zj.js} +4 -4
  8. package/dist/cli/curator-llm-factory-j76c96t7.js +70 -0
  9. package/dist/cli/{curator-brqack0j.js → curator-tn3x5j02.js} +36 -36
  10. package/dist/cli/{evidence-summary-service-nqbcvp30.js → evidence-summary-service-7cn9z4sn.js} +16 -16
  11. package/dist/cli/{gate-evidence-9stdtpej.js → gate-evidence-deyzt3hz.js} +7 -7
  12. package/dist/cli/guardrail-explain-4k2pqj46.js +71 -0
  13. package/dist/cli/{guardrail-log-sf39x00b.js → guardrail-log-cnbv6vry.js} +8 -8
  14. package/dist/cli/{guardrail-reset-9wr6a60s.js → guardrail-reset-xhh61cax.js} +36 -36
  15. package/dist/cli/{hive-promoter-bqtj8261.js → hive-promoter-1m8zpz4d.js} +36 -36
  16. package/dist/cli/{index-vw66q1rw.js → index-0mwjamha.js} +1 -1
  17. package/dist/cli/{index-d7j3n5ra.js → index-3c0z1jnc.js} +41 -39
  18. package/dist/cli/{index-wasdrhev.js → index-4fhcbe14.js} +4 -4
  19. package/dist/cli/{index-r2p0pgst.js → index-5ebgzb5a.js} +3 -3
  20. package/dist/cli/{index-ebce775n.js → index-5h60rtaa.js} +2 -2
  21. package/dist/cli/{index-yvqg6kn5.js → index-6m24v15v.js} +2 -2
  22. package/dist/cli/{index-sphahrmq.js → index-6rx1rdaq.js} +1 -1
  23. package/dist/cli/{index-ad9064j9.js → index-74514zkh.js} +4 -4
  24. package/dist/cli/{index-hb7bh4r2.js → index-7f2r3ysr.js} +30 -6
  25. package/dist/cli/{index-hg09xemc.js → index-7z9zqxqt.js} +4 -4
  26. package/dist/cli/{index-xxfk62zd.js → index-8bdk7124.js} +2 -2
  27. package/dist/cli/{index-50j914b5.js → index-a0d4fp6r.js} +29 -7
  28. package/dist/cli/{index-4mjmnysc.js → index-ajknebrc.js} +1 -1
  29. package/dist/cli/{index-qqq04n70.js → index-anxs69ad.js} +1 -1
  30. package/dist/cli/{index-cgewrpw5.js → index-asey3tb3.js} +4 -3
  31. package/dist/cli/{index-03enxdaq.js → index-bvkd7at6.js} +1 -1
  32. package/dist/cli/{index-5wc5pbzc.js → index-c98rjgjq.js} +682 -349
  33. package/dist/cli/{index-qgajv9rd.js → index-d224mhr9.js} +3 -3
  34. package/dist/cli/{index-ztm0q26v.js → index-dh5th4jn.js} +1 -1
  35. package/dist/cli/{index-c45662wc.js → index-e45htt92.js} +1 -1
  36. package/dist/cli/{index-hvz4ad2t.js → index-f36hy1x4.js} +1 -1
  37. package/dist/cli/{index-m8xrbdmn.js → index-f8jdar6q.js} +2 -2
  38. package/dist/cli/{index-r69gzes2.js → index-fnyw5rzg.js} +7 -7
  39. package/dist/cli/{index-kxv193aq.js → index-g11h1qpk.js} +5 -5
  40. package/dist/cli/{index-40twgsyh.js → index-g9weyhq6.js} +2 -2
  41. package/dist/cli/{index-888pq4xx.js → index-grn6tkbt.js} +7 -7
  42. package/dist/cli/{index-ewv8qa8q.js → index-gy0nyfbw.js} +2 -2
  43. package/dist/cli/{index-8vw2pjgr.js → index-hhzzyjm3.js} +6 -6
  44. package/dist/cli/{index-eed0gkv6.js → index-j2svfhzk.js} +2 -2
  45. package/dist/cli/{index-2bhz5k91.js → index-jre6tm3v.js} +2 -2
  46. package/dist/cli/{index-k0s8n6m5.js → index-mpf1tvwf.js} +11 -11
  47. package/dist/cli/{index-4vb56w2k.js → index-ndjjvxzz.js} +4 -4
  48. package/dist/cli/{index-d3mpxsmy.js → index-ptsqnxwd.js} +7 -7
  49. package/dist/cli/{index-0byep4pe.js → index-qtxevgdx.js} +8 -8
  50. package/dist/cli/{index-wknpkfm8.js → index-s3k7xbqd.js} +7 -7
  51. package/dist/cli/{index-x39hjdf1.js → index-tqw8w2n5.js} +1 -1
  52. package/dist/cli/{index-es64amqt.js → index-w6988bbc.js} +1 -1
  53. package/dist/cli/{index-mee9maf5.js → index-xwbn7c8m.js} +2 -2
  54. package/dist/cli/{index-3fnym6ac.js → index-y5hfk7ya.js} +4 -4
  55. package/dist/cli/{index-b25t91a3.js → index-zb6gdym8.js} +2 -2
  56. package/dist/cli/index.js +146 -67
  57. package/dist/cli/{knowledge-escalator-01vva51d.js → knowledge-escalator-3fax9y3s.js} +13 -13
  58. package/dist/cli/{knowledge-events-dpfwh1hs.js → knowledge-events-9cpdyhmb.js} +11 -11
  59. package/dist/cli/{knowledge-link-2rvp966j.js → knowledge-link-dgvbqjqg.js} +4 -4
  60. package/dist/cli/{knowledge-store-aw58ae7b.js → knowledge-store-y35rka0p.js} +5 -5
  61. package/dist/cli/{knowledge-validator-yhd31ryf.js → knowledge-validator-fd761gpx.js} +7 -7
  62. package/dist/cli/{model-preflight-288nsgpw.js → model-preflight-3s1c0zpc.js} +1 -1
  63. package/dist/cli/{pending-delegations-fjetcz8e.js → pending-delegations-t3y19j3n.js} +11 -11
  64. package/dist/cli/{pr-subscriptions-cwwtfs8w.js → pr-subscriptions-00zp69mt.js} +11 -11
  65. package/dist/cli/{pr-workflow-gate-5xwtg1k2.js → pr-workflow-gate-2h0j8c92.js} +36 -36
  66. package/dist/cli/{runner-mb51twxt.js → runner-0e3bjeev.js} +5 -5
  67. package/dist/cli/{scan-cursor-j11qwf0v.js → scan-cursor-wppe2gxw.js} +6 -6
  68. package/dist/cli/{schema-0xp3bde3.js → schema-sec49ppy.js} +2 -2
  69. package/dist/cli/{scope-persistence-brrk806y.js → scope-persistence-59eyqaz4.js} +15 -15
  70. package/dist/cli/{skill-generator-j8qzmet9.js → skill-generator-56rbmpj7.js} +15 -15
  71. package/dist/cli/{snapshot-coordination-init-h0xmtftq.js → snapshot-coordination-init-dnkdc7gx.js} +36 -36
  72. package/dist/cli/{telemetry-m84ap0pp.js → telemetry-a1yvjerj.js} +1 -1
  73. package/dist/cli/{worktree-collision-ownership-j9zykj18.js → worktree-collision-ownership-fj9n4mhk.js} +12 -12
  74. package/dist/cli/{worktree-isolation-jd39xz6h.js → worktree-isolation-vd1s86ya.js} +36 -36
  75. package/dist/commands/benchmark.d.ts +5 -1
  76. package/dist/commands/registry.d.ts +34 -43
  77. package/dist/commands/turbo.d.ts +1 -1
  78. package/dist/config/bundled-skills.d.ts +4 -3
  79. package/dist/config/constants.d.ts +13 -0
  80. package/dist/hooks/extractors.d.ts +9 -0
  81. package/dist/hooks/non-architect-advisory.d.ts +18 -0
  82. package/dist/hooks/repo-graph-injection.d.ts +16 -0
  83. package/dist/index.js +73 -71
  84. package/dist/services/decision-drift-analyzer.d.ts +7 -0
  85. package/dist/services/handoff-service.d.ts +10 -0
  86. package/dist/services/status-service.d.ts +27 -0
  87. package/dist/state.d.ts +8 -0
  88. package/dist/tools/repo-graph/builder.d.ts +1 -25
  89. package/dist/tools/repo-graph/cache.d.ts +5 -1
  90. package/dist/tools/repo-graph/fallback-scanner.d.ts +71 -0
  91. package/dist/tools/repo-graph/indexed-storage.d.ts +11 -0
  92. package/dist/tools/repo-graph/storage.d.ts +7 -0
  93. package/dist/utils/context-decisions.d.ts +77 -0
  94. package/dist/utils/sanitize-display.d.ts +7 -0
  95. package/package.json +3 -2
  96. package/dist/cli/curator-llm-factory-dtsjc3zf.js +0 -70
  97. package/dist/cli/guardrail-explain-3ff1z3fm.js +0 -71
package/dist/cli/index.js CHANGED
@@ -5,76 +5,78 @@ import {
5
5
  VALID_COMMANDS,
6
6
  VERSION_PINNED_LEAF,
7
7
  discoverVersionPinnedCachePaths,
8
+ formatCommandNotFound,
9
+ getHostConfigDir,
8
10
  getPluginCachePaths,
9
- getPluginConfigDir,
10
11
  getPluginLockFilePaths,
12
+ isCommandFailure,
11
13
  readCachePackageVersion,
12
14
  resolveCommand,
13
15
  safeRealpathSync
14
- } from "./index-5wc5pbzc.js";
16
+ } from "./index-c98rjgjq.js";
15
17
  import"./index-8d90gzaz.js";
16
- import"./index-hvz4ad2t.js";
17
- import"./index-wasdrhev.js";
18
- import"./index-b25t91a3.js";
19
- import"./index-k0s8n6m5.js";
20
- import"./index-x39hjdf1.js";
18
+ import"./index-f36hy1x4.js";
19
+ import"./index-4fhcbe14.js";
20
+ import"./index-zb6gdym8.js";
21
+ import"./index-mpf1tvwf.js";
22
+ import"./index-tqw8w2n5.js";
21
23
  import"./index-txdagbh7.js";
22
24
  import"./index-cw912re7.js";
23
- import"./index-hb7bh4r2.js";
24
- import"./index-kxv193aq.js";
25
- import"./index-40twgsyh.js";
25
+ import"./index-7f2r3ysr.js";
26
+ import"./index-g11h1qpk.js";
27
+ import"./index-g9weyhq6.js";
26
28
  import"./index-70ha9e09.js";
27
- import"./index-ztm0q26v.js";
29
+ import"./index-dh5th4jn.js";
28
30
  import"./index-9ss2m4rs.js";
29
- import"./index-d3mpxsmy.js";
31
+ import"./index-ptsqnxwd.js";
30
32
  import"./index-zsrtt42s.js";
31
- import"./index-r69gzes2.js";
33
+ import"./index-fnyw5rzg.js";
32
34
  import"./index-6chhqq2n.js";
33
- import"./index-xxfk62zd.js";
35
+ import"./index-8bdk7124.js";
34
36
  import"./index-b43rt5ph.js";
35
37
  import"./index-q7sjgr1y.js";
36
- import"./index-ad9064j9.js";
37
- import"./index-ebce775n.js";
38
- import"./index-8vw2pjgr.js";
39
- import"./index-0byep4pe.js";
40
- import"./index-qqq04n70.js";
38
+ import"./index-74514zkh.js";
39
+ import"./index-5h60rtaa.js";
40
+ import"./index-hhzzyjm3.js";
41
+ import"./index-qtxevgdx.js";
42
+ import"./index-anxs69ad.js";
41
43
  import"./index-z6xqpmqg.js";
42
44
  import"./index-p612v1mv.js";
43
- import"./index-hg09xemc.js";
44
- import"./index-4mjmnysc.js";
45
+ import"./index-7z9zqxqt.js";
46
+ import"./index-ajknebrc.js";
45
47
  import"./index-rtry5xyf.js";
46
- import"./index-qgajv9rd.js";
48
+ import"./index-d224mhr9.js";
47
49
  import"./index-3qf1vxtb.js";
48
50
  import"./index-n832052r.js";
49
- import"./index-wknpkfm8.js";
50
- import"./index-4vb56w2k.js";
51
- import"./index-mee9maf5.js";
51
+ import"./index-s3k7xbqd.js";
52
+ import"./index-ndjjvxzz.js";
53
+ import"./index-xwbn7c8m.js";
52
54
  import"./index-556ja8an.js";
53
- import"./index-yvqg6kn5.js";
54
- import"./index-c45662wc.js";
55
- import"./index-es64amqt.js";
55
+ import"./index-6m24v15v.js";
56
+ import"./index-e45htt92.js";
57
+ import"./index-w6988bbc.js";
56
58
  import"./index-ry16d01s.js";
57
59
  import"./index-n4fzmqz8.js";
58
- import"./index-eed0gkv6.js";
59
- import"./index-888pq4xx.js";
60
+ import"./index-j2svfhzk.js";
61
+ import"./index-grn6tkbt.js";
60
62
  import"./index-ae75rja9.js";
61
- import"./index-sphahrmq.js";
63
+ import"./index-6rx1rdaq.js";
62
64
  import"./index-7qefgq4j.js";
63
- import"./index-2bhz5k91.js";
64
- import"./index-ewv8qa8q.js";
65
- import"./index-r2p0pgst.js";
65
+ import"./index-jre6tm3v.js";
66
+ import"./index-gy0nyfbw.js";
67
+ import"./index-5ebgzb5a.js";
66
68
  import"./index-7g4c7s5r.js";
67
- import"./index-vw66q1rw.js";
69
+ import"./index-0mwjamha.js";
68
70
  import"./index-9e6fdz2h.js";
69
71
  import"./index-4rhhvd1a.js";
70
72
  import {
71
73
  init_package,
72
74
  package_default
73
- } from "./index-cgewrpw5.js";
75
+ } from "./index-asey3tb3.js";
74
76
  import {
75
77
  DEFAULT_AGENT_CONFIGS,
76
78
  init_constants
77
- } from "./index-50j914b5.js";
79
+ } from "./index-a0d4fp6r.js";
78
80
  import"./index-zjygnfay.js";
79
81
  import"./index-bk5tah7q.js";
80
82
  import"./index-bpmtbmy9.js";
@@ -98,7 +100,7 @@ var CONFIG_SCHEMA_REF = `https://unpkg.com/opencode-swarm@${package_default.vers
98
100
  // src/cli/index.ts
99
101
  var { version } = package_default;
100
102
  var PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
101
- var CONFIG_DIR = getPluginConfigDir();
103
+ var CONFIG_DIR = getHostConfigDir();
102
104
  var OPENCODE_CONFIG_PATH = path.join(CONFIG_DIR, "opencode.json");
103
105
  var PLUGIN_CONFIG_PATH = path.join(CONFIG_DIR, "opencode-swarm.json");
104
106
  var PROMPTS_DIR = path.join(CONFIG_DIR, "opencode-swarm");
@@ -214,42 +216,88 @@ function saveJson(filepath, data) {
214
216
  fs.writeFileSync(filepath, `${JSON.stringify(data, null, 2)}
215
217
  `, "utf-8");
216
218
  }
219
+ function stableJsonStringify(value) {
220
+ return JSON.stringify(sortKeysDeep(value));
221
+ }
222
+ function sortKeysDeep(value) {
223
+ if (Array.isArray(value)) {
224
+ return value.map(sortKeysDeep);
225
+ }
226
+ if (value && typeof value === "object") {
227
+ const record = value;
228
+ const sorted = {};
229
+ for (const key of Object.keys(record).sort()) {
230
+ sorted[key] = sortKeysDeep(record[key]);
231
+ }
232
+ return sorted;
233
+ }
234
+ return value;
235
+ }
217
236
  async function install() {
218
237
  console.log(`\uD83D\uDC1D Installing OpenCode Swarm...
219
238
  `);
220
239
  ensureDir(CONFIG_DIR);
221
240
  ensureDir(PROMPTS_DIR);
222
241
  const LEGACY_CONFIG_PATH = path.join(CONFIG_DIR, "config.json");
223
- let opencodeConfig = loadJson(OPENCODE_CONFIG_PATH);
224
- if (!opencodeConfig) {
242
+ const configExisted = fs.existsSync(OPENCODE_CONFIG_PATH);
243
+ const originalConfigRaw = configExisted ? fs.readFileSync(OPENCODE_CONFIG_PATH, "utf-8") : null;
244
+ const originalConfig = loadJson(OPENCODE_CONFIG_PATH);
245
+ let opencodeConfig;
246
+ if (originalConfig) {
247
+ opencodeConfig = structuredClone(originalConfig);
248
+ } else {
225
249
  const legacyConfig = loadJson(LEGACY_CONFIG_PATH);
226
250
  if (legacyConfig) {
227
251
  console.log("\u26A0 Migrating existing config from config.json to opencode.json...");
228
- opencodeConfig = legacyConfig;
252
+ opencodeConfig = structuredClone(legacyConfig);
229
253
  } else {
254
+ if (configExisted) {
255
+ console.warn("\u26A0 opencode.json exists but could not be parsed as JSON. " + "Starting from a fresh config; the original file is preserved in the backup written by this install.");
256
+ }
230
257
  opencodeConfig = {};
231
258
  }
232
259
  }
233
- if (!opencodeConfig.plugin) {
260
+ if (!Array.isArray(opencodeConfig.plugin)) {
261
+ if (opencodeConfig.plugin) {
262
+ console.warn(`\u26A0 opencode.json "plugin" field has an unexpected type (${typeof opencodeConfig.plugin}); replacing it with a plugin array.`);
263
+ }
234
264
  opencodeConfig.plugin = [];
235
265
  }
236
266
  const pluginName = "opencode-swarm";
237
267
  opencodeConfig.plugin = opencodeConfig.plugin.filter((p) => p !== pluginName && !p.startsWith(`${pluginName}@`));
238
268
  opencodeConfig.plugin.push(pluginName);
239
- if (!opencodeConfig.agent) {
269
+ const agentIsRecord = typeof opencodeConfig.agent === "object" && opencodeConfig.agent !== null && !Array.isArray(opencodeConfig.agent);
270
+ if (!agentIsRecord) {
271
+ if (opencodeConfig.agent) {
272
+ console.warn(`\u26A0 opencode.json "agent" field has an unexpected type (${Array.isArray(opencodeConfig.agent) ? "array" : typeof opencodeConfig.agent}); replacing it with agent overrides.`);
273
+ }
240
274
  opencodeConfig.agent = {};
241
275
  }
242
- opencodeConfig.agent.explore = {
243
- ...typeof opencodeConfig.agent.explore === "object" && opencodeConfig.agent.explore !== null ? opencodeConfig.agent.explore : {},
244
- disable: true
245
- };
246
- opencodeConfig.agent.general = {
247
- ...typeof opencodeConfig.agent.general === "object" && opencodeConfig.agent.general !== null ? opencodeConfig.agent.general : {},
248
- disable: true
249
- };
250
- saveJson(OPENCODE_CONFIG_PATH, opencodeConfig);
251
- console.log("\u2713 Added opencode-swarm to OpenCode plugins");
252
- console.log("\u2713 Disabled default OpenCode agents (explore, general)");
276
+ const agentRecord = opencodeConfig.agent;
277
+ for (const builtinAgent of ["explore", "general"]) {
278
+ const existing = agentRecord[builtinAgent];
279
+ const existingRecord = typeof existing === "object" && existing !== null && !Array.isArray(existing) ? existing : null;
280
+ if (existingRecord && existingRecord.disable !== undefined) {
281
+ continue;
282
+ }
283
+ agentRecord[builtinAgent] = {
284
+ ...existingRecord ?? {},
285
+ disable: true
286
+ };
287
+ }
288
+ const semanticallyChanged = !originalConfig || stableJsonStringify(opencodeConfig) !== stableJsonStringify(originalConfig);
289
+ if (semanticallyChanged) {
290
+ if (configExisted && originalConfigRaw !== null) {
291
+ const backupPath = path.join(CONFIG_DIR, "opencode.swarm-install-backup.json");
292
+ fs.writeFileSync(backupPath, originalConfigRaw, "utf-8");
293
+ console.log(`\u2713 Backed up existing config to ${path.basename(backupPath)}`);
294
+ }
295
+ saveJson(OPENCODE_CONFIG_PATH, opencodeConfig);
296
+ console.log("\u2713 Added opencode-swarm to OpenCode plugins");
297
+ console.log("\u2713 Disabled default OpenCode agents (explore, general)");
298
+ } else {
299
+ console.log("\u2713 OpenCode config already up to date (no rewrite)");
300
+ }
253
301
  const evicted = evictPluginCaches();
254
302
  if (evicted.cleared.length > 0) {
255
303
  console.log(`\u2713 Cleared opencode plugin cache (next start will fetch latest): ${evicted.cleared.join(", ")}`);
@@ -270,7 +318,8 @@ async function install() {
270
318
  const defaultConfig = {
271
319
  $schema: CONFIG_SCHEMA_REF,
272
320
  agents: { ...DEFAULT_AGENT_CONFIGS },
273
- max_iterations: 5
321
+ max_iterations: 5,
322
+ auto_select_architect: true
274
323
  };
275
324
  saveJson(PLUGIN_CONFIG_PATH, defaultConfig);
276
325
  console.log("\u2713 Created default plugin config at:", PLUGIN_CONFIG_PATH);
@@ -423,7 +472,14 @@ async function uninstall() {
423
472
  return 0;
424
473
  }
425
474
  }
426
- if (!opencodeConfig.plugin || opencodeConfig.plugin.length === 0) {
475
+ if (!Array.isArray(opencodeConfig.plugin)) {
476
+ if (opencodeConfig.plugin) {
477
+ console.warn('\u26A0 opencode.json "plugin" field has an unexpected type (expected array); refusing to modify it.');
478
+ }
479
+ console.log("\u26A0 opencode-swarm is not installed (no plugins configured).");
480
+ return 0;
481
+ }
482
+ if (opencodeConfig.plugin.length === 0) {
427
483
  console.log("\u26A0 opencode-swarm is not installed (no plugins configured).");
428
484
  return 0;
429
485
  }
@@ -434,7 +490,7 @@ async function uninstall() {
434
490
  return 0;
435
491
  }
436
492
  opencodeConfig.plugin = filteredPlugins;
437
- if (opencodeConfig.agent) {
493
+ if (typeof opencodeConfig.agent === "object" && opencodeConfig.agent !== null && !Array.isArray(opencodeConfig.agent)) {
438
494
  delete opencodeConfig.agent.explore;
439
495
  delete opencodeConfig.agent.general;
440
496
  if (Object.keys(opencodeConfig.agent).length === 0) {
@@ -466,6 +522,17 @@ async function uninstall() {
466
522
  cleaned = true;
467
523
  }
468
524
  }
525
+ const backupPath = path.join(CONFIG_DIR, "opencode.swarm-install-backup.json");
526
+ if (fs.existsSync(backupPath)) {
527
+ const canonical = safeRealpathSync(backupPath, backupPath);
528
+ if (canonical === null || path.basename(canonical) !== "opencode.swarm-install-backup.json" || path.basename(path.dirname(canonical)) !== path.basename(CONFIG_DIR)) {
529
+ console.log(`\u2717 Refused to remove install backup (failed safety check): ${canonical ?? backupPath}`);
530
+ } else {
531
+ fs.unlinkSync(canonical);
532
+ console.log(`\u2713 Removed install backup: ${canonical}`);
533
+ cleaned = true;
534
+ }
535
+ }
469
536
  if (!cleaned) {
470
537
  console.log("\u2713 No config files to clean up");
471
538
  }
@@ -569,10 +636,12 @@ Valid commands: ${VALID_COMMANDS.join(", ")}`);
569
636
  }
570
637
  const resolved = resolveCommand(args);
571
638
  if (!resolved) {
572
- console.error(`Unknown command: ${args[0]}
573
- Valid commands: ${VALID_COMMANDS.join(", ")}`);
639
+ console.error(formatCommandNotFound(args));
574
640
  return 1;
575
641
  }
642
+ if (resolved.warning) {
643
+ console.error(resolved.warning);
644
+ }
576
645
  let policy = resolved.entry.toolPolicy;
577
646
  if (!policy) {
578
647
  const aliasOf = resolved.entry.aliasOf;
@@ -585,14 +654,24 @@ Valid commands: ${VALID_COMMANDS.join(", ")}`);
585
654
  console.error(`Refusing to run human-only command '${resolved.key}' from a non-interactive shell. ` + "Run it yourself in a terminal, or set SWARM_ALLOW_HUMAN_ONLY_CLI=1 if this is an explicitly approved automation.");
586
655
  return 1;
587
656
  }
588
- const result = await resolved.entry.handler({
589
- directory: cwd,
590
- args: resolved.remainingArgs,
591
- sessionID: "",
592
- agents: {},
593
- source: "cli",
594
- packageRoot: PACKAGE_ROOT
595
- });
657
+ let result;
658
+ try {
659
+ result = await resolved.entry.handler({
660
+ directory: cwd,
661
+ args: resolved.remainingArgs,
662
+ sessionID: "",
663
+ agents: {},
664
+ source: "cli",
665
+ packageRoot: PACKAGE_ROOT
666
+ });
667
+ } catch (error) {
668
+ console.error(`Error executing command '${resolved.key}': ${error instanceof Error ? error.message : String(error)}`);
669
+ return 1;
670
+ }
671
+ if (isCommandFailure(result)) {
672
+ console.log(result.text);
673
+ return result.exitCode ?? 1;
674
+ }
596
675
  console.log(result);
597
676
  return 0;
598
677
  }
@@ -9,28 +9,28 @@ import {
9
9
  maybeEscalateOnViolation,
10
10
  maybeQuarantineOnContradiction,
11
11
  readRecentEscalations
12
- } from "./index-kxv193aq.js";
13
- import"./index-0byep4pe.js";
14
- import"./index-qqq04n70.js";
12
+ } from "./index-g11h1qpk.js";
13
+ import"./index-qtxevgdx.js";
14
+ import"./index-anxs69ad.js";
15
15
  import"./index-z6xqpmqg.js";
16
16
  import"./index-p612v1mv.js";
17
- import"./index-qgajv9rd.js";
17
+ import"./index-d224mhr9.js";
18
18
  import"./index-3qf1vxtb.js";
19
19
  import"./index-n832052r.js";
20
- import"./index-eed0gkv6.js";
21
- import"./index-888pq4xx.js";
20
+ import"./index-j2svfhzk.js";
21
+ import"./index-grn6tkbt.js";
22
22
  import"./index-ae75rja9.js";
23
- import"./index-sphahrmq.js";
23
+ import"./index-6rx1rdaq.js";
24
24
  import"./index-7qefgq4j.js";
25
- import"./index-2bhz5k91.js";
26
- import"./index-ewv8qa8q.js";
27
- import"./index-r2p0pgst.js";
25
+ import"./index-jre6tm3v.js";
26
+ import"./index-gy0nyfbw.js";
27
+ import"./index-5ebgzb5a.js";
28
28
  import"./index-7g4c7s5r.js";
29
- import"./index-vw66q1rw.js";
29
+ import"./index-0mwjamha.js";
30
30
  import"./index-9e6fdz2h.js";
31
31
  import"./index-4rhhvd1a.js";
32
- import"./index-cgewrpw5.js";
33
- import"./index-50j914b5.js";
32
+ import"./index-asey3tb3.js";
33
+ import"./index-a0d4fp6r.js";
34
34
  import"./index-zjygnfay.js";
35
35
  import"./index-bk5tah7q.js";
36
36
  import"./index-bpmtbmy9.js";
@@ -29,26 +29,26 @@ import {
29
29
  resolveKnowledgeCounterBaselinePath,
30
30
  resolveKnowledgeEventsPath,
31
31
  resolveLegacyApplicationLogPath
32
- } from "./index-0byep4pe.js";
33
- import"./index-qqq04n70.js";
32
+ } from "./index-qtxevgdx.js";
33
+ import"./index-anxs69ad.js";
34
34
  import"./index-z6xqpmqg.js";
35
35
  import"./index-p612v1mv.js";
36
- import"./index-qgajv9rd.js";
36
+ import"./index-d224mhr9.js";
37
37
  import"./index-3qf1vxtb.js";
38
38
  import"./index-n832052r.js";
39
- import"./index-eed0gkv6.js";
39
+ import"./index-j2svfhzk.js";
40
40
  import"./index-ae75rja9.js";
41
- import"./index-sphahrmq.js";
41
+ import"./index-6rx1rdaq.js";
42
42
  import"./index-7qefgq4j.js";
43
- import"./index-2bhz5k91.js";
44
- import"./index-ewv8qa8q.js";
45
- import"./index-r2p0pgst.js";
43
+ import"./index-jre6tm3v.js";
44
+ import"./index-gy0nyfbw.js";
45
+ import"./index-5ebgzb5a.js";
46
46
  import"./index-7g4c7s5r.js";
47
- import"./index-vw66q1rw.js";
47
+ import"./index-0mwjamha.js";
48
48
  import"./index-9e6fdz2h.js";
49
49
  import"./index-4rhhvd1a.js";
50
- import"./index-cgewrpw5.js";
51
- import"./index-50j914b5.js";
50
+ import"./index-asey3tb3.js";
51
+ import"./index-a0d4fp6r.js";
52
52
  import"./index-zjygnfay.js";
53
53
  import"./index-bk5tah7q.js";
54
54
  import"./index-bpmtbmy9.js";
@@ -12,11 +12,11 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-sphahrmq.js";
15
+ } from "./index-6rx1rdaq.js";
16
16
  import"./index-7qefgq4j.js";
17
- import"./index-2bhz5k91.js";
18
- import"./index-ewv8qa8q.js";
19
- import"./index-r2p0pgst.js";
17
+ import"./index-jre6tm3v.js";
18
+ import"./index-gy0nyfbw.js";
19
+ import"./index-5ebgzb5a.js";
20
20
  import"./index-7g4c7s5r.js";
21
21
  import"./index-bpmtbmy9.js";
22
22
  import"./index-zgwm4ryv.js";
@@ -42,15 +42,15 @@ import {
42
42
  transactKnowledge,
43
43
  transactKnowledgeWithCas,
44
44
  wordBigrams
45
- } from "./index-888pq4xx.js";
45
+ } from "./index-grn6tkbt.js";
46
46
  import {
47
47
  resolveHiveDataDir
48
48
  } from "./index-ae75rja9.js";
49
- import"./index-sphahrmq.js";
49
+ import"./index-6rx1rdaq.js";
50
50
  import"./index-7qefgq4j.js";
51
- import"./index-2bhz5k91.js";
52
- import"./index-ewv8qa8q.js";
53
- import"./index-r2p0pgst.js";
51
+ import"./index-jre6tm3v.js";
52
+ import"./index-gy0nyfbw.js";
53
+ import"./index-5ebgzb5a.js";
54
54
  import"./index-7g4c7s5r.js";
55
55
  import"./index-bk5tah7q.js";
56
56
  import"./index-bpmtbmy9.js";
@@ -23,16 +23,16 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-hg09xemc.js";
27
- import"./index-4mjmnysc.js";
26
+ } from "./index-7z9zqxqt.js";
27
+ import"./index-ajknebrc.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-888pq4xx.js";
29
+ import"./index-grn6tkbt.js";
30
30
  import"./index-ae75rja9.js";
31
- import"./index-sphahrmq.js";
31
+ import"./index-6rx1rdaq.js";
32
32
  import"./index-7qefgq4j.js";
33
- import"./index-2bhz5k91.js";
34
- import"./index-ewv8qa8q.js";
35
- import"./index-r2p0pgst.js";
33
+ import"./index-jre6tm3v.js";
34
+ import"./index-gy0nyfbw.js";
35
+ import"./index-5ebgzb5a.js";
36
36
  import"./index-7g4c7s5r.js";
37
37
  import"./index-bk5tah7q.js";
38
38
  import"./index-bpmtbmy9.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  DEFAULT_MODELS,
4
4
  init_constants
5
- } from "./index-50j914b5.js";
5
+ } from "./index-a0d4fp6r.js";
6
6
  import"./index-zjygnfay.js";
7
7
  import"./index-a76rekgs.js";
8
8
 
@@ -66,23 +66,23 @@ import {
66
66
  sweepStaleDelegations,
67
67
  updateCoderSettlement,
68
68
  writeDelegationFallback
69
- } from "./index-8vw2pjgr.js";
70
- import"./index-qqq04n70.js";
69
+ } from "./index-hhzzyjm3.js";
70
+ import"./index-anxs69ad.js";
71
71
  import"./index-z6xqpmqg.js";
72
72
  import"./index-p612v1mv.js";
73
- import"./index-yvqg6kn5.js";
74
- import"./index-c45662wc.js";
75
- import"./index-es64amqt.js";
73
+ import"./index-6m24v15v.js";
74
+ import"./index-e45htt92.js";
75
+ import"./index-w6988bbc.js";
76
76
  import"./index-ry16d01s.js";
77
77
  import"./index-n4fzmqz8.js";
78
- import"./index-eed0gkv6.js";
79
- import"./index-888pq4xx.js";
78
+ import"./index-j2svfhzk.js";
79
+ import"./index-grn6tkbt.js";
80
80
  import"./index-ae75rja9.js";
81
- import"./index-sphahrmq.js";
81
+ import"./index-6rx1rdaq.js";
82
82
  import"./index-7qefgq4j.js";
83
- import"./index-2bhz5k91.js";
84
- import"./index-ewv8qa8q.js";
85
- import"./index-r2p0pgst.js";
83
+ import"./index-jre6tm3v.js";
84
+ import"./index-gy0nyfbw.js";
85
+ import"./index-5ebgzb5a.js";
86
86
  import"./index-7g4c7s5r.js";
87
87
  import"./index-zjygnfay.js";
88
88
  import"./index-bk5tah7q.js";
@@ -14,23 +14,23 @@ import {
14
14
  sweepStale,
15
15
  unsubscribe,
16
16
  updateSnapshot
17
- } from "./index-d3mpxsmy.js";
18
- import"./index-qqq04n70.js";
17
+ } from "./index-ptsqnxwd.js";
18
+ import"./index-anxs69ad.js";
19
19
  import"./index-z6xqpmqg.js";
20
20
  import"./index-p612v1mv.js";
21
- import"./index-yvqg6kn5.js";
22
- import"./index-c45662wc.js";
23
- import"./index-es64amqt.js";
21
+ import"./index-6m24v15v.js";
22
+ import"./index-e45htt92.js";
23
+ import"./index-w6988bbc.js";
24
24
  import"./index-ry16d01s.js";
25
25
  import"./index-n4fzmqz8.js";
26
- import"./index-eed0gkv6.js";
27
- import"./index-888pq4xx.js";
26
+ import"./index-j2svfhzk.js";
27
+ import"./index-grn6tkbt.js";
28
28
  import"./index-ae75rja9.js";
29
- import"./index-sphahrmq.js";
29
+ import"./index-6rx1rdaq.js";
30
30
  import"./index-7qefgq4j.js";
31
- import"./index-2bhz5k91.js";
32
- import"./index-ewv8qa8q.js";
33
- import"./index-r2p0pgst.js";
31
+ import"./index-jre6tm3v.js";
32
+ import"./index-gy0nyfbw.js";
33
+ import"./index-5ebgzb5a.js";
34
34
  import"./index-7g4c7s5r.js";
35
35
  import"./index-zjygnfay.js";
36
36
  import"./index-bk5tah7q.js";
@@ -78,66 +78,66 @@ import {
78
78
  withPrWorkflowCheckoutMutationLock,
79
79
  withPrWorkflowCheckoutPreparationLock,
80
80
  writePrWorkflowAtomicJson
81
- } from "./index-5wc5pbzc.js";
81
+ } from "./index-c98rjgjq.js";
82
82
  import"./index-8d90gzaz.js";
83
- import"./index-hvz4ad2t.js";
84
- import"./index-wasdrhev.js";
85
- import"./index-b25t91a3.js";
86
- import"./index-k0s8n6m5.js";
87
- import"./index-x39hjdf1.js";
83
+ import"./index-f36hy1x4.js";
84
+ import"./index-4fhcbe14.js";
85
+ import"./index-zb6gdym8.js";
86
+ import"./index-mpf1tvwf.js";
87
+ import"./index-tqw8w2n5.js";
88
88
  import"./index-txdagbh7.js";
89
89
  import"./index-cw912re7.js";
90
- import"./index-hb7bh4r2.js";
91
- import"./index-kxv193aq.js";
92
- import"./index-40twgsyh.js";
90
+ import"./index-7f2r3ysr.js";
91
+ import"./index-g11h1qpk.js";
92
+ import"./index-g9weyhq6.js";
93
93
  import"./index-70ha9e09.js";
94
- import"./index-ztm0q26v.js";
94
+ import"./index-dh5th4jn.js";
95
95
  import"./index-9ss2m4rs.js";
96
- import"./index-d3mpxsmy.js";
96
+ import"./index-ptsqnxwd.js";
97
97
  import"./index-zsrtt42s.js";
98
- import"./index-r69gzes2.js";
98
+ import"./index-fnyw5rzg.js";
99
99
  import"./index-6chhqq2n.js";
100
- import"./index-xxfk62zd.js";
100
+ import"./index-8bdk7124.js";
101
101
  import"./index-b43rt5ph.js";
102
102
  import"./index-q7sjgr1y.js";
103
- import"./index-ad9064j9.js";
104
- import"./index-ebce775n.js";
103
+ import"./index-74514zkh.js";
104
+ import"./index-5h60rtaa.js";
105
105
  import {
106
106
  PR_REVIEW_BASE_DIMENSION_IDS
107
- } from "./index-8vw2pjgr.js";
108
- import"./index-0byep4pe.js";
109
- import"./index-qqq04n70.js";
107
+ } from "./index-hhzzyjm3.js";
108
+ import"./index-qtxevgdx.js";
109
+ import"./index-anxs69ad.js";
110
110
  import"./index-z6xqpmqg.js";
111
111
  import"./index-p612v1mv.js";
112
- import"./index-hg09xemc.js";
113
- import"./index-4mjmnysc.js";
112
+ import"./index-7z9zqxqt.js";
113
+ import"./index-ajknebrc.js";
114
114
  import"./index-rtry5xyf.js";
115
- import"./index-qgajv9rd.js";
115
+ import"./index-d224mhr9.js";
116
116
  import"./index-3qf1vxtb.js";
117
117
  import"./index-n832052r.js";
118
- import"./index-wknpkfm8.js";
119
- import"./index-4vb56w2k.js";
120
- import"./index-mee9maf5.js";
118
+ import"./index-s3k7xbqd.js";
119
+ import"./index-ndjjvxzz.js";
120
+ import"./index-xwbn7c8m.js";
121
121
  import"./index-556ja8an.js";
122
- import"./index-yvqg6kn5.js";
123
- import"./index-c45662wc.js";
124
- import"./index-es64amqt.js";
122
+ import"./index-6m24v15v.js";
123
+ import"./index-e45htt92.js";
124
+ import"./index-w6988bbc.js";
125
125
  import"./index-ry16d01s.js";
126
126
  import"./index-n4fzmqz8.js";
127
- import"./index-eed0gkv6.js";
128
- import"./index-888pq4xx.js";
127
+ import"./index-j2svfhzk.js";
128
+ import"./index-grn6tkbt.js";
129
129
  import"./index-ae75rja9.js";
130
- import"./index-sphahrmq.js";
130
+ import"./index-6rx1rdaq.js";
131
131
  import"./index-7qefgq4j.js";
132
- import"./index-2bhz5k91.js";
133
- import"./index-ewv8qa8q.js";
134
- import"./index-r2p0pgst.js";
132
+ import"./index-jre6tm3v.js";
133
+ import"./index-gy0nyfbw.js";
134
+ import"./index-5ebgzb5a.js";
135
135
  import"./index-7g4c7s5r.js";
136
- import"./index-vw66q1rw.js";
136
+ import"./index-0mwjamha.js";
137
137
  import"./index-9e6fdz2h.js";
138
138
  import"./index-4rhhvd1a.js";
139
- import"./index-cgewrpw5.js";
140
- import"./index-50j914b5.js";
139
+ import"./index-asey3tb3.js";
140
+ import"./index-a0d4fp6r.js";
141
141
  import"./index-zjygnfay.js";
142
142
  import"./index-bk5tah7q.js";
143
143
  import"./index-bpmtbmy9.js";