@vibgrate/cli 2026.720.3 → 2026.721.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/DOCS.md +4 -1
- package/dist/baseline-3S5NKMBP.js +6 -0
- package/dist/{baseline-FALF7ULT.js.map → baseline-3S5NKMBP.js.map} +1 -1
- package/dist/{chunk-ZFDVHKID.js → chunk-C4EDNPWN.js} +176 -30
- package/dist/chunk-C4EDNPWN.js.map +1 -0
- package/dist/{chunk-IUKCKMR6.js → chunk-FR72DKYF.js} +3 -3
- package/dist/{chunk-IUKCKMR6.js.map → chunk-FR72DKYF.js.map} +1 -1
- package/dist/{chunk-BHA7QIPD.js → chunk-JWBS5GS6.js} +10 -3
- package/dist/chunk-JWBS5GS6.js.map +1 -0
- package/dist/{chunk-B6ZWB3WH.js → chunk-SHXV4VPX.js} +3 -3
- package/dist/{chunk-B6ZWB3WH.js.map → chunk-SHXV4VPX.js.map} +1 -1
- package/dist/cli.js +17 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/parse-worker.js +1 -1
- package/package.json +3 -2
- package/dist/baseline-FALF7ULT.js +0 -6
- package/dist/chunk-BHA7QIPD.js.map +0 -1
- package/dist/chunk-ZFDVHKID.js.map +0 -1
package/DOCS.md
CHANGED
|
@@ -621,6 +621,8 @@ Maps source code into a graph artifact, enabling all downstream queries (`vg sho
|
|
|
621
621
|
| `--grammars <dir>` | — | Grammar `.wasm` directory for offline/air-gapped use |
|
|
622
622
|
| `-o, --export <file>` | — | Also write the map to a file (format from extension) |
|
|
623
623
|
|
|
624
|
+
**Local by default — no git churn.** The first time vg writes into `.vibgrate/` it also creates `.vibgrate/.gitignore`, keeping the graph artifacts (`graph.json`, `graph.html`, `GRAPH_REPORT.md`, `facts.jsonl`, `mcp-navigation.json`) and the cache out of git — so builds, auto-refreshes, and MCP use never leave your branch dirty. Run `vg share` when you want the map committed for your team (it rewrites that ignore file). vg never touches an existing `.vibgrate/.gitignore`, so edit it (or leave it empty) to manage the ignores yourself.
|
|
625
|
+
|
|
624
626
|
---
|
|
625
627
|
|
|
626
628
|
### vg bundle
|
|
@@ -849,6 +851,7 @@ Reads the counts-only usage ledger recorded when you run `vg serve --savings` (o
|
|
|
849
851
|
| Flag | Default | Description |
|
|
850
852
|
|------|---------|-------------|
|
|
851
853
|
| `--days <n>` | `30` | Reporting window in days |
|
|
854
|
+
| `--clear` | — | Delete the recorded usage data for this repo (the ledger under `.vibgrate/cache/`, plus the opt-in stats-share upload state and per-install id) |
|
|
852
855
|
|
|
853
856
|
Add `--json` for machine-readable output.
|
|
854
857
|
|
|
@@ -902,7 +905,7 @@ Make the code map committable and auto-updating for your team.
|
|
|
902
905
|
vg share
|
|
903
906
|
```
|
|
904
907
|
|
|
905
|
-
Installs a pre-commit hook, deterministic merge driver, and `.gitignore` so the map stays fresh without any manual steps.
|
|
908
|
+
Installs a pre-commit hook, deterministic merge driver, and `.gitignore` so the map stays fresh without any manual steps. This rewrites the default `.vibgrate/.gitignore` (which ignores the graph artifacts, `graph.json` included) so `graph.json` is committed while the cache and volatile reports stay ignored.
|
|
906
909
|
|
|
907
910
|
| Flag | Description |
|
|
908
911
|
|------|-------------|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-3S5NKMBP.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hashString, langById, shortId, canonicalize, grammarSetVersion, hashBytes, langForExtension, setGrammarsOverride, parseSource } from './chunk-
|
|
2
|
-
import { writeTextFile, pathExists, readJsonFile, loadConfig, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem, VERSION } from './chunk-
|
|
1
|
+
import { hashString, langById, shortId, canonicalize, grammarSetVersion, hashBytes, langForExtension, setGrammarsOverride, parseSource } from './chunk-JWBS5GS6.js';
|
|
2
|
+
import { writeTextFile, pathExists, readJsonFile, loadConfig, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem, VERSION } from './chunk-SHXV4VPX.js';
|
|
3
3
|
import * as fs17 from 'fs';
|
|
4
4
|
import { spawnSync, execFileSync } from 'child_process';
|
|
5
5
|
import * as path17 from 'path';
|
|
@@ -2471,12 +2471,33 @@ function esc(s) {
|
|
|
2471
2471
|
function vibgrateDir(root) {
|
|
2472
2472
|
return path17.join(root, ".vibgrate");
|
|
2473
2473
|
}
|
|
2474
|
+
var DEFAULT_GITIGNORE = [
|
|
2475
|
+
"# Created once by vg \u2014 local graph artifacts stay out of git by default.",
|
|
2476
|
+
"# Run `vg share` to commit the map for your team (it rewrites this file).",
|
|
2477
|
+
"# vg never touches an existing .vibgrate/.gitignore: edit it (or leave it",
|
|
2478
|
+
"# empty) to manage these ignores yourself.",
|
|
2479
|
+
".gitignore",
|
|
2480
|
+
"cache/",
|
|
2481
|
+
"graph.json",
|
|
2482
|
+
"graph.html",
|
|
2483
|
+
"GRAPH_REPORT.md",
|
|
2484
|
+
"facts.jsonl",
|
|
2485
|
+
"mcp-navigation.json"
|
|
2486
|
+
];
|
|
2487
|
+
function ensureVibgrateGitignore(root) {
|
|
2488
|
+
const file = path17.join(vibgrateDir(root), ".gitignore");
|
|
2489
|
+
if (fs17.existsSync(file)) return;
|
|
2490
|
+
fs17.mkdirSync(vibgrateDir(root), { recursive: true });
|
|
2491
|
+
fs17.writeFileSync(file, `${DEFAULT_GITIGNORE.join("\n")}
|
|
2492
|
+
`);
|
|
2493
|
+
}
|
|
2474
2494
|
function defaultGraphPath(root) {
|
|
2475
2495
|
return path17.join(vibgrateDir(root), "graph.json");
|
|
2476
2496
|
}
|
|
2477
2497
|
function writeArtifacts(graph, options) {
|
|
2478
2498
|
const dir = vibgrateDir(options.root);
|
|
2479
2499
|
fs17.mkdirSync(dir, { recursive: true });
|
|
2500
|
+
ensureVibgrateGitignore(options.root);
|
|
2480
2501
|
const graphPath = options.graphPath ?? defaultGraphPath(options.root);
|
|
2481
2502
|
fs17.mkdirSync(path17.dirname(graphPath), { recursive: true });
|
|
2482
2503
|
const tmp = `${graphPath}.${process.pid}.tmp`;
|
|
@@ -5665,13 +5686,19 @@ var ROW_CAP = 1e4;
|
|
|
5665
5686
|
async function scanCandidates(root, files, needle, opts) {
|
|
5666
5687
|
const needleLower = needle.toLowerCase();
|
|
5667
5688
|
if (!needleLower || files.length === 0) return { hits: [], total: 0, truncated: false };
|
|
5668
|
-
if (!opts.collectAll) return scanInline(root, files, needleLower, opts.budget, true, void 0);
|
|
5669
5689
|
if (files.length < PARALLEL_MIN_FILES && !process.env.VG_PARALLEL_MIN_BYTES) {
|
|
5670
|
-
return scanInline(root, files, needleLower, ROW_CAP, false, void 0);
|
|
5690
|
+
return opts.collectAll ? scanInline(root, files, needleLower, ROW_CAP, false, void 0) : scanInline(root, files, needleLower, opts.budget, true, void 0);
|
|
5671
5691
|
}
|
|
5672
5692
|
const { over, sizes } = measure(root, files);
|
|
5673
|
-
if (!over)
|
|
5674
|
-
|
|
5693
|
+
if (!over) {
|
|
5694
|
+
return opts.collectAll ? scanInline(root, files, needleLower, ROW_CAP, false, sizes) : scanInline(root, files, needleLower, opts.budget, true, sizes);
|
|
5695
|
+
}
|
|
5696
|
+
const out = await scanParallel(root, files, needleLower);
|
|
5697
|
+
if (!opts.collectAll && out.hits.length > opts.budget) {
|
|
5698
|
+
out.hits.length = opts.budget;
|
|
5699
|
+
out.truncated = true;
|
|
5700
|
+
}
|
|
5701
|
+
return out;
|
|
5675
5702
|
}
|
|
5676
5703
|
function parallelMinBytes() {
|
|
5677
5704
|
const v = Number(process.env.VG_PARALLEL_MIN_BYTES);
|
|
@@ -5802,13 +5829,80 @@ function runWorker(root, files, needleLower) {
|
|
|
5802
5829
|
}
|
|
5803
5830
|
|
|
5804
5831
|
// src/engine/search.ts
|
|
5805
|
-
var IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
5832
|
+
var IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
5833
|
+
".git",
|
|
5834
|
+
".vibgrate",
|
|
5835
|
+
"node_modules",
|
|
5836
|
+
"dist",
|
|
5837
|
+
"build",
|
|
5838
|
+
"out",
|
|
5839
|
+
"target",
|
|
5840
|
+
"vendor",
|
|
5841
|
+
"__pycache__",
|
|
5842
|
+
// .NET intermediate output and coverage reports: purely generated trees that a
|
|
5843
|
+
// C#/coverage-heavy repo pays for on every literal sweep. `bin` is deliberately
|
|
5844
|
+
// NOT here — plenty of repos keep real scripts in bin/ (rails, node CLIs), and
|
|
5845
|
+
// completeness beats speed; the binary-extension skip below keeps a .NET bin/
|
|
5846
|
+
// cheap anyway.
|
|
5847
|
+
"obj",
|
|
5848
|
+
"coverage"
|
|
5849
|
+
]);
|
|
5806
5850
|
var MAX_FILES_SCANNED = 2e4;
|
|
5851
|
+
var BINARY_EXTS = /* @__PURE__ */ new Set([
|
|
5852
|
+
".dll",
|
|
5853
|
+
".pdb",
|
|
5854
|
+
".exe",
|
|
5855
|
+
".so",
|
|
5856
|
+
".dylib",
|
|
5857
|
+
".a",
|
|
5858
|
+
".lib",
|
|
5859
|
+
".o",
|
|
5860
|
+
".class",
|
|
5861
|
+
".jar",
|
|
5862
|
+
".wasm",
|
|
5863
|
+
".node",
|
|
5864
|
+
".png",
|
|
5865
|
+
".jpg",
|
|
5866
|
+
".jpeg",
|
|
5867
|
+
".gif",
|
|
5868
|
+
".webp",
|
|
5869
|
+
".ico",
|
|
5870
|
+
".icns",
|
|
5871
|
+
".bmp",
|
|
5872
|
+
".zip",
|
|
5873
|
+
".gz",
|
|
5874
|
+
".tgz",
|
|
5875
|
+
".bz2",
|
|
5876
|
+
".xz",
|
|
5877
|
+
".7z",
|
|
5878
|
+
".rar",
|
|
5879
|
+
".woff",
|
|
5880
|
+
".woff2",
|
|
5881
|
+
".ttf",
|
|
5882
|
+
".otf",
|
|
5883
|
+
".eot",
|
|
5884
|
+
".mp3",
|
|
5885
|
+
".mp4",
|
|
5886
|
+
".mov",
|
|
5887
|
+
".avi",
|
|
5888
|
+
".pdf"
|
|
5889
|
+
]);
|
|
5890
|
+
function hasBinaryExt(rel2) {
|
|
5891
|
+
return BINARY_EXTS.has(path17.extname(rel2).toLowerCase());
|
|
5892
|
+
}
|
|
5893
|
+
function toPosix2(rel2) {
|
|
5894
|
+
return path17.sep === "\\" ? rel2.replaceAll("\\", "/") : rel2;
|
|
5895
|
+
}
|
|
5807
5896
|
async function searchSymbols(graph, root, query, limit) {
|
|
5808
|
-
|
|
5897
|
+
let q2 = query.trim();
|
|
5809
5898
|
if (!q2) return { matches: [], moreAvailable: false, hint: "query is required" };
|
|
5810
|
-
const
|
|
5899
|
+
const quoted = /^(["'`])(.+)\1$/.exec(q2);
|
|
5900
|
+
if (quoted && quoted[2].trim()) q2 = quoted[2].trim();
|
|
5901
|
+
const isPhrase = Boolean(quoted) || /\s/.test(q2) || /[/\\]/.test(q2) && !q2.includes(":") && !/[*?]/.test(q2);
|
|
5811
5902
|
let nodes = findNodes(graph, q2).filter((n) => n.kind !== "file");
|
|
5903
|
+
if (nodes.length === 0) {
|
|
5904
|
+
nodes = fileSymbolNodes(graph, q2);
|
|
5905
|
+
}
|
|
5812
5906
|
if (nodes.length === 0 && isPhrase) {
|
|
5813
5907
|
nodes = reconstructedIdentifierNodes(graph, q2);
|
|
5814
5908
|
}
|
|
@@ -5828,7 +5922,8 @@ async function searchSymbols(graph, root, query, limit) {
|
|
|
5828
5922
|
const textHits = [];
|
|
5829
5923
|
let truncatedScan = false;
|
|
5830
5924
|
let totalTextMatches;
|
|
5831
|
-
|
|
5925
|
+
const skipScan = !isPhrase && hasExactSymbolMatch(nodes, q2);
|
|
5926
|
+
if (spare > 0 && !skipScan) {
|
|
5832
5927
|
const seen = new Set(symbolHits.map((h) => `${h.file}:${h.line}`));
|
|
5833
5928
|
const scan = await scanFiles(root, q2, spare, seen, textHits, isPhrase);
|
|
5834
5929
|
truncatedScan = scan.truncated;
|
|
@@ -5851,6 +5946,20 @@ async function searchSymbols(graph, root, query, limit) {
|
|
|
5851
5946
|
}
|
|
5852
5947
|
return result;
|
|
5853
5948
|
}
|
|
5949
|
+
function fileSymbolNodes(graph, q2) {
|
|
5950
|
+
if (!/[/\\]/.test(q2) && !/\.\w+$/.test(q2)) return [];
|
|
5951
|
+
const norm = q2.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
5952
|
+
const inFile = graph.nodes.filter(
|
|
5953
|
+
(n) => n.kind !== "file" && (n.file === norm || n.file.endsWith(`/${norm}`))
|
|
5954
|
+
);
|
|
5955
|
+
return [...inFile].sort((a, b) => b.importance - a.importance || a.qualifiedName.localeCompare(b.qualifiedName));
|
|
5956
|
+
}
|
|
5957
|
+
function hasExactSymbolMatch(nodes, q2) {
|
|
5958
|
+
if (nodes.length === 0) return false;
|
|
5959
|
+
if (/^(.*):(\d+)$/.test(q2)) return true;
|
|
5960
|
+
const lower = q2.toLowerCase();
|
|
5961
|
+
return nodes.some((n) => n.id === q2 || n.qualifiedName.toLowerCase() === lower || n.name.toLowerCase() === lower);
|
|
5962
|
+
}
|
|
5854
5963
|
function queryTokens(q2) {
|
|
5855
5964
|
return [...new Set(q2.toLowerCase().split(/[^a-z0-9]+/).filter((t) => t.length >= 2))];
|
|
5856
5965
|
}
|
|
@@ -5863,16 +5972,22 @@ function reconstructedIdentifierNodes(graph, q2) {
|
|
|
5863
5972
|
return snake.filter((n) => n.kind !== "file");
|
|
5864
5973
|
}
|
|
5865
5974
|
function multiTokenNodes(graph, tokens) {
|
|
5866
|
-
const
|
|
5867
|
-
for (const
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5975
|
+
const scored = [];
|
|
5976
|
+
for (const n of graph.nodes) {
|
|
5977
|
+
if (n.kind === "file") continue;
|
|
5978
|
+
const name = n.name.toLowerCase();
|
|
5979
|
+
const qn = n.qualifiedName.toLowerCase();
|
|
5980
|
+
let hits = 0;
|
|
5981
|
+
let exact = false;
|
|
5982
|
+
for (const t of tokens) {
|
|
5983
|
+
if (name === t || qn === t) {
|
|
5984
|
+
hits++;
|
|
5985
|
+
exact = true;
|
|
5986
|
+
} else if (qn.includes(t)) hits++;
|
|
5873
5987
|
}
|
|
5988
|
+
if (exact || hits >= 2) scored.push({ node: n, hits, exact });
|
|
5874
5989
|
}
|
|
5875
|
-
return
|
|
5990
|
+
return scored.sort((a, b) => Number(b.exact) - Number(a.exact) || b.hits - a.hits || b.node.importance - a.node.importance || a.node.qualifiedName.localeCompare(b.node.qualifiedName)).map((e) => e.node);
|
|
5876
5991
|
}
|
|
5877
5992
|
async function scanFiles(root, needle, budget, seen, out, countAll) {
|
|
5878
5993
|
const listing = listCandidateFiles(root, needle);
|
|
@@ -5889,7 +6004,23 @@ async function scanFiles(root, needle, budget, seen, out, countAll) {
|
|
|
5889
6004
|
return { total: outcome.total - overlap, truncated: listing.truncated || outcome.truncated };
|
|
5890
6005
|
}
|
|
5891
6006
|
function listCandidateFiles(root, needle) {
|
|
5892
|
-
return ripgrepCandidates(root, needle) ??
|
|
6007
|
+
return ripgrepCandidates(root, needle) ?? walkCandidatesCached(root);
|
|
6008
|
+
}
|
|
6009
|
+
var LISTING_TTL_MS = 2e3;
|
|
6010
|
+
var listingCache = /* @__PURE__ */ new Map();
|
|
6011
|
+
function listingTtlMs() {
|
|
6012
|
+
const v = Number(process.env.VG_LISTING_TTL_MS);
|
|
6013
|
+
return Number.isFinite(v) && v >= 0 ? v : LISTING_TTL_MS;
|
|
6014
|
+
}
|
|
6015
|
+
function walkCandidatesCached(root) {
|
|
6016
|
+
const ttl = listingTtlMs();
|
|
6017
|
+
if (ttl > 0) {
|
|
6018
|
+
const hit = listingCache.get(root);
|
|
6019
|
+
if (hit && Date.now() - hit.at < ttl) return hit.listing;
|
|
6020
|
+
}
|
|
6021
|
+
const listing = walkCandidates(root);
|
|
6022
|
+
if (ttl > 0) listingCache.set(root, { listing, at: Date.now() });
|
|
6023
|
+
return listing;
|
|
5893
6024
|
}
|
|
5894
6025
|
function walkCandidates(root) {
|
|
5895
6026
|
const files = [];
|
|
@@ -5910,11 +6041,12 @@ function walkCandidates(root) {
|
|
|
5910
6041
|
stack.push(abs);
|
|
5911
6042
|
continue;
|
|
5912
6043
|
}
|
|
6044
|
+
if (hasBinaryExt(e.name)) continue;
|
|
5913
6045
|
if (files.length >= MAX_FILES_SCANNED) {
|
|
5914
6046
|
truncated = true;
|
|
5915
6047
|
continue;
|
|
5916
6048
|
}
|
|
5917
|
-
files.push(path17.relative(root, abs));
|
|
6049
|
+
files.push(toPosix2(path17.relative(root, abs)));
|
|
5918
6050
|
}
|
|
5919
6051
|
}
|
|
5920
6052
|
files.sort();
|
|
@@ -5941,17 +6073,23 @@ function ripgrepCandidates(root, needle) {
|
|
|
5941
6073
|
{ cwd: root, encoding: "utf8", timeout: 15e3, maxBuffer: 32 * 1024 * 1024 }
|
|
5942
6074
|
);
|
|
5943
6075
|
if (res.error || res.status !== 0 && res.status !== 1 || res.signal) return null;
|
|
6076
|
+
const files = parseRgFileList(res.stdout);
|
|
6077
|
+
if (files.length > MAX_FILES_SCANNED) return { files: files.slice(0, MAX_FILES_SCANNED), truncated: true };
|
|
6078
|
+
return { files, truncated: false };
|
|
6079
|
+
}
|
|
6080
|
+
function parseRgFileList(stdout, sep10 = path17.sep) {
|
|
5944
6081
|
const seen = /* @__PURE__ */ new Set();
|
|
5945
|
-
for (const raw of
|
|
5946
|
-
|
|
6082
|
+
for (const raw of stdout.split("\n")) {
|
|
6083
|
+
if (!raw) continue;
|
|
6084
|
+
const posix3 = sep10 === "\\" ? raw.replaceAll("\\", "/") : raw;
|
|
6085
|
+
const rel2 = posix3.startsWith("./") ? posix3.slice(2) : posix3;
|
|
5947
6086
|
if (!rel2) continue;
|
|
5948
6087
|
const segs = rel2.split("/");
|
|
5949
6088
|
if (segs.some((s) => s.startsWith(".") || IGNORE_DIRS.has(s))) continue;
|
|
6089
|
+
if (hasBinaryExt(rel2)) continue;
|
|
5950
6090
|
seen.add(rel2);
|
|
5951
6091
|
}
|
|
5952
|
-
|
|
5953
|
-
if (files.length > MAX_FILES_SCANNED) return { files: files.slice(0, MAX_FILES_SCANNED), truncated: true };
|
|
5954
|
-
return { files, truncated: false };
|
|
6092
|
+
return [...seen].sort();
|
|
5955
6093
|
}
|
|
5956
6094
|
|
|
5957
6095
|
// src/mcp/tools.ts
|
|
@@ -6070,7 +6208,7 @@ var TOOLS = [
|
|
|
6070
6208
|
},
|
|
6071
6209
|
{
|
|
6072
6210
|
name: "search_symbols",
|
|
6073
|
-
description:
|
|
6211
|
+
description: 'Find a known name or literal string fast: ranked symbol lookup, plus a complete literal file-search for any quoted, multi-word, or path-like query (config keys, routes, log lines, UI copy). Quote a single name ("AddJwtBearer") to sweep every occurrence of it as text. A sweep reports totalTextMatches so you know you have every occurrence \u2014 use it instead of grep. Use first for most discovery; use query_graph for meaning.',
|
|
6074
6212
|
inputSchema: obj(
|
|
6075
6213
|
{
|
|
6076
6214
|
query: { type: "string", maxLength: 120, description: "a symbol name, or a literal phrase to sweep for every occurrence of" },
|
|
@@ -6922,6 +7060,7 @@ function writeFileEnsured(file, content) {
|
|
|
6922
7060
|
fs17.writeFileSync(file, content);
|
|
6923
7061
|
}
|
|
6924
7062
|
function writeNavigationConfig(root) {
|
|
7063
|
+
ensureVibgrateGitignore(root);
|
|
6925
7064
|
const rel2 = path17.join(".vibgrate", "mcp-navigation.json");
|
|
6926
7065
|
const doc = {
|
|
6927
7066
|
_readme: "Deferred-loading config for agents embedding `vg serve` via the Claude API (defer_loading + tool-search). The hot navigation core stays in context; the rest load on demand \u2014 ~350-450 schema tokens/step vs ~1,881 for the full set. Hosts without defer_loading ignore this and serve the whole (already optimized) tool set. See docs/graph/VG-NAVIGATION-PROFILE.md.",
|
|
@@ -7113,7 +7252,7 @@ async function refreshIfStale(root, opts = {}) {
|
|
|
7113
7252
|
}
|
|
7114
7253
|
var LEDGER = "savings.jsonl";
|
|
7115
7254
|
var PER_FILE_TOKENS = 400;
|
|
7116
|
-
var SAVINGS_TOOLS = /* @__PURE__ */ new Set(["query_graph", "get_node"]);
|
|
7255
|
+
var SAVINGS_TOOLS = /* @__PURE__ */ new Set(["query_graph", "get_node", "search_symbols"]);
|
|
7117
7256
|
var CLI_TOOL_ALIASES = {
|
|
7118
7257
|
ask: "query_graph",
|
|
7119
7258
|
show: "get_node",
|
|
@@ -7151,6 +7290,13 @@ function ledgerPath(root) {
|
|
|
7151
7290
|
function savingsRecorded(root) {
|
|
7152
7291
|
return fs17.existsSync(ledgerPath(root));
|
|
7153
7292
|
}
|
|
7293
|
+
function clearSavings(root) {
|
|
7294
|
+
const file = ledgerPath(root);
|
|
7295
|
+
const existed = fs17.existsSync(file);
|
|
7296
|
+
fs17.rmSync(file, { force: true });
|
|
7297
|
+
fs17.rmSync(path17.join(cacheDir(root), "stats-share.json"), { force: true });
|
|
7298
|
+
return existed;
|
|
7299
|
+
}
|
|
7154
7300
|
function recordSaving(root, entry, now) {
|
|
7155
7301
|
try {
|
|
7156
7302
|
fs17.mkdirSync(cacheDir(root), { recursive: true });
|
|
@@ -7681,6 +7827,6 @@ function spdx(ctx) {
|
|
|
7681
7827
|
return JSON.stringify(doc, null, 2) + "\n";
|
|
7682
7828
|
}
|
|
7683
7829
|
|
|
7684
|
-
export { ASSISTANTS, CLI_TOOL_ALIASES, CliError, ECOSYSTEMS, ExitCode, FREE_PACK, GraphIndex, GraphSource, NPX_INVOCATION, ResourceLimitError, SAVINGS_TOOLS, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, SMALL_REPO_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assessDocQuality, assistantById, availableRegionIds, buildFacts, buildGraph, buildModuleResolver, cacheDir, catalogPath, clearModelCache, clearStoredCredentials, cosine, countPending, countTokens, coveringTests, createServer, createWorkspaceDsn, credentialsPath, dashHostForIngestHost, decodeScipIndex, defaultGraphPath, detectAssistants, detectRunner, detectServeLaunch, discover, discoverModels, driftCount, driftFor, dsnCommand, embeddingsCached, enrichOnline, ensureGitignored, epistemicBreakdown, exportGraph, fetchHostedDocsCached, findGitRoot, findNodes, formatForExt, getNodeEmbeddings, gitignoreEntryForCredentials, groundGraph, hasDrift, homeCredentialsPath, hostedBase, identifierParts, impactOf, indexFor, ingestHostForRegionId, installAssistant, inventory, isModelReady, isTestFile, libDir, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, localApiSurface, localPackageDocs, modelCacheInfo, nodeById, nodeEmbedText, parseDsn, parseGraph, parseJsonc, probeFreshness, projectCredentialsPath, publishPrivateLibrary, pushCommand, queryGraph, queryGraphSemantic, readDoc, readSavings, readScanArtifact, readStoredCredentials, readUsage, recordCliCall, recordSaving, refreshIfStale, refreshInstalledInstructions, relativeResolver, renderHtml, renderReport, resolveCliInvocation, resolveDsn, resolveEmbedModel, resolveIngestHost, resolveLib, resolveLimits, resolveOne, resolveVersion, sanitizeClient, saveCatalog, savingsLedgerPath, savingsRecorded, scipEdges, selectForBudget, serializeGraph, serveStdio, shortestPath, stableStringify, symbolsFromApi, testsToRun, unavailableMessage, uninstallAssistant, uploadScanArtifact, usageError, verifyDeterminism, vibgrateDir, writeArtifacts, writeNavigationConfig, writeSnapshot, writeStoredCredentials };
|
|
7685
|
-
//# sourceMappingURL=chunk-
|
|
7686
|
-
//# sourceMappingURL=chunk-
|
|
7830
|
+
export { ASSISTANTS, CLI_TOOL_ALIASES, CliError, ECOSYSTEMS, ExitCode, FREE_PACK, GraphIndex, GraphSource, NPX_INVOCATION, ResourceLimitError, SAVINGS_TOOLS, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, SMALL_REPO_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assessDocQuality, assistantById, availableRegionIds, buildFacts, buildGraph, buildModuleResolver, cacheDir, catalogPath, clearModelCache, clearSavings, clearStoredCredentials, cosine, countPending, countTokens, coveringTests, createServer, createWorkspaceDsn, credentialsPath, dashHostForIngestHost, decodeScipIndex, defaultGraphPath, detectAssistants, detectRunner, detectServeLaunch, discover, discoverModels, driftCount, driftFor, dsnCommand, embeddingsCached, enrichOnline, ensureGitignored, epistemicBreakdown, exportGraph, fetchHostedDocsCached, findGitRoot, findNodes, formatForExt, getNodeEmbeddings, gitignoreEntryForCredentials, groundGraph, hasDrift, homeCredentialsPath, hostedBase, identifierParts, impactOf, indexFor, ingestHostForRegionId, installAssistant, inventory, isModelReady, isTestFile, libDir, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, localApiSurface, localPackageDocs, modelCacheInfo, nodeById, nodeEmbedText, parseDsn, parseGraph, parseJsonc, probeFreshness, projectCredentialsPath, publishPrivateLibrary, pushCommand, queryGraph, queryGraphSemantic, readDoc, readSavings, readScanArtifact, readStoredCredentials, readUsage, recordCliCall, recordSaving, refreshIfStale, refreshInstalledInstructions, relativeResolver, renderHtml, renderReport, resolveCliInvocation, resolveDsn, resolveEmbedModel, resolveIngestHost, resolveLib, resolveLimits, resolveOne, resolveVersion, sanitizeClient, saveCatalog, savingsLedgerPath, savingsRecorded, scipEdges, selectForBudget, serializeGraph, serveStdio, shortestPath, stableStringify, symbolsFromApi, testsToRun, unavailableMessage, uninstallAssistant, uploadScanArtifact, usageError, verifyDeterminism, vibgrateDir, writeArtifacts, writeNavigationConfig, writeSnapshot, writeStoredCredentials };
|
|
7831
|
+
//# sourceMappingURL=chunk-C4EDNPWN.js.map
|
|
7832
|
+
//# sourceMappingURL=chunk-C4EDNPWN.js.map
|