@vibgrate/cli 2026.817.2 → 2026.818.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 (153) hide show
  1. package/dist/activity-MF2GNYAI.js +5 -0
  2. package/dist/activity-MF2GNYAI.js.map +1 -0
  3. package/dist/agent-X6VYCE63.js +30 -0
  4. package/dist/{agent-UQC7QN77.js.map → agent-X6VYCE63.js.map} +1 -1
  5. package/dist/{approvals-ASPJQUZK.js → approvals-TPQFQSWG.js} +5 -5
  6. package/dist/{approvals-ASPJQUZK.js.map → approvals-TPQFQSWG.js.map} +1 -1
  7. package/dist/attach-G5JUIWIT.js +10 -0
  8. package/dist/attach-G5JUIWIT.js.map +1 -0
  9. package/dist/baseline-DXI64VLW.js +9 -0
  10. package/dist/{baseline-FIV6PR2M.js.map → baseline-DXI64VLW.js.map} +1 -1
  11. package/dist/{chunk-AXZZ5CCG.js → chunk-2C33WR5O.js} +38 -19
  12. package/dist/chunk-2C33WR5O.js.map +1 -0
  13. package/dist/chunk-4NTNMT6T.js +6 -0
  14. package/dist/{chunk-PRG2ULPK.js.map → chunk-4NTNMT6T.js.map} +1 -1
  15. package/dist/chunk-5IQBIXHS.js +23 -0
  16. package/dist/chunk-5IQBIXHS.js.map +1 -0
  17. package/dist/{chunk-6K3XK7C5.js → chunk-6ABMV74F.js} +6 -3
  18. package/dist/chunk-6ABMV74F.js.map +1 -0
  19. package/dist/chunk-6BEBJCK4.js +467 -0
  20. package/dist/chunk-6BEBJCK4.js.map +1 -0
  21. package/dist/{chunk-E2FAQREZ.js → chunk-6PFHDHOL.js} +174 -401
  22. package/dist/chunk-6PFHDHOL.js.map +1 -0
  23. package/dist/chunk-6WRG7VDO.js +118 -0
  24. package/dist/chunk-6WRG7VDO.js.map +1 -0
  25. package/dist/{chunk-3NJUOIZQ.js → chunk-AEJYA6HZ.js} +5 -5
  26. package/dist/{chunk-3NJUOIZQ.js.map → chunk-AEJYA6HZ.js.map} +1 -1
  27. package/dist/{chunk-O2DL2Q55.js → chunk-B4EXD5LK.js} +5 -5
  28. package/dist/{chunk-O2DL2Q55.js.map → chunk-B4EXD5LK.js.map} +1 -1
  29. package/dist/{chunk-EXV4QSAD.js → chunk-BMOFJIMG.js} +3 -3
  30. package/dist/{chunk-EXV4QSAD.js.map → chunk-BMOFJIMG.js.map} +1 -1
  31. package/dist/chunk-DBX3DL27.js +26 -0
  32. package/dist/chunk-DBX3DL27.js.map +1 -0
  33. package/dist/{chunk-KNGAZDGF.js → chunk-E3O5UKNA.js} +151 -42
  34. package/dist/chunk-E3O5UKNA.js.map +1 -0
  35. package/dist/{chunk-RBIRXQR6.js → chunk-E53WBVUQ.js} +7 -14
  36. package/dist/chunk-E53WBVUQ.js.map +1 -0
  37. package/dist/{chunk-C3LMWZKF.js → chunk-FFXGWFAE.js} +4 -4
  38. package/dist/{chunk-C3LMWZKF.js.map → chunk-FFXGWFAE.js.map} +1 -1
  39. package/dist/chunk-H5Q4JUY4.js +47 -0
  40. package/dist/chunk-H5Q4JUY4.js.map +1 -0
  41. package/dist/{chunk-LHKQGVRF.js → chunk-HF6R73UC.js} +100 -11
  42. package/dist/chunk-HF6R73UC.js.map +1 -0
  43. package/dist/{chunk-K6DXETMC.js → chunk-JGA63RGF.js} +13 -12
  44. package/dist/chunk-JGA63RGF.js.map +1 -0
  45. package/dist/{chunk-3FMRFECC.js → chunk-KU7FI5EV.js} +3 -3
  46. package/dist/{chunk-3FMRFECC.js.map → chunk-KU7FI5EV.js.map} +1 -1
  47. package/dist/{chunk-5OL2TSHK.js → chunk-L2OS4WHT.js} +4 -4
  48. package/dist/{chunk-5OL2TSHK.js.map → chunk-L2OS4WHT.js.map} +1 -1
  49. package/dist/chunk-LJSJX6U4.js +38 -0
  50. package/dist/chunk-LJSJX6U4.js.map +1 -0
  51. package/dist/{chunk-Q4G2BWE3.js → chunk-MRZHNUN7.js} +12 -6
  52. package/dist/chunk-MRZHNUN7.js.map +1 -0
  53. package/dist/chunk-NDNNOAS6.js +16 -0
  54. package/dist/chunk-NDNNOAS6.js.map +1 -0
  55. package/dist/chunk-NJQZRM55.js +100 -0
  56. package/dist/chunk-NJQZRM55.js.map +1 -0
  57. package/dist/{chunk-DVW3SVCW.js → chunk-NKLYDSB7.js} +29 -9
  58. package/dist/chunk-NKLYDSB7.js.map +1 -0
  59. package/dist/{chunk-TVDMNIUT.js → chunk-O5IJDMTB.js} +4 -4
  60. package/dist/{chunk-TVDMNIUT.js.map → chunk-O5IJDMTB.js.map} +1 -1
  61. package/dist/chunk-POOL355F.js +237 -0
  62. package/dist/chunk-POOL355F.js.map +1 -0
  63. package/dist/{chunk-XLXJC7H3.js → chunk-PRHH4DVO.js} +5 -118
  64. package/dist/chunk-PRHH4DVO.js.map +1 -0
  65. package/dist/{chunk-3H3SVJUY.js → chunk-RHKOUPWT.js} +107 -542
  66. package/dist/chunk-RHKOUPWT.js.map +1 -0
  67. package/dist/{chunk-WAKP7SK7.js → chunk-V2UGRUTL.js} +225 -48
  68. package/dist/chunk-V2UGRUTL.js.map +1 -0
  69. package/dist/{chunk-2FEB5KJS.js → chunk-V6WONSIK.js} +5 -4
  70. package/dist/chunk-V6WONSIK.js.map +1 -0
  71. package/dist/{chunk-WVMOGIPC.js → chunk-VMAIDM4K.js} +3 -3
  72. package/dist/{chunk-WVMOGIPC.js.map → chunk-VMAIDM4K.js.map} +1 -1
  73. package/dist/{chunk-GOGMS3ST.js → chunk-VQ5KMHW6.js} +860 -65
  74. package/dist/chunk-VQ5KMHW6.js.map +1 -0
  75. package/dist/{chunk-M7IO3DXH.js → chunk-X2MQ7UFL.js} +250 -30
  76. package/dist/chunk-X2MQ7UFL.js.map +1 -0
  77. package/dist/{chunk-OZ3IFXRD.js → chunk-YENM3HT7.js} +5 -4
  78. package/dist/chunk-YENM3HT7.js.map +1 -0
  79. package/dist/{chunk-KJT2R6WW.js → chunk-YF54UMOU.js} +3 -3
  80. package/dist/{chunk-KJT2R6WW.js.map → chunk-YF54UMOU.js.map} +1 -1
  81. package/dist/{chunk-Q3M6K3HY.js → chunk-ZUOBPKVK.js} +3 -3
  82. package/dist/{chunk-Q3M6K3HY.js.map → chunk-ZUOBPKVK.js.map} +1 -1
  83. package/dist/cli.d.ts +6 -0
  84. package/dist/cli.js +711 -463
  85. package/dist/cli.js.map +1 -1
  86. package/dist/client-UQIELEEZ.js +8 -0
  87. package/dist/client-UQIELEEZ.js.map +1 -0
  88. package/dist/daemon-GUMWMKCA.js +31 -0
  89. package/dist/{daemon-FPTRHO5N.js.map → daemon-GUMWMKCA.js.map} +1 -1
  90. package/dist/embed-worker-main.js +3 -3
  91. package/dist/ensure-map-FHDJTO7Y.js +41 -0
  92. package/dist/{ensure-map-342G2IV3.js.map → ensure-map-FHDJTO7Y.js.map} +1 -1
  93. package/dist/graph-backend-W2D3HRRD.js +16 -0
  94. package/dist/{graph-backend-RNWQBT3P.js.map → graph-backend-W2D3HRRD.js.map} +1 -1
  95. package/dist/index.d.ts +633 -4
  96. package/dist/index.js +26 -17
  97. package/dist/index.js.map +1 -1
  98. package/dist/{interactive-SR7TMF6M.js → interactive-2MK4TLRD.js} +42 -34
  99. package/dist/interactive-2MK4TLRD.js.map +1 -0
  100. package/dist/load-4R4HYMBB.js +11 -0
  101. package/dist/{load-AYFECIQB.js.map → load-4R4HYMBB.js.map} +1 -1
  102. package/dist/parse-worker.js +3 -2
  103. package/dist/parse-worker.js.map +1 -1
  104. package/dist/publish-7YHRTBRA.js +9 -0
  105. package/dist/publish-7YHRTBRA.js.map +1 -0
  106. package/dist/{run-outcome-YQQJG3LW.js → run-outcome-H5GVDDZJ.js} +5 -5
  107. package/dist/{run-outcome-YQQJG3LW.js.map → run-outcome-H5GVDDZJ.js.map} +1 -1
  108. package/dist/runtime-session-JBIHHH5N.js +27 -0
  109. package/dist/{runtime-session-CNJ4DAV5.js.map → runtime-session-JBIHHH5N.js.map} +1 -1
  110. package/dist/semantic-status-2JFLIQQJ.js +4 -0
  111. package/dist/semantic-status-2JFLIQQJ.js.map +1 -0
  112. package/dist/{session-H34HUV2Y.js → session-N5IU4K5Q.js} +8 -8
  113. package/dist/{session-H34HUV2Y.js.map → session-N5IU4K5Q.js.map} +1 -1
  114. package/dist/slot-subscription-25GOARW5.js +95 -0
  115. package/dist/slot-subscription-25GOARW5.js.map +1 -0
  116. package/dist/{stream-json-55YDNAFX.js → stream-json-4WLSUF6I.js} +18 -15
  117. package/dist/stream-json-4WLSUF6I.js.map +1 -0
  118. package/dist/version-DTEU3SQD.js +4 -0
  119. package/dist/{version-WSE3QOPK.js.map → version-DTEU3SQD.js.map} +1 -1
  120. package/dist/{vg-mcp-bridge-2CNLHNEL.js → vg-mcp-bridge-KDVYIMFX.js} +12 -11
  121. package/dist/vg-mcp-bridge-KDVYIMFX.js.map +1 -0
  122. package/dist/{vgd-URUZQORN.js → vgd-M7UOPWLB.js} +15 -10
  123. package/dist/vgd-M7UOPWLB.js.map +1 -0
  124. package/package.json +1 -1
  125. package/dist/agent-UQC7QN77.js +0 -27
  126. package/dist/baseline-FIV6PR2M.js +0 -9
  127. package/dist/chunk-2FEB5KJS.js.map +0 -1
  128. package/dist/chunk-3H3SVJUY.js.map +0 -1
  129. package/dist/chunk-6K3XK7C5.js.map +0 -1
  130. package/dist/chunk-AXZZ5CCG.js.map +0 -1
  131. package/dist/chunk-DVW3SVCW.js.map +0 -1
  132. package/dist/chunk-E2FAQREZ.js.map +0 -1
  133. package/dist/chunk-GOGMS3ST.js.map +0 -1
  134. package/dist/chunk-K6DXETMC.js.map +0 -1
  135. package/dist/chunk-KNGAZDGF.js.map +0 -1
  136. package/dist/chunk-LHKQGVRF.js.map +0 -1
  137. package/dist/chunk-M7IO3DXH.js.map +0 -1
  138. package/dist/chunk-OZ3IFXRD.js.map +0 -1
  139. package/dist/chunk-PRG2ULPK.js +0 -6
  140. package/dist/chunk-Q4G2BWE3.js.map +0 -1
  141. package/dist/chunk-RBIRXQR6.js.map +0 -1
  142. package/dist/chunk-WAKP7SK7.js.map +0 -1
  143. package/dist/chunk-XLXJC7H3.js.map +0 -1
  144. package/dist/daemon-FPTRHO5N.js +0 -26
  145. package/dist/ensure-map-342G2IV3.js +0 -33
  146. package/dist/graph-backend-RNWQBT3P.js +0 -15
  147. package/dist/interactive-SR7TMF6M.js.map +0 -1
  148. package/dist/load-AYFECIQB.js +0 -11
  149. package/dist/runtime-session-CNJ4DAV5.js +0 -22
  150. package/dist/stream-json-55YDNAFX.js.map +0 -1
  151. package/dist/version-WSE3QOPK.js +0 -4
  152. package/dist/vg-mcp-bridge-2CNLHNEL.js.map +0 -1
  153. package/dist/vgd-URUZQORN.js.map +0 -1
