opencode-swarm 6.25.4 → 6.25.6

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
@@ -35676,6 +35676,28 @@ async function handleStatusCommand(directory, agents) {
35676
35676
  }
35677
35677
  // src/commands/sync-plan.ts
35678
35678
  init_manager2();
35679
+ async function handleSyncPlanCommand(directory, _args) {
35680
+ const plan = await loadPlan(directory);
35681
+ if (!plan) {
35682
+ return `## Plan Sync Report
35683
+
35684
+ No active swarm plan found. Nothing to sync.`;
35685
+ }
35686
+ const currentMarkdown = derivePlanMarkdown(plan);
35687
+ const lines = [
35688
+ "## Plan Sync Report",
35689
+ "",
35690
+ "**Status**: \u2705 Synced",
35691
+ "",
35692
+ "The plan.json and plan.md are now synchronized.",
35693
+ "",
35694
+ "### Current Plan",
35695
+ "",
35696
+ currentMarkdown
35697
+ ];
35698
+ return lines.join(`
35699
+ `);
35700
+ }
35679
35701
 
35680
35702
  // src/tools/write-retro.ts
35681
35703
  init_manager();
@@ -36018,6 +36040,7 @@ Examples:
36018
36040
  bunx opencode-swarm uninstall --clean
36019
36041
  bunx opencode-swarm --help
36020
36042
  bunx opencode-swarm run status
36043
+ bunx opencode-swarm run sync-plan
36021
36044
  bunx opencode-swarm run knowledge migrate
36022
36045
  bunx opencode-swarm run dark-matter
36023
36046
  `);
@@ -36082,6 +36105,11 @@ Run "bunx opencode-swarm --help" for a list of commands.`);
36082
36105
  console.log(result);
36083
36106
  return 0;
36084
36107
  }
36108
+ case "sync-plan": {
36109
+ const result = await handleSyncPlanCommand(cwd, args.slice(1));
36110
+ console.log(result);
36111
+ return 0;
36112
+ }
36085
36113
  case "handoff": {
36086
36114
  const result = await handleHandoffCommand(cwd, args.slice(1));
36087
36115
  console.log(result);
package/dist/index.js CHANGED
@@ -42809,7 +42809,17 @@ function recordPhaseAgentDispatch(sessionId, agentName) {
42809
42809
  const normalizedName = stripKnownSwarmPrefix(agentName);
42810
42810
  session.phaseAgentsDispatched.add(normalizedName);
42811
42811
  }
42812
+ function isValidTaskId(taskId) {
42813
+ if (taskId === null || taskId === undefined) {
42814
+ return false;
42815
+ }
42816
+ const trimmed = taskId.trim();
42817
+ return trimmed.length > 0;
42818
+ }
42812
42819
  function advanceTaskState(session, taskId, newState) {
42820
+ if (!isValidTaskId(taskId)) {
42821
+ return;
42822
+ }
42813
42823
  if (!session || !(session.taskWorkflowStates instanceof Map)) {
42814
42824
  throw new Error("INVALID_SESSION: session.taskWorkflowStates must be a Map instance");
42815
42825
  }
@@ -42833,6 +42843,9 @@ function advanceTaskState(session, taskId, newState) {
42833
42843
  session.taskWorkflowStates.set(taskId, newState);
42834
42844
  }
42835
42845
  function getTaskState(session, taskId) {
42846
+ if (!isValidTaskId(taskId)) {
42847
+ return "idle";
42848
+ }
42836
42849
  if (!session.taskWorkflowStates) {
42837
42850
  session.taskWorkflowStates = new Map;
42838
42851
  }
@@ -61816,6 +61829,7 @@ async function executeUpdateTaskStatus(args2, fallbackDir) {
61816
61829
  advanceTaskState(session, args2.task_id, "coder_delegated");
61817
61830
  } catch {}
61818
61831
  }
61832
+ session.currentTaskId = args2.task_id;
61819
61833
  }
61820
61834
  }
61821
61835
  let normalizedDir;
package/dist/state.d.ts CHANGED
@@ -242,6 +242,7 @@ export declare function recordPhaseAgentDispatch(sessionId: string, agentName: s
242
242
  /**
243
243
  * Advance a task's workflow state. Validates forward-only transitions.
244
244
  * Throws 'INVALID_TASK_STATE_TRANSITION: [taskId] [current] → [requested]' on illegal transition.
245
+ * Safely returns without mutating state when taskId is null, undefined, empty, or whitespace-only.
245
246
  *
246
247
  * Valid forward order: idle → coder_delegated → pre_check_passed → reviewer_run → tests_run → complete
247
248
  *
@@ -253,6 +254,7 @@ export declare function advanceTaskState(session: AgentSessionState, taskId: str
253
254
  /**
254
255
  * Get the current workflow state for a task.
255
256
  * Returns 'idle' if no entry exists.
257
+ * Returns 'idle' for invalid taskId (null, undefined, empty, or whitespace-only).
256
258
  * If taskWorkflowStates is missing/invalid, initializes it as a new Map.
257
259
  *
258
260
  * @param session - The agent session state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.25.4",
3
+ "version": "6.25.6",
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",