opencode-swarm-plugin 0.45.6 → 0.46.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.
Files changed (47) hide show
  1. package/bin/cass.characterization.test.ts +400 -379
  2. package/bin/eval-gate.test.ts +23 -0
  3. package/bin/eval-gate.ts +21 -0
  4. package/bin/swarm.ts +141 -45
  5. package/dist/bin/swarm.js +4504 -5064
  6. package/dist/cass-tools.d.ts +1 -2
  7. package/dist/cass-tools.d.ts.map +1 -1
  8. package/dist/compaction-hook.d.ts +50 -6
  9. package/dist/compaction-hook.d.ts.map +1 -1
  10. package/dist/dashboard.d.ts +5 -6
  11. package/dist/dashboard.d.ts.map +1 -1
  12. package/dist/eval-capture.d.ts +20 -10
  13. package/dist/eval-capture.d.ts.map +1 -1
  14. package/dist/eval-capture.js +54 -21
  15. package/dist/eval-learning.d.ts +5 -5
  16. package/dist/eval-learning.d.ts.map +1 -1
  17. package/dist/hive.d.ts +7 -0
  18. package/dist/hive.d.ts.map +1 -1
  19. package/dist/hive.js +61 -24
  20. package/dist/hivemind-tools.d.ts +479 -0
  21. package/dist/hivemind-tools.d.ts.map +1 -0
  22. package/dist/index.d.ts +31 -98
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1018 -467
  25. package/dist/observability-health.d.ts +87 -0
  26. package/dist/observability-health.d.ts.map +1 -0
  27. package/dist/observability-tools.d.ts +5 -1
  28. package/dist/observability-tools.d.ts.map +1 -1
  29. package/dist/planning-guardrails.d.ts +24 -5
  30. package/dist/planning-guardrails.d.ts.map +1 -1
  31. package/dist/plugin.js +1006 -475
  32. package/dist/query-tools.d.ts +23 -5
  33. package/dist/query-tools.d.ts.map +1 -1
  34. package/dist/regression-detection.d.ts +58 -0
  35. package/dist/regression-detection.d.ts.map +1 -0
  36. package/dist/swarm-orchestrate.d.ts +3 -3
  37. package/dist/swarm-orchestrate.d.ts.map +1 -1
  38. package/dist/swarm-prompts.d.ts +4 -4
  39. package/dist/swarm-prompts.d.ts.map +1 -1
  40. package/dist/swarm-prompts.js +165 -74
  41. package/dist/swarm-research.d.ts +0 -2
  42. package/dist/swarm-research.d.ts.map +1 -1
  43. package/dist/tool-availability.d.ts +1 -1
  44. package/dist/tool-availability.d.ts.map +1 -1
  45. package/examples/commands/swarm.md +7 -7
  46. package/global-skills/swarm-coordination/SKILL.md +6 -6
  47. package/package.json +6 -3
@@ -57,7 +57,7 @@ $ARGUMENTS
57
57
  │ → Caught worker blocked on database schema │
58
58
  │ → Unblocked by coordinating with upstream worker │
59
59
  │ │
60
- │ ✅ Delegated planning to swarm/planner subagent │
60
+ │ ✅ Delegated planning to swarm-planner subagent │
61
61
  │ → Main context stayed clean (only received JSON) │
62
62
  │ → Scaled to 7 workers without context exhaustion │
63
63
  │ │
