opencode-swarm 6.84.3 → 6.84.5

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/index.js CHANGED
@@ -62132,7 +62132,7 @@ __export(exports_doc_scan, {
62132
62132
  });
62133
62133
  import * as crypto7 from "crypto";
62134
62134
  import * as fs45 from "fs";
62135
- import { mkdir as mkdir8, readFile as readFile8, writeFile as writeFile8 } from "fs/promises";
62135
+ import { mkdir as mkdir9, readFile as readFile8, writeFile as writeFile8 } from "fs/promises";
62136
62136
  import * as path59 from "path";
62137
62137
  function normalizeSeparators(filePath) {
62138
62138
  return filePath.replace(/\\/g, "/");
@@ -62304,7 +62304,7 @@ async function scanDocIndex(directory) {
62304
62304
  files: discoveredFiles
62305
62305
  };
62306
62306
  try {
62307
- await mkdir8(path59.dirname(manifestPath), { recursive: true });
62307
+ await mkdir9(path59.dirname(manifestPath), { recursive: true });
62308
62308
  await writeFile8(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
62309
62309
  } catch {}
62310
62310
  return { manifest, cached: false };
@@ -65507,6 +65507,7 @@ async function saveGraph(workspace, graph, options) {
65507
65507
  const graphPath = getGraphPath(workspace);
65508
65508
  updateGraphMetadata(graph);
65509
65509
  const tempPath = `${graphPath}.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`;
65510
+ await fsPromises3.mkdir(path49.dirname(tempPath), { recursive: true });
65510
65511
  let lastError = null;
65511
65512
  try {
65512
65513
  if (options?.createAtomic) {
@@ -65717,16 +65718,21 @@ function buildWorkspaceGraph(workspaceRoot, options) {
65717
65718
  stats.filesScanned++;
65718
65719
  const ext = path49.extname(filePath).toLowerCase();
65719
65720
  let exports = [];
65720
- if ([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"].includes(ext)) {
65721
- const relativePath = path49.relative(absoluteRoot, filePath);
65722
- const symbols2 = extractTSSymbols(relativePath, absoluteRoot);
65723
- exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65724
- } else if (ext === ".py") {
65725
- const relativePath = path49.relative(absoluteRoot, filePath);
65726
- const symbols2 = extractPythonSymbols(relativePath, absoluteRoot);
65727
- exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65721
+ let parsedImports = [];
65722
+ try {
65723
+ if ([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"].includes(ext)) {
65724
+ const relativePath = path49.relative(absoluteRoot, filePath);
65725
+ const symbols2 = extractTSSymbols(relativePath, absoluteRoot);
65726
+ exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65727
+ } else if (ext === ".py") {
65728
+ const relativePath = path49.relative(absoluteRoot, filePath);
65729
+ const symbols2 = extractPythonSymbols(relativePath, absoluteRoot);
65730
+ exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65731
+ }
65732
+ parsedImports = parseFileImports(content);
65733
+ } catch {
65734
+ continue;
65728
65735
  }
65729
- const parsedImports = parseFileImports(content);
65730
65736
  const node = {
65731
65737
  filePath,
65732
65738
  moduleName: toModuleName(filePath, absoluteRoot),
@@ -65778,38 +65784,42 @@ function scanFile(filePath, absoluteRoot, maxFileSize) {
65778
65784
  }
65779
65785
  const ext = path49.extname(filePath).toLowerCase();
65780
65786
  let exports = [];
65781
- if ([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"].includes(ext)) {
65782
- const relativePath = path49.relative(absoluteRoot, filePath);
65783
- const symbols2 = extractTSSymbols(relativePath, absoluteRoot);
65784
- exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65785
- } else if (ext === ".py") {
65786
- const relativePath = path49.relative(absoluteRoot, filePath);
65787
- const symbols2 = extractPythonSymbols(relativePath, absoluteRoot);
65788
- exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65789
- }
65790
- const parsedImports = parseFileImports(content);
65791
- const node = {
65792
- filePath,
65793
- moduleName: toModuleName(filePath, absoluteRoot),
65794
- exports,
65795
- imports: parsedImports.map((p) => p.specifier),
65796
- language: getLanguage(filePath),
65797
- mtime: fileStats.mtime.toISOString()
65798
- };
65799
- const edges = [];
65800
- const sortedImports = [...parsedImports].sort((a, b) => a.specifier.localeCompare(b.specifier));
65801
- for (const parsed of sortedImports) {
65802
- const resolvedTarget = resolveModuleSpecifier(absoluteRoot, filePath, parsed.specifier);
65803
- if (resolvedTarget !== null) {
65804
- edges.push({
65805
- source: filePath,
65806
- target: resolvedTarget,
65807
- importSpecifier: parsed.specifier,
65808
- importType: parsed.importType
65809
- });
65787
+ try {
65788
+ if ([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"].includes(ext)) {
65789
+ const relativePath = path49.relative(absoluteRoot, filePath);
65790
+ const symbols2 = extractTSSymbols(relativePath, absoluteRoot);
65791
+ exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65792
+ } else if (ext === ".py") {
65793
+ const relativePath = path49.relative(absoluteRoot, filePath);
65794
+ const symbols2 = extractPythonSymbols(relativePath, absoluteRoot);
65795
+ exports = symbols2.filter((s) => s.exported).map((s) => s.name);
65810
65796
  }
65797
+ const parsedImports = parseFileImports(content);
65798
+ const node = {
65799
+ filePath,
65800
+ moduleName: toModuleName(filePath, absoluteRoot),
65801
+ exports,
65802
+ imports: parsedImports.map((p) => p.specifier),
65803
+ language: getLanguage(filePath),
65804
+ mtime: fileStats.mtime.toISOString()
65805
+ };
65806
+ const edges = [];
65807
+ const sortedImports = [...parsedImports].sort((a, b) => a.specifier.localeCompare(b.specifier));
65808
+ for (const parsed of sortedImports) {
65809
+ const resolvedTarget = resolveModuleSpecifier(absoluteRoot, filePath, parsed.specifier);
65810
+ if (resolvedTarget !== null) {
65811
+ edges.push({
65812
+ source: filePath,
65813
+ target: resolvedTarget,
65814
+ importSpecifier: parsed.specifier,
65815
+ importType: parsed.importType
65816
+ });
65817
+ }
65818
+ }
65819
+ return { node, edges };
65820
+ } catch {
65821
+ return { node: null, edges: [] };
65811
65822
  }
65812
- return { node, edges };
65813
65823
  }
65814
65824
  async function updateGraphForFiles(workspaceRoot, filePaths, options) {
65815
65825
  if (options?.forceRebuild) {
@@ -65907,7 +65917,7 @@ function createRepoGraphBuilderHook(workspaceRoot, deps) {
65907
65917
  if (message.includes("does not exist")) {
65908
65918
  return;
65909
65919
  }
65910
- console.error(`[repo-graph] Failed to build graph: ${message}`);
65920
+ console.warn(`[repo-graph] Failed to build graph: ${message}`);
65911
65921
  }
65912
65922
  },
65913
65923
  async toolAfter(input, _output) {
@@ -65947,7 +65957,7 @@ function createRepoGraphBuilderHook(workspaceRoot, deps) {
65947
65957
  console.log(`[repo-graph] Incremental update for ${path50.basename(filePath)}`);
65948
65958
  } catch (error93) {
65949
65959
  const message = error93 instanceof Error ? error93.message : String(error93);
65950
- console.error(`[repo-graph] Incremental update failed: ${message}`);
65960
+ console.warn(`[repo-graph] Incremental update failed: ${message}`);
65951
65961
  }
65952
65962
  }
65953
65963
  };
@@ -86802,6 +86812,7 @@ var todo_extract = createSwarmTool({
86802
86812
  init_tool();
86803
86813
  init_loader();
86804
86814
  init_schema();
86815
+ init_qa_gate_profile();
86805
86816
  init_gate_evidence();
86806
86817
  import * as fs83 from "fs";
86807
86818
  import * as path99 from "path";
@@ -87169,6 +87180,20 @@ function checkCouncilGate(workingDirectory, taskId) {
87169
87180
  if (!councilEnabled) {
87170
87181
  return { blocked: false, reason: "" };
87171
87182
  }
87183
+ try {
87184
+ const planPath = path99.join(workingDirectory, ".swarm", "plan.json");
87185
+ const planRaw = fs83.readFileSync(planPath, "utf-8");
87186
+ const planObj = JSON.parse(planRaw);
87187
+ if (planObj.swarm && planObj.title) {
87188
+ const planId = `${planObj.swarm}-${planObj.title}`.replace(/[^a-zA-Z0-9-_]/g, "_");
87189
+ const profile = getProfile(workingDirectory, planId);
87190
+ if (!profile || !profile.gates.council_mode) {
87191
+ return { blocked: false, reason: "" };
87192
+ }
87193
+ }
87194
+ } catch {
87195
+ return { blocked: false, reason: "" };
87196
+ }
87172
87197
  let evidence;
87173
87198
  try {
87174
87199
  evidence = readTaskEvidenceRaw(workingDirectory, taskId);
@@ -88092,9 +88117,9 @@ var OpenCodeSwarm = async (ctx) => {
88092
88117
  swarmState.fullAutoEnabledInConfig = config3.full_auto?.enabled === true;
88093
88118
  swarmState.opencodeClient = ctx.client;
88094
88119
  await loadSnapshot(ctx.directory);
88120
+ initTelemetry(ctx.directory);
88095
88121
  const repoGraphHook = createRepoGraphBuilderHook(ctx.directory);
88096
88122
  repoGraphHook.init().catch(() => {});
88097
- initTelemetry(ctx.directory);
88098
88123
  const agents = getAgentConfigs(config3, ctx.directory);
88099
88124
  const agentDefinitions = createAgents(config3);
88100
88125
  swarmState.curatorInitAgentNames = Object.keys(agents).filter((k) => k === "curator_init" || k.endsWith("_curator_init"));
@@ -88,6 +88,12 @@ export interface CouncilGateResult {
88
88
  * Check the council gate for a completion transition. Pure — reads config and
89
89
  * evidence only, no state mutation. Exported for focused unit testing.
90
90
  *
91
+ * AND semantics (mirrors isCouncilGateActive in state.ts): the gate only
92
+ * activates when BOTH pluginConfig.council.enabled === true AND the QA gate
93
+ * profile for this plan has council_mode === true. When council.enabled is
94
+ * true but council_mode is false (or the profile is absent), the gate is
95
+ * treated as inactive — the operator has disabled it at the profile level.
96
+ *
91
97
  * @param workingDirectory - Validated project root (contains .swarm/evidence/)
92
98
  * @param taskId - Task ID in N.M or N.M.P format
93
99
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.84.3",
3
+ "version": "6.84.5",
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",