opencode-swarm 7.1.1 → 7.3.0
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/README.md +37 -10
- package/dist/agents/architect.skip-aliases.test.d.ts +1 -0
- package/dist/cli/index.js +11825 -10650
- package/dist/commands/first-run.test.d.ts +11 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/registry.d.ts +123 -0
- package/dist/commands/registry.test.d.ts +1 -0
- package/dist/config/constants.d.ts +4 -0
- package/dist/config/project-init.d.ts +15 -0
- package/dist/config/schema.d.ts +20 -0
- package/dist/index.js +1380 -972
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for first-run sentinel detection, welcome message, and error handling
|
|
3
|
+
* catch block in createSwarmCommandHandler().
|
|
4
|
+
*
|
|
5
|
+
* Covers:
|
|
6
|
+
* - First-run sentinel detection (atomic 'wx' flag write)
|
|
7
|
+
* - Welcome message prepended on first run only
|
|
8
|
+
* - Error handling catch block when command handler throws
|
|
9
|
+
* - Regression: existing shortcut-routing tests still pass
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { handlePlanCommand } from './plan';
|
|
|
24
24
|
export { handlePreflightCommand } from './preflight';
|
|
25
25
|
export { handlePromoteCommand } from './promote';
|
|
26
26
|
export { handleQaGatesCommand } from './qa-gates';
|
|
27
|
+
export { handleHelpCommand } from './registry';
|
|
27
28
|
export type { CommandContext, CommandEntry, RegisteredCommand, } from './registry.js';
|
|
28
29
|
export { COMMAND_REGISTRY, resolveCommand, VALID_COMMANDS, } from './registry.js';
|
|
29
30
|
export { handleResetCommand } from './reset';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentDefinition } from '../agents/index.js';
|
|
2
|
+
export declare function handleHelpCommand(ctx: CommandContext): Promise<string>;
|
|
2
3
|
export type CommandContext = {
|
|
3
4
|
directory: string;
|
|
4
5
|
args: string[];
|
|
@@ -6,6 +7,7 @@ export type CommandContext = {
|
|
|
6
7
|
agents: Record<string, AgentDefinition>;
|
|
7
8
|
};
|
|
8
9
|
export type CommandResult = Promise<string>;
|
|
10
|
+
export type CommandCategory = 'core' | 'agent' | 'config' | 'diagnostics' | 'utility';
|
|
9
11
|
export type CommandEntry = {
|
|
10
12
|
handler: (ctx: CommandContext) => CommandResult;
|
|
11
13
|
/** Human-readable description shown in /swarm help and CLI --help */
|
|
@@ -23,80 +25,113 @@ export type CommandEntry = {
|
|
|
23
25
|
* Example: args: '--dry-run, --confirm, <phase-number>'
|
|
24
26
|
*/
|
|
25
27
|
args?: string;
|
|
28
|
+
/** Functional category for organization and filtering */
|
|
29
|
+
category?: CommandCategory;
|
|
30
|
+
/** Canonical command name this entry redirects to */
|
|
31
|
+
aliasOf?: string;
|
|
32
|
+
/** Whether this entry is deprecated — prefer aliasOf target instead */
|
|
33
|
+
deprecated?: boolean;
|
|
26
34
|
};
|
|
27
35
|
export declare const COMMAND_REGISTRY: {
|
|
28
36
|
readonly 'acknowledge-spec-drift': {
|
|
29
37
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
30
38
|
readonly description: "Acknowledge that the spec has drifted from the plan and suppress further warnings";
|
|
31
39
|
readonly args: "";
|
|
40
|
+
readonly category: "diagnostics";
|
|
32
41
|
};
|
|
33
42
|
readonly status: {
|
|
34
43
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
35
44
|
readonly description: "Show current swarm state";
|
|
45
|
+
readonly category: "core";
|
|
36
46
|
};
|
|
37
47
|
readonly plan: {
|
|
38
48
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
39
49
|
readonly description: "Show plan (optionally filter by phase number)";
|
|
50
|
+
readonly category: "core";
|
|
40
51
|
};
|
|
41
52
|
readonly agents: {
|
|
42
53
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
43
54
|
readonly description: "List registered agents";
|
|
55
|
+
readonly category: "core";
|
|
56
|
+
};
|
|
57
|
+
readonly help: {
|
|
58
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
59
|
+
readonly description: "Show help for swarm commands";
|
|
60
|
+
readonly category: "core";
|
|
61
|
+
readonly args: "[command]";
|
|
62
|
+
readonly details: "Without argument, shows full command listing. With argument, shows detailed help for a specific command.";
|
|
44
63
|
};
|
|
45
64
|
readonly history: {
|
|
46
65
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
47
66
|
readonly description: "Show completed phases summary";
|
|
67
|
+
readonly category: "utility";
|
|
48
68
|
};
|
|
49
69
|
readonly config: {
|
|
50
70
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
51
71
|
readonly description: "Show current resolved configuration";
|
|
72
|
+
readonly category: "config";
|
|
52
73
|
};
|
|
53
74
|
readonly 'config doctor': {
|
|
54
75
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
55
76
|
readonly description: "Run config doctor checks";
|
|
56
77
|
readonly subcommandOf: "config";
|
|
78
|
+
readonly category: "diagnostics";
|
|
57
79
|
};
|
|
58
80
|
readonly 'config-doctor': {
|
|
59
81
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
60
82
|
readonly description: "Run config doctor checks";
|
|
61
83
|
readonly subcommandOf: "config";
|
|
84
|
+
readonly category: "diagnostics";
|
|
85
|
+
readonly aliasOf: "config doctor";
|
|
86
|
+
readonly deprecated: true;
|
|
62
87
|
};
|
|
63
88
|
readonly 'doctor tools': {
|
|
64
89
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
65
90
|
readonly description: "Run tool registration coherence check";
|
|
91
|
+
readonly category: "diagnostics";
|
|
66
92
|
};
|
|
67
93
|
readonly diagnose: {
|
|
68
94
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
69
95
|
readonly description: "Run health check on swarm state";
|
|
96
|
+
readonly category: "diagnostics";
|
|
70
97
|
};
|
|
71
98
|
readonly diagnosis: {
|
|
72
99
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
73
100
|
readonly description: "Run health check on swarm state";
|
|
101
|
+
readonly category: "diagnostics";
|
|
102
|
+
readonly aliasOf: "diagnose";
|
|
103
|
+
readonly deprecated: true;
|
|
74
104
|
};
|
|
75
105
|
readonly preflight: {
|
|
76
106
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
77
107
|
readonly description: "Run preflight automation checks";
|
|
108
|
+
readonly category: "diagnostics";
|
|
78
109
|
};
|
|
79
110
|
readonly 'sync-plan': {
|
|
80
111
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
81
112
|
readonly description: "Ensure plan.json and plan.md are synced";
|
|
82
113
|
readonly args: "";
|
|
114
|
+
readonly category: "config";
|
|
83
115
|
};
|
|
84
116
|
readonly benchmark: {
|
|
85
117
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
86
118
|
readonly description: "Show performance metrics [--cumulative] [--ci-gate]";
|
|
87
119
|
readonly args: "--cumulative, --ci-gate";
|
|
120
|
+
readonly category: "diagnostics";
|
|
88
121
|
};
|
|
89
122
|
readonly export: {
|
|
90
123
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
91
124
|
readonly description: "Export plan and context as JSON";
|
|
92
125
|
readonly args: "";
|
|
93
126
|
readonly details: "Exports the current plan and context as JSON to stdout. Useful for piping to external tools or debugging swarm state.";
|
|
127
|
+
readonly category: "utility";
|
|
94
128
|
};
|
|
95
129
|
readonly evidence: {
|
|
96
130
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
97
131
|
readonly description: "Show evidence bundles [taskId]";
|
|
98
132
|
readonly args: "<taskId>";
|
|
99
133
|
readonly details: "Displays review results, test verdicts, and other evidence bundles for the given task ID (e.g., \"2.1\").";
|
|
134
|
+
readonly category: "utility";
|
|
100
135
|
};
|
|
101
136
|
readonly 'evidence summary': {
|
|
102
137
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -104,6 +139,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
104
139
|
readonly subcommandOf: "evidence";
|
|
105
140
|
readonly args: "";
|
|
106
141
|
readonly details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence.";
|
|
142
|
+
readonly category: "utility";
|
|
107
143
|
};
|
|
108
144
|
readonly 'evidence-summary': {
|
|
109
145
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -111,132 +147,199 @@ export declare const COMMAND_REGISTRY: {
|
|
|
111
147
|
readonly subcommandOf: "evidence";
|
|
112
148
|
readonly args: "";
|
|
113
149
|
readonly details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence.";
|
|
150
|
+
readonly category: "utility";
|
|
151
|
+
readonly aliasOf: "evidence summary";
|
|
152
|
+
readonly deprecated: true;
|
|
153
|
+
};
|
|
154
|
+
readonly doctor: {
|
|
155
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
156
|
+
readonly description: "Run config doctor checks";
|
|
157
|
+
readonly category: "diagnostics";
|
|
158
|
+
readonly aliasOf: "config doctor";
|
|
159
|
+
readonly deprecated: true;
|
|
160
|
+
};
|
|
161
|
+
readonly info: {
|
|
162
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
163
|
+
readonly description: "Show current swarm state";
|
|
164
|
+
readonly category: "core";
|
|
165
|
+
readonly aliasOf: "status";
|
|
166
|
+
readonly deprecated: true;
|
|
167
|
+
};
|
|
168
|
+
readonly 'list-agents': {
|
|
169
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
170
|
+
readonly description: "List registered agents";
|
|
171
|
+
readonly category: "core";
|
|
172
|
+
readonly aliasOf: "agents";
|
|
173
|
+
readonly deprecated: true;
|
|
174
|
+
};
|
|
175
|
+
readonly health: {
|
|
176
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
177
|
+
readonly description: "Run health check on swarm state";
|
|
178
|
+
readonly category: "diagnostics";
|
|
179
|
+
readonly aliasOf: "diagnose";
|
|
180
|
+
readonly deprecated: true;
|
|
181
|
+
};
|
|
182
|
+
readonly check: {
|
|
183
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
184
|
+
readonly description: "Run preflight automation checks";
|
|
185
|
+
readonly category: "diagnostics";
|
|
186
|
+
readonly aliasOf: "preflight";
|
|
187
|
+
readonly deprecated: true;
|
|
188
|
+
};
|
|
189
|
+
readonly clear: {
|
|
190
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
191
|
+
readonly description: "Clear session state while preserving plan, evidence, and knowledge";
|
|
192
|
+
readonly category: "utility";
|
|
193
|
+
readonly aliasOf: "reset-session";
|
|
194
|
+
readonly deprecated: true;
|
|
114
195
|
};
|
|
115
196
|
readonly archive: {
|
|
116
197
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
117
198
|
readonly description: "Archive old evidence bundles [--dry-run]";
|
|
118
199
|
readonly details: "Archives evidence bundles older than max_age_days (config, default 90) or beyond max_bundles cap (config, default 1000). --dry-run previews which bundles would be archived without deleting them. Applies two-tier retention: age-based first, then count-based on oldest remaining.";
|
|
119
200
|
readonly args: "--dry-run";
|
|
201
|
+
readonly category: "utility";
|
|
120
202
|
};
|
|
121
203
|
readonly curate: {
|
|
122
204
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
123
205
|
readonly description: "Run knowledge curation and hive promotion review";
|
|
124
206
|
readonly args: "";
|
|
207
|
+
readonly category: "utility";
|
|
125
208
|
};
|
|
126
209
|
readonly 'dark-matter': {
|
|
127
210
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
128
211
|
readonly description: "Detect hidden file couplings via co-change NPMI analysis";
|
|
129
212
|
readonly args: "--threshold <number>, --min-commits <number>";
|
|
213
|
+
readonly category: "diagnostics";
|
|
130
214
|
};
|
|
131
215
|
readonly close: {
|
|
132
216
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
133
217
|
readonly description: "Use /swarm close to close the swarm project and archive evidence";
|
|
134
218
|
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 safe git ff-only to main. Resets agent sessions and delegation chains. Reads .swarm/close-lessons.md for explicit lessons and runs curation.";
|
|
135
219
|
readonly args: "--prune-branches";
|
|
220
|
+
readonly category: "core";
|
|
136
221
|
};
|
|
137
222
|
readonly simulate: {
|
|
138
223
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
139
224
|
readonly description: "Dry-run hidden coupling analysis with configurable thresholds";
|
|
140
225
|
readonly args: "--threshold <number>, --min-commits <number>";
|
|
226
|
+
readonly category: "diagnostics";
|
|
141
227
|
};
|
|
142
228
|
readonly analyze: {
|
|
143
229
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
144
230
|
readonly description: "Analyze spec.md vs plan.md for requirement coverage gaps";
|
|
145
231
|
readonly args: "";
|
|
232
|
+
readonly category: "agent";
|
|
146
233
|
};
|
|
147
234
|
readonly clarify: {
|
|
148
235
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
149
236
|
readonly description: "Clarify and refine an existing feature specification";
|
|
150
237
|
readonly args: "[description-text]";
|
|
238
|
+
readonly category: "agent";
|
|
151
239
|
};
|
|
152
240
|
readonly specify: {
|
|
153
241
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
154
242
|
readonly description: "Generate or import a feature specification [description]";
|
|
155
243
|
readonly args: "[description-text]";
|
|
244
|
+
readonly category: "agent";
|
|
156
245
|
};
|
|
157
246
|
readonly brainstorm: {
|
|
158
247
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
159
248
|
readonly description: "Enter architect MODE: BRAINSTORM — structured seven-phase planning workflow [topic]";
|
|
160
249
|
readonly args: "[topic-text]";
|
|
161
250
|
readonly details: "Triggers the architect to run the brainstorm workflow: CONTEXT SCAN, single-question DIALOGUE, APPROACHES, DESIGN SECTIONS, SPEC WRITE + SELF-REVIEW, QA GATE SELECTION, TRANSITION. Use for new plans where requirements need to be drawn out before writing spec.md / plan.md.";
|
|
251
|
+
readonly category: "agent";
|
|
162
252
|
};
|
|
163
253
|
readonly council: {
|
|
164
254
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
165
255
|
readonly description: "Enter architect MODE: COUNCIL — multi-model deliberation [question] [--spec-review]";
|
|
166
256
|
readonly args: "<question> [--spec-review]";
|
|
167
257
|
readonly details: string;
|
|
258
|
+
readonly category: "agent";
|
|
168
259
|
};
|
|
169
260
|
readonly 'pr-review': {
|
|
170
261
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
171
262
|
readonly description: "Launch deep PR review with multi-lane analysis [url] [--council]";
|
|
172
263
|
readonly args: "<pr-url|owner/repo#N|N> [--council]";
|
|
173
264
|
readonly details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, runs 6 parallel explorer lanes (correctness, security, dependencies, docs-intent-vs-actual, tests, performance-architecture), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, synthesizes structured report. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).";
|
|
265
|
+
readonly category: "agent";
|
|
174
266
|
};
|
|
175
267
|
readonly issue: {
|
|
176
268
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
177
269
|
readonly description: "Ingest a GitHub issue into the swarm workflow [url] [--plan] [--trace] [--no-repro]";
|
|
178
270
|
readonly args: "<issue-url|owner/repo#N|N> [--plan] [--trace] [--no-repro]";
|
|
179
271
|
readonly details: "Triggers the architect to enter MODE: ISSUE_INGEST — ingests a GitHub issue, restructures it into a normalized intake note, localizes root cause through hypothesis-driven tracing, and outputs a resolution spec. --plan transitions to plan creation after spec generation. --trace runs the full fix-and-PR workflow (implies --plan). --no-repro skips the reproduction step. Supports full GitHub URL, owner/repo#N shorthand, or bare issue number (resolves against origin remote).";
|
|
272
|
+
readonly category: "agent";
|
|
180
273
|
};
|
|
181
274
|
readonly 'qa-gates': {
|
|
182
275
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
183
276
|
readonly description: "View or modify QA gate profile for the current plan [enable|override <gate>...]";
|
|
184
277
|
readonly args: "[show|enable|override] <gate>...";
|
|
185
278
|
readonly details: "show: display spec-level, session-override, and effective QA gates for the current plan. enable: persist gate(s) into the locked-once profile (architect; rejected after critic approval lock). override: session-only ratchet-tighter enable. Valid gates: reviewer, test_engineer, council_mode, sme_enabled, critic_pre_plan, hallucination_guard, sast_enabled, mutation_test, council_general_review, drift_check.";
|
|
279
|
+
readonly category: "config";
|
|
186
280
|
};
|
|
187
281
|
readonly promote: {
|
|
188
282
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
189
283
|
readonly description: "Manually promote lesson to hive knowledge";
|
|
190
284
|
readonly details: "Promotes a lesson directly to hive knowledge (--category flag sets category) or references an existing swarm lesson by ID (--from-swarm). Validates lesson text before promotion. Either direct text or --from-swarm ID is required.";
|
|
191
285
|
readonly args: "--category <category>, --from-swarm <lesson-id>, <lesson-text>";
|
|
286
|
+
readonly category: "utility";
|
|
192
287
|
};
|
|
193
288
|
readonly reset: {
|
|
194
289
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
195
290
|
readonly description: "Clear swarm state files [--confirm]";
|
|
196
291
|
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.";
|
|
197
292
|
readonly args: "--confirm (required)";
|
|
293
|
+
readonly category: "utility";
|
|
198
294
|
};
|
|
199
295
|
readonly 'reset-session': {
|
|
200
296
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
201
297
|
readonly description: "Clear session state while preserving plan, evidence, and knowledge";
|
|
202
298
|
readonly details: "Deletes only .swarm/session/state.json and any other session files. Clears in-memory agent sessions and delegation chains. Preserves plan, evidence, and knowledge for cross-session continuity.";
|
|
203
299
|
readonly args: "";
|
|
300
|
+
readonly category: "utility";
|
|
204
301
|
};
|
|
205
302
|
readonly rollback: {
|
|
206
303
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
207
304
|
readonly description: "Restore swarm state to a checkpoint <phase>";
|
|
208
305
|
readonly details: "Restores .swarm/ state by directly overwriting files from a checkpoint directory (checkpoints/phase-<N>). Writes rollback event to events.jsonl. Without phase argument, lists available checkpoints. Partial failures are reported but processing continues.";
|
|
209
306
|
readonly args: "<phase-number>";
|
|
307
|
+
readonly category: "utility";
|
|
210
308
|
};
|
|
211
309
|
readonly retrieve: {
|
|
212
310
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
213
311
|
readonly description: "Retrieve full output from a summary <id>";
|
|
214
312
|
readonly args: "<summary-id>";
|
|
215
313
|
readonly details: "Loads the full tool output that was previously summarized (referenced by IDs like S1, S2). Use when you need the complete output instead of the truncated summary.";
|
|
314
|
+
readonly category: "utility";
|
|
216
315
|
};
|
|
217
316
|
readonly handoff: {
|
|
218
317
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
219
318
|
readonly description: "Prepare state for clean model switch (new session)";
|
|
220
319
|
readonly args: "";
|
|
221
320
|
readonly details: "Generates handoff.md with full session state snapshot, including plan progress, recent decisions, and agent delegation history. Prepended to the next session prompt for seamless model switches.";
|
|
321
|
+
readonly category: "core";
|
|
222
322
|
};
|
|
223
323
|
readonly turbo: {
|
|
224
324
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
225
325
|
readonly description: "Toggle Turbo Mode for the active session [on|off]";
|
|
226
326
|
readonly args: "on, off";
|
|
227
327
|
readonly details: "Toggles Turbo Mode which skips non-critical QA gates for faster iteration. When enabled, the architect can proceed without waiting for all automated checks. Session-scoped — resets on new session. Use \"on\" or \"off\" to set explicitly, or toggle with no argument.";
|
|
328
|
+
readonly category: "utility";
|
|
228
329
|
};
|
|
229
330
|
readonly 'full-auto': {
|
|
230
331
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
231
332
|
readonly description: "Toggle Full-Auto Mode for the active session [on|off]";
|
|
232
333
|
readonly args: "on, off";
|
|
233
334
|
readonly details: "Toggles Full-Auto Mode which enables autonomous execution without confirmation prompts. When enabled, the architect proceeds through implementation steps automatically. Session-scoped — resets on new session. Use \"on\" or \"off\" to set explicitly, or toggle with no argument.";
|
|
335
|
+
readonly category: "utility";
|
|
234
336
|
};
|
|
235
337
|
readonly 'write-retro': {
|
|
236
338
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
237
339
|
readonly description: "Write a retrospective evidence bundle for a completed phase <json>";
|
|
238
340
|
readonly details: "Writes retrospective evidence bundle to .swarm/evidence/retro-{phase}/evidence.json. Required JSON: phase, summary, task_count, task_complexity, total_tool_calls, coder_revisions, reviewer_rejections, test_failures, security_findings, integration_issues. Optional: lessons_learned (max 5), top_rejection_reasons, task_id, metadata.";
|
|
239
341
|
readonly args: "<json: {phase, summary, task_count, task_complexity, ...}>";
|
|
342
|
+
readonly category: "utility";
|
|
240
343
|
};
|
|
241
344
|
readonly 'knowledge migrate': {
|
|
242
345
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -244,6 +347,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
244
347
|
readonly subcommandOf: "knowledge";
|
|
245
348
|
readonly details: "One-time migration from .swarm/context.md SME cache to .swarm/knowledge.jsonl. Skips if sentinel file .swarm/.knowledge-migrated exists, if context.md is absent, or if context.md is empty. Reports entries migrated, dropped (validation/dedup), and total processed.";
|
|
246
349
|
readonly args: "<directory>";
|
|
350
|
+
readonly category: "utility";
|
|
247
351
|
};
|
|
248
352
|
readonly 'knowledge quarantine': {
|
|
249
353
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -251,6 +355,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
251
355
|
readonly subcommandOf: "knowledge";
|
|
252
356
|
readonly details: "Moves a knowledge entry to quarantine with optional reason string (defaults to \"Quarantined via /swarm knowledge quarantine command\"). Validates entry ID format (1-64 alphanumeric/hyphen/underscore). Quarantined entries are excluded from knowledge queries.";
|
|
253
357
|
readonly args: "<entry-id> [reason]";
|
|
358
|
+
readonly category: "utility";
|
|
254
359
|
};
|
|
255
360
|
readonly 'knowledge restore': {
|
|
256
361
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -258,25 +363,43 @@ export declare const COMMAND_REGISTRY: {
|
|
|
258
363
|
readonly subcommandOf: "knowledge";
|
|
259
364
|
readonly details: "Restores a quarantined knowledge entry back to the active knowledge store by ID. Validates entry ID format (1-64 alphanumeric/hyphen/underscore). Entry must currently be in quarantine state.";
|
|
260
365
|
readonly args: "<entry-id>";
|
|
366
|
+
readonly category: "utility";
|
|
261
367
|
};
|
|
262
368
|
readonly knowledge: {
|
|
263
369
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
264
370
|
readonly description: "List knowledge entries";
|
|
371
|
+
readonly category: "utility";
|
|
265
372
|
};
|
|
266
373
|
readonly checkpoint: {
|
|
267
374
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
268
375
|
readonly description: "Manage project checkpoints [save|restore|delete|list] <label>";
|
|
269
376
|
readonly details: "save: creates named snapshot of current .swarm/ state. restore: soft-resets to checkpoint by overwriting current .swarm/ files. delete: removes named checkpoint. list: shows all checkpoints with timestamps. All subcommands require a label except list.";
|
|
270
377
|
readonly args: "<save|restore|delete|list> <label>";
|
|
378
|
+
readonly category: "utility";
|
|
271
379
|
};
|
|
272
380
|
};
|
|
273
381
|
export type RegisteredCommand = keyof typeof COMMAND_REGISTRY;
|
|
274
382
|
export declare const VALID_COMMANDS: RegisteredCommand[];
|
|
383
|
+
/**
|
|
384
|
+
* Validates alias configuration in COMMAND_REGISTRY.
|
|
385
|
+
* Checks for:
|
|
386
|
+
* - aliasOf pointing to an existing command
|
|
387
|
+
* - circular alias chains (A → B → C → A)
|
|
388
|
+
* - duplicate alias targets (multiple aliases for different commands) — logged as warning, not error
|
|
389
|
+
*/
|
|
390
|
+
export declare function validateAliases(): {
|
|
391
|
+
valid: boolean;
|
|
392
|
+
errors: string[];
|
|
393
|
+
warnings: string[];
|
|
394
|
+
};
|
|
275
395
|
/**
|
|
276
396
|
* Resolves compound commands like "evidence summary" and "config doctor".
|
|
277
397
|
* Tries a two-token compound key first, then falls back to a single-token key.
|
|
398
|
+
* Returns a warning if the resolved command is a deprecated alias.
|
|
278
399
|
*/
|
|
279
400
|
export declare function resolveCommand(tokens: string[]): {
|
|
280
401
|
entry: CommandEntry;
|
|
281
402
|
remainingArgs: string[];
|
|
403
|
+
key: string;
|
|
404
|
+
warning?: string;
|
|
282
405
|
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,6 +23,10 @@ export declare const WRITE_TOOL_NAMES: readonly ["write", "edit", "patch", "appl
|
|
|
23
23
|
export type WriteToolName = (typeof WRITE_TOOL_NAMES)[number];
|
|
24
24
|
export declare const TOOL_DESCRIPTIONS: Partial<Record<ToolName, string>>;
|
|
25
25
|
export declare const DEFAULT_MODELS: Record<string, string>;
|
|
26
|
+
export declare const DEFAULT_AGENT_CONFIGS: Record<string, {
|
|
27
|
+
model: string;
|
|
28
|
+
fallback_models: string[];
|
|
29
|
+
}>;
|
|
26
30
|
export declare function isQAAgent(name: string): name is QAAgentName;
|
|
27
31
|
export declare function isSubagent(name: string): boolean;
|
|
28
32
|
import type { ScoringConfig } from './schema';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates .opencode/opencode-swarm.json in the given directory if it does not
|
|
3
|
+
* already exist. Uses an atomic exclusive write (flag 'wx') so concurrent
|
|
4
|
+
* plugin loads never double-write or corrupt the file.
|
|
5
|
+
*
|
|
6
|
+
* Non-fatal: any fs error (permissions, disk full, etc.) is swallowed so the
|
|
7
|
+
* plugin continues with its default or global config.
|
|
8
|
+
*/
|
|
9
|
+
export declare function writeProjectConfigIfNew(directory: string, quiet?: boolean): void;
|
|
10
|
+
/**
|
|
11
|
+
* Writes .swarm/config.example.json on first plugin init for a given project.
|
|
12
|
+
* Creates .swarm/ if it does not yet exist. Non-fatal: all errors are silently
|
|
13
|
+
* ignored.
|
|
14
|
+
*/
|
|
15
|
+
export declare function writeSwarmConfigExampleIfNew(projectDirectory: string): void;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -643,6 +643,26 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
643
643
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
644
644
|
fallback_models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
645
645
|
}, z.core.$strip>>>;
|
|
646
|
+
default_agent: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
647
|
+
architect: "architect";
|
|
648
|
+
sme: "sme";
|
|
649
|
+
docs: "docs";
|
|
650
|
+
designer: "designer";
|
|
651
|
+
critic_sounding_board: "critic_sounding_board";
|
|
652
|
+
critic_drift_verifier: "critic_drift_verifier";
|
|
653
|
+
critic_hallucination_verifier: "critic_hallucination_verifier";
|
|
654
|
+
curator_init: "curator_init";
|
|
655
|
+
curator_phase: "curator_phase";
|
|
656
|
+
council_generalist: "council_generalist";
|
|
657
|
+
council_skeptic: "council_skeptic";
|
|
658
|
+
council_domain_expert: "council_domain_expert";
|
|
659
|
+
reviewer: "reviewer";
|
|
660
|
+
critic: "critic";
|
|
661
|
+
critic_oversight: "critic_oversight";
|
|
662
|
+
explorer: "explorer";
|
|
663
|
+
coder: "coder";
|
|
664
|
+
test_engineer: "test_engineer";
|
|
665
|
+
}>>>;
|
|
646
666
|
swarms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
647
667
|
name: z.ZodOptional<z.ZodString>;
|
|
648
668
|
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|