opencode-swarm 7.100.0 → 7.100.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.
@@ -6,7 +6,7 @@ import {
6
6
  loadPlanJsonOnly,
7
7
  mergeDurableGateEntriesFromEvidence,
8
8
  readDurableGateEvidence
9
- } from "./index-y3x3gvy6.js";
9
+ } from "./index-3emh7rny.js";
10
10
  import"./index-r8f89sm9.js";
11
11
  import"./index-9b7qp18e.js";
12
12
  import"./index-7ztmmqpt.js";
@@ -1,15 +1,15 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-tj0jek4p.js";
5
- import"./index-q5cae5d7.js";
4
+ } from "./index-4xqnktvr.js";
5
+ import"./index-qvdxzjqt.js";
6
6
  import"./index-pj3a5fbt.js";
7
7
  import"./index-ydgy7vg5.js";
8
8
  import"./index-vwyjkzgs.js";
9
9
  import"./index-f7nma02k.js";
10
10
  import"./index-rpb763g8.js";
11
11
  import"./index-m0qshbr6.js";
12
- import"./index-y3x3gvy6.js";
12
+ import"./index-3emh7rny.js";
13
13
  import"./index-adz3nk9b.js";
14
14
  import"./index-v4fcn4tr.js";
15
15
  import"./index-r8f89sm9.js";
@@ -458,6 +458,7 @@ async function resetToRemoteBranch(cwd, options) {
458
458
  };
459
459
  }
460
460
  }
461
+ var GITIGNORED_BUILD_ARTIFACTS = ["dist"];
461
462
  async function resetToMainAfterMerge(cwd, options) {
462
463
  const warnings = [];
463
464
  try {
@@ -595,9 +596,9 @@ async function resetToMainAfterMerge(cwd, options) {
595
596
  changesDiscarded = discardSucceeded;
596
597
  }
597
598
  try {
598
- _internals.gitExec(["clean", "-fdX"], cwd);
599
+ _internals.gitExec(["clean", "-fdX", "--", ...GITIGNORED_BUILD_ARTIFACTS], cwd);
599
600
  } catch {
600
- warnings.push("Could not clean untracked files");
601
+ warnings.push("Could not clean build artifacts");
601
602
  }
602
603
  let branchDeleted = false;
603
604
  if (switchedBranch && previousBranch !== defaultBranch) {
@@ -12,7 +12,7 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-q5cae5d7.js";
15
+ } from "./index-qvdxzjqt.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-tj0jek4p.js";
4
+ } from "./index-4xqnktvr.js";
5
5
  import {
6
6
  handleGuardrailLog
7
7
  } from "./index-5bstvpct.js";
@@ -79,7 +79,7 @@ import {
79
79
  handleWriteRetroCommand,
80
80
  normalizeSwarmCommandInput,
81
81
  resolveCommand
82
- } from "./index-q5cae5d7.js";
82
+ } from "./index-qvdxzjqt.js";
83
83
  import"./index-pj3a5fbt.js";
84
84
  import"./index-ydgy7vg5.js";
85
85
  import"./index-vwyjkzgs.js";
@@ -90,7 +90,7 @@ import {
90
90
  ORCHESTRATOR_NAME,
91
91
  stripKnownSwarmPrefix
92
92
  } from "./index-m0qshbr6.js";
93
- import"./index-y3x3gvy6.js";
93
+ import"./index-3emh7rny.js";
94
94
  import"./index-adz3nk9b.js";
95
95
  import"./index-v4fcn4tr.js";
96
96
  import"./index-r8f89sm9.js";