@@ -346,7 +346,7 @@ swarm_plan_interactive(
346
346
  >
347
347
  > **DO NOT decompose inline in the coordinator thread.** This consumes massive context with file reading, CASS queries, and reasoning.
348
348
  >
349
- > **ALWAYS delegate to a `swarm/planner` subagent** that returns only the validated CellTree JSON.
349
+ > **ALWAYS delegate to a `swarm-planner` subagent** that returns only the validated CellTree JSON.
350
350
 
351
351
  **❌ Don't do this (inline planning):**
352
352
 
@@ -365,9 +365,9 @@ hive_create(title="Plan: <task>", type="task", description="Decompose into subta
365
365
  # 2. Get final prompt from swarm_plan_interactive (when ready_to_decompose=true)
366
366
  # final_prompt = <from last swarm_plan_interactive call>
367
367
 
368
- # 3. Delegate to swarm/planner subagent
368
+ # 3. Delegate to swarm-planner subagent
369
369
  Task(
370
- subagent_type="swarm/planner",
370
+ subagent_type="swarm-planner",
371
371
  description="Decompose task: <task>",
372
372
  prompt="
373
373
  You are a swarm planner. Generate a CellTree for this task.
@@ -459,7 +459,7 @@ See full skill list with skills_list().
459
459
  Then spawn:
460
460
 
461
461
  ```bash
462
- Task(subagent_type="swarm/worker", description="<bead-title>", prompt="<from swarm_spawn_subtask>")
462
+ Task(subagent_type="swarm-worker", description="<bead-title>", prompt="<from swarm_spawn_subtask>")
463
463
  ```
464
464
 
465
465
  **Event tracked:** `worker_spawned` (for each worker)
@@ -639,7 +639,7 @@ These events are now tracked for coordinator evaluation:
639
639
  | `session_initialized` | swarmmail_init called |
640
640
  | `skill_loaded` | skills_use called |
641
641
  | `researcher_spawned` | Task(subagent_type="swarm-researcher") |
642
- | `worker_spawned` | Task(subagent_type="swarm/worker") |
642
+ | `worker_spawned` | Task(subagent_type="swarm-worker") |
643
643
  | `decomposition_complete` | hive_create_epic called |
644
644
  | `inbox_checked` | swarmmail_inbox called |
645
645
  | `blocker_resolved` | Coordinator unblocked stuck worker |
@@ -672,7 +672,7 @@ Not: Do Everything Inline → Run Out of Context → Fail
672
672
  - [ ] Knowledge gathered (semantic-memory, CASS, pdf-brain, skills)
673
673
  - [ ] **Skills loaded** → Event: `skill_loaded` (per skill)
674
674
  - [ ] **Researcher spawned if needed** → Event: `researcher_spawned`
675
- - [ ] **Planning delegated to swarm/planner subagent** (NOT inline)
675
+ - [ ] **Planning delegated to swarm-planner subagent** (NOT inline)
676
676
  - [ ] CellTree validated (no file conflicts)
677
677
  - [ ] Epic + subtasks created → Event: `decomposition_complete`
678
678
  - [ ] **Coordinator did NOT reserve files** (workers do this themselves)
@@ -310,7 +310,7 @@ Synthesize findings into `shared_context` for workers.
310
310
  >
311
311
  > **NEVER do planning inline in the coordinator thread.** Decomposition work (file reading, CASS searching, reasoning about task breakdown) consumes massive amounts of context and will exhaust your token budget on long swarms.
312
312
  >
313
- > **ALWAYS delegate planning to a `swarm/planner` subagent** and receive only the structured CellTree JSON result back.
313
+ > **ALWAYS delegate planning to a `swarm-planner` subagent** and receive only the structured CellTree JSON result back.
314
314
 
315
315
  **❌ Anti-Pattern (Context-Heavy):**
316
316
 
@@ -332,9 +332,9 @@ await hive_create({
332
332
  description: `Decompose into subtasks. Context: ${synthesizedContext}`,
333
333
  });
334
334
 
335
- // 2. Delegate to swarm/planner subagent
335
+ // 2. Delegate to swarm-planner subagent
336
336
  const planningResult = await Task({
337
- subagent_type: "swarm/planner",
337
+ subagent_type: "swarm-planner",
338
338
  description: `Decompose task: ${taskTitle}`,
339
339
  prompt: `
340
340
  You are a swarm planner. Generate a CellTree for this task.
@@ -438,7 +438,7 @@ for (const subtask of subtasks) {
438
438
 
439
439
  // Spawn via Task tool
440
440
  Task({
441
- subagent_type: "swarm/worker",
441
+ subagent_type: "swarm-worker",
442
442
  prompt: prompt.worker_prompt,
443
443
  });
444
444
  }
@@ -520,7 +520,7 @@ swarm_complete({ ... });
520
520
 
521
521
  // Coordinator immediately spawns next worker
522
522
  // ⚠️ WRONG - No quality gate!
523
- Task({ subagent_type: "swarm/worker", prompt: nextWorkerPrompt });
523
+ Task({ subagent_type: "swarm-worker", prompt: nextWorkerPrompt });
524
524
  ```
525
525
 
526
526
  **✅ Correct Pattern (Review Before Proceeding):**
@@ -535,7 +535,7 @@ swarm_review({ ... });
535
535
  swarm_review_feedback({ status: "approved" });
536
536
 
537
537
  // ONLY THEN spawn next worker
538
- Task({ subagent_type: "swarm/worker", prompt: nextWorkerPrompt });
538
+ Task({ subagent_type: "swarm-worker", prompt: nextWorkerPrompt });
539
539
  ```
540
540
 
541
541
  **Review Workflow (3-Strike Rule):**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm-plugin",
3
- "version": "0.45.6",
3
+ "version": "0.46.0",
4
4
  "description": "Multi-agent swarm coordination for OpenCode with learning capabilities, beads integration, and Agent Mail",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,6 +43,7 @@
43
43
  "test": "bun test --timeout 10000 src/anti-patterns.test.ts src/mandate-promotion.test.ts src/mandate-storage.test.ts src/output-guardrails.test.ts src/pattern-maturity.test.ts src/skills.test.ts src/structured.test.ts src/schemas/",
44
44
  "test:integration": "bun test --timeout 60000 src/*.integration.test.ts",
45
45
  "test:all": "bun test --timeout 60000 src/",
46
+ "test:isolated": "bun test ./src/zz-compaction-hook.test.ts && bun test ./src/zz-compaction-observability.integration.test.ts && bun test ./src/zz-eval-runner.test.ts",
46
47
  "test:watch": "bun test --watch src/",
47
48
  "typecheck": "tsc --noEmit",
48
49
  "eval:run": "bun --env-file=.env run bunx evalite run evals/",
@@ -63,11 +64,12 @@
63
64
  "minimatch": "^10.1.1",
64
65
  "pino": "^9.6.0",
65
66
  "pino-roll": "^1.3.0",
66
- "swarm-mail": "1.6.2",
67
+ "swarm-mail": "1.7.0",
67
68
  "yaml": "^2.8.2",
68
69
  "zod": "4.1.8"
69
70
  },
70
71
  "devDependencies": {
72
+ "@libsql/client": "^0.15.15",
71
73
  "@types/bun": "latest",
72
74
  "@types/minimatch": "^6.0.0",
73
75
  "ai": "6.0.0-beta.150",
@@ -75,7 +77,8 @@
75
77
  "evalite": "^0.19.0",
76
78
  "pino-pretty": "^13.1.3",
77
79
  "turbo": "^2.6.3",
78
- "typescript": "^5.7.0"
80
+ "typescript": "^5.7.0",
81
+ "vitest": "^3.0.0"
79
82
  },
80
83
  "peerDependencies": {
81
84
  "@opencode-ai/plugin": "^1.0.0"