opencode-swarm 6.32.2 → 6.32.4

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
@@ -31619,8 +31619,11 @@ async function rewriteKnowledge(filePath, entries) {
31619
31619
  ` : "");
31620
31620
  await writeFile(filePath, content, "utf-8");
31621
31621
  } finally {
31622
- if (release)
31623
- await release();
31622
+ if (release) {
31623
+ try {
31624
+ await release();
31625
+ } catch {}
31626
+ }
31624
31627
  }
31625
31628
  }
31626
31629
  function normalize2(text) {
@@ -33624,6 +33627,7 @@ async function handleExportCommand(directory, _args) {
33624
33627
  }
33625
33628
  // src/commands/handoff.ts
33626
33629
  init_utils2();
33630
+ import crypto3 from "crypto";
33627
33631
  import { renameSync as renameSync5 } from "fs";
33628
33632
 
33629
33633
  // src/services/handoff-service.ts
@@ -34019,7 +34023,7 @@ async function handleHandoffCommand(directory, _args) {
34019
34023
  const handoffData = await getHandoffData(directory);
34020
34024
  const markdown = formatHandoffMarkdown(handoffData);
34021
34025
  const resolvedPath = validateSwarmPath(directory, "handoff.md");
34022
- const tempPath = `${resolvedPath}.tmp.${Date.now()}.${Math.random().toString(36).slice(2)}`;
34026
+ const tempPath = `${resolvedPath}.tmp.${crypto3.randomUUID()}`;
34023
34027
  await Bun.write(tempPath, markdown);
34024
34028
  renameSync5(tempPath, resolvedPath);
34025
34029
  await writeSnapshot(directory, swarmState);
@@ -11,7 +11,7 @@ import type { DelegationEnvelope, EnvelopeValidationResult } from '../types/dele
11
11
  * Returns null if no valid envelope is found.
12
12
  * Never throws - all errors are caught and result in null.
13
13
  */
14
- export declare function parseDelegationEnvelope(content: string): DelegationEnvelope | null;
14
+ export declare function parseDelegationEnvelope(content: string, directory?: string): DelegationEnvelope | null;
15
15
  interface ValidationContext {
16
16
  planTasks: string[];
17
17
  validAgents: string[];
package/dist/index.js CHANGED
@@ -44009,8 +44009,11 @@ async function rewriteKnowledge(filePath, entries) {
44009
44009
  ` : "");
44010
44010
  await writeFile(filePath, content, "utf-8");
44011
44011
  } finally {
44012
- if (release)
44013
- await release();
44012
+ if (release) {
44013
+ try {
44014
+ await release();
44015
+ } catch {}
44016
+ }
44014
44017
  }
44015
44018
  }
44016
44019
  async function appendRejectedLesson(directory, lesson) {
@@ -46467,6 +46470,7 @@ async function handleExportCommand(directory, _args) {
46467
46470
  }
46468
46471
  // src/commands/handoff.ts
46469
46472
  init_utils2();
46473
+ import crypto3 from "crypto";
46470
46474
  import { renameSync as renameSync5 } from "fs";
46471
46475
 
46472
46476
  // src/services/handoff-service.ts
@@ -46869,7 +46873,7 @@ async function handleHandoffCommand(directory, _args) {
46869
46873
  const handoffData = await getHandoffData(directory);
46870
46874
  const markdown = formatHandoffMarkdown(handoffData);
46871
46875
  const resolvedPath = validateSwarmPath(directory, "handoff.md");
46872
- const tempPath = `${resolvedPath}.tmp.${Date.now()}.${Math.random().toString(36).slice(2)}`;
46876
+ const tempPath = `${resolvedPath}.tmp.${crypto3.randomUUID()}`;
46873
46877
  await Bun.write(tempPath, markdown);
46874
46878
  renameSync5(tempPath, resolvedPath);
46875
46879
  await writeSnapshot(directory, swarmState);
@@ -50606,6 +50610,7 @@ function hashArgs(args2) {
50606
50610
  }
50607
50611
 
50608
50612
  // src/hooks/delegation-gate.ts
50613
+ init_utils2();
50609
50614
  function extractTaskLine(text) {
50610
50615
  const match = text.match(/TASK:\s*(.+?)(?:\n|$)/i);
50611
50616
  return match ? match[1].trim() : null;
@@ -57384,10 +57389,11 @@ async function executePhaseComplete(args2, workingDirectory, directory) {
57384
57389
  const phase = Number(args2.phase);
57385
57390
  const summary = args2.summary;
57386
57391
  const sessionID = args2.sessionID;
57387
- if (Number.isNaN(phase) || phase < 1) {
57392
+ if (Number.isNaN(phase) || phase < 1 || !Number.isFinite(phase) || !Number.isInteger(phase)) {
57388
57393
  return JSON.stringify({
57389
57394
  success: false,
57390
57395
  phase,
57396
+ status: "blocked",
57391
57397
  message: "Invalid phase number",
57392
57398
  agentsDispatched: [],
57393
57399
  warnings: ["Phase must be a positive number"]
@@ -57455,7 +57461,7 @@ async function executePhaseComplete(args2, workingDirectory, directory) {
57455
57461
  }
57456
57462
  if (!retroFound) {
57457
57463
  const allTaskIds = await listEvidenceTaskIds(dir);
57458
- const retroTaskIds = allTaskIds.filter((id) => id.startsWith("retro-"));
57464
+ const retroTaskIds = allTaskIds.filter((id) => id.startsWith("retro-") && /^retro-\d+$/.test(id));
57459
57465
  for (const taskId of retroTaskIds) {
57460
57466
  const bundleResult = await loadEvidence(dir, taskId);
57461
57467
  if (bundleResult.status !== "found") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.32.2",
3
+ "version": "6.32.4",
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",