@vibgrate/cli 2026.709.1 → 2026.710.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/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { resolveDsn, resolveIngestHost, dashHostForIngestHost, resolveCliInvocation, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, inventory, uploadScanArtifact, ingestHostForRegionId, dsnCommand, pushCommand, CliError, ExitCode, NPX_INVOCATION, refreshIfStale, driftCount, embeddingsCached, resolveEmbedModel, loadEmbedder, getNodeEmbeddings, queryGraphSemantic, queryGraph, unavailableMessage, recordCliCall, CLI_TOOL_ALIASES, countPending, resolveOne, indexFor, countTokens, shortestPath, renderReport, impactOf, testsToRun, detectRunner, defaultGraphPath, serveStdio, ASSISTANTS, usageError, loadGraph, detectServeLaunch, installAssistant, writeNavigationConfig, uninstallAssistant, coveringTests, FREE_PACK, readScanArtifact, enrichOnline, ECOSYSTEMS, discoverModels, readSavings, readUsage, exportGraph, catalogPath, libDir, stableStringify, buildGraph, writeArtifacts, writeSnapshot, UsageError, ResourceLimitError, epistemicBreakdown, cacheDir, probeFreshness, discover, vibgrateDir, modelCacheInfo, clearModelCache, GraphSource, createServer, assistantById, serializeGraph, resolveLimits, loadCatalog, driftFor, addLibrary, parseDsn as parseDsn$1, publishPrivateLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface, assessDocQuality, symbolsFromApi, fetchHostedDocs, selectForBudget, formatForExt, verifyDeterminism, renderHtml, isModelReady } from './chunk-MPKMAERO.js';
2
+ import { resolveDsn, resolveIngestHost, dashHostForIngestHost, resolveCliInvocation, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, inventory, uploadScanArtifact, ingestHostForRegionId, dsnCommand, pushCommand, CliError, ExitCode, NPX_INVOCATION, refreshIfStale, driftCount, embeddingsCached, resolveEmbedModel, loadEmbedder, getNodeEmbeddings, queryGraphSemantic, queryGraph, unavailableMessage, recordCliCall, CLI_TOOL_ALIASES, countPending, resolveOne, indexFor, countTokens, shortestPath, renderReport, impactOf, testsToRun, detectRunner, defaultGraphPath, serveStdio, ASSISTANTS, usageError, loadGraph, detectServeLaunch, installAssistant, writeNavigationConfig, uninstallAssistant, coveringTests, FREE_PACK, readScanArtifact, enrichOnline, ECOSYSTEMS, discoverModels, readSavings, readUsage, exportGraph, catalogPath, libDir, stableStringify, buildGraph, writeArtifacts, writeSnapshot, UsageError, ResourceLimitError, epistemicBreakdown, cacheDir, probeFreshness, discover, vibgrateDir, modelCacheInfo, clearModelCache, GraphSource, createServer, assistantById, serializeGraph, resolveLimits, loadCatalog, driftFor, addLibrary, parseDsn as parseDsn$1, publishPrivateLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface, assessDocQuality, symbolsFromApi, fetchHostedDocs, selectForBudget, formatForExt, verifyDeterminism, renderHtml, isModelReady } from './chunk-NOHVVB7K.js';
3
3
  import { resolvedGrammarFiles, grammarSetVersion, canonicalize } from './chunk-X5YT263H.js';
4
- import { loadAdvancedScanHook, baselineCommand } from './chunk-IRZCYPFC.js';
5
- import { ensureDir, pathExists, writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, readJsonFile, writeTextFile, prepareCompressedUpload, computeDriftScore, titleBox, projectTypeToVulnEcosystem, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, brandProgressBar, resolveHead, workingTreeDirty } from './chunk-PXZ5KPVN.js';
4
+ import { loadAdvancedScanHook, baselineCommand } from './chunk-OGRPKYRW.js';
5
+ import { ensureDir, pathExists, writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, readJsonFile, writeTextFile, prepareCompressedUpload, computeDriftScore, titleBox, projectTypeToVulnEcosystem, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, brandProgressBar, resolveHead, workingTreeDirty } from './chunk-ZNCJZVNT.js';
6
6
  import './chunk-RXP66R2E.js';
