opencode-swarm 6.84.4 → 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.
Files changed (2) hide show
  1. package/dist/index.js +54 -44
  2. package/package.json +1 -1
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
  };
@@ -88107,9 +88117,9 @@ var OpenCodeSwarm = async (ctx) => {
88107
88117
  swarmState.fullAutoEnabledInConfig = config3.full_auto?.enabled === true;
88108
88118
  swarmState.opencodeClient = ctx.client;
88109
88119
  await loadSnapshot(ctx.directory);
88120
+ initTelemetry(ctx.directory);
88110
88121
  const repoGraphHook = createRepoGraphBuilderHook(ctx.directory);
88111
88122
  repoGraphHook.init().catch(() => {});
88112
- initTelemetry(ctx.directory);
88113
88123
  const agents = getAgentConfigs(config3, ctx.directory);
88114
88124
  const agentDefinitions = createAgents(config3);
88115
88125
  swarmState.curatorInitAgentNames = Object.keys(agents).filter((k) => k === "curator_init" || k.endsWith("_curator_init"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.84.4",
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",