@vibgrate/cli 2026.722.2 → 2026.727.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 (145) hide show
  1. package/DOCS.md +418 -213
  2. package/README.md +34 -8
  3. package/dist/baseline-TG4ATZGZ.js +8 -0
  4. package/dist/{baseline-BD3A7EXD.js.map → baseline-TG4ATZGZ.js.map} +1 -1
  5. package/dist/chunk-2MBL43EJ.js +82 -0
  6. package/dist/chunk-2MBL43EJ.js.map +1 -0
  7. package/dist/chunk-2XQDMLKB.js +465 -0
  8. package/dist/chunk-2XQDMLKB.js.map +1 -0
  9. package/dist/{chunk-PY3DNX5H.js → chunk-3Q7QBWFW.js} +13 -2
  10. package/dist/chunk-3Q7QBWFW.js.map +1 -0
  11. package/dist/chunk-3V24O47U.js +478 -0
  12. package/dist/chunk-3V24O47U.js.map +1 -0
  13. package/dist/chunk-5I4VSBWQ.js +764 -0
  14. package/dist/chunk-5I4VSBWQ.js.map +1 -0
  15. package/dist/{chunk-WNIIKCNF.js → chunk-6ABXHZRN.js} +59 -311
  16. package/dist/chunk-6ABXHZRN.js.map +1 -0
  17. package/dist/chunk-6AYDFFP5.js +136 -0
  18. package/dist/chunk-6AYDFFP5.js.map +1 -0
  19. package/dist/chunk-6UQMXIAG.js +122 -0
  20. package/dist/chunk-6UQMXIAG.js.map +1 -0
  21. package/dist/chunk-7N4Y3E47.js +108 -0
  22. package/dist/chunk-7N4Y3E47.js.map +1 -0
  23. package/dist/chunk-BPF3YX2U.js +64 -0
  24. package/dist/chunk-BPF3YX2U.js.map +1 -0
  25. package/dist/chunk-BWPBB45M.js +88 -0
  26. package/dist/chunk-BWPBB45M.js.map +1 -0
  27. package/dist/{chunk-6CXTPC74.js → chunk-CY4WKXB2.js} +27 -6
  28. package/dist/chunk-CY4WKXB2.js.map +1 -0
  29. package/dist/chunk-DGUM43GV.js +10 -0
  30. package/dist/chunk-DGUM43GV.js.map +1 -0
  31. package/dist/{chunk-NONYJLOJ.js → chunk-EX4PQT6W.js} +3 -3
  32. package/dist/{chunk-NONYJLOJ.js.map → chunk-EX4PQT6W.js.map} +1 -1
  33. package/dist/chunk-IS7VTH2Q.js +627 -0
  34. package/dist/chunk-IS7VTH2Q.js.map +1 -0
  35. package/dist/chunk-IZDH67DX.js +289 -0
  36. package/dist/chunk-IZDH67DX.js.map +1 -0
  37. package/dist/chunk-J4RFRKZH.js +2496 -0
  38. package/dist/chunk-J4RFRKZH.js.map +1 -0
  39. package/dist/chunk-J7LKEB2R.js +51 -0
  40. package/dist/chunk-J7LKEB2R.js.map +1 -0
  41. package/dist/chunk-JIBOJTGS.js +313 -0
  42. package/dist/chunk-JIBOJTGS.js.map +1 -0
  43. package/dist/chunk-K3MZIVZW.js +88 -0
  44. package/dist/chunk-K3MZIVZW.js.map +1 -0
  45. package/dist/chunk-K7REHDQS.js +776 -0
  46. package/dist/chunk-K7REHDQS.js.map +1 -0
  47. package/dist/{chunk-2O5YZVZV.js → chunk-KCKYKDMS.js} +23 -19
  48. package/dist/chunk-KCKYKDMS.js.map +1 -0
  49. package/dist/{chunk-3MXNNBLI.js → chunk-KNELIQJO.js} +1647 -2042
  50. package/dist/chunk-KNELIQJO.js.map +1 -0
  51. package/dist/chunk-KSBHGWRV.js +613 -0
  52. package/dist/chunk-KSBHGWRV.js.map +1 -0
  53. package/dist/chunk-LKVMI67M.js +1695 -0
  54. package/dist/chunk-LKVMI67M.js.map +1 -0
  55. package/dist/chunk-NDMDSPFX.js +69 -0
  56. package/dist/chunk-NDMDSPFX.js.map +1 -0
  57. package/dist/{chunk-CS37OBE3.js → chunk-OFUC6RYN.js} +791 -783
  58. package/dist/chunk-OFUC6RYN.js.map +1 -0
  59. package/dist/chunk-OOIG3RUM.js +276 -0
  60. package/dist/chunk-OOIG3RUM.js.map +1 -0
  61. package/dist/chunk-PMYWZRRS.js +62 -0
  62. package/dist/chunk-PMYWZRRS.js.map +1 -0
  63. package/dist/chunk-PXHNTC6D.js +382 -0
  64. package/dist/chunk-PXHNTC6D.js.map +1 -0
  65. package/dist/{chunk-I7GY7MVN.js → chunk-RNP3SMTV.js} +60 -12
  66. package/dist/chunk-RNP3SMTV.js.map +1 -0
  67. package/dist/chunk-TCDAZZNP.js +843 -0
  68. package/dist/chunk-TCDAZZNP.js.map +1 -0
  69. package/dist/{chunk-5BDHQ7DD.js → chunk-WGUL45AV.js} +24 -17
  70. package/dist/chunk-WGUL45AV.js.map +1 -0
  71. package/dist/cli.d.ts +3 -0
  72. package/dist/cli.js +3373 -617
  73. package/dist/cli.js.map +1 -1
  74. package/dist/execution-env-ZU45JZ4G.js +4 -0
  75. package/dist/execution-env-ZU45JZ4G.js.map +1 -0
  76. package/dist/federation-SZWZIFZ7.js +7 -0
  77. package/dist/federation-SZWZIFZ7.js.map +1 -0
  78. package/dist/{fs-IPY4FJKH.js → fs-B5HZ2MIU.js} +3 -2
  79. package/dist/fs-B5HZ2MIU.js.map +1 -0
  80. package/dist/{fs-KCABDURV.js → fs-O5IQYXHO.js} +3 -2
  81. package/dist/fs-O5IQYXHO.js.map +1 -0
  82. package/dist/git-ref-XDXB6JP5.js +4 -0
  83. package/dist/git-ref-XDXB6JP5.js.map +1 -0
  84. package/dist/graph-backend-73URGTFY.js +11 -0
  85. package/dist/graph-backend-73URGTFY.js.map +1 -0
  86. package/dist/index.d.ts +472 -137
  87. package/dist/index.js +15 -7
  88. package/dist/index.js.map +1 -1
  89. package/dist/{interactive-A4DISSIW.js → interactive-372NLI5C.js} +186 -226
  90. package/dist/interactive-372NLI5C.js.map +1 -0
  91. package/dist/llm-host-7GWDO6IX.js +9 -0
  92. package/dist/llm-host-7GWDO6IX.js.map +1 -0
  93. package/dist/load-I333TGNI.js +8 -0
  94. package/dist/load-I333TGNI.js.map +1 -0
  95. package/dist/local-runtime-5O2NN3GA.js +5 -0
  96. package/dist/local-runtime-5O2NN3GA.js.map +1 -0
  97. package/dist/mcp-tools-I7JK3S2M.js +4 -0
  98. package/dist/{mcp-tools-I6PME3AV.js.map → mcp-tools-I7JK3S2M.js.map} +1 -1
  99. package/dist/model-execution-profile-TFBKCNJG.js +4 -0
  100. package/dist/model-execution-profile-TFBKCNJG.js.map +1 -0
  101. package/dist/model-orchestrator-TVONAUPS.js +9 -0
  102. package/dist/model-orchestrator-TVONAUPS.js.map +1 -0
  103. package/dist/parse-worker.d.ts +1 -1
  104. package/dist/parse-worker.js +2 -1
  105. package/dist/parse-worker.js.map +1 -1
  106. package/dist/paths-2RAH3GME.js +6 -0
  107. package/dist/paths-2RAH3GME.js.map +1 -0
  108. package/dist/resolve-gguf-VPL4YQ6J.js +8 -0
  109. package/dist/resolve-gguf-VPL4YQ6J.js.map +1 -0
  110. package/dist/runtime-session-JRKCQUHY.js +18 -0
  111. package/dist/runtime-session-JRKCQUHY.js.map +1 -0
  112. package/dist/session-ITPYQ5XI.js +11 -0
  113. package/dist/{session-POJUDFPH.js.map → session-ITPYQ5XI.js.map} +1 -1
  114. package/dist/session-store-WFBX7HXL.js +4 -0
  115. package/dist/{session-store-W5RZZHA3.js.map → session-store-WFBX7HXL.js.map} +1 -1
  116. package/dist/{stream-json-Q2JGWPHB.js → stream-json-SLMDKLXP.js} +17 -6
  117. package/dist/stream-json-SLMDKLXP.js.map +1 -0
  118. package/dist/{types-Jl6RJ175.d.ts → types-7AHBUbFm.d.ts} +8 -2
  119. package/dist/ui-Q6DJ3GCU.js +5 -0
  120. package/dist/ui-Q6DJ3GCU.js.map +1 -0
  121. package/dist/vgd-7JV5KCNJ.js +17 -0
  122. package/dist/vgd-7JV5KCNJ.js.map +1 -0
  123. package/package.json +9 -6
  124. package/dist/baseline-BD3A7EXD.js +0 -7
  125. package/dist/chunk-2O5YZVZV.js.map +0 -1
  126. package/dist/chunk-3MXNNBLI.js.map +0 -1
  127. package/dist/chunk-5BDHQ7DD.js.map +0 -1
  128. package/dist/chunk-6CXTPC74.js.map +0 -1
  129. package/dist/chunk-CS37OBE3.js.map +0 -1
  130. package/dist/chunk-GGJZA3Q6.js +0 -961
  131. package/dist/chunk-GGJZA3Q6.js.map +0 -1
  132. package/dist/chunk-I7GY7MVN.js.map +0 -1
  133. package/dist/chunk-JBXNQCGE.js +0 -484
  134. package/dist/chunk-JBXNQCGE.js.map +0 -1
  135. package/dist/chunk-PY3DNX5H.js.map +0 -1
  136. package/dist/chunk-WNIIKCNF.js.map +0 -1
  137. package/dist/fs-IPY4FJKH.js.map +0 -1
  138. package/dist/fs-KCABDURV.js.map +0 -1
  139. package/dist/interactive-A4DISSIW.js.map +0 -1
  140. package/dist/mcp-tools-I6PME3AV.js +0 -3
  141. package/dist/session-POJUDFPH.js +0 -6
  142. package/dist/session-store-W5RZZHA3.js +0 -3
  143. package/dist/stream-json-Q2JGWPHB.js.map +0 -1
  144. package/dist/ui-HOVOPWMX.js +0 -4
  145. package/dist/ui-HOVOPWMX.js.map +0 -1
