@vibgrate/cli 2026.728.4 → 2026.728.5

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/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { sha256Hex, generateKeypair, dssePae, DSSE_PAYLOAD_TYPE, keyId, registerBuild, readGlobal, applyGlobalOptions, ProgressBar, printLogo, fetchCatalog, resolveProviders, runBuild } from './chunk-LYDH2PHN.js';
3
- export { runBuild } from './chunk-LYDH2PHN.js';
2
+ import { sha256Hex, generateKeypair, dssePae, DSSE_PAYLOAD_TYPE, keyId, registerBuild, readGlobal, applyGlobalOptions, ProgressBar, printLogo, fetchCatalog, resolveProviders, runBuild } from './chunk-643KXZ54.js';
3
+ export { runBuild } from './chunk-643KXZ54.js';
4
4
  import { CONTEXT_POLICY_VERSION, computeFcsReport, renderFcsReportMarkdown, createTrajectoryCollector, runAgent } from './chunk-2ZHWF7C6.js';
5
- import { loadAdvancedScanHook, baselineCommand } from './chunk-HY2RVURA.js';
5
+ import { loadAdvancedScanHook, baselineCommand } from './chunk-SGI5ZP2Y.js';
6
6
  import { runCodeSession } from './chunk-PRGCCW7D.js';
7
7
  import { summarizeDiffs, ScriptedProvider } from './chunk-RZEXHDCF.js';
8
8
  import { disableColor, info, c, json, out } from './chunk-CT5BS56U.js';
@@ -21,12 +21,12 @@ import { buildIdentifierTrieFromGraph } from './chunk-JIBOJTGS.js';
21
21
  import './chunk-7AVYKZEM.js';
22
22
  import { buildModelInstallPlan } from './chunk-WHJMS7XC.js';
23
23
  import { ensurePackage, ensureUnavailableMessage } from './chunk-REIGWTTH.js';
24
- import { serveStdio, exportGraph, GraphSource, createServer, formatForExt } from './chunk-ZU7VD4QL.js';
25
- import { CliError, ExitCode, refreshIfStale, driftCount, ASSISTANTS, detectAssistants, usageError, detectServeLaunch, installAssistant, writeNavigationConfig, uninstallAssistant, buildGraph, writeSnapshot, probeFreshness, discover, assistantById, SMALL_REPO_FILES, SKIP_DIRS, SKIP_FILES } from './chunk-WDJNUC6V.js';
26
- import { resolveDsn, resolveIngestHost, dashHostForIngestHost, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, parseDsn as parseDsn$1, uploadScanArtifact, ingestHostForRegionId, dsnCommand, pushCommand, countTokens, shortestPath, pathDisconnect, testsToRun, detectRunner, coveringTests, FREE_PACK, readScanArtifact, publishPrivateLibrary, assessDocQuality, symbolsFromApi, fetchHostedDocsCached, selectForBudget, hostedBase, readStoredCredentials, projectCredentialsPath, homeCredentialsPath } from './chunk-SA4BMEU6.js';
24
+ import { serveStdio, exportGraph, GraphSource, createServer, formatForExt } from './chunk-NH5NJ3UO.js';
25
+ import { CliError, ExitCode, refreshIfStale, driftCount, ASSISTANTS, detectAssistants, usageError, detectServeLaunch, installAssistant, writeNavigationConfig, uninstallAssistant, buildGraph, writeSnapshot, probeFreshness, discover, assistantById, SMALL_REPO_FILES, SKIP_DIRS, SKIP_FILES } from './chunk-RCP2KQGG.js';
26
+ import { resolveDsn, resolveIngestHost, dashHostForIngestHost, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, parseDsn as parseDsn$1, uploadScanArtifact, ingestHostForRegionId, dsnCommand, pushCommand, countTokens, shortestPath, pathDisconnect, testsToRun, detectRunner, coveringTests, FREE_PACK, readScanArtifact, publishPrivateLibrary, assessDocQuality, symbolsFromApi, fetchHostedDocsCached, selectForBudget, hostedBase, readStoredCredentials, projectCredentialsPath, homeCredentialsPath } from './chunk-VBVY733D.js';
27
27
  import './chunk-IPICO2RV.js';
28
28
  import { inventory, enrichOnline, ECOSYSTEMS, catalogPath, libDir, loadCatalog, driftFor, addLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface } from './chunk-G4HTI4ZM.js';
