opencode-swarm 6.22.5 → 6.22.7

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.
@@ -47,6 +47,7 @@ export declare function createDelegationGateHook(config: PluginConfig): {
47
47
  tool: string;
48
48
  sessionID: string;
49
49
  callID: string;
50
+ args?: Record<string, unknown>;
50
51
  }, output: unknown) => Promise<void>;
51
52
  };
52
53
  export {};
@@ -44,6 +44,7 @@ export declare function createGuardrailsHooks(directoryOrConfig?: string | Guard
44
44
  tool: string;
45
45
  sessionID: string;
46
46
  callID: string;
47
+ args?: Record<string, unknown>;
47
48
  }, output: {
48
49
  title: string;
49
50
  output: string;
package/dist/index.js CHANGED
@@ -47774,7 +47774,7 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
47774
47774
  }
47775
47775
  }
47776
47776
  }
47777
- const inputArgs = getStoredInputArgs(input.callID);
47777
+ const inputArgs = input.args ?? getStoredInputArgs(input.callID);
47778
47778
  const delegation = isAgentDelegation(input.tool, inputArgs);
47779
47779
  if (delegation.isDelegation && (delegation.targetAgent === "reviewer" || delegation.targetAgent === "test_engineer")) {
47780
47780
  let currentPhase = 1;
@@ -48019,10 +48019,10 @@ function createDelegationGateHook(config3) {
48019
48019
  console.log(`[swarm-debug-task] delegation-gate.toolAfter | session=${input.sessionID} callID=${input.callID} tool=${input.tool}`);
48020
48020
  const normalized = input.tool.replace(/^[^:]+[:.]/, "");
48021
48021
  if (normalized === "Task" || normalized === "task") {
48022
+ const directArgs = input.args;
48022
48023
  const storedArgs = getStoredInputArgs(input.callID);
48023
- const argsObj = storedArgs;
48024
- const subagentType = argsObj?.subagent_type;
48025
- console.log(`[swarm-debug-task] delegation-gate.taskDetected | session=${input.sessionID} subagent_type=${subagentType ?? "(none)"} currentStates=[${statesSummary}]`);
48024
+ const subagentType = directArgs?.subagent_type ?? storedArgs?.subagent_type;
48025
+ console.log(`[swarm-debug-task] delegation-gate.taskDetected | session=${input.sessionID} subagent_type=${subagentType ?? "(none)"} source=${directArgs?.subagent_type ? "input.args" : storedArgs?.subagent_type ? "storedArgs" : "none"} currentStates=[${statesSummary}]`);
48026
48026
  let hasReviewer = false;
48027
48027
  let hasTestEngineer = false;
48028
48028
  if (typeof subagentType === "string") {
@@ -48076,7 +48076,7 @@ function createDelegationGateHook(config3) {
48076
48076
  }
48077
48077
  }
48078
48078
  }
48079
- if (argsObj !== undefined) {
48079
+ if (storedArgs !== undefined) {
48080
48080
  deleteStoredInputArgs(input.callID);
48081
48081
  }
48082
48082
  if (!subagentType || !hasReviewer) {
@@ -54296,8 +54296,20 @@ async function executePhaseComplete(args2, workingDirectory) {
54296
54296
  if (phaseCompleteConfig.require_docs && !effectiveRequired.includes("docs")) {
54297
54297
  effectiveRequired.push("docs");
54298
54298
  }
54299
- const agentsMissing = effectiveRequired.filter((req) => !crossSessionResult.agents.has(req));
54299
+ let agentsMissing = effectiveRequired.filter((req) => !crossSessionResult.agents.has(req));
54300
54300
  const warnings = [];
54301
+ if (agentsMissing.length > 0) {
54302
+ try {
54303
+ const planPath = validateSwarmPath(dir, "plan.json");
54304
+ const planRaw = fs25.readFileSync(planPath, "utf-8");
54305
+ const plan = JSON.parse(planRaw);
54306
+ const targetPhase = plan.phases.find((p) => p.id === phase);
54307
+ if (targetPhase && targetPhase.tasks.length > 0 && targetPhase.tasks.every((t) => t.status === "completed")) {
54308
+ warnings.push(`Agent dispatch fallback: all ${targetPhase.tasks.length} tasks in phase ${phase} are completed in plan.json. Clearing missing agents: ${agentsMissing.join(", ")}.`);
54309
+ agentsMissing = [];
54310
+ }
54311
+ } catch {}
54312
+ }
54301
54313
  const VALID_TASK_COMPLEXITY = ["trivial", "simple", "moderate", "complex"];
54302
54314
  const firstEntry = loadedRetroBundle?.entries?.[0];
54303
54315
  if (loadedRetroTaskId?.startsWith("retro-") && loadedRetroBundle?.schema_version === "1.0.0" && firstEntry?.task_complexity && VALID_TASK_COMPLEXITY.includes(firstEntry.task_complexity)) {
@@ -54347,6 +54359,19 @@ async function executePhaseComplete(args2, workingDirectory) {
54347
54359
  contributorSession.lastPhaseCompletePhase = phase;
54348
54360
  }
54349
54361
  }
54362
+ try {
54363
+ const planPath = validateSwarmPath(dir, "plan.json");
54364
+ const planJson = fs25.readFileSync(planPath, "utf-8");
54365
+ const plan = JSON.parse(planJson);
54366
+ const phaseObj = plan.phases.find((p) => p.id === phase);
54367
+ if (phaseObj) {
54368
+ phaseObj.status = "completed";
54369
+ fs25.writeFileSync(planPath, JSON.stringify(plan, null, 2) + `
54370
+ `, "utf-8");
54371
+ }
54372
+ } catch (error93) {
54373
+ warnings.push(`Warning: failed to update plan.json phase status: ${error93 instanceof Error ? error93.message : String(error93)}`);
54374
+ }
54350
54375
  }
54351
54376
  const result = {
54352
54377
  success: success3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.22.5",
3
+ "version": "6.22.7",
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",