opencode-swarm-plugin 0.32.0 → 0.34.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 (55) hide show
  1. package/.hive/issues.jsonl +12 -0
  2. package/.hive/memories.jsonl +255 -1
  3. package/.turbo/turbo-build.log +9 -10
  4. package/.turbo/turbo-test.log +343 -337
  5. package/CHANGELOG.md +358 -0
  6. package/README.md +152 -179
  7. package/bin/swarm.test.ts +303 -1
  8. package/bin/swarm.ts +473 -16
  9. package/dist/compaction-hook.d.ts +1 -1
  10. package/dist/compaction-hook.d.ts.map +1 -1
  11. package/dist/index.d.ts +112 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +12380 -131
  14. package/dist/logger.d.ts +34 -0
  15. package/dist/logger.d.ts.map +1 -0
  16. package/dist/observability-tools.d.ts +116 -0
  17. package/dist/observability-tools.d.ts.map +1 -0
  18. package/dist/plugin.js +12254 -119
  19. package/dist/skills.d.ts.map +1 -1
  20. package/dist/swarm-orchestrate.d.ts +105 -0
  21. package/dist/swarm-orchestrate.d.ts.map +1 -1
  22. package/dist/swarm-prompts.d.ts +113 -2
  23. package/dist/swarm-prompts.d.ts.map +1 -1
  24. package/dist/swarm-research.d.ts +127 -0
  25. package/dist/swarm-research.d.ts.map +1 -0
  26. package/dist/swarm-review.d.ts.map +1 -1
  27. package/dist/swarm.d.ts +73 -1
  28. package/dist/swarm.d.ts.map +1 -1
  29. package/evals/compaction-resumption.eval.ts +289 -0
  30. package/evals/coordinator-behavior.eval.ts +307 -0
  31. package/evals/fixtures/compaction-cases.ts +350 -0
  32. package/evals/scorers/compaction-scorers.ts +305 -0
  33. package/evals/scorers/index.ts +12 -0
  34. package/examples/plugin-wrapper-template.ts +297 -8
  35. package/package.json +6 -2
  36. package/src/compaction-hook.test.ts +617 -1
  37. package/src/compaction-hook.ts +291 -18
  38. package/src/index.ts +54 -1
  39. package/src/logger.test.ts +189 -0
  40. package/src/logger.ts +135 -0
  41. package/src/observability-tools.test.ts +346 -0
  42. package/src/observability-tools.ts +594 -0
  43. package/src/skills.integration.test.ts +137 -1
  44. package/src/skills.test.ts +42 -1
  45. package/src/skills.ts +8 -4
  46. package/src/swarm-orchestrate.test.ts +123 -0
  47. package/src/swarm-orchestrate.ts +183 -0
  48. package/src/swarm-prompts.test.ts +553 -1
  49. package/src/swarm-prompts.ts +406 -4
  50. package/src/swarm-research.integration.test.ts +544 -0
  51. package/src/swarm-research.test.ts +698 -0
  52. package/src/swarm-research.ts +472 -0
  53. package/src/swarm-review.test.ts +177 -0
  54. package/src/swarm-review.ts +12 -47
  55. package/src/swarm.ts +6 -3
@@ -551,23 +551,8 @@ You may now complete the task with \`swarm_complete\`.`,
551
551
  }
552
552
  }
553
553
 
554
- // Send failure message
555
- await sendSwarmMessage({
556
- projectPath: args.project_key,
557
- fromAgent: "coordinator",
558
- toAgents: [args.worker_id],
559
- subject: `FAILED: ${args.task_id} - max review attempts reached`,
560
- body: `## Task Failed ✗
561
-
562
- Maximum review attempts (${MAX_REVIEW_ATTEMPTS}) reached.
563
-
564
- **Last Issues:**
565
- ${parsedIssues.map((i: ReviewIssue) => `- ${i.file}${i.line ? `:${i.line}` : ""}: ${i.issue}`).join("\n")}
566
-
567
- The task has been marked as blocked. A human or different approach is needed.`,
568
- threadId: epicId,
569
- importance: "urgent",
570
- });
554
+ // NO sendSwarmMessage - worker is dead, can't read it
555
+ // Coordinator handles retry or escalation
571
556
 