29
- import { writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, loadConfig, prepareCompressedUpload, computeDriftScore, titleBox, projectTypeToVulnEcosystem, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, PROJECT_TYPE_TO_OSV_ECOSYSTEM, fetchRiskySymbols } from './chunk-RCBMY7CR.js';
29
+ import { writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, loadConfig, prepareCompressedUpload, computeDriftScore, titleBox, projectTypeToVulnEcosystem, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, PROJECT_TYPE_TO_OSV_ECOSYSTEM, fetchRiskySymbols } from './chunk-4JD63RUR.js';
30
30
  import { recordCliCall, CLI_TOOL_ALIASES, savingsLedgerPath, clearSavings, readSavings, readUsage, readModelSavings, CAPSULE_RANKING_VERSION, SAVINGS_TOOLS, sanitizeClient } from './chunk-US2DAKCM.js';
31
31
  import { ensureDir, pathExists, readJsonFile, writeTextFile, writeJsonFile } from './chunk-CRAMOEBE.js';
32
32
  import { resolveOne } from './chunk-J7LKEB2R.js';
@@ -1677,7 +1677,7 @@ async function serveHttp(graphPath, host, port, opts, freshness, onReady) {
1677
1677
  info(c.red(`vg serve: request error: ${err.message}`));
1678
1678
  }
1679
1679
  });
1680
- await new Promise((resolve20) => httpServer.listen(port, host, resolve20));
1680
+ await new Promise((resolve21) => httpServer.listen(port, host, resolve21));
1681
1681
  info(c.dim(`vg \xB7 MCP server on http://${host}:${port}/mcp (read-only, local, ${freshness})`));
1682
1682
  onReady?.();