@@ -1,474 +1,16 @@
1
+ import { inventory, installedTreeVersion } from './chunk-6BEBJCK4.js';
1
2
  import { findNodes } from './chunk-J7LKEB2R.js';
2
- import { extractLiteralNeedles, residualForSymbolSearch } from './chunk-Q4G2BWE3.js';
3
+ import { extractLiteralNeedles, residualForSymbolSearch } from './chunk-MRZHNUN7.js';
3
4
  import { stableStringify } from './chunk-O3LABX6I.js';
4
5
  import { hashString } from './chunk-JFGYT6BI.js';
5
- import * as fs3 from 'fs';
6
- import * as path3 from 'path';
6
+ import * as fs2 from 'fs';
7
7
  import * as os from 'os';
8
+ import * as path2 from 'path';
8
9
  import { execFileSync, spawnSync } from 'child_process';
9
10
  import { Worker } from 'worker_threads';
10
11
 
11
- var ECOSYSTEMS = ["npm", "pypi", "go", "rust", "ruby", "php", "dotnet", "swift", "dart", "java"];
12
- function inventory(root) {
13
- const manifests = findManifests(root);
14
- const records = [];
15
- records.push(...npmDeps(manifests.npm, root));
16
- records.push(...pypiDeps(manifests.pypi));
17
- records.push(...goDeps(manifests.go));
18
- records.push(...cargoDeps(manifests.rust));
19
- records.push(...rubyDeps(manifests.ruby));
20
- records.push(...phpDeps(manifests.php));
21
- records.push(...dotnetDeps(manifests.dotnet));
22
- records.push(...swiftDeps(manifests.swift));
23
- records.push(...dartDeps(manifests.dart));
24
- records.push(...javaDeps(manifests.java));
25
- const seen = /* @__PURE__ */ new Set();
26
- const deduped = records.filter((r) => {
27
- const key = `${r.ecosystem}\0${r.name}`;
28
- if (seen.has(key)) return false;
29
- seen.add(key);
30
- return true;
31
- });
32
- deduped.sort((a, b) => a.ecosystem.localeCompare(b.ecosystem) || a.name.localeCompare(b.name));
33
- const counts = { total: deduped.length };
34
- for (const e of ECOSYSTEMS) counts[e] = 0;
35
- for (const r of deduped) counts[r.ecosystem]++;
36
- return { records: deduped, counts };
37
- }
38
- var SKIP_DIRS = /* @__PURE__ */ new Set([
39
- "node_modules",
40
- ".git",
41
- "dist",
42
- "build",
43
- "out",
44
- ".vibgrate",
45
- "vendor",
46
- ".venv",
47
- "venv",
48
- "env",
49
- "__pycache__",
50
- "target",
51
- ".next",
52
- ".nuxt",
53
- "coverage",
54
- ".cache"
55
- ]);
56
- var MANIFEST_BY_FILE = {
57
- "package.json": "npm",
58
- "requirements.txt": "pypi",
59
- "pyproject.toml": "pypi",
60
- "go.mod": "go",
61
- "Cargo.toml": "rust",
62
- Gemfile: "ruby",
63
- "composer.json": "php",
64
- "Package.swift": "swift",
65
- "pubspec.yaml": "dart",
66
- "pom.xml": "java",
67
- "build.gradle": "java",
68
- "build.gradle.kts": "java"
69
- };
70
- function findManifests(root) {
71
- const set = Object.fromEntries(ECOSYSTEMS.map((e) => [e, []]));
72
- const MAX_ENTRIES = 2e4;
73
- let scanned = 0;
74
- const walk = (dir, depth) => {
75
- if (depth > 8 || scanned > MAX_ENTRIES) return;
76
- let entries;
77
- try {
78
- entries = fs3.readdirSync(dir, { withFileTypes: true });
79
- } catch {
80
- return;
81
- }
82
- for (const e of entries) {
83
- scanned++;
84
- if (scanned > MAX_ENTRIES) break;
85
- if (e.isDirectory()) {
86
- if (!SKIP_DIRS.has(e.name) && !e.name.startsWith(".")) walk(path3.join(dir, e.name), depth + 1);
87
- continue;
88
- }
89
- const eco = MANIFEST_BY_FILE[e.name] ?? (/\.(cs|fs)proj$/i.test(e.name) ? "dotnet" : void 0);
90
- if (eco) set[eco].push(path3.join(dir, e.name));
91
- }
92
- };
93
- walk(root, 0);
94
- for (const e of ECOSYSTEMS) set[e].sort();
95
- return set;
96
- }
97
- function npmDeps(files, root) {
98
- const out = [];
99
- for (const file of files) {
100
- let pkg;
101
- try {
102
- pkg = JSON.parse(fs3.readFileSync(file, "utf8"));
103
- } catch {
104
- continue;
105
- }
106
- const dir = path3.dirname(file);
107
- const all = { ...pkg.dependencies, ...pkg.devDependencies };
108
- for (const [name, declared] of Object.entries(all)) {
109
- out.push({ name, ecosystem: "npm", declared, installed: installedNpmVersion(dir, name, root) });
110
- }
111
- }
112
- return out;
113
- }
114
- function installedNpmVersion(dir, name, root) {
115
- const rootResolved = path3.resolve(root);
116
- let cur = path3.resolve(dir);
117
- for (let i = 0; i < 12; i++) {
118
- const p = path3.join(cur, "node_modules", name, "package.json");
119
- try {
120
- return JSON.parse(fs3.readFileSync(p, "utf8")).version;
121
- } catch {
122
- }
123
- if (cur === rootResolved) break;
124
- const parent = path3.dirname(cur);
125
- if (parent === cur) break;
126
- cur = parent;
127
- }
128
- return void 0;
129
- }
130
- function installedTreeVersion(root, ecosystem, name) {
131
- if (ecosystem === "pypi") return installedPypiVersion(root, name);
132
- if (ecosystem === "php") return installedPhpVersion(root, name);
133
- return void 0;
134
- }
135
- function normalizePep503(name) {
136
- return name.trim().toLowerCase().replace(/[-_.]+/g, "-");
137
- }
138
- function sitePackagesDirs(base) {
139
- const out = [];
140
- try {
141
- for (const d of fs3.readdirSync(path3.join(base, "lib"))) {
142
- if (d.startsWith("python")) out.push(path3.join(base, "lib", d, "site-packages"));
143
- }
144
- } catch {
145
- }
146
- out.push(path3.join(base, "Lib", "site-packages"));
147
- return out;
148
- }
149
- function installedPypiVersion(root, name) {
150
- const target = normalizePep503(name);
151
- for (const venv of [".venv", "venv", "env", ".tox"]) {
152
- for (const sp of sitePackagesDirs(path3.join(root, venv))) {
153
- let entries;
154
- try {
155
- entries = fs3.readdirSync(sp);
156
- } catch {
157
- continue;
158
- }
159
- for (const entry of entries) {
160
- const m = /^(.+?)-(\d[^-]*)\.dist-info$/.exec(entry);
161
- if (m && normalizePep503(m[1]) === target) return m[2];
162
- }
163
- }
164
- }
165
- return void 0;
166
- }
167
- function installedPhpVersion(root, name) {
168
- let data;
169
- try {
170
- data = JSON.parse(fs3.readFileSync(path3.join(root, "vendor", "composer", "installed.json"), "utf8"));
171
- } catch {
172
- return void 0;
173
- }
174
- const pkgs = Array.isArray(data) ? data : data.packages;
175
- if (!Array.isArray(pkgs)) return void 0;
176
- const p = pkgs.find((x) => x && typeof x === "object" && x.name === name);
177
- return typeof p?.version === "string" ? p.version.replace(/^v/, "") : void 0;
178
- }
179
- function pypiDeps(files) {
180
- const byName = /* @__PURE__ */ new Map();
181
- const add = (name, declared) => {
182
- const clean = name.trim().replace(/\[.*\]$/, "");
183
- if (!clean || clean.toLowerCase() === "python") return;
184
- if (!byName.has(clean)) byName.set(clean, { name: clean, ecosystem: "pypi", declared: declared.trim() || "*" });
185
- };
186
- for (const file of files) {
187
- let text;
188
- try {
189
- text = fs3.readFileSync(file, "utf8");
190
- } catch {
191
- continue;
192
- }
193
- if (path3.basename(file) === "requirements.txt") {
194
- for (const line of text.split("\n")) {
195
- const t = line.trim();
196
- if (!t || t.startsWith("#") || t.startsWith("-")) continue;
197
- const m = /^([A-Za-z0-9._-]+(?:\[[^\]]*\])?)\s*([<>=!~).*]+.*)?$/.exec(t);
198
- if (m) add(m[1], m[2] ?? "*");
199
- }
200
- } else {
201
- for (const dep of pep621Dependencies(text)) {
202
- const m = /^([A-Za-z0-9._-]+(?:\[[^\]]*\])?)\s*(.*)$/.exec(dep.trim());
203
- if (m) add(m[1], m[2] ?? "*");
204
- }
205
- for (const [name, spec] of poetryDependencies(text)) add(name, spec);
206
- }
207
- }
208
- return [...byName.values()];
209
- }
210
- function pep621Dependencies(text) {
211
- const section = sectionBody(text, "project");
212
- if (!section) return [];
213
- const start = /dependencies\s*=\s*\[/.exec(section);
214
- if (!start) return [];
215
- let depth = 0;
216
- let inStr = false;
217
- let strCh = "";
218
- const out = [];
219
- let cur = "";
220
- for (let i = start.index + start[0].length - 1; i < section.length; i++) {
221
- const ch = section[i];
222
- if (inStr) {
223
- if (ch === strCh) {
224
- out.push(cur);
225
- inStr = false;
226
- } else cur += ch;
227
- continue;
228
- }
229
- if (ch === '"' || ch === "'") {
230
- inStr = true;
231
- strCh = ch;
232
- cur = "";
233
- } else if (ch === "[") depth++;
234
- else if (ch === "]") {
235
- depth--;
236
- if (depth === 0) break;
237
- }
238
- }
239
- return out;
240
- }
241
- function poetryDependencies(text) {
242
- const out = [];
243
- const lines = text.split("\n");
244
- let inDeps = false;
245
- for (const raw of lines) {
246
- const line = raw.trim();
247
- if (line.startsWith("[")) {
248
- inDeps = /^\[tool\.poetry(\.group\.[^.\]]+)?\.dependencies\]$/.test(line);
249
- continue;
250
- }
251
- if (!inDeps || !line || line.startsWith("#")) continue;
252
- const m = /^([A-Za-z0-9._-]+)\s*=\s*["']([^"']*)["']/.exec(line);
253
- if (m) out.push([m[1], m[2] || "*"]);
254
- }
255
- return out;
256
- }
257
- function sectionBody(text, name) {
258
- const lines = text.split("\n");
259
- let capturing = false;
260
- const body = [];
261
- for (const raw of lines) {
262
- const line = raw.trim();
263
- if (/^\[/.test(line)) {
264
- if (capturing) break;
265
- capturing = line === `[${name}]`;
266
- continue;
267
- }
268
- if (capturing) body.push(raw);
269
- }
270
- return capturing || body.length ? body.join("\n") : null;
271
- }
272
- function goDeps(files) {
273
- const out = [];
274
- for (const mod of files) {
275
- let text;
276
- try {
277
- text = fs3.readFileSync(mod, "utf8");
278
- } catch {
279
- continue;
280
- }
281
- const re = /^\s*(?:require\s+)?([\w./-]+)\s+v(\S+)/gm;
282
- let m;
283
- while (m = re.exec(text)) {
284
- if (m[1] === "go" || m[1] === "require" || m[1].startsWith("module")) continue;
285
- out.push({ name: m[1], ecosystem: "go", declared: `v${m[2]}` });
286
- }
287
- }
288
- return out;
289
- }
290
- function cargoDeps(files) {
291
- const out = [];
292
- for (const file of files) {
293
- let text;
294
- try {
295
- text = fs3.readFileSync(file, "utf8");
296
- } catch {
297
- continue;
298
- }
299
- for (const table of ["dependencies", "dev-dependencies", "build-dependencies"]) {
300
- const body = sectionBody(text, table);
301
- if (!body) continue;
302
- for (const raw of body.split("\n")) {
303
- const line = raw.trim();
304
- if (!line || line.startsWith("#")) continue;
305
- const m = /^([A-Za-z0-9._-]+)\s*=\s*(.+)$/.exec(line);
306
- if (!m) continue;
307
- const rhs = m[2].trim();
308
- let declared = "*";
309
- if (rhs.startsWith('"')) {
310
- const sm = /^"([^"]+)"/.exec(rhs);
311
- if (sm) declared = sm[1];
312
- } else if (rhs.startsWith("{")) {
313
- const vm = /version\s*=\s*"([^"]+)"/.exec(rhs);
314
- if (vm) declared = vm[1];
315
- }
316
- out.push({ name: m[1], ecosystem: "rust", declared });
317
- }
318
- }
319
- }
320
- return out;
321
- }
322
- function rubyDeps(files) {
323
- const out = [];
324
- for (const file of files) {
325
- let text;
326
- try {
327
- text = fs3.readFileSync(file, "utf8");
328
- } catch {
329
- continue;
330
- }
331
- const re = /^\s*gem\s+["']([^"']+)["']\s*(?:,\s*["']([^"']+)["'])?/gm;
332
- let m;
333
- while (m = re.exec(text)) out.push({ name: m[1], ecosystem: "ruby", declared: m[2] ?? "*" });
334
- }
335
- return out;
336
- }
337
- function phpDeps(files) {
338
- const out = [];
339
- for (const file of files) {
340
- let pkg;
341
- try {
342
- pkg = JSON.parse(fs3.readFileSync(file, "utf8"));
343
- } catch {
344
- continue;
345
- }
346
- const all = { ...pkg.require, ...pkg["require-dev"] };
347
- for (const [name, declared] of Object.entries(all)) {
348
- if (!name.includes("/")) continue;
349
- out.push({ name, ecosystem: "php", declared });
350
- }
351
- }
352
- return out;
353
- }
354
- function dotnetDeps(files) {
355
- const out = [];
356
- for (const file of files) {
357
- let text;
358
- try {
359
- text = fs3.readFileSync(file, "utf8");
360
- } catch {
361
- continue;
362
- }
363
- const tagRe = /<PackageReference\b[^>]*>/gi;
364
- let m;
365
- while (m = tagRe.exec(text)) {
366
- const inc = /Include\s*=\s*"([^"]+)"/i.exec(m[0]);
367
- if (!inc) continue;
368
- const ver = /Version\s*=\s*"([^"]+)"/i.exec(m[0]);
369
- out.push({ name: inc[1], ecosystem: "dotnet", declared: ver?.[1] ?? "*" });
370
- }
371
- }
372
- return out;
373
- }
374
- function swiftDeps(files) {
375
- const out = [];
376
- for (const file of files) {
377
- let text;
378
- try {
379
- text = fs3.readFileSync(file, "utf8");
380
- } catch {
381
- continue;
382
- }
383
- const re = /\.package\(/g;
384
- let m;
385
- while (m = re.exec(text)) {
386
- const win = text.slice(m.index, m.index + 200);
387
- const urlM = /url:\s*"([^"]+)"/.exec(win);
388
- if (!urlM) continue;
389
- const name = (urlM[1].replace(/\.git$/, "").split("/").filter(Boolean).pop() ?? urlM[1]).toLowerCase();
390
- const verM = /"(\d+\.\d+(?:\.\d+)?)"/.exec(win.slice(urlM.index + urlM[0].length));
391
- out.push({ name, ecosystem: "swift", declared: verM?.[1] ?? "*" });
392
- }
393
- }
394
- return out;
395
- }
396
- function dartDeps(files) {
397
- const out = [];
398
- for (const file of files) {
399
- let text;
400
- try {
401
- text = fs3.readFileSync(file, "utf8");
402
- } catch {
403
- continue;
404
- }
405
- let section = "";
406
- for (const raw of text.split("\n")) {
407
- const top = /^([a-z_]+):\s*$/.exec(raw);
408
- if (top) {
409
- section = top[1];
410
- continue;
411
- }
412
- if (section !== "dependencies" && section !== "dev_dependencies") continue;
413
- const m = /^ ([A-Za-z0-9_.]+):\s*(\S.*)?$/.exec(raw);
414
- if (!m || m[1] === "flutter" || m[1] === "sdk") continue;
415
- const declared = (m[2] ?? "").replace(/^["']|["']$/g, "").trim() || "*";
416
- out.push({ name: m[1], ecosystem: "dart", declared });
417
- }
418
- }
419
- return out;
420
- }
421
- function javaDeps(files) {
422
- const out = [];
423
- for (const file of files) {
424
- let text;
425
- try {
426
- text = fs3.readFileSync(file, "utf8");
427
- } catch {
428
- continue;
429
- }
430
- if (path3.basename(file) === "pom.xml") {
431
- for (const block of text.match(/<dependency>[\s\S]*?<\/dependency>/g) ?? []) {
432
- const g = /<groupId>([^<]+)<\/groupId>/.exec(block);
433
- const a = /<artifactId>([^<]+)<\/artifactId>/.exec(block);
434
- if (!g || !a) continue;
435
- const v = /<version>([^<]+)<\/version>/.exec(block);
436
- const declared = v ? v[1].trim().startsWith("${") ? "*" : v[1].trim() : "*";
437
- out.push({ name: `${g[1].trim()}:${a[1].trim()}`, ecosystem: "java", declared });
438
- }
439
- } else {
440
- const re = /(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor)\s*[(]?\s*["']([\w.-]+):([\w.-]+):([^"']+)["']/g;
441
- let m;
442
- while (m = re.exec(text)) out.push({ name: `${m[1]}:${m[2]}`, ecosystem: "java", declared: m[3] });
443
- }
444
- }
445
- return out;
446
- }
447
- async function enrichOnline(records, fetchImpl = globalThis.fetch) {
448
- for (const r of records) {
449
- if (r.ecosystem !== "npm" || !r.installed) continue;
450
- try {
451
- const res = await fetchImpl(`https://registry.npmjs.org/${encodeURIComponent(r.name)}/latest`);
452
- if (!res.ok) continue;
453
- const data = await res.json();
454
- r.latest = data.version;
455
- r.drift = classify(r.installed, r.latest);
456
- } catch {
457
- r.drift = "unknown";
458
- }
459
- }
460
- }
461
- function classify(installed, latest) {
462
- if (!latest) return "unknown";
463
- const a = installed.split(".").map(Number);
464
- const b = latest.split(".").map(Number);
465
- if (a[0] !== b[0]) return "major";
466
- if (a[1] !== b[1]) return "minor";
467
- if (a[2] !== b[2]) return "patch";
468
- return "current";
469
- }
470
12
  function lockfileVersion(root, ecosystem, name) {
471
- if (ecosystem === "npm") return packageLockVersion(root, name) ?? yarnLockVersion(root, name);
13
+ if (ecosystem === "npm") return packageLockVersion(root, name) ?? pnpmLockVersion(root, name) ?? yarnLockVersion(root, name);
472
14
  if (ecosystem === "pypi") return pypiLockVersion(root, name);
473
15
  if (ecosystem === "rust") return tomlPackageLock(root, "Cargo.lock", name, rustName);
474
16
  if (ecosystem === "ruby") return gemfileLock(root, name);
@@ -482,7 +24,7 @@ function lockfileVersion(root, ecosystem, name) {
482
24
  function gradleLock(root, name) {
483
25
  let text;
484
26
  try {
485
- text = fs3.readFileSync(path3.join(root, "gradle.lockfile"), "utf8");
27
+ text = fs2.readFileSync(path2.join(root, "gradle.lockfile"), "utf8");
486
28
  } catch {
487
29
  return void 0;
488
30
  }
@@ -492,7 +34,7 @@ function gradleLock(root, name) {
492
34
  function packageResolved(root, name) {
493
35
  let data;
494
36
  try {
495
- data = JSON.parse(fs3.readFileSync(path3.join(root, "Package.resolved"), "utf8"));
37
+ data = JSON.parse(fs2.readFileSync(path2.join(root, "Package.resolved"), "utf8"));
496
38
  } catch {
497
39
  return void 0;
498
40
  }
@@ -508,7 +50,7 @@ function packageResolved(root, name) {
508
50
  function pubspecLock(root, name) {
509
51
  let text;
510
52
  try {
511
- text = fs3.readFileSync(path3.join(root, "pubspec.lock"), "utf8");
53
+ text = fs2.readFileSync(path2.join(root, "pubspec.lock"), "utf8");
512
54
  } catch {
513
55
  return void 0;
514
56
  }
@@ -532,7 +74,7 @@ function escapeRegExp(s) {
532
74
  function gemfileLock(root, name) {
533
75
  let text;
534
76
  try {
535
- text = fs3.readFileSync(path3.join(root, "Gemfile.lock"), "utf8");
77
+ text = fs2.readFileSync(path2.join(root, "Gemfile.lock"), "utf8");
536
78
  } catch {
537
79
  return void 0;
538
80
  }
@@ -542,7 +84,7 @@ function gemfileLock(root, name) {
542
84
  function composerLock(root, name) {
543
85
  let data;
544
86
  try {
545
- data = JSON.parse(fs3.readFileSync(path3.join(root, "composer.lock"), "utf8"));
87
+ data = JSON.parse(fs2.readFileSync(path2.join(root, "composer.lock"), "utf8"));
546
88
  } catch {
547
89
  return void 0;
548
90
  }
@@ -557,7 +99,7 @@ function composerLock(root, name) {
557
99
  function packagesLock(root, name) {
558
100
  let data;
559
101
  try {
560
- data = JSON.parse(fs3.readFileSync(path3.join(root, "packages.lock.json"), "utf8"));
102
+ data = JSON.parse(fs2.readFileSync(path2.join(root, "packages.lock.json"), "utf8"));
561
103
  } catch {
562
104
  return void 0;
563
105
  }
@@ -582,7 +124,7 @@ function pypiLockVersion(root, name) {
582
124
  function tomlPackageLock(root, file, name, normalize) {
583
125
  let text;
584
126
  try {
585
- text = fs3.readFileSync(path3.join(root, file), "utf8");
127
+ text = fs2.readFileSync(path2.join(root, file), "utf8");
586
128
  } catch {
587
129
  return void 0;
588
130
  }
@@ -599,7 +141,7 @@ function tomlPackageLock(root, file, name, normalize) {
599
141
  function pipfileLock(root, name) {
600
142
  let data;
601
143
  try {
602
- data = JSON.parse(fs3.readFileSync(path3.join(root, "Pipfile.lock"), "utf8"));
144
+ data = JSON.parse(fs2.readFileSync(path2.join(root, "Pipfile.lock"), "utf8"));
603
145
  } catch {
604
146
  return void 0;
605
147
  }
@@ -618,7 +160,7 @@ function pipfileLock(root, name) {
618
160
  function packageLockVersion(root, name) {
619
161
  let data;
620
162
  try {
621
- data = JSON.parse(fs3.readFileSync(path3.join(root, "package-lock.json"), "utf8"));
163
+ data = JSON.parse(fs2.readFileSync(path2.join(root, "package-lock.json"), "utf8"));
622
164
  } catch {
623
165
  return void 0;
624
166
  }
@@ -627,10 +169,33 @@ function packageLockVersion(root, name) {
627
169
  const v1 = data.dependencies?.[name]?.version;
628
170
  return typeof v1 === "string" ? v1 : void 0;
629
171
  }
172
+ function pnpmLockVersion(root, name) {
173
+ let text;
174
+ try {
175
+ text = fs2.readFileSync(path2.join(root, "pnpm-lock.yaml"), "utf8");
176
+ } catch {
177
+ return void 0;
178
+ }
179
+ const importers = sectionOf(text, "importers");
180
+ if (!importers) return void 0;
181
+ const key = escapeRegExp(name);
182
+ const re = new RegExp(`^\\s+'?${key}'?:\\s*$\\n\\s+specifier:.*$\\n\\s+version:\\s*(\\S+)\\s*$`, "m");
183
+ const m = re.exec(importers);
184
+ if (!m?.[1]) return void 0;
185
+ const version = m[1].replace(/\(.*$/, "").trim();
186
+ return version || void 0;
187
+ }
188
+ function sectionOf(text, key) {
189
+ const start = new RegExp(`^${key}:\\s*$`, "m").exec(text);
190
+ if (!start) return void 0;
191
+ const from = start.index + start[0].length;
192
+ const next = /^\S[^\n]*:\s*$/m.exec(text.slice(from));
193
+ return next ? text.slice(from, from + next.index) : text.slice(from);
194
+ }
630
195
  function yarnLockVersion(root, name) {
631
196
  let text;
632
197
  try {
633
- text = fs3.readFileSync(path3.join(root, "yarn.lock"), "utf8");
198
+ text = fs2.readFileSync(path2.join(root, "yarn.lock"), "utf8");
634
199
  } catch {
635
200
  return void 0;
636
201
  }
@@ -658,19 +223,19 @@ function headerNamesPackage(header, name) {
658
223
  // src/engine/lib.ts
659
224
  var LIB_SCHEMA = "vg-lib/1.0";
660
225
  function catalogPath(root) {
661
- return path3.join(root, "vibgrate.lib.json");
226
+ return path2.join(root, "vibgrate.lib.json");
662
227
  }
663
228
  function libDir(root) {
664
- return path3.join(root, ".vibgrate", "lib");
229
+ return path2.join(root, ".vibgrate", "lib");
665
230
  }
666
231
  function libId(name) {
667
232
  return name.trim().toLowerCase().replace(/^@/, "").replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
668
233
  }
669
234
  function loadCatalog(root) {
670
235
  const file = catalogPath(root);
671
- if (fs3.existsSync(file)) {
236
+ if (fs2.existsSync(file)) {
672
237
  try {
673
- const data = JSON.parse(fs3.readFileSync(file, "utf8"));
238
+ const data = JSON.parse(fs2.readFileSync(file, "utf8"));
674
239
  if (data.schemaVersion === LIB_SCHEMA && data.libraries) return data;
675
240
  } catch {
676
241
  }
@@ -678,7 +243,7 @@ function loadCatalog(root) {
678
243
  return { schemaVersion: LIB_SCHEMA, libraries: {} };
679
244
  }
680
245
  function saveCatalog(root, catalog) {
681
- fs3.writeFileSync(catalogPath(root), `${stableStringify(catalog, 2)}
246
+ fs2.writeFileSync(catalogPath(root), `${stableStringify(catalog, 2)}
682
247
  `);
683
248
  }
684
249
  function resolveLib(catalog, name) {
@@ -688,8 +253,8 @@ function resolveLib(catalog, name) {
688
253
  const all = Object.values(catalog.libraries);
689
254
  return all.find((e) => e.name.toLowerCase() === lower) ?? all.find((e) => e.id.includes(id) || e.name.toLowerCase().includes(lower));
690
255
  }
691
- function installedVersion(root, name) {
692
- const rec = inventory(root).records.find((r) => r.name === name);
256
+ function installedVersion(root, name, inv) {
257
+ const rec = (inv ?? inventory(root)).records.find((r) => r.name === name);
693
258
  return rec?.installed ?? rec?.declared;
694
259
  }
695
260
  var stripRange = (v) => v?.replace(/^[v^~>=<\s]+/, "");
@@ -710,8 +275,8 @@ function resolveVersion(root, name) {
710
275
  const source = lockfile ? "lockfile" : installed ? "installed" : declared ? "declared" : "unknown";
711
276
  return { served, source, lockfile, installed, declared, mismatch };
712
277
  }
713
- function driftFor(root, entry) {
714
- const installed = installedVersion(root, entry.name);
278
+ function driftFor(root, entry, inv) {
279
+ const installed = installedVersion(root, entry.name, inv);
715
280
  if (!installed || entry.version === "*") return { cataloged: entry.version, installed, drift: "unknown" };
716
281
  const norm = (v) => v.replace(/^[v^~>=<\s]+/, "");
717
282
  const a = norm(entry.version);
@@ -754,23 +319,23 @@ async function addLibrary(source, opts) {
754
319
  content = await res.text();
755
320
  type = source.endsWith("llms.txt") ? "llms.txt" : source.endsWith(".json") ? "openapi" : "website";
756
321
  } else {
757
- const abs = path3.resolve(root, source);
758
- if (!fs3.existsSync(abs)) throw new Error(`source not found: ${source}`);
322
+ const abs = path2.resolve(root, source);
323
+ if (!fs2.existsSync(abs)) throw new Error(`source not found: ${source}`);
759
324
  content = readLocal(abs);
760
325
  type = "local";
761
326
  }
762
327
  const name = opts.name ?? inferName(source);
763
328
  const id = libId(name);
764
329
  const version = opts.version ?? installedVersion(root, name) ?? "*";
765
- fs3.mkdirSync(libDir(root), { recursive: true });
766
- const docFileAbs = path3.join(libDir(root), `${id}.md`);
767
- fs3.writeFileSync(docFileAbs, content);
330
+ fs2.mkdirSync(libDir(root), { recursive: true });
331
+ const docFileAbs = path2.join(libDir(root), `${id}.md`);
332
+ fs2.writeFileSync(docFileAbs, content);
768
333
  const entry = {
769
334
  id,
770
335
  name,
771
336
  version,
772
337
  source: { type, location: source },
773
- docFile: path3.relative(root, docFileAbs).split(path3.sep).join("/"),
338
+ docFile: path2.relative(root, docFileAbs).split(path2.sep).join("/"),
774
339
  docHash: hashString(content),
775
340
  bytes: Buffer.byteLength(content, "utf8")
776
341
  };
@@ -780,15 +345,15 @@ async function addLibrary(source, opts) {
780
345
  return entry;
781
346
  }
782
347
  function readDoc(root, entry) {
783
- const abs = path3.resolve(root, entry.docFile);
784
- return fs3.existsSync(abs) ? fs3.readFileSync(abs, "utf8") : "";
348
+ const abs = path2.resolve(root, entry.docFile);
349
+ return fs2.existsSync(abs) ? fs2.readFileSync(abs, "utf8") : "";
785
350
  }
786
351
  function npmPackageDir(root, name) {
787
352
  let cur = root;
788
353
  for (let i = 0; i < 12; i++) {
789
- const dir = path3.join(cur, "node_modules", name);
790
- if (fs3.existsSync(path3.join(dir, "package.json"))) return dir;
791
- const parent = path3.dirname(cur);
354
+ const dir = path2.join(cur, "node_modules", name);
355
+ if (fs2.existsSync(path2.join(dir, "package.json"))) return dir;
356
+ const parent = path2.dirname(cur);
792
357
  if (parent === cur) break;
793
358
  cur = parent;
794
359
  }
@@ -796,21 +361,21 @@ function npmPackageDir(root, name) {
796
361
  }
797
362
  var README_CANDIDATES = ["llms.txt", "README.md", "README.mdx", "README", "readme.md"];
798
363
  function packageDocsMarkdown(dir, query) {
799
- const docsDir = path3.join(dir, "docs");
800
- if (!fs3.existsSync(docsDir) || !fs3.statSync(docsDir).isDirectory()) return void 0;
364
+ const docsDir = path2.join(dir, "docs");
365
+ if (!fs2.existsSync(docsDir) || !fs2.statSync(docsDir).isDirectory()) return void 0;
801
366
  const files = [];
802
367
  const walk = (d, depth) => {
803
368
  if (depth > 3 || files.length >= 40) return;
804
369
  let entries;
805
370
  try {
806
- entries = fs3.readdirSync(d, { withFileTypes: true });
371
+ entries = fs2.readdirSync(d, { withFileTypes: true });
807
372
  } catch {
808
373
  return;
809
374
  }
810
375
  entries.sort((a, b) => a.name.localeCompare(b.name));
811
376
  for (const e of entries) {
812
377
  if (files.length >= 40) return;
813
- const full = path3.join(d, e.name);
378
+ const full = path2.join(d, e.name);
814
379
  if (e.isDirectory()) {
815
380
  if (e.name.startsWith(".") || e.name === "node_modules") continue;
816
381
  walk(full, depth + 1);
@@ -825,22 +390,22 @@ function packageDocsMarkdown(dir, query) {
825
390
  const scored = files.map((f) => {
826
391
  let body = "";
827
392
  try {
828
- body = fs3.readFileSync(f, "utf8");
393
+ body = fs2.readFileSync(f, "utf8");
829
394
  } catch {
830
395
  return { f, body: "", score: -1 };
831
396
  }
832
- const lc = `${path3.basename(f)}
397
+ const lc = `${path2.basename(f)}
833
398
  ${body}`.toLowerCase();
834
399
  const score = terms.length ? terms.filter((t) => lc.includes(t)).length : 1;
835
400
  return { f, body, score };
836
401
  });
837
402
  const picked = (terms.length ? scored.filter((s) => s.score > 0).sort((a, b) => b.score - a.score || a.f.localeCompare(b.f)) : scored).filter((s) => s.body.trim()).slice(0, terms.length ? 8 : 5);
838
403
  if (!picked.length) return void 0;
839
- const text = picked.map((s) => `<!-- ${path3.relative(dir, s.f).split(path3.sep).join("/")} -->
404
+ const text = picked.map((s) => `<!-- ${path2.relative(dir, s.f).split(path2.sep).join("/")} -->
840
405
  ${s.body.trim()}`).join("\n\n");
841
406
  return {
842
407
  text,
843
- files: picked.map((s) => path3.relative(dir, s.f).split(path3.sep).join("/"))
408
+ files: picked.map((s) => path2.relative(dir, s.f).split(path2.sep).join("/"))
844
409
  };
845
410
  }
846
411
  function localPackageDocs(root, name, opts) {
@@ -849,11 +414,11 @@ function localPackageDocs(root, name, opts) {
849
414
  const version = resolveVersion(root, name).served;
850
415
  let primary;
851
416
  for (const f of README_CANDIDATES) {
852
- const p = path3.join(dir, f);
417
+ const p = path2.join(dir, f);
853
418
  try {
854
- const docs = fs3.readFileSync(p, "utf8");
419
+ const docs = fs2.readFileSync(p, "utf8");
855
420
  if (docs.trim()) {
856
- primary = { docs, source: path3.relative(root, p).split(path3.sep).join("/") };
421
+ primary = { docs, source: path2.relative(root, p).split(path2.sep).join("/") };
857
422
  break;
858
423
  }
859
424
  } catch {
@@ -879,19 +444,19 @@ ${extra.text}`,
879
444
  return {
880
445
  docs: extra.text,
881
446
  version,
882
- source: path3.relative(root, path3.join(dir, "docs")).split(path3.sep).join("/") + "/",
447
+ source: path2.relative(root, path2.join(dir, "docs")).split(path2.sep).join("/") + "/",
883
448
  readmeOnly: false
884
449
  };
885
450
  }
886
451
  try {
887
- const pkg = JSON.parse(fs3.readFileSync(path3.join(dir, "package.json"), "utf8"));
452
+ const pkg = JSON.parse(fs2.readFileSync(path2.join(dir, "package.json"), "utf8"));
888
453
  if (pkg.description?.trim()) {
889
454
  return {
890
455
  docs: `# ${name}
891
456
 
892
457
  ${pkg.description}`,
893
458
  version: version ?? pkg.version,
894
- source: path3.relative(root, path3.join(dir, "package.json")).split(path3.sep).join("/"),
459
+ source: path2.relative(root, path2.join(dir, "package.json")).split(path2.sep).join("/"),
895
460
  readmeOnly: true
896
461
  };
897
462
  }
@@ -902,8 +467,8 @@ ${pkg.description}`,
902
467
  function typesFromPkg(dir, pkg) {
903
468
  const tryRel = (rel) => {
904
469
  if (typeof rel !== "string") return void 0;
905
- const p = path3.join(dir, rel);
906
- return fs3.existsSync(p) ? p : void 0;
470
+ const p = path2.join(dir, rel);
471
+ return fs2.existsSync(p) ? p : void 0;
907
472
  };
908
473
  const top = tryRel(pkg.types) ?? tryRel(pkg.typings);
909
474
  if (top) return top;
@@ -936,7 +501,7 @@ function typesFromPkg(dir, pkg) {
936
501
  }
937
502
  function dtsEntry(dir) {
938
503
  try {
939
- const pkg = JSON.parse(fs3.readFileSync(path3.join(dir, "package.json"), "utf8"));
504
+ const pkg = JSON.parse(fs2.readFileSync(path2.join(dir, "package.json"), "utf8"));
940
505
  const fromPkg = typesFromPkg(dir, pkg);
941
506
  if (fromPkg) return fromPkg;
942
507
  } catch {
@@ -949,8 +514,8 @@ function dtsEntry(dir) {
949
514
  "types/index.d.ts",
950
515
  "build/index.d.ts"
951
516
  ]) {
952
- const p = path3.join(dir, c);
953
- if (fs3.existsSync(p)) return p;
517
+ const p = path2.join(dir, c);
518
+ if (fs2.existsSync(p)) return p;
954
519
  }
955
520
  return void 0;
956
521
  }
@@ -962,7 +527,7 @@ function collectDtsFiles(dir) {
962
527
  if (depth > 4 || out.length >= MAX_DTS_FILES) return;
963
528
  let entries;
964
529
  try {
965
- entries = fs3.readdirSync(d, { withFileTypes: true });
530
+ entries = fs2.readdirSync(d, { withFileTypes: true });
966
531
  } catch {
967
532
  return;
968
533
  }
@@ -970,7 +535,7 @@ function collectDtsFiles(dir) {
970
535
  for (const e of entries) {
971
536
  if (out.length >= MAX_DTS_FILES) return;
972
537
  if (e.name === "node_modules" || e.name.startsWith(".")) continue;
973
- const full = path3.join(d, e.name);
538
+ const full = path2.join(d, e.name);
974
539
  if (e.isDirectory()) walk(full, depth + 1);
975
540
  else if (e.isFile() && /\.d\.(ts|mts|cts)$/.test(e.name)) out.push(full);
976
541
  }
@@ -1026,9 +591,9 @@ function localApiSurface(root, name, query) {
1026
591
  for (const f of files) {
1027
592
  let src;
1028
593
  try {
1029
- const st = fs3.statSync(f);
594
+ const st = fs2.statSync(f);
1030
595
  if (st.size > MAX_DTS_BYTES) continue;
1031
- src = fs3.readFileSync(f, "utf8");
596
+ src = fs2.readFileSync(f, "utf8");
1032
597
  } catch {
1033
598
  continue;
1034
599
  }
@@ -1073,36 +638,36 @@ function localApiSurface(root, name, query) {
1073
638
  return allDecls.slice(0, 80).join("\n\n");
1074
639
  }
1075
640
  function cloneAndReadGit(url) {
1076
- const dir = fs3.mkdtempSync(path3.join(os.tmpdir(), "vg-lib-git-"));
641
+ const dir = fs2.mkdtempSync(path2.join(os.tmpdir(), "vg-lib-git-"));
1077
642
  try {
1078
643
  execFileSync("git", ["clone", "--depth", "1", "--quiet", url, dir], {
1079
644
  stdio: ["ignore", "ignore", "pipe"]
1080
645
  });
1081
646
  } catch (err) {
1082
- fs3.rmSync(dir, { recursive: true, force: true });
647
+ fs2.rmSync(dir, { recursive: true, force: true });
1083
648
  const detail = err instanceof Error && err.message ? `: ${err.message.split("\n")[0]}` : "";
1084
649
  throw new Error(`git clone failed for ${url}${detail}`);
1085
650
  }
1086
651
  try {
1087
652
  return readGitDocs(dir);
1088
653
  } finally {
1089
- fs3.rmSync(dir, { recursive: true, force: true });
654
+ fs2.rmSync(dir, { recursive: true, force: true });
1090
655
  }
1091
656
  }
1092
657
  function readGitDocs(dir) {
1093
- const docsDir = path3.join(dir, "docs");
1094
- if (fs3.existsSync(docsDir) && fs3.statSync(docsDir).isDirectory()) return readLocal(docsDir);
1095
- const readme = ["README.md", "README.mdx", "README.txt", "README.rst", "readme.md"].map((f) => path3.join(dir, f)).find((p) => fs3.existsSync(p));
1096
- if (readme) return fs3.readFileSync(readme, "utf8");
658
+ const docsDir = path2.join(dir, "docs");
659
+ if (fs2.existsSync(docsDir) && fs2.statSync(docsDir).isDirectory()) return readLocal(docsDir);
660
+ const readme = ["README.md", "README.mdx", "README.txt", "README.rst", "readme.md"].map((f) => path2.join(dir, f)).find((p) => fs2.existsSync(p));
661
+ if (readme) return fs2.readFileSync(readme, "utf8");
1097
662
  return readLocal(dir);
1098
663
  }
1099
664
  function readLocal(abs) {
1100
- const stat = fs3.statSync(abs);
1101
- if (stat.isFile()) return fs3.readFileSync(abs, "utf8");
665
+ const stat = fs2.statSync(abs);
666
+ if (stat.isFile()) return fs2.readFileSync(abs, "utf8");
1102
667
  const parts = [];
1103
- const files = fs3.readdirSync(abs, { withFileTypes: true }).filter((e) => e.isFile() && /\.(md|mdx|txt|rst)$/i.test(e.name)).map((e) => e.name).sort();
668
+ const files = fs2.readdirSync(abs, { withFileTypes: true }).filter((e) => e.isFile() && /\.(md|mdx|txt|rst)$/i.test(e.name)).map((e) => e.name).sort();
1104
669
  for (const f of files) parts.push(`<!-- ${f} -->
1105
- ${fs3.readFileSync(path3.join(abs, f), "utf8")}`);
670
+ ${fs2.readFileSync(path2.join(abs, f), "utf8")}`);
1106
671
  return parts.join("\n\n");
1107
672
  }
1108
673
  function inferName(source) {
@@ -1144,7 +709,7 @@ function measure(root, files) {
1144
709
  for (const rel of files) {
1145
710
  let size;
1146
711
  try {
1147
- size = fs3.statSync(path3.join(root, rel)).size;
712
+ size = fs2.statSync(path2.join(root, rel)).size;
1148
713
  } catch {
1149
714
  continue;
1150
715
  }
@@ -1167,9 +732,9 @@ function matchLines(text, needleLower) {
1167
732
  }
1168
733
  function readCandidate(abs, knownSize) {
1169
734
  try {
1170
- const size = knownSize ?? fs3.statSync(abs).size;
735
+ const size = knownSize ?? fs2.statSync(abs).size;
1171
736
  if (size > MAX_FILE_BYTES) return null;
1172
- const text = fs3.readFileSync(abs, "utf8");
737
+ const text = fs2.readFileSync(abs, "utf8");
1173
738
  return text.includes(NUL) ? null : text;
1174
739
  } catch {
1175
740
  return null;
@@ -1180,7 +745,7 @@ function scanInline(root, files, needleLower, cap, stopAtCap, sizes) {
1180
745
  let total = 0;
1181
746
  let truncated = false;
1182
747
  for (const rel of files) {
1183
- const text = readCandidate(path3.join(root, rel), sizes?.get(rel));
748
+ const text = readCandidate(path2.join(root, rel), sizes?.get(rel));
1184
749
  if (text === null) continue;
1185
750
  for (const h of matchLines(text, needleLower)) {
1186
751
  total++;
@@ -1247,12 +812,12 @@ var WORKER_SOURCE = [
1247
812
  "parentPort.postMessage({ hits, total, truncated });"
1248
813
  ].join("\n");
1249
814
  function runWorker(root, files, needleLower) {
1250
- return new Promise((resolve3, reject) => {
815
+ return new Promise((resolve2, reject) => {
1251
816
  const w = new Worker(WORKER_SOURCE, { eval: true, workerData: { root, files, needleLower } });
1252
817
  let settled = false;
1253
818
  w.once("message", (m) => {
1254
819
  settled = true;
1255
- resolve3(m);
820
+ resolve2(m);
1256
821
  });
1257
822
  w.once("error", reject);
1258
823
  w.once("exit", (code) => {
@@ -1322,10 +887,10 @@ var BINARY_EXTS = /* @__PURE__ */ new Set([
1322
887
  ".pdf"
1323
888
  ]);
1324
889
  function hasBinaryExt(rel) {
1325
- return BINARY_EXTS.has(path3.extname(rel).toLowerCase());
890
+ return BINARY_EXTS.has(path2.extname(rel).toLowerCase());
1326
891
  }
1327
892
  function toPosix(rel) {
1328
- return path3.sep === "\\" ? rel.replaceAll("\\", "/") : rel;
893
+ return path2.sep === "\\" ? rel.replaceAll("\\", "/") : rel;
1329
894
  }
1330
895
  async function searchSymbols(graph, root, query, limit) {
1331
896
  let q = query.trim();
@@ -1473,13 +1038,13 @@ function walkCandidates(root) {
1473
1038
  const dir = stack.pop();
1474
1039
  let entries;
1475
1040
  try {
1476
- entries = fs3.readdirSync(dir, { withFileTypes: true });
1041
+ entries = fs2.readdirSync(dir, { withFileTypes: true });
1477
1042
  } catch {
1478
1043
  continue;
1479
1044
  }
1480
1045
  for (const e of entries) {
1481
1046
  if (e.name.startsWith(".") || IGNORE_DIRS.has(e.name)) continue;
1482
- const abs = path3.join(dir, e.name);
1047
+ const abs = path2.join(dir, e.name);
1483
1048
  if (e.isDirectory()) {
1484
1049
  stack.push(abs);
1485
1050
  continue;
@@ -1489,7 +1054,7 @@ function walkCandidates(root) {
1489
1054
  truncated = true;
1490
1055
  continue;
1491
1056
  }
1492
- files.push(toPosix(path3.relative(root, abs)));
1057
+ files.push(toPosix(path2.relative(root, abs)));
1493
1058
  }
1494
1059
  }
1495
1060
  files.sort();
@@ -1520,7 +1085,7 @@ function ripgrepCandidates(root, needle) {
1520
1085
  if (files.length > MAX_FILES_SCANNED) return { files: files.slice(0, MAX_FILES_SCANNED), truncated: true };
1521
1086
  return { files, truncated: false };
1522
1087
  }
1523
- function parseRgFileList(stdout, sep3 = path3.sep) {
1088
+ function parseRgFileList(stdout, sep3 = path2.sep) {
1524
1089
  const seen = /* @__PURE__ */ new Set();
1525
1090
  for (const raw of stdout.split("\n")) {
1526
1091
  if (!raw) continue;
@@ -1535,6 +1100,6 @@ function parseRgFileList(stdout, sep3 = path3.sep) {
1535
1100
  return [...seen].sort();
1536
1101
  }
1537
1102
 
1538
- export { ECOSYSTEMS, addLibrary, catalogPath, driftFor, enrichOnline, inventory, libDir, libId, loadCatalog, localApiSurface, localPackageDocs, readDoc, resolveLib, resolveVersion, saveCatalog, searchSymbols };
1539
- //# sourceMappingURL=chunk-3H3SVJUY.js.map
1540
- //# sourceMappingURL=chunk-3H3SVJUY.js.map
1103
+ export { addLibrary, catalogPath, driftFor, libDir, libId, loadCatalog, localApiSurface, localPackageDocs, readDoc, resolveLib, resolveVersion, saveCatalog, searchSymbols };
1104
+ //# sourceMappingURL=chunk-RHKOUPWT.js.map
1105
+ //# sourceMappingURL=chunk-RHKOUPWT.js.map