opencode-swarm-plugin 0.23.6 → 0.25.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 +4 -4
- package/CHANGELOG.md +53 -0
- package/README.md +155 -3
- package/bin/swarm.ts +635 -234
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +620 -89
- package/dist/plugin.js +548 -89
- package/dist/schemas/bead-events.d.ts +698 -0
- package/dist/schemas/bead-events.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/swarm-decompose.d.ts +74 -0
- package/dist/swarm-decompose.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm.d.ts +27 -0
- package/dist/swarm.d.ts.map +1 -1
- package/docs/testing/context-recovery-test.md +470 -0
- package/examples/commands/swarm.md +92 -20
- package/global-skills/swarm-coordination/SKILL.md +380 -10
- package/package.json +1 -1
- package/src/schemas/bead-events.test.ts +341 -0
- package/src/schemas/bead-events.ts +583 -0
- package/src/schemas/index.ts +51 -0
- package/src/skills.ts +10 -3
- package/src/swarm-decompose.ts +337 -0
- package/src/swarm-orchestrate.ts +15 -51
- package/src/swarm-prompts.ts +144 -42
- package/src/swarm.integration.test.ts +581 -31
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
$ bun build ./src/index.ts --outdir ./dist --target node --external @electric-sql/pglite --external swarm-mail && bun build ./src/plugin.ts --outfile ./dist/plugin.js --target node --external @electric-sql/pglite --external swarm-mail && tsc
|
|
2
|
-
Bundled
|
|
2
|
+
Bundled 196 modules in 32ms
|
|
3
3
|
|
|
4
|
-
index.js 1.
|
|
4
|
+
index.js 1.16 MB (entry point)
|
|
5
5
|
|
|
6
|
-
Bundled
|
|
6
|
+
Bundled 197 modules in 31ms
|
|
7
7
|
|
|
8
|
-
plugin.js 1.
|
|
8
|
+
plugin.js 1.13 MB (entry point)
|
|
9
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# opencode-swarm-plugin
|
|
2
2
|
|
|
3
|
+
## 0.25.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`b70ae35`](https://github.com/joelhooks/swarm-tools/commit/b70ae352876515bdfe68511d72bb472c85b7fdfc) Thanks [@joelhooks](https://github.com/joelhooks)! - Add Socratic planning phase and improved worker prompts to swarm setup
|
|
8
|
+
|
|
9
|
+
**SWARM_COMMAND template:**
|
|
10
|
+
|
|
11
|
+
- Added Phase 0: Socratic Planning - asks clarifying questions before decomposing
|
|
12
|
+
- Supports `--fast`, `--auto`, `--confirm-only` flags to skip questions
|
|
13
|
+
- ONE question at a time with concrete options and recommendations
|
|
14
|
+
|
|
15
|
+
**Worker agent template:**
|
|
16
|
+
|
|
17
|
+
- Reinforces the 9-step survival checklist from SUBTASK_PROMPT_V2
|
|
18
|
+
- Explicitly lists all steps with emphasis on non-negotiables
|
|
19
|
+
- Explains WHY skipping steps causes problems (lost work, conflicts, etc.)
|
|
20
|
+
|
|
21
|
+
**Agent path consolidation:**
|
|
22
|
+
|
|
23
|
+
- Now creates nested paths: `~/.config/opencode/agent/swarm/worker.md`
|
|
24
|
+
- Matches `Task(subagent_type="swarm/worker")` format
|
|
25
|
+
- Cleans up legacy flat files (`swarm-worker.md`) on reinstall
|
|
26
|
+
|
|
27
|
+
To get the new prompts, run `swarm setup` and choose "Reinstall everything".
|
|
28
|
+
|
|
29
|
+
## 0.24.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- [`434f48f`](https://github.com/joelhooks/swarm-tools/commit/434f48f207c3509f6b924caeb47cd6e019dcc0e1) Thanks [@joelhooks](https://github.com/joelhooks)! - Add worker survival checklist and Socratic planning for swarm coordination
|
|
34
|
+
|
|
35
|
+
**Worker Survival Checklist (9-step mandatory flow):**
|
|
36
|
+
|
|
37
|
+
- Workers now follow a strict initialization sequence: swarmmail_init → semantic-memory_find → skills_use → swarmmail_reserve
|
|
38
|
+
- Workers reserve their own files (coordinators no longer reserve on behalf of workers)
|
|
39
|
+
- Auto-checkpoint at 25/50/75% progress milestones
|
|
40
|
+
- Workers store learnings via semantic-memory before completing
|
|
41
|
+
|
|
42
|
+
**Socratic Planning:**
|
|
43
|
+
|
|
44
|
+
- New `swarm_plan_interactive` tool with 4 modes: socratic (default), fast, auto, confirm-only
|
|
45
|
+
- Default mode asks clarifying questions before decomposition
|
|
46
|
+
- Escape hatches for experienced users: `--fast`, `--auto`, `--confirm-only` flags on /swarm command
|
|
47
|
+
|
|
48
|
+
**Updated Skills:**
|
|
49
|
+
|
|
50
|
+
- swarm-coordination skill now documents worker survival patterns and coordinator rules
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- [#15](https://github.com/joelhooks/swarm-tools/pull/15) [`299f2d3`](https://github.com/joelhooks/swarm-tools/commit/299f2d3305796bcb411f9b90715cda3513d17b54) Thanks [@tayiorbeii](https://github.com/tayiorbeii)! - Sync bundled skills into the global skills directory during `swarm setup` reinstall, fix bundled-skill path resolution, and make AGENTS.md skill-awareness updates work without relying on `opencode run`.
|
|
55
|
+
|
|
3
56
|
## 0.23.6
|
|
4
57
|
|
|
5
58
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
OpenCode plugin for multi-agent swarm coordination with learning capabilities.
|
|
4
4
|
|
|
5
|
+
**🌐 Website:** [swarmtools.ai](https://swarmtools.ai)
|
|
6
|
+
**📚 Full Documentation:** [swarmtools.ai/docs](https://swarmtools.ai/docs)
|
|
7
|
+
|
|
5
8
|
```
|
|
6
9
|
███████╗██╗ ██╗ █████╗ ██████╗ ███╗ ███╗
|
|
7
10
|
██╔════╝██║ ██║██╔══██╗██╔══██╗████╗ ████║
|
|
@@ -18,7 +21,7 @@ OpenCode plugin for multi-agent swarm coordination with learning capabilities.
|
|
|
18
21
|
- **Agent Mail** - Inter-agent messaging with file reservations
|
|
19
22
|
- **Learning System** - Pattern maturity, anti-pattern detection, confidence decay
|
|
20
23
|
- **Skills System** - Knowledge injection with bundled and custom skills
|
|
21
|
-
- **
|
|
24
|
+
- **Checkpoint & Recovery** - Auto-checkpoint at 25/50/75%, survive context death (9 integration tests ✅)
|
|
22
25
|
|
|
23
26
|
## Install
|
|
24
27
|
|
|
@@ -76,8 +79,8 @@ swarm setup
|
|
|
76
79
|
| `swarm_progress` | Report subtask progress to coordinator |
|
|
77
80
|
| `swarm_complete` | Complete subtask (runs UBS scan, releases) |
|
|
78
81
|
| `swarm_record_outcome` | Record outcome for learning |
|
|
79
|
-
| `swarm_checkpoint` | Save progress snapshot
|
|
80
|
-
| `swarm_recover` | Resume from checkpoint
|
|
82
|
+
| `swarm_checkpoint` | Save progress snapshot (auto at 25/50/75%) |
|
|
83
|
+
| `swarm_recover` | Resume from checkpoint (returns full context) |
|
|
81
84
|
| `swarm_learn` | Extract learnings from outcome |
|
|
82
85
|
| `swarm_broadcast` | Send message to all active agents |
|
|
83
86
|
| `swarm_accumulate_error` | Track recurring errors (3-strike system) |
|
|
@@ -94,6 +97,69 @@ swarm setup
|
|
|
94
97
|
| `skills_read` | Read skill content |
|
|
95
98
|
| `skills_create` | Create new skill |
|
|
96
99
|
|
|
100
|
+
## Checkpoint & Recovery
|
|
101
|
+
|
|
102
|
+
Ensures work survives context compaction or crashes. Proven by 9 integration tests.
|
|
103
|
+
|
|
104
|
+
### Auto-Checkpoint Milestones
|
|
105
|
+
|
|
106
|
+
When `swarm_progress` reports 25%, 50%, or 75% completion, a checkpoint is automatically saved to PGLite:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
// Stored in .swarm-mail/ directory (no external database needed)
|
|
110
|
+
{
|
|
111
|
+
epic_id: "bd-123",
|
|
112
|
+
bead_id: "bd-123.1",
|
|
113
|
+
strategy: "file-based",
|
|
114
|
+
files: ["src/auth.ts", "src/middleware.ts"],
|
|
115
|
+
progress_percent: 50,
|
|
116
|
+
directives: {
|
|
117
|
+
shared_context: "OAuth implementation notes",
|
|
118
|
+
skills_to_load: ["testing-patterns"],
|
|
119
|
+
coordinator_notes: "Watch for race conditions"
|
|
120
|
+
},
|
|
121
|
+
recovery: {
|
|
122
|
+
last_checkpoint: 1234567890,
|
|
123
|
+
files_modified: ["src/auth.ts"],
|
|
124
|
+
error_context: "Optional: error details if checkpoint during error"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Tools
|
|
130
|
+
|
|
131
|
+
**swarm_checkpoint** - Manually save a checkpoint:
|
|
132
|
+
```typescript
|
|
133
|
+
swarm_checkpoint({
|
|
134
|
+
project_key: "/abs/path",
|
|
135
|
+
agent_name: "WorkerA",
|
|
136
|
+
bead_id: "bd-123.1",
|
|
137
|
+
epic_id: "bd-123",
|
|
138
|
+
files_modified: ["src/auth.ts"],
|
|
139
|
+
progress_percent: 30,
|
|
140
|
+
directives: { shared_context: "..." },
|
|
141
|
+
error_context: "Optional"
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**swarm_recover** - Resume from last checkpoint:
|
|
146
|
+
```typescript
|
|
147
|
+
swarm_recover({
|
|
148
|
+
project_key: "/abs/path",
|
|
149
|
+
epic_id: "bd-123"
|
|
150
|
+
})
|
|
151
|
+
// Returns:
|
|
152
|
+
// {
|
|
153
|
+
// found: true,
|
|
154
|
+
// context: { epic_id, bead_id, files, strategy, directives, recovery },
|
|
155
|
+
// age_seconds: 120
|
|
156
|
+
// }
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Failure Handling
|
|
160
|
+
|
|
161
|
+
Checkpoint failures are **non-fatal**—work continues even if checkpointing fails. Prevents infrastructure from blocking actual work.
|
|
162
|
+
|
|
97
163
|
## Bundled Skills
|
|
98
164
|
|
|
99
165
|
Located in `global-skills/`:
|
|
@@ -126,6 +192,74 @@ src/
|
|
|
126
192
|
|
|
127
193
|
## Dependencies
|
|
128
194
|
|
|
195
|
+
### Required
|
|
196
|
+
|
|
197
|
+
| Dependency | Purpose |
|
|
198
|
+
|------------|---------|
|
|
199
|
+
| [OpenCode](https://opencode.ai) | AI coding agent (the plugin runs inside OpenCode) |
|
|
200
|
+
| [Beads](https://github.com/steveyegge/beads) | Git-backed issue tracking |
|
|
201
|
+
|
|
202
|
+
### Optional (Highly Recommended)
|
|
203
|
+
|
|
204
|
+
These tools significantly enhance the swarm experience:
|
|
205
|
+
|
|
206
|
+
| Tool | Purpose | Install |
|
|
207
|
+
|------|---------|---------|
|
|
208
|
+
| [CASS](https://github.com/Dicklesworthstone/coding_agent_session_search) | Historical context - queries past sessions for similar decompositions | See below |
|
|
209
|
+
| [UBS](https://github.com/Dicklesworthstone/ultimate_bug_scanner) | Bug scanning - runs on subtask completion to catch issues | See below |
|
|
210
|
+
| [semantic-memory](https://github.com/joelhooks/semantic-memory) | Learning persistence - stores patterns across sessions | See below |
|
|
211
|
+
|
|
212
|
+
#### Installing CASS
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Clone and install
|
|
216
|
+
git clone https://github.com/Dicklesworthstone/coding_agent_session_search
|
|
217
|
+
cd coding_agent_session_search
|
|
218
|
+
pip install -e .
|
|
219
|
+
|
|
220
|
+
# Build the index (run periodically to index new sessions)
|
|
221
|
+
cass index
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### Installing UBS
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Clone and install
|
|
228
|
+
git clone https://github.com/Dicklesworthstone/ultimate_bug_scanner
|
|
229
|
+
cd ultimate_bug_scanner
|
|
230
|
+
pip install -e .
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### Installing semantic-memory
|
|
234
|
+
|
|
235
|
+
Requires [Ollama](https://ollama.ai) with an embedding model:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# 1. Install Ollama (macOS)
|
|
239
|
+
brew install ollama
|
|
240
|
+
|
|
241
|
+
# 2. Start Ollama service
|
|
242
|
+
ollama serve
|
|
243
|
+
|
|
244
|
+
# 3. Pull an embedding model
|
|
245
|
+
ollama pull mxbai-embed-large
|
|
246
|
+
|
|
247
|
+
# 4. Install the OpenCode plugin
|
|
248
|
+
# Add to your OpenCode config
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The `semantic-memory_check` tool verifies Ollama is ready.
|
|
252
|
+
|
|
253
|
+
**Why install these?**
|
|
254
|
+
|
|
255
|
+
- **CASS** - When you run `/swarm "Add OAuth"`, the coordinator queries CASS for similar past tasks. Without it, decomposition is based only on the current task description.
|
|
256
|
+
- **UBS** - Every `swarm_complete` runs UBS to scan for bugs. Without it, you lose automatic bug detection.
|
|
257
|
+
- **semantic-memory** - Pattern maturity and anti-pattern detection persist across sessions. Without it, learning resets each session.
|
|
258
|
+
|
|
259
|
+
Run `swarm doctor` to check which dependencies are installed.
|
|
260
|
+
|
|
261
|
+
### npm Dependencies
|
|
262
|
+
|
|
129
263
|
- [swarm-mail](../swarm-mail) - Event sourcing primitives (workspace dependency)
|
|
130
264
|
- [@opencode-ai/plugin](https://www.npmjs.com/package/@opencode-ai/plugin) - OpenCode plugin API
|
|
131
265
|
- [effect](https://effect.website) - Effect-TS for type-safe composition
|
|
@@ -154,6 +288,24 @@ swarm init # Initialize beads in project
|
|
|
154
288
|
swarm config # Show config file paths
|
|
155
289
|
```
|
|
156
290
|
|
|
291
|
+
## Roadmap
|
|
292
|
+
|
|
293
|
+
### Planned Features
|
|
294
|
+
|
|
295
|
+
- **Enhanced Learning** - Pattern extraction from successful/failed decompositions
|
|
296
|
+
- **Swarm Observability** - Real-time visualization of agent coordination
|
|
297
|
+
- **Advanced Strategies** - Risk-based decomposition, critical path optimization
|
|
298
|
+
- **Multi-Project Coordination** - Cross-repo dependencies and shared context
|
|
299
|
+
- **Learning Export/Import** - Share pattern maturity across teams
|
|
300
|
+
|
|
301
|
+
### Experimental
|
|
302
|
+
|
|
303
|
+
- **Auto-healing Swarms** - Agents detect and recover from blockers autonomously
|
|
304
|
+
- **Semantic Code Search** - Vector-based codebase exploration for decomposition context
|
|
305
|
+
- **Prevention Pipeline Integration** - Auto-generate prevention patterns from debug sessions
|
|
306
|
+
|
|
307
|
+
See [swarmtools.ai/docs](https://swarmtools.ai/docs) for latest updates and detailed guides.
|
|
308
|
+
|
|
157
309
|
## License
|
|
158
310
|
|
|
159
311
|
MIT
|