572
557
  return JSON.stringify(
573
558
  {
@@ -584,35 +569,8 @@ The task has been marked as blocked. A human or different approach is needed.`,
584
569
  );
585
570
  }
586
571
 
587
- // Send feedback message
588
- const issuesList = parsedIssues
589
- .map((i: ReviewIssue) => {
590
- let line = `- **${i.file}**`;
591
- if (i.line) line += `:${i.line}`;
592
- line += `: ${i.issue}`;
593
- if (i.suggestion) line += `\n → ${i.suggestion}`;
594
- return line;
595
- })
596
- .join("\n");
597
-
598
- await sendSwarmMessage({
599
- projectPath: args.project_key,
600
- fromAgent: "coordinator",
601
- toAgents: [args.worker_id],
602
- subject: `NEEDS CHANGES: ${args.task_id} (attempt ${attemptNumber}/${MAX_REVIEW_ATTEMPTS})`,
603
- body: `## Review: Changes Needed
604
-
605
- ${args.summary || "Please address the following issues:"}
606
-
607
- **Issues:**
608
- ${issuesList}
609
-
610
- **Remaining attempts:** ${remaining}
611
-
612
- Please fix these issues and request another review.`,
613
- threadId: epicId,
614
- importance: "high",
615
- });
572
+ // NO sendSwarmMessage for needs_changes - worker is dead
573
+ // Instead, return retry_context for coordinator to use with swarm_spawn_retry
616
574
 
617
575
  return JSON.stringify(
618
576
  {
@@ -622,7 +580,14 @@ Please fix these issues and request another review.`,
622
580
  attempt: attemptNumber,
623
581
  remaining_attempts: remaining,
624
582
  issues: parsedIssues,
625
- message: `Feedback sent. ${remaining} attempt(s) remaining.`,
583
+ message: `Review feedback ready. ${remaining} attempt(s) remaining.`,
584
+ retry_context: {
585
+ task_id: args.task_id,
586
+ attempt: attemptNumber,
587
+ max_attempts: MAX_REVIEW_ATTEMPTS,
588
+ issues: parsedIssues,
589
+ next_action: "Use swarm_spawn_retry to spawn new worker with these issues",
590
+ },
626
591
  },
627
592
  null,
628
593
  2
package/src/swarm.ts CHANGED
@@ -16,20 +16,23 @@ export * from "./swarm-strategies";
16
16
  export * from "./swarm-decompose";
17
17
  export * from "./swarm-prompts";
18
18
  export * from "./swarm-orchestrate";
19
+ export * from "./swarm-research";
19
20
 
20
21
  // Import tools from each module
21
- import { strategyTools } from "./swarm-strategies";
22
22
  import { decomposeTools } from "./swarm-decompose";
23
- import { promptTools } from "./swarm-prompts";
24
23
  import { orchestrateTools } from "./swarm-orchestrate";
24
+ import { promptTools } from "./swarm-prompts";
25
+ import { researchTools } from "./swarm-research";
26
+ import { strategyTools } from "./swarm-strategies";
25
27
 
26
28
  /**
27
29
  * Combined swarm tools for plugin registration.
28
- * Includes all tools from strategy, decompose, prompt, and orchestrate modules.
30
+ * Includes all tools from strategy, decompose, prompt, orchestrate, and research modules.
29
31
  */
30
32
  export const swarmTools = {
31
33
  ...strategyTools,
32
34
  ...decomposeTools,
33
35
  ...promptTools,
34
36
  ...orchestrateTools,
37
+ ...researchTools,
35
38
  };