opencode-swarm 6.60.0 → 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/README.md +5 -2
- 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 +85 -32
- 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/config/schema.d.ts +2 -0
- package/dist/hooks/guardrails.d.ts +5 -0
- package/dist/index.js +543 -184
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -759,14 +759,17 @@ Use glob patterns for complex path matching:
|
|
|
759
759
|
- `?` — Match single character: `test?.js` matches `test1.js`, `testa.js`
|
|
760
760
|
- Uses [picomatch](https://github.com/micromatch/picomatch) for cross-platform compatibility
|
|
761
761
|
|
|
762
|
+
**Path Normalization and Symlinks:**
|
|
763
|
+
Paths are resolved via `realpathSync` before matching, which resolves symlinks and prevents path-traversal escapes. However, if a symlink's target does not exist, `realpathSync` throws and the fallback returns the symlink's own path (unresolved). A dangling symlink inside an `allowedPrefix` directory will therefore pass prefix-based checks even if its intended target is outside the project. Use `blockedExact` or `blockedGlobs` to deny known dangling-symlink paths explicitly.
|
|
764
|
+
|
|
762
765
|
**Evaluation Order:**
|
|
763
766
|
1. `readOnly` check (if true, deny all writes)
|
|
764
767
|
2. `blockedExact` (exact path matches, highest priority)
|
|
765
768
|
3. `blockedGlobs` (glob pattern matches)
|
|
766
769
|
4. `allowedExact` (exact path matches, overrides prefix/glob restrictions)
|
|
767
770
|
5. `allowedGlobs` (glob pattern matches)
|
|
768
|
-
6. `
|
|
769
|
-
7. `
|
|
771
|
+
6. `blockedPrefix` (prefix matches)
|
|
772
|
+
7. `allowedPrefix` (prefix matches)
|
|
770
773
|
8. `blockedZones` (zone classification)
|
|
771
774
|
|
|
772
775
|
</details>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli/index.js
CHANGED
|
@@ -18296,7 +18296,7 @@ ${warnings.map((w) => ` - ${w}`).join(`
|
|
|
18296
18296
|
`)}` : "";
|
|
18297
18297
|
const cautionMessage = `
|
|
18298
18298
|
|
|
18299
|
-
\u26A0\uFE0F
|
|
18299
|
+
\u26A0\uFE0F Warning: Spec drift was acknowledged \u2014 verify that the implementation still matches the spec before proceeding.`;
|
|
18300
18300
|
return baseMessage + warningMessage + cautionMessage;
|
|
18301
18301
|
}
|
|
18302
18302
|
|
|
@@ -18564,7 +18564,8 @@ var AGENT_TOOL_MAP = {
|
|
|
18564
18564
|
"imports",
|
|
18565
18565
|
"retrieve_summary",
|
|
18566
18566
|
"symbols",
|
|
18567
|
-
"knowledge_recall"
|
|
18567
|
+
"knowledge_recall",
|
|
18568
|
+
"req_coverage"
|
|
18568
18569
|
],
|
|
18569
18570
|
critic_drift_verifier: [
|
|
18570
18571
|
"complexity_hotspots",
|
|
@@ -18968,7 +18969,8 @@ var GuardrailsConfigSchema = exports_external.object({
|
|
|
18968
18969
|
]),
|
|
18969
18970
|
require_reviewer_test_engineer: exports_external.boolean().default(true)
|
|
18970
18971
|
}).optional(),
|
|
18971
|
-
profiles: exports_external.record(exports_external.string(), GuardrailsProfileSchema).optional()
|
|
18972
|
+
profiles: exports_external.record(exports_external.string(), GuardrailsProfileSchema).optional(),
|
|
18973
|
+
block_destructive_commands: exports_external.boolean().default(true)
|
|
18972
18974
|
});
|
|
18973
18975
|
var WatchdogConfigSchema = exports_external.object({
|
|
18974
18976
|
scope_guard: exports_external.boolean().default(true),
|
|
@@ -32067,7 +32069,7 @@ var DeltaSpecSchema = exports_external.union([
|
|
|
32067
32069
|
]);
|
|
32068
32070
|
// src/tools/create-tool.ts
|
|
32069
32071
|
function classifyToolError(error93) {
|
|
32070
|
-
const msg = (error93 instanceof Error ? error93.message : String(error93)).toLowerCase();
|
|
32072
|
+
const msg = (error93 instanceof Error ? error93.message ?? "" : String(error93)).toLowerCase();
|
|
32071
32073
|
if (msg.includes("not registered") || msg.includes("unknown tool"))
|
|
32072
32074
|
return "not_registered";
|
|
32073
32075
|
if (msg.includes("not whitelisted") || msg.includes("not allowed"))
|
|
@@ -36802,6 +36804,10 @@ async function discoverBuildCommands(workingDir, options) {
|
|
|
36802
36804
|
const skipped = [...profileSkipped];
|
|
36803
36805
|
for (const ecosystem of ECOSYSTEMS) {
|
|
36804
36806
|
if (coveredEcosystems.has(ecosystem.ecosystem)) {
|
|
36807
|
+
skipped.push({
|
|
36808
|
+
ecosystem: ecosystem.ecosystem,
|
|
36809
|
+
reason: `Covered by profile detection`
|
|
36810
|
+
});
|
|
36805
36811
|
continue;
|
|
36806
36812
|
}
|
|
36807
36813
|
if (!checkToolchain(ecosystem.toolchainCommands)) {
|
|
@@ -42649,7 +42655,8 @@ Run \`/swarm evidence ${result.task_id ?? "unknown"}\` to view it, or \`/swarm s
|
|
|
42649
42655
|
var COMMAND_REGISTRY = {
|
|
42650
42656
|
"acknowledge-spec-drift": {
|
|
42651
42657
|
handler: (ctx) => handleAcknowledgeSpecDriftCommand(ctx.directory, ctx.args),
|
|
42652
|
-
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: ""
|
|
42653
42660
|
},
|
|
42654
42661
|
status: {
|
|
42655
42662
|
handler: (ctx) => handleStatusCommand(ctx.directory, ctx.agents),
|
|
@@ -42695,112 +42702,156 @@ var COMMAND_REGISTRY = {
|
|
|
42695
42702
|
},
|
|
42696
42703
|
"sync-plan": {
|
|
42697
42704
|
handler: (ctx) => handleSyncPlanCommand(ctx.directory, ctx.args),
|
|
42698
|
-
description: "Ensure plan.json and plan.md are synced"
|
|
42705
|
+
description: "Ensure plan.json and plan.md are synced",
|
|
42706
|
+
args: ""
|
|
42699
42707
|
},
|
|
42700
42708
|
benchmark: {
|
|
42701
42709
|
handler: (ctx) => handleBenchmarkCommand(ctx.directory, ctx.args),
|
|
42702
|
-
description: "Show performance metrics [--cumulative] [--ci-gate]"
|
|
42710
|
+
description: "Show performance metrics [--cumulative] [--ci-gate]",
|
|
42711
|
+
args: "--cumulative, --ci-gate"
|
|
42703
42712
|
},
|
|
42704
42713
|
export: {
|
|
42705
42714
|
handler: (ctx) => handleExportCommand(ctx.directory, ctx.args),
|
|
42706
|
-
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."
|
|
42707
42718
|
},
|
|
42708
42719
|
evidence: {
|
|
42709
42720
|
handler: (ctx) => handleEvidenceCommand(ctx.directory, ctx.args),
|
|
42710
|
-
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").'
|
|
42711
42724
|
},
|
|
42712
42725
|
"evidence summary": {
|
|
42713
42726
|
handler: (ctx) => handleEvidenceSummaryCommand(ctx.directory),
|
|
42714
42727
|
description: "Generate evidence summary with completion ratio and blockers",
|
|
42715
|
-
subcommandOf: "evidence"
|
|
42728
|
+
subcommandOf: "evidence",
|
|
42729
|
+
args: "",
|
|
42730
|
+
details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence."
|
|
42716
42731
|
},
|
|
42717
42732
|
"evidence-summary": {
|
|
42718
42733
|
handler: (ctx) => handleEvidenceSummaryCommand(ctx.directory),
|
|
42719
42734
|
description: "Generate evidence summary with completion ratio and blockers",
|
|
42720
|
-
subcommandOf: "evidence"
|
|
42735
|
+
subcommandOf: "evidence",
|
|
42736
|
+
args: "",
|
|
42737
|
+
details: "Generates a summary showing completion ratio across all tasks, lists blockers, and identifies missing evidence."
|
|
42721
42738
|
},
|
|
42722
42739
|
archive: {
|
|
42723
42740
|
handler: (ctx) => handleArchiveCommand(ctx.directory, ctx.args),
|
|
42724
|
-
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"
|
|
42725
42744
|
},
|
|
42726
42745
|
curate: {
|
|
42727
42746
|
handler: (ctx) => handleCurateCommand(ctx.directory, ctx.args),
|
|
42728
|
-
description: "Run knowledge curation and hive promotion review"
|
|
42747
|
+
description: "Run knowledge curation and hive promotion review",
|
|
42748
|
+
args: ""
|
|
42729
42749
|
},
|
|
42730
42750
|
"dark-matter": {
|
|
42731
42751
|
handler: (ctx) => handleDarkMatterCommand(ctx.directory, ctx.args),
|
|
42732
|
-
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>"
|
|
42733
42754
|
},
|
|
42734
42755
|
close: {
|
|
42735
42756
|
handler: (ctx) => handleCloseCommand(ctx.directory, ctx.args),
|
|
42736
|
-
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"
|
|
42737
42760
|
},
|
|
42738
42761
|
simulate: {
|
|
42739
42762
|
handler: (ctx) => handleSimulateCommand(ctx.directory, ctx.args),
|
|
42740
|
-
description: "Dry-run
|
|
42763
|
+
description: "Dry-run hidden coupling analysis with configurable thresholds",
|
|
42764
|
+
args: "--threshold <number>, --min-commits <number>"
|
|
42741
42765
|
},
|
|
42742
42766
|
analyze: {
|
|
42743
42767
|
handler: (ctx) => handleAnalyzeCommand(ctx.directory, ctx.args),
|
|
42744
|
-
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: ""
|
|
42745
42770
|
},
|
|
42746
42771
|
clarify: {
|
|
42747
42772
|
handler: (ctx) => handleClarifyCommand(ctx.directory, ctx.args),
|
|
42748
|
-
description: "Clarify and refine an existing feature specification"
|
|
42773
|
+
description: "Clarify and refine an existing feature specification",
|
|
42774
|
+
args: "[description-text]"
|
|
42749
42775
|
},
|
|
42750
42776
|
specify: {
|
|
42751
42777
|
handler: (ctx) => handleSpecifyCommand(ctx.directory, ctx.args),
|
|
42752
|
-
description: "Generate or import a feature specification [description]"
|
|
42778
|
+
description: "Generate or import a feature specification [description]",
|
|
42779
|
+
args: "[description-text]"
|
|
42753
42780
|
},
|
|
42754
42781
|
promote: {
|
|
42755
42782
|
handler: (ctx) => handlePromoteCommand(ctx.directory, ctx.args),
|
|
42756
|
-
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>"
|
|
42757
42786
|
},
|
|
42758
42787
|
reset: {
|
|
42759
42788
|
handler: (ctx) => handleResetCommand(ctx.directory, ctx.args),
|
|
42760
|
-
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)"
|
|
42761
42792
|
},
|
|
42762
42793
|
"reset-session": {
|
|
42763
42794
|
handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args),
|
|
42764
|
-
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: ""
|
|
42765
42798
|
},
|
|
42766
42799
|
rollback: {
|
|
42767
42800
|
handler: (ctx) => handleRollbackCommand(ctx.directory, ctx.args),
|
|
42768
|
-
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>"
|
|
42769
42804
|
},
|
|
42770
42805
|
retrieve: {
|
|
42771
42806
|
handler: (ctx) => handleRetrieveCommand(ctx.directory, ctx.args),
|
|
42772
|
-
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."
|
|
42773
42810
|
},
|
|
42774
42811
|
handoff: {
|
|
42775
42812
|
handler: (ctx) => handleHandoffCommand(ctx.directory, ctx.args),
|
|
42776
|
-
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."
|
|
42777
42816
|
},
|
|
42778
42817
|
turbo: {
|
|
42779
42818
|
handler: (ctx) => handleTurboCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
42780
|
-
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.'
|
|
42781
42822
|
},
|
|
42782
42823
|
"full-auto": {
|
|
42783
42824
|
handler: (ctx) => handleFullAutoCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
42784
|
-
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.'
|
|
42785
42828
|
},
|
|
42786
42829
|
"write-retro": {
|
|
42787
42830
|
handler: (ctx) => handleWriteRetroCommand(ctx.directory, ctx.args),
|
|
42788
|
-
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, ...}>"
|
|
42789
42834
|
},
|
|
42790
42835
|
"knowledge migrate": {
|
|
42791
42836
|
handler: (ctx) => handleKnowledgeMigrateCommand(ctx.directory, ctx.args),
|
|
42792
42837
|
description: "Migrate knowledge entries to the current format",
|
|
42793
|
-
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>"
|
|
42794
42841
|
},
|
|
42795
42842
|
"knowledge quarantine": {
|
|
42796
42843
|
handler: (ctx) => handleKnowledgeQuarantineCommand(ctx.directory, ctx.args),
|
|
42797
42844
|
description: "Move a knowledge entry to quarantine <id> [reason]",
|
|
42798
|
-
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]"
|
|
42799
42848
|
},
|
|
42800
42849
|
"knowledge restore": {
|
|
42801
42850
|
handler: (ctx) => handleKnowledgeRestoreCommand(ctx.directory, ctx.args),
|
|
42802
42851
|
description: "Restore a quarantined knowledge entry <id>",
|
|
42803
|
-
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>"
|
|
42804
42855
|
},
|
|
42805
42856
|
knowledge: {
|
|
42806
42857
|
handler: (ctx) => handleKnowledgeListCommand(ctx.directory, ctx.args),
|
|
@@ -42808,7 +42859,9 @@ var COMMAND_REGISTRY = {
|
|
|
42808
42859
|
},
|
|
42809
42860
|
checkpoint: {
|
|
42810
42861
|
handler: (ctx) => handleCheckpointCommand(ctx.directory, ctx.args),
|
|
42811
|
-
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>"
|
|
42812
42865
|
}
|
|
42813
42866
|
};
|
|
42814
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/config/schema.d.ts
CHANGED
|
@@ -330,6 +330,7 @@ export declare const GuardrailsConfigSchema: z.ZodObject<{
|
|
|
330
330
|
warning_threshold: z.ZodOptional<z.ZodNumber>;
|
|
331
331
|
idle_timeout_minutes: z.ZodOptional<z.ZodNumber>;
|
|
332
332
|
}, z.core.$strip>>>;
|
|
333
|
+
block_destructive_commands: z.ZodDefault<z.ZodBoolean>;
|
|
333
334
|
}, z.core.$strip>;
|
|
334
335
|
export type GuardrailsConfig = z.infer<typeof GuardrailsConfigSchema>;
|
|
335
336
|
export declare const WatchdogConfigSchema: z.ZodObject<{
|
|
@@ -655,6 +656,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
655
656
|
warning_threshold: z.ZodOptional<z.ZodNumber>;
|
|
656
657
|
idle_timeout_minutes: z.ZodOptional<z.ZodNumber>;
|
|
657
658
|
}, z.core.$strip>>>;
|
|
659
|
+
block_destructive_commands: z.ZodDefault<z.ZodBoolean>;
|
|
658
660
|
}, z.core.$strip>>;
|
|
659
661
|
watchdog: z.ZodOptional<z.ZodObject<{
|
|
660
662
|
scope_guard: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -103,6 +103,11 @@ export declare function validateAndRecordAttestation(dir: string, findingId: str
|
|
|
103
103
|
valid: false;
|
|
104
104
|
reason: string;
|
|
105
105
|
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Clears all guardrails caches.
|
|
108
|
+
* Use this for test isolation or when guardrails config reloads at runtime.
|
|
109
|
+
*/
|
|
110
|
+
export declare function clearGuardrailsCaches(): void;
|
|
106
111
|
type AgentRule = {
|
|
107
112
|
readOnly?: boolean;
|
|
108
113
|
blockedExact?: string[];
|