opencode-swarm 6.30.1 → 6.30.2
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/cli/index.d.ts +1 -0
- package/dist/cli/index.js +6589 -2564
- package/dist/commands/index.d.ts +4 -1
- package/dist/commands/registry.d.ts +160 -0
- package/dist/index.js +6539 -6397
- package/package.json +1 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { AgentDefinition } from '../agents';
|
|
1
|
+
import type { AgentDefinition } from '../agents/index.js';
|
|
2
2
|
export { handleAgentsCommand } from './agents';
|
|
3
3
|
export { handleAnalyzeCommand } from './analyze';
|
|
4
4
|
export { handleArchiveCommand } from './archive';
|
|
5
5
|
export { handleBenchmarkCommand } from './benchmark';
|
|
6
|
+
export { handleCheckpointCommand } from './checkpoint';
|
|
6
7
|
export { handleClarifyCommand } from './clarify';
|
|
7
8
|
export { handleConfigCommand } from './config';
|
|
8
9
|
export { handleCurateCommand } from './curate';
|
|
@@ -17,6 +18,8 @@ export { handleKnowledgeListCommand, handleKnowledgeMigrateCommand, handleKnowle
|
|
|
17
18
|
export { handlePlanCommand } from './plan';
|
|
18
19
|
export { handlePreflightCommand } from './preflight';
|
|
19
20
|
export { handlePromoteCommand } from './promote';
|
|
21
|
+
export type { CommandContext, CommandEntry, RegisteredCommand, } from './registry.js';
|
|
22
|
+
export { COMMAND_REGISTRY, resolveCommand, VALID_COMMANDS, } from './registry.js';
|
|
20
23
|
export { handleResetCommand } from './reset';
|
|
21
24
|
export { handleRetrieveCommand } from './retrieve';
|
|
22
25
|
export { handleRollbackCommand } from './rollback';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { AgentDefinition } from '../agents/index.js';
|
|
2
|
+
export type CommandContext = {
|
|
3
|
+
directory: string;
|
|
4
|
+
args: string[];
|
|
5
|
+
sessionID: string;
|
|
6
|
+
agents: Record<string, AgentDefinition>;
|
|
7
|
+
};
|
|
8
|
+
export type CommandResult = Promise<string>;
|
|
9
|
+
export type CommandEntry = {
|
|
10
|
+
handler: (ctx: CommandContext) => CommandResult;
|
|
11
|
+
/** Human-readable description shown in /swarm help and CLI --help */
|
|
12
|
+
description: string;
|
|
13
|
+
/** If true, this command is only accessible as a sub-key of a parent command */
|
|
14
|
+
subcommandOf?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const COMMAND_REGISTRY: {
|
|
17
|
+
readonly status: {
|
|
18
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
19
|
+
readonly description: "Show current swarm state";
|
|
20
|
+
};
|
|
21
|
+
readonly plan: {
|
|
22
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
23
|
+
readonly description: "Show plan (optionally filter by phase number)";
|
|
24
|
+
};
|
|
25
|
+
readonly agents: {
|
|
26
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
27
|
+
readonly description: "List registered agents";
|
|
28
|
+
};
|
|
29
|
+
readonly history: {
|
|
30
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
31
|
+
readonly description: "Show completed phases summary";
|
|
32
|
+
};
|
|
33
|
+
readonly config: {
|
|
34
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
35
|
+
readonly description: "Show current resolved configuration";
|
|
36
|
+
};
|
|
37
|
+
readonly 'config doctor': {
|
|
38
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
39
|
+
readonly description: "Run config doctor checks";
|
|
40
|
+
readonly subcommandOf: "config";
|
|
41
|
+
};
|
|
42
|
+
readonly diagnose: {
|
|
43
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
44
|
+
readonly description: "Run health check on swarm state";
|
|
45
|
+
};
|
|
46
|
+
readonly preflight: {
|
|
47
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
48
|
+
readonly description: "Run preflight automation checks";
|
|
49
|
+
};
|
|
50
|
+
readonly 'sync-plan': {
|
|
51
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
52
|
+
readonly description: "Ensure plan.json and plan.md are synced";
|
|
53
|
+
};
|
|
54
|
+
readonly benchmark: {
|
|
55
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
56
|
+
readonly description: "Show performance metrics [--cumulative] [--ci-gate]";
|
|
57
|
+
};
|
|
58
|
+
readonly export: {
|
|
59
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
60
|
+
readonly description: "Export plan and context as JSON";
|
|
61
|
+
};
|
|
62
|
+
readonly evidence: {
|
|
63
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
64
|
+
readonly description: "Show evidence bundles [taskId]";
|
|
65
|
+
};
|
|
66
|
+
readonly 'evidence summary': {
|
|
67
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
68
|
+
readonly description: "Generate evidence summary with completion ratio and blockers";
|
|
69
|
+
readonly subcommandOf: "evidence";
|
|
70
|
+
};
|
|
71
|
+
readonly archive: {
|
|
72
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
73
|
+
readonly description: "Archive old evidence bundles [--dry-run]";
|
|
74
|
+
};
|
|
75
|
+
readonly curate: {
|
|
76
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
77
|
+
readonly description: "Run knowledge curation and hive promotion review";
|
|
78
|
+
};
|
|
79
|
+
readonly 'dark-matter': {
|
|
80
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
81
|
+
readonly description: "Detect hidden file couplings via co-change NPMI analysis";
|
|
82
|
+
};
|
|
83
|
+
readonly simulate: {
|
|
84
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
85
|
+
readonly description: "Dry-run impact analysis of proposed changes [--target <glob>]";
|
|
86
|
+
};
|
|
87
|
+
readonly analyze: {
|
|
88
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
89
|
+
readonly description: "Analyze spec.md vs plan.md for requirement coverage gaps";
|
|
90
|
+
};
|
|
91
|
+
readonly clarify: {
|
|
92
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
93
|
+
readonly description: "Clarify and refine an existing feature specification";
|
|
94
|
+
};
|
|
95
|
+
readonly specify: {
|
|
96
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
97
|
+
readonly description: "Generate or import a feature specification [description]";
|
|
98
|
+
};
|
|
99
|
+
readonly promote: {
|
|
100
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
101
|
+
readonly description: "Manually promote lesson to hive knowledge";
|
|
102
|
+
};
|
|
103
|
+
readonly reset: {
|
|
104
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
105
|
+
readonly description: "Clear swarm state files [--confirm]";
|
|
106
|
+
};
|
|
107
|
+
readonly rollback: {
|
|
108
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
109
|
+
readonly description: "Restore swarm state to a checkpoint <phase>";
|
|
110
|
+
};
|
|
111
|
+
readonly retrieve: {
|
|
112
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
113
|
+
readonly description: "Retrieve full output from a summary <id>";
|
|
114
|
+
};
|
|
115
|
+
readonly handoff: {
|
|
116
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
117
|
+
readonly description: "Prepare state for clean model switch (new session)";
|
|
118
|
+
};
|
|
119
|
+
readonly turbo: {
|
|
120
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
121
|
+
readonly description: "Toggle Turbo Mode for the active session [on|off]";
|
|
122
|
+
};
|
|
123
|
+
readonly 'write-retro': {
|
|
124
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
125
|
+
readonly description: "Write a retrospective evidence bundle for a completed phase <json>";
|
|
126
|
+
};
|
|
127
|
+
readonly 'knowledge migrate': {
|
|
128
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
129
|
+
readonly description: "Migrate knowledge entries to the current format";
|
|
130
|
+
readonly subcommandOf: "knowledge";
|
|
131
|
+
};
|
|
132
|
+
readonly 'knowledge quarantine': {
|
|
133
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
134
|
+
readonly description: "Move a knowledge entry to quarantine <id> [reason]";
|
|
135
|
+
readonly subcommandOf: "knowledge";
|
|
136
|
+
};
|
|
137
|
+
readonly 'knowledge restore': {
|
|
138
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
139
|
+
readonly description: "Restore a quarantined knowledge entry <id>";
|
|
140
|
+
readonly subcommandOf: "knowledge";
|
|
141
|
+
};
|
|
142
|
+
readonly knowledge: {
|
|
143
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
144
|
+
readonly description: "List knowledge entries";
|
|
145
|
+
};
|
|
146
|
+
readonly checkpoint: {
|
|
147
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
148
|
+
readonly description: "Manage project checkpoints [save|restore|delete|list] <label>";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export type RegisteredCommand = keyof typeof COMMAND_REGISTRY;
|
|
152
|
+
export declare const VALID_COMMANDS: RegisteredCommand[];
|
|
153
|
+
/**
|
|
154
|
+
* Resolves compound commands like "evidence summary" and "config doctor".
|
|
155
|
+
* Tries a two-token compound key first, then falls back to a single-token key.
|
|
156
|
+
*/
|
|
157
|
+
export declare function resolveCommand(tokens: string[]): {
|
|
158
|
+
entry: CommandEntry;
|
|
159
|
+
remainingArgs: string[];
|
|
160
|
+
} | null;
|