@vibgrate/cli 2026.729.3 → 2026.730.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-Z4Z66IGM.js → agent-33BMKWJC.js} +4 -4
- package/dist/{agent-Z4Z66IGM.js.map → agent-33BMKWJC.js.map} +1 -1
- package/dist/baseline-V6MYDEMS.js +9 -0
- package/dist/{baseline-Q3QQF5QF.js.map → baseline-V6MYDEMS.js.map} +1 -1
- package/dist/{chunk-JXMZCTVZ.js → chunk-5G7C6H2G.js} +14 -204
- package/dist/chunk-5G7C6H2G.js.map +1 -0
- package/dist/{chunk-RIEUPFXO.js → chunk-6D4BCGRQ.js} +6 -62
- package/dist/chunk-6D4BCGRQ.js.map +1 -0
- package/dist/{chunk-YMSXP6AO.js → chunk-6WNJJXFY.js} +4 -4
- package/dist/{chunk-YMSXP6AO.js.map → chunk-6WNJJXFY.js.map} +1 -1
- package/dist/{chunk-HWFVBYX4.js → chunk-CFL3QQQZ.js} +7 -6
- package/dist/chunk-CFL3QQQZ.js.map +1 -0
- package/dist/{chunk-EQ3IOFIG.js → chunk-CQDCZQFV.js} +3 -3
- package/dist/{chunk-EQ3IOFIG.js.map → chunk-CQDCZQFV.js.map} +1 -1
- package/dist/{chunk-KBPNH67Q.js → chunk-DBMYWNLC.js} +3 -3
- package/dist/{chunk-KBPNH67Q.js.map → chunk-DBMYWNLC.js.map} +1 -1
- package/dist/{chunk-5MNX3OLS.js → chunk-EKCNSRNJ.js} +7 -6
- package/dist/chunk-EKCNSRNJ.js.map +1 -0
- package/dist/{chunk-G4HTI4ZM.js → chunk-FHJBGPJZ.js} +3 -2
- package/dist/chunk-FHJBGPJZ.js.map +1 -0
- package/dist/{chunk-3FQSBVQD.js → chunk-GLT3N7T2.js} +8 -5
- package/dist/chunk-GLT3N7T2.js.map +1 -0
- package/dist/chunk-HTLDXEHW.js +60 -0
- package/dist/chunk-HTLDXEHW.js.map +1 -0
- package/dist/{chunk-GI6W53LM.js → chunk-IDAQV3NQ.js} +4 -2
- package/dist/chunk-IDAQV3NQ.js.map +1 -0
- package/dist/{chunk-42RDYQFF.js → chunk-KGWEBM2J.js} +3 -3
- package/dist/{chunk-42RDYQFF.js.map → chunk-KGWEBM2J.js.map} +1 -1
- package/dist/{chunk-4BOWWYSE.js → chunk-ON7PZNYV.js} +12 -11
- package/dist/chunk-ON7PZNYV.js.map +1 -0
- package/dist/chunk-Q4UQ73NA.js +6 -0
- package/dist/{chunk-N3HCPBFY.js.map → chunk-Q4UQ73NA.js.map} +1 -1
- package/dist/chunk-TJ3WIJ7H.js +216 -0
- package/dist/chunk-TJ3WIJ7H.js.map +1 -0
- package/dist/chunk-VOEYUAER.js +203 -0
- package/dist/chunk-VOEYUAER.js.map +1 -0
- package/dist/cli.js +390 -507
- package/dist/cli.js.map +1 -1
- package/dist/{fs-6JKZNQ3U.js → fs-HNR6LAI7.js} +3 -3
- package/dist/fs-HNR6LAI7.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/{interactive-MJVMY5JP.js → interactive-NJG6467J.js} +16 -14
- package/dist/interactive-NJG6467J.js.map +1 -0
- package/dist/load-YPSEDYIW.js +10 -0
- package/dist/{load-4PARCNMD.js.map → load-YPSEDYIW.js.map} +1 -1
- package/dist/run-outcome-5FQWHWYK.js +253 -0
- package/dist/run-outcome-5FQWHWYK.js.map +1 -0
- package/dist/{runtime-session-AILFASQV.js → runtime-session-Y4ZD3QDO.js} +7 -6
- package/dist/{runtime-session-AILFASQV.js.map → runtime-session-Y4ZD3QDO.js.map} +1 -1
- package/dist/{stream-json-MTPWWVRR.js → stream-json-3YOPU3LF.js} +4 -4
- package/dist/{stream-json-MTPWWVRR.js.map → stream-json-3YOPU3LF.js.map} +1 -1
- package/dist/{vg-mcp-bridge-BLHEIWMT.js → vg-mcp-bridge-PZFGTZSA.js} +8 -7
- package/dist/vg-mcp-bridge-PZFGTZSA.js.map +1 -0
- package/dist/{vgd-S7D2SITC.js → vgd-DH7AHQ23.js} +6 -5
- package/dist/vgd-DH7AHQ23.js.map +1 -0
- package/package.json +1 -1
- package/dist/baseline-Q3QQF5QF.js +0 -9
- package/dist/chunk-3FQSBVQD.js.map +0 -1
- package/dist/chunk-4BOWWYSE.js.map +0 -1
- package/dist/chunk-5MNX3OLS.js.map +0 -1
- package/dist/chunk-G4HTI4ZM.js.map +0 -1
- package/dist/chunk-GI6W53LM.js.map +0 -1
- package/dist/chunk-HWFVBYX4.js.map +0 -1
- package/dist/chunk-JXMZCTVZ.js.map +0 -1
- package/dist/chunk-N3HCPBFY.js +0 -6
- package/dist/chunk-RIEUPFXO.js.map +0 -1
- package/dist/fs-6JKZNQ3U.js.map +0 -1
- package/dist/interactive-MJVMY5JP.js.map +0 -1
- package/dist/load-4PARCNMD.js +0 -9
- package/dist/vg-mcp-bridge-BLHEIWMT.js.map +0 -1
- package/dist/vgd-S7D2SITC.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CONTEXT_POLICY_VERSION, DISCOVERY_TOOLS, MUTATION_TOOLS, compact, runAgent } from './chunk-
|
|
1
|
+
export { CONTEXT_POLICY_VERSION, DISCOVERY_TOOLS, MUTATION_TOOLS, compact, runAgent } from './chunk-KGWEBM2J.js';
|
|
2
2
|
import './chunk-543E6WDJ.js';
|
|
3
3
|
import './chunk-MYM5VIJ4.js';
|
|
4
4
|
import './chunk-REIGWTTH.js';
|
|
@@ -6,7 +6,7 @@ import './chunk-RGEVBSLK.js';
|
|
|
6
6
|
import './chunk-RBIRXQR6.js';
|
|
7
7
|
import './chunk-5HYCB55P.js';
|
|
8
8
|
import './chunk-IPICO2RV.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-FHJBGPJZ.js';
|
|
10
10
|
export { summarizeCapsule } from './chunk-US2DAKCM.js';
|
|
11
11
|
import './chunk-3LSG7Z4I.js';
|
|
12
12
|
import './chunk-J7LKEB2R.js';
|
|
@@ -18,5 +18,5 @@ import './chunk-BWPBB45M.js';
|
|
|
18
18
|
import './chunk-JFGYT6BI.js';
|
|
19
19
|
import './chunk-BPF3YX2U.js';
|
|
20
20
|
import './chunk-Z6ZWNWWR.js';
|
|
21
|
-
//# sourceMappingURL=agent-
|
|
22
|
-
//# sourceMappingURL=agent-
|
|
21
|
+
//# sourceMappingURL=agent-33BMKWJC.js.map
|
|
22
|
+
//# sourceMappingURL=agent-33BMKWJC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-33BMKWJC.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { baselineCommand, runBaseline } from './chunk-6WNJJXFY.js';
|
|
2
|
+
import './chunk-ON7PZNYV.js';
|
|
3
|
+
import './chunk-CRAMOEBE.js';
|
|
4
|
+
import './chunk-RXP66R2E.js';
|
|
5
|
+
import './chunk-Q4UQ73NA.js';
|
|
6
|
+
import './chunk-IDAQV3NQ.js';
|
|
7
|
+
import './chunk-Z6ZWNWWR.js';
|
|
8
|
+
//# sourceMappingURL=baseline-V6MYDEMS.js.map
|
|
9
|
+
//# sourceMappingURL=baseline-V6MYDEMS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-V6MYDEMS.js"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { VERSION } from './chunk-
|
|
2
|
-
import { parseGraph, stableStringify, serializeGraph
|
|
1
|
+
import { VERSION } from './chunk-Q4UQ73NA.js';
|
|
2
|
+
import { parseGraph, stableStringify, serializeGraph } from './chunk-ZKNB4YH4.js';
|
|
3
3
|
import { globalGraphPathForRef, globalGraphPath, repositoryStoreDir } from './chunk-BWPBB45M.js';
|
|
4
4
|
import { detectGitRef } from './chunk-BPF3YX2U.js';
|
|
5
|
-
import { __require } from './chunk-Z6ZWNWWR.js';
|
|
6
5
|
import * as fs2 from 'fs';
|
|
7
|
-
import * as path from 'path';
|
|
8
6
|
import * as zlib from 'zlib';
|
|
9
7
|
import { Packr } from 'msgpackr';
|
|
8
|
+
import * as path from 'path';
|
|
10
9
|
|
|
11
10
|
var MAGIC = Buffer.from("VGSNAP1\0", "latin1");
|
|
12
11
|
var crc322 = zlib.crc32 ?? jsCrc32;
|
|
@@ -291,8 +290,6 @@ ${embedded}
|
|
|
291
290
|
function esc(s) {
|
|
292
291
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
293
292
|
}
|
|
294
|
-
|
|
295
|
-
// src/engine/artifacts.ts
|
|
296
293
|
function vibgrateDir(root) {
|
|
297
294
|
return path.join(root, ".vibgrate");
|
|
298
295
|
}
|
|
@@ -339,7 +336,14 @@ var DEFAULT_GITIGNORE = [
|
|
|
339
336
|
"graph.html",
|
|
340
337
|
"GRAPH_REPORT.md",
|
|
341
338
|
"facts.jsonl",
|
|
342
|
-
"mcp-navigation.json"
|
|
339
|
+
"mcp-navigation.json",
|
|
340
|
+
// Machine-local telemetry the LSP/`vg code` accrue over time — never meant
|
|
341
|
+
// for git: score-history.jsonl is per-machine trend data (lsp/score-history.ts),
|
|
342
|
+
// run-outcomes.jsonl is per-machine agent-run telemetry (code/run-outcome.ts).
|
|
343
|
+
// Neither is a snapshot artifact like scan_result.json/baseline.json, which
|
|
344
|
+
// are intentionally left out of this list for a user to commit if they choose.
|
|
345
|
+
"score-history.jsonl",
|
|
346
|
+
"run-outcomes.jsonl"
|
|
343
347
|
];
|
|
344
348
|
function ensureVibgrateGitignore(root) {
|
|
345
349
|
const file = path.join(vibgrateDir(root), ".gitignore");
|
|
@@ -409,200 +413,6 @@ function isPathInside(child, parent) {
|
|
|
409
413
|
return rel === "" || !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
410
414
|
}
|
|
411
415
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
// src/engine/index-db.ts
|
|
416
|
-
function indexDbPath(root) {
|
|
417
|
-
return path.join(cacheDir(root), "graph.db");
|
|
418
|
-
}
|
|
419
|
-
function writeGraphIndex(root, graph) {
|
|
420
|
-
const file = indexDbPath(root);
|
|
421
|
-
try {
|
|
422
|
-
const { DatabaseSync } = __require("sqlite");
|
|
423
|
-
fs2.mkdirSync(path.dirname(file), { recursive: true });
|
|
424
|
-
const tmp = `${file}.${process.pid}.tmp`;
|
|
425
|
-
try {
|
|
426
|
-
if (fs2.existsSync(tmp)) fs2.unlinkSync(tmp);
|
|
427
|
-
} catch {
|
|
428
|
-
}
|
|
429
|
-
const db = new DatabaseSync(tmp);
|
|
430
|
-
db.exec(`
|
|
431
|
-
PRAGMA journal_mode = OFF;
|
|
432
|
-
PRAGMA synchronous = OFF;
|
|
433
|
-
CREATE TABLE meta (
|
|
434
|
-
key TEXT PRIMARY KEY,
|
|
435
|
-
value TEXT NOT NULL
|
|
436
|
-
);
|
|
437
|
-
CREATE TABLE nodes (
|
|
438
|
-
id TEXT PRIMARY KEY,
|
|
439
|
-
name TEXT NOT NULL,
|
|
440
|
-
qualified_name TEXT NOT NULL,
|
|
441
|
-
kind TEXT NOT NULL,
|
|
442
|
-
file TEXT NOT NULL,
|
|
443
|
-
line INTEGER NOT NULL,
|
|
444
|
-
importance REAL NOT NULL,
|
|
445
|
-
area INTEGER NOT NULL,
|
|
446
|
-
is_hub INTEGER NOT NULL,
|
|
447
|
-
lang TEXT NOT NULL,
|
|
448
|
-
json TEXT NOT NULL
|
|
449
|
-
);
|
|
450
|
-
CREATE TABLE edges (
|
|
451
|
-
id TEXT PRIMARY KEY,
|
|
452
|
-
kind TEXT NOT NULL,
|
|
453
|
-
src TEXT NOT NULL,
|
|
454
|
-
dst TEXT NOT NULL,
|
|
455
|
-
resolution TEXT NOT NULL,
|
|
456
|
-
confidence REAL NOT NULL,
|
|
457
|
-
epistemic TEXT NOT NULL,
|
|
458
|
-
json TEXT NOT NULL
|
|
459
|
-
);
|
|
460
|
-
CREATE TABLE areas (
|
|
461
|
-
id INTEGER PRIMARY KEY,
|
|
462
|
-
json TEXT NOT NULL
|
|
463
|
-
);
|
|
464
|
-
CREATE INDEX idx_nodes_name ON nodes(name);
|
|
465
|
-
CREATE INDEX idx_nodes_qn ON nodes(qualified_name);
|
|
466
|
-
CREATE INDEX idx_nodes_file ON nodes(file);
|
|
467
|
-
CREATE INDEX idx_edges_src ON edges(src);
|
|
468
|
-
CREATE INDEX idx_edges_dst ON edges(dst);
|
|
469
|
-
CREATE INDEX idx_edges_kind ON edges(kind);
|
|
470
|
-
`);
|
|
471
|
-
const insMeta = db.prepare("INSERT INTO meta(key, value) VALUES (?, ?)");
|
|
472
|
-
insMeta.run("corpusHash", graph.provenance.corpusHash);
|
|
473
|
-
insMeta.run("schemaVersion", graph.schemaVersion);
|
|
474
|
-
insMeta.run("generatedAt", graph.generatedAt);
|
|
475
|
-
insMeta.run("nodeCount", String(graph.nodes.length));
|
|
476
|
-
insMeta.run("edgeCount", String(graph.edges.length));
|
|
477
|
-
insMeta.run("analysisTier", graph.meta.analysisTier ?? "full");
|
|
478
|
-
insMeta.run("indexVersion", "vg-graph-index/2");
|
|
479
|
-
insMeta.run("graphMeta", JSON.stringify(graph.meta));
|
|
480
|
-
insMeta.run("graphProvenance", JSON.stringify(graph.provenance));
|
|
481
|
-
if (graph.facts) insMeta.run("factsJson", JSON.stringify(graph.facts));
|
|
482
|
-
if (graph.grounding) insMeta.run("groundingJson", JSON.stringify(graph.grounding));
|
|
483
|
-
if (graph.summaries) insMeta.run("summariesJson", JSON.stringify(graph.summaries));
|
|
484
|
-
if (graph.unknowns) insMeta.run("unknownsJson", JSON.stringify(graph.unknowns));
|
|
485
|
-
const insNode = db.prepare(
|
|
486
|
-
`INSERT INTO nodes(id, name, qualified_name, kind, file, line, importance, area, is_hub, lang, json)
|
|
487
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
488
|
-
);
|
|
489
|
-
for (const n of graph.nodes) {
|
|
490
|
-
insNode.run(
|
|
491
|
-
n.id,
|
|
492
|
-
n.name,
|
|
493
|
-
n.qualifiedName,
|
|
494
|
-
n.kind,
|
|
495
|
-
n.file,
|
|
496
|
-
n.span.start,
|
|
497
|
-
n.importance,
|
|
498
|
-
n.area,
|
|
499
|
-
n.isHub ? 1 : 0,
|
|
500
|
-
n.lang,
|
|
501
|
-
JSON.stringify(n)
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
const insEdge = db.prepare(
|
|
505
|
-
`INSERT INTO edges(id, kind, src, dst, resolution, confidence, epistemic, json)
|
|
506
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`
|
|
507
|
-
);
|
|
508
|
-
for (const e of graph.edges) {
|
|
509
|
-
insEdge.run(
|
|
510
|
-
e.id,
|
|
511
|
-
e.kind,
|
|
512
|
-
e.src,
|
|
513
|
-
e.dst,
|
|
514
|
-
e.resolution,
|
|
515
|
-
e.confidence,
|
|
516
|
-
e.epistemic ?? "observed",
|
|
517
|
-
JSON.stringify(e)
|
|
518
|
-
);
|
|
519
|
-
}
|
|
520
|
-
const insArea = db.prepare("INSERT INTO areas(id, json) VALUES (?, ?)");
|
|
521
|
-
for (const a of graph.areas) {
|
|
522
|
-
insArea.run(a.id, JSON.stringify(a));
|
|
523
|
-
}
|
|
524
|
-
db.close();
|
|
525
|
-
fs2.renameSync(tmp, file);
|
|
526
|
-
return { path: file, nodes: graph.nodes.length, edges: graph.edges.length, ok: true };
|
|
527
|
-
} catch (err) {
|
|
528
|
-
return {
|
|
529
|
-
path: file,
|
|
530
|
-
nodes: 0,
|
|
531
|
-
edges: 0,
|
|
532
|
-
ok: false,
|
|
533
|
-
reason: err.message
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
function loadGraphFromIndex(root) {
|
|
538
|
-
const file = indexDbPath(root);
|
|
539
|
-
if (!fs2.existsSync(file)) return null;
|
|
540
|
-
try {
|
|
541
|
-
const { DatabaseSync } = __require("sqlite");
|
|
542
|
-
const db = new DatabaseSync(file, { readOnly: true });
|
|
543
|
-
const metaRows = db.prepare("SELECT key, value FROM meta").all();
|
|
544
|
-
const meta = {};
|
|
545
|
-
for (const r of metaRows) meta[r.key] = r.value;
|
|
546
|
-
if (meta.indexVersion !== "vg-graph-index/2" || !meta.graphMeta || !meta.graphProvenance) {
|
|
547
|
-
db.close();
|
|
548
|
-
return null;
|
|
549
|
-
}
|
|
550
|
-
const nodeRows = db.prepare("SELECT json FROM nodes ORDER BY id").all();
|
|
551
|
-
const edgeRows = db.prepare("SELECT json FROM edges ORDER BY id").all();
|
|
552
|
-
const areaRows = db.prepare("SELECT json FROM areas ORDER BY id").all();
|
|
553
|
-
db.close();
|
|
554
|
-
const nodes = nodeRows.map((r) => JSON.parse(r.json));
|
|
555
|
-
const edges = edgeRows.map((r) => JSON.parse(r.json));
|
|
556
|
-
const areas = areaRows.map((r) => JSON.parse(r.json));
|
|
557
|
-
nodes.sort((a, b) => a.id.localeCompare(b.id));
|
|
558
|
-
edges.sort(
|
|
559
|
-
(a, b) => a.kind.localeCompare(b.kind) || a.src.localeCompare(b.src) || a.dst.localeCompare(b.dst)
|
|
560
|
-
);
|
|
561
|
-
areas.sort((a, b) => a.id - b.id);
|
|
562
|
-
const graph = {
|
|
563
|
-
schemaVersion: meta.schemaVersion || SCHEMA_VERSION,
|
|
564
|
-
generatedAt: meta.generatedAt ?? (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
565
|
-
provenance: JSON.parse(meta.graphProvenance),
|
|
566
|
-
meta: JSON.parse(meta.graphMeta),
|
|
567
|
-
nodes,
|
|
568
|
-
edges,
|
|
569
|
-
areas
|
|
570
|
-
};
|
|
571
|
-
if (meta.factsJson) graph.facts = JSON.parse(meta.factsJson);
|
|
572
|
-
if (meta.groundingJson) graph.grounding = JSON.parse(meta.groundingJson);
|
|
573
|
-
if (meta.summariesJson) graph.summaries = JSON.parse(meta.summariesJson);
|
|
574
|
-
if (meta.unknownsJson) graph.unknowns = JSON.parse(meta.unknownsJson);
|
|
575
|
-
for (const e of edges) {
|
|
576
|
-
if (!e.resolution) e.resolution = "heuristic";
|
|
577
|
-
if (!e.epistemic) e.epistemic = "observed";
|
|
578
|
-
}
|
|
579
|
-
return graph;
|
|
580
|
-
} catch {
|
|
581
|
-
return null;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
function loadGraphPreferIndex(root, graphJsonPath) {
|
|
585
|
-
const jsonGraph = loadGraphFileWithSnapshot(graphJsonPath);
|
|
586
|
-
const fromIndex = loadGraphFromIndex(root);
|
|
587
|
-
if (fromIndex) {
|
|
588
|
-
if (!jsonGraph || fromIndex.provenance.corpusHash === jsonGraph.provenance.corpusHash) {
|
|
589
|
-
return { graph: fromIndex, source: "index" };
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
if (jsonGraph) return { graph: jsonGraph, source: "json" };
|
|
593
|
-
return null;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// src/engine/load.ts
|
|
597
|
-
function loadGraph(root, graphPath) {
|
|
598
|
-
const file = resolveGraphPath(root, graphPath);
|
|
599
|
-
if (!graphPath) {
|
|
600
|
-
const preferred = loadGraphPreferIndex(root, file);
|
|
601
|
-
if (preferred) return preferred.graph;
|
|
602
|
-
}
|
|
603
|
-
return loadGraphFileWithSnapshot(file);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
export { SCHEMA_VERSION, defaultGraphPath, ensureVibgrateGitignore, legacyGraphPath, loadGraph, loadGraphFileWithSnapshot, loadGraphPreferIndex, mapFileExists, mapFileStat, preferInRepoGraph, renderHtml, renderReport, resolveGraphPath, vibgrateDir, writeArtifacts, writeGraphIndex };
|
|
607
|
-
//# sourceMappingURL=chunk-JXMZCTVZ.js.map
|
|
608
|
-
//# sourceMappingURL=chunk-JXMZCTVZ.js.map
|
|
416
|
+
export { defaultGraphPath, ensureVibgrateGitignore, legacyGraphPath, loadGraphFileWithSnapshot, mapFileExists, mapFileStat, preferInRepoGraph, renderHtml, renderReport, resolveGraphPath, vibgrateDir, writeArtifacts };
|
|
417
|
+
//# sourceMappingURL=chunk-5G7C6H2G.js.map
|
|
418
|
+
//# sourceMappingURL=chunk-5G7C6H2G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/engine/snapshot.ts","../src/engine/report.ts","../src/engine/html.ts","../src/engine/artifacts.ts"],"names":["crc32","fs","legacy"],"mappings":";;;;;;;;;AAsCA,IAAM,KAAA,GAAQ,MAAA,CAAO,IAAA,CAAK,WAAA,EAAa,QAAQ,CAAA;AAG/C,IAAMA,SAA2C,IAAA,CAAA,KAAA,IAAS,OAAA;AAE1D,IAAI,QAAA,GAA+B,IAAA;AAEnC,SAAS,QAAQ,IAAA,EAA0B;AACzC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,QAAA,GAAW,IAAI,YAAY,GAAG,CAAA;AAC9B,IAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,GAAA,EAAK,CAAA,EAAA,EAAK;AAC5B,MAAA,IAAI,CAAA,GAAI,CAAA;AACR,MAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA,EAAA,EAAK,CAAA,GAAI,CAAA,GAAI,CAAA,GAAI,UAAA,GAAc,CAAA,KAAM,CAAA,GAAK,CAAA,KAAM,CAAA;AACvE,MAAA,QAAA,CAAS,CAAC,IAAI,CAAA,KAAM,CAAA;AAAA,IACtB;AAAA,EACF;AACA,EAAA,IAAI,GAAA,GAAM,UAAA;AACV,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK,GAAA,GAAM,QAAA,CAAA,CAAU,GAAA,GAAM,IAAA,CAA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Q,MAAO,CAAC,GAAA,CAAI,WAAW,IAAI,CAAA,IAAK,CAAM,IAAA,CAAA,UAAA,CAAW,GAAG,CAAA;AACrE","file":"chunk-5G7C6H2G.js","sourcesContent":["import * as fs from 'node:fs';\nimport * as zlib from 'node:zlib';\nimport { Packr } from 'msgpackr';\nimport { parseGraph } from './serialize.js';\nimport { VERSION } from '../version.js';\nimport type { VgGraph } from '../schema.js';\n\n/**\n * Binary graph snapshot — a derived, local **cache** beside `graph.json`.\n *\n * `graph.json` stays the canonical, committed, human-diffable artifact and the\n * only interchange format (`vg export` / `share` / `bundle` are unchanged); the\n * determinism contract attaches to it, not to this file. The snapshot exists\n * purely so hot paths (`vg ask`/`serve`/`code`, vgd session attach) skip the\n * large-string `JSON.parse` on load and the pretty-print on write — measured\n * ~2.6× faster cold load and ~4× faster encode on XL maps, at ~40% of the size.\n *\n * Robustness rules (each one keeps JSON as the unquestioned fallback):\n * - The loader trusts a snapshot only when its recorded (size, mtimeMs) of\n * the source `graph.json` still match — any rebuild or hand-edit of the\n * JSON silently invalidates it. Staleness never needs to parse the JSON.\n * - A CRC-32 over the payload rejects torn/corrupted files; any decode error\n * (unknown magic, short file, bad msgpack, version skew) returns null\n * rather than throwing, and the caller re-reads JSON and rewrites the\n * snapshot (\"self-healing\" — first load after upgrade migrates for free).\n * - Writes are atomic (temp + rename) and best-effort: a full disk or\n * read-only store must never fail a build or a query.\n * - The engine VERSION is recorded and must match: the msgpack record layout\n * tracks the in-memory graph shape, which may change between releases.\n *\n * Format: MAGIC (\"VGSNAP1\\0\") · u32LE header length · msgpack header\n * {engine, sourceSize, sourceMtimeMs, crc32} · msgpack graph payload.\n * Everything is explicit little-endian via DataView/Buffer — no platform\n * variance. msgpackr runs its pure-JS path (its native accelerator is an\n * optional dependency we do not rely on); a fresh Packr per encode/decode\n * keeps record-id assignment deterministic for identical input.\n */\n\nconst MAGIC = Buffer.from('VGSNAP1\\0', 'latin1');\n\n/** node:zlib gained crc32 in 22.2; fall back to a table crc for 22.0/22.1. */\nconst crc32: (data: Uint8Array) => number = zlib.crc32 ?? jsCrc32;\n\nlet crcTable: Uint32Array | null = null;\n\nfunction jsCrc32(data: Uint8Array): number {\n if (!crcTable) {\n crcTable = new Uint32Array(256);\n for (let n = 0; n < 256; n++) {\n let c = n;\n for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n crcTable[n] = c >>> 0;\n }\n }\n let crc = 0xffffffff;\n for (let i = 0; i < data.length; i++) crc = crcTable[(crc ^ data[i]) & 0xff] ^ (crc >>> 8);\n return (crc ^ 0xffffffff) >>> 0;\n}\n\ninterface SnapshotHeader {\n engine: string;\n crc32: number;\n /**\n * True when the snapshot IS the map (global-store mode, no graph.json\n * beside it). False/absent = sidecar of a canonical graph.json, valid only\n * while that JSON's recorded stat still matches.\n */\n standalone?: boolean;\n sourceSize?: number;\n sourceMtimeMs?: number;\n}\n\n/** Sidecar path for a map file: `…/graph.json` → `…/graph.snap`. */\nexport function snapshotPathFor(graphPath: string): string {\n return graphPath.endsWith('.json') ? `${graphPath.slice(0, -5)}.snap` : `${graphPath}.snap`;\n}\n\nfunction newPackr(): Packr {\n return new Packr({ useRecords: true });\n}\n\n/** Msgpack payload bytes for a graph (exported for the determinism test). */\nexport function encodeGraphPayload(graph: VgGraph): Buffer {\n return Buffer.from(newPackr().pack(graph));\n}\n\n/**\n * Write the snapshot beside `graphPath`.\n *\n * Sidecar mode (default): call after `graph.json` is on disk — the header\n * records its stat so readers can cheaply detect staleness.\n * `standalone: true` (global-store mode): the snapshot IS the map; no\n * `graph.json` is required or consulted.\n * Best-effort: returns false (never throws) when the file can't be written.\n */\nexport function writeGraphSnapshot(\n graphPath: string,\n graph: VgGraph,\n opts: { standalone?: boolean } = {},\n): boolean {\n try {\n const payload = encodeGraphPayload(graph);\n let header: Buffer;\n if (opts.standalone) {\n header = newPackr().pack({\n engine: VERSION,\n crc32: crc32(payload),\n standalone: true,\n } satisfies SnapshotHeader);\n } else {\n const stat = fs.statSync(graphPath);\n header = newPackr().pack({\n engine: VERSION,\n sourceSize: stat.size,\n sourceMtimeMs: stat.mtimeMs,\n crc32: crc32(payload),\n } satisfies SnapshotHeader);\n }\n const lenBuf = Buffer.alloc(4);\n lenBuf.writeUInt32LE(header.length, 0);\n const file = snapshotPathFor(graphPath);\n const tmp = `${file}.${process.pid}.tmp`;\n try {\n fs.writeFileSync(tmp, Buffer.concat([MAGIC, lenBuf, header, payload]));\n fs.renameSync(tmp, file);\n } catch (err) {\n fs.rmSync(tmp, { force: true });\n throw err;\n }\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Load the snapshot for `graphPath`, or null when it is absent, stale,\n * or corrupted.\n *\n * Sidecar snapshots additionally require their source `graph.json` to exist\n * with an unchanged stat AND an identical engine version — the JSON fallback\n * is free, so any doubt invalidates. Standalone snapshots are the map itself:\n * they are accepted on magic + CRC + a structural sanity check, including\n * across engine versions (msgpack embeds its record layout, so an older\n * snapshot decodes the same way an older committed graph.json would parse).\n */\nexport function readGraphSnapshot(graphPath: string): VgGraph | null {\n try {\n const file = snapshotPathFor(graphPath);\n if (!fs.existsSync(file)) return null;\n const raw = fs.readFileSync(file);\n if (raw.length < MAGIC.length + 4 || !raw.subarray(0, MAGIC.length).equals(MAGIC)) return null;\n const headerLen = raw.readUInt32LE(MAGIC.length);\n const payloadStart = MAGIC.length + 4 + headerLen;\n if (payloadStart > raw.length) return null;\n const header = newPackr().unpack(raw.subarray(MAGIC.length + 4, payloadStart)) as SnapshotHeader;\n if (!header.standalone) {\n if (header.engine !== VERSION) return null;\n const sourceStat = fs.statSync(graphPath); // no source JSON → nothing to be a cache of\n if (header.sourceSize !== sourceStat.size || header.sourceMtimeMs !== sourceStat.mtimeMs) return null;\n }\n const payload = raw.subarray(payloadStart);\n if (crc32(payload) !== header.crc32) return null;\n const graph = newPackr().unpack(payload) as VgGraph;\n if (!graph || !Array.isArray(graph.nodes) || !Array.isArray(graph.edges)) return null;\n return graph;\n } catch {\n return null;\n }\n}\n\n/**\n * Does a map exist at `graphPath` in either representation — the canonical\n * `graph.json`, or a standalone binary snapshot (global-store mode)?\n * Cheap: reads only the snapshot header, never the payload or the JSON.\n */\nexport function mapFileExists(graphPath: string): boolean {\n if (fs.existsSync(graphPath)) return true;\n return readSnapshotHeader(snapshotPathFor(graphPath))?.standalone === true;\n}\n\n/**\n * Stat for \"did the map change on disk\" mtime tracking: the JSON when\n * present, else the standalone snapshot file. Throws when neither exists —\n * same contract callers had with `fs.statSync(graphPath)`.\n */\nexport function mapFileStat(graphPath: string): fs.Stats {\n try {\n return fs.statSync(graphPath);\n } catch (err) {\n const snap = snapshotPathFor(graphPath);\n if (fs.existsSync(snap)) return fs.statSync(snap);\n throw err;\n }\n}\n\n/** Parse just the envelope header of a snapshot file (null on any problem). */\nfunction readSnapshotHeader(file: string): SnapshotHeader | null {\n let fd: number | null = null;\n try {\n fd = fs.openSync(file, 'r');\n const prefix = Buffer.alloc(4096);\n const read = fs.readSync(fd, prefix, 0, prefix.length, 0);\n if (read < MAGIC.length + 4 || !prefix.subarray(0, MAGIC.length).equals(MAGIC)) return null;\n const headerLen = prefix.readUInt32LE(MAGIC.length);\n if (MAGIC.length + 4 + headerLen > read) return null;\n return newPackr().unpack(prefix.subarray(MAGIC.length + 4, MAGIC.length + 4 + headerLen)) as SnapshotHeader;\n } catch {\n return null;\n } finally {\n if (fd !== null) fs.closeSync(fd);\n }\n}\n\n/**\n * Load a map file, preferring the binary snapshot and self-healing it.\n * Fast path: valid snapshot (sidecar or standalone) → decode it. Fallback:\n * parse `graph.json`, then (best-effort) rewrite the sidecar so the next load\n * takes the fast path. Returns null only when neither representation yields a\n * graph — exactly the cases the pre-snapshot code treated as \"no graph\".\n */\nexport function loadGraphFileWithSnapshot(graphPath: string): VgGraph | null {\n const snap = readGraphSnapshot(graphPath);\n if (snap) return snap;\n let json: string;\n try {\n json = fs.readFileSync(graphPath, 'utf8');\n } catch {\n return null;\n }\n let graph: VgGraph;\n try {\n graph = parseGraph(json);\n } catch {\n return null;\n }\n writeGraphSnapshot(graphPath, graph);\n return graph;\n}\n","import type { VgGraph } from '../schema.js';\n\n/**\n * Deterministic Markdown summary (`GRAPH_REPORT.md`). Given a pinned\n * `generatedAt`, the report is byte-stable. Numbers are derived purely from the\n * graph, so the report can be regenerated from a committed `graph.json`.\n */\nexport function renderReport(graph: VgGraph): string {\n const { meta, provenance, nodes, edges } = graph;\n const lines: string[] = [];\n\n lines.push('# Code Graph Report');\n lines.push('');\n lines.push(`Generated by \\`vg\\` ${provenance.version} · schema \\`${graph.schemaVersion}\\``);\n lines.push('');\n lines.push('## Summary');\n lines.push('');\n lines.push(`- **Nodes:** ${meta.counts.nodes.toLocaleString('en-US')}`);\n lines.push(`- **Edges:** ${meta.counts.edges.toLocaleString('en-US')}`);\n lines.push(`- **Areas:** ${meta.counts.areas.toLocaleString('en-US')}`);\n lines.push(`- **Languages:** ${meta.languages.join(', ') || '—'}`);\n lines.push(`- **Clustering:** ${meta.cluster}`);\n lines.push(`- **Resolvers:** ${provenance.resolver.join(', ')}`);\n lines.push(`- **Edge kinds:** ${meta.edgeKinds.join(', ') || '—'}`);\n lines.push('');\n\n // Files by definition count.\n const fileNodes = nodes.filter((n) => n.kind === 'file');\n const defsByFile = new Map<string, number>();\n for (const n of nodes) {\n if (n.kind === 'file' || n.kind === 'external') continue;\n defsByFile.set(n.file, (defsByFile.get(n.file) ?? 0) + 1);\n }\n const topFiles = [...defsByFile.entries()]\n .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))\n .slice(0, 15);\n if (topFiles.length) {\n lines.push('## Largest files (by definitions)');\n lines.push('');\n lines.push('| File | Definitions |');\n lines.push('| --- | ---: |');\n for (const [file, count] of topFiles) lines.push(`| \\`${file}\\` | ${count} |`);\n lines.push('');\n }\n\n // Most-connected nodes (Phase 0 importance = normalised degree).\n const topNodes = nodes\n .filter((n) => n.kind !== 'file' && n.kind !== 'external')\n .sort((a, b) => b.importance - a.importance || a.qualifiedName.localeCompare(b.qualifiedName))\n .slice(0, 15);\n if (topNodes.length) {\n lines.push('## Most-connected definitions');\n lines.push('');\n lines.push('| Symbol | Kind | File | Importance |');\n lines.push('| --- | --- | --- | ---: |');\n for (const n of topNodes) {\n lines.push(\n `| \\`${n.qualifiedName}\\` | ${n.kind} | \\`${n.file}\\`:${n.span.start} | ${n.importance.toFixed(3)} |`,\n );\n }\n lines.push('');\n }\n\n // Edge-kind breakdown.\n const byKind = new Map<string, number>();\n for (const e of edges) byKind.set(e.kind, (byKind.get(e.kind) ?? 0) + 1);\n if (byKind.size) {\n lines.push('## Edges by kind');\n lines.push('');\n lines.push('| Kind | Count |');\n lines.push('| --- | ---: |');\n for (const [kind, count] of [...byKind.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {\n lines.push(`| ${kind} | ${count} |`);\n }\n lines.push('');\n }\n\n lines.push('---');\n lines.push('');\n lines.push(`_Files: ${fileNodes.length} · Corpus: \\`${provenance.corpusHash.slice(0, 16)}…\\`_`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { stableStringify } from './serialize.js';\nimport type { VgGraph } from '../schema.js';\n\n/**\n * `graph.html`: self-contained, dependency-free, deterministic overview.\n *\n * For small/medium maps we embed the full graph JSON for tooling.\n * For large maps (default: >5k nodes) we embed only a\n * **hub + area summary** so the HTML stays openable; full data stays in\n * graph.json / graph.db. Interactive WebGL (sigma.js) remains a follow-up.\n */\n\nconst EMBED_NODE_LIMIT = 5_000;\n\nexport function renderHtml(graph: VgGraph): string {\n const top = graph.nodes\n .filter((n) => n.kind !== 'file' && n.kind !== 'external')\n .sort((a, b) => b.importance - a.importance || a.qualifiedName.localeCompare(b.qualifiedName))\n .slice(0, 50);\n\n const areas = [...graph.areas]\n .sort((a, b) => b.size - a.size || a.id - b.id)\n .slice(0, 40);\n\n const rows = top\n .map(\n (n) =>\n `<tr><td><code>${esc(n.qualifiedName)}</code></td><td>${esc(n.kind)}</td>` +\n `<td><code>${esc(n.file)}</code>:${n.span.start}</td><td>${n.importance.toFixed(3)}</td></tr>`,\n )\n .join('\\n');\n\n const areaRows = areas\n .map(\n (a) =>\n `<tr><td>${a.id}</td><td><code>${esc(a.label)}</code></td>` +\n `<td>${a.size}</td><td>${a.cohesion.toFixed(3)}</td><td>${a.externalEdges}</td></tr>`,\n )\n .join('\\n');\n\n const large = graph.meta.counts.nodes > EMBED_NODE_LIMIT;\n const embedPayload = large\n ? {\n schemaVersion: graph.schemaVersion,\n generatedAt: graph.generatedAt,\n provenance: graph.provenance,\n meta: graph.meta,\n hubs: top.map((n) => ({\n id: n.id,\n name: n.qualifiedName,\n kind: n.kind,\n file: n.file,\n line: n.span.start,\n importance: n.importance,\n area: n.area,\n })),\n areas: areas.map((a) => ({\n id: a.id,\n label: a.label,\n size: a.size,\n cohesion: a.cohesion,\n externalEdges: a.externalEdges,\n })),\n note: `Full graph omitted (${graph.meta.counts.nodes} nodes > ${EMBED_NODE_LIMIT}). Use graph.json or .vibgrate/cache/graph.db.`,\n }\n : graph;\n\n const embedded = stableStringify(embedPayload, 0);\n const tier = graph.meta.analysisTier ?? 'full';\n\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>vg · code graph</title>\n<style>\n :root { color-scheme: light dark; }\n body { font: 14px/1.5 system-ui, sans-serif; margin: 2rem auto; max-width: 60rem; padding: 0 1rem; }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.1rem; margin-top: 2rem; }\n table { border-collapse: collapse; width: 100%; }\n th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid #8884; }\n td:last-child, th:last-child { text-align: right; }\n .meta { color: #888; } code { font-size: 0.9em; }\n .banner { background: #8882; padding: 0.6rem 0.8rem; border-radius: 6px; margin: 1rem 0; }\n</style>\n</head>\n<body>\n<h1>vg · code graph</h1>\n<p class=\"meta\">${graph.meta.counts.nodes} nodes · ${graph.meta.counts.edges} edges ·\n${graph.meta.counts.areas} areas · ${esc(graph.meta.languages.join(', ') || '—')} ·\nclustering: ${esc(graph.meta.cluster)} · tier: ${esc(tier)} · vg ${esc(graph.provenance.version)}</p>\n${\n large\n ? `<p class=\"banner\">Large map (${graph.meta.counts.nodes} nodes): HTML shows hubs + areas only.\nFull graph remains in <code>graph.json</code> / <code>.vibgrate/cache/graph.db</code> (query via <code>vg serve</code>).</p>`\n : ''\n}\n<h2>Areas (subsystems)</h2>\n<table>\n<thead><tr><th>Id</th><th>Label</th><th>Size</th><th>Cohesion</th><th>External</th></tr></thead>\n<tbody>\n${areaRows || '<tr><td colspan=\"5\" class=\"meta\">no areas</td></tr>'}\n</tbody>\n</table>\n<h2>Most-connected definitions (hubs)</h2>\n<table>\n<thead><tr><th>Symbol</th><th>Kind</th><th>Location</th><th>Importance</th></tr></thead>\n<tbody>\n${rows}\n</tbody>\n</table>\n<p class=\"meta\">${large ? 'Summary payload' : 'Full graph'} embedded below for tooling.</p>\n<script type=\"application/json\" id=\"vg-graph\">\n${embedded}\n</script>\n</body>\n</html>\n`;\n}\n\nfunction esc(s: string): string {\n return s\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { serializeGraph } from './serialize.js';\nimport { mapFileExists, snapshotPathFor, writeGraphSnapshot } from './snapshot.js';\nimport { renderReport } from './report.js';\nimport { renderHtml } from './html.js';\nimport { globalGraphPath, globalGraphPathForRef, repositoryStoreDir } from '../runtime/paths.js';\nimport { detectGitRef } from '../runtime/git-ref.js';\nimport type { VgGraph } from '../schema.js';\n\n/**\n * Graph artifact layout (Fusion Runtime Phase 1).\n *\n * By default the code map lives in the **global** application store\n * (XDG / Application Support), keyed by repository id — not inside the repo.\n * That keeps `vg` / `vg serve` / auto-refresh from dirtying the working tree.\n *\n * Legacy in-repo path `.vibgrate/graph.json` is still **read** when present\n * (migration), and is still the write target when:\n * - `VIBGRATE_GRAPH_IN_REPO=1` (or true/yes), or\n * - callers pass an explicit `graphPath` / `--graph`.\n *\n * `vg share` continues to opt into a committed in-repo map by writing under\n * `.vibgrate/` (and rewriting its gitignore).\n */\n\nexport interface WriteOptions {\n root: string;\n html?: boolean; // default true\n report?: boolean; // default true\n graphPath?: string; // override graph.json path\n}\n\nexport interface WrittenArtifacts {\n graphPath: string;\n reportPath?: string;\n htmlPath?: string;\n factsPath?: string;\n}\n\nexport function vibgrateDir(root: string): string {\n return path.join(root, '.vibgrate');\n}\n\n/** Historical in-repo map path (still read as a fallback). */\nexport function legacyGraphPath(root: string): string {\n return path.join(vibgrateDir(root), 'graph.json');\n}\n\n/**\n * When true, default writes go to `.vibgrate/graph.json` (pre–Phase-1 layout).\n * Useful for CI that asserts in-repo artifacts, and for `vg share` workflows.\n */\nexport function preferInRepoGraph(env: NodeJS.ProcessEnv = process.env): boolean {\n const v = env.VIBGRATE_GRAPH_IN_REPO?.trim().toLowerCase();\n return v === '1' || v === 'true' || v === 'yes';\n}\n\n/**\n * Default **write** path for the map. Global store unless the operator opts\n * into the legacy in-repo layout. When git is available, prefer a\n * branch-keyed snapshot (Fusion §4.1.1) so switching branches does not\n * overwrite another ref's on-disk map.\n */\nexport function defaultGraphPath(root: string, env: NodeJS.ProcessEnv = process.env): string {\n if (preferInRepoGraph(env)) return legacyGraphPath(root);\n const { ref, kind } = detectGitRef(root);\n if (kind !== 'none' && ref) return globalGraphPathForRef(root, ref, env);\n return globalGraphPath(root, 'current', env);\n}\n\n/**\n * Resolve where to **read** the map from.\n * Order: explicit override → legacy in-repo when `VIBGRATE_GRAPH_IN_REPO` is set\n * → branch-keyed global (if on a git ref) → `current` global snapshot →\n * legacy in-repo → default write path.\n *\n * The in-repo env short-circuit matters for CI and the release benchmark: they\n * force portable `.vibgrate/graph.json` artifacts and must not pay a synchronous\n * `git rev-parse` (or prefer a leftover global snapshot) on every resolve.\n */\nexport function resolveGraphPath(root: string, override?: string, env: NodeJS.ProcessEnv = process.env): string {\n if (override?.trim()) return path.resolve(override.trim());\n if (preferInRepoGraph(env)) {\n const legacy = legacyGraphPath(root);\n if (fs.existsSync(legacy)) return legacy;\n return legacy;\n }\n const { ref, kind } = detectGitRef(root);\n if (kind !== 'none' && ref) {\n const branchPath = globalGraphPathForRef(root, ref, env);\n if (mapFileExists(branchPath)) return branchPath;\n }\n const globalPath = globalGraphPath(root, 'current', env);\n if (mapFileExists(globalPath)) return globalPath;\n const legacy = legacyGraphPath(root);\n if (fs.existsSync(legacy)) return legacy;\n return defaultGraphPath(root, env);\n}\n\n/**\n * By default the graph artifacts are *local*: builds and auto-refreshes rewrite\n * them constantly, and without an ignore file every `vg ask`/`vg serve` leaves\n * the branch dirty (untracked or modified `.vibgrate/` files) — irritating for\n * humans and a source of junk commits from AI agents. So the first time vg\n * writes into `.vibgrate/` it also drops a `.gitignore` covering the graph\n * artifacts, the cache, and itself.\n *\n * Deliberately create-once: an existing `.vibgrate/.gitignore` is NEVER\n * touched, whatever its content — `vg share` owns it after opt-in (rewritten to\n * commit `graph.json`), and a user-managed file (even an empty one) is theirs.\n * Scanner artifacts meant for git (`baseline.json`, `standards.json`,\n * `attestation.intoto.jsonl`) are intentionally not listed.\n *\n * With the global store default, this gitignore is only created when something\n * is still written under `.vibgrate/` (in-repo mode or other in-repo writers).\n */\nconst DEFAULT_GITIGNORE = [\n '# Created once by vg — local graph artifacts stay out of git by default.',\n '# Run `vg share` to commit the map for your team (it rewrites this file).',\n '# vg never touches an existing .vibgrate/.gitignore: edit it (or leave it',\n '# empty) to manage these ignores yourself.',\n '.gitignore',\n 'cache/',\n 'graph.json',\n 'graph.snap',\n 'graph.html',\n 'GRAPH_REPORT.md',\n 'facts.jsonl',\n 'mcp-navigation.json',\n // Machine-local telemetry the LSP/`vg code` accrue over time — never meant\n // for git: score-history.jsonl is per-machine trend data (lsp/score-history.ts),\n // run-outcomes.jsonl is per-machine agent-run telemetry (code/run-outcome.ts).\n // Neither is a snapshot artifact like scan_result.json/baseline.json, which\n // are intentionally left out of this list for a user to commit if they choose.\n 'score-history.jsonl',\n 'run-outcomes.jsonl',\n];\n\nexport function ensureVibgrateGitignore(root: string): void {\n const file = path.join(vibgrateDir(root), '.gitignore');\n if (fs.existsSync(file)) return;\n fs.mkdirSync(vibgrateDir(root), { recursive: true });\n fs.writeFileSync(file, `${DEFAULT_GITIGNORE.join('\\n')}\\n`);\n}\n\n/**\n * Directory for companion artifacts (report, html, facts) next to the map.\n * Global maps → repository store root; in-repo maps → `.vibgrate/`.\n */\nexport function companionArtifactDir(root: string, graphPath: string, env: NodeJS.ProcessEnv = process.env): string {\n const resolved = path.resolve(graphPath);\n const legacy = path.resolve(legacyGraphPath(root));\n if (resolved === legacy) return vibgrateDir(root);\n const globalDefault = path.resolve(globalGraphPath(root, 'current', env));\n if (resolved === globalDefault) return repositoryStoreDir(root, env);\n // Custom --graph: keep companions next to the map file.\n return path.dirname(resolved);\n}\n\nexport function writeArtifacts(graph: VgGraph, options: WriteOptions): WrittenArtifacts {\n const graphPath = options.graphPath ?? defaultGraphPath(options.root);\n const companions = companionArtifactDir(options.root, graphPath);\n const inRepo = isPathInside(companions, options.root) || isPathInside(graphPath, options.root);\n\n fs.mkdirSync(path.dirname(graphPath), { recursive: true });\n fs.mkdirSync(companions, { recursive: true });\n\n // Only drop `.vibgrate/.gitignore` when we still touch the in-repo layout.\n if (inRepo && isPathInside(companions, vibgrateDir(options.root))) {\n ensureVibgrateGitignore(options.root);\n } else if (path.resolve(graphPath) === path.resolve(legacyGraphPath(options.root))) {\n ensureVibgrateGitignore(options.root);\n }\n\n // Global-store maps are machine-consumed only, so the snapshot IS the map\n // there — skipping the pretty-JSON serialize is the bulk of the write cost\n // on large repos. Everywhere a human (or git) can see the file — legacy\n // in-repo layout, VIBGRATE_GRAPH_IN_REPO, `vg share`, an explicit --graph\n // path — the canonical graph.json is still written, with the snapshot as a\n // sidecar cache.\n const storeMode = isPathInside(graphPath, repositoryStoreDir(options.root));\n\n if (storeMode) {\n if (!writeGraphSnapshot(graphPath, graph, { standalone: true })) {\n // Store not writable for the binary — fall back to the JSON write below\n // rather than losing the build.\n } else {\n // Drop any JSON left by an older CLI at this path so a downgrade can\n // never silently serve a stale map from beside a newer snapshot.\n fs.rmSync(graphPath, { force: true });\n }\n }\n\n if (!storeMode || !fs.existsSync(snapshotPathFor(graphPath))) {\n // Atomic write (temp + rename): `vg serve` hot-reloads the map on mtime\n // change, so a rebuild — including its own in-process auto-refresh — must\n // never expose a half-written file to a concurrent reader.\n const tmp = `${graphPath}.${process.pid}.tmp`;\n try {\n fs.writeFileSync(tmp, serializeGraph(graph));\n fs.renameSync(tmp, graphPath);\n } catch (err) {\n fs.rmSync(tmp, { force: true });\n throw err;\n }\n // Binary sidecar cache for fast loads; best-effort, JSON stays canonical.\n writeGraphSnapshot(graphPath, graph);\n }\n\n const written: WrittenArtifacts = {\n graphPath: storeMode && !fs.existsSync(graphPath) ? snapshotPathFor(graphPath) : graphPath,\n };\n\n if (options.report !== false) {\n const reportPath = path.join(companions, 'GRAPH_REPORT.md');\n fs.writeFileSync(reportPath, renderReport(graph));\n written.reportPath = reportPath;\n }\n\n if (options.html !== false) {\n const htmlPath = path.join(companions, 'graph.html');\n fs.writeFileSync(htmlPath, renderHtml(graph));\n written.htmlPath = htmlPath;\n }\n\n // facts.jsonl (deterministic NDJSON) when facts were derived.\n if (graph.facts && graph.facts.length) {\n const factsPath = path.join(companions, 'facts.jsonl');\n fs.writeFileSync(factsPath, graph.facts.map((f) => JSON.stringify(f)).join('\\n') + '\\n');\n written.factsPath = factsPath;\n }\n\n return written;\n}\n\nfunction isPathInside(child: string, parent: string): boolean {\n const rel = path.relative(path.resolve(parent), path.resolve(child));\n return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { availableRegionIds, resolveIngestHost, dashHostForIngestHost, ingestHostForRegionId } from './chunk-HTLDXEHW.js';
|
|
2
|
+
import { loadConfig, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem } from './chunk-ON7PZNYV.js';
|
|
2
3
|
import { writeTextFile, pathExists, readJsonFile } from './chunk-CRAMOEBE.js';
|
|
3
|
-
import { searchSymbols, resolveVersion, resolveLib, loadCatalog, driftFor, localPackageDocs, readDoc, inventory, localApiSurface } from './chunk-
|
|
4
|
+
import { searchSymbols, resolveVersion, resolveLib, loadCatalog, driftFor, localPackageDocs, readDoc, inventory, localApiSurface } from './chunk-FHJBGPJZ.js';
|
|
4
5
|
import { resolveOne } from './chunk-J7LKEB2R.js';
|
|
5
6
|
import { impactOf, indexFor, withTimeout, getNodeEmbeddings, queryGraphSemantic, queryGraph, loadEmbedder, isModelReady } from './chunk-EETK7S43.js';
|
|
6
7
|
import { discoverModels } from './chunk-CQDUBAQY.js';
|
|
@@ -257,63 +258,6 @@ function ensureGitignored(entry, startDir = process.cwd()) {
|
|
|
257
258
|
return { status: fileExisted ? "added" : "created", entry, gitignorePath };
|
|
258
259
|
}
|
|
259
260
|
|
|
260
|
-
// src/reporting/regions.ts
|
|
261
|
-
var REGIONS = [
|
|
262
|
-
{
|
|
263
|
-
id: "us",
|
|
264
|
-
label: "United States",
|
|
265
|
-
ingestHost: "us.ingest.vibgrate.com",
|
|
266
|
-
dashHost: "dash.vibgrate.com",
|
|
267
|
-
available: true
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
id: "eu",
|
|
271
|
-
label: "European Union",
|
|
272
|
-
ingestHost: "eu.ingest.vibgrate.com",
|
|
273
|
-
dashHost: "dash.vibgrate.eu",
|
|
274
|
-
available: true
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
id: "apac",
|
|
278
|
-
label: "Asia-Pacific (coming soon)",
|
|
279
|
-
ingestHost: "apac.ingest.vibgrate.com",
|
|
280
|
-
dashHost: "dash.vibgrate.com",
|
|
281
|
-
available: false
|
|
282
|
-
}
|
|
283
|
-
];
|
|
284
|
-
var DEFAULT_REGION = "us";
|
|
285
|
-
function availableRegionIds() {
|
|
286
|
-
return REGIONS.filter((r) => r.available).map((r) => r.id);
|
|
287
|
-
}
|
|
288
|
-
function findRegion(id) {
|
|
289
|
-
return REGIONS.find((r) => r.id === id);
|
|
290
|
-
}
|
|
291
|
-
function resolveIngestHost(region, ingest) {
|
|
292
|
-
if (ingest) {
|
|
293
|
-
try {
|
|
294
|
-
return new URL(ingest).host;
|
|
295
|
-
} catch {
|
|
296
|
-
throw new Error(`Invalid ingest URL: ${ingest}`);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
const id = (region ?? DEFAULT_REGION).toLowerCase();
|
|
300
|
-
const match = findRegion(id);
|
|
301
|
-
if (!match) {
|
|
302
|
-
throw new Error(`Unknown region "${id}". Supported: ${availableRegionIds().join(", ")}`);
|
|
303
|
-
}
|
|
304
|
-
if (!match.available) {
|
|
305
|
-
throw new Error(`Region "${id}" (${match.label}) is not yet available. Supported: ${availableRegionIds().join(", ")}`);
|
|
306
|
-
}
|
|
307
|
-
return match.ingestHost;
|
|
308
|
-
}
|
|
309
|
-
function dashHostForIngestHost(ingestHost) {
|
|
310
|
-
const match = REGIONS.find((r) => r.ingestHost === ingestHost);
|
|
311
|
-
return match?.dashHost ?? "dash.vibgrate.com";
|
|
312
|
-
}
|
|
313
|
-
function ingestHostForRegionId(region) {
|
|
314
|
-
return findRegion(region.toLowerCase())?.ingestHost;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
261
|
// src/reporting/commands/dsn.ts
|
|
318
262
|
function generateKeyMaterial() {
|
|
319
263
|
return {
|
|
@@ -2179,6 +2123,6 @@ function navigationToolsetConfig(serverName = "vibgrate") {
|
|
|
2179
2123
|
};
|
|
2180
2124
|
}
|
|
2181
2125
|
|
|
2182
|
-
export { FREE_PACK, HOT_TOOLS, TOOLS, assessDocQuality,
|
|
2183
|
-
//# sourceMappingURL=chunk-
|
|
2184
|
-
//# sourceMappingURL=chunk-
|
|
2126
|
+
export { FREE_PACK, HOT_TOOLS, TOOLS, assessDocQuality, clearStoredCredentials, countTokens, coveringTests, createWorkspaceDsn, credentialsPath, deferredToolNames, detectRunner, dsnCommand, ensureGitignored, fetchHostedDocsCached, findGitRoot, gitignoreEntryForCredentials, homeCredentialsPath, hostedBase, navigationToolsetConfig, parseDsn, pathDisconnect, projectCredentialsPath, publishPrivateLibrary, pushCommand, readScanArtifact, readStoredCredentials, renderToolResult, resolveDsn, selectForBudget, shortestPath, symbolsFromApi, testsToRun, uploadScanArtifact, warmEmbedderInBackground, writeStoredCredentials };
|
|
2127
|
+
//# sourceMappingURL=chunk-6D4BCGRQ.js.map
|
|
2128
|
+
//# sourceMappingURL=chunk-6D4BCGRQ.js.map
|