opencode-swarm 7.3.0 → 7.3.1

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
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.3.0",
37
+ version: "7.3.1",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
@@ -24,9 +24,11 @@ export declare function createAgentActivityHooks(config: PluginConfig, directory
24
24
  sessionID: string;
25
25
  callID: string;
26
26
  }, output: {
27
- title: string;
28
- output: string;
29
- metadata: unknown;
27
+ title?: string;
28
+ output?: unknown;
29
+ metadata?: unknown;
30
+ error?: unknown;
31
+ success?: boolean;
30
32
  }) => Promise<void>;
31
33
  };
32
34
  /**
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var package_default;
33
33
  var init_package = __esm(() => {
34
34
  package_default = {
35
35
  name: "opencode-swarm",
36
- version: "7.3.0",
36
+ version: "7.3.1",
37
37
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
38
38
  main: "dist/index.js",
39
39
  types: "dist/index.d.ts",
@@ -25579,7 +25579,7 @@ function createDelegationGateHook(config2, directory) {
25579
25579
  });
25580
25580
  if (councilActive && result.overallVerdict === "APPROVE" && result.allCriteriaMet === true && (result.requiredFixesCount ?? 0) === 0) {
25581
25581
  try {
25582
- await advanceTaskStateAndPersist(session, taskId, "complete", directory, config2.council);
25582
+ await advanceTaskStateAndPersist(session, taskId, "complete", directory, { telemetrySessionId: input.sessionID }, config2.council);
25583
25583
  } catch (err2) {
25584
25584
  warn(`[delegation-gate] toolAfter submit_council_verdicts: could not advance ${taskId} → complete: ${err2 instanceof Error ? err2.message : String(err2)}`);
25585
25585
  }
@@ -25620,9 +25620,13 @@ function createDelegationGateHook(config2, directory) {
25620
25620
  if (hasBothStageBCompletions(session, taskId)) {
25621
25621
  try {
25622
25622
  if (eligibleState === "coder_delegated" || eligibleState === "pre_check_passed") {
25623
- advanceTaskState(session, taskId, "reviewer_run");
25623
+ advanceTaskState(session, taskId, "reviewer_run", {
25624
+ telemetrySessionId: input.sessionID
25625
+ });
25624
25626
  }
25625
- advanceTaskState(session, taskId, "tests_run");
25627
+ advanceTaskState(session, taskId, "tests_run", {
25628
+ telemetrySessionId: input.sessionID
25629
+ });
25626
25630
  } catch (err2) {
25627
25631
  warn(`[delegation-gate] toolAfter stage-b-parallel: could not advance ${taskId} (${eligibleState}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25628
25632
  }
@@ -25647,9 +25651,11 @@ function createDelegationGateHook(config2, directory) {
25647
25651
  if (hasBothStageBCompletions(otherSession, seedTaskId)) {
25648
25652
  try {
25649
25653
  if (seedEligibleState === "coder_delegated" || seedEligibleState === "pre_check_passed") {
25650
- advanceTaskState(otherSession, seedTaskId, "reviewer_run");
25654
+ advanceTaskState(otherSession, seedTaskId, "reviewer_run", { emitTelemetry: false });
25651
25655
  }
25652
- advanceTaskState(otherSession, seedTaskId, "tests_run");
25656
+ advanceTaskState(otherSession, seedTaskId, "tests_run", {
25657
+ emitTelemetry: false
25658
+ });
25653
25659
  } catch (err2) {
25654
25660
  warn(`[delegation-gate] toolAfter cross-session stage-b-parallel: could not advance ${seedTaskId} (${seedEligibleState}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25655
25661
  }
@@ -25662,7 +25668,9 @@ function createDelegationGateHook(config2, directory) {
25662
25668
  for (const [taskId, state] of session.taskWorkflowStates) {
25663
25669
  if (state === "coder_delegated" || state === "pre_check_passed") {
25664
25670
  try {
25665
- advanceTaskState(session, taskId, "reviewer_run");
25671
+ advanceTaskState(session, taskId, "reviewer_run", {
25672
+ telemetrySessionId: input.sessionID
25673
+ });
25666
25674
  } catch (err2) {
25667
25675
  warn(`[delegation-gate] toolAfter: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25668
25676
  }
@@ -25673,7 +25681,9 @@ function createDelegationGateHook(config2, directory) {
25673
25681
  for (const [taskId, state] of session.taskWorkflowStates) {
25674
25682
  if (state === "reviewer_run") {
25675
25683
  try {
25676
- advanceTaskState(session, taskId, "tests_run");
25684
+ advanceTaskState(session, taskId, "tests_run", {
25685
+ telemetrySessionId: input.sessionID
25686
+ });
25677
25687
  } catch (err2) {
25678
25688
  warn(`[delegation-gate] toolAfter: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25679
25689
  }
@@ -25697,7 +25707,9 @@ function createDelegationGateHook(config2, directory) {
25697
25707
  ] of otherSession.taskWorkflowStates) {
25698
25708
  if (state === "coder_delegated" || state === "pre_check_passed") {
25699
25709
  try {
25700
- advanceTaskState(otherSession, taskId, "reviewer_run");
25710
+ advanceTaskState(otherSession, taskId, "reviewer_run", {
25711
+ emitTelemetry: false
25712
+ });
25701
25713
  } catch (err2) {
25702
25714
  warn(`[delegation-gate] toolAfter cross-session: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25703
25715
  }
@@ -25715,7 +25727,9 @@ function createDelegationGateHook(config2, directory) {
25715
25727
  ] of otherSession.taskWorkflowStates) {
25716
25728
  if (state === "reviewer_run") {
25717
25729
  try {
25718
- advanceTaskState(otherSession, taskId, "tests_run");
25730
+ advanceTaskState(otherSession, taskId, "tests_run", {
25731
+ emitTelemetry: false
25732
+ });
25719
25733
  } catch (err2) {
25720
25734
  warn(`[delegation-gate] toolAfter cross-session: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25721
25735
  }
@@ -25818,7 +25832,9 @@ function createDelegationGateHook(config2, directory) {
25818
25832
  for (const [taskId, state] of otherSession.taskWorkflowStates) {
25819
25833
  if (state === "coder_delegated" || state === "pre_check_passed") {
25820
25834
  try {
25821
- advanceTaskState(otherSession, taskId, "reviewer_run");
25835
+ advanceTaskState(otherSession, taskId, "reviewer_run", {
25836
+ emitTelemetry: false
25837
+ });
25822
25838
  } catch (err2) {
25823
25839
  warn(`[delegation-gate] fallback cross-session: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25824
25840
  }
@@ -25839,7 +25855,9 @@ function createDelegationGateHook(config2, directory) {
25839
25855
  for (const [taskId, state] of otherSession.taskWorkflowStates) {
25840
25856
  if (state === "reviewer_run") {
25841
25857
  try {
25842
- advanceTaskState(otherSession, taskId, "tests_run");
25858
+ advanceTaskState(otherSession, taskId, "tests_run", {
25859
+ emitTelemetry: false
25860
+ });
25843
25861
  } catch (err2) {
25844
25862
  warn(`[delegation-gate] fallback cross-session: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25845
25863
  }
@@ -25966,7 +25984,7 @@ ${trimComment}${after}`;
25966
25984
  pendingCoderScopeByTaskId.delete(currentTaskId);
25967
25985
  }
25968
25986
  try {
25969
- await advanceTaskStateAndPersist(session, currentTaskId, "coder_delegated", directory);
25987
+ await advanceTaskStateAndPersist(session, currentTaskId, "coder_delegated", directory, { telemetrySessionId: sessionID });
25970
25988
  } catch (err2) {
25971
25989
  warn(`[delegation-gate] state machine warn: ${err2 instanceof Error ? err2.message : String(err2)}`);
25972
25990
  }
@@ -26492,7 +26510,7 @@ function isValidTaskId2(taskId) {
26492
26510
  const trimmed = taskId.trim();
26493
26511
  return trimmed.length > 0;
26494
26512
  }
26495
- function advanceTaskState(session, taskId, newState, councilConfig) {
26513
+ function advanceTaskState(session, taskId, newState, options, councilConfig) {
26496
26514
  if (!isValidTaskId2(taskId)) {
26497
26515
  return;
26498
26516
  }
@@ -26523,10 +26541,12 @@ function advanceTaskState(session, taskId, newState, councilConfig) {
26523
26541
  }
26524
26542
  }
26525
26543
  session.taskWorkflowStates.set(taskId, newState);
26526
- telemetry.taskStateChanged(session.agentName, taskId, newState, current);
26544
+ if (options?.emitTelemetry !== false) {
26545
+ telemetry.taskStateChanged(options?.telemetrySessionId ?? session.agentName, taskId, newState, current);
26546
+ }
26527
26547
  }
26528
- async function advanceTaskStateAndPersist(session, taskId, newState, directory, councilConfig) {
26529
- advanceTaskState(session, taskId, newState, councilConfig);
26548
+ async function advanceTaskStateAndPersist(session, taskId, newState, directory, options, councilConfig) {
26549
+ advanceTaskState(session, taskId, newState, options, councilConfig);
26530
26550
  if (newState !== "coder_delegated" && newState !== "complete") {
26531
26551
  return;
26532
26552
  }
@@ -65364,8 +65384,9 @@ function createAgentActivityHooks(config3, directory) {
65364
65384
  return;
65365
65385
  swarmState.activeToolCalls.delete(input.callID);
65366
65386
  const duration5 = Date.now() - entry.startTime;
65367
- const rawOutput = output.output;
65368
- const success3 = rawOutput !== null && rawOutput !== undefined;
65387
+ const explicitSuccess = typeof output.success === "boolean" ? output.success : undefined;
65388
+ const explicitFailure = explicitSuccess === false || !!output.error;
65389
+ const success3 = explicitFailure ? false : true;
65369
65390
  const key = entry.tool;
65370
65391
  const existing = swarmState.toolAggregates.get(key) ?? {
65371
65392
  tool: key,
package/dist/state.d.ts CHANGED
@@ -368,7 +368,10 @@ export declare function recordPhaseAgentDispatch(sessionId: string, agentName: s
368
368
  * @param taskId - The task identifier
369
369
  * @param newState - The requested new state
370
370
  */
