opencode-swarm-plugin 0.26.1 → 0.27.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.
Files changed (77) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +38 -0
  3. package/README.md +43 -46
  4. package/bin/swarm.ts +10 -54
  5. package/dist/compaction-hook.d.ts +57 -0
  6. package/dist/compaction-hook.d.ts.map +1 -0
  7. package/dist/hive.d.ts +741 -0
  8. package/dist/hive.d.ts.map +1 -0
  9. package/dist/index.d.ts +139 -23
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1353 -350
  12. package/dist/learning.d.ts +9 -9
  13. package/dist/plugin.js +1176 -350
  14. package/dist/schemas/cell-events.d.ts +1352 -0
  15. package/dist/schemas/{bead-events.d.ts.map → cell-events.d.ts.map} +1 -1
  16. package/dist/schemas/{bead.d.ts → cell.d.ts} +173 -29
  17. package/dist/schemas/cell.d.ts.map +1 -0
  18. package/dist/schemas/index.d.ts +11 -7
  19. package/dist/schemas/index.d.ts.map +1 -1
  20. package/dist/structured.d.ts +17 -7
  21. package/dist/structured.d.ts.map +1 -1
  22. package/dist/swarm-decompose.d.ts +5 -5
  23. package/dist/swarm-orchestrate.d.ts +16 -2
  24. package/dist/swarm-orchestrate.d.ts.map +1 -1
  25. package/dist/swarm-prompts.d.ts +9 -9
  26. package/dist/swarm-prompts.d.ts.map +1 -1
  27. package/dist/swarm-review.d.ts +210 -0
  28. package/dist/swarm-review.d.ts.map +1 -0
  29. package/dist/swarm-worktree.d.ts +185 -0
  30. package/dist/swarm-worktree.d.ts.map +1 -0
  31. package/dist/swarm.d.ts +7 -0
  32. package/dist/swarm.d.ts.map +1 -1
  33. package/dist/tool-availability.d.ts +3 -2
  34. package/dist/tool-availability.d.ts.map +1 -1
  35. package/docs/analysis-socratic-planner-pattern.md +1 -1
  36. package/docs/planning/ADR-007-swarm-enhancements-worktree-review.md +168 -0
  37. package/docs/testing/context-recovery-test.md +2 -2
  38. package/evals/README.md +2 -2
  39. package/evals/scorers/index.ts +7 -7
  40. package/examples/commands/swarm.md +21 -23
  41. package/examples/plugin-wrapper-template.ts +310 -44
  42. package/examples/skills/{beads-workflow → hive-workflow}/SKILL.md +40 -40
  43. package/examples/skills/swarm-coordination/SKILL.md +1 -1
  44. package/global-skills/swarm-coordination/SKILL.md +14 -14
  45. package/global-skills/swarm-coordination/references/coordinator-patterns.md +3 -3
  46. package/package.json +2 -2
  47. package/src/compaction-hook.ts +161 -0
  48. package/src/{beads.integration.test.ts → hive.integration.test.ts} +92 -80
  49. package/src/{beads.ts → hive.ts} +378 -219
  50. package/src/index.ts +57 -20
  51. package/src/learning.ts +9 -9
  52. package/src/output-guardrails.test.ts +4 -4
  53. package/src/output-guardrails.ts +9 -9
  54. package/src/planning-guardrails.test.ts +1 -1
  55. package/src/planning-guardrails.ts +1 -1
  56. package/src/schemas/{bead-events.test.ts → cell-events.test.ts} +83 -77
  57. package/src/schemas/cell-events.ts +807 -0
  58. package/src/schemas/{bead.ts → cell.ts} +95 -41
  59. package/src/schemas/evaluation.ts +1 -1
  60. package/src/schemas/index.ts +90 -18
  61. package/src/schemas/swarm-context.ts +2 -2
  62. package/src/structured.test.ts +15 -15
  63. package/src/structured.ts +18 -11
  64. package/src/swarm-decompose.ts +23 -23
  65. package/src/swarm-orchestrate.ts +135 -21
  66. package/src/swarm-prompts.ts +43 -43
  67. package/src/swarm-review.test.ts +702 -0
  68. package/src/swarm-review.ts +696 -0
  69. package/src/swarm-worktree.test.ts +501 -0
  70. package/src/swarm-worktree.ts +575 -0
  71. package/src/swarm.integration.test.ts +12 -12
  72. package/src/tool-availability.ts +36 -3
  73. package/dist/beads.d.ts +0 -386
  74. package/dist/beads.d.ts.map +0 -1
  75. package/dist/schemas/bead-events.d.ts +0 -698
  76. package/dist/schemas/bead.d.ts.map +0 -1
  77. package/src/schemas/bead-events.ts +0 -583
