@vibgrate/cli 2026.708.1 → 2026.708.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.
- package/dist/baseline-AMQ7VEB5.js +6 -0
- package/dist/{baseline-RRO4NNNF.js.map → baseline-AMQ7VEB5.js.map} +1 -1
- package/dist/{chunk-2J7DPIAL.js → chunk-AWEAREOE.js} +186 -48
- package/dist/chunk-AWEAREOE.js.map +1 -0
- package/dist/{chunk-FMCI3MXH.js → chunk-GHLYQZWT.js} +3 -3
- package/dist/{chunk-FMCI3MXH.js.map → chunk-GHLYQZWT.js.map} +1 -1
- package/dist/{chunk-SRWMZBLG.js → chunk-ICBBG6U3.js} +4 -4
- package/dist/{chunk-SRWMZBLG.js.map → chunk-ICBBG6U3.js.map} +1 -1
- package/dist/cli.js +119 -56
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/baseline-RRO4NNNF.js +0 -6
- package/dist/chunk-2J7DPIAL.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-AMQ7VEB5.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hashString, langById, shortId, canonicalize, grammarSetVersion, hashBytes, langForExtension, setGrammarsOverride, parseSource } from './chunk-X5YT263H.js';
|
|
2
|
-
import { writeTextFile, pathExists, readJsonFile, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem, VERSION } from './chunk-
|
|
2
|
+
import { writeTextFile, pathExists, readJsonFile, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem, VERSION } from './chunk-ICBBG6U3.js';
|
|
3
3
|
import * as fs18 from 'fs';
|
|
4
4
|
import { execFileSync } from 'child_process';
|
|
5
5
|
import * as path18 from 'path';
|
|
@@ -3054,12 +3054,13 @@ function queryGraph(graph, question, options = {}) {
|
|
|
3054
3054
|
const budget = options.budget ?? 2e3;
|
|
3055
3055
|
const limit = options.limit ?? 12;
|
|
3056
3056
|
const terms = tokenize(question);
|
|
3057
|
+
const weightOf = termWeights(graph, terms);
|
|
3057
3058
|
const index = new GraphIndex(graph);
|
|
3058
3059
|
const scored = [];
|
|
3059
3060
|
for (const node of graph.nodes) {
|
|
3060
3061
|
if (node.kind === "file" || node.kind === "external") continue;
|
|
3061
|
-
const { score, why } = scoreNode(node, terms);
|
|
3062
|
-
if (score > 0) scored.push({ node, score: round2(score * (1 + node.importance)), why });
|
|
3062
|
+
const { score, why } = scoreNode(node, terms, weightOf);
|
|
3063
|
+
if (score > 0) scored.push({ node, score: round2(score * (1 + IMPORTANCE_WEIGHT * node.importance)), why });
|
|
3063
3064
|
}
|
|
3064
3065
|
scored.sort((a, b) => b.score - a.score || a.node.qualifiedName.localeCompare(b.node.qualifiedName));
|
|
3065
3066
|
const seeds = scored.slice(0, limit);
|
|
@@ -3070,6 +3071,7 @@ async function queryGraphSemantic(graph, question, options) {
|
|
|
3070
3071
|
const budget = options.budget ?? 2e3;
|
|
3071
3072
|
const limit = options.limit ?? 12;
|
|
3072
3073
|
const terms = tokenize(question);
|
|
3074
|
+
const weightOf = termWeights(graph, terms);
|
|
3073
3075
|
const index = new GraphIndex(graph);
|
|
3074
3076
|
const queryVec = await options.embedder.embedQuery(question);
|
|
3075
3077
|
const lexRaw = /* @__PURE__ */ new Map();
|
|
@@ -3077,7 +3079,7 @@ async function queryGraphSemantic(graph, question, options) {
|
|
|
3077
3079
|
const whyById = /* @__PURE__ */ new Map();
|
|
3078
3080
|
for (const node of graph.nodes) {
|
|
3079
3081
|
if (node.kind === "file" || node.kind === "external") continue;
|
|
3080
|
-
const { score, why } = scoreNode(node, terms);
|
|
3082
|
+
const { score, why } = scoreNode(node, terms, weightOf);
|
|
3081
3083
|
lexRaw.set(node.id, score);
|
|
3082
3084
|
whyById.set(node.id, why);
|
|
3083
3085
|
if (score > lexMax) lexMax = score;
|
|
@@ -3092,7 +3094,7 @@ async function queryGraphSemantic(graph, question, options) {
|
|
|
3092
3094
|
if (hybrid <= 0) continue;
|
|
3093
3095
|
const lexWhy = whyById.get(node.id);
|
|
3094
3096
|
const why = lexWhy || (sem > 0.3 ? `semantic match (${sem.toFixed(2)})` : "weak match");
|
|
3095
|
-
scored.push({ node, score: round2(hybrid * (1 + node.importance)), why });
|
|
3097
|
+
scored.push({ node, score: round2(hybrid * (1 + IMPORTANCE_WEIGHT * node.importance)), why });
|
|
3096
3098
|
}
|
|
3097
3099
|
scored.sort((a, b) => b.score - a.score || a.node.qualifiedName.localeCompare(b.node.qualifiedName));
|
|
3098
3100
|
const seeds = scored.slice(0, limit);
|
|
@@ -3106,7 +3108,7 @@ function tokenize(q2) {
|
|
|
3106
3108
|
)
|
|
3107
3109
|
];
|
|
3108
3110
|
}
|
|
3109
|
-
function scoreNode(node, terms) {
|
|
3111
|
+
function scoreNode(node, terms, weightOf = () => 1) {
|
|
3110
3112
|
let score = 0;
|
|
3111
3113
|
const hits = [];
|
|
3112
3114
|
const name = node.name.toLowerCase();
|
|
@@ -3114,28 +3116,50 @@ function scoreNode(node, terms) {
|
|
|
3114
3116
|
const file = node.file.toLowerCase();
|
|
3115
3117
|
const nameParts = identifierParts(node.name);
|
|
3116
3118
|
for (const t of terms) {
|
|
3119
|
+
const w = weightOf(t);
|
|
3117
3120
|
if (name === t) {
|
|
3118
|
-
score += 10;
|
|
3121
|
+
score += 10 * w;
|
|
3119
3122
|
hits.push(t);
|
|
3120
3123
|
} else if (nameParts.has(t)) {
|
|
3121
|
-
score += 6;
|
|
3124
|
+
score += 6 * w;
|
|
3122
3125
|
hits.push(t);
|
|
3123
3126
|
} else if (name.includes(t)) {
|
|
3124
|
-
score += 4;
|
|
3127
|
+
score += 4 * w;
|
|
3125
3128
|
hits.push(t);
|
|
3126
3129
|
} else if (qn.includes(t)) {
|
|
3127
|
-
score += 3;
|
|
3130
|
+
score += 3 * w;
|
|
3128
3131
|
hits.push(t);
|
|
3129
3132
|
} else if (fuzzyPartMatch(t, nameParts)) {
|
|
3130
|
-
score += 2;
|
|
3133
|
+
score += 2 * w;
|
|
3131
3134
|
hits.push(`~${t}`);
|
|
3132
3135
|
} else if (file.includes(t)) {
|
|
3133
|
-
score += 1;
|
|
3136
|
+
score += 1 * w;
|
|
3134
3137
|
hits.push(t);
|
|
3135
3138
|
}
|
|
3136
3139
|
}
|
|
3137
3140
|
return { score, why: hits.length ? `matched: ${hits.join(", ")}` : "" };
|
|
3138
3141
|
}
|
|
3142
|
+
var IMPORTANCE_WEIGHT = 0.4;
|
|
3143
|
+
function termWeights(graph, terms) {
|
|
3144
|
+
if (terms.length === 0) return () => 1;
|
|
3145
|
+
const df = /* @__PURE__ */ new Map();
|
|
3146
|
+
let n = 0;
|
|
3147
|
+
for (const node of graph.nodes) {
|
|
3148
|
+
if (node.kind === "file" || node.kind === "external") continue;
|
|
3149
|
+
n++;
|
|
3150
|
+
const name = node.name.toLowerCase();
|
|
3151
|
+
const parts = identifierParts(node.name);
|
|
3152
|
+
for (const t of terms) {
|
|
3153
|
+
if (parts.has(t) || name.includes(t)) df.set(t, (df.get(t) ?? 0) + 1);
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
const w = /* @__PURE__ */ new Map();
|
|
3157
|
+
for (const t of terms) {
|
|
3158
|
+
const idf = Math.log((n + 1) / ((df.get(t) ?? 0) + 1)) + 1;
|
|
3159
|
+
w.set(t, Math.max(0.5, Math.min(8, idf)));
|
|
3160
|
+
}
|
|
3161
|
+
return (t) => w.get(t) ?? 1;
|
|
3162
|
+
}
|
|
3139
3163
|
function identifierParts(name) {
|
|
3140
3164
|
return new Set(
|
|
3141
3165
|
name.split(/[^a-zA-Z0-9]+|(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/).filter(Boolean).map((s) => s.toLowerCase())
|
|
@@ -5494,7 +5518,11 @@ var PREVIEW_CHARS = 120;
|
|
|
5494
5518
|
function searchSymbols(graph, root, query, limit) {
|
|
5495
5519
|
const q2 = query.trim();
|
|
5496
5520
|
if (!q2) return { matches: [], moreAvailable: false, hint: "query is required" };
|
|
5497
|
-
|
|
5521
|
+
let nodes = findNodes(graph, q2).filter((n) => n.kind !== "file");
|
|
5522
|
+
if (nodes.length === 0) {
|
|
5523
|
+
const tokens = queryTokens(q2);
|
|
5524
|
+
if (tokens.length >= 2) nodes = multiTokenNodes(graph, tokens);
|
|
5525
|
+
}
|
|
5498
5526
|
const symbolHits = nodes.slice(0, limit).map((n, i) => ({
|
|
5499
5527
|
kind: n.kind,
|
|
5500
5528
|
name: n.qualifiedName,
|
|
@@ -5519,6 +5547,21 @@ function searchSymbols(graph, root, query, limit) {
|
|
|
5519
5547
|
}
|
|
5520
5548
|
return { matches, moreAvailable: nodes.length > symbolHits.length || truncatedScan };
|
|
5521
5549
|
}
|
|
5550
|
+
function queryTokens(q2) {
|
|
5551
|
+
return [...new Set(q2.toLowerCase().split(/[^a-z0-9]+/).filter((t) => t.length >= 2))];
|
|
5552
|
+
}
|
|
5553
|
+
function multiTokenNodes(graph, tokens) {
|
|
5554
|
+
const cov = /* @__PURE__ */ new Map();
|
|
5555
|
+
for (const t of tokens) {
|
|
5556
|
+
for (const n of findNodes(graph, t)) {
|
|
5557
|
+
if (n.kind === "file") continue;
|
|
5558
|
+
const e = cov.get(n.id);
|
|
5559
|
+
if (e) e.hits++;
|
|
5560
|
+
else cov.set(n.id, { node: n, hits: 1 });
|
|
5561
|
+
}
|
|
5562
|
+
}
|
|
5563
|
+
return [...cov.values()].sort((a, b) => b.hits - a.hits || b.node.importance - a.node.importance).map((e) => e.node);
|
|
5564
|
+
}
|
|
5522
5565
|
function scanFiles(root, needle, budget, seen, out) {
|
|
5523
5566
|
const lower = needle.toLowerCase();
|
|
5524
5567
|
let scanned = 0;
|
|
@@ -5630,17 +5673,20 @@ var TOOLS = [
|
|
|
5630
5673
|
{
|
|
5631
5674
|
name: "orient",
|
|
5632
5675
|
description: "Start here: one call returns the map overview, ranked matches for your question, and the top hit\u2019s blast radius \u2014 replaces summary+query+impact round-trips.",
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
},
|
|
5640
|
-
|
|
5641
|
-
|
|
5676
|
+
// `query` is a no-description back-compat alias for `question`: the sibling
|
|
5677
|
+
// discovery tools (search_symbols, resolve_library) take `query`, so an agent
|
|
5678
|
+
// naturally reaches for it here too — accepting it turns what was a wasted
|
|
5679
|
+
// "question is required" round-trip into a hit. Neither is `required` (either
|
|
5680
|
+
// satisfies the in-handler check), matching library_docs/resolve_library.
|
|
5681
|
+
inputSchema: obj({
|
|
5682
|
+
question: { type: "string", maxLength: 300 },
|
|
5683
|
+
query: { type: "string", maxLength: 300 },
|
|
5684
|
+
scope: { type: "string", description: "path prefix to orient within" },
|
|
5685
|
+
budget: { type: "number", description: "token budget in detailed mode (default 1500)" },
|
|
5686
|
+
response_format: RESPONSE_FORMAT
|
|
5687
|
+
}),
|
|
5642
5688
|
handler: async (graph, args, ctx) => {
|
|
5643
|
-
const question = String(args.question ?? "");
|
|
5689
|
+
const question = String(args.question ?? args.query ?? "");
|
|
5644
5690
|
if (!question) return { error: "bad_request", message: "question is required" };
|
|
5645
5691
|
const budget = numOr(args.budget, 1500);
|
|
5646
5692
|
const { q: q2, mode } = await retrieve(graph, question, budget, ctx);
|
|
@@ -5656,7 +5702,11 @@ var TOOLS = [
|
|
|
5656
5702
|
}
|
|
5657
5703
|
const shown = detailed ? scoped : scoped.slice(0, CONCISE_MATCHES);
|
|
5658
5704
|
return {
|
|
5659
|
-
|
|
5705
|
+
// Concise "find X" calls need a one-line map (counts + languages), not the
|
|
5706
|
+
// full topAreas/topHubs blocks — those were ~half of every orient
|
|
5707
|
+
// response's tokens on the hot discovery path and the caller navigates by
|
|
5708
|
+
// `matches`. Detailed keeps the full overview.
|
|
5709
|
+
summary: detailed ? summarize(graph, 10) : conciseSummary(graph),
|
|
5660
5710
|
mode,
|
|
5661
5711
|
// The fact-annotated context block is detail: concise callers navigate
|
|
5662
5712
|
// by the ranked matches and fetch nodes on demand (plan P2).
|
|
@@ -5688,18 +5738,19 @@ var TOOLS = [
|
|
|
5688
5738
|
{
|
|
5689
5739
|
name: "query_graph",
|
|
5690
5740
|
description: "Find code by meaning when you don\u2019t know the name: symptoms, relationships, what-breaks-if. For a known name or literal string use search_symbols.",
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
},
|
|
5699
|
-
|
|
5700
|
-
),
|
|
5741
|
+
// `query` is a no-description back-compat alias for `question` (see orient):
|
|
5742
|
+
// sibling tools take `query`, so accept it here rather than reject the call.
|
|
5743
|
+
inputSchema: obj({
|
|
5744
|
+
question: { type: "string", maxLength: 300 },
|
|
5745
|
+
query: { type: "string", maxLength: 300 },
|
|
5746
|
+
limit: { type: "number", description: "ranked matches to return (default 5)" },
|
|
5747
|
+
offset: { type: "number" },
|
|
5748
|
+
budget: { type: "number", description: "context-block token budget in detailed mode (default 2000)" },
|
|
5749
|
+
response_format: RESPONSE_FORMAT
|
|
5750
|
+
}),
|
|
5701
5751
|
handler: async (graph, args, ctx) => {
|
|
5702
|
-
const question = String(args.question ?? "");
|
|
5752
|
+
const question = String(args.question ?? args.query ?? "");
|
|
5753
|
+
if (!question) return { mode: "lexical", matches: [], hint: "question (or query) is required" };
|
|
5703
5754
|
const budget = numOr(args.budget, 2e3);
|
|
5704
5755
|
const { q: r, mode } = await retrieve(graph, question, budget, ctx);
|
|
5705
5756
|
if (r.matches.length === 0) {
|
|
@@ -6167,6 +6218,9 @@ var TOOLS = [
|
|
|
6167
6218
|
}
|
|
6168
6219
|
];
|
|
6169
6220
|
var VERBOSITY_BUDGET = { concise: 1500, balanced: 4e3, exhaustive: 12e3 };
|
|
6221
|
+
function conciseSummary(graph) {
|
|
6222
|
+
return { counts: graph.meta.counts, languages: graph.meta.languages };
|
|
6223
|
+
}
|
|
6170
6224
|
function summarize(graph, top = 10) {
|
|
6171
6225
|
return {
|
|
6172
6226
|
counts: graph.meta.counts,
|
|
@@ -6221,6 +6275,7 @@ function navigationToolsetConfig(serverName = "vibgrate") {
|
|
|
6221
6275
|
}
|
|
6222
6276
|
var LEDGER = "savings.jsonl";
|
|
6223
6277
|
var PER_FILE_TOKENS = 400;
|
|
6278
|
+
var SAVINGS_TOOLS = /* @__PURE__ */ new Set(["query_graph", "get_node"]);
|
|
6224
6279
|
function ledgerPath(root) {
|
|
6225
6280
|
return path18.join(cacheDir(root), LEDGER);
|
|
6226
6281
|
}
|
|
@@ -6249,6 +6304,7 @@ function readSavings(root, days, now, ratePerM = DEFAULT_RATE_PER_M) {
|
|
|
6249
6304
|
try {
|
|
6250
6305
|
const e = JSON.parse(line);
|
|
6251
6306
|
if (e.ts < cutoff) continue;
|
|
6307
|
+
if (!SAVINGS_TOOLS.has(e.tool)) continue;
|
|
6252
6308
|
queries++;
|
|
6253
6309
|
vgTokens += e.vgTokens;
|
|
6254
6310
|
baselineTokens += e.baselineTokens;
|
|
@@ -6274,6 +6330,47 @@ function readSavings(root, days, now, ratePerM = DEFAULT_RATE_PER_M) {
|
|
|
6274
6330
|
function round22(x) {
|
|
6275
6331
|
return Math.round(x * 100) / 100;
|
|
6276
6332
|
}
|
|
6333
|
+
function readUsage(root, days, now) {
|
|
6334
|
+
const file = ledgerPath(root);
|
|
6335
|
+
const cutoff = now - days * 24 * 60 * 60 * 1e3;
|
|
6336
|
+
const byTool = /* @__PURE__ */ new Map();
|
|
6337
|
+
if (fs18.existsSync(file)) {
|
|
6338
|
+
for (const line of fs18.readFileSync(file, "utf8").split("\n")) {
|
|
6339
|
+
if (!line.trim()) continue;
|
|
6340
|
+
try {
|
|
6341
|
+
const e = JSON.parse(line);
|
|
6342
|
+
if (e.ts < cutoff) continue;
|
|
6343
|
+
const outcome = e.outcome ?? "complete";
|
|
6344
|
+
const row = byTool.get(e.tool) ?? { complete: 0, partial: 0, miss: 0 };
|
|
6345
|
+
row[outcome]++;
|
|
6346
|
+
byTool.set(e.tool, row);
|
|
6347
|
+
} catch {
|
|
6348
|
+
}
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
const commands = [...byTool.entries()].map(([tool, r]) => {
|
|
6352
|
+
const calls = r.complete + r.partial + r.miss;
|
|
6353
|
+
return {
|
|
6354
|
+
tool,
|
|
6355
|
+
calls,
|
|
6356
|
+
complete: r.complete,
|
|
6357
|
+
partial: r.partial,
|
|
6358
|
+
miss: r.miss,
|
|
6359
|
+
successPct: calls ? Math.round((r.complete + r.partial) / calls * 100) : 0
|
|
6360
|
+
};
|
|
6361
|
+
}).sort((a, b) => b.calls - a.calls || a.tool.localeCompare(b.tool));
|
|
6362
|
+
const totals = commands.reduce(
|
|
6363
|
+
(t, c) => ({
|
|
6364
|
+
calls: t.calls + c.calls,
|
|
6365
|
+
complete: t.complete + c.complete,
|
|
6366
|
+
partial: t.partial + c.partial,
|
|
6367
|
+
miss: t.miss + c.miss
|
|
6368
|
+
}),
|
|
6369
|
+
{ calls: 0, complete: 0, partial: 0, miss: 0 }
|
|
6370
|
+
);
|
|
6371
|
+
const avgSuccessPct = commands.length ? Math.round(commands.reduce((s, c) => s + c.successPct, 0) / commands.length) : 0;
|
|
6372
|
+
return { enabled: savingsRecorded(root), days, commands, totals, avgSuccessPct };
|
|
6373
|
+
}
|
|
6277
6374
|
var PROBE_INTERVAL_MS = 2e3;
|
|
6278
6375
|
var MAX_PROBE_INTERVAL_MS = 3e4;
|
|
6279
6376
|
var PROBE_DUTY_FACTOR = 20;
|
|
@@ -6373,9 +6470,7 @@ function createServer(source, opts = {}) {
|
|
|
6373
6470
|
try {
|
|
6374
6471
|
const args = request.params.arguments ?? {};
|
|
6375
6472
|
const result = await tool.handler(graph, args, { root, local, dedup, seen });
|
|
6376
|
-
if (savings
|
|
6377
|
-
maybeRecordSaving(root, tool.name, result);
|
|
6378
|
-
}
|
|
6473
|
+
if (savings) recordUsage(root, tool.name, result);
|
|
6379
6474
|
return renderToolResult(result);
|
|
6380
6475
|
} catch (err) {
|
|
6381
6476
|
return errorResult(`tool "${tool.name}" failed: ${err.message}`);
|
|
@@ -6395,14 +6490,57 @@ function sleep(ms) {
|
|
|
6395
6490
|
timer.unref?.();
|
|
6396
6491
|
});
|
|
6397
6492
|
}
|
|
6398
|
-
function
|
|
6399
|
-
|
|
6493
|
+
function recordUsage(root, tool, result) {
|
|
6494
|
+
const outcome = classifyOutcome(result);
|
|
6495
|
+
let vgTokens = 0;
|
|
6496
|
+
let baselineTokens = 0;
|
|
6497
|
+
if (SAVINGS_TOOLS.has(tool) && result && typeof result === "object") {
|
|
6498
|
+
vgTokens = countTokens(renderedText(renderToolResult(result)));
|
|
6499
|
+
baselineTokens = referencedFiles(result).size * PER_FILE_TOKENS;
|
|
6500
|
+
}
|
|
6501
|
+
recordSaving(root, { tool, outcome, vgTokens, baselineTokens }, Date.now());
|
|
6502
|
+
}
|
|
6503
|
+
function classifyOutcome(result) {
|
|
6504
|
+
if (Array.isArray(result)) return result.length === 0 ? "miss" : "complete";
|
|
6505
|
+
if (!result || typeof result !== "object") return "miss";
|
|
6400
6506
|
const r = result;
|
|
6401
|
-
|
|
6402
|
-
if (
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6507
|
+
if (typeof r.error === "string" && r.error) return "miss";
|
|
6508
|
+
if (r.connected === false) return "miss";
|
|
6509
|
+
if (Array.isArray(r.matches) && r.matches.length === 0) return "miss";
|
|
6510
|
+
return isPartial(r) ? "partial" : "complete";
|
|
6511
|
+
}
|
|
6512
|
+
function isPartial(r) {
|
|
6513
|
+
if (r.moreAvailable === true) return true;
|
|
6514
|
+
if (r._truncated && typeof r._truncated === "object") return true;
|
|
6515
|
+
for (const [key, value] of Object.entries(r)) {
|
|
6516
|
+
if (typeof value !== "number" || !key.endsWith("Total")) continue;
|
|
6517
|
+
const base = key.slice(0, -"Total".length);
|
|
6518
|
+
const shown = Array.isArray(r[base]) ? r[base].length : 0;
|
|
6519
|
+
if (value > shown) return true;
|
|
6520
|
+
}
|
|
6521
|
+
return false;
|
|
6522
|
+
}
|
|
6523
|
+
function renderedText(rendered) {
|
|
6524
|
+
const block = rendered.content?.find((b) => b.type === "text");
|
|
6525
|
+
return block && "text" in block && typeof block.text === "string" ? block.text : "";
|
|
6526
|
+
}
|
|
6527
|
+
function referencedFiles(result) {
|
|
6528
|
+
const r = result;
|
|
6529
|
+
const files = /* @__PURE__ */ new Set();
|
|
6530
|
+
if (typeof r.file === "string" && r.file) files.add(r.file);
|
|
6531
|
+
for (const m of asArray(r.matches)) {
|
|
6532
|
+
const f = m.file;
|
|
6533
|
+
if (typeof f === "string" && f) files.add(f);
|
|
6534
|
+
}
|
|
6535
|
+
for (const name of [...asArray(r.calls), ...asArray(r.calledBy)]) {
|
|
6536
|
+
if (typeof name !== "string") continue;
|
|
6537
|
+
const i = name.indexOf(":");
|
|
6538
|
+
if (i > 0) files.add(name.slice(0, i));
|
|
6539
|
+
}
|
|
6540
|
+
return files;
|
|
6541
|
+
}
|
|
6542
|
+
function asArray(v) {
|
|
6543
|
+
return Array.isArray(v) ? v : [];
|
|
6406
6544
|
}
|
|
6407
6545
|
function errorResult(message) {
|
|
6408
6546
|
return { content: [{ type: "text", text: message }], isError: true };
|
|
@@ -6901,6 +7039,6 @@ function spdx(ctx) {
|
|
|
6901
7039
|
return JSON.stringify(doc, null, 2) + "\n";
|
|
6902
7040
|
}
|
|
6903
7041
|
|
|
6904
|
-
export { ASSISTANTS, CliError, ECOSYSTEMS, ExitCode, FREE_PACK, GraphIndex, GraphSource, NPX_INVOCATION, ResourceLimitError, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assessDocQuality, assistantById, availableRegionIds, buildFacts, buildGraph, buildModuleResolver, cacheDir, catalogPath, clearModelCache, clearStoredCredentials, cosine, countPending, coveringTests, createServer, createWorkspaceDsn, credentialsPath, dashHostForIngestHost, decodeScipIndex, defaultGraphPath, detectRunner, detectServeLaunch, discover, discoverModels, driftCount, driftFor, dsnCommand, embeddingsCached, enrichOnline, ensureGitignored, epistemicBreakdown, exportGraph, fetchHostedDocs, findGitRoot, findNodes, formatForExt, getNodeEmbeddings, gitignoreEntryForCredentials, groundGraph, hasDrift, identifierParts, impactOf, ingestHostForRegionId, installAssistant, inventory, isModelReady, isTestFile, libDir, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, localApiSurface, localPackageDocs, modelCacheInfo, nodeById, nodeEmbedText, parseDsn, parseGraph, parseJsonc, probeFreshness, publishPrivateLibrary, pushCommand, queryGraph, queryGraphSemantic, readDoc, readSavings, readScanArtifact, recordSaving, refreshIfStale, relativeResolver, renderHtml, renderReport, resolveCliInvocation, resolveDsn, resolveEmbedModel, resolveIngestHost, resolveLib, resolveLimits, resolveOne, resolveVersion, saveCatalog, savingsRecorded, scipEdges, selectForBudget, serializeGraph, serveStdio, shortestPath, stableStringify, symbolsFromApi, testsToRun, unavailableMessage, uninstallAssistant, uploadScanArtifact, usageError, verifyDeterminism, vibgrateDir, writeArtifacts, writeNavigationConfig, writeSnapshot, writeStoredCredentials };
|
|
6905
|
-
//# sourceMappingURL=chunk-
|
|
6906
|
-
//# sourceMappingURL=chunk-
|
|
7042
|
+
export { ASSISTANTS, CliError, ECOSYSTEMS, ExitCode, FREE_PACK, GraphIndex, GraphSource, NPX_INVOCATION, ResourceLimitError, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assessDocQuality, assistantById, availableRegionIds, buildFacts, buildGraph, buildModuleResolver, cacheDir, catalogPath, clearModelCache, clearStoredCredentials, cosine, countPending, coveringTests, createServer, createWorkspaceDsn, credentialsPath, dashHostForIngestHost, decodeScipIndex, defaultGraphPath, detectRunner, detectServeLaunch, discover, discoverModels, driftCount, driftFor, dsnCommand, embeddingsCached, enrichOnline, ensureGitignored, epistemicBreakdown, exportGraph, fetchHostedDocs, findGitRoot, findNodes, formatForExt, getNodeEmbeddings, gitignoreEntryForCredentials, groundGraph, hasDrift, identifierParts, impactOf, ingestHostForRegionId, installAssistant, inventory, isModelReady, isTestFile, libDir, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, localApiSurface, localPackageDocs, modelCacheInfo, nodeById, nodeEmbedText, parseDsn, parseGraph, parseJsonc, probeFreshness, publishPrivateLibrary, pushCommand, queryGraph, queryGraphSemantic, readDoc, readSavings, readScanArtifact, readUsage, recordSaving, refreshIfStale, relativeResolver, renderHtml, renderReport, resolveCliInvocation, resolveDsn, resolveEmbedModel, resolveIngestHost, resolveLib, resolveLimits, resolveOne, resolveVersion, saveCatalog, savingsRecorded, scipEdges, selectForBudget, serializeGraph, serveStdio, shortestPath, stableStringify, symbolsFromApi, testsToRun, unavailableMessage, uninstallAssistant, uploadScanArtifact, usageError, verifyDeterminism, vibgrateDir, writeArtifacts, writeNavigationConfig, writeSnapshot, writeStoredCredentials };
|
|
7043
|
+
//# sourceMappingURL=chunk-AWEAREOE.js.map
|
|
7044
|
+
//# sourceMappingURL=chunk-AWEAREOE.js.map
|