@vibgrate/cli 2026.729.2 → 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.
Files changed (84) hide show
  1. package/DOCS.md +5 -1
  2. package/dist/agent-Z4Z66IGM.js +22 -0
  3. package/dist/agent-Z4Z66IGM.js.map +1 -0
  4. package/dist/baseline-Q3QQF5QF.js +9 -0
  5. package/dist/{baseline-UOTGTJYT.js.map → baseline-Q3QQF5QF.js.map} +1 -1
  6. package/dist/checkpoint-4WFZMKEO.js +56 -0
  7. package/dist/checkpoint-4WFZMKEO.js.map +1 -0
  8. package/dist/{chunk-CYC3ZI32.js → chunk-3FQSBVQD.js} +6 -6
  9. package/dist/{chunk-CYC3ZI32.js.map → chunk-3FQSBVQD.js.map} +1 -1
  10. package/dist/{chunk-2ZHWF7C6.js → chunk-42RDYQFF.js} +42 -67
  11. package/dist/chunk-42RDYQFF.js.map +1 -0
  12. package/dist/{chunk-HDQG3QYV.js → chunk-4BOWWYSE.js} +32 -17
  13. package/dist/chunk-4BOWWYSE.js.map +1 -0
  14. package/dist/chunk-543E6WDJ.js +61 -0
  15. package/dist/chunk-543E6WDJ.js.map +1 -0
  16. package/dist/{chunk-JIBOJTGS.js → chunk-5HYCB55P.js} +101 -101
  17. package/dist/chunk-5HYCB55P.js.map +1 -0
  18. package/dist/{chunk-QDZ47G45.js → chunk-5MNX3OLS.js} +19 -11
  19. package/dist/chunk-5MNX3OLS.js.map +1 -0
  20. package/dist/{chunk-74ZMAOVF.js → chunk-EQ3IOFIG.js} +55 -9
  21. package/dist/chunk-EQ3IOFIG.js.map +1 -0
  22. package/dist/{chunk-SIPGDJT4.js → chunk-EVLS2M5G.js} +4 -4
  23. package/dist/{chunk-SIPGDJT4.js.map → chunk-EVLS2M5G.js.map} +1 -1
  24. package/dist/{chunk-PXXVLX7K.js → chunk-HWFVBYX4.js} +6 -6
  25. package/dist/{chunk-PXXVLX7K.js.map → chunk-HWFVBYX4.js.map} +1 -1
  26. package/dist/{chunk-P3QIO4ZU.js → chunk-JXMZCTVZ.js} +3 -3
  27. package/dist/{chunk-P3QIO4ZU.js.map → chunk-JXMZCTVZ.js.map} +1 -1
  28. package/dist/{chunk-VZRQUI54.js → chunk-KBPNH67Q.js} +4 -4
  29. package/dist/{chunk-VZRQUI54.js.map → chunk-KBPNH67Q.js.map} +1 -1
  30. package/dist/{chunk-RZEXHDCF.js → chunk-MYM5VIJ4.js} +14 -3
  31. package/dist/chunk-MYM5VIJ4.js.map +1 -0
  32. package/dist/chunk-N3HCPBFY.js +6 -0
  33. package/dist/{chunk-WQE4OIZS.js.map → chunk-N3HCPBFY.js.map} +1 -1
  34. package/dist/{chunk-PMYWZRRS.js → chunk-RBIRXQR6.js} +21 -3
  35. package/dist/chunk-RBIRXQR6.js.map +1 -0
  36. package/dist/{chunk-TCJTQGAO.js → chunk-RGEVBSLK.js} +3 -3
  37. package/dist/{chunk-TCJTQGAO.js.map → chunk-RGEVBSLK.js.map} +1 -1
  38. package/dist/{chunk-67YG3R5F.js → chunk-RIEUPFXO.js} +4 -4
  39. package/dist/{chunk-67YG3R5F.js.map → chunk-RIEUPFXO.js.map} +1 -1
  40. package/dist/{chunk-PRGCCW7D.js → chunk-WBMMRERH.js} +3 -3
  41. package/dist/{chunk-PRGCCW7D.js.map → chunk-WBMMRERH.js.map} +1 -1
  42. package/dist/{chunk-6HX47EBL.js → chunk-X634FZVG.js} +3 -3
  43. package/dist/{chunk-6HX47EBL.js.map → chunk-X634FZVG.js.map} +1 -1
  44. package/dist/{chunk-F6ZPUKED.js → chunk-YMSXP6AO.js} +3 -3
  45. package/dist/{chunk-F6ZPUKED.js.map → chunk-YMSXP6AO.js.map} +1 -1
  46. package/dist/cli.js +713 -373
  47. package/dist/cli.js.map +1 -1
  48. package/dist/{graph-backend-GBL33GMW.js → graph-backend-G5Y6QQV4.js} +4 -4
  49. package/dist/{graph-backend-GBL33GMW.js.map → graph-backend-G5Y6QQV4.js.map} +1 -1
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +8 -8
  52. package/dist/{interactive-HLGJJFLI.js → interactive-MJVMY5JP.js} +23 -22
  53. package/dist/interactive-MJVMY5JP.js.map +1 -0
  54. package/dist/{llm-host-5RE34322.js → llm-host-DZBD5D36.js} +5 -5
  55. package/dist/{llm-host-5RE34322.js.map → llm-host-DZBD5D36.js.map} +1 -1
  56. package/dist/load-4PARCNMD.js +9 -0
  57. package/dist/{load-4MLIHGXF.js.map → load-4PARCNMD.js.map} +1 -1
  58. package/dist/rules-ASYEUNB5.js +74 -0
  59. package/dist/rules-ASYEUNB5.js.map +1 -0
  60. package/dist/runtime-session-AILFASQV.js +19 -0
  61. package/dist/{runtime-session-5M6QZZOS.js.map → runtime-session-AILFASQV.js.map} +1 -1
  62. package/dist/{session-2JT4AUZT.js → session-3OBIQLE4.js} +5 -5
  63. package/dist/{session-2JT4AUZT.js.map → session-3OBIQLE4.js.map} +1 -1
  64. package/dist/{stream-json-Y45JBNYP.js → stream-json-MTPWWVRR.js} +81 -9
  65. package/dist/stream-json-MTPWWVRR.js.map +1 -0
  66. package/dist/{vg-mcp-bridge-ZCKBYQ2D.js → vg-mcp-bridge-BLHEIWMT.js} +6 -6
  67. package/dist/{vg-mcp-bridge-ZCKBYQ2D.js.map → vg-mcp-bridge-BLHEIWMT.js.map} +1 -1
  68. package/dist/{vgd-TGGEAGQZ.js → vgd-S7D2SITC.js} +8 -8
  69. package/dist/vgd-S7D2SITC.js.map +1 -0
  70. package/package.json +1 -1
  71. package/dist/baseline-UOTGTJYT.js +0 -9
  72. package/dist/chunk-2ZHWF7C6.js.map +0 -1
  73. package/dist/chunk-74ZMAOVF.js.map +0 -1
  74. package/dist/chunk-HDQG3QYV.js.map +0 -1
  75. package/dist/chunk-JIBOJTGS.js.map +0 -1
  76. package/dist/chunk-PMYWZRRS.js.map +0 -1
  77. package/dist/chunk-QDZ47G45.js.map +0 -1
  78. package/dist/chunk-RZEXHDCF.js.map +0 -1
  79. package/dist/chunk-WQE4OIZS.js +0 -6
  80. package/dist/interactive-HLGJJFLI.js.map +0 -1
  81. package/dist/load-4MLIHGXF.js +0 -9
  82. package/dist/runtime-session-5M6QZZOS.js +0 -19
  83. package/dist/stream-json-Y45JBNYP.js.map +0 -1
  84. package/dist/vgd-TGGEAGQZ.js.map +0 -1
@@ -1,6 +1,7 @@
1
- import { buildAgentMessages, redactSecrets, unifiedDiff, applyEdit } from './chunk-RZEXHDCF.js';
2
- import { localGraphBackend } from './chunk-TCJTQGAO.js';
3
- import { buildIdentifierTrieFromGraph, KvBlockRegistry, graphDraftCandidates, extractIdentifiers, scanIdentifiersAgainstTrie } from './chunk-JIBOJTGS.js';
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/secrets.ts
583
- var SECRET_FILE = new RegExp(
584
- [
585
- String.raw`(^|/)\.env(\.[\w.-]+)?$`,
586
- // .env, .env.local, .env.production
587
- String.raw`(^|/)\.npmrc$`,
588
- String.raw`(^|/)\.netrc$`,
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
- if (p.op === "delete") return { file: p.file, op: "delete", diff: p.diff };
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: options.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-2ZHWF7C6.js.map
2666
- //# sourceMappingURL=chunk-2ZHWF7C6.js.map
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