opencode-swarm-plugin 0.12.17 → 0.12.19

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/dist/index.js CHANGED
@@ -21608,7 +21608,7 @@ var BeadTreeSchema = exports_external.object({
21608
21608
  title: exports_external.string().min(1),
21609
21609
  description: exports_external.string().optional().default("")
21610
21610
  }),
21611
- subtasks: exports_external.array(SubtaskSpecSchema).min(1).max(10)
21611
+ subtasks: exports_external.array(SubtaskSpecSchema).min(1)
21612
21612
  });
21613
21613
  var EpicCreateArgsSchema = exports_external.object({
21614
21614
  epic_title: exports_external.string().min(1),
@@ -21617,7 +21617,7 @@ var EpicCreateArgsSchema = exports_external.object({
21617
21617
  title: exports_external.string().min(1),
21618
21618
  priority: exports_external.number().int().min(0).max(3).default(2),
21619
21619
  files: exports_external.array(exports_external.string()).optional().default([])
21620
- })).min(1).max(10)
21620
+ })).min(1)
21621
21621
  });
21622
21622
  var EpicCreateResultSchema = exports_external.object({
21623
21623
  success: exports_external.boolean(),
@@ -21720,13 +21720,13 @@ var SubtaskDependencySchema = exports_external.object({
21720
21720
  var TaskDecompositionSchema = exports_external.object({
21721
21721
  task: exports_external.string(),
21722
21722
  reasoning: exports_external.string().optional(),
21723
- subtasks: exports_external.array(DecomposedSubtaskSchema).min(1).max(10),
21723
+ subtasks: exports_external.array(DecomposedSubtaskSchema).min(1),
21724
21724
  dependencies: exports_external.array(SubtaskDependencySchema).optional().default([]),
21725
21725
  shared_context: exports_external.string().optional()
21726
21726
  });
21727
21727
  var DecomposeArgsSchema = exports_external.object({
21728
21728
  task: exports_external.string().min(1),
21729
- max_subtasks: exports_external.number().int().min(1).max(10).default(5),
21729
+ max_subtasks: exports_external.number().int().min(1).default(5),
21730
21730
  context: exports_external.string().optional()
21731
21731
  });
21732
21732
  var SpawnedAgentSchema = exports_external.object({
@@ -22132,15 +22132,35 @@ var beads_sync = tool({
22132
22132
  }
22133
22133
  }
22134
22134
  };
22135
+ const flushResult = await withTimeout(runBdCommand(["sync", "--flush-only"]), TIMEOUT_MS, "bd sync --flush-only");
22136
+ if (flushResult.exitCode !== 0) {
22137
+ throw new BeadError(`Failed to flush beads: ${flushResult.stderr}`, "bd sync --flush-only", flushResult.exitCode);
22138
+ }
22139
+ const beadsStatusResult = await runGitCommand([
22140
+ "status",
22141
+ "--porcelain",
22142
+ ".beads/"
22143
+ ]);
22144
+ const hasChanges = beadsStatusResult.stdout.trim() !== "";
22145
+ if (hasChanges) {
22146
+ const addResult = await runGitCommand(["add", ".beads/"]);
22147
+ if (addResult.exitCode !== 0) {
22148
+ throw new BeadError(`Failed to stage beads: ${addResult.stderr}`, "git add .beads/", addResult.exitCode);
22149
+ }
22150
+ const commitResult = await withTimeout(runGitCommand(["commit", "-m", "chore: sync beads"]), TIMEOUT_MS, "git commit");
22151
+ if (commitResult.exitCode !== 0 && !commitResult.stdout.includes("nothing to commit")) {
22152
+ throw new BeadError(`Failed to commit beads: ${commitResult.stderr}`, "git commit", commitResult.exitCode);
22153
+ }
22154
+ }
22135
22155
  if (autoPull) {
22136
22156
  const pullResult = await withTimeout(runGitCommand(["pull", "--rebase"]), TIMEOUT_MS, "git pull --rebase");
22137
22157
  if (pullResult.exitCode !== 0) {
22138
22158
  throw new BeadError(`Failed to pull: ${pullResult.stderr}`, "git pull --rebase", pullResult.exitCode);
22139
22159
  }
22140
- }
22141
- const syncResult = await withTimeout(runBdCommand(["sync"]), TIMEOUT_MS, "bd sync");
22142
- if (syncResult.exitCode !== 0) {
22143
- throw new BeadError(`Failed to sync beads: ${syncResult.stderr}`, "bd sync", syncResult.exitCode);
22160
+ const importResult = await withTimeout(runBdCommand(["sync", "--import-only"]), TIMEOUT_MS, "bd sync --import-only");
22161
+ if (importResult.exitCode !== 0) {
22162
+ console.warn(`[beads] Import warning: ${importResult.stderr}`);
22163
+ }
22144
22164
  }
22145
22165
  const pushResult = await withTimeout(runGitCommand(["push"]), TIMEOUT_MS, "git push");
22146
22166
  if (pushResult.exitCode !== 0) {
@@ -24908,10 +24928,10 @@ var swarm_plan_prompt = tool({
24908
24928
  args: {
24909
24929
  task: tool.schema.string().min(1).describe("Task description to decompose"),
24910
24930
  strategy: tool.schema.enum(["file-based", "feature-based", "risk-based", "auto"]).optional().describe("Decomposition strategy (default: auto-detect)"),
24911
- max_subtasks: tool.schema.number().int().min(2).max(10).default(5).describe("Maximum number of subtasks (default: 5)"),
24931
+ max_subtasks: tool.schema.number().int().min(2).default(5).describe("Maximum number of subtasks (default: 5)"),
24912
24932
  context: tool.schema.string().optional().describe("Additional context (codebase info, constraints, etc.)"),
24913
24933
  query_cass: tool.schema.boolean().optional().describe("Query CASS for similar past tasks (default: true)"),
24914
- cass_limit: tool.schema.number().int().min(1).max(10).optional().describe("Max CASS results to include (default: 3)")
24934
+ cass_limit: tool.schema.number().int().min(1).optional().describe("Max CASS results to include (default: 3)")
24915
24935
  },
24916
24936
  async execute(args) {
24917
24937
  let selectedStrategy;
@@ -24981,10 +25001,10 @@ var swarm_decompose = tool({
24981
25001
  description: "Generate decomposition prompt for breaking task into parallelizable subtasks. Optionally queries CASS for similar past tasks.",
24982
25002
  args: {
24983
25003
  task: tool.schema.string().min(1).describe("Task description to decompose"),
24984
- max_subtasks: tool.schema.number().int().min(2).max(10).default(5).describe("Maximum number of subtasks (default: 5)"),
25004
+ max_subtasks: tool.schema.number().int().min(2).default(5).describe("Maximum number of subtasks (default: 5)"),
24985
25005
  context: tool.schema.string().optional().describe("Additional context (codebase info, constraints, etc.)"),
24986
25006
  query_cass: tool.schema.boolean().optional().describe("Query CASS for similar past tasks (default: true)"),
24987
- cass_limit: tool.schema.number().int().min(1).max(10).optional().describe("Max CASS results to include (default: 3)")
25007
+ cass_limit: tool.schema.number().int().min(1).optional().describe("Max CASS results to include (default: 3)")
24988
25008
  },
24989
25009
  async execute(args) {
24990
25010
  let cassContext = "";
package/dist/plugin.js CHANGED
@@ -21608,7 +21608,7 @@ var BeadTreeSchema = exports_external.object({
21608
21608
  title: exports_external.string().min(1),
21609
21609
  description: exports_external.string().optional().default("")
21610
21610
  }),
21611
- subtasks: exports_external.array(SubtaskSpecSchema).min(1).max(10)
21611
+ subtasks: exports_external.array(SubtaskSpecSchema).min(1)
21612
21612
  });
21613
21613
  var EpicCreateArgsSchema = exports_external.object({
21614
21614
  epic_title: exports_external.string().min(1),
@@ -21617,7 +21617,7 @@ var EpicCreateArgsSchema = exports_external.object({
21617
21617
  title: exports_external.string().min(1),
21618
21618
  priority: exports_external.number().int().min(0).max(3).default(2),
21619
21619
  files: exports_external.array(exports_external.string()).optional().default([])
21620
- })).min(1).max(10)
21620
+ })).min(1)
21621
21621
  });
21622
21622
  var EpicCreateResultSchema = exports_external.object({
21623
21623
  success: exports_external.boolean(),
@@ -21720,13 +21720,13 @@ var SubtaskDependencySchema = exports_external.object({
21720
21720
  var TaskDecompositionSchema = exports_external.object({
21721
21721
  task: exports_external.string(),
21722
21722
  reasoning: exports_external.string().optional(),
21723
- subtasks: exports_external.array(DecomposedSubtaskSchema).min(1).max(10),
21723
+ subtasks: exports_external.array(DecomposedSubtaskSchema).min(1),
21724
21724
  dependencies: exports_external.array(SubtaskDependencySchema).optional().default([]),
21725
21725
  shared_context: exports_external.string().optional()
21726
21726
  });
21727
21727
  var DecomposeArgsSchema = exports_external.object({
21728
21728
  task: exports_external.string().min(1),
21729
- max_subtasks: exports_external.number().int().min(1).max(10).default(5),
21729
+ max_subtasks: exports_external.number().int().min(1).default(5),
21730
21730
  context: exports_external.string().optional()
21731
21731
  });
21732
21732
  var SpawnedAgentSchema = exports_external.object({
@@ -22132,15 +22132,35 @@ var beads_sync = tool({
22132
22132
  }
22133
22133
  }
22134
22134
  };
22135
+ const flushResult = await withTimeout(runBdCommand(["sync", "--flush-only"]), TIMEOUT_MS, "bd sync --flush-only");
22136
+ if (flushResult.exitCode !== 0) {
22137
+ throw new BeadError(`Failed to flush beads: ${flushResult.stderr}`, "bd sync --flush-only", flushResult.exitCode);
22138
+ }
22139
+ const beadsStatusResult = await runGitCommand([
22140
+ "status",
22141
+ "--porcelain",
22142
+ ".beads/"
22143
+ ]);
22144
+ const hasChanges = beadsStatusResult.stdout.trim() !== "";
22145
+ if (hasChanges) {
22146
+ const addResult = await runGitCommand(["add", ".beads/"]);
22147
+ if (addResult.exitCode !== 0) {
22148
+ throw new BeadError(`Failed to stage beads: ${addResult.stderr}`, "git add .beads/", addResult.exitCode);
22149
+ }
22150
+ const commitResult = await withTimeout(runGitCommand(["commit", "-m", "chore: sync beads"]), TIMEOUT_MS, "git commit");
22151
+ if (commitResult.exitCode !== 0 && !commitResult.stdout.includes("nothing to commit")) {
22152
+ throw new BeadError(`Failed to commit beads: ${commitResult.stderr}`, "git commit", commitResult.exitCode);
22153
+ }
22154
+ }
22135
22155
  if (autoPull) {
22136
22156
  const pullResult = await withTimeout(runGitCommand(["pull", "--rebase"]), TIMEOUT_MS, "git pull --rebase");
22137
22157
  if (pullResult.exitCode !== 0) {
22138
22158
  throw new BeadError(`Failed to pull: ${pullResult.stderr}`, "git pull --rebase", pullResult.exitCode);
22139
22159
  }
22140
- }
22141
- const syncResult = await withTimeout(runBdCommand(["sync"]), TIMEOUT_MS, "bd sync");
22142
- if (syncResult.exitCode !== 0) {
22143
- throw new BeadError(`Failed to sync beads: ${syncResult.stderr}`, "bd sync", syncResult.exitCode);
22160
+ const importResult = await withTimeout(runBdCommand(["sync", "--import-only"]), TIMEOUT_MS, "bd sync --import-only");
22161
+ if (importResult.exitCode !== 0) {
22162
+ console.warn(`[beads] Import warning: ${importResult.stderr}`);
22163
+ }
22144
22164
  }
22145
22165
  const pushResult = await withTimeout(runGitCommand(["push"]), TIMEOUT_MS, "git push");
22146
22166
  if (pushResult.exitCode !== 0) {
@@ -24847,10 +24867,10 @@ var swarm_plan_prompt = tool({
24847
24867
  args: {
24848
24868
  task: tool.schema.string().min(1).describe("Task description to decompose"),
24849
24869
  strategy: tool.schema.enum(["file-based", "feature-based", "risk-based", "auto"]).optional().describe("Decomposition strategy (default: auto-detect)"),
24850
- max_subtasks: tool.schema.number().int().min(2).max(10).default(5).describe("Maximum number of subtasks (default: 5)"),
24870
+ max_subtasks: tool.schema.number().int().min(2).default(5).describe("Maximum number of subtasks (default: 5)"),
24851
24871
  context: tool.schema.string().optional().describe("Additional context (codebase info, constraints, etc.)"),
24852
24872
  query_cass: tool.schema.boolean().optional().describe("Query CASS for similar past tasks (default: true)"),
24853
- cass_limit: tool.schema.number().int().min(1).max(10).optional().describe("Max CASS results to include (default: 3)")
24873
+ cass_limit: tool.schema.number().int().min(1).optional().describe("Max CASS results to include (default: 3)")
24854
24874
  },
24855
24875
  async execute(args) {
24856
24876
  let selectedStrategy;
@@ -24920,10 +24940,10 @@ var swarm_decompose = tool({
24920
24940
  description: "Generate decomposition prompt for breaking task into parallelizable subtasks. Optionally queries CASS for similar past tasks.",
24921
24941
  args: {
24922
24942
  task: tool.schema.string().min(1).describe("Task description to decompose"),
24923
- max_subtasks: tool.schema.number().int().min(2).max(10).default(5).describe("Maximum number of subtasks (default: 5)"),
24943
+ max_subtasks: tool.schema.number().int().min(2).default(5).describe("Maximum number of subtasks (default: 5)"),
24924
24944
  context: tool.schema.string().optional().describe("Additional context (codebase info, constraints, etc.)"),
24925
24945
  query_cass: tool.schema.boolean().optional().describe("Query CASS for similar past tasks (default: true)"),
24926
- cass_limit: tool.schema.number().int().min(1).max(10).optional().describe("Max CASS results to include (default: 3)")
24946
+ cass_limit: tool.schema.number().int().min(1).optional().describe("Max CASS results to include (default: 3)")
24927
24947
  },
24928
24948
  async execute(args) {
24929
24949
  let cassContext = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm-plugin",
3
- "version": "0.12.17",
3
+ "version": "0.12.19",
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",
package/src/beads.ts CHANGED
@@ -664,7 +664,58 @@ export const beads_sync = tool({
664
664
  }
665
665
  };
666
666
 
667
- // 1. Pull if requested
667
+ // 1. Flush beads to JSONL (doesn't use worktrees)
668
+ const flushResult = await withTimeout(
669
+ runBdCommand(["sync", "--flush-only"]),
670
+ TIMEOUT_MS,
671
+ "bd sync --flush-only",
672
+ );
673
+ if (flushResult.exitCode !== 0) {
674
+ throw new BeadError(
675
+ `Failed to flush beads: ${flushResult.stderr}`,
676
+ "bd sync --flush-only",
677
+ flushResult.exitCode,
678
+ );
679
+ }
680
+
681
+ // 2. Check if there are changes to commit
682
+ const beadsStatusResult = await runGitCommand([
683
+ "status",
684
+ "--porcelain",
685
+ ".beads/",
686
+ ]);
687
+ const hasChanges = beadsStatusResult.stdout.trim() !== "";
688
+
689
+ if (hasChanges) {
690
+ // 3. Stage .beads changes
691
+ const addResult = await runGitCommand(["add", ".beads/"]);
692
+ if (addResult.exitCode !== 0) {
693
+ throw new BeadError(
694
+ `Failed to stage beads: ${addResult.stderr}`,
695
+ "git add .beads/",
696
+ addResult.exitCode,
697
+ );
698
+ }
699
+
700
+ // 4. Commit
701
+ const commitResult = await withTimeout(
702
+ runGitCommand(["commit", "-m", "chore: sync beads"]),
703
+ TIMEOUT_MS,
704
+ "git commit",
705
+ );
706
+ if (
707
+ commitResult.exitCode !== 0 &&
708
+ !commitResult.stdout.includes("nothing to commit")
709
+ ) {
710
+ throw new BeadError(
711
+ `Failed to commit beads: ${commitResult.stderr}`,
712
+ "git commit",
713
+ commitResult.exitCode,
714
+ );
715
+ }
716
+ }
717
+
718
+ // 5. Pull if requested (with rebase to avoid merge commits)
668
719
  if (autoPull) {
669
720
  const pullResult = await withTimeout(
670
721
  runGitCommand(["pull", "--rebase"]),
@@ -678,23 +729,20 @@ export const beads_sync = tool({
678
729
  pullResult.exitCode,
679
730
  );
680
731
  }
681
- }
682
732
 
683
- // 2. Sync beads
684
- const syncResult = await withTimeout(
685
- runBdCommand(["sync"]),
686
- TIMEOUT_MS,
687
- "bd sync",
688
- );
689
- if (syncResult.exitCode !== 0) {
690
- throw new BeadError(
691
- `Failed to sync beads: ${syncResult.stderr}`,
692
- "bd sync",
693
- syncResult.exitCode,
733
+ // 6. Import any changes from remote
734
+ const importResult = await withTimeout(
735
+ runBdCommand(["sync", "--import-only"]),
736
+ TIMEOUT_MS,
737
+ "bd sync --import-only",
694
738
  );
739
+ if (importResult.exitCode !== 0) {
740
+ // Non-fatal - just log warning
741
+ console.warn(`[beads] Import warning: ${importResult.stderr}`);
742
+ }
695
743
  }
696
744
 
697
- // 3. Push
745
+ // 7. Push
698
746
  const pushResult = await withTimeout(
699
747
  runGitCommand(["push"]),
700
748
  TIMEOUT_MS,
@@ -117,7 +117,7 @@ export const BeadTreeSchema = z.object({
117
117
  title: z.string().min(1),
118
118
  description: z.string().optional().default(""),
119
119
  }),
120
- subtasks: z.array(SubtaskSpecSchema).min(1).max(10),
120
+ subtasks: z.array(SubtaskSpecSchema).min(1),
121
121
  });
122
122
  export type BeadTree = z.infer<typeof BeadTreeSchema>;
123
123
 
@@ -133,8 +133,7 @@ export const EpicCreateArgsSchema = z.object({
133
133
  files: z.array(z.string()).optional().default([]),
134
134
  }),
135
135
  )
136
- .min(1)
137
- .max(10),
136
+ .min(1),
138
137
  });
139
138
  export type EpicCreateArgs = z.infer<typeof EpicCreateArgsSchema>;
140
139
 
@@ -57,7 +57,7 @@ export type SubtaskDependency = z.infer<typeof SubtaskDependencySchema>;
57
57
  export const TaskDecompositionSchema = z.object({
58
58
  task: z.string(), // Original task description
59
59
  reasoning: z.string().optional(), // Why this decomposition
60
- subtasks: z.array(DecomposedSubtaskSchema).min(1).max(10),
60
+ subtasks: z.array(DecomposedSubtaskSchema).min(1),
61
61
  dependencies: z.array(SubtaskDependencySchema).optional().default([]),
62
62
  shared_context: z.string().optional(), // Context to pass to all agents
63
63
  });
@@ -68,7 +68,7 @@ export type TaskDecomposition = z.infer<typeof TaskDecompositionSchema>;
68
68
  */
69
69
  export const DecomposeArgsSchema = z.object({
70
70
  task: z.string().min(1),
71
- max_subtasks: z.number().int().min(1).max(10).default(5),
71
+ max_subtasks: z.number().int().min(1).default(5),
72
72
  context: z.string().optional(),
73
73
  });
74
74
  export type DecomposeArgs = z.infer<typeof DecomposeArgsSchema>;
package/src/swarm.ts CHANGED
@@ -1222,7 +1222,7 @@ export const swarm_plan_prompt = tool({
1222
1222
  .number()
1223
1223
  .int()
1224
1224
  .min(2)
1225
- .max(10)
1225
+
1226
1226
  .default(5)
1227
1227
  .describe("Maximum number of subtasks (default: 5)"),
1228
1228
  context: tool.schema
@@ -1237,7 +1237,7 @@ export const swarm_plan_prompt = tool({
1237
1237
  .number()
1238
1238
  .int()
1239
1239
  .min(1)
1240
- .max(10)
1240
+
1241
1241
  .optional()
1242
1242
  .describe("Max CASS results to include (default: 3)"),
1243
1243
  },
@@ -1352,7 +1352,7 @@ export const swarm_decompose = tool({
1352
1352
  .number()
1353
1353
  .int()
1354
1354
  .min(2)
1355
- .max(10)
1355
+
1356
1356
  .default(5)
1357
1357
  .describe("Maximum number of subtasks (default: 5)"),
1358
1358
  context: tool.schema
@@ -1367,7 +1367,7 @@ export const swarm_decompose = tool({
1367
1367
  .number()
1368
1368
  .int()
1369
1369
  .min(1)
1370
- .max(10)
1370
+
1371
1371
  .optional()
1372
1372
  .describe("Max CASS results to include (default: 3)"),
1373
1373
  },