@vibgrate/cli 2026.817.1 → 2026.817.2

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 (131) hide show
  1. package/DOCS.md +61 -0
  2. package/README.md +1 -0
  3. package/dist/agent-UQC7QN77.js +27 -0
  4. package/dist/{agent-CUYQKC6S.js.map → agent-UQC7QN77.js.map} +1 -1
  5. package/dist/{approvals-IPMUDEDV.js → approvals-ASPJQUZK.js} +6 -5
  6. package/dist/{approvals-IPMUDEDV.js.map → approvals-ASPJQUZK.js.map} +1 -1
  7. package/dist/baseline-FIV6PR2M.js +9 -0
  8. package/dist/{baseline-NZFGLMER.js.map → baseline-FIV6PR2M.js.map} +1 -1
  9. package/dist/{chunk-4W5SYK2M.js → chunk-2FEB5KJS.js} +3 -3
  10. package/dist/{chunk-4W5SYK2M.js.map → chunk-2FEB5KJS.js.map} +1 -1
  11. package/dist/{chunk-MIYXVY57.js → chunk-3FMRFECC.js} +4 -4
  12. package/dist/{chunk-MIYXVY57.js.map → chunk-3FMRFECC.js.map} +1 -1
  13. package/dist/{chunk-NQUWC2IA.js → chunk-3H3SVJUY.js} +4 -4
  14. package/dist/{chunk-NQUWC2IA.js.map → chunk-3H3SVJUY.js.map} +1 -1
  15. package/dist/{chunk-UBEVY5UT.js → chunk-3NJUOIZQ.js} +5 -5
  16. package/dist/{chunk-UBEVY5UT.js.map → chunk-3NJUOIZQ.js.map} +1 -1
  17. package/dist/{chunk-3GZSDY35.js → chunk-5OL2TSHK.js} +4 -4
  18. package/dist/{chunk-3GZSDY35.js.map → chunk-5OL2TSHK.js.map} +1 -1
  19. package/dist/{chunk-2BURPMYA.js → chunk-6K3XK7C5.js} +69 -976
  20. package/dist/chunk-6K3XK7C5.js.map +1 -0
  21. package/dist/{chunk-2GSMCOIC.js → chunk-AXZZ5CCG.js} +4 -4
  22. package/dist/{chunk-2GSMCOIC.js.map → chunk-AXZZ5CCG.js.map} +1 -1
  23. package/dist/{chunk-NHB53JTV.js → chunk-C3LMWZKF.js} +3 -3
  24. package/dist/{chunk-NHB53JTV.js.map → chunk-C3LMWZKF.js.map} +1 -1
  25. package/dist/{chunk-FD2HPGX2.js → chunk-DVW3SVCW.js} +9 -8
  26. package/dist/chunk-DVW3SVCW.js.map +1 -0
  27. package/dist/{chunk-RJCRWQNS.js → chunk-E2FAQREZ.js} +164 -221
  28. package/dist/chunk-E2FAQREZ.js.map +1 -0
  29. package/dist/{chunk-45AKSS4A.js → chunk-EXV4QSAD.js} +4 -4
  30. package/dist/{chunk-45AKSS4A.js.map → chunk-EXV4QSAD.js.map} +1 -1
  31. package/dist/{chunk-OWSXI3PJ.js → chunk-GOGMS3ST.js} +5 -5
  32. package/dist/{chunk-OWSXI3PJ.js.map → chunk-GOGMS3ST.js.map} +1 -1
  33. package/dist/{chunk-YL4OIUA5.js → chunk-K6DXETMC.js} +11 -11
  34. package/dist/{chunk-YL4OIUA5.js.map → chunk-K6DXETMC.js.map} +1 -1
  35. package/dist/{chunk-NKRWKCME.js → chunk-KJT2R6WW.js} +4 -4
  36. package/dist/{chunk-NKRWKCME.js.map → chunk-KJT2R6WW.js.map} +1 -1
  37. package/dist/{chunk-FMS6G67U.js → chunk-KNGAZDGF.js} +5 -5
  38. package/dist/{chunk-FMS6G67U.js.map → chunk-KNGAZDGF.js.map} +1 -1
  39. package/dist/{chunk-JHLCKMKF.js → chunk-LHKQGVRF.js} +9 -8
  40. package/dist/chunk-LHKQGVRF.js.map +1 -0
  41. package/dist/{chunk-A7EKFLAN.js → chunk-M7IO3DXH.js} +9 -8
  42. package/dist/chunk-M7IO3DXH.js.map +1 -0
  43. package/dist/{chunk-QPXVTQ7O.js → chunk-MVPRPSXU.js} +7 -4
  44. package/dist/chunk-MVPRPSXU.js.map +1 -0
  45. package/dist/{chunk-DT4KIVRI.js → chunk-NG4KIJW6.js} +34 -2
  46. package/dist/chunk-NG4KIJW6.js.map +1 -0
  47. package/dist/{chunk-K267DHCF.js → chunk-O2DL2Q55.js} +6 -6
  48. package/dist/{chunk-K267DHCF.js.map → chunk-O2DL2Q55.js.map} +1 -1
  49. package/dist/chunk-O3LABX6I.js +43 -0
  50. package/dist/chunk-O3LABX6I.js.map +1 -0
  51. package/dist/chunk-PRG2ULPK.js +6 -0
  52. package/dist/{chunk-PV76EO4G.js.map → chunk-PRG2ULPK.js.map} +1 -1
  53. package/dist/{chunk-ZSECAGSU.js → chunk-Q3M6K3HY.js} +3 -3
  54. package/dist/{chunk-ZSECAGSU.js.map → chunk-Q3M6K3HY.js.map} +1 -1
  55. package/dist/{chunk-2TJ5EY4I.js → chunk-Q4G2BWE3.js} +4 -4
  56. package/dist/{chunk-2TJ5EY4I.js.map → chunk-Q4G2BWE3.js.map} +1 -1
  57. package/dist/chunk-T7RSQ5WD.js +227 -0
  58. package/dist/chunk-T7RSQ5WD.js.map +1 -0
  59. package/dist/{chunk-RQAKBRAV.js → chunk-TVDMNIUT.js} +3 -3
  60. package/dist/{chunk-RQAKBRAV.js.map → chunk-TVDMNIUT.js.map} +1 -1
  61. package/dist/{chunk-ANYL7SUI.js → chunk-WAKP7SK7.js} +4584 -976
  62. package/dist/chunk-WAKP7SK7.js.map +1 -0
  63. package/dist/{chunk-ENFSSUNK.js → chunk-WVMOGIPC.js} +5 -43
  64. package/dist/chunk-WVMOGIPC.js.map +1 -0
  65. package/dist/{chunk-6NOGNOE4.js → chunk-XLXJC7H3.js} +141 -13
  66. package/dist/chunk-XLXJC7H3.js.map +1 -0
  67. package/dist/cli.js +1476 -575
  68. package/dist/cli.js.map +1 -1
  69. package/dist/{daemon-J2HX4GY3.js → daemon-FPTRHO5N.js} +11 -10
  70. package/dist/{daemon-J2HX4GY3.js.map → daemon-FPTRHO5N.js.map} +1 -1
  71. package/dist/embed-worker-main.js +5 -4
  72. package/dist/embed-worker-main.js.map +1 -1
  73. package/dist/ensure-map-342G2IV3.js +33 -0
  74. package/dist/{ensure-map-5C6KG66X.js.map → ensure-map-342G2IV3.js.map} +1 -1
  75. package/dist/{fs-NTQUFCXV.js → fs-TLPOWC2D.js} +3 -3
  76. package/dist/fs-TLPOWC2D.js.map +1 -0
  77. package/dist/graph-backend-RNWQBT3P.js +15 -0
  78. package/dist/{graph-backend-HH5IIQ55.js.map → graph-backend-RNWQBT3P.js.map} +1 -1
  79. package/dist/index.d.ts +22 -3
  80. package/dist/index.js +18 -17
  81. package/dist/index.js.map +1 -1
  82. package/dist/{interactive-FXPAZAUJ.js → interactive-SR7TMF6M.js} +28 -27
  83. package/dist/interactive-SR7TMF6M.js.map +1 -0
  84. package/dist/load-AYFECIQB.js +11 -0
  85. package/dist/{load-OR2XVGAV.js.map → load-AYFECIQB.js.map} +1 -1
  86. package/dist/parse-worker.d.ts +1 -1
  87. package/dist/parse-worker.js +5 -2
  88. package/dist/parse-worker.js.map +1 -1
  89. package/dist/{run-outcome-M4546HLJ.js → run-outcome-YQQJG3LW.js} +7 -6
  90. package/dist/run-outcome-YQQJG3LW.js.map +1 -0
  91. package/dist/runtime-session-CNJ4DAV5.js +22 -0
  92. package/dist/{runtime-session-6KKMFS6Q.js.map → runtime-session-CNJ4DAV5.js.map} +1 -1
  93. package/dist/session-H34HUV2Y.js +17 -0
  94. package/dist/{session-HCFJUSKN.js.map → session-H34HUV2Y.js.map} +1 -1
  95. package/dist/{stream-json-4DL65D6U.js → stream-json-55YDNAFX.js} +15 -14
  96. package/dist/stream-json-55YDNAFX.js.map +1 -0
  97. package/dist/{types-8SYlXhzm.d.ts → types-DHqH0XIE.d.ts} +11 -0
  98. package/dist/version-WSE3QOPK.js +4 -0
  99. package/dist/{version-UPIC3F4P.js.map → version-WSE3QOPK.js.map} +1 -1
  100. package/dist/{vg-mcp-bridge-FZGX6DYO.js → vg-mcp-bridge-2CNLHNEL.js} +13 -12
  101. package/dist/vg-mcp-bridge-2CNLHNEL.js.map +1 -0
  102. package/dist/{vgd-QR26FAZD.js → vgd-URUZQORN.js} +10 -9
  103. package/dist/vgd-URUZQORN.js.map +1 -0
  104. package/package.json +7 -7
  105. package/dist/agent-CUYQKC6S.js +0 -26
  106. package/dist/baseline-NZFGLMER.js +0 -9
  107. package/dist/chunk-2BURPMYA.js.map +0 -1
  108. package/dist/chunk-6NOGNOE4.js.map +0 -1
  109. package/dist/chunk-A7EKFLAN.js.map +0 -1
  110. package/dist/chunk-ANYL7SUI.js.map +0 -1
  111. package/dist/chunk-DT4KIVRI.js.map +0 -1
  112. package/dist/chunk-ENFSSUNK.js.map +0 -1
  113. package/dist/chunk-FD2HPGX2.js.map +0 -1
  114. package/dist/chunk-JHLCKMKF.js.map +0 -1
  115. package/dist/chunk-PV76EO4G.js +0 -6
  116. package/dist/chunk-QPXVTQ7O.js.map +0 -1
  117. package/dist/chunk-RJCRWQNS.js.map +0 -1
  118. package/dist/chunk-RXP66R2E.js +0 -39
  119. package/dist/chunk-RXP66R2E.js.map +0 -1
  120. package/dist/ensure-map-5C6KG66X.js +0 -32
  121. package/dist/fs-NTQUFCXV.js.map +0 -1
  122. package/dist/graph-backend-HH5IIQ55.js +0 -14
  123. package/dist/interactive-FXPAZAUJ.js.map +0 -1
  124. package/dist/load-OR2XVGAV.js +0 -10
  125. package/dist/run-outcome-M4546HLJ.js.map +0 -1
  126. package/dist/runtime-session-6KKMFS6Q.js +0 -21
  127. package/dist/session-HCFJUSKN.js +0 -16
  128. package/dist/stream-json-4DL65D6U.js.map +0 -1
  129. package/dist/version-UPIC3F4P.js +0 -4
  130. package/dist/vg-mcp-bridge-FZGX6DYO.js.map +0 -1
  131. package/dist/vgd-QR26FAZD.js.map +0 -1