@@ -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 197 modules in 35ms
2
+ Bundled 200 modules in 36ms
3
3
 
4
- index.js 1.16 MB (entry point)
4
+ index.js 1.19 MB (entry point)
5
5
 
6
- Bundled 198 modules in 33ms
6
+ Bundled 201 modules in 35ms
7
7
 
8
- plugin.js 1.13 MB (entry point)
8
+ plugin.js 1.16 MB (entry point)
9
9
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # opencode-swarm-plugin
2
2
 
3
+ ## 0.27.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`50a2bf5`](https://github.com/joelhooks/swarm-tools/commit/50a2bf51c5320c038f202191d7acbfd2179f2cb3) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix cells view migration not being applied
8
+
9
+ The v7 migration (cellsViewMigration) that creates the `cells` view was added after
10
+ swarm-mail@0.3.0 was published. This caused `hive_sync` to fail with
11
+ "relation cells does not exist" because the JSONL export queries the `cells` view.
12
+
13
+ This patch ensures the v7 migration is included in the published package.
14
+
15
+ - Updated dependencies [[`50a2bf5`](https://github.com/joelhooks/swarm-tools/commit/50a2bf51c5320c038f202191d7acbfd2179f2cb3)]:
16
+ - swarm-mail@0.3.2
17
+
18
+ ## 0.27.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [`26fd2ef`](https://github.com/joelhooks/swarm-tools/commit/26fd2ef27562edc39f7db7a9cdbed399a465200d) Thanks [@joelhooks](https://github.com/joelhooks)! - Rename beads → hive across the codebase
23
+
24
+ - `createBeadsAdapter` → `createHiveAdapter` (old name still exported as alias)
25
+ - `BeadsAdapter` type → `HiveAdapter` type
26
+ - All internal references updated to use hive terminology
27
+ - Backward compatible: old exports still work but are deprecated
28
+
29
+ - [`ab23071`](https://github.com/joelhooks/swarm-tools/commit/ab23071cc7509c4fc37e1cac0f38a3812022cdf5) Thanks [@joelhooks](https://github.com/joelhooks)! - Add swarm-aware compaction hook to keep swarms cooking after context compression
30
+
31
+ - New `experimental.session.compacting` hook detects active swarms and injects recovery context
32
+ - `hasSwarmSign()` checks for swarm evidence: in-progress beads, subtasks, unclosed epics
33
+ - Compaction prompt instructs coordinator to immediately resume orchestration
34
+ - Fix @types/node conflicts by pinning to 22.19.3 in root overrides
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [[`26fd2ef`](https://github.com/joelhooks/swarm-tools/commit/26fd2ef27562edc39f7db7a9cdbed399a465200d)]:
39
+ - swarm-mail@0.3.0
40
+
3
41
  ## 0.26.1
4
42
 
5
43
  ### Patch Changes
package/README.md CHANGED
@@ -14,22 +14,28 @@ OpenCode plugin for multi-agent swarm coordination with learning capabilities.
14
14
  ╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
15
15
  ```
16
16
 
17
+ ## Install
18
+
19
+ ```bash
20
+ # Install
21
+ npm install -g opencode-swarm-plugin@latest
22
+ swarm setup
23
+
24
+ # For semantic memory (optional but recommended)
25
+ brew install ollama
26
+ ollama serve &
27
+ ollama pull mxbai-embed-large
28
+ ```
29
+
17
30
  ## Features
18
31
 
19
32
  - **Swarm Coordination** - Break tasks into parallel subtasks, spawn worker agents
20
- - **Beads Integration** - Git-backed issue tracking with atomic epic creation
33
+ - **Hive Integration** - Git-backed work item tracking with atomic epic creation
21
34
  - **Agent Mail** - Inter-agent messaging with file reservations
22
35
  - **Learning System** - Pattern maturity, anti-pattern detection, confidence decay
23
36
  - **Skills System** - Knowledge injection with bundled and custom skills
24
37
  - **Checkpoint & Recovery** - Auto-checkpoint at 25/50/75%, survive context death (9 integration tests ✅)
25
38
 
26
- ## Install
27
-
28
- ```bash
29
- npm install -g opencode-swarm-plugin@latest
30
- swarm setup
31
- ```
32
-
33
39
  ## Usage
34
40
 
35
41
  ```bash
@@ -38,18 +44,20 @@ swarm setup
38
44
 
39
45
  ## Tools Provided
40
46
 
41
- ### Beads (Issue Tracking)
47
+ ### Hive (Work Item Tracking)
42
48
 
43
- | Tool | Purpose |
44
- | ------------------- | ------------------------------------- |
45
- | `beads_create` | Create bead with type-safe validation |
46
- | `beads_create_epic` | Atomic epic + subtasks creation |
47
- | `beads_query` | Query with filters |
48
- | `beads_update` | Update status/description/priority |
49
- | `beads_close` | Close with reason |
50
- | `beads_start` | Mark in-progress |
51
- | `beads_ready` | Get next unblocked bead |
52
- | `beads_sync` | Sync to git |
49
+ | Tool | Purpose |
50
+ | ------------------ | ------------------------------------- |
51
+ | `hive_create` | Create cell with type-safe validation |
52
+ | `hive_create_epic` | Atomic epic + subtasks creation |
53
+ | `hive_query` | Query with filters |
54
+ | `hive_update` | Update status/description/priority |
55
+ | `hive_close` | Close with reason |
56
+ | `hive_start` | Mark in-progress |
57
+ | `hive_ready` | Get next unblocked cell |
58
+ | `hive_sync` | Sync to git |
59
+
60
+ > **Migration Note:** `beads_*` tools still work but show deprecation warnings. Update to `hive_*` tools.
53
61
 
54
62
  ### Swarm Mail (Agent Coordination)
55
63
 
@@ -108,8 +116,8 @@ When `swarm_progress` reports 25%, 50%, or 75% completion, a checkpoint is autom
108
116
  ```typescript
109
117
  // Stored in .swarm-mail/ directory (no external database needed)
110
118
  {
111
- epic_id: "bd-123",
112
- bead_id: "bd-123.1",
119
+ epic_id: "hv-123",
120
+ cell_id: "hv-123.1",
113
121
  strategy: "file-based",
114
122
  files: ["src/auth.ts", "src/middleware.ts"],
115
123
  progress_percent: 50,
@@ -133,8 +141,8 @@ When `swarm_progress` reports 25%, 50%, or 75% completion, a checkpoint is autom
133
141
  swarm_checkpoint({
134
142
  project_key: "/abs/path",
135
143
  agent_name: "WorkerA",
136
- bead_id: "bd-123.1",
137
- epic_id: "bd-123",
144
+ cell_id: "hv-123.1",
145
+ epic_id: "hv-123",
138
146
  files_modified: ["src/auth.ts"],
139
147
  progress_percent: 30,
140
148
  directives: { shared_context: "..." },
@@ -146,12 +154,12 @@ swarm_checkpoint({
146
154
  ```typescript
147
155
  swarm_recover({
148
156
  project_key: "/abs/path",
149
- epic_id: "bd-123"
157
+ epic_id: "hv-123"
150
158
  })
151
159
  // Returns:
152
160
  // {
153
161
  // found: true,
154
- // context: { epic_id, bead_id, files, strategy, directives, recovery },
162
+ // context: { epic_id, cell_id, files, strategy, directives, recovery },
155
163
  // age_seconds: 120
156
164
  // }
157
165
  ```
@@ -175,7 +183,7 @@ Located in `global-skills/`:
175
183
 
176
184
  ```
177
185
  src/
178
- ├── beads.ts # Beads integration
186
+ ├── hive.ts # Hive integration (work item tracking)
179
187
  ├── agent-mail.ts # Agent Mail tools (legacy MCP wrapper)
180
188
  ├── swarm-mail.ts # Swarm Mail tools (new, uses swarm-mail package)
181
189
  ├── swarm.ts # Swarm orchestration tools
@@ -197,7 +205,12 @@ src/
197
205
  | Dependency | Purpose |
198
206
  |------------|---------|
199
207
  | [OpenCode](https://opencode.ai) | AI coding agent (the plugin runs inside OpenCode) |
200
- | [Beads](https://github.com/steveyegge/beads) | Git-backed issue tracking |
208
+
209
+ ### Required for Semantic Memory
210
+
211
+ | Dependency | Purpose | Install |
212
+ |------------|---------|---------|
213
+ | [Ollama](https://ollama.ai) | Embedding model for semantic memory | `brew install ollama && ollama serve & && ollama pull mxbai-embed-large` |
201
214
 
202
215
  ### Optional (Highly Recommended)
203
216
 
@@ -207,7 +220,7 @@ These tools significantly enhance the swarm experience:
207
220
  |------|---------|---------|
208
221
  | [CASS](https://github.com/Dicklesworthstone/coding_agent_session_search) | Historical context - queries past sessions for similar decompositions | See below |
209
222
  | [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 |
223
+ | [semantic-memory](https://github.com/joelhooks/semantic-memory) | Learning persistence - stores patterns across sessions | Requires Ollama (see above) |
211
224
 
212
225
  #### Installing CASS
213
226
 
@@ -232,23 +245,7 @@ pip install -e .
232
245
 
233
246
  #### Installing semantic-memory
234
247
 
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.
248
+ The `semantic-memory_check` tool verifies Ollama is ready (see installation steps above).
252
249
 
253
250
  **Why install these?**
254
251
 
@@ -284,7 +281,7 @@ bun run typecheck
284
281
  ```bash
285
282
  swarm setup # Install and configure
286
283
  swarm doctor # Check dependencies
287
- swarm init # Initialize beads in project
284
+ swarm init # Initialize hive in project
288
285
  swarm config # Show config file paths
289
286
  ```
290
287
 
package/bin/swarm.ts CHANGED
@@ -336,46 +336,8 @@ const DEPENDENCIES: Dependency[] = [
336
336
  installType: "brew",
337
337
  description: "AI coding assistant (plugin host)",
338
338
  },
339
- {
340
- name: "Beads",
341
- command: "bd",
342
- checkArgs: ["--version"],
343
- required: true,
344
- install:
345
- "curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash",
346
- installType: "curl",
347
- description: "Git-backed issue tracking",
348
- },
349
- {
350
- name: "Go",
351
- command: "go",
352
- checkArgs: ["version"],
353
- required: false,
354
- install: "brew install go",
355
- installType: "brew",
356
- description: "Required for Agent Mail",
357
- },
358
- {
359
- name: "MCP Agent Mail",
360
- command: "curl",
361
- checkArgs: [
362
- "-s",
363
- "-X",
364
- "POST",
365
- "http://localhost:8765/mcp",
366
- "-H",
367
- "Content-Type: application/json",
368
- "-d",
369
- "{}",
370
- "-o",
371
- "/dev/null",
372
- ],
373
- required: false,
374
- install: "https://github.com/Dicklesworthstone/mcp_agent_mail",
375
- installType: "manual",
376
- description:
377
- "Multi-agent coordination & file reservations (like Gmail for coding agents)",
378
- },
339
+ // Note: Beads CLI (bd) is NO LONGER required - we use HiveAdapter from swarm-mail
340
+ // which provides the same functionality programmatically without external dependencies
379
341
  {
380
342
  name: "CASS (Coding Agent Session Search)",
381
343
  command: "cass",
@@ -951,11 +913,11 @@ Synthesize findings into shared_context for workers.
951
913
  \`\`\`
952
914
  swarm_select_strategy(task="<task>")
953
915
  swarm_plan_prompt(task="<task>", context="<synthesized knowledge>")
954
- swarm_validate_decomposition(response="<BeadTree JSON>")
916
+ swarm_validate_decomposition(response="<CellTree JSON>")
955
917
  \`\`\`
956
918
 
957
919
  ### Phase 4: Create Beads
958
- \`beads_create_epic(epic_title="<task>", subtasks=[...])\`
920
+ \`hive_create_epic(epic_title="<task>", subtasks=[...])\`
959
921
 
960
922
  ### Phase 5: Reserve Files
961
923
  \`swarmmail_reserve(paths=[...], reason="<bead-id>: <desc>")\`
@@ -979,7 +941,7 @@ Intervene if: blocked >5min, file conflicts, scope creep.
979
941
  ### Phase 8: Complete
980
942
  \`\`\`
981
943
  swarm_complete(...)
982
- beads_sync()
944
+ hive_sync()
983
945
  \`\`\`
984
946
 
985
947
  ## Strategy Reference
@@ -1033,7 +995,7 @@ Synthesize findings - note relevant patterns, past approaches, and skills to rec
1033
995
 
1034
996
  \`swarm_plan_prompt(task="<task>", context="<synthesized knowledge>")\`
1035
997
 
1036
- ### 4. Output BeadTree
998
+ ### 4. Output CellTree
1037
999
 
1038
1000
  Return ONLY valid JSON - no markdown, no explanation:
1039
1001
 
@@ -1093,7 +1055,7 @@ Your Task prompt contains detailed instructions including:
1093
1055
  6. **swarm_progress()** - Report at 25/50/75%
1094
1056
  7. **swarm_checkpoint()** - Before risky operations
1095
1057
  8. **semantic-memory_store()** - Store learnings
1096
- 9. **swarm_complete()** - NOT beads_close
1058
+ 9. **swarm_complete()** - NOT hive_close
1097
1059
 
1098
1060
  ## Non-Negotiables
1099
1061
 
@@ -1112,7 +1074,7 @@ swarmmail_send(
1112
1074
  body="<what you need>",
1113
1075
  importance="high"
1114
1076
  )
1115
- beads_update(id="<bead-id>", status="blocked")
1077
+ hive_update(id="<bead-id>", status="blocked")
1116
1078
  \`\`\`
1117
1079
 
1118
1080
  ## Focus
@@ -1136,16 +1098,10 @@ function getFixCommand(dep: Dependency): string | null {
1136
1098
  switch (dep.name) {
1137
1099
  case "OpenCode":
1138
1100
  return "brew install sst/tap/opencode";
1139
- case "Beads":
1140
- return "curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash";
1141
- case "Go":
1142
- return "brew install go (or visit https://go.dev/dl/)";
1143
1101
  case "semantic-memory":
1144
1102
  return "npm install -g semantic-memory";
1145
1103
  case "Redis":
1146
1104
  return "brew install redis && brew services start redis";
1147
- case "MCP Agent Mail":
1148
- return "See: https://github.com/Dicklesworthstone/mcp_agent_mail";
1149
1105
  case "CASS (Coding Agent Session Search)":
1150
1106
  return "See: https://github.com/Dicklesworthstone/coding_agent_session_search";
1151
1107
  case "UBS (Ultimate Bug Scanner)":
@@ -2224,9 +2180,9 @@ async function listTools() {
2224
2180
  }
2225
2181
 
2226
2182
  console.log(dim("Usage: swarm tool <name> [--json '<args>']"));
2227
- console.log(dim("Example: swarm tool beads_ready"));
2183
+ console.log(dim("Example: swarm tool hive_ready"));
2228
2184
  console.log(
2229
- dim('Example: swarm tool beads_create --json \'{"title": "Fix bug"}\''),
2185
+ dim('Example: swarm tool hive_create --json \'{"title": "Fix bug"}\''),
2230
2186
  );
2231
2187
  }
2232
2188
 
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Swarm-Aware Compaction Hook
3
+ *
4
+ * Provides context preservation during OpenCode session compaction.
5
+ * When context is compacted, this hook injects instructions for the summarizer
6
+ * to preserve swarm coordination state and enable seamless resumption.
7
+ *
8
+ * Hook signature (from @opencode-ai/plugin):
9
+ * ```typescript
10
+ * "experimental.session.compacting"?: (
11
+ * input: { sessionID: string },
12
+ * output: { context: string[] }
13
+ * ) => Promise<void>
14
+ * ```
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { SWARM_COMPACTION_CONTEXT, createCompactionHook } from "opencode-swarm-plugin";
19
+ *
20
+ * const hooks: Hooks = {
21
+ * "experimental.session.compacting": createCompactionHook(),
22
+ * };
23
+ * ```
24
+ */
25
+ /**
26
+ * Swarm-aware compaction context
27
+ *
28
+ * Injected during compaction to keep the swarm cooking. The coordinator should
29
+ * wake up from compaction and immediately resume orchestration - spawning agents,
30
+ * monitoring progress, unblocking work.
31
+ *
32
+ * This is NOT about preserving state for a human - it's about the swarm continuing
33
+ * autonomously after context compression.
34
+ */
35
+ export declare const SWARM_COMPACTION_CONTEXT = "## \uD83D\uDC1D SWARM ACTIVE - Keep Cooking\n\nYou are the **COORDINATOR** of an active swarm. Context was compacted but the swarm is still running.\n\n**YOUR JOB:** Keep orchestrating. Spawn agents. Monitor progress. Unblock work. Ship it.\n\n### Preserve in Summary\n\nExtract from session context:\n\n1. **Epic & Subtasks** - IDs, titles, status, file assignments\n2. **What's Running** - Which agents are active, what they're working on \n3. **What's Blocked** - Blockers and what's needed to unblock\n4. **What's Done** - Completed work and any follow-ups needed\n5. **What's Next** - Pending subtasks ready to spawn\n\n### Summary Format\n\n```\n## \uD83D\uDC1D Swarm State\n\n**Epic:** <bd-xxx> - <title>\n**Project:** <path>\n**Progress:** X/Y subtasks complete\n\n**Active:**\n- <bd-xxx>: <title> [in_progress] \u2192 <agent> working on <files>\n\n**Blocked:**\n- <bd-xxx>: <title> - BLOCKED: <reason>\n\n**Completed:**\n- <bd-xxx>: <title> \u2713\n\n**Ready to Spawn:**\n- <bd-xxx>: <title> (files: <...>)\n```\n\n### On Resume - IMMEDIATELY\n\n1. `swarm_status(epic_id=\"<epic>\", project_key=\"<path>\")` - Get current state\n2. `swarmmail_inbox(limit=5)` - Check for agent messages\n3. **Spawn ready subtasks** - Don't wait, fire them off\n4. **Unblock blocked work** - Resolve dependencies, reassign if needed\n5. **Collect completed work** - Close done subtasks, verify quality\n\n### Keep the Swarm Cooking\n\n- **Spawn aggressively** - If a subtask is ready and unblocked, spawn an agent\n- **Monitor actively** - Check status, read messages, respond to blockers\n- **Close the loop** - When all subtasks done, verify and close the epic\n- **Don't stop** - The swarm runs until the epic is closed\n\n**You are not waiting for instructions. You are the coordinator. Coordinate.**\n";
36
+ /**
37
+ * Create the compaction hook for use in plugin registration
38
+ *
39
+ * Only injects swarm context if there's an active swarm (in-progress beads).
40
+ * This keeps the coordinator cooking after compaction.
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * import { createCompactionHook } from "opencode-swarm-plugin";
45
+ *
46
+ * export const SwarmPlugin: Plugin = async () => ({
47
+ * tool: { ... },
48
+ * "experimental.session.compacting": createCompactionHook(),
49
+ * });
50
+ * ```
51
+ */
52
+ export declare function createCompactionHook(): (_input: {
53
+ sessionID: string;
54
+ }, output: {
55
+ context: string[];
56
+ }) => Promise<void>;
57
+ //# sourceMappingURL=compaction-hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compaction-hook.d.ts","sourceRoot":"","sources":["../src/compaction-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,2wDAsDpC,CAAC;AAyCF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,KAEhC,QAAQ;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EAC7B,QAAQ;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,KAC5B,OAAO,CAAC,IAAI,CAAC,CAMjB"}