@@ -1,961 +0,0 @@
1
- import { stableStringify } from './chunk-WNIIKCNF.js';
2
- import { hashString } from './chunk-JFGYT6BI.js';
3
- import * as fs3 from 'fs';
4
- import * as path3 from 'path';
5
- import * as os from 'os';
6
- import { execFileSync } from 'child_process';
7
-
8
- // src/engine/lookup.ts
9
- function findNodes(graph, query) {
10
- const q = query.trim();
11
- if (!q) return [];
12
- const byId = graph.nodes.filter((n) => n.id === q);
13
- if (byId.length) return byId;
14
- const fileLine = /^(.*):(\d+)$/.exec(q);
15
- if (fileLine) {
16
- const file = fileLine[1];
17
- const line = Number(fileLine[2]);
18
- const spanning = graph.nodes.filter((n) => n.file === file && n.span.start <= line && n.span.end >= line && n.kind !== "file").sort((a, b) => a.span.end - a.span.start - (b.span.end - b.span.start));
19
- if (spanning.length) return spanning;
20
- }
21
- if (/[*?]/.test(q)) {
22
- const re = globToRegExp(q);
23
- return rank(graph.nodes.filter((n) => re.test(n.qualifiedName) || re.test(n.name) || re.test(n.file)));
24
- }
25
- const byQn = graph.nodes.filter((n) => n.qualifiedName === q);
26
- if (byQn.length) return rank(byQn);
27
- const byName = graph.nodes.filter((n) => n.name === q);
28
- if (byName.length) return rank(byName);
29
- const lower = q.toLowerCase();
30
- const ci = graph.nodes.filter(
31
- (n) => n.qualifiedName.toLowerCase() === lower || n.name.toLowerCase() === lower
32
- );
33
- if (ci.length) return rank(ci);
34
- return rank(graph.nodes.filter((n) => n.qualifiedName.toLowerCase().includes(lower))).slice(0, 25);
35
- }
36
- function resolveOne(graph, query, pick) {
37
- const candidates = findNodes(graph, query);
38
- if (candidates.length === 0) return { candidates };
39
- if (pick && pick >= 1 && pick <= candidates.length) return { node: candidates[pick - 1], candidates };
40
- if (candidates.length === 1) return { node: candidates[0], candidates };
41
- return { candidates };
42
- }
43
- function nodeById(graph, id) {
44
- return graph.nodes.find((n) => n.id === id);
45
- }
46
- function rank(nodes) {
47
- return [...nodes].sort(
48
- (a, b) => b.importance - a.importance || a.qualifiedName.localeCompare(b.qualifiedName)
49
- );
50
- }
51
- function globToRegExp(glob) {
52
- const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
53
- return new RegExp(`^${escaped}$`, "i");
54
- }
55
- var ECOSYSTEMS = ["npm", "pypi", "go", "rust", "ruby", "php", "dotnet", "swift", "dart", "java"];
56
- function inventory(root) {
57
- const manifests = findManifests(root);
58
- const records = [];
59
- records.push(...npmDeps(manifests.npm));
60
- records.push(...pypiDeps(manifests.pypi));
61
- records.push(...goDeps(manifests.go));
62
- records.push(...cargoDeps(manifests.rust));
63
- records.push(...rubyDeps(manifests.ruby));
64
- records.push(...phpDeps(manifests.php));
65
- records.push(...dotnetDeps(manifests.dotnet));
66
- records.push(...swiftDeps(manifests.swift));
67
- records.push(...dartDeps(manifests.dart));
68
- records.push(...javaDeps(manifests.java));
69
- const seen = /* @__PURE__ */ new Set();
70
- const deduped = records.filter((r) => {
71
- const key = `${r.ecosystem}\0${r.name}`;
72
- if (seen.has(key)) return false;
73
- seen.add(key);
74
- return true;
75
- });
76
- deduped.sort((a, b) => a.ecosystem.localeCompare(b.ecosystem) || a.name.localeCompare(b.name));
77
- const counts = { total: deduped.length };
78
- for (const e of ECOSYSTEMS) counts[e] = 0;
79
- for (const r of deduped) counts[r.ecosystem]++;
80
- return { records: deduped, counts };
81
- }
82
- var SKIP_DIRS = /* @__PURE__ */ new Set([
83
- "node_modules",
84
- ".git",
85
- "dist",
86
- "build",
87
- "out",
88
- ".vibgrate",
89
- "vendor",
90
- ".venv",
91
- "venv",
92
- "env",
93
- "__pycache__",
94
- "target",
95
- ".next",
96
- ".nuxt",
97
- "coverage",
98
- ".cache"
99
- ]);
100
- var MANIFEST_BY_FILE = {
101
- "package.json": "npm",
102
- "requirements.txt": "pypi",
103
- "pyproject.toml": "pypi",
104
- "go.mod": "go",
105
- "Cargo.toml": "rust",
106
- Gemfile: "ruby",
107
- "composer.json": "php",
108
- "Package.swift": "swift",
109
- "pubspec.yaml": "dart",
110
- "pom.xml": "java",
111
- "build.gradle": "java",
112
- "build.gradle.kts": "java"
113
- };
114
- function findManifests(root) {
115
- const set = Object.fromEntries(ECOSYSTEMS.map((e) => [e, []]));
116
- const MAX_ENTRIES = 2e4;
117
- let scanned = 0;
118
- const walk = (dir, depth) => {
119
- if (depth > 8 || scanned > MAX_ENTRIES) return;
120
- let entries;
121
- try {
122
- entries = fs3.readdirSync(dir, { withFileTypes: true });
123
- } catch {
124
- return;
125
- }
126
- for (const e of entries) {
127
- scanned++;
128
- if (scanned > MAX_ENTRIES) break;
129
- if (e.isDirectory()) {
130
- if (!SKIP_DIRS.has(e.name) && !e.name.startsWith(".")) walk(path3.join(dir, e.name), depth + 1);
131
- continue;
132
- }
133
- const eco = MANIFEST_BY_FILE[e.name] ?? (/\.(cs|fs)proj$/i.test(e.name) ? "dotnet" : void 0);
134
- if (eco) set[eco].push(path3.join(dir, e.name));
135
- }
136
- };
137
- walk(root, 0);
138
- for (const e of ECOSYSTEMS) set[e].sort();
139
- return set;
140
- }
141
- function npmDeps(files) {
142
- const out = [];
143
- for (const file of files) {
144
- let pkg;
145
- try {
146
- pkg = JSON.parse(fs3.readFileSync(file, "utf8"));
147
- } catch {
148
- continue;
149
- }
150
- const dir = path3.dirname(file);
151
- const all = { ...pkg.dependencies, ...pkg.devDependencies };
152
- for (const [name, declared] of Object.entries(all)) {
153
- out.push({ name, ecosystem: "npm", declared, installed: installedNpmVersion(dir, name) });
154
- }
155
- }
156
- return out;
157
- }
158
- function installedNpmVersion(dir, name) {
159
- let cur = dir;
160
- for (let i = 0; i < 12; i++) {
161
- const p = path3.join(cur, "node_modules", name, "package.json");
162
- try {
163
- return JSON.parse(fs3.readFileSync(p, "utf8")).version;
164
- } catch {
165
- }
166
- const parent = path3.dirname(cur);
167
- if (parent === cur) break;
168
- cur = parent;
169
- }
170
- return void 0;
171
- }
172
- function installedTreeVersion(root, ecosystem, name) {
173
- if (ecosystem === "pypi") return installedPypiVersion(root, name);
174
- if (ecosystem === "php") return installedPhpVersion(root, name);
175
- return void 0;
176
- }
177
- function normalizePep503(name) {
178
- return name.trim().toLowerCase().replace(/[-_.]+/g, "-");
179
- }
180
- function sitePackagesDirs(base) {
181
- const out = [];
182
- try {
183
- for (const d of fs3.readdirSync(path3.join(base, "lib"))) {
184
- if (d.startsWith("python")) out.push(path3.join(base, "lib", d, "site-packages"));
185
- }
186
- } catch {
187
- }
188
- out.push(path3.join(base, "Lib", "site-packages"));
189
- return out;
190
- }
191
- function installedPypiVersion(root, name) {
192
- const target = normalizePep503(name);
193
- for (const venv of [".venv", "venv", "env", ".tox"]) {
194
- for (const sp of sitePackagesDirs(path3.join(root, venv))) {
195
- let entries;
196
- try {
197
- entries = fs3.readdirSync(sp);
198
- } catch {
199
- continue;
200
- }
201
- for (const entry of entries) {
202
- const m = /^(.+?)-(\d[^-]*)\.dist-info$/.exec(entry);
203
- if (m && normalizePep503(m[1]) === target) return m[2];
204
- }
205
- }
206
- }
207
- return void 0;
208
- }
209
- function installedPhpVersion(root, name) {
210
- let data;
211
- try {
212
- data = JSON.parse(fs3.readFileSync(path3.join(root, "vendor", "composer", "installed.json"), "utf8"));
213
- } catch {
214
- return void 0;
215
- }
216
- const pkgs = Array.isArray(data) ? data : data.packages;
217
- if (!Array.isArray(pkgs)) return void 0;
218
- const p = pkgs.find((x) => x && typeof x === "object" && x.name === name);
219
- return typeof p?.version === "string" ? p.version.replace(/^v/, "") : void 0;
220
- }
221
- function pypiDeps(files) {
222
- const byName = /* @__PURE__ */ new Map();
223
- const add = (name, declared) => {
224
- const clean = name.trim().replace(/\[.*\]$/, "");
225
- if (!clean || clean.toLowerCase() === "python") return;
226
- if (!byName.has(clean)) byName.set(clean, { name: clean, ecosystem: "pypi", declared: declared.trim() || "*" });
227
- };
228
- for (const file of files) {
229
- let text;
230
- try {
231
- text = fs3.readFileSync(file, "utf8");
232
- } catch {
233
- continue;
234
- }
235
- if (path3.basename(file) === "requirements.txt") {
236
- for (const line of text.split("\n")) {
237
- const t = line.trim();
238
- if (!t || t.startsWith("#") || t.startsWith("-")) continue;
239
- const m = /^([A-Za-z0-9._-]+(?:\[[^\]]*\])?)\s*([<>=!~).*]+.*)?$/.exec(t);
240
- if (m) add(m[1], m[2] ?? "*");
241
- }
242
- } else {
243
- for (const dep of pep621Dependencies(text)) {
244
- const m = /^([A-Za-z0-9._-]+(?:\[[^\]]*\])?)\s*(.*)$/.exec(dep.trim());
245
- if (m) add(m[1], m[2] ?? "*");
246
- }
247
- for (const [name, spec] of poetryDependencies(text)) add(name, spec);
248
- }
249
- }
250
- return [...byName.values()];
251
- }
252
- function pep621Dependencies(text) {
253
- const section = sectionBody(text, "project");
254
- if (!section) return [];
255
- const start = /dependencies\s*=\s*\[/.exec(section);
256
- if (!start) return [];
257
- let depth = 0;
258
- let inStr = false;
259
- let strCh = "";
260
- const out = [];
261
- let cur = "";
262
- for (let i = start.index + start[0].length - 1; i < section.length; i++) {
263
- const ch = section[i];
264
- if (inStr) {
265
- if (ch === strCh) {
266
- out.push(cur);
267
- inStr = false;
268
- } else cur += ch;
269
- continue;
270
- }
271
- if (ch === '"' || ch === "'") {
272
- inStr = true;
273
- strCh = ch;
274
- cur = "";
275
- } else if (ch === "[") depth++;
276
- else if (ch === "]") {
277
- depth--;
278
- if (depth === 0) break;
279
- }
280
- }
281
- return out;
282
- }
283
- function poetryDependencies(text) {
284
- const out = [];
285
- const lines = text.split("\n");
286
- let inDeps = false;
287
- for (const raw of lines) {
288
- const line = raw.trim();
289
- if (line.startsWith("[")) {
290
- inDeps = /^\[tool\.poetry(\.group\.[^.\]]+)?\.dependencies\]$/.test(line);
291
- continue;
292
- }
293
- if (!inDeps || !line || line.startsWith("#")) continue;
294
- const m = /^([A-Za-z0-9._-]+)\s*=\s*["']([^"']*)["']/.exec(line);
295
- if (m) out.push([m[1], m[2] || "*"]);
296
- }
297
- return out;
298
- }
299
- function sectionBody(text, name) {
300
- const lines = text.split("\n");
301
- let capturing = false;
302
- const body = [];
303
- for (const raw of lines) {
304
- const line = raw.trim();
305
- if (/^\[/.test(line)) {
306
- if (capturing) break;
307
- capturing = line === `[${name}]`;
308
- continue;
309
- }
310
- if (capturing) body.push(raw);
311
- }
312
- return capturing || body.length ? body.join("\n") : null;
313
- }
314
- function goDeps(files) {
315
- const out = [];
316
- for (const mod of files) {
317
- let text;
318
- try {
319
- text = fs3.readFileSync(mod, "utf8");
320
- } catch {
321
- continue;
322
- }
323
- const re = /^\s*(?:require\s+)?([\w./-]+)\s+v(\S+)/gm;
324
- let m;
325
- while (m = re.exec(text)) {
326
- if (m[1] === "go" || m[1] === "require" || m[1].startsWith("module")) continue;
327
- out.push({ name: m[1], ecosystem: "go", declared: `v${m[2]}` });
328
- }
329
- }
330
- return out;
331
- }
332
- function cargoDeps(files) {
333
- const out = [];
334
- for (const file of files) {
335
- let text;
336
- try {
337
- text = fs3.readFileSync(file, "utf8");
338
- } catch {
339
- continue;
340
- }
341
- for (const table of ["dependencies", "dev-dependencies", "build-dependencies"]) {
342
- const body = sectionBody(text, table);
343
- if (!body) continue;
344
- for (const raw of body.split("\n")) {
345
- const line = raw.trim();
346
- if (!line || line.startsWith("#")) continue;
347
- const m = /^([A-Za-z0-9._-]+)\s*=\s*(.+)$/.exec(line);
348
- if (!m) continue;
349
- const rhs = m[2].trim();
350
- let declared = "*";
351
- if (rhs.startsWith('"')) {
352
- const sm = /^"([^"]+)"/.exec(rhs);
353
- if (sm) declared = sm[1];
354
- } else if (rhs.startsWith("{")) {
355
- const vm = /version\s*=\s*"([^"]+)"/.exec(rhs);
356
- if (vm) declared = vm[1];
357
- }
358
- out.push({ name: m[1], ecosystem: "rust", declared });
359
- }
360
- }
361
- }
362
- return out;
363
- }
364
- function rubyDeps(files) {
365
- const out = [];
366
- for (const file of files) {
367
- let text;
368
- try {
369
- text = fs3.readFileSync(file, "utf8");
370
- } catch {
371
- continue;
372
- }
373
- const re = /^\s*gem\s+["']([^"']+)["']\s*(?:,\s*["']([^"']+)["'])?/gm;
374
- let m;
375
- while (m = re.exec(text)) out.push({ name: m[1], ecosystem: "ruby", declared: m[2] ?? "*" });
376
- }
377
- return out;
378
- }
379
- function phpDeps(files) {
380
- const out = [];
381
- for (const file of files) {
382
- let pkg;
383
- try {
384
- pkg = JSON.parse(fs3.readFileSync(file, "utf8"));
385
- } catch {
386
- continue;
387
- }
388
- const all = { ...pkg.require, ...pkg["require-dev"] };
389
- for (const [name, declared] of Object.entries(all)) {
390
- if (!name.includes("/")) continue;
391
- out.push({ name, ecosystem: "php", declared });
392
- }
393
- }
394
- return out;
395
- }
396
- function dotnetDeps(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
- const tagRe = /<PackageReference\b[^>]*>/gi;
406
- let m;
407
- while (m = tagRe.exec(text)) {
408
- const inc = /Include\s*=\s*"([^"]+)"/i.exec(m[0]);
409
- if (!inc) continue;
410
- const ver = /Version\s*=\s*"([^"]+)"/i.exec(m[0]);
411
- out.push({ name: inc[1], ecosystem: "dotnet", declared: ver?.[1] ?? "*" });
412
- }
413
- }
414
- return out;
415
- }
416
- function swiftDeps(files) {
417
- const out = [];
418
- for (const file of files) {
419
- let text;
420
- try {
421
- text = fs3.readFileSync(file, "utf8");
422
- } catch {
423
- continue;
424
- }
425
- const re = /\.package\(/g;
426
- let m;
427
- while (m = re.exec(text)) {
428
- const win = text.slice(m.index, m.index + 200);
429
- const urlM = /url:\s*"([^"]+)"/.exec(win);
430
- if (!urlM) continue;
431
- const name = (urlM[1].replace(/\.git$/, "").split("/").filter(Boolean).pop() ?? urlM[1]).toLowerCase();
432
- const verM = /"(\d+\.\d+(?:\.\d+)?)"/.exec(win.slice(urlM.index + urlM[0].length));
433
- out.push({ name, ecosystem: "swift", declared: verM?.[1] ?? "*" });
434
- }
435
- }
436
- return out;
437
- }
438
- function dartDeps(files) {
439
- const out = [];
440
- for (const file of files) {
441
- let text;
442
- try {
443
- text = fs3.readFileSync(file, "utf8");
444
- } catch {
445
- continue;
446
- }
447
- let section = "";
448
- for (const raw of text.split("\n")) {
449
- const top = /^([a-z_]+):\s*$/.exec(raw);
450
- if (top) {
451
- section = top[1];
452
- continue;
453
- }
454
- if (section !== "dependencies" && section !== "dev_dependencies") continue;
455
- const m = /^ ([A-Za-z0-9_.]+):\s*(\S.*)?$/.exec(raw);
456
- if (!m || m[1] === "flutter" || m[1] === "sdk") continue;
457
- const declared = (m[2] ?? "").replace(/^["']|["']$/g, "").trim() || "*";
458
- out.push({ name: m[1], ecosystem: "dart", declared });
459
- }
460
- }
461
- return out;
462
- }
463
- function javaDeps(files) {
464
- const out = [];
465
- for (const file of files) {
466
- let text;
467
- try {
468
- text = fs3.readFileSync(file, "utf8");
469
- } catch {
470
- continue;
471
- }
472
- if (path3.basename(file) === "pom.xml") {
473
- for (const block of text.match(/<dependency>[\s\S]*?<\/dependency>/g) ?? []) {
474
- const g = /<groupId>([^<]+)<\/groupId>/.exec(block);
475
- const a = /<artifactId>([^<]+)<\/artifactId>/.exec(block);
476
- if (!g || !a) continue;
477
- const v = /<version>([^<]+)<\/version>/.exec(block);
478
- const declared = v ? v[1].trim().startsWith("${") ? "*" : v[1].trim() : "*";
479
- out.push({ name: `${g[1].trim()}:${a[1].trim()}`, ecosystem: "java", declared });
480
- }
481
- } else {
482
- const re = /(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor)\s*[(]?\s*["']([\w.-]+):([\w.-]+):([^"']+)["']/g;
483
- let m;
484
- while (m = re.exec(text)) out.push({ name: `${m[1]}:${m[2]}`, ecosystem: "java", declared: m[3] });
485
- }
486
- }
487
- return out;
488
- }
489
- async function enrichOnline(records, fetchImpl = globalThis.fetch) {
490
- for (const r of records) {
491
- if (r.ecosystem !== "npm" || !r.installed) continue;
492
- try {
493
- const res = await fetchImpl(`https://registry.npmjs.org/${encodeURIComponent(r.name)}/latest`);
494
- if (!res.ok) continue;
495
- const data = await res.json();
496
- r.latest = data.version;
497
- r.drift = classify(r.installed, r.latest);
498
- } catch {
499
- r.drift = "unknown";
500
- }
501
- }
502
- }
503
- function classify(installed, latest) {
504
- if (!latest) return "unknown";
505
- const a = installed.split(".").map(Number);
506
- const b = latest.split(".").map(Number);
507
- if (a[0] !== b[0]) return "major";
508
- if (a[1] !== b[1]) return "minor";
509
- if (a[2] !== b[2]) return "patch";
510
- return "current";
511
- }
512
- function lockfileVersion(root, ecosystem, name) {
513
- if (ecosystem === "npm") return packageLockVersion(root, name) ?? yarnLockVersion(root, name);
514
- if (ecosystem === "pypi") return pypiLockVersion(root, name);
515
- if (ecosystem === "rust") return tomlPackageLock(root, "Cargo.lock", name, rustName);
516
- if (ecosystem === "ruby") return gemfileLock(root, name);
517
- if (ecosystem === "php") return composerLock(root, name);
518
- if (ecosystem === "dotnet") return packagesLock(root, name);
519
- if (ecosystem === "swift") return packageResolved(root, name);
520
- if (ecosystem === "dart") return pubspecLock(root, name);
521
- if (ecosystem === "java") return gradleLock(root, name);
522
- return void 0;
523
- }
524
- function gradleLock(root, name) {
525
- let text;
526
- try {
527
- text = fs3.readFileSync(path3.join(root, "gradle.lockfile"), "utf8");
528
- } catch {
529
- return void 0;
530
- }
531
- const m = new RegExp(`^${escapeRegExp(name)}:([^=\\s]+)=`, "m").exec(text);
532
- return m ? m[1] : void 0;
533
- }
534
- function packageResolved(root, name) {
535
- let data;
536
- try {
537
- data = JSON.parse(fs3.readFileSync(path3.join(root, "Package.resolved"), "utf8"));
538
- } catch {
539
- return void 0;
540
- }
541
- const pins = data.pins ?? data.object?.pins;
542
- if (!Array.isArray(pins)) return void 0;
543
- const target = name.toLowerCase();
544
- for (const p of pins) {
545
- const id = (p.identity ?? p.package ?? "").toLowerCase();
546
- if (id === target && p.state?.version) return p.state.version;
547
- }
548
- return void 0;
549
- }
550
- function pubspecLock(root, name) {
551
- let text;
552
- try {
553
- text = fs3.readFileSync(path3.join(root, "pubspec.lock"), "utf8");
554
- } catch {
555
- return void 0;
556
- }
557
- let inPkg = false;
558
- for (const line of text.split("\n")) {
559
- const key = /^ ([A-Za-z0-9_.]+):\s*$/.exec(line);
560
- if (key) {
561
- inPkg = key[1] === name;
562
- continue;
563
- }
564
- if (inPkg) {
565
- const vm = /^\s+version:\s*"?([^"\s]+)"?/.exec(line);
566
- if (vm) return vm[1];
567
- }
568
- }
569
- return void 0;
570
- }
571
- function escapeRegExp(s) {
572
- return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
573
- }
574
- function gemfileLock(root, name) {
575
- let text;
576
- try {
577
- text = fs3.readFileSync(path3.join(root, "Gemfile.lock"), "utf8");
578
- } catch {
579
- return void 0;
580
- }
581
- const m = new RegExp(`^ ${escapeRegExp(name)} \\((\\d[^)]*)\\)`, "m").exec(text);
582
- return m ? m[1] : void 0;
583
- }
584
- function composerLock(root, name) {
585
- let data;
586
- try {
587
- data = JSON.parse(fs3.readFileSync(path3.join(root, "composer.lock"), "utf8"));
588
- } catch {
589
- return void 0;
590
- }
591
- for (const section of ["packages", "packages-dev"]) {
592
- const arr = data[section];
593
- if (!Array.isArray(arr)) continue;
594
- const p = arr.find((x) => x && x.name === name);
595
- if (p && typeof p.version === "string") return p.version.replace(/^v/, "");
596
- }
597
- return void 0;
598
- }
599
- function packagesLock(root, name) {
600
- let data;
601
- try {
602
- data = JSON.parse(fs3.readFileSync(path3.join(root, "packages.lock.json"), "utf8"));
603
- } catch {
604
- return void 0;
605
- }
606
- const target = name.toLowerCase();
607
- for (const fw of Object.values(data.dependencies ?? {})) {
608
- if (!fw || typeof fw !== "object") continue;
609
- for (const [id, v] of Object.entries(fw)) {
610
- if (id.toLowerCase() === target && v && typeof v.resolved === "string") return v.resolved;
611
- }
612
- }
613
- return void 0;
614
- }
615
- function pep503(name) {
616
- return name.trim().toLowerCase().replace(/[-_.]+/g, "-");
617
- }
618
- function rustName(name) {
619
- return name.trim().toLowerCase();
620
- }
621
- function pypiLockVersion(root, name) {
622
- return tomlPackageLock(root, "poetry.lock", name, pep503) ?? tomlPackageLock(root, "uv.lock", name, pep503) ?? pipfileLock(root, name);
623
- }
624
- function tomlPackageLock(root, file, name, normalize) {
625
- let text;
626
- try {
627
- text = fs3.readFileSync(path3.join(root, file), "utf8");
628
- } catch {
629
- return void 0;
630
- }
631
- const target = normalize(name);
632
- for (const block of text.split(/\[\[package\]\]/)) {
633
- const nm = /(?:^|\n)\s*name\s*=\s*"([^"]+)"/.exec(block);
634
- if (nm && normalize(nm[1]) === target) {
635
- const ver = /(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(block);
636
- if (ver) return ver[1];
637
- }
638
- }
639
- return void 0;
640
- }
641
- function pipfileLock(root, name) {
642
- let data;
643
- try {
644
- data = JSON.parse(fs3.readFileSync(path3.join(root, "Pipfile.lock"), "utf8"));
645
- } catch {
646
- return void 0;
647
- }
648
- const target = pep503(name);
649
- for (const section of ["default", "develop"]) {
650
- const deps = data[section];
651
- if (!deps || typeof deps !== "object") continue;
652
- for (const [k, v] of Object.entries(deps)) {
653
- if (pep503(k) === target && v && typeof v.version === "string") {
654
- return v.version.replace(/^==/, "");
655
- }
656
- }
657
- }
658
- return void 0;
659
- }
660
- function packageLockVersion(root, name) {
661
- let data;
662
- try {
663
- data = JSON.parse(fs3.readFileSync(path3.join(root, "package-lock.json"), "utf8"));
664
- } catch {
665
- return void 0;
666
- }
667
- const top = data.packages?.[`node_modules/${name}`]?.version;
668
- if (typeof top === "string") return top;
669
- const v1 = data.dependencies?.[name]?.version;
670
- return typeof v1 === "string" ? v1 : void 0;
671
- }
672
- function yarnLockVersion(root, name) {
673
- let text;
674
- try {
675
- text = fs3.readFileSync(path3.join(root, "yarn.lock"), "utf8");
676
- } catch {
677
- return void 0;
678
- }
679
- let inBlock = false;
680
- for (const line of text.split("\n")) {
681
- if (line && !/^\s/.test(line) && !line.startsWith("#")) {
682
- inBlock = headerNamesPackage(line, name);
683
- } else if (inBlock) {
684
- const m = /^\s+version:?\s+"?([^"\s]+)"?/.exec(line);
685
- if (m) return m[1];
686
- }
687
- }
688
- return void 0;
689
- }
690
- function headerNamesPackage(header, name) {
691
- return header.replace(/:\s*$/, "").split(",").some((spec) => {
692
- const s = spec.trim().replace(/^"|"$/g, "");
693
- const at = s.lastIndexOf("@");
694
- if (at <= 0) return false;
695
- const specName = s.slice(0, at);
696
- return specName === name;
697
- });
698
- }
699
-
700
- // src/engine/lib.ts
701
- var LIB_SCHEMA = "vg-lib/1.0";
702
- function catalogPath(root) {
703
- return path3.join(root, "vibgrate.lib.json");
704
- }
705
- function libDir(root) {
706
- return path3.join(root, ".vibgrate", "lib");
707
- }
708
- function libId(name) {
709
- return name.trim().toLowerCase().replace(/^@/, "").replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
710
- }
711
- function loadCatalog(root) {
712
- const file = catalogPath(root);
713
- if (fs3.existsSync(file)) {
714
- try {
715
- const data = JSON.parse(fs3.readFileSync(file, "utf8"));
716
- if (data.schemaVersion === LIB_SCHEMA && data.libraries) return data;
717
- } catch {
718
- }
719
- }
720
- return { schemaVersion: LIB_SCHEMA, libraries: {} };
721
- }
722
- function saveCatalog(root, catalog) {
723
- fs3.writeFileSync(catalogPath(root), `${stableStringify(catalog, 2)}
724
- `);
725
- }
726
- function resolveLib(catalog, name) {
727
- const id = libId(name);
728
- if (catalog.libraries[id]) return catalog.libraries[id];
729
- const lower = name.toLowerCase();
730
- const all = Object.values(catalog.libraries);
731
- return all.find((e) => e.name.toLowerCase() === lower) ?? all.find((e) => e.id.includes(id) || e.name.toLowerCase().includes(lower));
732
- }
733
- function installedVersion(root, name) {
734
- const rec = inventory(root).records.find((r) => r.name === name);
735
- return rec?.installed ?? rec?.declared;
736
- }
737
- var stripRange = (v) => v?.replace(/^[v^~>=<\s]+/, "");
738
- function resolveVersion(root, name) {
739
- const rec = inventory(root).records.find((r) => r.name === name);
740
- const declared = rec?.declared;
741
- const installed = rec?.installed ?? (rec ? installedTreeVersion(root, rec.ecosystem, name) : void 0);
742
- const lockfile = rec ? lockfileVersion(root, rec.ecosystem, name) : void 0;
743
- let mismatch;
744
- if (lockfile && installed && stripRange(lockfile) !== stripRange(installed)) {
745
- mismatch = {
746
- lockfile,
747
- installed,
748
- note: `lockfile pins ${lockfile} but the installed tree has ${installed} \u2014 your install is out of sync with the lockfile (re-install or commit the lock)`
749
- };
750
- }
751
- const served = lockfile ?? installed ?? declared;
752
- const source = lockfile ? "lockfile" : installed ? "installed" : declared ? "declared" : "unknown";
753
- return { served, source, lockfile, installed, declared, mismatch };
754
- }
755
- function driftFor(root, entry) {
756
- const installed = installedVersion(root, entry.name);
757
- if (!installed || entry.version === "*") return { cataloged: entry.version, installed, drift: "unknown" };
758
- const norm = (v) => v.replace(/^[v^~>=<\s]+/, "");
759
- const a = norm(entry.version);
760
- const b = norm(installed);
761
- if (a === b) return { cataloged: entry.version, installed, drift: "current" };
762
- return { cataloged: entry.version, installed, drift: cmp(a, b) < 0 ? "behind" : "ahead" };
763
- }
764
- function cmp(a, b) {
765
- const pa = a.split(".").map(Number);
766
- const pb = b.split(".").map(Number);
767
- for (let i = 0; i < 3; i++) {
768
- const d = (pa[i] || 0) - (pb[i] || 0);
769
- if (d) return d;
770
- }
771
- return 0;
772
- }
773
- function parseGitSource(source) {
774
- if (source.startsWith("git+")) return source.slice(4);
775
- if (/^git@[^:]+:/.test(source)) return source;
776
- if (/\.git\/?$/.test(source)) return source;
777
- return null;
778
- }
779
- async function addLibrary(source, opts) {
780
- const { root } = opts;
781
- let content;
782
- let type = "local";
783
- const gitUrl = parseGitSource(source);
784
- if (gitUrl) {
785
- if (!opts.allowNetwork) {
786
- throw new Error(`refusing to clone ${source} without --online (offline by default)`);
787
- }
788
- content = cloneAndReadGit(gitUrl);
789
- type = "git";
790
- } else if (/^https?:\/\//.test(source)) {
791
- if (!opts.allowNetwork) {
792
- throw new Error(`refusing to fetch ${source} without --online (offline by default)`);
793
- }
794
- const res = await (opts.fetchImpl ?? globalThis.fetch)(source);
795
- if (!res.ok) throw new Error(`fetch failed (${res.status}) for ${source}`);
796
- content = await res.text();
797
- type = source.endsWith("llms.txt") ? "llms.txt" : source.endsWith(".json") ? "openapi" : "website";
798
- } else {
799
- const abs = path3.resolve(root, source);
800
- if (!fs3.existsSync(abs)) throw new Error(`source not found: ${source}`);
801
- content = readLocal(abs);
802
- type = "local";
803
- }
804
- const name = opts.name ?? inferName(source);
805
- const id = libId(name);
806
- const version = opts.version ?? installedVersion(root, name) ?? "*";
807
- fs3.mkdirSync(libDir(root), { recursive: true });
808
- const docFileAbs = path3.join(libDir(root), `${id}.md`);
809
- fs3.writeFileSync(docFileAbs, content);
810
- const entry = {
811
- id,
812
- name,
813
- version,
814
- source: { type, location: source },
815
- docFile: path3.relative(root, docFileAbs).split(path3.sep).join("/"),
816
- docHash: hashString(content),
817
- bytes: Buffer.byteLength(content, "utf8")
818
- };
819
- const catalog = loadCatalog(root);
820
- catalog.libraries[id] = entry;
821
- saveCatalog(root, catalog);
822
- return entry;
823
- }
824
- function readDoc(root, entry) {
825
- const abs = path3.resolve(root, entry.docFile);
826
- return fs3.existsSync(abs) ? fs3.readFileSync(abs, "utf8") : "";
827
- }
828
- function npmPackageDir(root, name) {
829
- let cur = root;
830
- for (let i = 0; i < 12; i++) {
831
- const dir = path3.join(cur, "node_modules", name);
832
- if (fs3.existsSync(path3.join(dir, "package.json"))) return dir;
833
- const parent = path3.dirname(cur);
834
- if (parent === cur) break;
835
- cur = parent;
836
- }
837
- return void 0;
838
- }
839
- function localPackageDocs(root, name) {
840
- const dir = npmPackageDir(root, name);
841
- if (!dir) return void 0;
842
- const version = resolveVersion(root, name).served;
843
- for (const f of ["llms.txt", "README.md", "README.mdx", "README", "readme.md"]) {
844
- const p = path3.join(dir, f);
845
- try {
846
- const docs = fs3.readFileSync(p, "utf8");
847
- if (docs.trim()) {
848
- return { docs, version, source: path3.relative(root, p).split(path3.sep).join("/") };
849
- }
850
- } catch {
851
- }
852
- }
853
- try {
854
- const pkg = JSON.parse(fs3.readFileSync(path3.join(dir, "package.json"), "utf8"));
855
- if (pkg.description?.trim()) {
856
- return {
857
- docs: `# ${name}
858
-
859
- ${pkg.description}`,
860
- version: version ?? pkg.version,
861
- source: path3.relative(root, path3.join(dir, "package.json")).split(path3.sep).join("/")
862
- };
863
- }
864
- } catch {
865
- }
866
- return void 0;
867
- }
868
- function dtsEntry(dir) {
869
- try {
870
- const pkg = JSON.parse(fs3.readFileSync(path3.join(dir, "package.json"), "utf8"));
871
- const rel = pkg.types ?? pkg.typings;
872
- if (typeof rel === "string") {
873
- const p = path3.join(dir, rel);
874
- if (fs3.existsSync(p)) return p;
875
- }
876
- } catch {
877
- }
878
- for (const c of ["index.d.ts", "dist/index.d.ts", "lib/index.d.ts", "types/index.d.ts"]) {
879
- const p = path3.join(dir, c);
880
- if (fs3.existsSync(p)) return p;
881
- }
882
- return void 0;
883
- }
884
- function extractDtsApi(src, maxDecls = 200) {
885
- const out = [];
886
- let depth = 0;
887
- let capture = null;
888
- for (const raw of src.split("\n")) {
889
- const line = raw.trim();
890
- if (capture === null && depth === 0 && /^export\b/.test(line) && !/^export\s+(\{|\*|default\b|type\s+\{)/.test(line)) {
891
- capture = [];
892
- }
893
- if (capture) capture.push(raw);
894
- for (const ch of raw) {
895
- if (ch === "{") depth++;
896
- else if (ch === "}") depth = Math.max(0, depth - 1);
897
- }
898
- if (capture && depth === 0 && /[;}]\s*$/.test(line)) {
899
- out.push(capture.join("\n").trim());
900
- capture = null;
901
- if (out.length >= maxDecls) break;
902
- }
903
- }
904
- return out;
905
- }
906
- function localApiSurface(root, name) {
907
- const dir = npmPackageDir(root, name);
908
- if (!dir) return void 0;
909
- const dts = dtsEntry(dir);
910
- if (!dts) return void 0;
911
- let src;
912
- try {
913
- src = fs3.readFileSync(dts, "utf8");
914
- } catch {
915
- return void 0;
916
- }
917
- const decls = extractDtsApi(src);
918
- return decls.length ? decls.join("\n\n") : void 0;
919
- }
920
- function cloneAndReadGit(url) {
921
- const dir = fs3.mkdtempSync(path3.join(os.tmpdir(), "vg-lib-git-"));
922
- try {
923
- execFileSync("git", ["clone", "--depth", "1", "--quiet", url, dir], {
924
- stdio: ["ignore", "ignore", "pipe"]
925
- });
926
- } catch (err) {
927
- fs3.rmSync(dir, { recursive: true, force: true });
928
- const detail = err instanceof Error && err.message ? `: ${err.message.split("\n")[0]}` : "";
929
- throw new Error(`git clone failed for ${url}${detail}`);
930
- }
931
- try {
932
- return readGitDocs(dir);
933
- } finally {
934
- fs3.rmSync(dir, { recursive: true, force: true });
935
- }
936
- }
937
- function readGitDocs(dir) {
938
- const docsDir = path3.join(dir, "docs");
939
- if (fs3.existsSync(docsDir) && fs3.statSync(docsDir).isDirectory()) return readLocal(docsDir);
940
- const readme = ["README.md", "README.mdx", "README.txt", "README.rst", "readme.md"].map((f) => path3.join(dir, f)).find((p) => fs3.existsSync(p));
941
- if (readme) return fs3.readFileSync(readme, "utf8");
942
- return readLocal(dir);
943
- }
944
- function readLocal(abs) {
945
- const stat = fs3.statSync(abs);
946
- if (stat.isFile()) return fs3.readFileSync(abs, "utf8");
947
- const parts = [];
948
- const files = fs3.readdirSync(abs, { withFileTypes: true }).filter((e) => e.isFile() && /\.(md|mdx|txt|rst)$/i.test(e.name)).map((e) => e.name).sort();
949
- for (const f of files) parts.push(`<!-- ${f} -->
950
- ${fs3.readFileSync(path3.join(abs, f), "utf8")}`);
951
- return parts.join("\n\n");
952
- }
953
- function inferName(source) {
954
- const cleaned = source.replace(/^git\+/, "").replace(/\.git\/?$/i, "");
955
- const base = cleaned.replace(/\/+$/, "").split(/[/:]/).pop() ?? cleaned;
956
- return base.replace(/\.(md|mdx|txt|rst|json)$/i, "").replace(/^llms$/, "docs");
957
- }
958
-
959
- export { ECOSYSTEMS, addLibrary, catalogPath, driftFor, enrichOnline, findNodes, inventory, libDir, libId, loadCatalog, localApiSurface, localPackageDocs, nodeById, readDoc, resolveLib, resolveOne, resolveVersion, saveCatalog };
960
- //# sourceMappingURL=chunk-GGJZA3Q6.js.map
961
- //# sourceMappingURL=chunk-GGJZA3Q6.js.map