opencode-swarm 6.21.2 → 6.21.3

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/cli/index.js CHANGED
@@ -29784,7 +29784,7 @@ function createSwarmTool(opts) {
29784
29784
  args: opts.args,
29785
29785
  execute: async (args, ctx) => {
29786
29786
  const directory = ctx?.directory ?? process.cwd();
29787
- return opts.execute(args, directory);
29787
+ return opts.execute(args, directory, ctx);
29788
29788
  }
29789
29789
  });
29790
29790
  }
package/dist/index.js CHANGED
@@ -30346,7 +30346,7 @@ function createSwarmTool(opts) {
30346
30346
  args: opts.args,
30347
30347
  execute: async (args2, ctx) => {
30348
30348
  const directory = ctx?.directory ?? process.cwd();
30349
- return opts.execute(args2, directory);
30349
+ return opts.execute(args2, directory, ctx);
30350
30350
  }
30351
30351
  });
30352
30352
  }
@@ -53451,13 +53451,13 @@ var phase_complete = createSwarmTool({
53451
53451
  summary: tool.schema.string().optional().describe("Optional summary of what was accomplished in this phase"),
53452
53452
  sessionID: tool.schema.string().optional().describe("Session ID for tracking state (auto-provided by plugin context)")
53453
53453
  },
53454
- execute: async (args2, directory) => {
53454
+ execute: async (args2, directory, ctx) => {
53455
53455
  let phaseCompleteArgs;
53456
53456
  try {
53457
53457
  phaseCompleteArgs = {
53458
53458
  phase: Number(args2.phase),
53459
53459
  summary: args2.summary !== undefined ? String(args2.summary) : undefined,
53460
- sessionID: args2.sessionID !== undefined ? String(args2.sessionID) : undefined
53460
+ sessionID: ctx?.sessionID ?? (args2.sessionID !== undefined ? String(args2.sessionID) : undefined)
53461
53461
  };
53462
53462
  } catch {
53463
53463
  return JSON.stringify({
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import { type ToolContext, tool } from '@opencode-ai/plugin';
2
2
  /**
3
3
  * Options for creating a swarm tool.
4
4
  * The args type is inferred from what you pass to the tool() call.
@@ -6,10 +6,10 @@ import { tool } from '@opencode-ai/plugin';
6
6
  export interface SwarmToolOptions<Args extends Record<string, unknown>> {
7
7
  description: string;
8
8
  args: Args;
9
- execute: (args: Args, directory: string) => Promise<string>;
9
+ execute: (args: Args, directory: string, ctx?: ToolContext) => Promise<string>;
10
10
  }
11
11
  /**
12
12
  * Creates a swarm tool with automatic working directory injection.
13
- * Wraps the @opencode-ai/plugin/tool factory to always inject `directory` into tool execute callbacks.
13
+ * Wraps the @opencode-ai/plugin/tool factory to always inject `directory` and `ctx` into tool execute callbacks.
14
14
  */
15
15
  export declare function createSwarmTool<Args extends Record<string, unknown>>(opts: SwarmToolOptions<Args>): ReturnType<typeof tool>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.21.2",
3
+ "version": "6.21.3",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",