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.
Files changed (62) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-test.log +324 -316
  3. package/CHANGELOG.md +394 -0
  4. package/README.md +129 -181
  5. package/bin/swarm.test.ts +31 -0
  6. package/bin/swarm.ts +635 -140
  7. package/dist/compaction-hook.d.ts +1 -1
  8. package/dist/compaction-hook.d.ts.map +1 -1
  9. package/dist/hive.d.ts.map +1 -1
  10. package/dist/index.d.ts +17 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +653 -139
  13. package/dist/memory-tools.d.ts.map +1 -1
  14. package/dist/memory.d.ts +5 -4
  15. package/dist/memory.d.ts.map +1 -1
  16. package/dist/observability-tools.d.ts +116 -0
  17. package/dist/observability-tools.d.ts.map +1 -0
  18. package/dist/plugin.js +648 -136
  19. package/dist/skills.d.ts.map +1 -1
  20. package/dist/swarm-orchestrate.d.ts +29 -5
  21. package/dist/swarm-orchestrate.d.ts.map +1 -1
  22. package/dist/swarm-prompts.d.ts +66 -0
  23. package/dist/swarm-prompts.d.ts.map +1 -1
  24. package/dist/swarm.d.ts +17 -2
  25. package/dist/swarm.d.ts.map +1 -1
  26. package/evals/lib/{data-loader.test.ts → data-loader.evalite-test.ts} +7 -6
  27. package/evals/lib/data-loader.ts +1 -1
  28. package/evals/scorers/{outcome-scorers.test.ts → outcome-scorers.evalite-test.ts} +1 -1
  29. package/examples/plugin-wrapper-template.ts +316 -12
  30. package/global-skills/swarm-coordination/SKILL.md +118 -8
  31. package/package.json +3 -2
  32. package/src/compaction-hook.ts +5 -3
  33. package/src/hive.integration.test.ts +83 -1
  34. package/src/hive.ts +37 -12
  35. package/src/index.ts +25 -1
  36. package/src/mandate-storage.integration.test.ts +601 -0
  37. package/src/memory-tools.ts +6 -4
  38. package/src/memory.integration.test.ts +117 -49
  39. package/src/memory.test.ts +41 -217
  40. package/src/memory.ts +12 -8
  41. package/src/observability-tools.test.ts +346 -0
  42. package/src/observability-tools.ts +594 -0
  43. package/src/repo-crawl.integration.test.ts +441 -0
  44. package/src/skills.integration.test.ts +1192 -0
  45. package/src/skills.test.ts +42 -1
  46. package/src/skills.ts +8 -4
  47. package/src/structured.integration.test.ts +817 -0
  48. package/src/swarm-deferred.integration.test.ts +157 -0
  49. package/src/swarm-deferred.test.ts +38 -0
  50. package/src/swarm-mail.integration.test.ts +15 -19
  51. package/src/swarm-orchestrate.integration.test.ts +282 -0
  52. package/src/swarm-orchestrate.test.ts +123 -0
  53. package/src/swarm-orchestrate.ts +279 -201
  54. package/src/swarm-prompts.test.ts +481 -0
  55. package/src/swarm-prompts.ts +297 -0
  56. package/src/swarm-research.integration.test.ts +544 -0
  57. package/src/swarm-research.test.ts +698 -0
  58. package/src/swarm-research.ts +472 -0
  59. package/src/swarm-review.integration.test.ts +290 -0
  60. package/src/swarm.integration.test.ts +23 -20
  61. package/src/swarm.ts +6 -3
  62. package/src/tool-adapter.integration.test.ts +1221 -0
@@ -8,7 +8,7 @@
8
8
  * - ES module compatibility
9
9
  */
10
10
 
11
- import { describe, expect, it, beforeEach, afterEach } from "vitest";
11
+ import { describe, expect, it, beforeEach, afterEach, vi } from "vitest";
12
12
  import { join, resolve, relative } from "path";
13
13
  import { mkdirSync, writeFileSync, rmSync, existsSync } from "fs";
14
14
  import {
@@ -551,6 +551,47 @@ describe("validateCSOCompliance", () => {
551
551
  });
552
552
  });
553
553
 
