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
package/dist/swarm.d.ts
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Module - High-level swarm coordination
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports from focused submodules for backward compatibility.
|
|
5
|
+
* For new code, prefer importing from specific modules:
|
|
6
|
+
* - swarm-strategies.ts - Strategy selection
|
|
7
|
+
* - swarm-decompose.ts - Task decomposition
|
|
8
|
+
* - swarm-prompts.ts - Prompt templates
|
|
9
|
+
* - swarm-orchestrate.ts - Status and completion
|
|
10
|
+
*
|
|
11
|
+
* @module swarm
|
|
12
|
+
*/
|
|
13
|
+
export * from "./swarm-strategies";
|
|
14
|
+
export * from "./swarm-decompose";
|
|
15
|
+
export * from "./swarm-prompts";
|
|
16
|
+
export * from "./swarm-orchestrate";
|
|
17
|
+
/**
|
|
18
|
+
* Combined swarm tools for plugin registration.
|
|
19
|
+
* Includes all tools from strategy, decompose, prompt, and orchestrate modules.
|
|
20
|
+
*/
|
|
21
|
+
export declare const swarmTools: {
|
|
22
|
+
swarm_init: {
|
|
23
|
+
description: string;
|
|
24
|
+
args: {
|
|
25
|
+
project_path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
26
|
+
};
|
|
27
|
+
execute(args: {
|
|
28
|
+
project_path?: string | undefined;
|
|
29
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
30
|
+
};
|
|
31
|
+
swarm_status: {
|
|
32
|
+
description: string;
|
|
33
|
+
args: {
|
|
34
|
+
epic_id: import("zod").ZodString;
|
|
35
|
+
project_key: import("zod").ZodString;
|
|
36
|
+
};
|
|
37
|
+
execute(args: {
|
|
38
|
+
epic_id: string;
|
|
39
|
+
project_key: string;
|
|
40
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
41
|
+
};
|
|
42
|
+
swarm_progress: {
|
|
43
|
+
description: string;
|
|
44
|
+
args: {
|
|
45
|
+
project_key: import("zod").ZodString;
|
|
46
|
+
agent_name: import("zod").ZodString;
|
|
47
|
+
bead_id: import("zod").ZodString;
|
|
48
|
+
status: import("zod").ZodEnum<{
|
|
49
|
+
in_progress: "in_progress";
|
|
50
|
+
blocked: "blocked";
|
|
51
|
+
failed: "failed";
|
|
52
|
+
completed: "completed";
|
|
53
|
+
}>;
|
|
54
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
55
|
+
progress_percent: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
56
|
+
files_touched: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
57
|
+
};
|
|
58
|
+
execute(args: {
|
|
59
|
+
project_key: string;
|
|
60
|
+
agent_name: string;
|
|
61
|
+
bead_id: string;
|
|
62
|
+
status: "in_progress" | "blocked" | "failed" | "completed";
|
|
63
|
+
message?: string | undefined;
|
|
64
|
+
progress_percent?: number | undefined;
|
|
65
|
+
files_touched?: string[] | undefined;
|
|
66
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
67
|
+
};
|
|
68
|
+
swarm_broadcast: {
|
|
69
|
+
description: string;
|
|
70
|
+
args: {
|
|
71
|
+
project_path: import("zod").ZodString;
|
|
72
|
+
agent_name: import("zod").ZodString;
|
|
73
|
+
epic_id: import("zod").ZodString;
|
|
74
|
+
message: import("zod").ZodString;
|
|
75
|
+
importance: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
76
|
+
info: "info";
|
|
77
|
+
warning: "warning";
|
|
78
|
+
blocker: "blocker";
|
|
79
|
+
}>>;
|
|
80
|
+
files_affected: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
81
|
+
};
|
|
82
|
+
execute(args: {
|
|
83
|
+
project_path: string;
|
|
84
|
+
agent_name: string;
|
|
85
|
+
epic_id: string;
|
|
86
|
+
message: string;
|
|
87
|
+
importance: "info" | "warning" | "blocker";
|
|
88
|
+
files_affected?: string[] | undefined;
|
|
89
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
90
|
+
};
|
|
91
|
+
swarm_complete: {
|
|
92
|
+
description: string;
|
|
93
|
+
args: {
|
|
94
|
+
project_key: import("zod").ZodString;
|
|
95
|
+
agent_name: import("zod").ZodString;
|
|
96
|
+
bead_id: import("zod").ZodString;
|
|
97
|
+
summary: import("zod").ZodString;
|
|
98
|
+
evaluation: import("zod").ZodOptional<import("zod").ZodString>;
|
|
99
|
+
files_touched: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
100
|
+
skip_ubs_scan: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
101
|
+
skip_verification: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
102
|
+
planned_files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
103
|
+
start_time: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
104
|
+
error_count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
105
|
+
retry_count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
106
|
+
};
|
|
107
|
+
execute(args: {
|
|
108
|
+
project_key: string;
|
|
109
|
+
agent_name: string;
|
|
110
|
+
bead_id: string;
|
|
111
|
+
summary: string;
|
|
112
|
+
evaluation?: string | undefined;
|
|
113
|
+
files_touched?: string[] | undefined;
|
|
114
|
+
skip_ubs_scan?: boolean | undefined;
|
|
115
|
+
skip_verification?: boolean | undefined;
|
|
116
|
+
planned_files?: string[] | undefined;
|
|
117
|
+
start_time?: number | undefined;
|
|
118
|
+
error_count?: number | undefined;
|
|
119
|
+
retry_count?: number | undefined;
|
|
120
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
121
|
+
};
|
|
122
|
+
swarm_record_outcome: {
|
|
123
|
+
description: string;
|
|
124
|
+
args: {
|
|
125
|
+
bead_id: import("zod").ZodString;
|
|
126
|
+
duration_ms: import("zod").ZodNumber;
|
|
127
|
+
error_count: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
128
|
+
retry_count: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
129
|
+
success: import("zod").ZodBoolean;
|
|
130
|
+
files_touched: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
131
|
+
criteria: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
132
|
+
strategy: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
133
|
+
"file-based": "file-based";
|
|
134
|
+
"feature-based": "feature-based";
|
|
135
|
+
"risk-based": "risk-based";
|
|
136
|
+
"research-based": "research-based";
|
|
137
|
+
}>>;
|
|
138
|
+
failure_mode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
139
|
+
timeout: "timeout";
|
|
140
|
+
unknown: "unknown";
|
|
141
|
+
conflict: "conflict";
|
|
142
|
+
validation: "validation";
|
|
143
|
+
tool_failure: "tool_failure";
|
|
144
|
+
context_overflow: "context_overflow";
|
|
145
|
+
dependency_blocked: "dependency_blocked";
|
|
146
|
+
user_cancelled: "user_cancelled";
|
|
147
|
+
}>>;
|
|
148
|
+
failure_details: import("zod").ZodOptional<import("zod").ZodString>;
|
|
149
|
+
};
|
|
150
|
+
execute(args: {
|
|
151
|
+
bead_id: string;
|
|
152
|
+
duration_ms: number;
|
|
153
|
+
error_count: number;
|
|
154
|
+
retry_count: number;
|
|
155
|
+
success: boolean;
|
|
156
|
+
files_touched?: string[] | undefined;
|
|
157
|
+
criteria?: string[] | undefined;
|
|
158
|
+
strategy?: "file-based" | "feature-based" | "risk-based" | "research-based" | undefined;
|
|
159
|
+
failure_mode?: "timeout" | "unknown" | "conflict" | "validation" | "tool_failure" | "context_overflow" | "dependency_blocked" | "user_cancelled" | undefined;
|
|
160
|
+
failure_details?: string | undefined;
|
|
161
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
162
|
+
};
|
|
163
|
+
swarm_accumulate_error: {
|
|
164
|
+
description: string;
|
|
165
|
+
args: {
|
|
166
|
+
bead_id: import("zod").ZodString;
|
|
167
|
+
error_type: import("zod").ZodEnum<{
|
|
168
|
+
timeout: "timeout";
|
|
169
|
+
unknown: "unknown";
|
|
170
|
+
conflict: "conflict";
|
|
171
|
+
validation: "validation";
|
|
172
|
+
tool_failure: "tool_failure";
|
|
173
|
+
}>;
|
|
174
|
+
message: import("zod").ZodString;
|
|
175
|
+
stack_trace: import("zod").ZodOptional<import("zod").ZodString>;
|
|
176
|
+
tool_name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
177
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
178
|
+
};
|
|
179
|
+
execute(args: {
|
|
180
|
+
bead_id: string;
|
|
181
|
+
error_type: "timeout" | "unknown" | "conflict" | "validation" | "tool_failure";
|
|
182
|
+
message: string;
|
|
183
|
+
stack_trace?: string | undefined;
|
|
184
|
+
tool_name?: string | undefined;
|
|
185
|
+
context?: string | undefined;
|
|
186
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
187
|
+
};
|
|
188
|
+
swarm_get_error_context: {
|
|
189
|
+
description: string;
|
|
190
|
+
args: {
|
|
191
|
+
bead_id: import("zod").ZodString;
|
|
192
|
+
include_resolved: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
193
|
+
};
|
|
194
|
+
execute(args: {
|
|
195
|
+
bead_id: string;
|
|
196
|
+
include_resolved?: boolean | undefined;
|
|
197
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
198
|
+
};
|
|
199
|
+
swarm_resolve_error: {
|
|
200
|
+
description: string;
|
|
201
|
+
args: {
|
|
202
|
+
error_id: import("zod").ZodString;
|
|
203
|
+
};
|
|
204
|
+
execute(args: {
|
|
205
|
+
error_id: string;
|
|
206
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
207
|
+
};
|
|
208
|
+
swarm_check_strikes: {
|
|
209
|
+
description: string;
|
|
210
|
+
args: {
|
|
211
|
+
bead_id: import("zod").ZodString;
|
|
212
|
+
action: import("zod").ZodEnum<{
|
|
213
|
+
check: "check";
|
|
214
|
+
add_strike: "add_strike";
|
|
215
|
+
clear: "clear";
|
|
216
|
+
get_prompt: "get_prompt";
|
|
217
|
+
}>;
|
|
218
|
+
attempt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
219
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
220
|
+
};
|
|
221
|
+
execute(args: {
|
|
222
|
+
bead_id: string;
|
|
223
|
+
action: "check" | "add_strike" | "clear" | "get_prompt";
|
|
224
|
+
attempt?: string | undefined;
|
|
225
|
+
reason?: string | undefined;
|
|
226
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
227
|
+
};
|
|
228
|
+
swarm_checkpoint: {
|
|
229
|
+
description: string;
|
|
230
|
+
args: {
|
|
231
|
+
project_key: import("zod").ZodString;
|
|
232
|
+
agent_name: import("zod").ZodString;
|
|
233
|
+
bead_id: import("zod").ZodString;
|
|
234
|
+
epic_id: import("zod").ZodString;
|
|
235
|
+
files_modified: import("zod").ZodArray<import("zod").ZodString>;
|
|
236
|
+
progress_percent: import("zod").ZodNumber;
|
|
237
|
+
directives: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
238
|
+
shared_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
239
|
+
skills_to_load: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
240
|
+
coordinator_notes: import("zod").ZodOptional<import("zod").ZodString>;
|
|
241
|
+
}, import("zod/v4/core").$strip>>;
|
|
242
|
+
error_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
243
|
+
};
|
|
244
|
+
execute(args: {
|
|
245
|
+
project_key: string;
|
|
246
|
+
agent_name: string;
|
|
247
|
+
bead_id: string;
|
|
248
|
+
epic_id: string;
|
|
249
|
+
files_modified: string[];
|
|
250
|
+
progress_percent: number;
|
|
251
|
+
directives?: {
|
|
252
|
+
shared_context?: string | undefined;
|
|
253
|
+
skills_to_load?: string[] | undefined;
|
|
254
|
+
coordinator_notes?: string | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
error_context?: string | undefined;
|
|
257
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
258
|
+
};
|
|
259
|
+
swarm_recover: {
|
|
260
|
+
description: string;
|
|
261
|
+
args: {
|
|
262
|
+
project_key: import("zod").ZodString;
|
|
263
|
+
epic_id: import("zod").ZodString;
|
|
264
|
+
};
|
|
265
|
+
execute(args: {
|
|
266
|
+
project_key: string;
|
|
267
|
+
epic_id: string;
|
|
268
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
269
|
+
};
|
|
270
|
+
swarm_learn: {
|
|
271
|
+
description: string;
|
|
272
|
+
args: {
|
|
273
|
+
summary: import("zod").ZodString;
|
|
274
|
+
pattern_type: import("zod").ZodEnum<{
|
|
275
|
+
"code-pattern": "code-pattern";
|
|
276
|
+
"best-practice": "best-practice";
|
|
277
|
+
gotcha: "gotcha";
|
|
278
|
+
"tool-usage": "tool-usage";
|
|
279
|
+
"domain-knowledge": "domain-knowledge";
|
|
280
|
+
workflow: "workflow";
|
|
281
|
+
}>;
|
|
282
|
+
details: import("zod").ZodString;
|
|
283
|
+
example: import("zod").ZodOptional<import("zod").ZodString>;
|
|
284
|
+
when_to_use: import("zod").ZodString;
|
|
285
|
+
files_context: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
286
|
+
create_skill: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
287
|
+
skill_name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
288
|
+
skill_tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
289
|
+
};
|
|
290
|
+
execute(args: {
|
|
291
|
+
summary: string;
|
|
292
|
+
pattern_type: "code-pattern" | "best-practice" | "gotcha" | "tool-usage" | "domain-knowledge" | "workflow";
|
|
293
|
+
details: string;
|
|
294
|
+
when_to_use: string;
|
|
295
|
+
example?: string | undefined;
|
|
296
|
+
files_context?: string[] | undefined;
|
|
297
|
+
create_skill?: boolean | undefined;
|
|
298
|
+
skill_name?: string | undefined;
|
|
299
|
+
skill_tags?: string[] | undefined;
|
|
300
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
301
|
+
};
|
|
302
|
+
swarm_subtask_prompt: {
|
|
303
|
+
description: string;
|
|
304
|
+
args: {
|
|
305
|
+
agent_name: import("zod").ZodString;
|
|
306
|
+
bead_id: import("zod").ZodString;
|
|
307
|
+
epic_id: import("zod").ZodString;
|
|
308
|
+
subtask_title: import("zod").ZodString;
|
|
309
|
+
subtask_description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
310
|
+
files: import("zod").ZodArray<import("zod").ZodString>;
|
|
311
|
+
shared_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
312
|
+
project_path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
313
|
+
};
|
|
314
|
+
execute(args: {
|
|
315
|
+
agent_name: string;
|
|
316
|
+
bead_id: string;
|
|
317
|
+
epic_id: string;
|
|
318
|
+
subtask_title: string;
|
|
319
|
+
files: string[];
|
|
320
|
+
subtask_description?: string | undefined;
|
|
321
|
+
shared_context?: string | undefined;
|
|
322
|
+
project_path?: string | undefined;
|
|
323
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
324
|
+
};
|
|
325
|
+
swarm_spawn_subtask: {
|
|
326
|
+
description: string;
|
|
327
|
+
args: {
|
|
328
|
+
bead_id: import("zod").ZodString;
|
|
329
|
+
epic_id: import("zod").ZodString;
|
|
330
|
+
subtask_title: import("zod").ZodString;
|
|
331
|
+
subtask_description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
332
|
+
files: import("zod").ZodArray<import("zod").ZodString>;
|
|
333
|
+
shared_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
334
|
+
project_path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
335
|
+
recovery_context: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
336
|
+
shared_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
337
|
+
skills_to_load: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
338
|
+
coordinator_notes: import("zod").ZodOptional<import("zod").ZodString>;
|
|
339
|
+
}, import("zod/v4/core").$strip>>;
|
|
340
|
+
};
|
|
341
|
+
execute(args: {
|
|
342
|
+
bead_id: string;
|
|
343
|
+
epic_id: string;
|
|
344
|
+
subtask_title: string;
|
|
345
|
+
files: string[];
|
|
346
|
+
subtask_description?: string | undefined;
|
|
347
|
+
shared_context?: string | undefined;
|
|
348
|
+
project_path?: string | undefined;
|
|
349
|
+
recovery_context?: {
|
|
350
|
+
shared_context?: string | undefined;
|
|
351
|
+
skills_to_load?: string[] | undefined;
|
|
352
|
+
coordinator_notes?: string | undefined;
|
|
353
|
+
} | undefined;
|
|
354
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
355
|
+
};
|
|
356
|
+
swarm_evaluation_prompt: {
|
|
357
|
+
description: string;
|
|
358
|
+
args: {
|
|
359
|
+
bead_id: import("zod").ZodString;
|
|
360
|
+
subtask_title: import("zod").ZodString;
|
|
361
|
+
files_touched: import("zod").ZodArray<import("zod").ZodString>;
|
|
362
|
+
};
|
|
363
|
+
execute(args: {
|
|
364
|
+
bead_id: string;
|
|
365
|
+
subtask_title: string;
|
|
366
|
+
files_touched: string[];
|
|
367
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
368
|
+
};
|
|
369
|
+
swarm_plan_prompt: {
|
|
370
|
+
description: string;
|
|
371
|
+
args: {
|
|
372
|
+
task: import("zod").ZodString;
|
|
373
|
+
strategy: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
374
|
+
"file-based": "file-based";
|
|
375
|
+
"feature-based": "feature-based";
|
|
376
|
+
"risk-based": "risk-based";
|
|
377
|
+
auto: "auto";
|
|
378
|
+
}>>;
|
|
379
|
+
max_subtasks: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
380
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
381
|
+
query_cass: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
382
|
+
cass_limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
383
|
+
include_skills: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
384
|
+
};
|
|
385
|
+
execute(args: {
|
|
386
|
+
task: string;
|
|
387
|
+
max_subtasks: number;
|
|
388
|
+
strategy?: "file-based" | "feature-based" | "risk-based" | "auto" | undefined;
|
|
389
|
+
context?: string | undefined;
|
|
390
|
+
query_cass?: boolean | undefined;
|
|
391
|
+
cass_limit?: number | undefined;
|
|
392
|
+
include_skills?: boolean | undefined;
|
|
393
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
394
|
+
};
|
|
395
|
+
swarm_decompose: {
|
|
396
|
+
description: string;
|
|
397
|
+
args: {
|
|
398
|
+
task: import("zod").ZodString;
|
|
399
|
+
max_subtasks: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
400
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
401
|
+
query_cass: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
402
|
+
cass_limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
403
|
+
};
|
|
404
|
+
execute(args: {
|
|
405
|
+
task: string;
|
|
406
|
+
max_subtasks: number;
|
|
407
|
+
context?: string | undefined;
|
|
408
|
+
query_cass?: boolean | undefined;
|
|
409
|
+
cass_limit?: number | undefined;
|
|
410
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
411
|
+
};
|
|
412
|
+
swarm_validate_decomposition: {
|
|
413
|
+
description: string;
|
|
414
|
+
args: {
|
|
415
|
+
response: import("zod").ZodString;
|
|
416
|
+
};
|
|
417
|
+
execute(args: {
|
|
418
|
+
response: string;
|
|
419
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
420
|
+
};
|
|
421
|
+
swarm_delegate_planning: {
|
|
422
|
+
description: string;
|
|
423
|
+
args: {
|
|
424
|
+
task: import("zod").ZodString;
|
|
425
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
426
|
+
max_subtasks: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
427
|
+
strategy: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
428
|
+
"file-based": "file-based";
|
|
429
|
+
"feature-based": "feature-based";
|
|
430
|
+
"risk-based": "risk-based";
|
|
431
|
+
auto: "auto";
|
|
432
|
+
}>>>;
|
|
433
|
+
query_cass: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
434
|
+
};
|
|
435
|
+
execute(args: {
|
|
436
|
+
task: string;
|
|
437
|
+
max_subtasks: number;
|
|
438
|
+
strategy: "file-based" | "feature-based" | "risk-based" | "auto";
|
|
439
|
+
query_cass: boolean;
|
|
440
|
+
context?: string | undefined;
|
|
441
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
442
|
+
};
|
|
443
|
+
swarm_select_strategy: {
|
|
444
|
+
description: string;
|
|
445
|
+
args: {
|
|
446
|
+
task: import("zod").ZodString;
|
|
447
|
+
codebase_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
448
|
+
};
|
|
449
|
+
execute(args: {
|
|
450
|
+
task: string;
|
|
451
|
+
codebase_context?: string | undefined;
|
|
452
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
//# sourceMappingURL=swarm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../src/swarm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AAQpC;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKtB,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Availability Module
|
|
3
|
+
*
|
|
4
|
+
* Checks for external tool availability and provides graceful degradation.
|
|
5
|
+
* Tools are checked once and cached for the session.
|
|
6
|
+
*
|
|
7
|
+
* Supported tools:
|
|
8
|
+
* - semantic-memory: Learning persistence with semantic search
|
|
9
|
+
* - cass: Cross-agent session search for historical context
|
|
10
|
+
* - ubs: Universal bug scanner for pre-commit checks
|
|
11
|
+
* - beads (bd): Git-backed issue tracking
|
|
12
|
+
* - swarm-mail: Embedded multi-agent coordination (PGLite-based)
|
|
13
|
+
* - agent-mail: DEPRECATED - Legacy MCP server (use swarm-mail instead)
|
|
14
|
+
*/
|
|
15
|
+
export type ToolName = "semantic-memory" | "cass" | "ubs" | "beads" | "swarm-mail" | "agent-mail";
|
|
16
|
+
export interface ToolStatus {
|
|
17
|
+
available: boolean;
|
|
18
|
+
checkedAt: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolAvailability {
|
|
23
|
+
tool: ToolName;
|
|
24
|
+
status: ToolStatus;
|
|
25
|
+
fallbackBehavior: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if a tool is available (cached)
|
|
29
|
+
*
|
|
30
|
+
* @param tool - Tool name to check
|
|
31
|
+
* @returns Tool status
|
|
32
|
+
*/
|
|
33
|
+
export declare function checkTool(tool: ToolName): Promise<ToolStatus>;
|
|
34
|
+
/**
|
|
35
|
+
* Check if a tool is available (simple boolean, cached)
|
|
36
|
+
*/
|
|
37
|
+
export declare function isToolAvailable(tool: ToolName): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Get full availability info including fallback behavior
|
|
40
|
+
*/
|
|
41
|
+
export declare function getToolAvailability(tool: ToolName): Promise<ToolAvailability>;
|
|
42
|
+
/**
|
|
43
|
+
* Check all tools and return availability map
|
|
44
|
+
*/
|
|
45
|
+
export declare function checkAllTools(): Promise<Map<ToolName, ToolAvailability>>;
|
|
46
|
+
/**
|
|
47
|
+
* Log a warning when a tool is missing.
|
|
48
|
+
* Uses Set to deduplicate - logs once per tool per session to prevent spam
|
|
49
|
+
* when tool availability is checked repeatedly.
|
|
50
|
+
*/
|
|
51
|
+
export declare function warnMissingTool(tool: ToolName): void;
|
|
52
|
+
/**
|
|
53
|
+
* Require a tool - throws if not available
|
|
54
|
+
*
|
|
55
|
+
* Use this for tools that are mandatory for a feature.
|
|
56
|
+
*/
|
|
57
|
+
export declare function requireTool(tool: ToolName): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Execute with fallback - runs the action if tool available, otherwise runs fallback
|
|
60
|
+
*
|
|
61
|
+
* @param tool - Tool to check
|
|
62
|
+
* @param action - Action to run if tool available
|
|
63
|
+
* @param fallback - Fallback to run if tool not available
|
|
64
|
+
* @returns Result from action or fallback
|
|
65
|
+
*/
|
|
66
|
+
export declare function withToolFallback<T>(tool: ToolName, action: () => Promise<T>, fallback: () => T | Promise<T>): Promise<T>;
|
|
67
|
+
/**
|
|
68
|
+
* Execute if tool available, otherwise return undefined
|
|
69
|
+
*/
|
|
70
|
+
export declare function ifToolAvailable<T>(tool: ToolName, action: () => Promise<T>): Promise<T | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Reset the tool availability cache.
|
|
73
|
+
* Use in tests to ensure fresh checks, or when tool availability may have
|
|
74
|
+
* changed mid-session (e.g., after installing a tool via `bunx`).
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // In tests
|
|
78
|
+
* beforeEach(() => resetToolCache());
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // After installing a tool
|
|
82
|
+
* await installTool('semantic-memory');
|
|
83
|
+
* resetToolCache();
|
|
84
|
+
* const available = await isToolAvailable('semantic-memory');
|
|
85
|
+
*/
|
|
86
|
+
export declare function resetToolCache(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Format tool availability for display
|
|
89
|
+
*/
|
|
90
|
+
export declare function formatToolAvailability(availability: Map<ToolName, ToolAvailability>): string;
|
|
91
|
+
//# sourceMappingURL=tool-availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-availability.d.ts","sourceRoot":"","sources":["../src/tool-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,MAAM,MAAM,QAAQ,GAChB,iBAAiB,GACjB,MAAM,GACN,KAAK,GACL,OAAO,GACP,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAiOD;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAWnE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAGtE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,gBAAgB,CAAC,CAO3B;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAC5C,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAChC,CAyBA;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAQpD;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/D;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CASZ;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CASxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,GAC5C,MAAM,CAWR"}
|