@@ -1,17 +1,18 @@
1
- import { FREE_PACK, navigationToolsetConfig, deferredToolNames, HOT_TOOLS } from './chunk-FD2HPGX2.js';
1
+ import { FREE_PACK, navigationToolsetConfig, deferredToolNames, HOT_TOOLS } from './chunk-DVW3SVCW.js';
2
2
  import { CliError, ExitCode } from './chunk-MS6V5XKB.js';
3
3
  import { edgeId, buildModuleResolver, resolve, applyStaticTestLinkage, nodeId } from './chunk-VIWZ4QT7.js';
4
- import { indexFor } from './chunk-2TJ5EY4I.js';
5
- import { writeGraphIndex, SCHEMA_VERSION, loadGraph } from './chunk-MIYXVY57.js';
4
+ import { indexFor } from './chunk-Q4G2BWE3.js';
5
+ import { writeGraphIndex, SCHEMA_VERSION, loadGraph } from './chunk-3FMRFECC.js';
6
6
  import { init_cli_invocation, whichOnPath, isInstalledOwnBinary } from './chunk-EZ7UC5Y5.js';
7
- import { langById, grammarSetVersion, langForExtension, grammarDirs, setGrammarsOverride, parseSource, ensureParserInit } from './chunk-6NOGNOE4.js';
8
- import { redactSecrets } from './chunk-RXP66R2E.js';
9
- import { loadCache, cacheDir } from './chunk-QPXVTQ7O.js';
10
- import { serializeGraph, stableStringify, ensureVibgrateGitignore } from './chunk-ENFSSUNK.js';
11
- import { VERSION } from './chunk-PV76EO4G.js';
7
+ import { langById, grammarSetVersion, toolchainGrammarSetVersion, fileRolesFromParses, langForExtension, setGrammarsOverride, parseSource, toolchainParser } from './chunk-XLXJC7H3.js';
8
+ import { redactSecrets } from './chunk-T7RSQ5WD.js';
9
+ import { ensureVibgrateGitignore } from './chunk-WVMOGIPC.js';
10
+ import { loadCache, cacheDir } from './chunk-MVPRPSXU.js';
11
+ import { serializeGraph, stableStringify } from './chunk-O3LABX6I.js';
12
+ import { VERSION } from './chunk-PRG2ULPK.js';
12
13
  import { shortId, canonicalize, hashString, hashBytes } from './chunk-JFGYT6BI.js';
13
- import * as fs13 from 'fs';
14
- import * as path12 from 'path';
14
+ import * as fs12 from 'fs';
15
+ import * as path11 from 'path';
15
16
  import ignore from 'ignore';
16
17
  import * as v8 from 'v8';
17
18
  import Graph from 'graphology';
@@ -24,9 +25,7 @@ import { fileURLToPath } from 'url';
24
25
  import ts from 'typescript';
25
26
  import * as crypto from 'crypto';
26
27
  import YAML from 'yaml';
27
- import { createRequire } from 'module';
28
- import { Parser, Language } from 'web-tree-sitter';
29
- import * as fs10 from 'fs/promises';
28
+ import * as fs9 from 'fs/promises';
30
29
 