@@ -114,7 +114,7 @@ import {
114
114
  transientBackoff,
115
115
  validateProjectRoot,
116
116
  writeProjectedSpecSync
117
- } from "./index-y3x3gvy6.js";
117
+ } from "./index-3emh7rny.js";
118
118
  import {
119
119
  _internals as _internals2,
120
120
  _internals1 as _internals3,
@@ -909,7 +909,7 @@ var init_executor = __esm(() => {
909
909
  // package.json
910
910
  var package_default = {
911
911
  name: "opencode-swarm",
912
- version: "7.100.0",
912
+ version: "7.100.1",
913
913
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
914
914
  main: "dist/index.js",
915
915
  types: "dist/index.d.ts",
@@ -13089,6 +13089,7 @@ var ACTIVE_STATE_TO_CLEAN = [
13089
13089
  "swarm.db-shm",
13090
13090
  "swarm.db-wal"
13091
13091
  ];
13092
+ var TERMINAL_STATE_FILES = ["plan.json", "plan-ledger.jsonl"];
13092
13093
  var KNOWLEDGE_FAMILY_ARTIFACTS = new Set([
13093
13094
  "knowledge.jsonl",
13094
13095
  "knowledge-rejected.jsonl"
@@ -13579,6 +13580,10 @@ async function runCleanStage(ctx) {
13579
13580
  }
13580
13581
  if (!ctx.archivedActiveStateFiles.has(artifact)) {
13581
13582
  const reason = ctx.archiveFailureReasons?.get(artifact);
13583
+ if (TERMINAL_STATE_FILES.includes(artifact)) {
13584
+ ctx.warnings.push(reason ? `${artifact} was not archived (${reason}); removing it anyway to prevent CLOSED-plan resurrection next session \u2014 no archive copy retained.` : `${artifact} was not archived; removing it anyway to prevent CLOSED-plan resurrection next session \u2014 no archive copy retained.`);
13585
+ continue;
13586
+ }
13582
13587
  ctx.warnings.push(reason ? `Preserved ${artifact} because it was not successfully archived: ${reason}.` : `Preserved ${artifact} because it was not successfully archived.`);
13583
13588
  continue;
13584
13589
  }
@@ -13686,6 +13691,20 @@ async function runCleanStage(ctx) {
13686
13691
  if (tmpFilesRemoved > 0) {
13687
13692
  cleanedFiles.push(`${tmpFilesRemoved} .tmp.* file(s)`);
13688
13693
  }
13694
+ for (const terminalFile of TERMINAL_STATE_FILES) {
13695
+ try {
13696
+ await fs13.unlink(path26.join(ctx.swarmDir, terminalFile));
13697
+ if (!cleanedFiles.includes(terminalFile)) {
13698
+ cleanedFiles.push(terminalFile);
13699
+ }
13700
+ } catch (err) {
13701
+ const errno = err?.code;
13702
+ if (errno === "ENOENT") {} else {
13703
+ const reason = err instanceof Error ? err.message : String(err);
13704
+ ctx.warnings.push(`Failed to remove terminal-state file ${terminalFile} [${errno ?? "unknown"}]: ${reason}`);
13705
+ }
13706
+ }
13707
+ }
13689
13708
  clearAllScopes(ctx.directory);
13690
13709
  const contextPath = path26.join(ctx.swarmDir, "context.md");
13691
13710
  const contextContent = [
@@ -16153,6 +16172,15 @@ async function checkKnowledgeHealth(directory) {
16153
16172
  // src/services/diagnose-service.ts
16154
16173
  var { version: version2 } = package_default;
16155
16174
  var sandboxCapabilityProbe = new SandboxCapabilityProbe;
16175
+ var REQUIRED_CACHE_GRAMMAR_ASSETS = [
16176
+ "tree-sitter.wasm",
16177
+ "tree-sitter-javascript.wasm",
16178
+ "tree-sitter-typescript.wasm"
16179
+ ];
16180
+ function resolveCachePackageRoot(cachePath) {
16181
+ const nestedPackageRoot = path33.join(cachePath, "node_modules", "opencode-swarm");
16182
+ return existsSync18(nestedPackageRoot) ? nestedPackageRoot : cachePath;
16183
+ }
16156
16184
  var _internals24 = {
16157
16185
  detectSandboxCapability: () => sandboxCapabilityProbe.detect(),
16158
16186
  getSandboxExecutor: getExecutor
@@ -16933,14 +16961,21 @@ async function getDiagnoseData(directory) {
16933
16961
  cacheRows.push(`\u2B1C ${cachePath} \u2014 absent`);
16934
16962
  continue;
16935
16963
  }
16936
- const pkgJsonPath = path33.join(cachePath, "package.json");
16964
+ const packageRoot = resolveCachePackageRoot(cachePath);
16965
+ const cacheLabel = packageRoot === cachePath ? cachePath : `${cachePath} -> ${packageRoot}`;
16966
+ const missingGrammarAssets = REQUIRED_CACHE_GRAMMAR_ASSETS.filter((file) => !existsSync18(path33.join(packageRoot, "dist", "lang", "grammars", file)));
16967
+ const pkgJsonPath = path33.join(packageRoot, "package.json");
16937
16968
  try {
16938
16969
  const raw = readFileSync10(pkgJsonPath, "utf-8");
16939
16970
  const parsed = JSON.parse(raw);
16940
16971
  const installedVersion = typeof parsed.version === "string" ? parsed.version : "?";
16941
- cacheRows.push(`\u2705 ${cachePath} \u2014 v${installedVersion}`);
16972
+ if (missingGrammarAssets.length > 0) {
16973
+ cacheRows.push(`\u26A0\uFE0F ${cacheLabel} \u2014 v${installedVersion}, missing grammar assets: ${missingGrammarAssets.join(", ")}; run \`bunx opencode-swarm update\` and restart OpenCode`);
16974
+ continue;
16975
+ }
16976
+ cacheRows.push(`\u2705 ${cacheLabel} \u2014 v${installedVersion}`);
16942
16977
  } catch {
16943
- cacheRows.push(`\u26A0\uFE0F ${cachePath} \u2014 present (package.json unreadable)`);
16978
+ cacheRows.push(`\u26A0\uFE0F ${cacheLabel} \u2014 present (package.json unreadable)`);
16944
16979
  }
16945
16980
  } catch {
16946
16981
  cacheRows.push(`\u26A0\uFE0F ${cachePath} \u2014 status unknown (read error)`);
@@ -17967,7 +18002,7 @@ async function handleEvidenceCommand(directory, args) {
17967
18002
  return formatTaskEvidenceMarkdown(evidenceData);
17968
18003
  }
17969
18004
  async function handleEvidenceSummaryCommand(directory) {
17970
- const { buildEvidenceSummary } = await import("./evidence-summary-service-ch74hb16.js");
18005
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-vgw9vw3n.js");
17971
18006
  const artifact = await buildEvidenceSummary(directory);
17972
18007
  if (!artifact) {
17973
18008
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -33038,7 +33073,7 @@ function buildDetailedHelp(commandName, entry) {
33038
33073
  async function handleHelpCommand(ctx) {
33039
33074
  const targetCommand = ctx.args.join(" ");
33040
33075
  if (!targetCommand) {
33041
- const { buildHelpText } = await import("./index-jg6m72g7.js");
33076
+ const { buildHelpText } = await import("./index-bcr2a549.js");
33042
33077
  return buildHelpText();
33043
33078
  }
33044
33079
  const tokens = targetCommand.split(/\s+/);
@@ -33047,7 +33082,7 @@ async function handleHelpCommand(ctx) {
33047
33082
  return _internals47.buildDetailedHelp(resolved.key, resolved.entry);
33048
33083
  }
33049
33084
  const similar = _internals47.findSimilarCommands(targetCommand);
33050
- const { buildHelpText: fullHelp } = await import("./index-jg6m72g7.js");
33085
+ const { buildHelpText: fullHelp } = await import("./index-bcr2a549.js");
33051
33086
  if (similar.length > 0) {
33052
33087
  return `Command '/swarm ${targetCommand}' not found.
33053
33088
 
@@ -33180,7 +33215,7 @@ var COMMAND_REGISTRY = {
33180
33215
  },
33181
33216
  "guardrail explain": {
33182
33217
  handler: async (ctx) => {
33183
- const { handleGuardrailExplain } = await import("./guardrail-explain-q8pj9691.js");
33218
+ const { handleGuardrailExplain } = await import("./guardrail-explain-z37rtfz4.js");
33184
33219
  return handleGuardrailExplain(ctx.directory, ctx.args);
33185
33220
  },
33186
33221
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
package/dist/cli/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-q5cae5d7.js";
10
+ } from "./index-qvdxzjqt.js";
11
11
  import"./index-pj3a5fbt.js";
12
12
  import"./index-ydgy7vg5.js";
13
13
  import"./index-vwyjkzgs.js";
@@ -16,7 +16,7 @@ import"./index-rpb763g8.js";
16
16
  import {
17
17
  DEFAULT_AGENT_CONFIGS
18
18
  } from "./index-m0qshbr6.js";
19
- import"./index-y3x3gvy6.js";
19
+ import"./index-3emh7rny.js";
20
20
  import"./index-adz3nk9b.js";
21
21
  import"./index-v4fcn4tr.js";
22
22
  import"./index-r8f89sm9.js";
@@ -119,6 +119,22 @@ export interface ResetToMainAfterMergeResult {
119
119
  changesDiscarded: boolean;
120
120
  warnings: string[];
121
121
  }
122
+ /**
123
+ * Gitignored build-artifact paths the post-merge alignment (`/swarm finalize`) is
124
+ * allowed to delete. Scoped to an explicit allowlist on purpose: `git clean -fdX`
125
+ * removes EVERY gitignored path under cwd — which in this repo also includes
126
+ * `.swarm/` (the cumulative runtime knowledge store), the gitignored
127
+ * `.claude/issue-traces/` directory (investigation traces), the gitignored files
128
+ * inside `.opencode/` (its `node_modules/`, `package.json`, lockfiles — via a
129
+ * nested `.opencode/.gitignore`), and root `node_modules/` (dependencies). A
130
+ * blanket `git clean -fdX` therefore silently destroyed `.swarm/knowledge.jsonl` —
131
+ * the exact file the finalize clean stage (`runCleanStage`) deliberately preserves.
132
+ * Restricting removal to this allowlist clears stale build output across the
133
+ * reset while leaving runtime/durable state and dependencies untouched.
134
+ * `dist/` is the repo's only committed build output (see the `clean`/`build`
135
+ * scripts in package.json); extend this list only with regenerable build output.
136
+ */
137
+ export declare const GITIGNORED_BUILD_ARTIFACTS: readonly string[];
122
138
  /**
123
139
  * Aggressive git reset for post-merge cleanup.
124
140
  * Handles the common scenario: feature branch PR merged, local has uncommitted artifacts.
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ var package_default;
69
69
  var init_package = __esm(() => {
70
70
  package_default = {
71
71
  name: "opencode-swarm",
72
- version: "7.100.0",
72
+ version: "7.100.1",
73
73
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
74
74
  main: "dist/index.js",
75
75
  types: "dist/index.d.ts",
@@ -18821,9 +18821,9 @@ async function resetToMainAfterMerge(cwd, options) {
18821
18821
  changesDiscarded = discardSucceeded;
18822
18822
  }
18823
18823
  try {
18824
- _internals4.gitExec(["clean", "-fdX"], cwd);
18824
+ _internals4.gitExec(["clean", "-fdX", "--", ...GITIGNORED_BUILD_ARTIFACTS], cwd);
18825
18825
  } catch {
18826
- warnings.push("Could not clean untracked files");
18826
+ warnings.push("Could not clean build artifacts");
18827
18827
  }
18828
18828
  let branchDeleted = false;
18829
18829
  if (switchedBranch && previousBranch !== defaultBranch) {
@@ -18882,11 +18882,12 @@ async function resetToMainAfterMerge(cwd, options) {
18882
18882
  };
18883
18883
  }
18884
18884
  }
18885
- var GIT_TIMEOUT_MS = 30000, GIT_MAX_BUFFER_BYTES, _internals4;
18885
+ var GIT_TIMEOUT_MS = 30000, GIT_MAX_BUFFER_BYTES, GITIGNORED_BUILD_ARTIFACTS, _internals4;
18886
18886
  var init_branch = __esm(() => {
18887
18887
  init_git_binary_missing_error();
18888
18888
  init_logger();
18889
18889
  GIT_MAX_BUFFER_BYTES = 5 * 1024 * 1024;
18890
+ GITIGNORED_BUILD_ARTIFACTS = ["dist"];
18890
18891
  _internals4 = {
18891
18892
  gitExec,
18892
18893
  detectDefaultRemoteBranch,
@@ -74149,6 +74150,10 @@ async function runCleanStage(ctx) {
74149
74150
  }
74150
74151
  if (!ctx.archivedActiveStateFiles.has(artifact)) {
74151
74152
  const reason = ctx.archiveFailureReasons?.get(artifact);
74153
+ if (TERMINAL_STATE_FILES.includes(artifact)) {
74154
+ ctx.warnings.push(reason ? `${artifact} was not archived (${reason}); removing it anyway to prevent CLOSED-plan resurrection next session — no archive copy retained.` : `${artifact} was not archived; removing it anyway to prevent CLOSED-plan resurrection next session — no archive copy retained.`);
74155
+ continue;
74156
+ }
74152
74157
  ctx.warnings.push(reason ? `Preserved ${artifact} because it was not successfully archived: ${reason}.` : `Preserved ${artifact} because it was not successfully archived.`);
74153
74158
  continue;
74154
74159
  }
@@ -74256,6 +74261,20 @@ async function runCleanStage(ctx) {
74256
74261
  if (tmpFilesRemoved > 0) {
74257
74262
  cleanedFiles.push(`${tmpFilesRemoved} .tmp.* file(s)`);
74258
74263
  }
74264
+ for (const terminalFile of TERMINAL_STATE_FILES) {
74265
+ try {
74266
+ await fs30.unlink(path61.join(ctx.swarmDir, terminalFile));
74267
+ if (!cleanedFiles.includes(terminalFile)) {
74268
+ cleanedFiles.push(terminalFile);
74269
+ }
74270
+ } catch (err) {
74271
+ const errno = err?.code;
74272
+ if (errno === "ENOENT") {} else {
74273
+ const reason = err instanceof Error ? err.message : String(err);
74274
+ ctx.warnings.push(`Failed to remove terminal-state file ${terminalFile} [${errno ?? "unknown"}]: ${reason}`);
74275
+ }
74276
+ }
74277
+ }
74259
74278
  clearAllScopes(ctx.directory);
74260
74279
  const contextPath = path61.join(ctx.swarmDir, "context.md");
74261
74280
  const contextContent = [
@@ -74588,7 +74607,7 @@ async function acquireFinalizeLock(directory) {
74588
74607
  }
74589
74608
  return { acquired: false };
74590
74609
  }
74591
- var CLOSE_SKILL_REVIEW_TIMEOUT_MS = 120000, CLOSE_REFLECTION_TIMEOUT_MS = 90000, ARCHIVE_ARTIFACTS, ACTIVE_STATE_TO_CLEAN, KNOWLEDGE_FAMILY_ARTIFACTS, ACTIVE_STATE_DIRS_TO_CLEAN, _internals38;
74610
+ var CLOSE_SKILL_REVIEW_TIMEOUT_MS = 120000, CLOSE_REFLECTION_TIMEOUT_MS = 90000, ARCHIVE_ARTIFACTS, ACTIVE_STATE_TO_CLEAN, TERMINAL_STATE_FILES, KNOWLEDGE_FAMILY_ARTIFACTS, ACTIVE_STATE_DIRS_TO_CLEAN, _internals38;
74592
74611
  var init_close = __esm(() => {
74593
74612
  init_config();
74594
74613
  init_schema();
@@ -74652,6 +74671,7 @@ var init_close = __esm(() => {
74652
74671
  "swarm.db-shm",
74653
74672
  "swarm.db-wal"
74654
74673
  ];
74674
+ TERMINAL_STATE_FILES = ["plan.json", "plan-ledger.jsonl"];
74655
74675
  KNOWLEDGE_FAMILY_ARTIFACTS = new Set([
74656
74676
  "knowledge.jsonl",
74657
74677
  "knowledge-rejected.jsonl"
@@ -77043,6 +77063,10 @@ import * as child_process6 from "node:child_process";
77043
77063
  import { existsSync as existsSync37, readdirSync as readdirSync7, readFileSync as readFileSync20, statSync as statSync11 } from "node:fs";
77044
77064
  import path68 from "node:path";
77045
77065
  import { fileURLToPath as fileURLToPath2 } from "node:url";
77066
+ function resolveCachePackageRoot(cachePath) {
77067
+ const nestedPackageRoot = path68.join(cachePath, "node_modules", "opencode-swarm");
77068
+ return existsSync37(nestedPackageRoot) ? nestedPackageRoot : cachePath;
77069
+ }
77046
77070
  function validateTaskDag(plan) {
77047
77071
  const allTaskIds = new Set;
77048
77072
  for (const phase of plan.phases) {
@@ -77819,14 +77843,21 @@ async function getDiagnoseData(directory) {
77819
77843
  cacheRows.push(`⬜ ${cachePath} — absent`);
77820
77844
  continue;
77821
77845
  }
77822
- const pkgJsonPath = path68.join(cachePath, "package.json");
77846
+ const packageRoot = resolveCachePackageRoot(cachePath);
77847
+ const cacheLabel = packageRoot === cachePath ? cachePath : `${cachePath} -> ${packageRoot}`;
77848
+ const missingGrammarAssets = REQUIRED_CACHE_GRAMMAR_ASSETS.filter((file3) => !existsSync37(path68.join(packageRoot, "dist", "lang", "grammars", file3)));
77849
+ const pkgJsonPath = path68.join(packageRoot, "package.json");
77823
77850
  try {
77824
77851
  const raw = readFileSync20(pkgJsonPath, "utf-8");
77825
77852
  const parsed = JSON.parse(raw);
77826
77853
  const installedVersion = typeof parsed.version === "string" ? parsed.version : "?";
77827
- cacheRows.push(`✅ ${cachePath} v${installedVersion}`);
77854
+ if (missingGrammarAssets.length > 0) {
77855
+ cacheRows.push(`⚠️ ${cacheLabel} — v${installedVersion}, missing grammar assets: ${missingGrammarAssets.join(", ")}; run \`bunx opencode-swarm update\` and restart OpenCode`);
77856
+ continue;
77857
+ }
77858
+ cacheRows.push(`✅ ${cacheLabel} — v${installedVersion}`);
77828
77859
  } catch {
77829
- cacheRows.push(`⚠️ ${cachePath} — present (package.json unreadable)`);
77860
+ cacheRows.push(`⚠️ ${cacheLabel} — present (package.json unreadable)`);
77830
77861
  }
77831
77862
  } catch {
77832
77863
  cacheRows.push(`⚠️ ${cachePath} — status unknown (read error)`);
@@ -77874,7 +77905,7 @@ async function handleDiagnoseCommand(directory, _args) {
77874
77905
  const diagnoseData = await getDiagnoseData(directory);
77875
77906
  return formatDiagnoseMarkdown(diagnoseData);
77876
77907
  }
77877
- var version4, sandboxCapabilityProbe, _internals44;
77908
+ var version4, sandboxCapabilityProbe, REQUIRED_CACHE_GRAMMAR_ASSETS, _internals44;
77878
77909
  var init_diagnose_service = __esm(() => {
77879
77910
  init_package();
77880
77911
  init_cache_paths();
@@ -77891,6 +77922,11 @@ var init_diagnose_service = __esm(() => {
77891
77922
  init_warning_buffer();
77892
77923
  ({ version: version4 } = package_default);
77893
77924
  sandboxCapabilityProbe = new SandboxCapabilityProbe;
77925
+ REQUIRED_CACHE_GRAMMAR_ASSETS = [
77926
+ "tree-sitter.wasm",
77927
+ "tree-sitter-javascript.wasm",
77928
+ "tree-sitter-typescript.wasm"
77929
+ ];
77894
77930
  _internals44 = {
77895
77931
  detectSandboxCapability: () => sandboxCapabilityProbe.detect(),
77896
77932
  getSandboxExecutor: getExecutor
@@ -108671,12 +108707,17 @@ import { Language, Parser as TreeSitterParser } from "web-tree-sitter";
108671
108707
  async function initTreeSitter() {
108672
108708
  if (!treeSitterInitPromise) {
108673
108709
  treeSitterInitPromise = (async () => {
108674
- const thisDir = path132.dirname(fileURLToPath4(import.meta.url));
108710
+ const thisDir = _internals82.getModuleDir();
108675
108711
  const isSource = thisDir.replace(/\\/g, "/").endsWith("/src/lang");
108676
108712
  if (isSource) {
108677
108713
  await _internals82.parserInit();
108678
108714
  } else {
108679
108715
  const grammarsDir = getGrammarsDirAbsolute();
108716
+ const coreWasmPath = path132.join(grammarsDir, "tree-sitter.wasm");
108717
+ if (!_internals82.fileExists(coreWasmPath)) {
108718
+ throw new Error(`Core tree-sitter WASM runtime missing: ${coreWasmPath}
108719
+ ` + `The installed OpenCode plugin cache is incomplete or stale. Run ` + `'bunx opencode-swarm update', then restart OpenCode so it fetches ` + `a fresh package from npm.`);
108720
+ }
108680
108721
  await _internals82.parserInit({
108681
108722
  locateFile(scriptName) {
108682
108723
  return path132.join(grammarsDir, scriptName);
@@ -108711,7 +108752,7 @@ function resolveGrammarsDir(thisDir) {
108711
108752
  return isSource ? path132.join(thisDir, "grammars") : isCliBundle ? path132.join(thisDir, "..", "lang", "grammars") : path132.join(thisDir, "lang", "grammars");
108712
108753
  }
108713
108754
  function getGrammarsDirAbsolute() {
108714
- const thisDir = path132.dirname(fileURLToPath4(import.meta.url));
108755
+ const thisDir = _internals82.getModuleDir();
108715
108756
  return resolveGrammarsDir(thisDir);
108716
108757
  }
108717
108758
  async function loadGrammar(languageId) {
@@ -108733,9 +108774,9 @@ async function loadGrammar(languageId) {
108733
108774
  const parser = new TreeSitterParser;
108734
108775
  const wasmFileName = getWasmFileName(normalizedId);
108735
108776
  const wasmPath = path132.join(getGrammarsDirAbsolute(), wasmFileName);
108736
- if (!existsSync75(wasmPath)) {
108777
+ if (!_internals82.fileExists(wasmPath)) {
108737
108778
  throw new Error(`Grammar file not found for ${languageId}: ${wasmPath}
108738
- ` + `Make sure to run 'bun run build' to copy grammar files to dist/lang/grammars/`);
108779
+ ` + `Make sure to run 'bun run build' to copy grammar files to dist/lang/grammars/. ` + `If this is an installed OpenCode plugin cache, run ` + `'bunx opencode-swarm update' and restart OpenCode.`);
108739
108780
  }
108740
108781
  try {
108741
108782
  const language = await withTimeout(Language.load(wasmPath), GRAMMAR_LOAD_TIMEOUT_MS, new Error(`Timed out after ${GRAMMAR_LOAD_TIMEOUT_MS}ms loading grammar`));
@@ -108798,7 +108839,9 @@ var init_runtime = __esm(() => {
108798
108839
  inflightLoads = new Map;
108799
108840
  initializedLanguages = new Set;
108800
108841
  _internals82 = {
108801
- parserInit: TreeSitterParser.init
108842
+ parserInit: TreeSitterParser.init,
108843
+ getModuleDir: () => path132.dirname(fileURLToPath4(import.meta.url)),
108844
+ fileExists: existsSync75
108802
108845
  };
108803
108846
  LANGUAGE_WASM_MAP = {
108804
108847
  javascript: "tree-sitter-javascript.wasm",
@@ -1,3 +1,4 @@
1
+ import { existsSync } from 'node:fs';
1
2
  import type { Parser as ParserType } from 'web-tree-sitter';
2
3
  export type Parser = ParserType;
3
4
  /**
@@ -21,6 +22,8 @@ export declare const _internals: {
21
22
  parserInit: (opts?: {
22
23
  locateFile: (scriptName: string) => string;
23
24
  }) => Promise<void>;
25
+ getModuleDir: () => string;
26
+ fileExists: typeof existsSync;
24
27
  };
25
28
  /**
26
29
  * Pure path resolver for the grammars directory given a base directory.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.100.0",
3
+ "version": "7.100.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",