1683
1683
  await new Promise(() => {
@@ -1923,6 +1923,14 @@ function manifestHash(root2) {
1923
1923
  files.sort((a, b) => a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0);
1924
1924
  return hashString(canonicalize(files));
1925
1925
  }
1926
+ function isDependencyFile(root2, filePath) {
1927
+ const rel = path37.relative(path37.resolve(root2), path37.resolve(filePath));
1928
+ if (rel === "" || rel.startsWith("..") || path37.isAbsolute(rel)) return false;
1929
+ const parts = rel.split(path37.sep);
1930
+ if (parts.slice(0, -1).some((dir) => SKIP_DIRS.has(dir))) return false;
1931
+ const base = parts[parts.length - 1].toLowerCase();
1932
+ return isManifest(filePath) || SKIP_FILES.has(base);
1933
+ }
1926
1934
  function loadScanCache(root2, key2) {
1927
1935
  try {
1928
1936
  const raw = JSON.parse(fs8.readFileSync(cachePath(root2), "utf8"));
@@ -2442,6 +2450,13 @@ var VibgrateLanguageServer = class {
2442
2450
  if (!uri || !this.docs.has(uri)) return;
2443
2451
  this.scheduleScan(400);
2444
2452
  });
2453
+ this.conn.onNotification("workspace/didChangeWatchedFiles", (_m, params) => {
2454
+ const p = params;
2455
+ const relevant = (p.changes ?? []).some(
2456
+ (c2) => c2.uri && isDependencyFile(this.opts.root, uriToPath(c2.uri))
2457
+ );
2458
+ if (relevant) this.scheduleScan(400);
2459
+ });
2445
2460
  this.conn.onNotification("textDocument/didClose", (_m, params) => {
2446
2461
  const p = params;
2447
2462
  if (p.textDocument?.uri) this.docs.delete(p.textDocument.uri);
@@ -3123,7 +3138,7 @@ function registerInstall(program) {
3123
3138
  }
3124
3139
  return;
3125
3140
  }
3126
- const targets = opts.all ? ASSISTANTS : opts.detect ? detected.map((d) => d.assistant) : tools.map(resolve4);
3141
+ const targets = opts.all ? ASSISTANTS : opts.detect ? detected.map((d) => d.assistant) : tools.map(resolve5);
3127
3142
  if (targets.length === 0) {
3128
3143
  if (opts.detect) {
3129
3144
  if (global.json) json({ root: root2, detected: [], results: [] });
@@ -3154,7 +3169,7 @@ function registerInstall(program) {
3154
3169
  const uninstall = program.command("uninstall").description("remove vg from an AI assistant").argument("<tools...>", "assistant ids").option("--purge", "also delete the skill file").action(function(tools, opts) {
3155
3170
  const global = readGlobal(this);
3156
3171
  const root2 = rootOf(global);
3157
- const results = tools.map(resolve4).map((a) => ({ id: a.id, removed: uninstallAssistant(a, root2, !!opts.purge) }));
3172
+ const results = tools.map(resolve5).map((a) => ({ id: a.id, removed: uninstallAssistant(a, root2, !!opts.purge) }));
3158
3173
  if (global.json) {
3159
3174
  json({ root: root2, results });
3160
3175
  return;
@@ -3165,7 +3180,7 @@ function registerInstall(program) {
3165
3180
  });
3166
3181
  applyGlobalOptions(uninstall);
3167
3182
  }
3168
- function resolve4(id) {
3183
+ function resolve5(id) {
3169
3184
  const a = assistantById(id);
3170
3185
  if (!a) {
3171
3186
  const near = ASSISTANTS.filter(
@@ -3379,11 +3394,11 @@ function registerWatch(program) {
3379
3394
  }
3380
3395
  }
3381
3396
  info(c.dim(`vg watch \xB7 watching ${watchRoots.map((p) => path37.relative(root2, p) || ".").join(", ")} (debounce ${debounceMs}ms) \xB7 Ctrl+C to stop`));
3382
- await new Promise((resolve20) => {
3397
+ await new Promise((resolve21) => {
3383
3398
  const stop = () => {
3384
3399
  for (const w of watchers) w.close();
3385
3400
  if (timer) clearTimeout(timer);
3386
- resolve20();
3401
+ resolve21();
3387
3402
  };
3388
3403
  process.once("SIGINT", stop);
3389
3404
  process.once("SIGTERM", stop);
@@ -5376,7 +5391,7 @@ function registerModels(program) {
5376
5391
  );
5377
5392
  });
5378
5393
  applyGlobalOptions(modeCmd);
5379
- const resolve20 = cmd.command("resolve").description("resolve a Code Mode to pack + underlying model + fit (no download)").argument("[mode]", "spark | flow | forge (default: auto-fit or configured default)").action(function(modeArg) {
5394
+ const resolve21 = cmd.command("resolve").description("resolve a Code Mode to pack + underlying model + fit (no download)").argument("[mode]", "spark | flow | forge (default: auto-fit or configured default)").action(function(modeArg) {
5380
5395
  const global = readGlobal(this);
5381
5396
  const root2 = rootOf(global);
5382
5397
  const sys = gatherSystemMemory();
@@ -5408,7 +5423,7 @@ function registerModels(program) {
5408
5423
  info(c.yellow(" will not fit \u2014 choose a lower mode or free memory before loading"));
5409
5424
  }
5410
5425
  });
5411
- applyGlobalOptions(resolve20);
5426
+ applyGlobalOptions(resolve21);
5412
5427
  const installCmd = cmd.command("install").description("resolve the best Code Mode for this machine and install the pack").argument("[mode]", "spark | flow | forge (default: auto-fit)").option("--dry-run", "print the install plan only \u2014 do not download").option("--yes", "skip prompts (install already runs by default)").action(async function(modeArg, opts) {
5413
5428
  const global = readGlobal(this);
5414
5429
  const root2 = rootOf(global);
@@ -5913,11 +5928,11 @@ function fitColor(label) {
5913
5928
  return label;
5914
5929
  }
5915
5930
  function confirmYesNo(question) {
5916
- return new Promise((resolve20) => {
5931
+ return new Promise((resolve21) => {
5917
5932
  const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
5918
5933
  rl.question(`${question} [y/N] `, (answer) => {
5919
5934
  rl.close();
5920
- resolve20(/^y(es)?$/i.test(answer.trim()));
5935
+ resolve21(/^y(es)?$/i.test(answer.trim()));
5921
5936
  });
5922
5937
  });
5923
5938
  }
@@ -6188,7 +6203,7 @@ function registerCode(program) {
6188
6203
  if (!(process.stdin.isTTY && process.stdout.isTTY)) {
6189
6204
  throw usageError('say what to change, e.g. `vg code "add a --timeout flag to the scan command"` (guided mode needs an interactive terminal)');
6190
6205
  }
6191
- const { runInteractive } = await import('./interactive-32LSIBRG.js');
6206
+ const { runInteractive } = await import('./interactive-KVDKRKNK.js');
6192
6207
  await runInteractive(
6193
6208
  rootOf(global),
6194
6209
  global,
@@ -6327,7 +6342,7 @@ ${res.stderr}` : ""),
6327
6342
  exitCode: res.status ?? 1
6328
6343
  };
6329
6344
  };
6330
- const { createVgBuiltinMcpTools, mergeExternalToolsets } = await import('./vg-mcp-bridge-E4SJFL7Q.js');
6345
+ const { createVgBuiltinMcpTools, mergeExternalToolsets } = await import('./vg-mcp-bridge-B35WCSAS.js');
6331
6346
  const vgBuiltin = createVgBuiltinMcpTools({
6332
6347
  getGraph: () => graph,
6333
6348
  root: root2,
@@ -6409,7 +6424,7 @@ ${res.stderr}` : ""),
6409
6424
  if (!autonomous && !tty) {
6410
6425
  throw usageError("the agent approves each edit/command \u2014 run in a terminal to approve interactively, or pass --auto to run autonomously (or --single for a one-shot diff).");
6411
6426
  }
6412
- const { agentTask } = await import('./interactive-32LSIBRG.js');
6427
+ const { agentTask } = await import('./interactive-KVDKRKNK.js');
6413
6428
  const { nodeCodeFs } = await import('./session-2JT4AUZT.js');
6414
6429
  const { TtyPrompter } = await import('./ui-K7D3BCHD.js');
6415
6430
  let priorSummary;
@@ -6419,7 +6434,7 @@ ${res.stderr}` : ""),
6419
6434
  if (prev) priorSummary = summarizeSession(prev);
6420
6435
  }
6421
6436
  const prompter = tty ? new TtyPrompter() : void 0;
6422
- const { createVgBuiltinMcpTools, mergeExternalToolsets } = await import('./vg-mcp-bridge-E4SJFL7Q.js');
6437
+ const { createVgBuiltinMcpTools, mergeExternalToolsets } = await import('./vg-mcp-bridge-B35WCSAS.js');
6423
6438
  const vgBuiltin = createVgBuiltinMcpTools({
6424
6439
  getGraph: () => graph,
6425
6440
  root: root2,
@@ -6591,11 +6606,11 @@ function resolveSecurityTierFlag(flag, fromConfig, auto) {
6591
6606
  return auto ? "L1" : "L0";
6592
6607
  }
6593
6608
  function confirm(question) {
6594
- return new Promise((resolve20) => {
6609
+ return new Promise((resolve21) => {
6595
6610
  const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
6596
6611
  rl.question(`${question} [y/N] `, (answer) => {
6597
6612
  rl.close();
6598
- resolve20(/^y(es)?$/i.test(answer.trim()));
6613
+ resolve21(/^y(es)?$/i.test(answer.trim()));
6599
6614
  });
6600
6615
  });
6601
6616
  }
@@ -7630,7 +7645,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
7630
7645
  console.log(chalk7.green("\u2714") + ` Created ${chalk7.bold("vibgrate.config.ts")}`);
7631
7646
  }
7632
7647
  if (opts.baseline) {
7633
- const { runBaseline } = await import('./baseline-QD4HVNVJ.js');
7648
+ const { runBaseline } = await import('./baseline-Y5FBYWNJ.js');
7634
7649
  await runBaseline(rootDir);
7635
7650
  }
7636
7651
  console.log("");
@@ -9053,11 +9068,11 @@ async function getLocalDependencyState(cwd, pkg = PACKAGE_NAME) {
9053
9068
  async function confirmWorkspaceRoot(pm) {
9054
9069
  if (!(process.stdin.isTTY && process.stdout.isTTY)) return false;
9055
9070
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
9056
- return new Promise((resolve20) => {
9071
+ return new Promise((resolve21) => {
9057
9072
  rl.question(chalk7.yellow(`Update the ${pm} workspace root with -w? [y/N]: `), (ans) => {
9058
9073
  rl.close();
9059
9074
  const t = ans.trim().toLowerCase();
9060
- resolve20(t === "y" || t === "yes");
9075
+ resolve21(t === "y" || t === "yes");
9061
9076
  });
9062
9077
  });
9063
9078
  }
@@ -9424,14 +9439,14 @@ function promptPlanSelection(response) {
9424
9439
  const defaultIdx = plans.findIndex((p) => p.tier === response.recommended);
9425
9440
  const def = defaultIdx >= 0 ? defaultIdx + 1 : 1;
9426
9441
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
9427
- return new Promise((resolve20) => {
9442
+ return new Promise((resolve21) => {
9428
9443
  rl.question(`Plan [1-${plans.length}, default ${def}, q to cancel]: `, (ans) => {
9429
9444
  rl.close();
9430
9445
  const t = ans.trim().toLowerCase();
9431
- if (t === "q" || t === "quit") return resolve20(null);
9446
+ if (t === "q" || t === "quit") return resolve21(null);
9432
9447
  const n = t === "" ? def : Number.parseInt(t, 10);
9433
- if (!Number.isInteger(n) || n < 1 || n > plans.length) return resolve20(null);
9434
- resolve20(plans[n - 1].tier);
9448
+ if (!Number.isInteger(n) || n < 1 || n > plans.length) return resolve21(null);
9449
+ resolve21(plans[n - 1].tier);
9435
9450
  });
9436
9451
  });
9437
9452
  }
@@ -10265,7 +10280,7 @@ function openUrl(url) {
10265
10280
  }
10266
10281
 
10267
10282
  // src/reporting/commands/login.ts
10268
- var delay = (ms) => new Promise((resolve20) => setTimeout(resolve20, ms));
10283
+ var delay = (ms) => new Promise((resolve21) => setTimeout(resolve21, ms));
10269
10284
  function isInside(dir, file) {
10270
10285
  const rel = path37.relative(dir, file);
10271
10286
  return !!rel && !rel.startsWith("..") && !path37.isAbsolute(rel);