@vibgrate/cli 2026.729.1 → 2026.729.3
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 +5 -1
- package/dist/agent-Z4Z66IGM.js +22 -0
- package/dist/agent-Z4Z66IGM.js.map +1 -0
- package/dist/baseline-Q3QQF5QF.js +9 -0
- package/dist/{baseline-MROWBNK7.js.map → baseline-Q3QQF5QF.js.map} +1 -1
- package/dist/checkpoint-4WFZMKEO.js +56 -0
- package/dist/checkpoint-4WFZMKEO.js.map +1 -0
- package/dist/{chunk-YMHQZ24Q.js → chunk-3FQSBVQD.js} +6 -6
- package/dist/{chunk-YMHQZ24Q.js.map → chunk-3FQSBVQD.js.map} +1 -1
- package/dist/{chunk-2ZHWF7C6.js → chunk-42RDYQFF.js} +42 -67
- package/dist/chunk-42RDYQFF.js.map +1 -0
- package/dist/{chunk-OIWHR57Q.js → chunk-4BOWWYSE.js} +37 -19
- package/dist/chunk-4BOWWYSE.js.map +1 -0
- package/dist/chunk-543E6WDJ.js +61 -0
- package/dist/chunk-543E6WDJ.js.map +1 -0
- package/dist/{chunk-JIBOJTGS.js → chunk-5HYCB55P.js} +101 -101
- package/dist/chunk-5HYCB55P.js.map +1 -0
- package/dist/{chunk-EEVZVXT2.js → chunk-5MNX3OLS.js} +19 -11
- package/dist/chunk-5MNX3OLS.js.map +1 -0
- package/dist/{chunk-2JV3J5NF.js → chunk-EQ3IOFIG.js} +55 -9
- package/dist/chunk-EQ3IOFIG.js.map +1 -0
- package/dist/{chunk-SIPGDJT4.js → chunk-EVLS2M5G.js} +4 -4
- package/dist/{chunk-SIPGDJT4.js.map → chunk-EVLS2M5G.js.map} +1 -1
- package/dist/{chunk-TQFY6OSV.js → chunk-HWFVBYX4.js} +6 -6
- package/dist/{chunk-TQFY6OSV.js.map → chunk-HWFVBYX4.js.map} +1 -1
- package/dist/{chunk-YKVNMNEM.js → chunk-JXMZCTVZ.js} +3 -3
- package/dist/{chunk-YKVNMNEM.js.map → chunk-JXMZCTVZ.js.map} +1 -1
- package/dist/{chunk-3IJB5UJI.js → chunk-KBPNH67Q.js} +4 -4
- package/dist/{chunk-3IJB5UJI.js.map → chunk-KBPNH67Q.js.map} +1 -1
- package/dist/{chunk-RZEXHDCF.js → chunk-MYM5VIJ4.js} +14 -3
- package/dist/chunk-MYM5VIJ4.js.map +1 -0
- package/dist/chunk-N3HCPBFY.js +6 -0
- package/dist/{chunk-NQ4FSRXL.js.map → chunk-N3HCPBFY.js.map} +1 -1
- package/dist/{chunk-PMYWZRRS.js → chunk-RBIRXQR6.js} +21 -3
- package/dist/chunk-RBIRXQR6.js.map +1 -0
- package/dist/{chunk-TCJTQGAO.js → chunk-RGEVBSLK.js} +3 -3
- package/dist/{chunk-TCJTQGAO.js.map → chunk-RGEVBSLK.js.map} +1 -1
- package/dist/{chunk-QS5BTBRX.js → chunk-RIEUPFXO.js} +4 -4
- package/dist/{chunk-QS5BTBRX.js.map → chunk-RIEUPFXO.js.map} +1 -1
- package/dist/{chunk-PRGCCW7D.js → chunk-WBMMRERH.js} +3 -3
- package/dist/{chunk-PRGCCW7D.js.map → chunk-WBMMRERH.js.map} +1 -1
- package/dist/{chunk-6HX47EBL.js → chunk-X634FZVG.js} +3 -3
- package/dist/{chunk-6HX47EBL.js.map → chunk-X634FZVG.js.map} +1 -1
- package/dist/{chunk-CF2MLSOV.js → chunk-YMSXP6AO.js} +3 -3
- package/dist/{chunk-CF2MLSOV.js.map → chunk-YMSXP6AO.js.map} +1 -1
- package/dist/cli.js +738 -383
- package/dist/cli.js.map +1 -1
- package/dist/{graph-backend-GBL33GMW.js → graph-backend-G5Y6QQV4.js} +4 -4
- package/dist/{graph-backend-GBL33GMW.js.map → graph-backend-G5Y6QQV4.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/{interactive-R5VQGDWP.js → interactive-MJVMY5JP.js} +23 -22
- package/dist/interactive-MJVMY5JP.js.map +1 -0
- package/dist/{llm-host-5RE34322.js → llm-host-DZBD5D36.js} +5 -5
- package/dist/{llm-host-5RE34322.js.map → llm-host-DZBD5D36.js.map} +1 -1
- package/dist/load-4PARCNMD.js +9 -0
- package/dist/{load-WKIZF2AK.js.map → load-4PARCNMD.js.map} +1 -1
- package/dist/rules-ASYEUNB5.js +74 -0
- package/dist/rules-ASYEUNB5.js.map +1 -0
- package/dist/runtime-session-AILFASQV.js +19 -0
- package/dist/{runtime-session-5NRB6BTR.js.map → runtime-session-AILFASQV.js.map} +1 -1
- package/dist/{session-2JT4AUZT.js → session-3OBIQLE4.js} +5 -5
- package/dist/{session-2JT4AUZT.js.map → session-3OBIQLE4.js.map} +1 -1
- package/dist/{stream-json-Y45JBNYP.js → stream-json-MTPWWVRR.js} +81 -9
- package/dist/stream-json-MTPWWVRR.js.map +1 -0
- package/dist/{vg-mcp-bridge-YXQS6HTO.js → vg-mcp-bridge-BLHEIWMT.js} +6 -6
- package/dist/{vg-mcp-bridge-YXQS6HTO.js.map → vg-mcp-bridge-BLHEIWMT.js.map} +1 -1
- package/dist/{vgd-KC5RCOP6.js → vgd-S7D2SITC.js} +8 -8
- package/dist/vgd-S7D2SITC.js.map +1 -0
- package/package.json +1 -1
- package/dist/baseline-MROWBNK7.js +0 -9
- package/dist/chunk-2JV3J5NF.js.map +0 -1
- package/dist/chunk-2ZHWF7C6.js.map +0 -1
- package/dist/chunk-EEVZVXT2.js.map +0 -1
- package/dist/chunk-JIBOJTGS.js.map +0 -1
- package/dist/chunk-NQ4FSRXL.js +0 -6
- package/dist/chunk-OIWHR57Q.js.map +0 -1
- package/dist/chunk-PMYWZRRS.js.map +0 -1
- package/dist/chunk-RZEXHDCF.js.map +0 -1
- package/dist/interactive-R5VQGDWP.js.map +0 -1
- package/dist/load-WKIZF2AK.js +0 -9
- package/dist/runtime-session-5NRB6BTR.js +0 -19
- package/dist/stream-json-Y45JBNYP.js.map +0 -1
- package/dist/vgd-KC5RCOP6.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { secretEgressRefusal, isSecretPath, secretRefusal, redactText } from './chunk-543E6WDJ.js';
|
|
2
|
+
import { buildAgentMessages, redactSecrets, unifiedDiff, applyEdit } from './chunk-MYM5VIJ4.js';
|
|
3
|
+
import { localGraphBackend } from './chunk-RGEVBSLK.js';
|
|
4
|
+
import { buildIdentifierTrieFromGraph, KvBlockRegistry, graphDraftCandidates, extractIdentifiers, scanIdentifiersAgainstTrie } from './chunk-5HYCB55P.js';
|
|
4
5
|
import { resolve } from './chunk-IPICO2RV.js';
|
|
5
6
|
import { searchSymbols, resolveLib, loadCatalog, readDoc, localPackageDocs, resolveVersion } from './chunk-G4HTI4ZM.js';
|
|
6
7
|
import { summarizeCapsule, CAPSULE_RANKING_VERSION, buildCodeContext, buildTaskCapsule, capsuleToCodeContext, recordCliCall, CLI_TOOL_ALIASES } from './chunk-US2DAKCM.js';
|
|
@@ -579,62 +580,13 @@ function locatorsFromGraph(nodes) {
|
|
|
579
580
|
return (id) => map.get(id) ?? null;
|
|
580
581
|
}
|
|
581
582
|
|
|
582
|
-
// src/code/
|
|
583
|
-
var
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
String.raw`(^|/)\.pgpass$`,
|
|
590
|
-
String.raw`(^|/)\.git-credentials$`,
|
|
591
|
-
String.raw`(^|/)id_(rsa|dsa|ecdsa|ed25519)$`,
|
|
592
|
-
String.raw`\.pem$`,
|
|
593
|
-
String.raw`\.key$`,
|
|
594
|
-
String.raw`\.p12$`,
|
|
595
|
-
String.raw`\.pfx$`,
|
|
596
|
-
String.raw`(^|/)credentials(\.json)?$`,
|
|
597
|
-
// aws credentials, gcloud
|
|
598
|
-
String.raw`(^|/)\.aws/credentials$`,
|
|
599
|
-
String.raw`(^|/)secrets?\.(ya?ml|json|toml|env)$`
|
|
600
|
-
].join("|"),
|
|
601
|
-
"i"
|
|
602
|
-
);
|
|
603
|
-
function isSecretPath(file) {
|
|
604
|
-
const normalized = file.replace(/\\/g, "/");
|
|
605
|
-
return SECRET_FILE.test(normalized);
|
|
606
|
-
}
|
|
607
|
-
function secretRefusal(file) {
|
|
608
|
-
return `refusing to read ${file} \u2014 it looks like a secrets/credentials file, and this content would be sent to the model. Reference the values by name instead, or read a non-secret file.`;
|
|
609
|
-
}
|
|
610
|
-
var TOKEN_SHAPES = /\b(sk|pk|rk|xoxb|xoxp|ghp|gho|ghs|ghu|glpat|AKIA|ASIA|AIza|ya29|hf|nvapi|sk-ant|sk-or)[-_][A-Za-z0-9\-_./+]{8,}/g;
|
|
611
|
-
var BEARER = /\b(Authorization|Bearer|token|api[_-]?key)\b\s*[:=]\s*['"]?[A-Za-z0-9\-_./+]{12,}['"]?/gi;
|
|
612
|
-
var ASSIGNMENT = /\b([A-Za-z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIAL|PRIVATE|ACCESS|SESSION)[A-Za-z0-9_]*)\s*([:=])\s*['"]?([^\s'";,]{6,})/gi;
|
|
613
|
-
var URL_AUTH = /\b([a-z][a-z0-9+.-]*:\/\/)([^:/\s]+):([^@/\s]+)@/gi;
|
|
614
|
-
function redactText(text) {
|
|
615
|
-
return text.replace(URL_AUTH, "$1$2:***redacted***@").replace(TOKEN_SHAPES, (_m, prefix) => `${prefix}-***redacted***`).replace(BEARER, (_m, k) => `${k}: ***redacted***`).replace(ASSIGNMENT, (_m, name, op) => `${name}${op}***redacted***`);
|
|
616
|
-
}
|
|
617
|
-
function findSecretShapes(text) {
|
|
618
|
-
const hits = [];
|
|
619
|
-
const scan = (re, kind) => {
|
|
620
|
-
re.lastIndex = 0;
|
|
621
|
-
let m;
|
|
622
|
-
while ((m = re.exec(text)) !== null) {
|
|
623
|
-
hits.push({ kind, index: m.index });
|
|
624
|
-
if (m[0].length === 0) re.lastIndex++;
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
scan(TOKEN_SHAPES, "token");
|
|
628
|
-
scan(BEARER, "bearer");
|
|
629
|
-
scan(ASSIGNMENT, "assignment");
|
|
630
|
-
scan(URL_AUTH, "url-auth");
|
|
631
|
-
return hits.sort((a, b) => a.index - b.index || a.kind.localeCompare(b.kind));
|
|
632
|
-
}
|
|
633
|
-
function secretEgressRefusal(text, surface = "network payload") {
|
|
634
|
-
const hits = findSecretShapes(text);
|
|
635
|
-
if (hits.length === 0) return null;
|
|
636
|
-
const kinds = [...new Set(hits.map((h) => h.kind))].sort().join(", ");
|
|
637
|
-
return `refusing to send ${surface} \u2014 detected credential-shaped content (${kinds}). Remove secrets before any network call; path-level secrets files are also blocked.`;
|
|
583
|
+
// src/code/preview-sides.ts
|
|
584
|
+
var MAX_PREVIEW_CHARS = 256e3;
|
|
585
|
+
function previewSides(before, after) {
|
|
586
|
+
const b = before ?? "";
|
|
587
|
+
const a = after ?? "";
|
|
588
|
+
if (b.length > MAX_PREVIEW_CHARS || a.length > MAX_PREVIEW_CHARS) return void 0;
|
|
589
|
+
return { before: b, after: a };
|
|
638
590
|
}
|
|
639
591
|
|
|
640
592
|
// src/code/safety.ts
|
|
@@ -1480,7 +1432,7 @@ async function editFile(ctx, path2, search2, replace) {
|
|
|
1480
1432
|
return { content: `edit not applied (${outcome.status}): ${outcome.reason ?? ""}`, mutated: false };
|
|
1481
1433
|
}
|
|
1482
1434
|
const diff = unifiedDiff(before, after, path2);
|
|
1483
|
-
if (!await ctx.approve({ kind: "edit", file: path2, diff })) {
|
|
1435
|
+
if (!await ctx.approve({ kind: "edit", file: path2, diff, sides: previewSides(before, after) })) {
|
|
1484
1436
|
return { content: `edit to ${path2} was declined by the user`, mutated: false };
|
|
1485
1437
|
}
|
|
1486
1438
|
ctx.fsImpl.write(path2, after ?? "");
|
|
@@ -1555,11 +1507,12 @@ async function applyPatchTool(ctx, raw) {
|
|
|
1555
1507
|
return { content: "patch applied with no content changes (no-op)", mutated: false };
|
|
1556
1508
|
}
|
|
1557
1509
|
const files = planned.map((p) => {
|
|
1558
|
-
|
|
1510
|
+
const sides = previewSides(p.before, p.after);
|
|
1511
|
+
if (p.op === "delete") return { file: p.file, op: "delete", diff: p.diff, sides };
|
|
1559
1512
|
if (p.op === "create") {
|
|
1560
|
-
return { file: p.file, op: "create", bytes: Buffer.byteLength(p.after ?? ""), diff: p.diff };
|
|
1513
|
+
return { file: p.file, op: "create", bytes: Buffer.byteLength(p.after ?? ""), diff: p.diff, sides };
|
|
1561
1514
|
}
|
|
1562
|
-
return { file: p.file, op: "edit", diff: p.diff };
|
|
1515
|
+
return { file: p.file, op: "edit", diff: p.diff, sides };
|
|
1563
1516
|
});
|
|
1564
1517
|
if (!await ctx.approve({ kind: "patch", files })) {
|
|
1565
1518
|
return {
|
|
@@ -2109,6 +2062,9 @@ async function runAgent(options) {
|
|
|
2109
2062
|
let capsule = built.capsule;
|
|
2110
2063
|
const useLadder = options.verifyLadder ?? !!capsule;
|
|
2111
2064
|
const messages = buildAgentMessages(context);
|
|
2065
|
+
if (options.projectRules) {
|
|
2066
|
+
messages.push({ role: "user", content: options.projectRules });
|
|
2067
|
+
}
|
|
2112
2068
|
if (options.priorSummary) {
|
|
2113
2069
|
messages.push({ role: "user", content: options.priorSummary });
|
|
2114
2070
|
}
|
|
@@ -2185,13 +2141,29 @@ async function runAgent(options) {
|
|
|
2185
2141
|
if (options.executionEnv) return options.executionEnv.run(command, { cwd: root });
|
|
2186
2142
|
return options.run(command);
|
|
2187
2143
|
};
|
|
2144
|
+
const actionFiles = (action) => {
|
|
2145
|
+
if (action.kind === "patch") return action.files.map((f) => f.file);
|
|
2146
|
+
return "file" in action && action.file ? [action.file] : [];
|
|
2147
|
+
};
|
|
2148
|
+
const approveAndCheckpoint = async (action) => {
|
|
2149
|
+
const approved = await options.approve(action);
|
|
2150
|
+
if (!approved || !options.checkpoint) return approved;
|
|
2151
|
+
const files = actionFiles(action);
|
|
2152
|
+
if (!files.length) return approved;
|
|
2153
|
+
try {
|
|
2154
|
+
const cp = options.checkpoint(files);
|
|
2155
|
+
if (cp) onEvent({ type: "checkpoint", ...cp, files });
|
|
2156
|
+
} catch {
|
|
2157
|
+
}
|
|
2158
|
+
return approved;
|
|
2159
|
+
};
|
|
2188
2160
|
const ctx = {
|
|
2189
2161
|
root,
|
|
2190
2162
|
graph,
|
|
2191
2163
|
fsImpl,
|
|
2192
2164
|
spans,
|
|
2193
2165
|
run: runShell,
|
|
2194
|
-
approve:
|
|
2166
|
+
approve: approveAndCheckpoint,
|
|
2195
2167
|
askUser: options.askUser,
|
|
2196
2168
|
auto: options.auto,
|
|
2197
2169
|
denyCommands: options.denyCommands,
|
|
@@ -2396,6 +2368,9 @@ Fix the failing tests, then call finish again.${verifyRounds === 0 ? " (last ver
|
|
|
2396
2368
|
return "retry";
|
|
2397
2369
|
};
|
|
2398
2370
|
for (let step = 1; step <= maxSteps; step++) {
|
|
2371
|
+
if (options.signal?.aborted) {
|
|
2372
|
+
return finish("cancelled", "stopped at your request", step - 1);
|
|
2373
|
+
}
|
|
2399
2374
|
currentStep = step;
|
|
2400
2375
|
onEvent({ type: "step", n: step });
|
|
2401
2376
|
const compacted = compact(messages, contextBudget, changes);
|
|
@@ -2661,6 +2636,6 @@ function buildSpanIndex(graph) {
|
|
|
2661
2636
|
return map;
|
|
2662
2637
|
}
|
|
2663
2638
|
|
|
2664
|
-
export { CONTEXT_POLICY_VERSION, computeFcsReport, createTrajectoryCollector, renderFcsReportMarkdown, runAgent };
|
|
2665
|
-
//# sourceMappingURL=chunk-
|
|
2666
|
-
//# sourceMappingURL=chunk-
|
|
2639
|
+
export { CONTEXT_POLICY_VERSION, DISCOVERY_TOOLS, MUTATION_TOOLS, compact, computeFcsReport, createTrajectoryCollector, renderFcsReportMarkdown, runAgent };
|
|
2640
|
+
//# sourceMappingURL=chunk-42RDYQFF.js.map
|
|
2641
|
+
//# sourceMappingURL=chunk-42RDYQFF.js.map
|