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
@@ -30,10 +30,31 @@ export type CommandContext = {
30
30
  activeAgentName?: string;
31
31
  reviewAgentModelRegistry?: ReviewAgentModelRegistry;
32
32
  };
33
- export type CommandResult = Promise<string>;
33
+ /**
34
+ * Issue #2493 (#1646 item 3): opt-in structured failure channel. A handler
35
+ * may return a plain string (ok — CLI exits 0, chat prints it verbatim) or
36
+ * this shape to signal failure; the CLI maps `ok: false` to `exitCode ?? 1`
37
+ * while the chat path displays `text` unchanged (chat has no exit codes).
38
+ */
39
+ export type CommandFailure = {
40
+ /** User-facing failure text (also what the chat path displays). */
41
+ text: string;
42
+ ok: false;
43
+ /** CLI exit code; defaults to 1 when omitted. */
44
+ exitCode?: number;
45
+ };
46
+ export type CommandResult = Promise<string | CommandFailure>;
47
+ /** Type guard for the CommandFailure half of the CommandResult union. */
48
+ export declare function isCommandFailure(value: string | CommandFailure): value is CommandFailure;
34
49
  export type CommandCategory = 'core' | 'agent' | 'config' | 'diagnostics' | 'utility';
35
50
  export type CommandEntry = {
36
- handler: (ctx: CommandContext) => CommandResult;
51
+ /**
52
+ * Command handler. OPTIONAL on pure alias entries (#1646 via #2493): an
53
+ * entry without a handler MUST carry a valid `aliasOf` (enforced by
54
+ * validateAliases) and `resolveCommand` dereferences to the canonical
55
+ * entry — new aliases never redeclare the canonical handler.
56
+ */
57
+ handler?: (ctx: CommandContext) => CommandResult;
37
58
  /** Human-readable description shown in /swarm help and CLI --help */
38
59
  description: string;
39
60
  /** If true, this command is only accessible as a sub-key of a parent command */
@@ -131,56 +152,48 @@ export declare const COMMAND_REGISTRY: {
131
152
  readonly toolPolicy: "none";
132
153
  };
133
154
  readonly 'blueprint-validate': {
134
- readonly handler: (ctx: CommandContext) => Promise<string>;
135
155
  readonly description: "TUI shortcut alias for blueprint validate";
136
156
  readonly category: "utility";
137
157
  readonly aliasOf: "blueprint validate";
138
158
  readonly deprecated: true;
139
159
  };
140
160
  readonly 'blueprint-current': {
141
- readonly handler: (ctx: CommandContext) => Promise<string>;
142
161
  readonly description: "TUI shortcut alias for blueprint current";
143
162
  readonly category: "utility";
144
163
  readonly aliasOf: "blueprint current";
145
164
  readonly deprecated: true;
146
165
  };
147
166
  readonly 'blueprint-history': {
148
- readonly handler: (ctx: CommandContext) => Promise<string>;
149
167
  readonly description: "TUI shortcut alias for blueprint history";
150
168
  readonly category: "utility";
151
169
  readonly aliasOf: "blueprint history";
152
170
  readonly deprecated: true;
153
171
  };
154
172
  readonly 'blueprint-diff': {
155
- readonly handler: (ctx: CommandContext) => Promise<string>;
156
173
  readonly description: "TUI shortcut alias for blueprint diff";
157
174
  readonly category: "utility";
158
175
  readonly aliasOf: "blueprint diff";
159
176
  readonly deprecated: true;
160
177
  };
161
178
  readonly 'blueprint-export': {
162
- readonly handler: (ctx: CommandContext) => Promise<string>;
163
179
  readonly description: "TUI shortcut alias for blueprint export";
164
180
  readonly category: "utility";
165
181
  readonly aliasOf: "blueprint export";
166
182
  readonly deprecated: true;
167
183
  };
168
184
  readonly 'harness-candidate-validate': {
169
- readonly handler: (ctx: CommandContext) => Promise<string>;
170
185
  readonly description: "TUI shortcut alias for harness candidate validate";
171
186
  readonly category: "utility";
172
187
  readonly aliasOf: "harness candidate validate";
173
188
  readonly deprecated: true;
174
189
  };
175
190
  readonly 'harness-candidate-show': {
176
- readonly handler: (ctx: CommandContext) => Promise<string>;
177
191
  readonly description: "TUI shortcut alias for harness candidate show";
178
192
  readonly category: "utility";
179
193
  readonly aliasOf: "harness candidate show";
180
194
  readonly deprecated: true;
181
195
  };
182
196
  readonly 'harness-candidate-diff': {
183
- readonly handler: (ctx: CommandContext) => Promise<string>;
184
197
  readonly description: "TUI shortcut alias for harness candidate diff";
185
198
  readonly category: "utility";
186
199
  readonly aliasOf: "harness candidate diff";
@@ -216,7 +229,6 @@ export declare const COMMAND_REGISTRY: {
216
229
  readonly toolNoArgs: true;
217
230
  };
218
231
  readonly 'context-map-stats': {
219
- readonly handler: (ctx: CommandContext) => Promise<string>;
220
232
  readonly description: "Show aggregated context-capsule telemetry stats";
221
233
  readonly category: "diagnostics";
222
234
  readonly aliasOf: "context-map stats";
@@ -230,7 +242,6 @@ export declare const COMMAND_REGISTRY: {
230
242
  readonly toolPolicy: "agent";
231
243
  };
232
244
  readonly plan: {
233
- readonly handler: (ctx: CommandContext) => Promise<string>;
234
245
  readonly description: "Show current plan (deprecated alias for /swarm show-plan)";
235
246
  readonly category: "core";
236
247
  readonly clashesWithNativeCcCommand: "/plan";
@@ -278,7 +289,6 @@ export declare const COMMAND_REGISTRY: {
278
289
  readonly toolNoArgs: true;
279
290
  };
280
291
  readonly 'config-doctor': {
281
- readonly handler: (ctx: CommandContext) => Promise<string>;
282
292
  readonly description: "Run config doctor checks";
283
293
  readonly subcommandOf: "config";
284
294
  readonly category: "diagnostics";
@@ -293,7 +303,6 @@ export declare const COMMAND_REGISTRY: {
293
303
  readonly toolNoArgs: true;
294
304
  };
295
305
  readonly 'doctor-tools': {
296
- readonly handler: (ctx: CommandContext) => Promise<string>;
297
306
  readonly description: "Run tool registration coherence check";
298
307
  readonly category: "diagnostics";
299
308
  readonly aliasOf: "doctor tools";
@@ -307,7 +316,6 @@ export declare const COMMAND_REGISTRY: {
307
316
  readonly toolNoArgs: true;
308
317
  };
309
318
  readonly diagnosis: {
310
- readonly handler: (ctx: CommandContext) => Promise<string>;
311
319
  readonly description: "Run health check on swarm state";
312
320
  readonly category: "diagnostics";
313
321
  readonly aliasOf: "diagnose";
@@ -327,14 +335,12 @@ export declare const COMMAND_REGISTRY: {
327
335
  readonly toolPolicy: "agent";
328
336
  };
329
337
  readonly 'guardrail-explain': {
330
- readonly handler: (ctx: CommandContext) => Promise<string>;
331
338
  readonly description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)";
332
339
  readonly category: "diagnostics";
333
340
  readonly aliasOf: "guardrail explain";
334
341
  readonly deprecated: true;
335
342
  };
336
343
  readonly 'guardrail-reset': {
337
- readonly handler: (ctx: CommandContext) => Promise<string>;
338
344
  readonly description: "Reset one exact active invocation/action circuit after repair";
339
345
  readonly category: "diagnostics";
340
346
  readonly aliasOf: "guardrail reset";
@@ -370,9 +376,14 @@ export declare const COMMAND_REGISTRY: {
370
376
  readonly toolNoArgs: true;
371
377
  };
372
378
  readonly benchmark: {
373
- readonly handler: (ctx: CommandContext) => Promise<string>;
379
+ readonly handler: (ctx: CommandContext) => Promise<string | {
380
+ text: string;
381
+ ok: false;
382
+ exitCode: number;
383
+ }>;
374
384
  readonly description: "Show performance metrics [--cumulative] [--ci-gate] [--max-cost-usd <n>] [--gate-audit-run <id>]";
375
385
  readonly args: "--cumulative, --ci-gate, --max-cost-usd <n>, --gate-audit-run <id>";
386
+ readonly details: "Exit codes (#2493 review F-14): with --ci-gate, the process exits 0 only when every quality check passes and 1 on any failure, budget breach, or missing evidence — CI-safe by construction. Without --ci-gate the command is informational and always exits 0.";
376
387
  readonly category: "diagnostics";
377
388
  readonly toolPolicy: "agent";
378
389
  };
@@ -515,7 +526,6 @@ export declare const COMMAND_REGISTRY: {
515
526
  readonly toolNoArgs: true;
516
527
  };
517
528
  readonly 'evidence-summary': {
518
- readonly handler: (ctx: CommandContext) => Promise<string>;
519
529
  readonly description: "Generate evidence summary with completion ratio and blockers";
520
530
  readonly subcommandOf: "evidence";
521
531
  readonly args: "";
@@ -525,7 +535,6 @@ export declare const COMMAND_REGISTRY: {
525
535
  readonly deprecated: true;
526
536
  };
527
537
  readonly doctor: {
528
- readonly handler: (ctx: CommandContext) => Promise<string>;
529
538
  readonly description: "Run config doctor checks";
530
539
  readonly category: "diagnostics";
531
540
  readonly aliasOf: "config doctor";
@@ -533,35 +542,30 @@ export declare const COMMAND_REGISTRY: {
533
542
  readonly clashesWithNativeCcCommand: "/doctor";
534
543
  };
535
544
  readonly info: {
536
- readonly handler: (ctx: CommandContext) => Promise<string>;
537
545
  readonly description: "Show current swarm state (plus background-work health when hooks.background_subagents is enabled)";
538
546
  readonly category: "core";
539
547
  readonly aliasOf: "status";
540
548
  readonly deprecated: true;
541
549
  };
542
550
  readonly 'list-agents': {
543
- readonly handler: (ctx: CommandContext) => Promise<string>;
544
551
  readonly description: "List registered agents";
545
552
  readonly category: "core";
546
553
  readonly aliasOf: "agents";
547
554
  readonly deprecated: true;
548
555
  };
549
556
  readonly health: {
550
- readonly handler: (ctx: CommandContext) => Promise<string>;
551
557
  readonly description: "Run health check on swarm state";
552
558
  readonly category: "diagnostics";
553
559
  readonly aliasOf: "diagnose";
554
560
  readonly deprecated: true;
555
561
  };
556
562
  readonly check: {
557
- readonly handler: (ctx: CommandContext) => Promise<string>;
558
563
  readonly description: "Run preflight automation checks";
559
564
  readonly category: "diagnostics";
560
565
  readonly aliasOf: "preflight";
561
566
  readonly deprecated: true;
562
567
  };
563
568
  readonly clear: {
564
- readonly handler: (ctx: CommandContext) => Promise<string>;
565
569
  readonly description: "Clear session state while preserving plan, evidence, and knowledge";
566
570
  readonly category: "utility";
567
571
  readonly aliasOf: "reset-session";
@@ -616,13 +620,12 @@ export declare const COMMAND_REGISTRY: {
616
620
  readonly finalize: {
617
621
  readonly handler: (ctx: CommandContext) => Promise<string>;
618
622
  readonly description: "Use /swarm finalize to finalize the swarm project and archive evidence";
619
- readonly details: "Idempotent 4-stage terminal finalization: (1) finalize writes retrospectives for in-progress phases, (2) archive creates timestamped bundle of swarm artifacts and evidence, (3) clean removes active-state files for a clean slate, (4) align performs aggressive git reset --hard to the default remote branch, discarding uncommitted changes and gitignored build artifacts (user-created untracked files are preserved); falls back to a cautious reset that preserves uncommitted changes when the aggressive path cannot proceed. WARNING: alignment discards local changes and gitignored files. Resets agent sessions, delegation chains, and active-agent mappings. Reads .swarm/close-lessons.md for explicit lessons and runs curation. Use --skill-review to run the quota-bounded skill_improver in proposal mode. Use --dry-run to preview what finalize would archive, clean, and align without taking the lock or changing anything.";
623
+ readonly details: "Idempotent 4-stage terminal finalization: (1) finalize writes retrospectives for in-progress phases, (2) archive creates timestamped bundle of swarm artifacts and evidence, (3) clean removes active-state files for a clean slate, (4) align performs aggressive git reset --hard to the default remote branch, discarding uncommitted changes and gitignored build artifacts (user-created untracked files are preserved); falls back to a cautious reset that preserves uncommitted changes when the aggressive path cannot proceed. WARNING: alignment discards local changes and gitignored files. Resets agent sessions, delegation chains, and active-agent mappings. Reads .swarm/close-lessons.md for explicit lessons and runs curation. Cleanup: knowledge.jsonl is preserved; plan.json, plan.md, events.jsonl, handoff.*, run-memory.jsonl, and summaries/ are removed. Use --skill-review to run the quota-bounded skill_improver in proposal mode. Use --dry-run to preview what finalize would archive, clean, and align without taking the lock or changing anything.";
620
624
  readonly args: "--prune-branches, --skill-review, --dry-run";
621
625
  readonly category: "core";
622
626
  readonly toolPolicy: "none";
623
627
  };
624
628
  readonly close: {
625
- readonly handler: (ctx: CommandContext) => Promise<string>;
626
629
  readonly description: "Use /swarm close (deprecated alias) to finalize and archive swarm state";
627
630
  readonly details: "Deprecated alias for /swarm finalize. Preserved for backward compatibility. Supports the same flags, including --dry-run.";
628
631
  readonly args: "--prune-branches, --skill-review, --dry-run";
@@ -686,19 +689,16 @@ export declare const COMMAND_REGISTRY: {
686
689
  readonly toolPolicy: "agent";
687
690
  };
688
691
  readonly 'sdd-status': {
689
- readonly handler: (ctx: CommandContext) => Promise<string>;
690
692
  readonly description: "Show OpenSpec-compatible SDD status and effective spec source";
691
693
  readonly aliasOf: "sdd status";
692
694
  readonly deprecated: true;
693
695
  };
694
696
  readonly 'sdd-validate': {
695
- readonly handler: (ctx: CommandContext) => Promise<string>;
696
697
  readonly description: "Validate OpenSpec-compatible artifacts and effective spec projection";
697
698
  readonly aliasOf: "sdd validate";
698
699
  readonly deprecated: true;
699
700
  };
700
701
  readonly 'sdd-project': {
701
- readonly handler: (ctx: CommandContext) => Promise<string>;
702
702
  readonly description: "Materialize the OpenSpec-compatible effective spec into .swarm/spec.md";
703
703
  readonly aliasOf: "sdd project";
704
704
  readonly deprecated: true;
@@ -797,7 +797,6 @@ export declare const COMMAND_REGISTRY: {
797
797
  readonly toolPolicy: "agent";
798
798
  };
799
799
  readonly 'pr-subscribe': {
800
- readonly handler: (ctx: CommandContext) => Promise<string>;
801
800
  readonly description: "Subscribe the current session to PR state-change notifications";
802
801
  readonly aliasOf: "pr subscribe";
803
802
  readonly deprecated: true;
@@ -811,7 +810,6 @@ export declare const COMMAND_REGISTRY: {
811
810
  readonly toolPolicy: "agent";
812
811
  };
813
812
  readonly 'pr-unsubscribe': {
814
- readonly handler: (ctx: CommandContext) => Promise<string>;
815
813
  readonly description: "Unsubscribe the current session from PR state-change notifications";
816
814
  readonly aliasOf: "pr unsubscribe";
817
815
  readonly deprecated: true;
@@ -826,7 +824,6 @@ export declare const COMMAND_REGISTRY: {
826
824
  readonly toolNoArgs: true;
827
825
  };
828
826
  readonly 'pr-status': {
829
- readonly handler: (ctx: CommandContext) => Promise<string>;
830
827
  readonly description: "Show PR monitor subscription status for the current session";
831
828
  readonly aliasOf: "pr status";
832
829
  readonly deprecated: true;
@@ -848,7 +845,6 @@ export declare const COMMAND_REGISTRY: {
848
845
  readonly toolPolicy: "none";
849
846
  };
850
847
  readonly 'deep dive': {
851
- readonly handler: (ctx: CommandContext) => CommandResult;
852
848
  readonly description: "Alias for /swarm deep-dive — launch deep codebase audit";
853
849
  readonly args: "<scope> [--profile standard|security|ux|architecture|full] [--max-explorers 1..8] [--json] [--skip-update] [--allow-dirty]";
854
850
  readonly category: "agent";
@@ -863,7 +859,6 @@ export declare const COMMAND_REGISTRY: {
863
859
  readonly toolPolicy: "none";
864
860
  };
865
861
  readonly 'deep research': {
866
- readonly handler: (ctx: CommandContext) => CommandResult;
867
862
  readonly description: "Alias for /swarm deep-research — launch a cited deep research pass";
868
863
  readonly args: "<question> [--depth standard|exhaustive] [--max-researchers 1..6] [--rounds 1..4] [--brief]";
869
864
  readonly category: "agent";
@@ -878,7 +873,6 @@ export declare const COMMAND_REGISTRY: {
878
873
  readonly toolPolicy: "none";
879
874
  };
880
875
  readonly 'codebase review': {
881
- readonly handler: (ctx: CommandContext) => CommandResult;
882
876
  readonly description: "Alias for /swarm codebase-review - launch codebase-review-swarm";
883
877
  readonly args: "[scope] [--mode phase0|complete|defect|security|correctness|testing|ui|performance|ai-slop|enhancements|custom] [--tracks <list>] [--continue <run-id>] [--json] [--skip-update] [--allow-dirty]";
884
878
  readonly category: "agent";
@@ -893,7 +887,6 @@ export declare const COMMAND_REGISTRY: {
893
887
  readonly toolPolicy: "none";
894
888
  };
895
889
  readonly 'design docs': {
896
- readonly handler: (ctx: CommandContext) => CommandResult;
897
890
  readonly description: "Alias for /swarm design-docs — generate or sync design docs";
898
891
  readonly args: "<description> [--out <dir>] [--lang <name>] [--update]";
899
892
  readonly category: "agent";
@@ -949,7 +942,7 @@ export declare const COMMAND_REGISTRY: {
949
942
  readonly reset: {
950
943
  readonly handler: (ctx: CommandContext) => Promise<string>;
951
944
  readonly description: "Clear swarm state files [--confirm]";
952
- readonly details: "DELETES plan.md, context.md, and summaries/ directory from .swarm/. Stops background automation and clears in-memory queues. SAFETY: requires --confirm flag — without it, displays a warning and tips to export first. Before deleting, auto-backs up the state it removes to .swarm/reset-backups/<timestamp>/ (newest 5 kept) so it can be restored by copying the files back.";
945
+ readonly details: "DELETES plan.md, plan.json, context.md, events.jsonl, run-memory.jsonl, and summaries/ from .swarm/. Stops background automation and clears in-memory queues. SAFETY: requires --confirm flag — without it, displays a warning and tips to export first. Before deleting, auto-backs up the state it removes to .swarm/reset-backups/<timestamp>/ (newest 5 kept) so it can be restored by copying the files back.";
953
946
  readonly args: "--confirm (required)";
954
947
  readonly category: "utility";
955
948
  readonly clashesWithNativeCcCommand: "/reset";
@@ -1212,25 +1205,21 @@ export declare const COMMAND_REGISTRY: {
1212
1205
  readonly toolPolicy: "agent";
1213
1206
  };
1214
1207
  readonly 'memory-status': {
1215
- readonly handler: (ctx: CommandContext) => Promise<string>;
1216
1208
  readonly description: "Show Swarm memory provider, JSONL, and migration status";
1217
1209
  readonly aliasOf: "memory status";
1218
1210
  readonly deprecated: true;
1219
1211
  };
1220
1212
  readonly 'memory-export': {
1221
- readonly handler: (ctx: CommandContext) => Promise<string>;
1222
1213
  readonly description: "Export current Swarm memory to JSONL files";
1223
1214
  readonly aliasOf: "memory export";
1224
1215
  readonly deprecated: true;
1225
1216
  };
1226
1217
  readonly 'memory-import': {
1227
- readonly handler: (ctx: CommandContext) => Promise<string>;
1228
1218
  readonly description: "Import legacy JSONL memory into SQLite";
1229
1219
  readonly aliasOf: "memory import";
1230
1220
  readonly deprecated: true;
1231
1221
  };
1232
1222
  readonly 'memory-migrate': {
1233
- readonly handler: (ctx: CommandContext) => Promise<string>;
1234
1223
  readonly description: "Run the one-time legacy JSONL to SQLite migration";
1235
1224
  readonly aliasOf: "memory migrate";
1236
1225
  readonly deprecated: true;
@@ -1293,7 +1282,9 @@ export declare const _internals: {
1293
1282
  * Returns a warning if the resolved command is a deprecated alias.
1294
1283
  */
1295
1284
  export declare function resolveCommand(tokens: string[]): {
1296
- entry: CommandEntry;
1285
+ entry: CommandEntry & {
1286
+ handler: (ctx: CommandContext) => CommandResult;
1287
+ };
1297
1288
  remainingArgs: string[];
1298
1289
  key: string;
1299
1290
  warning?: string;
@@ -14,7 +14,7 @@ export declare const _internals: {
14
14
  * Supports standard turbo toggle, lean turbo mode, and status reporting.
15
15
  *
16
16
  * @param directory - Project directory (used to persist Lean Turbo run state)
17
- * @param args - Optional arguments: "lean" | "standard" | "on" | "off" | "status" | undefined
17
+ * @param args - Arguments: (none) | "on" | "off" | "status" | "lean" ["on"|"off"] | "standard" ["on"|"off"] | "epic" ["on"|"off"]. Unknown arguments are rejected without changing state.
18
18
  * @param sessionID - Session ID for accessing active session state
19
19
  * @returns Feedback message about Turbo Mode state
20
20
  */
@@ -1,14 +1,15 @@
1
- export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "swarm-resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "swarm-implement", "design-docs", "swarm-pr-review", "swarm", "swarm-pr-feedback", "swarm-pr-subscribe", "swarm-ci-monitor", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr", "ci-failure-batching", "gate-attribution", "merge-queue-readiness", "skill-edit-validation", "worktree-retry-cleanup", "test-file-split", "fork-pr-operations", "parallel-work-check", "ci-fix-monitor", "issue-tracer", "orchestrating-subagents", "durable-session-state"];
1
+ export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "swarm-resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "swarm-implement", "design-docs", "swarm-pr-review", "swarm", "swarm-pr-feedback", "swarm-pr-subscribe", "swarm-ci-monitor", "issue-ingest", "swarm-plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr", "ci-failure-batching", "gate-attribution", "merge-queue-readiness", "skill-edit-validation", "worktree-retry-cleanup", "test-file-split", "fork-pr-operations", "parallel-work-check", "ci-fix-monitor", "issue-tracer", "orchestrating-subagents", "durable-session-state"];
2
2
  export type BundledProjectSkill = (typeof BUNDLED_PROJECT_SKILLS)[number];
3
3
  /**
4
4
  * Bundled skill slugs that were retired (renamed away) in shipped releases.
5
5
  * The sync removes their materialized directories from
6
6
  * `.swarm/bundled-skills/` in existing user projects so a rename never leaves
7
- * a stale protocol copy behind (issue #2379: `resume` → `swarm-resume`).
7
+ * a stale protocol copy behind (issue #2379: `resume` → `swarm-resume`;
8
+ * issue #2388 via #2493: `plan` → `swarm-plan`).
8
9
  * A slug must never appear both here and in BUNDLED_PROJECT_SKILLS (asserted
9
10
  * by tests/unit/skills/claude-slug-collision-guard.test.ts).
10
11
  */
11
- export declare const RETIRED_BUNDLED_PROJECT_SKILLS: readonly ["resume"];
12
+ export declare const RETIRED_BUNDLED_PROJECT_SKILLS: readonly ["resume", "plan"];
12
13
  /**
13
14
  * Project-private runtime location for plugin-owned skills. Repository-native
14
15
  * skill roots (`.opencode/skills`, `.claude/skills`, and `.agents/skills`) are
@@ -5,6 +5,19 @@ export type { AgentName, PipelineAgentName, QAAgentName } from './agent-names';
5
5
  export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS, } from './agent-names';
6
6
  export declare const OPENCODE_NATIVE_AGENTS: Set<"plan" | "summary" | "compaction" | "title" | "build" | "general" | "explore">;
7
7
  export declare const CLAUDE_CODE_NATIVE_COMMANDS: ReadonlySet<string>;
8
+ /**
9
+ * OpenCode built-in slash commands (without leading slash). Used by
10
+ * tests/unit/skills/claude-slug-collision-guard.test.ts to assert that no
11
+ * repo-shipped native skill slug in `.opencode/skills/` or `.claude/skills/`
12
+ * shadows one of OpenCode's own `/<slug>` commands (the host exposes every
13
+ * native skill directory as a slash command, so e.g. a `plan` skill dir would
14
+ * shadow OpenCode's built-in `/plan` plan mode — issue #2388/#2493).
15
+ *
16
+ * Hand-curated mirror of OpenCode's built-in slash commands — must be
17
+ * reviewed when bumping @opencode-ai/* dependencies (no programmatic oracle
18
+ * exists; issue #2493).
19
+ */
20
+ export declare const OPENCODE_NATIVE_COMMANDS: ReadonlySet<string>;
8
21
  export declare const MEMORY_TOOL_NAMES: readonly ["swarm_memory_recall", "swarm_memory_propose", "swarm_memory_outcome"];
9
22
  export declare const MEMORY_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
10
23
  export declare const EXTERNAL_SKILL_TOOL_NAMES: readonly ["external_skill_discover", "external_skill_list", "external_skill_inspect", "external_skill_promote", "external_skill_reject", "external_skill_delete", "external_skill_revoke"];
@@ -15,6 +15,15 @@ export declare function extractCurrentPhase(planContent: string): string | null;
15
15
  export declare function extractCurrentTask(planContent: string): string | null;
16
16
  /**
17
17
  * Extracts decisions section from context content.
18
+ *
19
+ * #2493 W9a: derives from the shared section extractor
20
+ * (`src/utils/context-decisions.ts`) instead of a private line-scan.
21
+ * Mapping preserves this consumer's historical output exactly:
22
+ * - Only NON-indented `- ` lines are kept (the old scan matched raw
23
+ * `line.startsWith('- ')`; the shared extractor is indent-tolerant, so
24
+ * indented sub-bullets are filtered out here).
25
+ * - Lines are reproduced verbatim from `raw` — bullet prefix, markers
26
+ * (✅ / [timestamps]) and all — then joined, trimmed and truncated.
18
27
  */
19
28
  export declare function extractDecisions(contextContent: string, maxChars?: number): string | null;
20
29
  /**
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Issue #2493 (K3 UX-3): one-time first-run advisory when a session runs on a
3
+ * non-architect agent. The OpenCode plugin v1 shape has no session-start hook,
4
+ * so "session starts on a non-architect agent" is operationalized as the first
5
+ * user message observed on a non-architect agent (the chat.message hook calls
6
+ * this on every message; the one-shot flag makes it fire once per sessionID).
7
+ *
8
+ * Invariant 8: the guard lives on AgentSessionState (session-keyed, bounded by
9
+ * the existing session-state eviction) — no new module-level session map.
10
+ */
11
+ export declare const NON_ARCHITECT_ADVISORY_KEY = "[non-architect-advisory]";
12
+ /**
13
+ * Emit the one-time non-architect advisory for `sessionID` when `agentName`
14
+ * identifies a user-facing, non-architect agent. Returns true when the
15
+ * advisory was enqueued this call. Fail-open by contract: callers wrap in
16
+ * try/catch so an advisory failure can never block message processing.
17
+ */
18
+ export declare function maybeEmitNonArchitectAdvisory(sessionID: string, agentName: string): boolean;
@@ -25,9 +25,23 @@
25
25
  * touches SQLite. Whole-graph consumers (`buildLaneOrientationBlock`,
26
26
  * `semantic-diff-injection`) always get the full JSON graph.
27
27
  */
28
+ import * as fs from 'node:fs';
28
29
  import { loadPluginConfigWithMetaAsync } from '../config/loader';
29
30
  import { type FreshnessOptions, probeFreshness, type RepoGraph } from '../tools/repo-graph';
30
31
  import { loadSubgraphForFiles } from '../tools/repo-graph/indexed-storage';
32
+ interface CachedGraph {
33
+ graph: RepoGraph;
34
+ mtimeMs: number;
35
+ size: number;
36
+ /**
37
+ * File identity from `st.ino`. The indexed freshness stamp relies on it
38
+ * because same-size/same-mtime-tick rewrites are common, and these caches
39
+ * shadow that stamp (a hit short-circuits before the index is consulted).
40
+ * On filesystems reporting no usable id it is 0 on both sides, so the
41
+ * comparator degrades to mtime+size exactly as before.
42
+ */
43
+ ino: number;
44
+ }
31
45
  export interface RepoGraphInjectionOptions extends FreshnessOptions {
32
46
  enabled?: boolean;
33
47
  refreshCap?: number;
@@ -49,7 +63,9 @@ export declare const _internals: {
49
63
  loadPluginConfigWithMetaAsync: typeof loadPluginConfigWithMetaAsync;
50
64
  loadSubgraphForFiles: typeof loadSubgraphForFiles;
51
65
  subgraphCacheKey: typeof subgraphCacheKey;
66
+ fullGraphCacheMatches: typeof fullGraphCacheMatches;
52
67
  };
68
+ declare function fullGraphCacheMatches(cached: Pick<CachedGraph, 'mtimeMs' | 'size' | 'ino'>, stat: Pick<fs.Stats, 'mtimeMs' | 'size' | 'ino'>): boolean;
53
69
  /**
54
70
  * Cache key for a subgraph request. The graph artifact's `{mtimeMs, size, ino}`
55
71
  * is part of the key, so a graph change invalidates every cached subgraph for