31
30
  var SKIP_DIRS = /* @__PURE__ */ new Set([
32
31
  // Version control, IDE & tool metadata
@@ -191,19 +190,19 @@ var SKIP_FILES = /* @__PURE__ */ new Set([
191
190
  "flake.lock"
192
191
  ]);
193
192
  function toPosix(p) {
194
- return p.split(path12.sep).join("/");
193
+ return p.split(path11.sep).join("/");
195
194
  }
196
195
  function buildRootIgnore(root, exclude) {
197
196
  const ig = ignore();
198
- const gitignorePath = path12.join(root, ".gitignore");
199
- if (fs13.existsSync(gitignorePath)) {
200
- ig.add(fs13.readFileSync(gitignorePath, "utf8"));
197
+ const gitignorePath = path11.join(root, ".gitignore");
198
+ if (fs12.existsSync(gitignorePath)) {
199
+ ig.add(fs12.readFileSync(gitignorePath, "utf8"));
201
200
  }
202
201
  if (exclude.length) ig.add(exclude);
203
202
  return ig;
204
203
  }
205
204
  function discover(options) {
206
- const root = path12.resolve(options.root);
205
+ const root = path11.resolve(options.root);
207
206
  const onlyLangs = (options.only ?? []).filter(Boolean);
208
207
  const allowLang = (lang) => onlyLangs.length === 0 || onlyLangs.includes(lang.id);
209
208
  for (const id of onlyLangs) {
@@ -212,27 +211,27 @@ function discover(options) {
212
211
  }
213
212
  }
214
213
  const rootIg = buildRootIgnore(root, options.exclude ?? []);
215
- const scopeAbs = (options.paths && options.paths.length ? options.paths.map((p) => path12.resolve(root, p)) : [root]).filter((p) => fs13.existsSync(p));
214
+ const scopeAbs = (options.paths && options.paths.length ? options.paths.map((p) => path11.resolve(root, p)) : [root]).filter((p) => fs12.existsSync(p));
216
215
  const found = /* @__PURE__ */ new Map();
217
216
  const considerFile = (abs) => {
218
- const rel2 = toPosix(path12.relative(root, abs));
217
+ const rel2 = toPosix(path11.relative(root, abs));
219
218
  if (rel2.startsWith("..")) return;
220
219
  if (rel2 === "" || rootIg.ignores(rel2)) return;
221
- if (SKIP_FILES.has(path12.basename(abs).toLowerCase())) return;
222
- const lang = langForExtension(path12.extname(abs));
220
+ if (SKIP_FILES.has(path11.basename(abs).toLowerCase())) return;
221
+ const lang = langForExtension(path11.extname(abs));
223
222
  if (!lang || !allowLang(lang)) return;
224
223
  found.set(rel2, { rel: rel2, abs, lang });
225
224
  };
226
225
  const walk = (dir) => {
227
226
  let entries;
228
227
  try {
229
- entries = fs13.readdirSync(dir, { withFileTypes: true });
228
+ entries = fs12.readdirSync(dir, { withFileTypes: true });
230
229
  } catch {
231
230
  return;
232
231
  }
233
232
  for (const entry of entries) {
234
- const abs = path12.join(dir, entry.name);
235
- const rel2 = toPosix(path12.relative(root, abs));
233
+ const abs = path11.join(dir, entry.name);
234
+ const rel2 = toPosix(path11.relative(root, abs));
236
235
  if (entry.isDirectory()) {
237
236
  if (isSkippedDirName(entry.name)) continue;
238
237
  if (rel2 && rootIg.ignores(`${rel2}/`)) continue;
@@ -243,7 +242,7 @@ function discover(options) {
243
242
  }
244
243
  };
245
244
  for (const scope of scopeAbs) {
246
- const stat = fs13.statSync(scope);
245
+ const stat = fs12.statSync(scope);
247
246
  if (stat.isDirectory()) walk(scope);
248
247
  else if (stat.isFile()) considerFile(scope);
249
248
  }
@@ -725,14 +724,14 @@ var DEFAULT_PATHS = [
725
724
  ];
726
725
  function loadCoverage(root, explicit) {
727
726
  const candidates = (explicit && explicit.length ? explicit : DEFAULT_PATHS).map(
728
- (p) => path12.resolve(root, p)
727
+ (p) => path11.resolve(root, p)
729
728
  );
730
- const found = candidates.filter((p) => fs13.existsSync(p));
729
+ const found = candidates.filter((p) => fs12.existsSync(p));
731
730
  if (found.length === 0) return null;
732
731
  const map = /* @__PURE__ */ new Map();
733
732
  for (const file of found) {
734
733
  try {
735
- const text = fs13.readFileSync(file, "utf8");
734
+ const text = fs12.readFileSync(file, "utf8");
736
735
  if (file.endsWith(".json")) mergeIstanbul(map, text, root);
737
736
  else mergeLcov(map, text, root);
738
737
  } catch {
@@ -741,8 +740,8 @@ function loadCoverage(root, explicit) {
741
740
  return map.size ? map : null;
742
741
  }
743
742
  function rel(root, p) {
744
- const abs = path12.isAbsolute(p) ? p : path12.resolve(root, p);
745
- return path12.relative(root, abs).split(path12.sep).join("/");
743
+ const abs = path11.isAbsolute(p) ? p : path11.resolve(root, p);
744
+ return path11.relative(root, abs).split(path11.sep).join("/");
746
745
  }
747
746
  function bump(map, file, line, hits) {
748
747
  let lh = map.get(file);
@@ -953,7 +952,7 @@ async function parseInline(files, options) {
953
952
  onProgress?.(0, files.length);
954
953
  for (const file of files) {
955
954
  try {
956
- const source = fs13.readFileSync(file.abs, "utf8");
955
+ const source = fs12.readFileSync(file.abs, "utf8");
957
956
  out.push(await parseSource(file.rel, file.lang.id, source));
958
957
  } catch (err) {
959
958
  out.push(emptyParse(file, `parse failed: ${err.message}`));
@@ -1008,9 +1007,9 @@ function isWorkerOom(err) {
1008
1007
  return e?.code === "ERR_WORKER_OUT_OF_MEMORY" || /out of memory/i.test(e?.message ?? "");
1009
1008
  }
1010
1009
  function resolveWorkerFile() {
1011
- const here = path12.dirname(fileURLToPath(import.meta.url));
1012
- const candidate = path12.join(here, "parse-worker.js");
1013
- return fs13.existsSync(candidate) ? candidate : null;
1010
+ const here = path11.dirname(fileURLToPath(import.meta.url));
1011
+ const candidate = path11.join(here, "parse-worker.js");
1012
+ return fs12.existsSync(candidate) ? candidate : null;
1014
1013
  }
1015
1014
  function chunk(items, buckets) {
1016
1015
  const out = Array.from({ length: Math.min(buckets, items.length || 1) }, () => []);
@@ -1289,12 +1288,12 @@ function enclosing3(nodes, line) {
1289
1288
  return best;
1290
1289
  }
1291
1290
  function normalize2(p) {
1292
- return path12.resolve(p).split(path12.sep).join("/");
1291
+ return path11.resolve(p).split(path11.sep).join("/");
1293
1292
  }
1294
1293
  var TSC_CACHE_VERSION = "vg-tsc-cache/1";
1295
1294
  var AMBIENT_RE = /\bdeclare\s+(global|module)\b/;
1296
1295
  function tscCachePath(root) {
1297
- return path12.join(cacheDir(root), "tsc-cache.json");
1296
+ return path11.join(cacheDir(root), "tsc-cache.json");
1298
1297
  }
1299
1298
  function loadTscCache(root, opts) {
1300
1299
  const file = tscCachePath(root);
@@ -1304,9 +1303,9 @@ function loadTscCache(root, opts) {
1304
1303
  ts: ts.version,
1305
1304
  entries: {}
1306
1305
  };
1307
- if (!opts.disabled && fs13.existsSync(file)) {
1306
+ if (!opts.disabled && fs12.existsSync(file)) {
1308
1307
  try {
1309
- const loaded = JSON.parse(fs13.readFileSync(file, "utf8"));
1308
+ const loaded = JSON.parse(fs12.readFileSync(file, "utf8"));
1310
1309
  if (loaded.version === TSC_CACHE_VERSION && loaded.toolVersion === opts.toolVersion && loaded.ts === ts.version && loaded.entries) {
1311
1310
  data = loaded;
1312
1311
  }
@@ -1337,18 +1336,18 @@ function loadTscCache(root, opts) {
1337
1336
  },
1338
1337
  save() {
1339
1338
  if (opts.disabled) return;
1340
- fs13.mkdirSync(cacheDir(root), { recursive: true });
1341
- fs13.writeFileSync(file, stableStringify(data, 0));
1339
+ fs12.mkdirSync(cacheDir(root), { recursive: true });
1340
+ fs12.writeFileSync(file, stableStringify(data, 0));
1342
1341
  }
1343
1342
  };
1344
1343
  }
1345
1344
  function abs$(root, rel2) {
1346
- return path12.join(root, rel2);
1345
+ return path11.join(root, rel2);
1347
1346
  }
1348
1347
  function detectAmbient(rel2, abs) {
1349
1348
  if (rel2.endsWith(".d.ts")) return true;
1350
1349
  try {
1351
- return AMBIENT_RE.test(fs13.readFileSync(abs, "utf8"));
1350
+ return AMBIENT_RE.test(fs12.readFileSync(abs, "utf8"));
1352
1351
  } catch {
1353
1352
  return true;
1354
1353
  }
@@ -1642,14 +1641,14 @@ var IMPORTANCE = {
1642
1641
  "other-config": 0.08
1643
1642
  };
1644
1643
  function toPosix2(p) {
1645
- return p.split(path12.sep).join("/");
1644
+ return p.split(path11.sep).join("/");
1646
1645
  }
1647
1646
  function buildRootIgnore2(root, exclude) {
1648
1647
  const ig = ignore();
1649
- const gitignorePath = path12.join(root, ".gitignore");
1650
- if (fs13.existsSync(gitignorePath)) {
1648
+ const gitignorePath = path11.join(root, ".gitignore");
1649
+ if (fs12.existsSync(gitignorePath)) {
1651
1650
  try {
1652
- ig.add(fs13.readFileSync(gitignorePath, "utf8"));
1651
+ ig.add(fs12.readFileSync(gitignorePath, "utf8"));
1653
1652
  } catch {
1654
1653
  }
1655
1654
  }
@@ -1658,7 +1657,7 @@ function buildRootIgnore2(root, exclude) {
1658
1657
  }
1659
1658
  function classifyProjectContext(relOrName) {
1660
1659
  const rel2 = relOrName.replace(/\\/g, "/");
1661
- const base = path12.basename(rel2);
1660
+ const base = path11.basename(rel2);
1662
1661
  const baseLower = base.toLowerCase();
1663
1662
  if (/^\.env($|\.)/i.test(base) && !isEnvExampleName(baseLower)) return null;
1664
1663
  if (SKIP_FILES.has(baseLower)) return null;
@@ -1671,7 +1670,7 @@ function classifyProjectContext(relOrName) {
1671
1670
  for (const { re, category } of PATH_PATTERNS) {
1672
1671
  if (re.test(rel2)) return category;
1673
1672
  }
1674
- const ext = path12.extname(baseLower);
1673
+ const ext = path11.extname(baseLower);
1675
1674
  if (DOC_EXTENSIONS.has(ext)) return ext === ".txt" ? "text" : "markdown";
1676
1675
  if (API_EXTENSIONS.has(ext)) return "api-contract";
1677
1676
  if ((ext === ".yaml" || ext === ".yml" || ext === ".json") && /openapi|swagger|asyncapi/i.test(base)) {
@@ -1689,24 +1688,24 @@ function isEnvExampleName(baseLower) {
1689
1688
  return false;
1690
1689
  }
1691
1690
  function discoverDocs(options) {
1692
- const root = path12.resolve(options.root);
1691
+ const root = path11.resolve(options.root);
1693
1692
  const maxFiles = options.maxFiles ?? DOC_MAX_FILES;
1694
1693
  const rootIg = buildRootIgnore2(root, options.exclude ?? []);
1695
- const scopeAbs = (options.paths?.length ? options.paths.map((p) => path12.resolve(root, p)) : [root]).filter(
1696
- (p) => fs13.existsSync(p)
1694
+ const scopeAbs = (options.paths?.length ? options.paths.map((p) => path11.resolve(root, p)) : [root]).filter(
1695
+ (p) => fs12.existsSync(p)
1697
1696
  );
1698
1697
  const found = /* @__PURE__ */ new Map();
1699
1698
  const consider = (abs) => {
1700
1699
  if (found.size >= maxFiles) return;
1701
- const rel2 = toPosix2(path12.relative(root, abs));
1700
+ const rel2 = toPosix2(path11.relative(root, abs));
1702
1701
  if (!rel2 || rel2.startsWith("..")) return;
1703
1702
  if (rootIg.ignores(rel2)) return;
1704
- const base = path12.basename(abs);
1703
+ const base = path11.basename(abs);
1705
1704
  if (SKIP_FILES.has(base.toLowerCase())) return;
1706
1705
  const category = classifyProjectContext(rel2);
1707
1706
  if (!category) return;
1708
1707
  try {
1709
- const st = fs13.statSync(abs);
1708
+ const st = fs12.statSync(abs);
1710
1709
  if (!st.isFile() || st.size > DOC_FILE_MAX_BYTES) return;
1711
1710
  if (st.size === 0) return;
1712
1711
  } catch {
@@ -1718,14 +1717,14 @@ function discoverDocs(options) {
1718
1717
  if (found.size >= maxFiles || depth > 12) return;
1719
1718
  let entries;
1720
1719
  try {
1721
- entries = fs13.readdirSync(dir, { withFileTypes: true });
1720
+ entries = fs12.readdirSync(dir, { withFileTypes: true });
1722
1721
  } catch {
1723
1722
  return;
1724
1723
  }
1725
1724
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
1726
1725
  if (found.size >= maxFiles) return;
1727
- const abs = path12.join(dir, entry.name);
1728
- const rel2 = toPosix2(path12.relative(root, abs));
1726
+ const abs = path11.join(dir, entry.name);
1727
+ const rel2 = toPosix2(path11.relative(root, abs));
1729
1728
  if (entry.isDirectory()) {
1730
1729
  if (isSkippedDirName(entry.name)) continue;
1731
1730
  if (rel2 && rootIg.ignores(`${rel2}/`) && !rel2.startsWith(".github")) continue;
@@ -1737,7 +1736,7 @@ function discoverDocs(options) {
1737
1736
  };
1738
1737
  for (const scope of scopeAbs) {
1739
1738
  try {
1740
- const st = fs13.statSync(scope);
1739
+ const st = fs12.statSync(scope);
1741
1740
  if (st.isDirectory()) walk(scope, 0);
1742
1741
  else if (st.isFile()) consider(scope);
1743
1742
  } catch {
@@ -1748,7 +1747,7 @@ function discoverDocs(options) {
1748
1747
  function prepareDocBody(rel2, raw, category) {
1749
1748
  const scrubbed = redactSecrets(raw);
1750
1749
  if (scrubbed.length <= DOC_BODY_MAX_CHARS) return scrubbed;
1751
- if (category === "manifest" && path12.basename(rel2).toLowerCase() === "package.json") {
1750
+ if (category === "manifest" && path11.basename(rel2).toLowerCase() === "package.json") {
1752
1751
  return summarizePackageJson(scrubbed);
1753
1752
  }
1754
1753
  if (category === "api-contract" && /\.(ya?ml|json)$/i.test(rel2)) {
@@ -1794,14 +1793,14 @@ function documentNodesFromDocs(docs) {
1794
1793
  for (const d of docs) {
1795
1794
  let raw = "";
1796
1795
  try {
1797
- raw = fs13.readFileSync(d.abs, "utf8");
1796
+ raw = fs12.readFileSync(d.abs, "utf8");
1798
1797
  } catch {
1799
1798
  continue;
1800
1799
  }
1801
1800
  const category = d.category ?? d.kind;
1802
1801
  const scrubbed = prepareDocBody(d.rel, raw, category);
1803
1802
  if (!scrubbed.trim()) continue;
1804
- const name = path12.basename(d.rel);
1803
+ const name = path11.basename(d.rel);
1805
1804
  const qualifiedName = d.rel.replace(/\\/g, "/");
1806
1805
  const id = nodeId({
1807
1806
  kind: "document",
@@ -1949,15 +1948,15 @@ function parseYamlStream(rel2, source) {
1949
1948
  });
1950
1949
  return { docs, warnings };
1951
1950
  }
1952
- function spanAt(doc, lines, path13) {
1953
- const node = path13.length ? safeGetIn(doc.ast, path13) : doc.ast.contents;
1951
+ function spanAt(doc, lines, path12) {
1952
+ const node = path12.length ? safeGetIn(doc.ast, path12) : doc.ast.contents;
1954
1953
  const range = nodeRange(node) ?? nodeRange(doc.ast.contents);
1955
1954
  if (!range) return { start: 1, end: 1 };
1956
1955
  return lines.span(range[0], range[2] ?? range[1]);
1957
1956
  }
1958
- function safeGetIn(ast, path13) {
1957
+ function safeGetIn(ast, path12) {
1959
1958
  try {
1960
- return ast.getIn(path13, true);
1959
+ return ast.getIn(path12, true);
1961
1960
  } catch {
1962
1961
  return void 0;
1963
1962
  }
@@ -1966,26 +1965,26 @@ function nodeRange(node) {
1966
1965
  const range = node?.range;
1967
1966
  return Array.isArray(range) ? range : null;
1968
1967
  }
1969
- function getPath(value, path13) {
1968
+ function getPath(value, path12) {
1970
1969
  let current = value;
1971
- for (const key of path13) {
1970
+ for (const key of path12) {
1972
1971
  if (current === null || typeof current !== "object") return void 0;
1973
1972
  current = current[key];
1974
1973
  }
1975
1974
  return current;
1976
1975
  }
1977
- function getString(value, path13) {
1978
- const found = getPath(value, path13);
1976
+ function getString(value, path12) {
1977
+ const found = getPath(value, path12);
1979
1978
  if (typeof found === "string") return found;
1980
1979
  if (typeof found === "number" || typeof found === "boolean") return String(found);
1981
1980
  return void 0;
1982
1981
  }
1983
- function getArray(value, path13) {
1984
- const found = getPath(value, path13);
1982
+ function getArray(value, path12) {
1983
+ const found = getPath(value, path12);
1985
1984
  return Array.isArray(found) ? found : [];
1986
1985
  }
1987
- function getRecordEntries(value, path13) {
1988
- const found = getPath(value, path13);
1986
+ function getRecordEntries(value, path12) {
1987
+ const found = getPath(value, path12);
1989
1988
  if (!found || typeof found !== "object" || Array.isArray(found)) return [];
1990
1989
  return Object.entries(found).sort(([a], [b]) => a.localeCompare(b, "en"));
1991
1990
  }
@@ -2553,9 +2552,9 @@ function referencedConfig(value, podPath) {
2553
2552
  }
2554
2553
  return [...out].sort();
2555
2554
  }
2556
- function readLabels(value, path13) {
2555
+ function readLabels(value, path12) {
2557
2556
  const out = {};
2558
- for (const [key, raw] of getRecordEntries(value, path13)) {
2557
+ for (const [key, raw] of getRecordEntries(value, path12)) {
2559
2558
  if (typeof raw === "string") out[key] = raw;
2560
2559
  else if (typeof raw === "number" || typeof raw === "boolean") out[key] = String(raw);
2561
2560
  }
@@ -2586,63 +2585,6 @@ function describeObject(value, kind) {
2586
2585
  }
2587
2586
  return parts.join(", ");
2588
2587
  }
2589
- var require2 = createRequire(import.meta.url);
2590
- var TOOLCHAIN_GRAMMARS = {
2591
- hcl: { wasm: "tree-sitter-hcl", pkg: "@tree-sitter-grammars/tree-sitter-hcl" }
2592
- };
2593
- var languageCache = /* @__PURE__ */ new Map();
2594
- function toolchainGrammarDirs(pkg) {
2595
- const dirs = [...grammarDirs()];
2596
- try {
2597
- dirs.push(path12.dirname(require2.resolve(`${pkg}/package.json`)));
2598
- } catch {
2599
- }
2600
- return dirs;
2601
- }
2602
- function resolveToolchainGrammar(id) {
2603
- const spec = TOOLCHAIN_GRAMMARS[id];
2604
- if (!spec) return null;
2605
- for (const dir of toolchainGrammarDirs(spec.pkg)) {
2606
- const candidate = path12.join(dir, `${spec.wasm}.wasm`);
2607
- if (fs13.existsSync(candidate)) return candidate;
2608
- }
2609
- return null;
2610
- }
2611
- async function loadToolchainLanguage(id) {
2612
- const cached = languageCache.get(id);
2613
- if (cached) return cached;
2614
- const wasmPath = resolveToolchainGrammar(id);
2615
- if (!wasmPath) return null;
2616
- try {
2617
- await ensureParserInit();
2618
- const language = await Language.load(fs13.readFileSync(wasmPath));
2619
- languageCache.set(id, language);
2620
- return language;
2621
- } catch {
2622
- return null;
2623
- }
2624
- }
2625
- async function toolchainParser(id) {
2626
- const language = await loadToolchainLanguage(id);
2627
- if (!language) return null;
2628
- const parser = new Parser();
2629
- parser.setLanguage(language);
2630
- return parser;
2631
- }
2632
- function toolchainGrammarSetVersion() {
2633
- const parts = [];
2634
- for (const id of Object.keys(TOOLCHAIN_GRAMMARS).sort()) {
2635
- const { pkg } = TOOLCHAIN_GRAMMARS[id];
2636
- let version = "bundled";
2637
- try {
2638
- const json = require2.resolve(`${pkg}/package.json`);
2639
- version = JSON.parse(fs13.readFileSync(json, "utf8")).version;
2640
- } catch {
2641
- }
2642
- parts.push(`${pkg}@${version}`);
2643
- }
2644
- return parts.join(",");
2645
- }
2646
2588
 
2647
2589
  // src/engine/toolchain/terraform.ts
2648
2590
  var BUILTIN_REF_PREFIXES = /* @__PURE__ */ new Set([
@@ -3262,7 +3204,7 @@ function linkToolchain(input) {
3262
3204
  const { nodes, edges, fileNodes, stageCopySources } = input;
3263
3205
  const out = /* @__PURE__ */ new Map();
3264
3206
  const counts = {};
3265
- const add3 = (kind, src, dst, confidence, join11) => {
3207
+ const add3 = (kind, src, dst, confidence, join10) => {
3266
3208
  if (src === dst) return;
3267
3209
  const id = edgeId(kind, src, dst);
3268
3210
  if (out.has(id)) return;
@@ -3275,7 +3217,7 @@ function linkToolchain(input) {
3275
3217
  confidence,
3276
3218
  epistemic: "name-matched"
3277
3219
  });
3278
- counts[join11] = (counts[join11] ?? 0) + 1;
3220
+ counts[join10] = (counts[join10] ?? 0) + 1;
3279
3221
  };
3280
3222
  const declared = new Set(edges.map((e) => `${e.kind} ${e.src} ${e.dst}`));
3281
3223
  const dockerfileByPath = /* @__PURE__ */ new Map();
@@ -3358,8 +3300,8 @@ function linkToolchain(input) {
3358
3300
  for (const stage of stages) {
3359
3301
  const copied = stageCopySources.get(stage.qualifiedName);
3360
3302
  if (!copied?.length) continue;
3361
- for (const path13 of copied) {
3362
- const fileNodeId = fileNodes.get(toPosix3(path13));
3303
+ for (const path12 of copied) {
3304
+ const fileNodeId = fileNodes.get(toPosix3(path12));
3363
3305
  if (!fileNodeId) continue;
3364
3306
  add3("depends_on", stage.id, fileNodeId, LINK_CONFIDENCE.dockerfileCopy, "dockerfile\u2192source");
3365
3307
  }
@@ -3421,9 +3363,9 @@ async function extractToolchain(docs, options = {}) {
3421
3363
  let source;
3422
3364
  let head;
3423
3365
  try {
3424
- const stat = fs13.statSync(doc.abs);
3366
+ const stat = fs12.statSync(doc.abs);
3425
3367
  if (stat.size > TOOLCHAIN_FILE_MAX_BYTES) continue;
3426
- source = fs13.readFileSync(doc.abs, "utf8");
3368
+ source = fs12.readFileSync(doc.abs, "utf8");
3427
3369
  head = source.slice(0, HEAD_BYTES);
3428
3370
  } catch {
3429
3371
  continue;
@@ -3526,7 +3468,7 @@ function shardTsProjects(root, files) {
3526
3468
  const cache = /* @__PURE__ */ new Map();
3527
3469
  const byKey = /* @__PURE__ */ new Map();
3528
3470
  for (const f of files) {
3529
- const dir = path12.dirname(f.abs);
3471
+ const dir = path11.dirname(f.abs);
3530
3472
  const key = nearestProjectKey(root, dir, cache);
3531
3473
  const list = byKey.get(key);
3532
3474
  if (list) list.push(f);
@@ -3541,22 +3483,22 @@ function nearestProjectKey(root, startDir, cache) {
3541
3483
  const hit = cache.get(startDir);
3542
3484
  if (hit !== void 0) return hit;
3543
3485
  let dir = startDir;
3544
- const rootAbs = path12.resolve(root);
3486
+ const rootAbs = path11.resolve(root);
3545
3487
  while (true) {
3546
- if (fs13.existsSync(path12.join(dir, "tsconfig.json")) || fs13.existsSync(path12.join(dir, "tsconfig.base.json")) || fs13.existsSync(path12.join(dir, "package.json"))) {
3547
- const key = toPosix4(path12.relative(rootAbs, dir)) || ".";
3488
+ if (fs12.existsSync(path11.join(dir, "tsconfig.json")) || fs12.existsSync(path11.join(dir, "tsconfig.base.json")) || fs12.existsSync(path11.join(dir, "package.json"))) {
3489
+ const key = toPosix4(path11.relative(rootAbs, dir)) || ".";
3548
3490
  cache.set(startDir, key);
3549
3491
  return key;
3550
3492
  }
3551
- if (dir === rootAbs || path12.dirname(dir) === dir) {
3493
+ if (dir === rootAbs || path11.dirname(dir) === dir) {
3552
3494
  cache.set(startDir, ".");
3553
3495
  return ".";
3554
3496
  }
3555
- dir = path12.dirname(dir);
3497
+ dir = path11.dirname(dir);
3556
3498
  }
3557
3499
  }
3558
3500
  function toPosix4(p) {
3559
- return p.split(path12.sep).join("/");
3501
+ return p.split(path11.sep).join("/");
3560
3502
  }
3561
3503
 
3562
3504
  // src/engine/timing.ts
@@ -3648,9 +3590,9 @@ var emptyNode = (partial) => ({
3648
3590
  tested: null
3649
3591
  });
3650
3592
  function extractManifests(root, opts = {}) {
3651
- const absRoot = path12.resolve(root);
3593
+ const absRoot = path11.resolve(root);
3652
3594
  const ig = buildRootIgnore3(absRoot, opts.exclude ?? []);
3653
- const scopes = (opts.paths?.length ? opts.paths : ["."]).map((p) => path12.resolve(absRoot, p)).filter((p) => fs13.existsSync(p));
3595
+ const scopes = (opts.paths?.length ? opts.paths : ["."]).map((p) => path11.resolve(absRoot, p)).filter((p) => fs12.existsSync(p));
3654
3596
  const found = /* @__PURE__ */ new Map();
3655
3597
  for (const scope of scopes) {
3656
3598
  walkManifests(absRoot, scope, ig, found);
@@ -3660,7 +3602,7 @@ function extractManifests(root, opts = {}) {
3660
3602
  let deps = 0;
3661
3603
  for (const rel2 of [...found.keys()].sort()) {
3662
3604
  const abs = found.get(rel2);
3663
- const base = path12.posix.basename(rel2);
3605
+ const base = path11.posix.basename(rel2);
3664
3606
  try {
3665
3607
  if (base === "package.json") {
3666
3608
  deps += ingestPackageJson(rel2, abs, nodes, edges);
@@ -3680,8 +3622,8 @@ function extractManifests(root, opts = {}) {
3680
3622
  };
3681
3623
  }
3682
3624
  function ingestPackageJson(rel2, abs, nodes, edges) {
3683
- const raw = JSON.parse(fs13.readFileSync(abs, "utf8"));
3684
- const pkgName = raw.name && String(raw.name).trim() || path12.posix.dirname(rel2) || ".";
3625
+ const raw = JSON.parse(fs12.readFileSync(abs, "utf8"));
3626
+ const pkgName = raw.name && String(raw.name).trim() || path11.posix.dirname(rel2) || ".";
3685
3627
  const localId = nodeId({ kind: "package", qualifiedName: pkgName, file: rel2 });
3686
3628
  nodes.set(
3687
3629
  localId,
@@ -3700,7 +3642,7 @@ function ingestPackageJson(rel2, abs, nodes, edges) {
3700
3642
  emptyNode({
3701
3643
  id: fileId,
3702
3644
  kind: "file",
3703
- name: path12.posix.basename(rel2),
3645
+ name: path11.posix.basename(rel2),
3704
3646
  qualifiedName: rel2,
3705
3647
  file: rel2,
3706
3648
  lang: "json"
@@ -3724,8 +3666,8 @@ function ingestPackageJson(rel2, abs, nodes, edges) {
3724
3666
  return n;
3725
3667
  }
3726
3668
  function ingestGoMod(rel2, abs, nodes, edges) {
3727
- const text = fs13.readFileSync(abs, "utf8");
3728
- let moduleName = path12.posix.dirname(rel2) || ".";
3669
+ const text = fs12.readFileSync(abs, "utf8");
3670
+ let moduleName = path11.posix.dirname(rel2) || ".";
3729
3671
  const moduleMatch = /^\s*module\s+(\S+)/m.exec(text);
3730
3672
  if (moduleMatch) moduleName = moduleMatch[1];
3731
3673
  const localId = nodeId({ kind: "package", qualifiedName: moduleName, file: rel2 });
@@ -3746,7 +3688,7 @@ function ingestGoMod(rel2, abs, nodes, edges) {
3746
3688
  emptyNode({
3747
3689
  id: fileId,
3748
3690
  kind: "file",
3749
- name: path12.posix.basename(rel2),
3691
+ name: path11.posix.basename(rel2),
3750
3692
  qualifiedName: rel2,
3751
3693
  file: rel2,
3752
3694
  lang: "go"
@@ -3807,10 +3749,10 @@ function addEdge(edges, kind, src, dst, confidence) {
3807
3749
  }
3808
3750
  function buildRootIgnore3(root, exclude) {
3809
3751
  const ig = ignore();
3810
- const gitignorePath = path12.join(root, ".gitignore");
3811
- if (fs13.existsSync(gitignorePath)) {
3752
+ const gitignorePath = path11.join(root, ".gitignore");
3753
+ if (fs12.existsSync(gitignorePath)) {
3812
3754
  try {
3813
- ig.add(fs13.readFileSync(gitignorePath, "utf8"));
3755
+ ig.add(fs12.readFileSync(gitignorePath, "utf8"));
3814
3756
  } catch {
3815
3757
  }
3816
3758
  }
@@ -3820,13 +3762,13 @@ function buildRootIgnore3(root, exclude) {
3820
3762
  function walkManifests(root, dir, ig, found) {
3821
3763
  let entries;
3822
3764
  try {
3823
- entries = fs13.readdirSync(dir, { withFileTypes: true });
3765
+ entries = fs12.readdirSync(dir, { withFileTypes: true });
3824
3766
  } catch {
3825
3767
  return;
3826
3768
  }
3827
3769
  for (const entry of entries) {
3828
- const abs = path12.join(dir, entry.name);
3829
- const rel2 = path12.relative(root, abs).split(path12.sep).join("/");
3770
+ const abs = path11.join(dir, entry.name);
3771
+ const rel2 = path11.relative(root, abs).split(path11.sep).join("/");
3830
3772
  if (entry.isDirectory()) {
3831
3773
  if (isSkippedDirName(entry.name)) continue;
3832
3774
  if (rel2 && ig.ignores(`${rel2}/`)) continue;
@@ -3853,7 +3795,7 @@ async function hashFilesParallel(jobs, concurrency) {
3853
3795
  if (i >= jobs.length) return;
3854
3796
  const job = jobs[i];
3855
3797
  try {
3856
- const buf = await fs10.readFile(job.abs);
3798
+ const buf = await fs9.readFile(job.abs);
3857
3799
  out[i] = { rel: job.rel, hash: hashBytes(buf), ok: true };
3858
3800
  } catch {
3859
3801
  out[i] = { rel: job.rel, hash: "", ok: false };
@@ -3868,7 +3810,7 @@ async function hashFilesParallel(jobs, concurrency) {
3868
3810
  async function buildGraph(options) {
3869
3811
  const timer = new StageTimer();
3870
3812
  timer.start("total");
3871
- const root = path12.resolve(options.root);
3813
+ const root = path11.resolve(options.root);
3872
3814
  timer.start("discover");
3873
3815
  const files = discover({
3874
3816
  root,
@@ -3901,7 +3843,7 @@ async function buildGraph(options) {
3901
3843
  for (const file of files) {
3902
3844
  let stat;
3903
3845
  try {
3904
- stat = fs13.statSync(file.abs);
3846
+ stat = fs12.statSync(file.abs);
3905
3847
  } catch {
3906
3848
  continue;
3907
3849
  }
@@ -4107,8 +4049,8 @@ async function buildGraph(options) {
4107
4049
  });
4108
4050
  for (const d of docs) {
4109
4051
  try {
4110
- const st = fs13.statSync(d.abs);
4111
- const hash = hashBytes(fs13.readFileSync(d.abs));
4052
+ const st = fs12.statSync(d.abs);
4053
+ const hash = hashBytes(fs12.readFileSync(d.abs));
4112
4054
  hashes.set(d.rel, hash);
4113
4055
  fileStats.push({ rel: d.rel, size: st.size, mtimeMs: st.mtimeMs, hash });
4114
4056
  } catch {
@@ -4164,7 +4106,7 @@ async function buildGraph(options) {
4164
4106
  toolchain
4165
4107
  },
4166
4108
  meta: {
4167
- root: path12.basename(root) === "" ? "." : ".",
4109
+ root: path11.basename(root) === "" ? "." : ".",
4168
4110
  languages,
4169
4111
  analysisTier: analysis.tier,
4170
4112
  counts: {
@@ -4214,7 +4156,8 @@ async function buildGraph(options) {
4214
4156
  tsc: tscStats,
4215
4157
  scip: scipStats,
4216
4158
  index: indexResult,
4217
- warnings
4159
+ warnings,
4160
+ fileRoles: fileRolesFromParses(parses)
4218
4161
  };
4219
4162
  }
4220
4163
  function toRepoRel(p) {
@@ -4223,14 +4166,14 @@ function toRepoRel(p) {
4223
4166
  function loadScipIndex(root, explicit) {
4224
4167
  const candidates = [
4225
4168
  explicit,
4226
- path12.join(root, "index.scip"),
4227
- path12.join(root, ".vibgrate", "index.scip")
4169
+ path11.join(root, "index.scip"),
4170
+ path11.join(root, ".vibgrate", "index.scip")
4228
4171
  ].filter((p) => Boolean(p));
4229
4172
  for (const file of candidates) {
4230
- const abs = path12.isAbsolute(file) ? file : path12.resolve(root, file);
4231
- if (!fs13.existsSync(abs)) continue;
4173
+ const abs = path11.isAbsolute(file) ? file : path11.resolve(root, file);
4174
+ if (!fs12.existsSync(abs)) continue;
4232
4175
  try {
4233
- const index = decodeScipIndex(new Uint8Array(fs13.readFileSync(abs)));
4176
+ const index = decodeScipIndex(new Uint8Array(fs12.readFileSync(abs)));
4234
4177
  if (index.documents.length) {
4235
4178
  return { index, tool: index.toolVersion ? `${index.toolName} ${index.toolVersion}` : index.toolName };
4236
4179
  }
@@ -4324,21 +4267,21 @@ function diffHint(x, y) {
4324
4267
  }
4325
4268
  var SNAPSHOT_VERSION = "vg-freshness/1";
4326
4269
  function snapshotPath(root) {
4327
- return path12.join(cacheDir(root), "freshness.json");
4270
+ return path11.join(cacheDir(root), "freshness.json");
4328
4271
  }
4329
4272
  function writeSnapshot(root, corpusHash, fileStats, scope = {}) {
4330
4273
  const files = {};
4331
4274
  for (const f of fileStats) files[f.rel] = { size: f.size, mtimeMs: f.mtimeMs, hash: f.hash };
4332
4275
  const snapshot = { version: SNAPSHOT_VERSION, corpusHash, scope: pruneScope(scope), files };
4333
4276
  try {
4334
- fs13.mkdirSync(cacheDir(root), { recursive: true });
4335
- fs13.writeFileSync(snapshotPath(root), stableStringify(snapshot, 0));
4277
+ fs12.mkdirSync(cacheDir(root), { recursive: true });
4278
+ fs12.writeFileSync(snapshotPath(root), stableStringify(snapshot, 0));
4336
4279
  } catch {
4337
4280
  }
4338
4281
  }
4339
4282
  function loadSnapshot(root) {
4340
4283
  try {
4341
- const loaded = JSON.parse(fs13.readFileSync(snapshotPath(root), "utf8"));
4284
+ const loaded = JSON.parse(fs12.readFileSync(snapshotPath(root), "utf8"));
4342
4285
  if (loaded.version === SNAPSHOT_VERSION && loaded.files && typeof loaded.corpusHash === "string") {
4343
4286
  return { ...loaded, scope: loaded.scope ?? {} };
4344
4287
  }
@@ -4381,7 +4324,7 @@ function probeFreshness(root) {
4381
4324
  }
4382
4325
  let stat;
4383
4326
  try {
4384
- stat = fs13.statSync(file.abs);
4327
+ stat = fs12.statSync(file.abs);
4385
4328
  } catch {
4386
4329
  drift.removed.push(file.rel);
4387
4330
  continue;
@@ -4399,7 +4342,7 @@ function probeFreshness(root) {
4399
4342
  }
4400
4343
  let hash = "";
4401
4344
  try {
4402
- hash = hashBytes(fs13.readFileSync(file.abs));
4345
+ hash = hashBytes(fs12.readFileSync(file.abs));
4403
4346
  } catch {
4404
4347
  drift.removed.push(file.rel);
4405
4348
  continue;
@@ -4416,7 +4359,7 @@ function probeFreshness(root) {
4416
4359
  }
4417
4360
  if (absorbed && !hasDrift(drift)) {
4418
4361
  try {
4419
- fs13.writeFileSync(snapshotPath(root), stableStringify(snapshot, 0));
4362
+ fs12.writeFileSync(snapshotPath(root), stableStringify(snapshot, 0));
4420
4363
  } catch {
4421
4364
  }
4422
4365
  }
@@ -4661,12 +4604,12 @@ function detectAssistants(root, opts = {}) {
4661
4604
  const which = opts.which ?? whichOnPath;
4662
4605
  const found = [];
4663
4606
  for (const assistant of ASSISTANTS) {
4664
- const repoHit = (assistant.markers ?? []).find((m) => fs13.existsSync(path12.join(root, m)));
4607
+ const repoHit = (assistant.markers ?? []).find((m) => fs12.existsSync(path11.join(root, m)));
4665
4608
  if (repoHit) {
4666
4609
  found.push({ assistant, via: "repo", marker: repoHit });
4667
4610
  continue;
4668
4611
  }
4669
- const homeHit = (assistant.homeMarkers ?? []).find((m) => fs13.existsSync(path12.join(home, m)));
4612
+ const homeHit = (assistant.homeMarkers ?? []).find((m) => fs12.existsSync(path11.join(home, m)));
4670
4613
  if (homeHit) {
4671
4614
  found.push({ assistant, via: "home", marker: homeHit });
4672
4615
  continue;
@@ -4698,19 +4641,19 @@ function installAssistant(a, opts) {
4698
4641
  const skipped = [];
4699
4642
  let note;
4700
4643
  if (a.skill) {
4701
- writeFileEnsured(path12.join(opts.root, a.skill), skillMarkdown(a.id));
4644
+ writeFileEnsured(path11.join(opts.root, a.skill), skillMarkdown(a.id));
4702
4645
  wrote.push(a.skill);
4703
4646
  }
4704
4647
  if (a.mcp) {
4705
4648
  const launch = opts.launch ?? detectServeLaunch();
4706
- upsertMcp(path12.join(opts.root, a.mcp.file), a.mcp, launch);
4649
+ upsertMcp(path11.join(opts.root, a.mcp.file), a.mcp, launch);
4707
4650
  wrote.push(a.mcp.file);
4708
4651
  note = launch.note;
4709
4652
  } else {
4710
4653
  skipped.push("mcp (host-specific setup)");
4711
4654
  }
4712
4655
  if (a.nudge && opts.hook !== false) {
4713
- writeNudge(path12.join(opts.root, a.nudge.file), a.nudge, opts.smallRepo, a.id);
4656
+ writeNudge(path11.join(opts.root, a.nudge.file), a.nudge, opts.smallRepo, a.id);
4714
4657
  wrote.push(a.nudge.file);
4715
4658
  } else if (a.nudge) {
4716
4659
  skipped.push("nudge (--no-hook)");
@@ -4720,34 +4663,34 @@ function installAssistant(a, opts) {
4720
4663
  function uninstallAssistant(a, root, purge) {
4721
4664
  const removed = [];
4722
4665
  if (a.mcp) {
4723
- const file = path12.join(root, a.mcp.file);
4666
+ const file = path11.join(root, a.mcp.file);
4724
4667
  if (removeMcp(file, a.mcp)) removed.push(a.mcp.file);
4725
4668
  }
4726
4669
  if (a.nudge) {
4727
- const file = path12.join(root, a.nudge.file);
4670
+ const file = path11.join(root, a.nudge.file);
4728
4671
  if (a.nudge.kind === "block") {
4729
4672
  if (removeBlock(file)) removed.push(a.nudge.file);
4730
- } else if (fs13.existsSync(file)) {
4731
- fs13.rmSync(file);
4673
+ } else if (fs12.existsSync(file)) {
4674
+ fs12.rmSync(file);
4732
4675
  removed.push(a.nudge.file);
4733
4676
  }
4734
4677
  }
4735
4678
  if (purge && a.skill) {
4736
- const file = path12.join(root, a.skill);
4737
- if (fs13.existsSync(file)) {
4738
- fs13.rmSync(file);
4679
+ const file = path11.join(root, a.skill);
4680
+ if (fs12.existsSync(file)) {
4681
+ fs12.rmSync(file);
4739
4682
  removed.push(a.skill);
4740
4683
  }
4741
4684
  }
4742
4685
  return removed;
4743
4686
  }
4744
4687
  function isAssistantInstalled(a, root) {
4745
- if (a.skill && fs13.existsSync(path12.join(root, a.skill))) return true;
4688
+ if (a.skill && fs12.existsSync(path11.join(root, a.skill))) return true;
4746
4689
  if (a.mcp) {
4747
- const file = path12.join(root, a.mcp.file);
4690
+ const file = path11.join(root, a.mcp.file);
4748
4691
  if (a.mcp.format === "toml") {
4749
4692
  if (hasTomlMcp(file, a.mcp)) return true;
4750
- } else if (fs13.existsSync(file)) {
4693
+ } else if (fs12.existsSync(file)) {
4751
4694
  try {
4752
4695
  const config = readJson(file);
4753
4696
  const bag = config[a.mcp.key];
@@ -4757,8 +4700,8 @@ function isAssistantInstalled(a, root) {
4757
4700
  }
4758
4701
  }
4759
4702
  if (a.nudge) {
4760
- const file = path12.join(root, a.nudge.file);
4761
- if (!fs13.existsSync(file)) return false;
4703
+ const file = path11.join(root, a.nudge.file);
4704
+ if (!fs12.existsSync(file)) return false;
4762
4705
  const text = readTextSafe(file);
4763
4706
  if (!text) return false;
4764
4707
  if (a.nudge.kind === "block") return text.includes(NUDGE_BEGIN);
@@ -4767,19 +4710,19 @@ function isAssistantInstalled(a, root) {
4767
4710
  return false;
4768
4711
  }
4769
4712
  function writeFileEnsured(file, content) {
4770
- fs13.mkdirSync(path12.dirname(file), { recursive: true });
4771
- fs13.writeFileSync(file, content);
4713
+ fs12.mkdirSync(path11.dirname(file), { recursive: true });
4714
+ fs12.writeFileSync(file, content);
4772
4715
  }
4773
4716
  function writeNavigationConfig(root) {
4774
4717
  ensureVibgrateGitignore(root);
4775
- const rel2 = path12.join(".vibgrate", "mcp-navigation.json");
4718
+ const rel2 = path11.join(".vibgrate", "mcp-navigation.json");
4776
4719
  const doc = {
4777
4720
  _readme: "Deferred-loading config for agents embedding `vg serve` via the Claude API (defer_loading + tool-search). The hot navigation core stays in context; the rest load on demand \u2014 ~350-450 schema tokens/step vs ~1,881 for the full set. Hosts without defer_loading ignore this and serve the whole (already optimized) tool set. See docs/graph/VG-NAVIGATION-PROFILE.md.",
4778
4721
  hot_core: [...HOT_TOOLS],
4779
4722
  deferred: deferredToolNames(),
4780
4723
  toolset: navigationToolsetConfig()
4781
4724
  };
4782
- writeFileEnsured(path12.join(root, rel2), `${JSON.stringify(doc, null, 2)}
4725
+ writeFileEnsured(path11.join(root, rel2), `${JSON.stringify(doc, null, 2)}
4783
4726
  `);
4784
4727
  return rel2;
4785
4728
  }
@@ -4809,7 +4752,7 @@ function upsertTomlMcp(file, target, launch) {
4809
4752
  command = ${tomlString(entry.command)}
4810
4753
  args = [${entry.args.map(tomlString).join(", ")}]
4811
4754
  `;
4812
- const existing = fs13.existsSync(file) ? fs13.readFileSync(file, "utf8") : "";
4755
+ const existing = fs12.existsSync(file) ? fs12.readFileSync(file, "utf8") : "";
4813
4756
  const re = tomlTableRe(target.key);
4814
4757
  const next = re.test(existing) ? existing.replace(re, (m) => m.startsWith("\n") ? `
4815
4758
  ${table}` : table) : existing.length ? `${existing.replace(/\s*$/, "")}
@@ -4818,7 +4761,7 @@ ${table}` : table;
4818
4761
  writeFileEnsured(file, next);
4819
4762
  }
4820
4763
  function removeTomlMcp(file, target) {
4821
- if (!fs13.existsSync(file)) return false;
4764
+ if (!fs12.existsSync(file)) return false;
4822
4765
  const existing = readTextSafe(file);
4823
4766
  if (existing === null) return false;
4824
4767
  const re = tomlTableRe(target.key);
@@ -4828,13 +4771,13 @@ function removeTomlMcp(file, target) {
4828
4771
  return true;
4829
4772
  }
4830
4773
  function hasTomlMcp(file, target) {
4831
- if (!fs13.existsSync(file)) return false;
4774
+ if (!fs12.existsSync(file)) return false;
4832
4775
  const text = readTextSafe(file);
4833
4776
  return text !== null && tomlTableRe(target.key).test(text);
4834
4777
  }
4835
4778
  function removeMcp(file, target) {
4836
4779
  if (target.format === "toml") return removeTomlMcp(file, target);
4837
- if (!fs13.existsSync(file)) return false;
4780
+ if (!fs12.existsSync(file)) return false;
4838
4781
  const config = readJson(file);
4839
4782
  const bag = config[target.key];
4840
4783
  if (!bag || !(bag.vg !== void 0)) return false;
@@ -4853,8 +4796,8 @@ function refreshInstalledInstructions(root, smallRepo) {
4853
4796
  };
4854
4797
  for (const a of ASSISTANTS) {
4855
4798
  if (a.skill) {
4856
- const file = path12.join(root, a.skill);
4857
- if (fs13.existsSync(file)) {
4799
+ const file = path11.join(root, a.skill);
4800
+ if (fs12.existsSync(file)) {
4858
4801
  const text = readTextSafe(file);
4859
4802
  const from = text === null ? null : staleVersion(text, "# vg \u2014 the code map");
4860
4803
  if (from !== null) {
@@ -4864,8 +4807,8 @@ function refreshInstalledInstructions(root, smallRepo) {
4864
4807
  }
4865
4808
  }
4866
4809
  if (a.nudge) {
4867
- const file = path12.join(root, a.nudge.file);
4868
- if (!fs13.existsSync(file)) continue;
4810
+ const file = path11.join(root, a.nudge.file);
4811
+ if (!fs12.existsSync(file)) continue;
4869
4812
  const text = readTextSafe(file);
4870
4813
  if (text === null) continue;
4871
4814
  if (a.nudge.kind === "block") {
@@ -4889,7 +4832,7 @@ function refreshInstalledInstructions(root, smallRepo) {
4889
4832
  }
4890
4833
  function readTextSafe(file) {
4891
4834
  try {
4892
- return fs13.readFileSync(file, "utf8");
4835
+ return fs12.readFileSync(file, "utf8");
4893
4836
  } catch {
4894
4837
  return null;
4895
4838
  }
@@ -4908,8 +4851,8 @@ ${stripMarkers(nudgeMarkdown(smallRepo, client))}` : stripMarkers(nudgeMarkdown(
4908
4851
  upsertBlock(file, nudgeMarkdown(smallRepo, client));
4909
4852
  }
4910
4853
  function upsertBlock(file, block) {
4911
- fs13.mkdirSync(path12.dirname(file), { recursive: true });
4912
- let existing = fs13.existsSync(file) ? fs13.readFileSync(file, "utf8") : "";
4854
+ fs12.mkdirSync(path11.dirname(file), { recursive: true });
4855
+ let existing = fs12.existsSync(file) ? fs12.readFileSync(file, "utf8") : "";
4913
4856
  const re = new RegExp(`${escapeRe(NUDGE_BEGIN)}[\\s\\S]*?${escapeRe(NUDGE_END)}`);
4914
4857
  if (re.test(existing)) existing = existing.replace(re, block);
4915
4858
  else existing = existing.length ? `${existing.replace(/\s*$/, "")}
@@ -4917,20 +4860,20 @@ function upsertBlock(file, block) {
4917
4860
  ${block}
4918
4861
  ` : `${block}
4919
4862
  `;
4920
- fs13.writeFileSync(file, existing);
4863
+ fs12.writeFileSync(file, existing);
4921
4864
  }
4922
4865
  function removeBlock(file) {
4923
- if (!fs13.existsSync(file)) return false;
4924
- const existing = fs13.readFileSync(file, "utf8");
4866
+ if (!fs12.existsSync(file)) return false;
4867
+ const existing = fs12.readFileSync(file, "utf8");
4925
4868
  const re = new RegExp(`\\n*${escapeRe(NUDGE_BEGIN)}[\\s\\S]*?${escapeRe(NUDGE_END)}\\n*`);
4926
4869
  if (!re.test(existing)) return false;
4927
- fs13.writeFileSync(file, existing.replace(re, "\n"));
4870
+ fs12.writeFileSync(file, existing.replace(re, "\n"));
4928
4871
  return true;
4929
4872
  }
4930
4873
  function readJson(file) {
4931
- if (!fs13.existsSync(file)) return {};
4874
+ if (!fs12.existsSync(file)) return {};
4932
4875
  try {
4933
- const parsed = JSON.parse(fs13.readFileSync(file, "utf8"));
4876
+ const parsed = JSON.parse(fs12.readFileSync(file, "utf8"));
4934
4877
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
4935
4878
  return parsed;
4936
4879
  }
@@ -4949,6 +4892,6 @@ function escapeRe(s) {
4949
4892
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4950
4893
  }
4951
4894
 
4952
- export { ASSISTANTS, ResourceLimitError, SKIP_DIRS, SKIP_FILES, SMALL_REPO_FILES, TOOLCHAIN_GRAMMARS, UsageError, analyze, applyCoverage, assistantById, buildFacts, buildGraph, decodeScipIndex, detectAssistants, detectServeLaunch, discover, driftCount, epistemicBreakdown, groundGraph, hasDrift, installAssistant, isAssistantInstalled, isSkippedDirName, loadCoverage, loadSnapshot, probeFreshness, refreshInstalledInstructions, resolveLimits, resolveToolchainGrammar, scipEdges, uninstallAssistant, verifyDeterminism, versionMarker, writeNavigationConfig, writeSnapshot };
4953
- //# sourceMappingURL=chunk-RJCRWQNS.js.map
4954
- //# sourceMappingURL=chunk-RJCRWQNS.js.map
4895
+ export { ASSISTANTS, ResourceLimitError, SKIP_DIRS, SKIP_FILES, SMALL_REPO_FILES, UsageError, analyze, applyCoverage, assistantById, buildFacts, buildGraph, decodeScipIndex, detectAssistants, detectServeLaunch, discover, driftCount, epistemicBreakdown, groundGraph, hasDrift, installAssistant, isAssistantInstalled, isSkippedDirName, loadCoverage, loadSnapshot, probeFreshness, refreshInstalledInstructions, resolveLimits, scipEdges, uninstallAssistant, verifyDeterminism, versionMarker, writeNavigationConfig, writeSnapshot };
4896
+ //# sourceMappingURL=chunk-E2FAQREZ.js.map
4897
+ //# sourceMappingURL=chunk-E2FAQREZ.js.map