opencode-swarm-plugin 0.31.7 → 0.33.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/.turbo/turbo-test.log +324 -316
- package/CHANGELOG.md +394 -0
- package/README.md +129 -181
- package/bin/swarm.test.ts +31 -0
- package/bin/swarm.ts +635 -140
- package/dist/compaction-hook.d.ts +1 -1
- package/dist/compaction-hook.d.ts.map +1 -1
- package/dist/hive.d.ts.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +653 -139
- package/dist/memory-tools.d.ts.map +1 -1
- package/dist/memory.d.ts +5 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/observability-tools.d.ts +116 -0
- package/dist/observability-tools.d.ts.map +1 -0
- package/dist/plugin.js +648 -136
- package/dist/skills.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts +29 -5
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +66 -0
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm.d.ts +17 -2
- package/dist/swarm.d.ts.map +1 -1
- package/evals/lib/{data-loader.test.ts → data-loader.evalite-test.ts} +7 -6
- package/evals/lib/data-loader.ts +1 -1
- package/evals/scorers/{outcome-scorers.test.ts → outcome-scorers.evalite-test.ts} +1 -1
- package/examples/plugin-wrapper-template.ts +316 -12
- package/global-skills/swarm-coordination/SKILL.md +118 -8
- package/package.json +3 -2
- package/src/compaction-hook.ts +5 -3
- package/src/hive.integration.test.ts +83 -1
- package/src/hive.ts +37 -12
- package/src/index.ts +25 -1
- package/src/mandate-storage.integration.test.ts +601 -0
- package/src/memory-tools.ts +6 -4
- package/src/memory.integration.test.ts +117 -49
- package/src/memory.test.ts +41 -217
- package/src/memory.ts +12 -8
- package/src/observability-tools.test.ts +346 -0
- package/src/observability-tools.ts +594 -0
- package/src/repo-crawl.integration.test.ts +441 -0
- package/src/skills.integration.test.ts +1192 -0
- package/src/skills.test.ts +42 -1
- package/src/skills.ts +8 -4
- package/src/structured.integration.test.ts +817 -0
- package/src/swarm-deferred.integration.test.ts +157 -0
- package/src/swarm-deferred.test.ts +38 -0
- package/src/swarm-mail.integration.test.ts +15 -19
- package/src/swarm-orchestrate.integration.test.ts +282 -0
- package/src/swarm-orchestrate.test.ts +123 -0
- package/src/swarm-orchestrate.ts +279 -201
- package/src/swarm-prompts.test.ts +481 -0
- package/src/swarm-prompts.ts +297 -0
- package/src/swarm-research.integration.test.ts +544 -0
- package/src/swarm-research.test.ts +698 -0
- package/src/swarm-research.ts +472 -0
- package/src/swarm-review.integration.test.ts +290 -0
- package/src/swarm.integration.test.ts +23 -20
- package/src/swarm.ts +6 -3
- package/src/tool-adapter.integration.test.ts +1221 -0
package/dist/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAoBH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,kCAAkC;IAClC,QAAQ,EAAE,aAAa,CAAC;IACxB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,kDAAkD;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;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5. ONLY THEN: Close the cell
|
|
185
185
|
*
|
|
186
|
-
* Closes cell, releases reservations, notifies coordinator
|
|
186
|
+
* Closes cell, releases reservations, notifies coordinator, and resolves
|
|
187
|
+
* a DurableDeferred keyed by bead_id for cross-agent task completion signaling.
|
|
188
|
+
*
|
|
189
|
+
* ## DurableDeferred Integration
|
|
190
|
+
*
|
|
191
|
+
* When a coordinator spawns workers, it can create a deferred BEFORE spawning:
|
|
192
|
+
*
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const swarmMail = await getSwarmMailLibSQL(projectPath);
|
|
195
|
+
* const db = await swarmMail.getDatabase();
|
|
196
|
+
*
|
|
197
|
+
* // Create deferred keyed by bead_id
|
|
198
|
+
* const deferredUrl = `deferred:${beadId}`;
|
|
199
|
+
* await db.query(
|
|
200
|
+
* `INSERT INTO deferred (url, resolved, expires_at, created_at) VALUES (?, 0, ?, ?)`,
|
|
201
|
+
* [deferredUrl, Date.now() + 3600000, Date.now()]
|
|
202
|
+
* );
|
|
203
|
+
*
|
|
204
|
+
* // Spawn worker (swarm_spawn_subtask...)
|
|
205
|
+
*
|
|
206
|
+
* // Await completion
|
|
207
|
+
* const result = await db.query<{ value: string }>(
|
|
208
|
+
* `SELECT value FROM deferred WHERE url = ? AND resolved = 1`,
|
|
209
|
+
* [deferredUrl]
|
|
210
|
+
* );
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* When the worker calls swarm_complete, it resolves the deferred automatically.
|
|
214
|
+
* Coordinator can await without polling.
|
|
187
215
|
*/
|
|
188
216
|
export declare const swarm_complete: {
|
|
189
217
|
description: string;
|
|
@@ -194,7 +222,6 @@ export declare const swarm_complete: {
|
|
|
194
222
|
summary: z.ZodString;
|
|
195
223
|
evaluation: z.ZodOptional<z.ZodString>;
|
|
196
224
|
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
197
|
-
skip_ubs_scan: z.ZodOptional<z.ZodBoolean>;
|
|
198
225
|
skip_verification: z.ZodOptional<z.ZodBoolean>;
|
|
199
226
|
planned_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
200
227
|
start_time: z.ZodOptional<z.ZodNumber>;
|
|
@@ -209,7 +236,6 @@ export declare const swarm_complete: {
|
|
|
209
236
|
summary: string;
|
|
210
237
|
evaluation?: string | undefined;
|
|
211
238
|
files_touched?: string[] | undefined;
|
|
212
|
-
skip_ubs_scan?: boolean | undefined;
|
|
213
239
|
skip_verification?: boolean | undefined;
|
|
214
240
|
planned_files?: string[] | undefined;
|
|
215
241
|
start_time?: number | undefined;
|
|
@@ -564,7 +590,6 @@ export declare const orchestrateTools: {
|
|
|
564
590
|
summary: z.ZodString;
|
|
565
591
|
evaluation: z.ZodOptional<z.ZodString>;
|
|
566
592
|
files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
567
|
-
skip_ubs_scan: z.ZodOptional<z.ZodBoolean>;
|
|
568
593
|
skip_verification: z.ZodOptional<z.ZodBoolean>;
|
|
569
594
|
planned_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
570
595
|
start_time: z.ZodOptional<z.ZodNumber>;
|
|
@@ -579,7 +604,6 @@ export declare const orchestrateTools: {
|
|
|
579
604
|
summary: string;
|
|
580
605
|
evaluation?: string | undefined;
|
|
581
606
|
files_touched?: string[] | undefined;
|
|
582
|
-
skip_ubs_scan?: boolean | undefined;
|
|
583
607
|
skip_verification?: boolean | undefined;
|
|
584
608
|
planned_files?: string[] | undefined;
|
|
585
609
|
start_time?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm-orchestrate.d.ts","sourceRoot":"","sources":["../src/swarm-orchestrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"swarm-orchestrate.d.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;;;;;;;;;;;;CA6rBzB,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJ/B,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;CA6CjC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;CAmClC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;CAmB9B,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;CAoJ9B,CAAC;AA4BH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqG3B,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;CAuGxB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgMtB,CAAC;AAMH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAc5B,CAAC"}
|
package/dist/swarm-prompts.d.ts
CHANGED
|
@@ -38,12 +38,38 @@ export declare const SUBTASK_PROMPT = "You are a swarm agent working on a subtas
|
|
|
38
38
|
* Supports {error_context} placeholder for retry prompts.
|
|
39
39
|
*/
|
|
40
40
|
export declare const SUBTASK_PROMPT_V2 = "You are a swarm agent working on: **{subtask_title}**\n\n## [IDENTITY]\nAgent: (assigned at spawn)\nCell: {bead_id}\nEpic: {epic_id}\n\n## [TASK]\n{subtask_description}\n\n## [FILES]\nReserved (exclusive):\n{file_list}\n\nOnly modify these files. Need others? Message the coordinator.\n\n## [CONTEXT]\n{shared_context}\n\n{compressed_context}\n\n{error_context}\n\n## [MANDATORY SURVIVAL CHECKLIST]\n\n**CRITICAL: Follow this checklist IN ORDER. Each step builds on the previous.**\n\n### Step 1: Initialize Coordination (REQUIRED - DO THIS FIRST)\n```\nswarmmail_init(project_path=\"{project_path}\", task_description=\"{bead_id}: {subtask_title}\")\n```\n\n**This registers you with the coordination system and enables:**\n- File reservation tracking\n- Inter-agent communication\n- Progress monitoring\n- Conflict detection\n\n**If you skip this step, your work will not be tracked and swarm_complete will fail.**\n\n### Step 2: \uD83E\uDDE0 Query Past Learnings (MANDATORY - BEFORE starting work)\n\n**\u26A0\uFE0F CRITICAL: ALWAYS query semantic memory BEFORE writing ANY code.**\n\n```\nsemantic-memory_find(query=\"<keywords from your task>\", limit=5, expand=true)\n```\n\n**Why this is MANDATORY:**\n- Past agents may have already solved your exact problem\n- Avoids repeating mistakes that wasted 30+ minutes before\n- Discovers project-specific patterns and gotchas\n- Finds known workarounds for tool/library quirks\n\n**Search Query Examples by Task Type:**\n\n- **Bug fix**: Use exact error message or \"<symptom> <component>\"\n- **New feature**: Search \"<domain concept> implementation pattern\"\n- **Refactor**: Query \"<pattern name> migration approach\"\n- **Integration**: Look for \"<library name> gotchas configuration\"\n- **Testing**: Find \"testing <component type> characterization tests\"\n- **Performance**: Search \"<technology> performance optimization\"\n\n**BEFORE you start coding:**\n1. Run semantic-memory_find with keywords from your task\n2. Read the results with expand=true for full content\n3. Check if any memory solves your problem or warns of pitfalls\n4. Adjust your approach based on past learnings\n\n**If you skip this step, you WILL waste time solving already-solved problems.**\n\n### Step 3: Load Relevant Skills (if available)\n```\nskills_list() # See what skills exist\nskills_use(name=\"<relevant-skill>\", context=\"<your task>\") # Load skill\n```\n\n**Common skill triggers:**\n- Writing tests? \u2192 `skills_use(name=\"testing-patterns\")`\n- Breaking dependencies? \u2192 `skills_use(name=\"testing-patterns\")`\n- Multi-agent coordination? \u2192 `skills_use(name=\"swarm-coordination\")`\n- Building a CLI? \u2192 `skills_use(name=\"cli-builder\")`\n\n### Step 4: Reserve Your Files (YOU reserve, not coordinator)\n```\nswarmmail_reserve(\n paths=[{file_list}],\n reason=\"{bead_id}: {subtask_title}\",\n exclusive=true\n)\n```\n\n**Workers reserve their own files.** This prevents edit conflicts with other agents.\n\n### Step 5: Do the Work (TDD MANDATORY)\n\n**Follow RED \u2192 GREEN \u2192 REFACTOR. No exceptions.**\n\n1. **RED**: Write a failing test that describes the expected behavior\n - Test MUST fail before you write implementation\n - If test passes immediately, your test is wrong\n \n2. **GREEN**: Write minimal code to make the test pass\n - Don't over-engineer - just make it green\n - Hardcode if needed, refactor later\n \n3. **REFACTOR**: Clean up while tests stay green\n - Run tests after every change\n - If tests break, undo and try again\n\n```bash\n# Run tests continuously\nbun test <your-test-file> --watch\n```\n\n**Why TDD?**\n- Catches bugs before they exist\n- Documents expected behavior\n- Enables fearless refactoring\n- Proves your code works\n\n### Step 6: Report Progress at Milestones\n```\nswarm_progress(\n project_key=\"{project_path}\",\n agent_name=\"<your-agent-name>\",\n bead_id=\"{bead_id}\",\n status=\"in_progress\",\n progress_percent=25, # or 50, 75\n message=\"<what you just completed>\"\n)\n```\n\n**Report at 25%, 50%, 75% completion.** This:\n- Triggers auto-checkpoint (saves context)\n- Keeps coordinator informed\n- Prevents silent failures\n\n### Step 7: Manual Checkpoint BEFORE Risky Operations\n```\nswarm_checkpoint(\n project_key=\"{project_path}\",\n agent_name=\"<your-agent-name>\",\n bead_id=\"{bead_id}\"\n)\n```\n\n**Call BEFORE:**\n- Large refactors\n- File deletions\n- Breaking API changes\n- Anything that might fail catastrophically\n\n**Checkpoints preserve context so you can recover if things go wrong.**\n\n### Step 8: \uD83D\uDCBE STORE YOUR LEARNINGS (if you discovered something)\n\n**If you learned it the hard way, STORE IT so the next agent doesn't have to.**\n\n```\nsemantic-memory_store(\n information=\"<what you learned, WHY it matters, how to apply it>\",\n tags=\"<domain, tech-stack, pattern-type>\"\n)\n```\n\n**MANDATORY Storage Triggers - Store when you:**\n- \uD83D\uDC1B **Solved a tricky bug** (>15min debugging) - include root cause + solution\n- \uD83D\uDCA1 **Discovered a project-specific pattern** - domain rules, business logic quirks\n- \u26A0\uFE0F **Found a tool/library gotcha** - API quirks, version-specific bugs, workarounds\n- \uD83D\uDEAB **Tried an approach that failed** - anti-patterns to avoid, why it didn't work\n- \uD83C\uDFD7\uFE0F **Made an architectural decision** - reasoning, alternatives considered, tradeoffs\n\n**What Makes a GOOD Memory:**\n\n\u2705 **GOOD** (actionable, explains WHY):\n```\n\"OAuth refresh tokens need 5min buffer before expiry to avoid race conditions.\nWithout buffer, token refresh can fail mid-request if expiry happens between\ncheck and use. Implemented with: if (expiresAt - Date.now() < 300000) refresh()\"\n```\n\n\u274C **BAD** (generic, no context):\n```\n\"Fixed the auth bug by adding a null check\"\n```\n\n**What NOT to Store:**\n- Generic knowledge that's in official documentation\n- Implementation details that change frequently\n- Vague descriptions without context (\"fixed the thing\")\n\n**The WHY matters more than the WHAT.** Future agents need context to apply your learning.\n\n### Step 9: Complete (REQUIRED - releases reservations)\n```\nswarm_complete(\n project_key=\"{project_path}\",\n agent_name=\"<your-agent-name>\",\n bead_id=\"{bead_id}\",\n summary=\"<what you accomplished>\",\n files_touched=[\"list\", \"of\", \"files\"]\n)\n```\n\n**This automatically:**\n- Runs UBS bug scan\n- Releases file reservations\n- Records learning signals\n- Notifies coordinator\n\n**DO NOT manually close the cell with hive_close.** Use swarm_complete.\n\n## [SWARM MAIL COMMUNICATION]\n\n### Check Inbox Regularly\n```\nswarmmail_inbox() # Check for coordinator messages\nswarmmail_read_message(message_id=N) # Read specific message\n```\n\n### When Blocked\n```\nswarmmail_send(\n to=[\"coordinator\"],\n subject=\"BLOCKED: {bead_id}\",\n body=\"<blocker description, what you need>\",\n importance=\"high\",\n thread_id=\"{epic_id}\"\n)\nhive_update(id=\"{bead_id}\", status=\"blocked\")\n```\n\n### Report Issues to Other Agents\n```\nswarmmail_send(\n to=[\"OtherAgent\", \"coordinator\"],\n subject=\"Issue in {bead_id}\",\n body=\"<describe problem, don't fix their code>\",\n thread_id=\"{epic_id}\"\n)\n```\n\n### Manual Release (if needed)\n```\nswarmmail_release() # Manually release reservations\n```\n\n**Note:** `swarm_complete` automatically releases reservations. Only use manual release if aborting work.\n\n## [OTHER TOOLS]\n### Hive - You Have Autonomy to File Issues\nYou can create new cells against this epic when you discover:\n- **Bugs**: Found a bug while working? File it.\n- **Tech debt**: Spotted something that needs cleanup? File it.\n- **Follow-up work**: Task needs more work than scoped? File a follow-up.\n- **Dependencies**: Need something from another agent? File and link it.\n\n```\nhive_create(\n title=\"<descriptive title>\",\n type=\"bug\", # or \"task\", \"chore\"\n priority=2,\n parent_id=\"{epic_id}\", # Links to this epic\n description=\"Found while working on {bead_id}: <details>\"\n)\n```\n\n**Don't silently ignore issues.** File them so they get tracked and addressed.\n\nOther cell operations:\n- hive_update(id, status) - Mark blocked if stuck\n- hive_query(status=\"open\") - See what else needs work\n\n### Skills\n- skills_list() - Discover available skills\n- skills_use(name) - Activate skill for specialized guidance\n- skills_create(name) - Create new skill (if you found a reusable pattern)\n\n## [CRITICAL REQUIREMENTS]\n\n**NON-NEGOTIABLE:**\n1. Step 1 (swarmmail_init) MUST be first - do it before anything else\n2. \uD83E\uDDE0 Step 2 (semantic-memory_find) MUST happen BEFORE starting work - query first, code second\n3. Step 4 (swarmmail_reserve) - YOU reserve files, not coordinator\n4. Step 6 (swarm_progress) - Report at milestones, don't work silently\n5. \uD83D\uDCBE Step 8 (semantic-memory_store) - If you learned something hard, STORE IT\n6. Step 9 (swarm_complete) - Use this to close, NOT hive_close\n\n**If you skip these steps:**\n- Your work won't be tracked (swarm_complete will fail)\n- \uD83D\uDD04 You'll waste time repeating already-solved problems (no semantic memory query)\n- Edit conflicts with other agents (no file reservation)\n- Lost work if you crash (no checkpoints)\n- \uD83D\uDD04 Future agents repeat YOUR mistakes (no learnings stored)\n\n**Memory is the swarm's collective intelligence. Query it. Feed it.**\n\nBegin now.";
|
|
41
|
+
/**
|
|
42
|
+
* Researcher prompt template for documentation discovery
|
|
43
|
+
*
|
|
44
|
+
* Spawned BEFORE decomposition to gather technology documentation.
|
|
45
|
+
* Researchers receive an EXPLICIT list of technologies to research from the coordinator.
|
|
46
|
+
* They dynamically discover WHAT TOOLS are available to fetch docs.
|
|
47
|
+
* Output: condensed summary for shared_context + detailed findings in semantic-memory.
|
|
48
|
+
*/
|
|
49
|
+
export declare const RESEARCHER_PROMPT = "You are a swarm researcher gathering documentation for: **{research_id}**\n\n## [IDENTITY]\nAgent: (assigned at spawn)\nResearch Task: {research_id}\nEpic: {epic_id}\n\n## [MISSION]\nGather comprehensive documentation for the specified technologies to inform task decomposition.\n\n**COORDINATOR PROVIDED THESE TECHNOLOGIES TO RESEARCH:**\n{tech_stack}\n\nYou do NOT discover what to research - the coordinator already decided that.\nYou DO discover what TOOLS are available to fetch documentation.\n\n## [OUTPUT MODE]\n{check_upgrades}\n\n## [WORKFLOW]\n\n### Step 1: Initialize (MANDATORY FIRST)\n```\nswarmmail_init(project_path=\"{project_path}\", task_description=\"{research_id}: Documentation research\")\n```\n\n### Step 2: Discover Available Documentation Tools\nCheck what's available for fetching docs:\n- **next-devtools**: `nextjs_docs` for Next.js documentation\n- **context7**: Library documentation lookup (`use context7` in prompts)\n- **fetch**: General web fetching for official docs sites\n- **pdf-brain**: Internal knowledge base search\n\n**Don't assume** - check which tools exist in your environment.\n\n### Step 3: Read Installed Versions\nFor each technology in the tech stack:\n1. Check package.json (or equivalent) for installed version\n2. Record exact version numbers\n3. Note any version constraints (^, ~, etc.)\n\n### Step 4: Fetch Documentation\nFor EACH technology in the list:\n- Use the most appropriate tool (Next.js \u2192 nextjs_docs, libraries \u2192 context7, others \u2192 fetch)\n- Fetch documentation for the INSTALLED version (not latest, unless --check-upgrades)\n- Focus on: API changes, breaking changes, migration guides, best practices\n- Extract key patterns, gotchas, and compatibility notes\n\n**If --check-upgrades mode:**\n- ALSO fetch docs for the LATEST version\n- Compare installed vs latest\n- Note breaking changes, new features, migration complexity\n\n### Step 5: Store Detailed Findings\nFor EACH technology, store in semantic-memory:\n```\nsemantic-memory_store(\n information=\"<technology-name> <version>: <key patterns, gotchas, API changes, compatibility notes>\",\n tags=\"research, <tech-name>, documentation, {epic_id}\"\n)\n```\n\n**Why store individually?** Future agents can search by technology name.\n\n### Step 6: Broadcast Summary\nSend condensed findings to coordinator:\n```\nswarmmail_send(\n to=[\"coordinator\"],\n subject=\"Research Complete: {research_id}\",\n body=\"<brief summary - see semantic-memory for details>\",\n thread_id=\"{epic_id}\"\n)\n```\n\n### Step 7: Return Structured Output\nOutput JSON with:\n```json\n{\n \"technologies\": [\n {\n \"name\": \"string\",\n \"installed_version\": \"string\",\n \"latest_version\": \"string | null\", // Only if --check-upgrades\n \"key_patterns\": [\"string\"],\n \"gotchas\": [\"string\"],\n \"breaking_changes\": [\"string\"], // Only if --check-upgrades\n \"memory_id\": \"string\" // ID of semantic-memory entry\n }\n ],\n \"summary\": \"string\" // Condensed summary for shared_context\n}\n```\n\n## [CRITICAL REQUIREMENTS]\n\n**NON-NEGOTIABLE:**\n1. Step 1 (swarmmail_init) MUST be first\n2. Research ONLY the technologies the coordinator specified\n3. Fetch docs for INSTALLED versions (unless --check-upgrades)\n4. Store detailed findings in semantic-memory (one per technology)\n5. Return condensed summary for coordinator (full details in memory)\n6. Use appropriate doc tools (nextjs_docs for Next.js, context7 for libraries, etc.)\n\n**Output goes TWO places:**\n- **semantic-memory**: Detailed findings (searchable by future agents)\n- **Return JSON**: Condensed summary (for coordinator's shared_context)\n\nBegin research now.";
|
|
50
|
+
/**
|
|
51
|
+
* Coordinator post-worker checklist - MANDATORY review loop
|
|
52
|
+
*
|
|
53
|
+
* This checklist is returned to coordinators after spawning a worker.
|
|
54
|
+
* It ensures coordinators REVIEW worker output before spawning the next worker.
|
|
55
|
+
*/
|
|
56
|
+
export declare const COORDINATOR_POST_WORKER_CHECKLIST = "\n## \u26A0\uFE0F MANDATORY: Post-Worker Review (DO THIS IMMEDIATELY)\n\n**A worker just returned. Before doing ANYTHING else, complete this checklist:**\n\n### Step 1: Check Swarm Mail\n```\nswarmmail_inbox()\nswarmmail_read_message(message_id=N) // Read any messages from the worker\n```\n\n### Step 2: Review the Work\n```\nswarm_review(\n project_key=\"{project_key}\",\n epic_id=\"{epic_id}\",\n task_id=\"{task_id}\",\n files_touched=[{files_touched}]\n)\n```\n\nThis generates a review prompt with:\n- Epic context (what we're trying to achieve)\n- Subtask requirements\n- Git diff of changes\n- Dependency status\n\n### Step 3: Evaluate Against Criteria\n- Does the work fulfill the subtask requirements?\n- Does it serve the overall epic goal?\n- Does it enable downstream tasks?\n- Type safety, no obvious bugs?\n\n### Step 4: Send Feedback\n```\nswarm_review_feedback(\n project_key=\"{project_key}\",\n task_id=\"{task_id}\",\n worker_id=\"{worker_id}\",\n status=\"approved\", // or \"needs_changes\"\n summary=\"<brief summary>\",\n issues=\"[]\" // or \"[{file, line, issue, suggestion}]\"\n)\n```\n\n### Step 5: ONLY THEN Continue\n- If approved: Close the cell, spawn next worker\n- If needs_changes: Worker gets feedback, retries (max 3 attempts)\n- If 3 failures: Mark blocked, escalate to human\n\n**\u26A0\uFE0F DO NOT spawn the next worker until review is complete.**\n";
|
|
41
57
|
/**
|
|
42
58
|
* Prompt for self-evaluation before completing a subtask.
|
|
43
59
|
*
|
|
44
60
|
* Agents use this to assess their work quality before marking complete.
|
|
45
61
|
*/
|
|
46
62
|
export declare const EVALUATION_PROMPT = "Evaluate the work completed for this subtask.\n\n## Subtask\n**Cell ID**: {bead_id}\n**Title**: {subtask_title}\n\n## Files Modified\n{files_touched}\n\n## Evaluation Criteria\n\nFor each criterion, assess passed/failed and provide brief feedback:\n\n1. **type_safe**: Code compiles without TypeScript errors\n2. **no_bugs**: No obvious bugs, edge cases handled\n3. **patterns**: Follows existing codebase patterns and conventions\n4. **readable**: Code is clear and maintainable\n\n## Response Format\n\n```json\n{\n \"passed\": boolean, // Overall pass/fail\n \"criteria\": {\n \"type_safe\": { \"passed\": boolean, \"feedback\": string },\n \"no_bugs\": { \"passed\": boolean, \"feedback\": string },\n \"patterns\": { \"passed\": boolean, \"feedback\": string },\n \"readable\": { \"passed\": boolean, \"feedback\": string }\n },\n \"overall_feedback\": string,\n \"retry_suggestion\": string | null // If failed, what to fix\n}\n```\n\nIf any criterion fails, the overall evaluation fails and retry_suggestion \nshould describe what needs to be fixed.";
|
|
63
|
+
/**
|
|
64
|
+
* Format the researcher prompt for a documentation research task
|
|
65
|
+
*/
|
|
66
|
+
export declare function formatResearcherPrompt(params: {
|
|
67
|
+
research_id: string;
|
|
68
|
+
epic_id: string;
|
|
69
|
+
tech_stack: string[];
|
|
70
|
+
project_path: string;
|
|
71
|
+
check_upgrades: boolean;
|
|
72
|
+
}): string;
|
|
47
73
|
/**
|
|
48
74
|
* Format the V2 subtask prompt for a specific agent
|
|
49
75
|
*/
|
|
@@ -148,6 +174,29 @@ export declare const swarm_spawn_subtask: {
|
|
|
148
174
|
model?: string | undefined;
|
|
149
175
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
150
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Prepare a researcher task for spawning with Task tool
|
|
179
|
+
*
|
|
180
|
+
* Generates a prompt that tells the researcher to fetch documentation for specific technologies.
|
|
181
|
+
* Returns JSON that can be directly used with Task tool.
|
|
182
|
+
*/
|
|
183
|
+
export declare const swarm_spawn_researcher: {
|
|
184
|
+
description: string;
|
|
185
|
+
args: {
|
|
186
|
+
research_id: import("zod").ZodString;
|
|
187
|
+
epic_id: import("zod").ZodString;
|
|
188
|
+
tech_stack: import("zod").ZodArray<import("zod").ZodString>;
|
|
189
|
+
project_path: import("zod").ZodString;
|
|
190
|
+
check_upgrades: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
191
|
+
};
|
|
192
|
+
execute(args: {
|
|
193
|
+
research_id: string;
|
|
194
|
+
epic_id: string;
|
|
195
|
+
tech_stack: string[];
|
|
196
|
+
project_path: string;
|
|
197
|
+
check_upgrades?: boolean | undefined;
|
|
198
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
199
|
+
};
|
|
151
200
|
/**
|
|
152
201
|
* Generate self-evaluation prompt
|
|
153
202
|
*/
|
|
@@ -253,6 +302,23 @@ export declare const promptTools: {
|
|
|
253
302
|
model?: string | undefined;
|
|
254
303
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
255
304
|
};
|
|
305
|
+
swarm_spawn_researcher: {
|
|
306
|
+
description: string;
|
|
307
|
+
args: {
|
|
308
|
+
research_id: import("zod").ZodString;
|
|
309
|
+
epic_id: import("zod").ZodString;
|
|
310
|
+
tech_stack: import("zod").ZodArray<import("zod").ZodString>;
|
|
311
|
+
project_path: import("zod").ZodString;
|
|
312
|
+
check_upgrades: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
313
|
+
};
|
|
314
|
+
execute(args: {
|
|
315
|
+
research_id: string;
|
|
316
|
+
epic_id: string;
|
|
317
|
+
tech_stack: string[];
|
|
318
|
+
project_path: string;
|
|
319
|
+
check_upgrades?: boolean | undefined;
|
|
320
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
321
|
+
};
|
|
256
322
|
swarm_evaluation_prompt: {
|
|
257
323
|
description: string;
|
|
258
324
|
args: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm-prompts.d.ts","sourceRoot":"","sources":["../src/swarm-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH;;;;;GAKG;AACH,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMvB,CAAC"}
|
package/dist/swarm.d.ts
CHANGED
|
@@ -102,7 +102,6 @@ export declare const swarmTools: {
|
|
|
102
102
|
summary: import("zod").ZodString;
|
|
103
103
|
evaluation: import("zod").ZodOptional<import("zod").ZodString>;
|
|
104
104
|
files_touched: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
105
|
-
skip_ubs_scan: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
106
105
|
skip_verification: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
107
106
|
planned_files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
108
107
|
start_time: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -117,7 +116,6 @@ export declare const swarmTools: {
|
|
|
117
116
|
summary: string;
|
|
118
117
|
evaluation?: string | undefined;
|
|
119
118
|
files_touched?: string[] | undefined;
|
|
120
|
-
skip_ubs_scan?: boolean | undefined;
|
|
121
119
|
skip_verification?: boolean | undefined;
|
|
122
120
|
planned_files?: string[] | undefined;
|
|
123
121
|
start_time?: number | undefined;
|
|
@@ -362,6 +360,23 @@ export declare const swarmTools: {
|
|
|
362
360
|
model?: string | undefined;
|
|
363
361
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
364
362
|
};
|
|
363
|
+
swarm_spawn_researcher: {
|
|
364
|
+
description: string;
|
|
365
|
+
args: {
|
|
366
|
+
research_id: import("zod").ZodString;
|
|
367
|
+
epic_id: import("zod").ZodString;
|
|
368
|
+
tech_stack: import("zod").ZodArray<import("zod").ZodString>;
|
|
369
|
+
project_path: import("zod").ZodString;
|
|
370
|
+
check_upgrades: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
371
|
+
};
|
|
372
|
+
execute(args: {
|
|
373
|
+
research_id: string;
|
|
374
|
+
epic_id: string;
|
|
375
|
+
tech_stack: string[];
|
|
376
|
+
project_path: string;
|
|
377
|
+
check_upgrades?: boolean | undefined;
|
|
378
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
379
|
+
};
|
|
365
380
|
swarm_evaluation_prompt: {
|
|
366
381
|
description: string;
|
|
367
382
|
args: {
|
package/dist/swarm.d.ts.map
CHANGED
|
@@ -1 +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
|
|
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"}
|
|
@@ -10,12 +10,13 @@ import {
|
|
|
10
10
|
hasRealEvalData,
|
|
11
11
|
getEvalDataSummary,
|
|
12
12
|
} from "./data-loader.js";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
import {
|
|
14
|
+
appendEvent,
|
|
15
|
+
getDatabase,
|
|
16
|
+
closeDatabase,
|
|
17
|
+
type DecompositionGeneratedEvent,
|
|
18
|
+
type SubtaskOutcomeEvent,
|
|
19
|
+
} from "swarm-mail";
|
|
19
20
|
import * as fs from "node:fs";
|
|
20
21
|
import * as path from "node:path";
|
|
21
22
|
import * as os from "node:os";
|
package/evals/lib/data-loader.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Tests the 5 new outcome-based scorers by verifying their exports.
|
|
5
5
|
* Full functional testing happens via Evalite integration.
|
|
6
6
|
*/
|
|
7
|
-
import { describe, it, expect } from "
|
|
7
|
+
import { describe, it, expect } from "bun:test";
|
|
8
8
|
|
|
9
9
|
describe("Outcome Scorers", () => {
|
|
10
10
|
it("exports all 5 outcome scorers from outcome-scorers.ts", async () => {
|