371
- export declare function advanceTaskState(session: AgentSessionState, taskId: string, newState: TaskWorkflowState, councilConfig?: {
371
+ export declare function advanceTaskState(session: AgentSessionState, taskId: string, newState: TaskWorkflowState, options?: {
372
+ telemetrySessionId?: string;
373
+ emitTelemetry?: boolean;
374
+ }, councilConfig?: {
372
375
  minimumMembers?: number;
373
376
  requireAllMembers?: boolean;
374
377
  }): void;
@@ -389,7 +392,10 @@ export declare function advanceTaskState(session: AgentSessionState, taskId: str
389
392
  * not break the in-memory state machine — matches the existing defensive
390
393
  * pattern around advanceTaskState call sites.
391
394
  */
392
- export declare function advanceTaskStateAndPersist(session: AgentSessionState, taskId: string, newState: TaskWorkflowState, directory: string, councilConfig?: {
395
+ export declare function advanceTaskStateAndPersist(session: AgentSessionState, taskId: string, newState: TaskWorkflowState, directory: string, options?: {
396
+ telemetrySessionId?: string;
397
+ emitTelemetry?: boolean;
398
+ }, councilConfig?: {
393
399
  minimumMembers?: number;
394
400
  requireAllMembers?: boolean;
395
401
  }): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
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",