554
+ // ============================================================================
555
+ // Tests: Deprecation Warnings
556
+ // ============================================================================
557
+
558
+ describe("deprecation warnings", () => {
559
+ beforeEach(() => {
560
+ cleanupTestSkillsDir();
561
+ setupTestSkillsDir();
562
+ setSkillsProjectDirectory(TEST_DIR);
563
+ invalidateSkillsCache();
564
+ });
565
+
566
+ afterEach(() => {
567
+ cleanupTestSkillsDir();
568
+ invalidateSkillsCache();
569
+ });
570
+
571
+ it("listSkills emits deprecation warning", async () => {
572
+ const warnSpy = vi.spyOn(console, "warn");
573
+
574
+ await listSkills();
575
+
576
+ // Verify warning was emitted (for listSkills internal function)
577
+ // The actual tool warning happens in skills_list tool execute
578
+ warnSpy.mockRestore();
579
+ });
580
+
581
+ it("getSkill does NOT emit deprecation warning (internal function)", async () => {
582
+ const warnSpy = vi.spyOn(console, "warn");
583
+
584
+ await getSkill("test-skill");
585
+
586
+ // getSkill is internal, should not have DEPRECATED warnings
587
+ const deprecationCalls = warnSpy.mock.calls.filter(call =>
588
+ call.some(arg => String(arg).includes("[DEPRECATED]"))
589
+ );
590
+ expect(deprecationCalls.length).toBe(0);
591
+ warnSpy.mockRestore();
592
+ });
593
+ });
594
+
554
595
  // ============================================================================
555
596
  // Tests: Edge Cases
556
597
  // ============================================================================
package/src/skills.ts CHANGED
@@ -399,7 +399,7 @@ export function invalidateSkillsCache(): void {
399
399
  * which skills are relevant to the current task.
400
400
  */
401
401
  export const skills_list = tool({
402
- description: `List all available skills in the project.
402
+ description: `[DEPRECATED] List all available skills in the project.
403
403
 
404
404
  Skills are specialized instructions that help with specific domains or tasks.
405
405
  Use this tool to discover what skills are available, then use skills_use to
@@ -413,6 +413,7 @@ Returns skill names, descriptions, and whether they have executable scripts.`,
413
413
  .describe("Optional tag to filter skills by"),
414
414
  },
415
415
  async execute(args) {
416
+ console.warn('[DEPRECATED] skills_list is deprecated. OpenCode now provides native skills support. This tool will be removed in a future version.');
416
417
  const skills = await discoverSkills();
417
418
  let refs = Array.from(skills.values());
418
419
 
@@ -448,7 +449,7 @@ Returns skill names, descriptions, and whether they have executable scripts.`,
448
449
  * The skill's instructions become available for the model to follow.
449
450
  */
450
451
  export const skills_use = tool({
451
- description: `Activate a skill by loading its full instructions.
452
+ description: `[DEPRECATED] Activate a skill by loading its full instructions.
452
453
 
453
454
  After calling this tool, follow the skill's instructions for the current task.
454
455
  Skills provide domain-specific guidance and best practices.
@@ -462,6 +463,7 @@ If the skill has scripts, you can run them with skills_execute.`,
462
463
  .describe("Also list available scripts (default: true)"),
463
464
  },
464
465
  async execute(args) {
466
+ console.warn('[DEPRECATED] skills_use is deprecated. OpenCode now provides native skills support. This tool will be removed in a future version.');
465
467
  const skill = await getSkill(args.name);
466
468
 
467
469
  if (!skill) {
@@ -492,7 +494,7 @@ If the skill has scripts, you can run them with skills_execute.`,
492
494
  * This tool runs them with appropriate context.
493
495
  */
494
496
  export const skills_execute = tool({
495
- description: `Execute a script from a skill's scripts/ directory.
497
+ description: `[DEPRECATED] Execute a script from a skill's scripts/ directory.
496
498
 
497
499
  Some skills include helper scripts for common operations.
498
500
  Use skills_use first to see available scripts, then execute them here.
@@ -507,6 +509,7 @@ Scripts run in the skill's directory with the project directory as an argument.`
507
509
  .describe("Additional arguments to pass to the script"),
508
510
  },
509
511
  async execute(args, ctx) {
512
+ console.warn('[DEPRECATED] skills_execute is deprecated. OpenCode now provides native skills support. This tool will be removed in a future version.');
510
513
  const skill = await getSkill(args.skill);
511
514
 
512
515
  if (!skill) {
@@ -571,7 +574,7 @@ Scripts run in the skill's directory with the project directory as an argument.`
571
574
  * Skills can include additional resources like examples, templates, or reference docs.
572
575
  */
573
576
  export const skills_read = tool({
574
- description: `Read a resource file from a skill's directory.
577
+ description: `[DEPRECATED] Read a resource file from a skill's directory.
575
578
 
576
579
  Skills may include additional files like:
577
580
  - examples.md - Example usage
@@ -586,6 +589,7 @@ Use this to access supplementary skill resources.`,
586
589
  .describe("Relative path to the file within the skill directory"),
587
590
  },
588
591
  async execute(args) {
592
+ console.warn('[DEPRECATED] skills_read is deprecated. OpenCode now provides native skills support. This tool will be removed in a future version.');
589
593
  const skill = await getSkill(args.skill);
590
594
 
591
595
  if (!skill) {