opencode-swarm 6.60.1 → 6.61.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/dist/agents/architect.commands-list.adversarial.test.d.ts +1 -0
- package/dist/agents/architect.commands-list.test.d.ts +1 -0
- package/dist/cli/index.js +75 -28
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.help-text.test.d.ts +1 -0
- package/dist/commands/registry-documentation.test.d.ts +1 -0
- package/dist/commands/registry-type.test.d.ts +1 -0
- package/dist/commands/registry.d.ts +59 -1
- package/dist/index.js +250 -37
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli/index.js
CHANGED
|
@@ -42655,7 +42655,8 @@ Run \`/swarm evidence ${result.task_id ?? "unknown"}\` to view it, or \`/swarm s
|
|
|
42655
42655
|
var COMMAND_REGISTRY = {
|
|
42656
42656
|
"acknowledge-spec-drift": {
|
|
42657
42657
|
handler: (ctx) => handleAcknowledgeSpecDriftCommand(ctx.directory, ctx.args),
|
|
42658
|
-
description: "Acknowledge that the spec has drifted from the plan and suppress further warnings"
|
|
42658
|
+
description: "Acknowledge that the spec has drifted from the plan and suppress further warnings",
|
|
42659
|
+
args: ""
|
|
42659
42660
|
},
|
|
42660
42661
|
status: {
|
|
42661
42662
|
handler: (ctx) => handleStatusCommand(ctx.directory, ctx.agents),
|
|
@@ -42701,112 +42702,156 @@ var COMMAND_REGISTRY = {
|
|
|
42701
42702
|
},
|
|
42702
42703
|
"sync-plan": {
|
|
42703
42704
|
handler: (ctx) => handleSyncPlanCommand(ctx.directory, ctx.args),
|
|
42704
|
-
description: "Ensure plan.json and plan.md are synced"
|
|
42705
|
+
description: "Ensure plan.json and plan.md are synced",
|
|
42706
|
+
args: ""
|
|
42705
42707
|
},
|
|
42706
42708
|
benchmark: {
|
|
42707
42709
|
handler: (ctx) => handleBenchmarkCommand(ctx.directory, ctx.args),
|
|
42708
|
-
description: "Show performance metrics [--cumulative] [--ci-gate]"
|
|
42710
|
+
description: "Show performance metrics [--cumulative] [--ci-gate]",
|
|
42711
|
+
args: "--cumulative, --ci-gate"
|
|
42709
42712
|
},
|
|
42710
42713
|
export: {
|
|
42711
42714
|
handler: (ctx) => handleExportCommand(ctx.directory, ctx.args),
|
|
42712
|
-
description: "Export plan and context as JSON"
|
|
42715
|
+
description: "Export plan and context as JSON",
|
|
42716
|
+
args: "",
|
|
42717
|
+
details: "Exports the current plan and context as JSON to stdout. Useful for piping to external tools or debugging swarm state."
|
|
42713
42718
|
},
|
|
42714
42719
|
evidence: {
|
|
42715
42720
|
handler: (ctx) => handleEvidenceCommand(ctx.directory, ctx.args),
|
|
42716
|
-
description: "Show evidence bundles [taskId]"
|
|
42721
|
+
description: "Show evidence bundles [taskId]",
|
|
42722
|
+
args: "<taskId>",
|
|
42723
|
+
details: 'Displays review results, test verdicts, and other evidence bundles for the given task ID (e.g., "2.1").'
|
|
42717
42724
|
},
|
|
42718
42725
|
"evidence summary": {
|
|
42719
42726
|
handler: (ctx) => handleEvidenceSummaryCommand(ctx.directory),
|
|
42720
42727
|
description: "Generate evidence summary with completion ratio and blockers",
|
|
42721
|
-
subcommandOf: "evidence"
|
|
42728
|
+
subcommandOf: "evidence",
|
|
42729
|
+
args: "",
|
|
42730
|
+
details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence."
|
|
42722
42731
|
},
|
|
42723
42732
|
"evidence-summary": {
|
|
42724
42733
|
handler: (ctx) => handleEvidenceSummaryCommand(ctx.directory),
|
|
42725
42734
|
description: "Generate evidence summary with completion ratio and blockers",
|
|
42726
|
-
subcommandOf: "evidence"
|
|
42735
|
+
subcommandOf: "evidence",
|
|
42736
|
+
args: "",
|
|
42737
|
+
details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence."
|
|
42727
42738
|
},
|
|
42728
42739
|
archive: {
|
|
42729
42740
|
handler: (ctx) => handleArchiveCommand(ctx.directory, ctx.args),
|
|
42730
|
-
description: "Archive old evidence bundles [--dry-run]"
|
|
42741
|
+
description: "Archive old evidence bundles [--dry-run]",
|
|
42742
|
+
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.",
|
|
42743
|
+
args: "--dry-run"
|
|
42731
42744
|
},
|
|
42732
42745
|
curate: {
|
|
42733
42746
|
handler: (ctx) => handleCurateCommand(ctx.directory, ctx.args),
|
|
42734
|
-
description: "Run knowledge curation and hive promotion review"
|
|
42747
|
+
description: "Run knowledge curation and hive promotion review",
|
|
42748
|
+
args: ""
|
|
42735
42749
|
},
|
|
42736
42750
|
"dark-matter": {
|
|
42737
42751
|
handler: (ctx) => handleDarkMatterCommand(ctx.directory, ctx.args),
|
|
42738
|
-
description: "Detect hidden file couplings via co-change NPMI analysis"
|
|
42752
|
+
description: "Detect hidden file couplings via co-change NPMI analysis",
|
|
42753
|
+
args: "--threshold <number>, --min-commits <number>"
|
|
42739
42754
|
},
|
|
42740
42755
|
close: {
|
|
42741
42756
|
handler: (ctx) => handleCloseCommand(ctx.directory, ctx.args),
|
|
42742
|
-
description: "Use /swarm close to close the swarm project and archive evidence"
|
|
42757
|
+
description: "Use /swarm close to close the swarm project and archive evidence",
|
|
42758
|
+
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.",
|
|
42759
|
+
args: "--prune-branches"
|
|
42743
42760
|
},
|
|
42744
42761
|
simulate: {
|
|
42745
42762
|
handler: (ctx) => handleSimulateCommand(ctx.directory, ctx.args),
|
|
42746
|
-
description: "Dry-run
|
|
42763
|
+
description: "Dry-run hidden coupling analysis with configurable thresholds",
|
|
42764
|
+
args: "--threshold <number>, --min-commits <number>"
|
|
42747
42765
|
},
|
|
42748
42766
|
analyze: {
|
|
42749
42767
|
handler: (ctx) => handleAnalyzeCommand(ctx.directory, ctx.args),
|
|
42750
|
-
description: "Analyze spec.md vs plan.md for requirement coverage gaps"
|
|
42768
|
+
description: "Analyze spec.md vs plan.md for requirement coverage gaps",
|
|
42769
|
+
args: ""
|
|
42751
42770
|
},
|
|
42752
42771
|
clarify: {
|
|
42753
42772
|
handler: (ctx) => handleClarifyCommand(ctx.directory, ctx.args),
|
|
42754
|
-
description: "Clarify and refine an existing feature specification"
|
|
42773
|
+
description: "Clarify and refine an existing feature specification",
|
|
42774
|
+
args: "[description-text]"
|
|
42755
42775
|
},
|
|
42756
42776
|
specify: {
|
|
42757
42777
|
handler: (ctx) => handleSpecifyCommand(ctx.directory, ctx.args),
|
|
42758
|
-
description: "Generate or import a feature specification [description]"
|
|
42778
|
+
description: "Generate or import a feature specification [description]",
|
|
42779
|
+
args: "[description-text]"
|
|
42759
42780
|
},
|
|
42760
42781
|
promote: {
|
|
42761
42782
|
handler: (ctx) => handlePromoteCommand(ctx.directory, ctx.args),
|
|
42762
|
-
description: "Manually promote lesson to hive knowledge"
|
|
42783
|
+
description: "Manually promote lesson to hive knowledge",
|
|
42784
|
+
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.",
|
|
42785
|
+
args: "--category <category>, --from-swarm <lesson-id>, <lesson-text>"
|
|
42763
42786
|
},
|
|
42764
42787
|
reset: {
|
|
42765
42788
|
handler: (ctx) => handleResetCommand(ctx.directory, ctx.args),
|
|
42766
|
-
description: "Clear swarm state files [--confirm]"
|
|
42789
|
+
description: "Clear swarm state files [--confirm]",
|
|
42790
|
+
details: "DELETES plan.md, context.md, and summaries/ directory from .swarm/. Stops background automation and clears in-memory queues. SAFETY: requires --confirm flag \u2014 without it, displays a warning and tips to export first.",
|
|
42791
|
+
args: "--confirm (required)"
|
|
42767
42792
|
},
|
|
42768
42793
|
"reset-session": {
|
|
42769
42794
|
handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args),
|
|
42770
|
-
description: "Clear session state while preserving plan, evidence, and knowledge"
|
|
42795
|
+
description: "Clear session state while preserving plan, evidence, and knowledge",
|
|
42796
|
+
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.",
|
|
42797
|
+
args: ""
|
|
42771
42798
|
},
|
|
42772
42799
|
rollback: {
|
|
42773
42800
|
handler: (ctx) => handleRollbackCommand(ctx.directory, ctx.args),
|
|
42774
|
-
description: "Restore swarm state to a checkpoint <phase>"
|
|
42801
|
+
description: "Restore swarm state to a checkpoint <phase>",
|
|
42802
|
+
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.",
|
|
42803
|
+
args: "<phase-number>"
|
|
42775
42804
|
},
|
|
42776
42805
|
retrieve: {
|
|
42777
42806
|
handler: (ctx) => handleRetrieveCommand(ctx.directory, ctx.args),
|
|
42778
|
-
description: "Retrieve full output from a summary <id>"
|
|
42807
|
+
description: "Retrieve full output from a summary <id>",
|
|
42808
|
+
args: "<summary-id>",
|
|
42809
|
+
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."
|
|
42779
42810
|
},
|
|
42780
42811
|
handoff: {
|
|
42781
42812
|
handler: (ctx) => handleHandoffCommand(ctx.directory, ctx.args),
|
|
42782
|
-
description: "Prepare state for clean model switch (new session)"
|
|
42813
|
+
description: "Prepare state for clean model switch (new session)",
|
|
42814
|
+
args: "",
|
|
42815
|
+
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."
|
|
42783
42816
|
},
|
|
42784
42817
|
turbo: {
|
|
42785
42818
|
handler: (ctx) => handleTurboCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
42786
|
-
description: "Toggle Turbo Mode for the active session [on|off]"
|
|
42819
|
+
description: "Toggle Turbo Mode for the active session [on|off]",
|
|
42820
|
+
args: "on, off",
|
|
42821
|
+
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 \u2014 resets on new session. Use "on" or "off" to set explicitly, or toggle with no argument.'
|
|
42787
42822
|
},
|
|
42788
42823
|
"full-auto": {
|
|
42789
42824
|
handler: (ctx) => handleFullAutoCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
42790
|
-
description: "Toggle Full-Auto Mode for the active session [on|off]"
|
|
42825
|
+
description: "Toggle Full-Auto Mode for the active session [on|off]",
|
|
42826
|
+
args: "on, off",
|
|
42827
|
+
details: 'Toggles Full-Auto Mode which enables autonomous execution without confirmation prompts. When enabled, the architect proceeds through implementation steps automatically. Session-scoped \u2014 resets on new session. Use "on" or "off" to set explicitly, or toggle with no argument.'
|
|
42791
42828
|
},
|
|
42792
42829
|
"write-retro": {
|
|
42793
42830
|
handler: (ctx) => handleWriteRetroCommand(ctx.directory, ctx.args),
|
|
42794
|
-
description: "Write a retrospective evidence bundle for a completed phase <json>"
|
|
42831
|
+
description: "Write a retrospective evidence bundle for a completed phase <json>",
|
|
42832
|
+
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.",
|
|
42833
|
+
args: "<json: {phase, summary, task_count, task_complexity, ...}>"
|
|
42795
42834
|
},
|
|
42796
42835
|
"knowledge migrate": {
|
|
42797
42836
|
handler: (ctx) => handleKnowledgeMigrateCommand(ctx.directory, ctx.args),
|
|
42798
42837
|
description: "Migrate knowledge entries to the current format",
|
|
42799
|
-
subcommandOf: "knowledge"
|
|
42838
|
+
subcommandOf: "knowledge",
|
|
42839
|
+
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.",
|
|
42840
|
+
args: "<directory>"
|
|
42800
42841
|
},
|
|
42801
42842
|
"knowledge quarantine": {
|
|
42802
42843
|
handler: (ctx) => handleKnowledgeQuarantineCommand(ctx.directory, ctx.args),
|
|
42803
42844
|
description: "Move a knowledge entry to quarantine <id> [reason]",
|
|
42804
|
-
subcommandOf: "knowledge"
|
|
42845
|
+
subcommandOf: "knowledge",
|
|
42846
|
+
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.',
|
|
42847
|
+
args: "<entry-id> [reason]"
|
|
42805
42848
|
},
|
|
42806
42849
|
"knowledge restore": {
|
|
42807
42850
|
handler: (ctx) => handleKnowledgeRestoreCommand(ctx.directory, ctx.args),
|
|
42808
42851
|
description: "Restore a quarantined knowledge entry <id>",
|
|
42809
|
-
subcommandOf: "knowledge"
|
|
42852
|
+
subcommandOf: "knowledge",
|
|
42853
|
+
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.",
|
|
42854
|
+
args: "<entry-id>"
|
|
42810
42855
|
},
|
|
42811
42856
|
knowledge: {
|
|
42812
42857
|
handler: (ctx) => handleKnowledgeListCommand(ctx.directory, ctx.args),
|
|
@@ -42814,7 +42859,9 @@ var COMMAND_REGISTRY = {
|
|
|
42814
42859
|
},
|
|
42815
42860
|
checkpoint: {
|
|
42816
42861
|
handler: (ctx) => handleCheckpointCommand(ctx.directory, ctx.args),
|
|
42817
|
-
description: "Manage project checkpoints [save|restore|delete|list] <label>"
|
|
42862
|
+
description: "Manage project checkpoints [save|restore|delete|list] <label>",
|
|
42863
|
+
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.",
|
|
42864
|
+
args: "<save|restore|delete|list> <label>"
|
|
42818
42865
|
}
|
|
42819
42866
|
};
|
|
42820
42867
|
var VALID_COMMANDS = Object.keys(COMMAND_REGISTRY);
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export { handleStatusCommand } from './status';
|
|
|
33
33
|
export { handleSyncPlanCommand } from './sync-plan';
|
|
34
34
|
export { handleTurboCommand } from './turbo';
|
|
35
35
|
export { handleWriteRetroCommand } from './write-retro';
|
|
36
|
+
export declare function buildHelpText(): string;
|
|
36
37
|
/**
|
|
37
38
|
* Creates a command.execute.before handler for /swarm commands.
|
|
38
39
|
* Uses factory pattern to close over directory and agents.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,11 +12,23 @@ export type CommandEntry = {
|
|
|
12
12
|
description: string;
|
|
13
13
|
/** If true, this command is only accessible as a sub-key of a parent command */
|
|
14
14
|
subcommandOf?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 2-3 line behavioral summary: what the command does step-by-step,
|
|
17
|
+
* side effects, and safety guarantees.
|
|
18
|
+
*/
|
|
19
|
+
details?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Documents flags and positional arguments. Format: flags comma-separated with
|
|
22
|
+
* double-dash prefix, positional args in angle brackets.
|
|
23
|
+
* Example: args: '--dry-run, --confirm, <phase-number>'
|
|
24
|
+
*/
|
|
25
|
+
args?: string;
|
|
15
26
|
};
|
|
16
27
|
export declare const COMMAND_REGISTRY: {
|
|
17
28
|
readonly 'acknowledge-spec-drift': {
|
|
18
29
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
19
30
|
readonly description: "Acknowledge that the spec has drifted from the plan and suppress further warnings";
|
|
31
|
+
readonly args: "";
|
|
20
32
|
};
|
|
21
33
|
readonly status: {
|
|
22
34
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -63,111 +75,155 @@ export declare const COMMAND_REGISTRY: {
|
|
|
63
75
|
readonly 'sync-plan': {
|
|
64
76
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
65
77
|
readonly description: "Ensure plan.json and plan.md are synced";
|
|
78
|
+
readonly args: "";
|
|
66
79
|
};
|
|
67
80
|
readonly benchmark: {
|
|
68
81
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
69
82
|
readonly description: "Show performance metrics [--cumulative] [--ci-gate]";
|
|
83
|
+
readonly args: "--cumulative, --ci-gate";
|
|
70
84
|
};
|
|
71
85
|
readonly export: {
|
|
72
86
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
73
87
|
readonly description: "Export plan and context as JSON";
|
|
88
|
+
readonly args: "";
|
|
89
|
+
readonly details: "Exports the current plan and context as JSON to stdout. Useful for piping to external tools or debugging swarm state.";
|
|
74
90
|
};
|
|
75
91
|
readonly evidence: {
|
|
76
92
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
77
93
|
readonly description: "Show evidence bundles [taskId]";
|
|
94
|
+
readonly args: "<taskId>";
|
|
95
|
+
readonly details: "Displays review results, test verdicts, and other evidence bundles for the given task ID (e.g., \"2.1\").";
|
|
78
96
|
};
|
|
79
97
|
readonly 'evidence summary': {
|
|
80
98
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
81
99
|
readonly description: "Generate evidence summary with completion ratio and blockers";
|
|
82
100
|
readonly subcommandOf: "evidence";
|
|
101
|
+
readonly args: "";
|
|
102
|
+
readonly details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence.";
|
|
83
103
|
};
|
|
84
104
|
readonly 'evidence-summary': {
|
|
85
105
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
86
106
|
readonly description: "Generate evidence summary with completion ratio and blockers";
|
|
87
107
|
readonly subcommandOf: "evidence";
|
|
108
|
+
readonly args: "";
|
|
109
|
+
readonly details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence.";
|
|
88
110
|
};
|
|
89
111
|
readonly archive: {
|
|
90
112
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
91
113
|
readonly description: "Archive old evidence bundles [--dry-run]";
|
|
114
|
+
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.";
|
|
115
|
+
readonly args: "--dry-run";
|
|
92
116
|
};
|
|
93
117
|
readonly curate: {
|
|
94
118
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
95
119
|
readonly description: "Run knowledge curation and hive promotion review";
|
|
120
|
+
readonly args: "";
|
|
96
121
|
};
|
|
97
122
|
readonly 'dark-matter': {
|
|
98
123
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
99
124
|
readonly description: "Detect hidden file couplings via co-change NPMI analysis";
|
|
125
|
+
readonly args: "--threshold <number>, --min-commits <number>";
|
|
100
126
|
};
|
|
101
127
|
readonly close: {
|
|
102
128
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
103
129
|
readonly description: "Use /swarm close to close the swarm project and archive evidence";
|
|
130
|
+
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.";
|
|
131
|
+
readonly args: "--prune-branches";
|
|
104
132
|
};
|
|
105
133
|
readonly simulate: {
|
|
106
134
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
107
|
-
readonly description: "Dry-run
|
|
135
|
+
readonly description: "Dry-run hidden coupling analysis with configurable thresholds";
|
|
136
|
+
readonly args: "--threshold <number>, --min-commits <number>";
|
|
108
137
|
};
|
|
109
138
|
readonly analyze: {
|
|
110
139
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
111
140
|
readonly description: "Analyze spec.md vs plan.md for requirement coverage gaps";
|
|
141
|
+
readonly args: "";
|
|
112
142
|
};
|
|
113
143
|
readonly clarify: {
|
|
114
144
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
115
145
|
readonly description: "Clarify and refine an existing feature specification";
|
|
146
|
+
readonly args: "[description-text]";
|
|
116
147
|
};
|
|
117
148
|
readonly specify: {
|
|
118
149
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
119
150
|
readonly description: "Generate or import a feature specification [description]";
|
|
151
|
+
readonly args: "[description-text]";
|
|
120
152
|
};
|
|
121
153
|
readonly promote: {
|
|
122
154
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
123
155
|
readonly description: "Manually promote lesson to hive knowledge";
|
|
156
|
+
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.";
|
|
157
|
+
readonly args: "--category <category>, --from-swarm <lesson-id>, <lesson-text>";
|
|
124
158
|
};
|
|
125
159
|
readonly reset: {
|
|
126
160
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
127
161
|
readonly description: "Clear swarm state files [--confirm]";
|
|
162
|
+
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.";
|
|
163
|
+
readonly args: "--confirm (required)";
|
|
128
164
|
};
|
|
129
165
|
readonly 'reset-session': {
|
|
130
166
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
131
167
|
readonly description: "Clear session state while preserving plan, evidence, and knowledge";
|
|
168
|
+
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.";
|
|
169
|
+
readonly args: "";
|
|
132
170
|
};
|
|
133
171
|
readonly rollback: {
|
|
134
172
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
135
173
|
readonly description: "Restore swarm state to a checkpoint <phase>";
|
|
174
|
+
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.";
|
|
175
|
+
readonly args: "<phase-number>";
|
|
136
176
|
};
|
|
137
177
|
readonly retrieve: {
|
|
138
178
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
139
179
|
readonly description: "Retrieve full output from a summary <id>";
|
|
180
|
+
readonly args: "<summary-id>";
|
|
181
|
+
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.";
|
|
140
182
|
};
|
|
141
183
|
readonly handoff: {
|
|
142
184
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
143
185
|
readonly description: "Prepare state for clean model switch (new session)";
|
|
186
|
+
readonly args: "";
|
|
187
|
+
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.";
|
|
144
188
|
};
|
|
145
189
|
readonly turbo: {
|
|
146
190
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
147
191
|
readonly description: "Toggle Turbo Mode for the active session [on|off]";
|
|
192
|
+
readonly args: "on, off";
|
|
193
|
+
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.";
|
|
148
194
|
};
|
|
149
195
|
readonly 'full-auto': {
|
|
150
196
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
151
197
|
readonly description: "Toggle Full-Auto Mode for the active session [on|off]";
|
|
198
|
+
readonly args: "on, off";
|
|
199
|
+
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.";
|
|
152
200
|
};
|
|
153
201
|
readonly 'write-retro': {
|
|
154
202
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
155
203
|
readonly description: "Write a retrospective evidence bundle for a completed phase <json>";
|
|
204
|
+
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.";
|
|
205
|
+
readonly args: "<json: {phase, summary, task_count, task_complexity, ...}>";
|
|
156
206
|
};
|
|
157
207
|
readonly 'knowledge migrate': {
|
|
158
208
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
159
209
|
readonly description: "Migrate knowledge entries to the current format";
|
|
160
210
|
readonly subcommandOf: "knowledge";
|
|
211
|
+
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.";
|
|
212
|
+
readonly args: "<directory>";
|
|
161
213
|
};
|
|
162
214
|
readonly 'knowledge quarantine': {
|
|
163
215
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
164
216
|
readonly description: "Move a knowledge entry to quarantine <id> [reason]";
|
|
165
217
|
readonly subcommandOf: "knowledge";
|
|
218
|
+
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.";
|
|
219
|
+
readonly args: "<entry-id> [reason]";
|
|
166
220
|
};
|
|
167
221
|
readonly 'knowledge restore': {
|
|
168
222
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
169
223
|
readonly description: "Restore a quarantined knowledge entry <id>";
|
|
170
224
|
readonly subcommandOf: "knowledge";
|
|
225
|
+
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.";
|
|
226
|
+
readonly args: "<entry-id>";
|
|
171
227
|
};
|
|
172
228
|
readonly knowledge: {
|
|
173
229
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
@@ -176,6 +232,8 @@ export declare const COMMAND_REGISTRY: {
|
|
|
176
232
|
readonly checkpoint: {
|
|
177
233
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
178
234
|
readonly description: "Manage project checkpoints [save|restore|delete|list] <label>";
|
|
235
|
+
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.";
|
|
236
|
+
readonly args: "<save|restore|delete|list> <label>";
|
|
179
237
|
};
|
|
180
238
|
};
|
|
181
239
|
export type RegisteredCommand = keyof typeof COMMAND_REGISTRY;
|
package/dist/index.js
CHANGED
|
@@ -41328,7 +41328,7 @@ async function scanDocIndex(directory) {
|
|
|
41328
41328
|
try {
|
|
41329
41329
|
const fullPath = path46.join(directory, file3.path);
|
|
41330
41330
|
const stat2 = fs34.statSync(fullPath);
|
|
41331
|
-
if (stat2.mtimeMs >
|
|
41331
|
+
if (stat2.mtimeMs > file3.mtime) {
|
|
41332
41332
|
cacheValid = false;
|
|
41333
41333
|
break;
|
|
41334
41334
|
}
|
|
@@ -53049,7 +53049,8 @@ Run \`/swarm evidence ${result.task_id ?? "unknown"}\` to view it, or \`/swarm s
|
|
|
53049
53049
|
var COMMAND_REGISTRY = {
|
|
53050
53050
|
"acknowledge-spec-drift": {
|
|
53051
53051
|
handler: (ctx) => handleAcknowledgeSpecDriftCommand(ctx.directory, ctx.args),
|
|
53052
|
-
description: "Acknowledge that the spec has drifted from the plan and suppress further warnings"
|
|
53052
|
+
description: "Acknowledge that the spec has drifted from the plan and suppress further warnings",
|
|
53053
|
+
args: ""
|
|
53053
53054
|
},
|
|
53054
53055
|
status: {
|
|
53055
53056
|
handler: (ctx) => handleStatusCommand(ctx.directory, ctx.agents),
|
|
@@ -53095,112 +53096,156 @@ var COMMAND_REGISTRY = {
|
|
|
53095
53096
|
},
|
|
53096
53097
|
"sync-plan": {
|
|
53097
53098
|
handler: (ctx) => handleSyncPlanCommand(ctx.directory, ctx.args),
|
|
53098
|
-
description: "Ensure plan.json and plan.md are synced"
|
|
53099
|
+
description: "Ensure plan.json and plan.md are synced",
|
|
53100
|
+
args: ""
|
|
53099
53101
|
},
|
|
53100
53102
|
benchmark: {
|
|
53101
53103
|
handler: (ctx) => handleBenchmarkCommand(ctx.directory, ctx.args),
|
|
53102
|
-
description: "Show performance metrics [--cumulative] [--ci-gate]"
|
|
53104
|
+
description: "Show performance metrics [--cumulative] [--ci-gate]",
|
|
53105
|
+
args: "--cumulative, --ci-gate"
|
|
53103
53106
|
},
|
|
53104
53107
|
export: {
|
|
53105
53108
|
handler: (ctx) => handleExportCommand(ctx.directory, ctx.args),
|
|
53106
|
-
description: "Export plan and context as JSON"
|
|
53109
|
+
description: "Export plan and context as JSON",
|
|
53110
|
+
args: "",
|
|
53111
|
+
details: "Exports the current plan and context as JSON to stdout. Useful for piping to external tools or debugging swarm state."
|
|
53107
53112
|
},
|
|
53108
53113
|
evidence: {
|
|
53109
53114
|
handler: (ctx) => handleEvidenceCommand(ctx.directory, ctx.args),
|
|
53110
|
-
description: "Show evidence bundles [taskId]"
|
|
53115
|
+
description: "Show evidence bundles [taskId]",
|
|
53116
|
+
args: "<taskId>",
|
|
53117
|
+
details: 'Displays review results, test verdicts, and other evidence bundles for the given task ID (e.g., "2.1").'
|
|
53111
53118
|
},
|
|
53112
53119
|
"evidence summary": {
|
|
53113
53120
|
handler: (ctx) => handleEvidenceSummaryCommand(ctx.directory),
|
|
53114
53121
|
description: "Generate evidence summary with completion ratio and blockers",
|
|
53115
|
-
subcommandOf: "evidence"
|
|
53122
|
+
subcommandOf: "evidence",
|
|
53123
|
+
args: "",
|
|
53124
|
+
details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence."
|
|
53116
53125
|
},
|
|
53117
53126
|
"evidence-summary": {
|
|
53118
53127
|
handler: (ctx) => handleEvidenceSummaryCommand(ctx.directory),
|
|
53119
53128
|
description: "Generate evidence summary with completion ratio and blockers",
|
|
53120
|
-
subcommandOf: "evidence"
|
|
53129
|
+
subcommandOf: "evidence",
|
|
53130
|
+
args: "",
|
|
53131
|
+
details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence."
|
|
53121
53132
|
},
|
|
53122
53133
|
archive: {
|
|
53123
53134
|
handler: (ctx) => handleArchiveCommand(ctx.directory, ctx.args),
|
|
53124
|
-
description: "Archive old evidence bundles [--dry-run]"
|
|
53135
|
+
description: "Archive old evidence bundles [--dry-run]",
|
|
53136
|
+
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.",
|
|
53137
|
+
args: "--dry-run"
|
|
53125
53138
|
},
|
|
53126
53139
|
curate: {
|
|
53127
53140
|
handler: (ctx) => handleCurateCommand(ctx.directory, ctx.args),
|
|
53128
|
-
description: "Run knowledge curation and hive promotion review"
|
|
53141
|
+
description: "Run knowledge curation and hive promotion review",
|
|
53142
|
+
args: ""
|
|
53129
53143
|
},
|
|
53130
53144
|
"dark-matter": {
|
|
53131
53145
|
handler: (ctx) => handleDarkMatterCommand(ctx.directory, ctx.args),
|
|
53132
|
-
description: "Detect hidden file couplings via co-change NPMI analysis"
|
|
53146
|
+
description: "Detect hidden file couplings via co-change NPMI analysis",
|
|
53147
|
+
args: "--threshold <number>, --min-commits <number>"
|
|
53133
53148
|
},
|
|
53134
53149
|
close: {
|
|
53135
53150
|
handler: (ctx) => handleCloseCommand(ctx.directory, ctx.args),
|
|
53136
|
-
description: "Use /swarm close to close the swarm project and archive evidence"
|
|
53151
|
+
description: "Use /swarm close to close the swarm project and archive evidence",
|
|
53152
|
+
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.",
|
|
53153
|
+
args: "--prune-branches"
|
|
53137
53154
|
},
|
|
53138
53155
|
simulate: {
|
|
53139
53156
|
handler: (ctx) => handleSimulateCommand(ctx.directory, ctx.args),
|
|
53140
|
-
description: "Dry-run
|
|
53157
|
+
description: "Dry-run hidden coupling analysis with configurable thresholds",
|
|
53158
|
+
args: "--threshold <number>, --min-commits <number>"
|
|
53141
53159
|
},
|
|
53142
53160
|
analyze: {
|
|
53143
53161
|
handler: (ctx) => handleAnalyzeCommand(ctx.directory, ctx.args),
|
|
53144
|
-
description: "Analyze spec.md vs plan.md for requirement coverage gaps"
|
|
53162
|
+
description: "Analyze spec.md vs plan.md for requirement coverage gaps",
|
|
53163
|
+
args: ""
|
|
53145
53164
|
},
|
|
53146
53165
|
clarify: {
|
|
53147
53166
|
handler: (ctx) => handleClarifyCommand(ctx.directory, ctx.args),
|
|
53148
|
-
description: "Clarify and refine an existing feature specification"
|
|
53167
|
+
description: "Clarify and refine an existing feature specification",
|
|
53168
|
+
args: "[description-text]"
|
|
53149
53169
|
},
|
|
53150
53170
|
specify: {
|
|
53151
53171
|
handler: (ctx) => handleSpecifyCommand(ctx.directory, ctx.args),
|
|
53152
|
-
description: "Generate or import a feature specification [description]"
|
|
53172
|
+
description: "Generate or import a feature specification [description]",
|
|
53173
|
+
args: "[description-text]"
|
|
53153
53174
|
},
|
|
53154
53175
|
promote: {
|
|
53155
53176
|
handler: (ctx) => handlePromoteCommand(ctx.directory, ctx.args),
|
|
53156
|
-
description: "Manually promote lesson to hive knowledge"
|
|
53177
|
+
description: "Manually promote lesson to hive knowledge",
|
|
53178
|
+
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.",
|
|
53179
|
+
args: "--category <category>, --from-swarm <lesson-id>, <lesson-text>"
|
|
53157
53180
|
},
|
|
53158
53181
|
reset: {
|
|
53159
53182
|
handler: (ctx) => handleResetCommand(ctx.directory, ctx.args),
|
|
53160
|
-
description: "Clear swarm state files [--confirm]"
|
|
53183
|
+
description: "Clear swarm state files [--confirm]",
|
|
53184
|
+
details: "DELETES plan.md, context.md, and summaries/ directory from .swarm/. Stops background automation and clears in-memory queues. SAFETY: requires --confirm flag \u2014 without it, displays a warning and tips to export first.",
|
|
53185
|
+
args: "--confirm (required)"
|
|
53161
53186
|
},
|
|
53162
53187
|
"reset-session": {
|
|
53163
53188
|
handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args),
|
|
53164
|
-
description: "Clear session state while preserving plan, evidence, and knowledge"
|
|
53189
|
+
description: "Clear session state while preserving plan, evidence, and knowledge",
|
|
53190
|
+
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.",
|
|
53191
|
+
args: ""
|
|
53165
53192
|
},
|
|
53166
53193
|
rollback: {
|
|
53167
53194
|
handler: (ctx) => handleRollbackCommand(ctx.directory, ctx.args),
|
|
53168
|
-
description: "Restore swarm state to a checkpoint <phase>"
|
|
53195
|
+
description: "Restore swarm state to a checkpoint <phase>",
|
|
53196
|
+
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.",
|
|
53197
|
+
args: "<phase-number>"
|
|
53169
53198
|
},
|
|
53170
53199
|
retrieve: {
|
|
53171
53200
|
handler: (ctx) => handleRetrieveCommand(ctx.directory, ctx.args),
|
|
53172
|
-
description: "Retrieve full output from a summary <id>"
|
|
53201
|
+
description: "Retrieve full output from a summary <id>",
|
|
53202
|
+
args: "<summary-id>",
|
|
53203
|
+
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."
|
|
53173
53204
|
},
|
|
53174
53205
|
handoff: {
|
|
53175
53206
|
handler: (ctx) => handleHandoffCommand(ctx.directory, ctx.args),
|
|
53176
|
-
description: "Prepare state for clean model switch (new session)"
|
|
53207
|
+
description: "Prepare state for clean model switch (new session)",
|
|
53208
|
+
args: "",
|
|
53209
|
+
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."
|
|
53177
53210
|
},
|
|
53178
53211
|
turbo: {
|
|
53179
53212
|
handler: (ctx) => handleTurboCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
53180
|
-
description: "Toggle Turbo Mode for the active session [on|off]"
|
|
53213
|
+
description: "Toggle Turbo Mode for the active session [on|off]",
|
|
53214
|
+
args: "on, off",
|
|
53215
|
+
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 \u2014 resets on new session. Use "on" or "off" to set explicitly, or toggle with no argument.'
|
|
53181
53216
|
},
|
|
53182
53217
|
"full-auto": {
|
|
53183
53218
|
handler: (ctx) => handleFullAutoCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
53184
|
-
description: "Toggle Full-Auto Mode for the active session [on|off]"
|
|
53219
|
+
description: "Toggle Full-Auto Mode for the active session [on|off]",
|
|
53220
|
+
args: "on, off",
|
|
53221
|
+
details: 'Toggles Full-Auto Mode which enables autonomous execution without confirmation prompts. When enabled, the architect proceeds through implementation steps automatically. Session-scoped \u2014 resets on new session. Use "on" or "off" to set explicitly, or toggle with no argument.'
|
|
53185
53222
|
},
|
|
53186
53223
|
"write-retro": {
|
|
53187
53224
|
handler: (ctx) => handleWriteRetroCommand(ctx.directory, ctx.args),
|
|
53188
|
-
description: "Write a retrospective evidence bundle for a completed phase <json>"
|
|
53225
|
+
description: "Write a retrospective evidence bundle for a completed phase <json>",
|
|
53226
|
+
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.",
|
|
53227
|
+
args: "<json: {phase, summary, task_count, task_complexity, ...}>"
|
|
53189
53228
|
},
|
|
53190
53229
|
"knowledge migrate": {
|
|
53191
53230
|
handler: (ctx) => handleKnowledgeMigrateCommand(ctx.directory, ctx.args),
|
|
53192
53231
|
description: "Migrate knowledge entries to the current format",
|
|
53193
|
-
subcommandOf: "knowledge"
|
|
53232
|
+
subcommandOf: "knowledge",
|
|
53233
|
+
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.",
|
|
53234
|
+
args: "<directory>"
|
|
53194
53235
|
},
|
|
53195
53236
|
"knowledge quarantine": {
|
|
53196
53237
|
handler: (ctx) => handleKnowledgeQuarantineCommand(ctx.directory, ctx.args),
|
|
53197
53238
|
description: "Move a knowledge entry to quarantine <id> [reason]",
|
|
53198
|
-
subcommandOf: "knowledge"
|
|
53239
|
+
subcommandOf: "knowledge",
|
|
53240
|
+
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.',
|
|
53241
|
+
args: "<entry-id> [reason]"
|
|
53199
53242
|
},
|
|
53200
53243
|
"knowledge restore": {
|
|
53201
53244
|
handler: (ctx) => handleKnowledgeRestoreCommand(ctx.directory, ctx.args),
|
|
53202
53245
|
description: "Restore a quarantined knowledge entry <id>",
|
|
53203
|
-
subcommandOf: "knowledge"
|
|
53246
|
+
subcommandOf: "knowledge",
|
|
53247
|
+
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.",
|
|
53248
|
+
args: "<entry-id>"
|
|
53204
53249
|
},
|
|
53205
53250
|
knowledge: {
|
|
53206
53251
|
handler: (ctx) => handleKnowledgeListCommand(ctx.directory, ctx.args),
|
|
@@ -53208,7 +53253,9 @@ var COMMAND_REGISTRY = {
|
|
|
53208
53253
|
},
|
|
53209
53254
|
checkpoint: {
|
|
53210
53255
|
handler: (ctx) => handleCheckpointCommand(ctx.directory, ctx.args),
|
|
53211
|
-
description: "Manage project checkpoints [save|restore|delete|list] <label>"
|
|
53256
|
+
description: "Manage project checkpoints [save|restore|delete|list] <label>",
|
|
53257
|
+
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.",
|
|
53258
|
+
args: "<save|restore|delete|list> <label>"
|
|
53212
53259
|
}
|
|
53213
53260
|
};
|
|
53214
53261
|
var VALID_COMMANDS = Object.keys(COMMAND_REGISTRY);
|
|
@@ -53558,8 +53605,8 @@ SECURITY_KEYWORDS: password, secret, token, credential, auth, login, encryption,
|
|
|
53558
53605
|
{{AGENT_PREFIX}}designer - UI/UX design specs (scaffold generation for UI components \u2014 runs BEFORE coder on UI tasks)
|
|
53559
53606
|
|
|
53560
53607
|
## SLASH COMMANDS
|
|
53561
|
-
|
|
53562
|
-
|
|
53608
|
+
{{SLASH_COMMANDS}}
|
|
53609
|
+
Commands above are documented with args and behavioral details. Run commands via /swarm <command> [args].
|
|
53563
53610
|
Outside OpenCode, invoke any plugin command via: \`bunx opencode-swarm run <command> [args]\` (e.g. \`bunx opencode-swarm run knowledge migrate\`). Do not use \`bun -e\` or look for \`src/commands/\` \u2014 those paths are internal to the plugin source and do not exist in user project directories.
|
|
53564
53611
|
|
|
53565
53612
|
SMEs advise only. Reviewer and critic review only. None of them write code.
|
|
@@ -54287,7 +54334,131 @@ function buildAvailableToolsList() {
|
|
|
54287
54334
|
}).join(", ");
|
|
54288
54335
|
}
|
|
54289
54336
|
function buildSlashCommandsList() {
|
|
54290
|
-
|
|
54337
|
+
const SKIP_ALIASES = new Set(["config-doctor", "evidence-summary"]);
|
|
54338
|
+
const READ_ONLY_OBSERVATION = new Set([
|
|
54339
|
+
"status",
|
|
54340
|
+
"history",
|
|
54341
|
+
"agents",
|
|
54342
|
+
"config",
|
|
54343
|
+
"plan",
|
|
54344
|
+
"benchmark",
|
|
54345
|
+
"export",
|
|
54346
|
+
"retrieve"
|
|
54347
|
+
]);
|
|
54348
|
+
const CATEGORY_ORDER = [
|
|
54349
|
+
"Session Lifecycle",
|
|
54350
|
+
"Planning",
|
|
54351
|
+
"Execution Modes",
|
|
54352
|
+
"Observation",
|
|
54353
|
+
"Knowledge",
|
|
54354
|
+
"State Management",
|
|
54355
|
+
"Diagnostics"
|
|
54356
|
+
];
|
|
54357
|
+
const COMMANDS_BY_CATEGORY = {
|
|
54358
|
+
"Session Lifecycle": [
|
|
54359
|
+
"close",
|
|
54360
|
+
"reset",
|
|
54361
|
+
"reset-session",
|
|
54362
|
+
"handoff",
|
|
54363
|
+
"archive"
|
|
54364
|
+
],
|
|
54365
|
+
Planning: [
|
|
54366
|
+
"specify",
|
|
54367
|
+
"clarify",
|
|
54368
|
+
"analyze",
|
|
54369
|
+
"plan",
|
|
54370
|
+
"sync-plan",
|
|
54371
|
+
"acknowledge-spec-drift"
|
|
54372
|
+
],
|
|
54373
|
+
"Execution Modes": ["turbo", "full-auto"],
|
|
54374
|
+
Observation: [
|
|
54375
|
+
"status",
|
|
54376
|
+
"history",
|
|
54377
|
+
"agents",
|
|
54378
|
+
"config",
|
|
54379
|
+
"benchmark",
|
|
54380
|
+
"export",
|
|
54381
|
+
"evidence",
|
|
54382
|
+
"evidence summary",
|
|
54383
|
+
"retrieve"
|
|
54384
|
+
],
|
|
54385
|
+
Knowledge: [
|
|
54386
|
+
"knowledge",
|
|
54387
|
+
"knowledge migrate",
|
|
54388
|
+
"knowledge quarantine",
|
|
54389
|
+
"knowledge restore",
|
|
54390
|
+
"promote",
|
|
54391
|
+
"curate"
|
|
54392
|
+
],
|
|
54393
|
+
"State Management": ["checkpoint", "rollback", "write-retro"],
|
|
54394
|
+
Diagnostics: [
|
|
54395
|
+
"diagnose",
|
|
54396
|
+
"preflight",
|
|
54397
|
+
"doctor tools",
|
|
54398
|
+
"config doctor",
|
|
54399
|
+
"simulate",
|
|
54400
|
+
"dark-matter"
|
|
54401
|
+
]
|
|
54402
|
+
};
|
|
54403
|
+
const lines = [];
|
|
54404
|
+
const subcommandMap = {};
|
|
54405
|
+
for (const [cmdName, cmdEntry] of Object.entries(COMMAND_REGISTRY)) {
|
|
54406
|
+
const entry = cmdEntry;
|
|
54407
|
+
if (entry.subcommandOf) {
|
|
54408
|
+
if (!subcommandMap[entry.subcommandOf]) {
|
|
54409
|
+
subcommandMap[entry.subcommandOf] = [];
|
|
54410
|
+
}
|
|
54411
|
+
subcommandMap[entry.subcommandOf].push(cmdName);
|
|
54412
|
+
}
|
|
54413
|
+
}
|
|
54414
|
+
const compoundsInValidCommands = new Set;
|
|
54415
|
+
for (const category of CATEGORY_ORDER) {
|
|
54416
|
+
lines.push(`**${category}**`);
|
|
54417
|
+
const commandNames = COMMANDS_BY_CATEGORY[category];
|
|
54418
|
+
for (const name2 of commandNames) {
|
|
54419
|
+
const entry = COMMAND_REGISTRY[name2];
|
|
54420
|
+
if (!entry)
|
|
54421
|
+
continue;
|
|
54422
|
+
if (SKIP_ALIASES.has(name2))
|
|
54423
|
+
continue;
|
|
54424
|
+
if (entry.subcommandOf && !VALID_COMMANDS.includes(name2))
|
|
54425
|
+
continue;
|
|
54426
|
+
lines.push(`- \`/swarm ${name2}\` \u2014 ${entry.description}`);
|
|
54427
|
+
if (entry.subcommandOf && VALID_COMMANDS.includes(name2)) {
|
|
54428
|
+
compoundsInValidCommands.add(name2);
|
|
54429
|
+
}
|
|
54430
|
+
if (READ_ONLY_OBSERVATION.has(name2))
|
|
54431
|
+
continue;
|
|
54432
|
+
if (entry.details) {
|
|
54433
|
+
lines.push(` ${entry.details}`);
|
|
54434
|
+
}
|
|
54435
|
+
if (entry.args) {
|
|
54436
|
+
lines.push(` Args: ${entry.args}`);
|
|
54437
|
+
}
|
|
54438
|
+
}
|
|
54439
|
+
for (const parent of commandNames) {
|
|
54440
|
+
const subs = subcommandMap[parent];
|
|
54441
|
+
if (!subs)
|
|
54442
|
+
continue;
|
|
54443
|
+
for (const subName of subs) {
|
|
54444
|
+
const subEntry = COMMAND_REGISTRY[subName];
|
|
54445
|
+
if (!subEntry)
|
|
54446
|
+
continue;
|
|
54447
|
+
if (compoundsInValidCommands.has(subName) || subEntry.subcommandOf && VALID_COMMANDS.includes(subName) || SKIP_ALIASES.has(subName)) {
|
|
54448
|
+
continue;
|
|
54449
|
+
}
|
|
54450
|
+
lines.push(` - \`/swarm ${subName}\` \u2014 ${subEntry.description}`);
|
|
54451
|
+
if (subEntry.details) {
|
|
54452
|
+
lines.push(` ${subEntry.details}`);
|
|
54453
|
+
}
|
|
54454
|
+
if (subEntry.args) {
|
|
54455
|
+
lines.push(` Args: ${subEntry.args}`);
|
|
54456
|
+
}
|
|
54457
|
+
}
|
|
54458
|
+
}
|
|
54459
|
+
}
|
|
54460
|
+
return lines.join(`
|
|
54461
|
+
`);
|
|
54291
54462
|
}
|
|
54292
54463
|
function createArchitectAgent(model, customPrompt, customAppendPrompt, adversarialTesting) {
|
|
54293
54464
|
let prompt = ARCHITECT_PROMPT;
|
|
@@ -56358,12 +56529,54 @@ init_status_artifact();
|
|
|
56358
56529
|
init_trigger();
|
|
56359
56530
|
|
|
56360
56531
|
// src/commands/index.ts
|
|
56361
|
-
|
|
56362
|
-
"## Swarm Commands",
|
|
56363
|
-
|
|
56364
|
-
|
|
56365
|
-
|
|
56532
|
+
function buildHelpText() {
|
|
56533
|
+
const lines = ["## Swarm Commands", ""];
|
|
56534
|
+
const shownAsSubcommand = new Set;
|
|
56535
|
+
for (const cmd of VALID_COMMANDS) {
|
|
56536
|
+
if (cmd.includes(" ")) {
|
|
56537
|
+
const parent = cmd.split(" ")[0];
|
|
56538
|
+
if (VALID_COMMANDS.includes(parent)) {
|
|
56539
|
+
shownAsSubcommand.add(cmd);
|
|
56540
|
+
}
|
|
56541
|
+
continue;
|
|
56542
|
+
}
|
|
56543
|
+
const entry = COMMAND_REGISTRY[cmd];
|
|
56544
|
+
lines.push(`- \`/swarm ${cmd}\` \u2014 ${entry.description}`);
|
|
56545
|
+
if (entry.args) {
|
|
56546
|
+
lines.push(` Args: \`${entry.args}\``);
|
|
56547
|
+
}
|
|
56548
|
+
if (entry.details) {
|
|
56549
|
+
lines.push(` ${entry.details}`);
|
|
56550
|
+
}
|
|
56551
|
+
const subcommands = VALID_COMMANDS.filter((sub) => sub.startsWith(`${cmd} `) && sub !== cmd);
|
|
56552
|
+
for (const sub of subcommands) {
|
|
56553
|
+
const subEntry = COMMAND_REGISTRY[sub];
|
|
56554
|
+
const subName = sub.slice(cmd.length + 1);
|
|
56555
|
+
lines.push(` - \`${subName}\` \u2014 ${subEntry.description}`);
|
|
56556
|
+
if (subEntry.args) {
|
|
56557
|
+
lines.push(` Args: \`${subEntry.args}\``);
|
|
56558
|
+
}
|
|
56559
|
+
if (subEntry.details) {
|
|
56560
|
+
lines.push(` ${subEntry.details}`);
|
|
56561
|
+
}
|
|
56562
|
+
}
|
|
56563
|
+
}
|
|
56564
|
+
for (const cmd of VALID_COMMANDS) {
|
|
56565
|
+
if (!cmd.includes(" ") || shownAsSubcommand.has(cmd))
|
|
56566
|
+
continue;
|
|
56567
|
+
const entry = COMMAND_REGISTRY[cmd];
|
|
56568
|
+
lines.push(`- \`/swarm ${cmd}\` \u2014 ${entry.description}`);
|
|
56569
|
+
if (entry.args) {
|
|
56570
|
+
lines.push(` Args: \`${entry.args}\``);
|
|
56571
|
+
}
|
|
56572
|
+
if (entry.details) {
|
|
56573
|
+
lines.push(` ${entry.details}`);
|
|
56574
|
+
}
|
|
56575
|
+
}
|
|
56576
|
+
return lines.join(`
|
|
56366
56577
|
`);
|
|
56578
|
+
}
|
|
56579
|
+
var HELP_TEXT = buildHelpText();
|
|
56367
56580
|
function createSwarmCommandHandler(directory, agents) {
|
|
56368
56581
|
return async (input, output) => {
|
|
56369
56582
|
if (input.command !== "swarm" && !input.command.startsWith("swarm-")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.61.0",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|