opencode-swarm-plugin 0.22.0 → 0.23.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/.turbo/turbo-build.log +9 -0
- package/CHANGELOG.md +12 -0
- package/README.md +109 -429
- package/dist/agent-mail.d.ts +480 -0
- package/dist/agent-mail.d.ts.map +1 -0
- package/dist/anti-patterns.d.ts +257 -0
- package/dist/anti-patterns.d.ts.map +1 -0
- package/dist/beads.d.ts +377 -0
- package/dist/beads.d.ts.map +1 -0
- package/dist/eval-capture.d.ts +206 -0
- package/dist/eval-capture.d.ts.map +1 -0
- package/dist/index.d.ts +1299 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +498 -4246
- package/dist/learning.d.ts +670 -0
- package/dist/learning.d.ts.map +1 -0
- package/dist/mandate-promotion.d.ts +93 -0
- package/dist/mandate-promotion.d.ts.map +1 -0
- package/dist/mandate-storage.d.ts +209 -0
- package/dist/mandate-storage.d.ts.map +1 -0
- package/dist/mandates.d.ts +230 -0
- package/dist/mandates.d.ts.map +1 -0
- package/dist/output-guardrails.d.ts +125 -0
- package/dist/output-guardrails.d.ts.map +1 -0
- package/dist/pattern-maturity.d.ts +246 -0
- package/dist/pattern-maturity.d.ts.map +1 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +493 -4241
- package/dist/rate-limiter.d.ts +218 -0
- package/dist/rate-limiter.d.ts.map +1 -0
- package/dist/repo-crawl.d.ts +146 -0
- package/dist/repo-crawl.d.ts.map +1 -0
- package/dist/schemas/bead.d.ts +255 -0
- package/dist/schemas/bead.d.ts.map +1 -0
- package/dist/schemas/evaluation.d.ts +161 -0
- package/dist/schemas/evaluation.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +34 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/mandate.d.ts +336 -0
- package/dist/schemas/mandate.d.ts.map +1 -0
- package/dist/schemas/swarm-context.d.ts +131 -0
- package/dist/schemas/swarm-context.d.ts.map +1 -0
- package/dist/schemas/task.d.ts +188 -0
- package/dist/schemas/task.d.ts.map +1 -0
- package/dist/skills.d.ts +471 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/storage.d.ts +260 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/structured.d.ts +196 -0
- package/dist/structured.d.ts.map +1 -0
- package/dist/swarm-decompose.d.ts +201 -0
- package/dist/swarm-decompose.d.ts.map +1 -0
- package/dist/swarm-mail.d.ts +240 -0
- package/dist/swarm-mail.d.ts.map +1 -0
- package/dist/swarm-orchestrate.d.ts +708 -0
- package/dist/swarm-orchestrate.d.ts.map +1 -0
- package/dist/swarm-prompts.d.ts +292 -0
- package/dist/swarm-prompts.d.ts.map +1 -0
- package/dist/swarm-strategies.d.ts +100 -0
- package/dist/swarm-strategies.d.ts.map +1 -0
- package/dist/swarm.d.ts +455 -0
- package/dist/swarm.d.ts.map +1 -0
- package/dist/tool-availability.d.ts +91 -0
- package/dist/tool-availability.d.ts.map +1 -0
- package/docs/planning/ADR-001-monorepo-structure.md +171 -0
- package/docs/planning/ADR-002-package-extraction.md +393 -0
- package/docs/planning/ADR-003-performance-improvements.md +451 -0
- package/docs/planning/ADR-004-message-queue-features.md +187 -0
- package/docs/planning/ADR-005-devtools-observability.md +202 -0
- package/docs/planning/ROADMAP.md +368 -0
- package/package.json +13 -24
- package/src/agent-mail.ts +1 -1
- package/src/beads.ts +1 -2
- package/src/index.ts +2 -2
- package/src/learning.integration.test.ts +66 -11
- package/src/mandate-storage.test.ts +3 -3
- package/src/storage.ts +78 -10
- package/src/swarm-mail.ts +3 -3
- package/src/swarm-orchestrate.ts +7 -7
- package/src/tool-availability.ts +1 -1
- package/tsconfig.json +1 -1
- package/.beads/.local_version +0 -1
- package/.beads/README.md +0 -81
- package/.beads/analysis/skill-architecture-meta-skills.md +0 -1562
- package/.beads/config.yaml +0 -62
- package/.beads/issues.jsonl +0 -2197
- package/.beads/metadata.json +0 -4
- package/.gitattributes +0 -3
- package/.github/workflows/ci.yml +0 -30
- package/.github/workflows/opencode.yml +0 -31
- package/.opencode/skills/tdd/SKILL.md +0 -182
- package/INTEGRATION_EXAMPLE.md +0 -66
- package/VERIFICATION_QUALITY_PATTERNS.md +0 -565
- package/bun.lock +0 -286
- package/dist/pglite.data +0 -0
- package/dist/pglite.wasm +0 -0
- package/src/streams/agent-mail.test.ts +0 -777
- package/src/streams/agent-mail.ts +0 -535
- package/src/streams/debug.test.ts +0 -500
- package/src/streams/debug.ts +0 -727
- package/src/streams/effect/ask.integration.test.ts +0 -314
- package/src/streams/effect/ask.ts +0 -202
- package/src/streams/effect/cursor.integration.test.ts +0 -418
- package/src/streams/effect/cursor.ts +0 -288
- package/src/streams/effect/deferred.test.ts +0 -357
- package/src/streams/effect/deferred.ts +0 -445
- package/src/streams/effect/index.ts +0 -17
- package/src/streams/effect/layers.ts +0 -73
- package/src/streams/effect/lock.test.ts +0 -385
- package/src/streams/effect/lock.ts +0 -399
- package/src/streams/effect/mailbox.test.ts +0 -260
- package/src/streams/effect/mailbox.ts +0 -318
- package/src/streams/events.test.ts +0 -924
- package/src/streams/events.ts +0 -329
- package/src/streams/index.test.ts +0 -229
- package/src/streams/index.ts +0 -578
- package/src/streams/migrations.test.ts +0 -359
- package/src/streams/migrations.ts +0 -362
- package/src/streams/projections.test.ts +0 -611
- package/src/streams/projections.ts +0 -504
- package/src/streams/store.integration.test.ts +0 -658
- package/src/streams/store.ts +0 -1075
- package/src/streams/swarm-mail.ts +0 -552
- package/test-bug-fixes.ts +0 -86
- package/vitest.integration.config.ts +0 -19
- package/vitest.integration.setup.ts +0 -48
- package/workflow-integration-analysis.md +0 -876
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Orchestrate Module - Status tracking and completion handling
|
|
3
|
+
*
|
|
4
|
+
* Handles swarm execution lifecycle:
|
|
5
|
+
* - Initialization and tool availability
|
|
6
|
+
* - Status tracking and progress reporting
|
|
7
|
+
* - Completion verification and gates
|
|
8
|
+
* - Error accumulation and 3-strike detection
|
|
9
|
+
* - Learning from outcomes
|
|
10
|
+
*
|
|
11
|
+
* Key responsibilities:
|
|
12
|
+
* - swarm_init - Check tools and discover skills
|
|
13
|
+
* - swarm_status - Query epic progress
|
|
14
|
+
* - swarm_progress - Report agent progress
|
|
15
|
+
* - swarm_complete - Verification gate and completion
|
|
16
|
+
* - swarm_record_outcome - Learning signals
|
|
17
|
+
* - swarm_broadcast - Mid-task context sharing
|
|
18
|
+
* - Error accumulation tools
|
|
19
|
+
* - 3-strike detection for architectural problems
|
|
20
|
+
*/
|
|
21
|
+
import { z } from "zod";
|
|
22
|
+
/**
|
|
23
|
+
* Initialize swarm and check tool availability
|
|
24
|
+
*
|
|
25
|
+
* Call this at the start of a swarm session to see what tools are available,
|
|
26
|
+
* what skills exist in the project, and what features will be degraded.
|
|
27
|
+
*
|
|
28
|
+
* Skills are automatically discovered from:
|
|
29
|
+
* - .opencode/skills/
|
|
30
|
+
* - .claude/skills/
|
|
31
|
+
* - skills/
|
|
32
|
+
*/
|
|
33
|
+
export declare const swarm_init: {
|
|
34
|
+
description: string;
|
|
35
|
+
args: {
|
|
36
|
+
project_path: z.ZodOptional<z.ZodString>;
|
|
37
|
+
};
|
|
38
|
+
execute(args: {
|
|
39
|
+
project_path?: string | undefined;
|
|
40
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Get status of a swarm by epic ID
|
|
44
|
+
*
|
|
45
|
+
* Requires project_key to query Agent Mail for message counts.
|
|
46
|
+
*/
|
|
47
|
+
export declare const swarm_status: {
|
|
48
|
+
description: string;
|
|
49
|
+
args: {
|
|
50
|
+
epic_id: z.ZodString;
|
|
51
|
+
project_key: z.ZodString;
|
|
52
|
+
};
|
|
53
|
+
execute(args: {
|
|
54
|
+
epic_id: string;
|
|
55
|
+
project_key: string;
|
|
56
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Report progress on a subtask
|
|
60
|
+
*
|
|
61
|
+
* Takes explicit agent identity since tools don't have persistent state.
|
|
62
|
+
*/
|
|
63
|
+
export declare const swarm_progress: {
|
|
64
|
+
description: string;
|
|
65
|
+
args: {
|
|
66
|
+
project_key: z.ZodString;
|
|
67
|
+
agent_name: z.ZodString;
|
|
68
|
+
bead_id: z.ZodString;
|
|
69
|
+
status: z.ZodEnum<{
|
|
70
|
+
in_progress: "in_progress";
|
|
71
|
+
blocked: "blocked";
|
|
72
|
+
failed: "failed";
|
|
73
|
+
completed: "completed";
|
|
74
|
+
}>;
|
|
75
|
+
message: z.ZodOptional<z.ZodString>;
|
|
76
|
+
progress_percent: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
};
|
|
79
|
+
execute(args: {
|
|
80
|
+
project_key: string;
|
|
81
|
+
agent_name: string;
|
|
82
|
+
bead_id: string;
|
|
83
|
+
status: "in_progress" | "blocked" | "failed" | "completed";
|
|
84
|
+
message?: string | undefined;
|
|
85
|
+
progress_percent?: number | undefined;
|
|
86
|
+
files_touched?: string[] | undefined;
|
|
87
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Broadcast context updates to all agents in the epic
|
|
91
|
+
*
|
|
92
|
+
* Enables mid-task coordination by sharing discoveries, warnings, or blockers
|
|
93
|
+
* with all agents working on the same epic. Agents can broadcast without
|
|
94
|
+
* waiting for task completion.
|
|
95
|
+
*
|
|
96
|
+
* Based on "Patterns for Building AI Agents" p.31: "Ensure subagents can share context along the way"
|
|
97
|
+
*/
|
|
98
|
+
export declare const swarm_broadcast: {
|
|
99
|
+
description: string;
|
|
100
|
+
args: {
|
|
101
|
+
project_path: z.ZodString;
|
|
102
|
+
agent_name: z.ZodString;
|
|
103
|
+
epic_id: z.ZodString;
|
|
104
|
+
message: z.ZodString;
|
|
105
|
+
importance: z.ZodDefault<z.ZodEnum<{
|
|
106
|
+
info: "info";
|
|
107
|
+
warning: "warning";
|
|
108
|
+
blocker: "blocker";
|
|
109
|
+
}>>;
|
|
110
|
+
files_affected: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
|
+
};
|
|
112
|
+
execute(args: {
|
|
113
|
+
project_path: string;
|
|
114
|
+
agent_name: string;
|
|
115
|
+
epic_id: string;
|
|
116
|
+
message: string;
|
|
117
|
+
importance: "info" | "warning" | "blocker";
|
|
118
|
+
files_affected?: string[] | undefined;
|
|
119
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Mark a subtask as complete
|
|
123
|
+
*
|
|
124
|
+
* Implements the Verification Gate (from superpowers):
|
|
125
|
+
* 1. IDENTIFY: What commands prove this claim?
|
|
126
|
+
* 2. RUN: Execute verification (UBS, typecheck, tests)
|
|
127
|
+
* 3. READ: Check exit codes and output
|
|
128
|
+
* 4. VERIFY: All checks must pass
|
|
129
|
+
* 5. ONLY THEN: Close the bead
|
|
130
|
+
*
|
|
131
|
+
* Closes bead, releases reservations, notifies coordinator.
|
|
132
|
+
*/
|
|
133
|
+
export declare const swarm_complete: {
|
|
134
|
+
description: string;
|
|
135
|
+
args: {
|
|
136
|
+
project_key: z.ZodString;
|
|
137
|
+
agent_name: z.ZodString;
|
|
138
|
+
bead_id: z.ZodString;
|
|
139
|
+
summary: z.ZodString;
|
|
140
|
+
evaluation: z.ZodOptional<z.ZodString>;
|
|
141
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
|
+
skip_ubs_scan: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
skip_verification: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
planned_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
start_time: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
error_count: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
retry_count: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
};
|
|
149
|
+
execute(args: {
|
|
150
|
+
project_key: string;
|
|
151
|
+
agent_name: string;
|
|
152
|
+
bead_id: string;
|
|
153
|
+
summary: string;
|
|
154
|
+
evaluation?: string | undefined;
|
|
155
|
+
files_touched?: string[] | undefined;
|
|
156
|
+
skip_ubs_scan?: boolean | undefined;
|
|
157
|
+
skip_verification?: boolean | undefined;
|
|
158
|
+
planned_files?: string[] | undefined;
|
|
159
|
+
start_time?: number | undefined;
|
|
160
|
+
error_count?: number | undefined;
|
|
161
|
+
retry_count?: number | undefined;
|
|
162
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Record outcome signals from a completed subtask
|
|
166
|
+
*
|
|
167
|
+
* Tracks implicit feedback (duration, errors, retries) to score
|
|
168
|
+
* decomposition quality over time. This data feeds into criterion
|
|
169
|
+
* weight calculations.
|
|
170
|
+
*
|
|
171
|
+
* Strategy tracking enables learning about which decomposition strategies
|
|
172
|
+
* work best for different task types.
|
|
173
|
+
*
|
|
174
|
+
* @see src/learning.ts for scoring logic
|
|
175
|
+
*/
|
|
176
|
+
export declare const swarm_record_outcome: {
|
|
177
|
+
description: string;
|
|
178
|
+
args: {
|
|
179
|
+
bead_id: z.ZodString;
|
|
180
|
+
duration_ms: z.ZodNumber;
|
|
181
|
+
error_count: z.ZodDefault<z.ZodNumber>;
|
|
182
|
+
retry_count: z.ZodDefault<z.ZodNumber>;
|
|
183
|
+
success: z.ZodBoolean;
|
|
184
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
185
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
186
|
+
strategy: z.ZodOptional<z.ZodEnum<{
|
|
187
|
+
"file-based": "file-based";
|
|
188
|
+
"feature-based": "feature-based";
|
|
189
|
+
"risk-based": "risk-based";
|
|
190
|
+
"research-based": "research-based";
|
|
191
|
+
}>>;
|
|
192
|
+
failure_mode: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
timeout: "timeout";
|
|
194
|
+
unknown: "unknown";
|
|
195
|
+
conflict: "conflict";
|
|
196
|
+
validation: "validation";
|
|
197
|
+
tool_failure: "tool_failure";
|
|
198
|
+
context_overflow: "context_overflow";
|
|
199
|
+
dependency_blocked: "dependency_blocked";
|
|
200
|
+
user_cancelled: "user_cancelled";
|
|
201
|
+
}>>;
|
|
202
|
+
failure_details: z.ZodOptional<z.ZodString>;
|
|
203
|
+
};
|
|
204
|
+
execute(args: {
|
|
205
|
+
bead_id: string;
|
|
206
|
+
duration_ms: number;
|
|
207
|
+
error_count: number;
|
|
208
|
+
retry_count: number;
|
|
209
|
+
success: boolean;
|
|
210
|
+
files_touched?: string[] | undefined;
|
|
211
|
+
criteria?: string[] | undefined;
|
|
212
|
+
strategy?: "file-based" | "feature-based" | "risk-based" | "research-based" | undefined;
|
|
213
|
+
failure_mode?: "timeout" | "unknown" | "conflict" | "validation" | "tool_failure" | "context_overflow" | "dependency_blocked" | "user_cancelled" | undefined;
|
|
214
|
+
failure_details?: string | undefined;
|
|
215
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Record an error during subtask execution
|
|
219
|
+
*
|
|
220
|
+
* Implements pattern from "Patterns for Building AI Agents" p.40:
|
|
221
|
+
* "Good agents examine and correct errors when something goes wrong"
|
|
222
|
+
*
|
|
223
|
+
* Errors are accumulated and can be fed into retry prompts to help
|
|
224
|
+
* agents learn from past failures.
|
|
225
|
+
*/
|
|
226
|
+
export declare const swarm_accumulate_error: {
|
|
227
|
+
description: string;
|
|
228
|
+
args: {
|
|
229
|
+
bead_id: z.ZodString;
|
|
230
|
+
error_type: z.ZodEnum<{
|
|
231
|
+
timeout: "timeout";
|
|
232
|
+
unknown: "unknown";
|
|
233
|
+
conflict: "conflict";
|
|
234
|
+
validation: "validation";
|
|
235
|
+
tool_failure: "tool_failure";
|
|
236
|
+
}>;
|
|
237
|
+
message: z.ZodString;
|
|
238
|
+
stack_trace: z.ZodOptional<z.ZodString>;
|
|
239
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
240
|
+
context: z.ZodOptional<z.ZodString>;
|
|
241
|
+
};
|
|
242
|
+
execute(args: {
|
|
243
|
+
bead_id: string;
|
|
244
|
+
error_type: "timeout" | "unknown" | "conflict" | "validation" | "tool_failure";
|
|
245
|
+
message: string;
|
|
246
|
+
stack_trace?: string | undefined;
|
|
247
|
+
tool_name?: string | undefined;
|
|
248
|
+
context?: string | undefined;
|
|
249
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Get accumulated errors for a bead to feed into retry prompts
|
|
253
|
+
*
|
|
254
|
+
* Returns formatted error context that can be injected into retry prompts
|
|
255
|
+
* to help agents learn from past failures.
|
|
256
|
+
*/
|
|
257
|
+
export declare const swarm_get_error_context: {
|
|
258
|
+
description: string;
|
|
259
|
+
args: {
|
|
260
|
+
bead_id: z.ZodString;
|
|
261
|
+
include_resolved: z.ZodOptional<z.ZodBoolean>;
|
|
262
|
+
};
|
|
263
|
+
execute(args: {
|
|
264
|
+
bead_id: string;
|
|
265
|
+
include_resolved?: boolean | undefined;
|
|
266
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Mark an error as resolved
|
|
270
|
+
*
|
|
271
|
+
* Call this after an agent successfully addresses an error to update
|
|
272
|
+
* the accumulator state.
|
|
273
|
+
*/
|
|
274
|
+
export declare const swarm_resolve_error: {
|
|
275
|
+
description: string;
|
|
276
|
+
args: {
|
|
277
|
+
error_id: z.ZodString;
|
|
278
|
+
};
|
|
279
|
+
execute(args: {
|
|
280
|
+
error_id: string;
|
|
281
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Check if a bead has struck out (3 consecutive failures)
|
|
285
|
+
*
|
|
286
|
+
* The 3-Strike Rule:
|
|
287
|
+
* IF 3+ fixes have failed:
|
|
288
|
+
* STOP → Question the architecture
|
|
289
|
+
* DON'T attempt Fix #4
|
|
290
|
+
* Discuss with human partner
|
|
291
|
+
*
|
|
292
|
+
* This is NOT a failed hypothesis.
|
|
293
|
+
* This is a WRONG ARCHITECTURE.
|
|
294
|
+
*
|
|
295
|
+
* Use this tool to:
|
|
296
|
+
* - Check strike count before attempting a fix
|
|
297
|
+
* - Get architecture review prompt if struck out
|
|
298
|
+
* - Record a strike when a fix fails
|
|
299
|
+
* - Clear strikes when a fix succeeds
|
|
300
|
+
*/
|
|
301
|
+
export declare const swarm_check_strikes: {
|
|
302
|
+
description: string;
|
|
303
|
+
args: {
|
|
304
|
+
bead_id: z.ZodString;
|
|
305
|
+
action: z.ZodEnum<{
|
|
306
|
+
check: "check";
|
|
307
|
+
add_strike: "add_strike";
|
|
308
|
+
clear: "clear";
|
|
309
|
+
get_prompt: "get_prompt";
|
|
310
|
+
}>;
|
|
311
|
+
attempt: z.ZodOptional<z.ZodString>;
|
|
312
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
313
|
+
};
|
|
314
|
+
execute(args: {
|
|
315
|
+
bead_id: string;
|
|
316
|
+
action: "check" | "add_strike" | "clear" | "get_prompt";
|
|
317
|
+
attempt?: string | undefined;
|
|
318
|
+
reason?: string | undefined;
|
|
319
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Checkpoint swarm context for recovery
|
|
323
|
+
*
|
|
324
|
+
* Records the current state of a subtask to enable recovery after crashes,
|
|
325
|
+
* context overflows, or agent restarts. Non-fatal errors - logs warnings
|
|
326
|
+
* and continues if checkpoint fails.
|
|
327
|
+
*
|
|
328
|
+
* Integration:
|
|
329
|
+
* - Called automatically by swarm_progress at milestone thresholds (25%, 50%, 75%)
|
|
330
|
+
* - Can be called manually by agents at critical points
|
|
331
|
+
* - Emits SwarmCheckpointedEvent for audit trail
|
|
332
|
+
* - Updates swarm_contexts table for fast recovery queries
|
|
333
|
+
*/
|
|
334
|
+
export declare const swarm_checkpoint: {
|
|
335
|
+
description: string;
|
|
336
|
+
args: {
|
|
337
|
+
project_key: z.ZodString;
|
|
338
|
+
agent_name: z.ZodString;
|
|
339
|
+
bead_id: z.ZodString;
|
|
340
|
+
epic_id: z.ZodString;
|
|
341
|
+
files_modified: z.ZodArray<z.ZodString>;
|
|
342
|
+
progress_percent: z.ZodNumber;
|
|
343
|
+
directives: z.ZodOptional<z.ZodObject<{
|
|
344
|
+
shared_context: z.ZodOptional<z.ZodString>;
|
|
345
|
+
skills_to_load: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
346
|
+
coordinator_notes: z.ZodOptional<z.ZodString>;
|
|
347
|
+
}, z.core.$strip>>;
|
|
348
|
+
error_context: z.ZodOptional<z.ZodString>;
|
|
349
|
+
};
|
|
350
|
+
execute(args: {
|
|
351
|
+
project_key: string;
|
|
352
|
+
agent_name: string;
|
|
353
|
+
bead_id: string;
|
|
354
|
+
epic_id: string;
|
|
355
|
+
files_modified: string[];
|
|
356
|
+
progress_percent: number;
|
|
357
|
+
directives?: {
|
|
358
|
+
shared_context?: string | undefined;
|
|
359
|
+
skills_to_load?: string[] | undefined;
|
|
360
|
+
coordinator_notes?: string | undefined;
|
|
361
|
+
} | undefined;
|
|
362
|
+
error_context?: string | undefined;
|
|
363
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Recover swarm context from last checkpoint
|
|
367
|
+
*
|
|
368
|
+
* Queries swarm_contexts table for the most recent checkpoint of an epic.
|
|
369
|
+
* Returns the full context including files, progress, and recovery state.
|
|
370
|
+
* Emits SwarmRecoveredEvent for audit trail.
|
|
371
|
+
*
|
|
372
|
+
* Graceful fallback: Returns { found: false } if no checkpoint exists.
|
|
373
|
+
*/
|
|
374
|
+
export declare const swarm_recover: {
|
|
375
|
+
description: string;
|
|
376
|
+
args: {
|
|
377
|
+
project_key: z.ZodString;
|
|
378
|
+
epic_id: z.ZodString;
|
|
379
|
+
};
|
|
380
|
+
execute(args: {
|
|
381
|
+
project_key: string;
|
|
382
|
+
epic_id: string;
|
|
383
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Learn from completed work and optionally create a skill
|
|
387
|
+
*
|
|
388
|
+
* This tool helps agents reflect on patterns, best practices, or domain
|
|
389
|
+
* knowledge discovered during task execution and codify them into reusable
|
|
390
|
+
* skills for future swarms.
|
|
391
|
+
*
|
|
392
|
+
* Implements the "learning swarm" pattern where swarms get smarter over time.
|
|
393
|
+
*/
|
|
394
|
+
export declare const swarm_learn: {
|
|
395
|
+
description: string;
|
|
396
|
+
args: {
|
|
397
|
+
summary: z.ZodString;
|
|
398
|
+
pattern_type: z.ZodEnum<{
|
|
399
|
+
"code-pattern": "code-pattern";
|
|
400
|
+
"best-practice": "best-practice";
|
|
401
|
+
gotcha: "gotcha";
|
|
402
|
+
"tool-usage": "tool-usage";
|
|
403
|
+
"domain-knowledge": "domain-knowledge";
|
|
404
|
+
workflow: "workflow";
|
|
405
|
+
}>;
|
|
406
|
+
details: z.ZodString;
|
|
407
|
+
example: z.ZodOptional<z.ZodString>;
|
|
408
|
+
when_to_use: z.ZodString;
|
|
409
|
+
files_context: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
410
|
+
create_skill: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
+
skill_name: z.ZodOptional<z.ZodString>;
|
|
412
|
+
skill_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
413
|
+
};
|
|
414
|
+
execute(args: {
|
|
415
|
+
summary: string;
|
|
416
|
+
pattern_type: "code-pattern" | "best-practice" | "gotcha" | "tool-usage" | "domain-knowledge" | "workflow";
|
|
417
|
+
details: string;
|
|
418
|
+
when_to_use: string;
|
|
419
|
+
example?: string | undefined;
|
|
420
|
+
files_context?: string[] | undefined;
|
|
421
|
+
create_skill?: boolean | undefined;
|
|
422
|
+
skill_name?: string | undefined;
|
|
423
|
+
skill_tags?: string[] | undefined;
|
|
424
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
425
|
+
};
|
|
426
|
+
export declare const orchestrateTools: {
|
|
427
|
+
swarm_init: {
|
|
428
|
+
description: string;
|
|
429
|
+
args: {
|
|
430
|
+
project_path: z.ZodOptional<z.ZodString>;
|
|
431
|
+
};
|
|
432
|
+
execute(args: {
|
|
433
|
+
project_path?: string | undefined;
|
|
434
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
435
|
+
};
|
|
436
|
+
swarm_status: {
|
|
437
|
+
description: string;
|
|
438
|
+
args: {
|
|
439
|
+
epic_id: z.ZodString;
|
|
440
|
+
project_key: z.ZodString;
|
|
441
|
+
};
|
|
442
|
+
execute(args: {
|
|
443
|
+
epic_id: string;
|
|
444
|
+
project_key: string;
|
|
445
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
446
|
+
};
|
|
447
|
+
swarm_progress: {
|
|
448
|
+
description: string;
|
|
449
|
+
args: {
|
|
450
|
+
project_key: z.ZodString;
|
|
451
|
+
agent_name: z.ZodString;
|
|
452
|
+
bead_id: z.ZodString;
|
|
453
|
+
status: z.ZodEnum<{
|
|
454
|
+
in_progress: "in_progress";
|
|
455
|
+
blocked: "blocked";
|
|
456
|
+
failed: "failed";
|
|
457
|
+
completed: "completed";
|
|
458
|
+
}>;
|
|
459
|
+
message: z.ZodOptional<z.ZodString>;
|
|
460
|
+
progress_percent: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
462
|
+
};
|
|
463
|
+
execute(args: {
|
|
464
|
+
project_key: string;
|
|
465
|
+
agent_name: string;
|
|
466
|
+
bead_id: string;
|
|
467
|
+
status: "in_progress" | "blocked" | "failed" | "completed";
|
|
468
|
+
message?: string | undefined;
|
|
469
|
+
progress_percent?: number | undefined;
|
|
470
|
+
files_touched?: string[] | undefined;
|
|
471
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
472
|
+
};
|
|
473
|
+
swarm_broadcast: {
|
|
474
|
+
description: string;
|
|
475
|
+
args: {
|
|
476
|
+
project_path: z.ZodString;
|
|
477
|
+
agent_name: z.ZodString;
|
|
478
|
+
epic_id: z.ZodString;
|
|
479
|
+
message: z.ZodString;
|
|
480
|
+
importance: z.ZodDefault<z.ZodEnum<{
|
|
481
|
+
info: "info";
|
|
482
|
+
warning: "warning";
|
|
483
|
+
blocker: "blocker";
|
|
484
|
+
}>>;
|
|
485
|
+
files_affected: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
486
|
+
};
|
|
487
|
+
execute(args: {
|
|
488
|
+
project_path: string;
|
|
489
|
+
agent_name: string;
|
|
490
|
+
epic_id: string;
|
|
491
|
+
message: string;
|
|
492
|
+
importance: "info" | "warning" | "blocker";
|
|
493
|
+
files_affected?: string[] | undefined;
|
|
494
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
495
|
+
};
|
|
496
|
+
swarm_complete: {
|
|
497
|
+
description: string;
|
|
498
|
+
args: {
|
|
499
|
+
project_key: z.ZodString;
|
|
500
|
+
agent_name: z.ZodString;
|
|
501
|
+
bead_id: z.ZodString;
|
|
502
|
+
summary: z.ZodString;
|
|
503
|
+
evaluation: z.ZodOptional<z.ZodString>;
|
|
504
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
505
|
+
skip_ubs_scan: z.ZodOptional<z.ZodBoolean>;
|
|
506
|
+
skip_verification: z.ZodOptional<z.ZodBoolean>;
|
|
507
|
+
planned_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
508
|
+
start_time: z.ZodOptional<z.ZodNumber>;
|
|
509
|
+
error_count: z.ZodOptional<z.ZodNumber>;
|
|
510
|
+
retry_count: z.ZodOptional<z.ZodNumber>;
|
|
511
|
+
};
|
|
512
|
+
execute(args: {
|
|
513
|
+
project_key: string;
|
|
514
|
+
agent_name: string;
|
|
515
|
+
bead_id: string;
|
|
516
|
+
summary: string;
|
|
517
|
+
evaluation?: string | undefined;
|
|
518
|
+
files_touched?: string[] | undefined;
|
|
519
|
+
skip_ubs_scan?: boolean | undefined;
|
|
520
|
+
skip_verification?: boolean | undefined;
|
|
521
|
+
planned_files?: string[] | undefined;
|
|
522
|
+
start_time?: number | undefined;
|
|
523
|
+
error_count?: number | undefined;
|
|
524
|
+
retry_count?: number | undefined;
|
|
525
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
526
|
+
};
|
|
527
|
+
swarm_record_outcome: {
|
|
528
|
+
description: string;
|
|
529
|
+
args: {
|
|
530
|
+
bead_id: z.ZodString;
|
|
531
|
+
duration_ms: z.ZodNumber;
|
|
532
|
+
error_count: z.ZodDefault<z.ZodNumber>;
|
|
533
|
+
retry_count: z.ZodDefault<z.ZodNumber>;
|
|
534
|
+
success: z.ZodBoolean;
|
|
535
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
536
|
+
criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
537
|
+
strategy: z.ZodOptional<z.ZodEnum<{
|
|
538
|
+
"file-based": "file-based";
|
|
539
|
+
"feature-based": "feature-based";
|
|
540
|
+
"risk-based": "risk-based";
|
|
541
|
+
"research-based": "research-based";
|
|
542
|
+
}>>;
|
|
543
|
+
failure_mode: z.ZodOptional<z.ZodEnum<{
|
|
544
|
+
timeout: "timeout";
|
|
545
|
+
unknown: "unknown";
|
|
546
|
+
conflict: "conflict";
|
|
547
|
+
validation: "validation";
|
|
548
|
+
tool_failure: "tool_failure";
|
|
549
|
+
context_overflow: "context_overflow";
|
|
550
|
+
dependency_blocked: "dependency_blocked";
|
|
551
|
+
user_cancelled: "user_cancelled";
|
|
552
|
+
}>>;
|
|
553
|
+
failure_details: z.ZodOptional<z.ZodString>;
|
|
554
|
+
};
|
|
555
|
+
execute(args: {
|
|
556
|
+
bead_id: string;
|
|
557
|
+
duration_ms: number;
|
|
558
|
+
error_count: number;
|
|
559
|
+
retry_count: number;
|
|
560
|
+
success: boolean;
|
|
561
|
+
files_touched?: string[] | undefined;
|
|
562
|
+
criteria?: string[] | undefined;
|
|
563
|
+
strategy?: "file-based" | "feature-based" | "risk-based" | "research-based" | undefined;
|
|
564
|
+
failure_mode?: "timeout" | "unknown" | "conflict" | "validation" | "tool_failure" | "context_overflow" | "dependency_blocked" | "user_cancelled" | undefined;
|
|
565
|
+
failure_details?: string | undefined;
|
|
566
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
567
|
+
};
|
|
568
|
+
swarm_accumulate_error: {
|
|
569
|
+
description: string;
|
|
570
|
+
args: {
|
|
571
|
+
bead_id: z.ZodString;
|
|
572
|
+
error_type: z.ZodEnum<{
|
|
573
|
+
timeout: "timeout";
|
|
574
|
+
unknown: "unknown";
|
|
575
|
+
conflict: "conflict";
|
|
576
|
+
validation: "validation";
|
|
577
|
+
tool_failure: "tool_failure";
|
|
578
|
+
}>;
|
|
579
|
+
message: z.ZodString;
|
|
580
|
+
stack_trace: z.ZodOptional<z.ZodString>;
|
|
581
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
582
|
+
context: z.ZodOptional<z.ZodString>;
|
|
583
|
+
};
|
|
584
|
+
execute(args: {
|
|
585
|
+
bead_id: string;
|
|
586
|
+
error_type: "timeout" | "unknown" | "conflict" | "validation" | "tool_failure";
|
|
587
|
+
message: string;
|
|
588
|
+
stack_trace?: string | undefined;
|
|
589
|
+
tool_name?: string | undefined;
|
|
590
|
+
context?: string | undefined;
|
|
591
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
592
|
+
};
|
|
593
|
+
swarm_get_error_context: {
|
|
594
|
+
description: string;
|
|
595
|
+
args: {
|
|
596
|
+
bead_id: z.ZodString;
|
|
597
|
+
include_resolved: z.ZodOptional<z.ZodBoolean>;
|
|
598
|
+
};
|
|
599
|
+
execute(args: {
|
|
600
|
+
bead_id: string;
|
|
601
|
+
include_resolved?: boolean | undefined;
|
|
602
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
603
|
+
};
|
|
604
|
+
swarm_resolve_error: {
|
|
605
|
+
description: string;
|
|
606
|
+
args: {
|
|
607
|
+
error_id: z.ZodString;
|
|
608
|
+
};
|
|
609
|
+
execute(args: {
|
|
610
|
+
error_id: string;
|
|
611
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
612
|
+
};
|
|
613
|
+
swarm_check_strikes: {
|
|
614
|
+
description: string;
|
|
615
|
+
args: {
|
|
616
|
+
bead_id: z.ZodString;
|
|
617
|
+
action: z.ZodEnum<{
|
|
618
|
+
check: "check";
|
|
619
|
+
add_strike: "add_strike";
|
|
620
|
+
clear: "clear";
|
|
621
|
+
get_prompt: "get_prompt";
|
|
622
|
+
}>;
|
|
623
|
+
attempt: z.ZodOptional<z.ZodString>;
|
|
624
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
625
|
+
};
|
|
626
|
+
execute(args: {
|
|
627
|
+
bead_id: string;
|
|
628
|
+
action: "check" | "add_strike" | "clear" | "get_prompt";
|
|
629
|
+
attempt?: string | undefined;
|
|
630
|
+
reason?: string | undefined;
|
|
631
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
632
|
+
};
|
|
633
|
+
swarm_checkpoint: {
|
|
634
|
+
description: string;
|
|
635
|
+
args: {
|
|
636
|
+
project_key: z.ZodString;
|
|
637
|
+
agent_name: z.ZodString;
|
|
638
|
+
bead_id: z.ZodString;
|
|
639
|
+
epic_id: z.ZodString;
|
|
640
|
+
files_modified: z.ZodArray<z.ZodString>;
|
|
641
|
+
progress_percent: z.ZodNumber;
|
|
642
|
+
directives: z.ZodOptional<z.ZodObject<{
|
|
643
|
+
shared_context: z.ZodOptional<z.ZodString>;
|
|
644
|
+
skills_to_load: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
645
|
+
coordinator_notes: z.ZodOptional<z.ZodString>;
|
|
646
|
+
}, z.core.$strip>>;
|
|
647
|
+
error_context: z.ZodOptional<z.ZodString>;
|
|
648
|
+
};
|
|
649
|
+
execute(args: {
|
|
650
|
+
project_key: string;
|
|
651
|
+
agent_name: string;
|
|
652
|
+
bead_id: string;
|
|
653
|
+
epic_id: string;
|
|
654
|
+
files_modified: string[];
|
|
655
|
+
progress_percent: number;
|
|
656
|
+
directives?: {
|
|
657
|
+
shared_context?: string | undefined;
|
|
658
|
+
skills_to_load?: string[] | undefined;
|
|
659
|
+
coordinator_notes?: string | undefined;
|
|
660
|
+
} | undefined;
|
|
661
|
+
error_context?: string | undefined;
|
|
662
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
663
|
+
};
|
|
664
|
+
swarm_recover: {
|
|
665
|
+
description: string;
|
|
666
|
+
args: {
|
|
667
|
+
project_key: z.ZodString;
|
|
668
|
+
epic_id: z.ZodString;
|
|
669
|
+
};
|
|
670
|
+
execute(args: {
|
|
671
|
+
project_key: string;
|
|
672
|
+
epic_id: string;
|
|
673
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
674
|
+
};
|
|
675
|
+
swarm_learn: {
|
|
676
|
+
description: string;
|
|
677
|
+
args: {
|
|
678
|
+
summary: z.ZodString;
|
|
679
|
+
pattern_type: z.ZodEnum<{
|
|
680
|
+
"code-pattern": "code-pattern";
|
|
681
|
+
"best-practice": "best-practice";
|
|
682
|
+
gotcha: "gotcha";
|
|
683
|
+
"tool-usage": "tool-usage";
|
|
684
|
+
"domain-knowledge": "domain-knowledge";
|
|
685
|
+
workflow: "workflow";
|
|
686
|
+
}>;
|
|
687
|
+
details: z.ZodString;
|
|
688
|
+
example: z.ZodOptional<z.ZodString>;
|
|
689
|
+
when_to_use: z.ZodString;
|
|
690
|
+
files_context: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
691
|
+
create_skill: z.ZodOptional<z.ZodBoolean>;
|
|
692
|
+
skill_name: z.ZodOptional<z.ZodString>;
|
|
693
|
+
skill_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
694
|
+
};
|
|
695
|
+
execute(args: {
|
|
696
|
+
summary: string;
|
|
697
|
+
pattern_type: "code-pattern" | "best-practice" | "gotcha" | "tool-usage" | "domain-knowledge" | "workflow";
|
|
698
|
+
details: string;
|
|
699
|
+
when_to_use: string;
|
|
700
|
+
example?: string | undefined;
|
|
701
|
+
files_context?: string[] | undefined;
|
|
702
|
+
create_skill?: boolean | undefined;
|
|
703
|
+
skill_name?: string | undefined;
|
|
704
|
+
skill_tags?: string[] | undefined;
|
|
705
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
//# sourceMappingURL=swarm-orchestrate.d.ts.map
|