7
7
  import { pathExists as pathExists$1, parseExcludePatterns } from './chunk-GI6W53LM.js';
8
8
  import * as fs6 from 'fs';
@@ -1480,12 +1480,7 @@ function registerServe(program) {
1480
1480
  dedup: opts.dedup === true,
1481
1481
  refresh
1482
1482
  };
1483
- if (!fs6.existsSync(graphPath)) {
1484
- throw new CliError(
1485
- `no map found at ${graphPath} \u2014 run \`vg\` to build one first`,
1486
- ExitCode.NOT_FOUND
1487
- );
1488
- }
1483
+ await ensureServableGraph(root, graphPath, global, refresh);
1489
1484
  if (opts.shareStats === true && local) {
1490
1485
  info(c.dim("vg \xB7 --share-stats ignored under --local (air-gapped): recording locally, not uploading."));
1491
1486
  }
@@ -1500,6 +1495,32 @@ function registerServe(program) {
1500
1495
  });
1501
1496
  applyGlobalOptions(cmd);
1502
1497
  }
1498
+ async function ensureServableGraph(root, graphPath, global, refresh, opts = {}) {
1499
+ if (refresh) {
1500
+ if (!fs6.existsSync(graphPath)) {
1501
+ info(c.dim("vg \xB7 no map found \u2014 building it before serving\u2026"));
1502
+ await runBuild(
1503
+ [],
1504
+ { html: false, report: false, jobs: opts.inline ? "1" : void 0 },
1505
+ { ...global, json: false }
1506
+ );
1507
+ } else {
1508
+ const refreshed = await refreshIfStale(root, { inline: opts.inline });
1509
+ if (refreshed.status === "refreshed") {
1510
+ const n = driftCount(refreshed.drift);
1511
+ info(c.dim(`vg \xB7 map refreshed before serving \u2014 ${n} file(s) drifted (${(refreshed.ms / 1e3).toFixed(2)}s)`));
1512
+ } else if (refreshed.status === "error") {
1513
+ info(c.yellow(`vg \xB7 map refresh failed (${refreshed.message}) \u2014 serving the last built map`));
1514
+ }
1515
+ }
1516
+ }
1517
+ if (!fs6.existsSync(graphPath)) {
1518
+ throw new CliError(
1519
+ `no map found at ${graphPath} \u2014 run \`vg\` to build one first`,
1520
+ ExitCode.NOT_FOUND
1521
+ );
1522
+ }
1523
+ }
1503
1524
  function startSharing(root) {
1504
1525
  const sharer = new StatsSharer(root);
1505
1526
  info(
@@ -2653,7 +2674,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
2653
2674
  console.log(chalk8.green("\u2714") + ` Created ${chalk8.bold("vibgrate.config.ts")}`);
2654
2675
  }
2655
2676
  if (opts.baseline) {
2656
- const { runBaseline } = await import('./baseline-7AFTGG3I.js');
2677
+ const { runBaseline } = await import('./baseline-EONSXRN7.js');
2657
2678
  await runBaseline(rootDir);
2658
2679
  }
2659
2680
  console.log("");
@@ -5386,7 +5407,7 @@ function buildProgram() {
5386
5407
  const cli = resolveCliInvocation();
5387
5408
  const aliasNote = cli === "vg" ? "The `vibgrate` command is an alias for `vg`.\n" : cli === NPX_INVOCATION ? "Install globally (`npm i -g @vibgrate/cli`) to use the shorter `vg` command.\n" : "";
5388
5409
  return `
5389
- Run \`${cli}\` to scan + map the current folder, \`${cli} "<question>"\` to ask, \`${cli} status\`/\`${cli} verify\` for state.
5410
+ Run \`${cli}\` to scan + map the current folder, \`${cli} "<question>"\` to ask, \`${cli} status\` for state, \`${cli} build --verify\` to re-verify the map.
5390
5411
  Drift: \`${cli} scan\` / \`${cli} report\`. Wire into your AI agent: \`${cli} install\`.
5391
5412
  ${aliasNote}Docs: https://vibgrate.com/help`;
5392
5413
  });