@vibgrate/cli 2026.704.3 → 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.
@@ -1,4 +1,4 @@
1
- import { runCoreScan, writeJsonFile } from './chunk-YN5OGRWU.js';
1
+ import { runCoreScan, writeJsonFile } from './chunk-ICBBG6U3.js';
2
2
  import * as path from 'path';
3
3
  import { Command } from 'commander';
4
4
  import chalk from 'chalk';
@@ -27,5 +27,5 @@ var baselineCommand = new Command("baseline").description("Create a drift baseli
27
27
  });
28
28
 
29
29
  export { baselineCommand, loadAdvancedScanHook, runBaseline };
30
- //# sourceMappingURL=chunk-WHQRV66O.js.map
31
- //# sourceMappingURL=chunk-WHQRV66O.js.map
30
+ //# sourceMappingURL=chunk-GHLYQZWT.js.map
31
+ //# sourceMappingURL=chunk-GHLYQZWT.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/reporting/advanced-hook.ts","../src/reporting/commands/baseline.ts"],"names":[],"mappings":";;;;;;AAUA,eAAsB,oBAAA,GAA8D;AAClF,EAAA,OAAO,MAAA;AACT;;;ACLA,eAAsB,YAAY,OAAA,EAAgC;AAChE,EAAA,OAAA,CAAQ,GAAA,CAAI,KAAA,CAAM,GAAA,CAAI,sBAAsB,CAAC,CAAA;AAE7C,EAAA,MAAM,QAAA,GAAW,MAAM,oBAAA,EAAqB;AAC5C,EAAA,MAAM,QAAA,GAAW,MAAM,WAAA,CAAY,OAAA,EAAS;AAAA,IAC1C,MAAA,EAAQ,MAAA;AAAA,IACR,WAAA,EAAa;AAAA,KACZ,QAAQ,CAAA;AAEX,EAAA,MAAM,YAAA,GAAoB,IAAA,CAAA,IAAA,CAAK,OAAA,EAAS,WAAA,EAAa,eAAe,CAAA;AACpE,EAAA,MAAM,aAAA,CAAc,cAAc,QAAQ,CAAA;AAC1C,EAAA,OAAA,CAAQ,GAAA,CAAI,KAAA,CAAM,KAAA,CAAM,QAAG,CAAA,GAAI,sBAAsB,KAAA,CAAM,IAAA,CAAK,yBAAyB,CAAC,CAAA,CAAE,CAAA;AAC5F,EAAA,OAAA,CAAQ,GAAA,CAAI,MAAM,GAAA,CAAI,CAAA,kBAAA,EAAqB,SAAS,KAAA,CAAM,KAAK,MAAM,CAAC,CAAA;AACxE;AAEO,IAAM,eAAA,GAAkB,IAAI,OAAA,CAAQ,UAAU,EAClD,WAAA,CAAY,kCAAkC,CAAA,CAC9C,QAAA,CAAS,UAAU,kBAAA,EAAoB,GAAG,CAAA,CAC1C,MAAA,CAAO,OAAO,UAAA,KAAuB;AACpC,EAAA,MAAM,OAAA,GAAe,aAAQ,UAAU,CAAA;AACvC,EAAA,MAAM,YAAY,OAAO,CAAA;AAC3B,CAAC","file":"chunk-WHQRV66O.js","sourcesContent":["import type { AdvancedScanHook } from '../core-open/index.js';\n\n/**\n * Open build: there is no proprietary advanced-analysis hook.\n *\n * In the public, Apache-2.0 distribution every reporting command runs purely on\n * the open base engine (`runCoreScan` from `@vibgrate/core-open`). This shim\n * keeps the call sites in `scan`/`baseline` unchanged while always resolving to\n * `undefined`, so the scan falls back to the open base engine.\n */\nexport async function loadAdvancedScanHook(): Promise<AdvancedScanHook | undefined> {\n return undefined;\n}\n","import * as path from 'node:path';\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { runCoreScan } from '../../core-open/index.js';\nimport { writeJsonFile } from '../utils/fs.js';\nimport { loadAdvancedScanHook } from '../advanced-hook.js';\n\nexport async function runBaseline(rootDir: string): Promise<void> {\n console.log(chalk.dim('Creating baseline...'));\n\n const advanced = await loadAdvancedScanHook();\n const artifact = await runCoreScan(rootDir, {\n format: 'text',\n concurrency: 8,\n }, advanced);\n\n const baselinePath = path.join(rootDir, '.vibgrate', 'baseline.json');\n await writeJsonFile(baselinePath, artifact);\n console.log(chalk.green('✔') + ` Baseline saved to ${chalk.bold('.vibgrate/baseline.json')}`);\n console.log(chalk.dim(` Baseline score: ${artifact.drift.score}/100`));\n}\n\nexport const baselineCommand = new Command('baseline')\n .description('Create a drift baseline snapshot')\n .argument('[path]', 'Path to baseline', '.')\n .action(async (targetPath: string) => {\n const rootDir = path.resolve(targetPath);\n await runBaseline(rootDir);\n });\n"]}
1
+ {"version":3,"sources":["../src/reporting/advanced-hook.ts","../src/reporting/commands/baseline.ts"],"names":[],"mappings":";;;;;;AAUA,eAAsB,oBAAA,GAA8D;AAClF,EAAA,OAAO,MAAA;AACT;;;ACLA,eAAsB,YAAY,OAAA,EAAgC;AAChE,EAAA,OAAA,CAAQ,GAAA,CAAI,KAAA,CAAM,GAAA,CAAI,sBAAsB,CAAC,CAAA;AAE7C,EAAA,MAAM,QAAA,GAAW,MAAM,oBAAA,EAAqB;AAC5C,EAAA,MAAM,QAAA,GAAW,MAAM,WAAA,CAAY,OAAA,EAAS;AAAA,IAC1C,MAAA,EAAQ,MAAA;AAAA,IACR,WAAA,EAAa;AAAA,KACZ,QAAQ,CAAA;AAEX,EAAA,MAAM,YAAA,GAAoB,IAAA,CAAA,IAAA,CAAK,OAAA,EAAS,WAAA,EAAa,eAAe,CAAA;AACpE,EAAA,MAAM,aAAA,CAAc,cAAc,QAAQ,CAAA;AAC1C,EAAA,OAAA,CAAQ,GAAA,CAAI,KAAA,CAAM,KAAA,CAAM,QAAG,CAAA,GAAI,sBAAsB,KAAA,CAAM,IAAA,CAAK,yBAAyB,CAAC,CAAA,CAAE,CAAA;AAC5F,EAAA,OAAA,CAAQ,GAAA,CAAI,MAAM,GAAA,CAAI,CAAA,kBAAA,EAAqB,SAAS,KAAA,CAAM,KAAK,MAAM,CAAC,CAAA;AACxE;AAEO,IAAM,eAAA,GAAkB,IAAI,OAAA,CAAQ,UAAU,EAClD,WAAA,CAAY,kCAAkC,CAAA,CAC9C,QAAA,CAAS,UAAU,kBAAA,EAAoB,GAAG,CAAA,CAC1C,MAAA,CAAO,OAAO,UAAA,KAAuB;AACpC,EAAA,MAAM,OAAA,GAAe,aAAQ,UAAU,CAAA;AACvC,EAAA,MAAM,YAAY,OAAO,CAAA;AAC3B,CAAC","file":"chunk-GHLYQZWT.js","sourcesContent":["import type { AdvancedScanHook } from '../core-open/index.js';\n\n/**\n * Open build: there is no proprietary advanced-analysis hook.\n *\n * In the public, Apache-2.0 distribution every reporting command runs purely on\n * the open base engine (`runCoreScan` from `@vibgrate/core-open`). This shim\n * keeps the call sites in `scan`/`baseline` unchanged while always resolving to\n * `undefined`, so the scan falls back to the open base engine.\n */\nexport async function loadAdvancedScanHook(): Promise<AdvancedScanHook | undefined> {\n return undefined;\n}\n","import * as path from 'node:path';\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { runCoreScan } from '../../core-open/index.js';\nimport { writeJsonFile } from '../utils/fs.js';\nimport { loadAdvancedScanHook } from '../advanced-hook.js';\n\nexport async function runBaseline(rootDir: string): Promise<void> {\n console.log(chalk.dim('Creating baseline...'));\n\n const advanced = await loadAdvancedScanHook();\n const artifact = await runCoreScan(rootDir, {\n format: 'text',\n concurrency: 8,\n }, advanced);\n\n const baselinePath = path.join(rootDir, '.vibgrate', 'baseline.json');\n await writeJsonFile(baselinePath, artifact);\n console.log(chalk.green('✔') + ` Baseline saved to ${chalk.bold('.vibgrate/baseline.json')}`);\n console.log(chalk.dim(` Baseline score: ${artifact.drift.score}/100`));\n}\n\nexport const baselineCommand = new Command('baseline')\n .description('Create a drift baseline snapshot')\n .argument('[path]', 'Path to baseline', '.')\n .action(async (targetPath: string) => {\n const rootDir = path.resolve(targetPath);\n await runBaseline(rootDir);\n });\n"]}
@@ -20,7 +20,7 @@ import * as zlib from 'zlib';
20
20
  import { promisify } from 'util';
21
21
 
22
22
  // src/version.ts
23
- var VERSION = "2026.704.3";
23
+ var VERSION = "2026.708.2";
24
24
  var TOP_LEVEL_NODE_MODULES = /^node_modules\/((?:@[^/]+\/)?[^/]+)$/;
25
25
  function parsePackageLock(json) {
26
26
  const out = /* @__PURE__ */ new Map();
@@ -6932,12 +6932,16 @@ var ANSI_SGR = /\[[0-9;]*m/g;
6932
6932
  function visibleLength(s) {
6933
6933
  return s.replace(ANSI_SGR, "").length;
6934
6934
  }
6935
- function panelBox(title, body, color = chalk3.cyan, width = BOX_WIDTH) {
6935
+ function panelBox(title, body, color = chalk3.cyan, minWidth = BOX_WIDTH) {
6936
6936
  const out = [];
6937
+ const indent = 1;
6937
6938
  const titleSegment = ` ${title} `;
6939
+ const width = body.reduce(
6940
+ (w, line) => Math.max(w, visibleLength(line) + indent),
6941
+ Math.max(minWidth, titleSegment.length + 2)
6942
+ );
6938
6943
  const dashes = Math.max(width - 1 - titleSegment.length, 0);
6939
6944
  out.push(color("\u256D\u2500") + chalk3.bold.white(titleSegment) + color("\u2500".repeat(dashes) + "\u256E"));
6940
- const indent = 1;
6941
6945
  for (const line of body) {
6942
6946
  const pad = Math.max(width - indent - visibleLength(line), 0);
6943
6947
  out.push(color("\u2502") + " ".repeat(indent) + line + " ".repeat(pad) + color("\u2502"));
@@ -7031,9 +7035,9 @@ function formatText(artifact, opts = {}) {
7031
7035
  lines.push("");
7032
7036
  }
7033
7037
  const scoreColor = artifact.drift.score <= 30 ? chalk3.green : artifact.drift.score <= 60 ? chalk3.yellow : chalk3.red;
7034
- lines.push(...titleBox("Drift Score Summary"));
7038
+ lines.push(...titleBox("DriftScore Summary"));
7035
7039
  lines.push("");
7036
- lines.push(chalk3.bold(" Drift Score: ") + scoreColor.bold(`${artifact.drift.score}/100`));
7040
+ lines.push(chalk3.bold(" DriftScore: ") + scoreColor.bold(`${artifact.drift.score}/100`));
7037
7041
  lines.push(chalk3.bold(" Risk Level: ") + riskBadge(artifact.drift.riskLevel));
7038
7042
  lines.push(chalk3.bold(" Projects: ") + `${artifact.projects.length}`);
7039
7043
  const billing = artifact.billing;
@@ -7094,7 +7098,11 @@ function formatText(artifact, opts = {}) {
7094
7098
  lines.push(chalk3.dim(` ${scannedParts.join(" \xB7 ")}`));
7095
7099
  lines.push("");
7096
7100
  if (opts.free && artifact.billing) {
7097
- lines.push(...renderUpsellPanel(artifact.billing, opts.invocation ?? "vg"));
7101
+ lines.push(...renderUpsellPanel(artifact.billing, {
7102
+ authenticated: opts.authenticated === true,
7103
+ invocation: opts.invocation ?? "vg",
7104
+ upgradeUrl: opts.upgradeUrl ?? "https://dash.vibgrate.com"
7105
+ }));
7098
7106
  lines.push("");
7099
7107
  }
7100
7108
  return lines.join("\n");
@@ -7118,27 +7126,44 @@ function estimateMonthly(billableProjects, rates) {
7118
7126
  function formatMoney(value) {
7119
7127
  return value === Math.floor(value) ? `$${value}` : `$${value.toFixed(2)}`;
7120
7128
  }
7121
- function renderUpsellPanel(billing, invocation) {
7129
+ function renderUpsellPanel(billing, opts) {
7122
7130
  const raw = billing.billableProjectsRaw;
7123
7131
  const team = estimateMonthly(raw, PRICE_RATES.team);
7124
7132
  const business = estimateMonthly(raw, PRICE_RATES.business);
7125
7133
  const rawLabel = formatBillable(raw);
7126
- const body = [
7134
+ const intro = opts.authenticated ? [
7135
+ `You're on Vibgrate Free \u2014 your scans are tracked on`,
7136
+ `Vibgrate Cloud, capped at the free plan's limits.`
7137
+ ] : [
7127
7138
  `You're on Vibgrate Free \u2014 this scan ran locally and`,
7128
- `isn't tracked over time.`,
7139
+ `isn't tracked over time.`
7140
+ ];
7141
+ const costLead = opts.authenticated ? `On Team or Business, this repo would cost:` : `Tracked monthly on Vibgrate Cloud, this repo would cost:`;
7142
+ const addsLead = opts.authenticated ? `Upgrading adds:` : `Vibgrate Cloud adds:`;
7143
+ const adds = opts.authenticated ? [
7144
+ ` ${chalk3.cyan("\u2022")} More repositories and pushed scans`,
7145
+ ` ${chalk3.cyan("\u2022")} Scheduled scans that run automatically \u2014 no CI wiring`,
7146
+ ` ${chalk3.cyan("\u2022")} Alerts when drift crosses the budget you set`
7147
+ ] : [
7148
+ ` ${chalk3.cyan("\u2022")} DriftScore tracked over time \u2014 trends, not snapshots`,
7149
+ ` ${chalk3.cyan("\u2022")} Scheduled scans that run automatically \u2014 no CI wiring`,
7150
+ ` ${chalk3.cyan("\u2022")} Alerts when drift crosses the budget you set`
7151
+ ];
7152
+ const capacityLine = opts.authenticated ? `Free plan: 1 repository, 5 pushed scans / month.` : `Free forever: 1 repository, 5 pushed scans / month.`;
7153
+ const cta = opts.authenticated ? `${chalk3.bold("More on Team or Business:")} ${chalk3.cyan(opts.upgradeUrl)}` : `${chalk3.bold("Start tracking:")} ${chalk3.cyan(`${opts.invocation} login`)} \u2192 ${chalk3.cyan(`${opts.invocation} push`)}`;
7154
+ const body = [
7155
+ ...intro,
7129
7156
  ``,
7130
- chalk3.bold(`Tracked monthly on Vibgrate Cloud, this repo would cost:`),
7157
+ chalk3.bold(costLead),
7131
7158
  ` ${chalk3.bold("Team")} ${chalk3.bold.white(formatMoney(team))} / mo`,
7132
7159
  ` ${chalk3.bold("Business")} ${chalk3.bold.white(formatMoney(business))} / mo`,
7133
7160
  chalk3.dim(` (${rawLabel} billable project${raw === 1 ? "" : "s"}, banded per-project pricing)`),
7134
7161
  ``,
7135
- chalk3.bold(`Vibgrate Cloud adds:`),
7136
- ` ${chalk3.cyan("\u2022")} DriftScore tracked over time \u2014 trends, not snapshots`,
7137
- ` ${chalk3.cyan("\u2022")} Scheduled scans that run automatically \u2014 no CI wiring`,
7138
- ` ${chalk3.cyan("\u2022")} Alerts when drift crosses the budget you set`,
7162
+ chalk3.bold(addsLead),
7163
+ ...adds,
7139
7164
  ``,
7140
- chalk3.dim(`Free forever: 1 repository, 5 pushed scans / month.`),
7141
- `${chalk3.bold("Start tracking:")} ${chalk3.cyan(`${invocation} login`)} \u2192 ${chalk3.cyan(`${invocation} push`)}`
7165
+ chalk3.dim(capacityLine),
7166
+ cta
7142
7167
  ];
7143
7168
  return panelBox("KEEP TRACKING YOUR DRIFTSCORE", body, chalk3.hex("#3FB0A4"), 60);
7144
7169
  }
@@ -7703,7 +7728,7 @@ function formatMarkdown(artifact) {
7703
7728
  lines.push("");
7704
7729
  lines.push(`| Metric | Value |`);
7705
7730
  lines.push(`|--------|-------|`);
7706
- lines.push(`| **Drift Score** | ${artifact.drift.score}/100 |`);
7731
+ lines.push(`| **DriftScore** | ${artifact.drift.score}/100 |`);
7707
7732
  lines.push(`| **Risk Level** | ${artifact.drift.riskLevel.toUpperCase()} |`);
7708
7733
  lines.push(`| **Projects** | ${artifact.projects.length} |`);
7709
7734
  if (billing) {
@@ -8202,7 +8227,7 @@ var ROBOT = [
8202
8227
  function getBrand(version) {
8203
8228
  return [
8204
8229
  chalk3.bold.white(" V I B G R A T E"),
8205
- chalk3.dim(` Drift Intelligence Engine`) + chalk3.dim(` v${version}`)
8230
+ chalk3.dim(` Code Intelligence Engine`) + chalk3.dim(` v${version}`)
8206
8231
  ];
8207
8232
  }
8208
8233
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -10662,7 +10687,15 @@ async function runCoreScan(rootDir, opts, advanced) {
10662
10687
  await writeTextFile(path29.resolve(opts.out), markdown);
10663
10688
  }
10664
10689
  } else {
10665
- const text = formatText(artifact, { free: !parsedDsn && !opts.quiet, invocation: opts.invocation });
10690
+ const authenticated = opts.authenticated ?? !!parsedDsn;
10691
+ const freePlan = opts.planTier === "free";
10692
+ const showUpsell = !opts.quiet && (!authenticated || freePlan);
10693
+ const text = formatText(artifact, {
10694
+ free: showUpsell,
10695
+ authenticated,
10696
+ invocation: opts.invocation,
10697
+ upgradeUrl: opts.upgradeUrl
10698
+ });
10666
10699
  console.log(text);
10667
10700
  if (opts.out) {
10668
10701
  await writeTextFile(path29.resolve(opts.out), text);
@@ -11384,6 +11417,6 @@ async function writeTextFile2(filePath, content) {
11384
11417
  await fs2.writeFile(filePath, content, "utf8");
11385
11418
  }
11386
11419
 
11387
- export { VERSION, brandProgressBar, buildVersionTimelines, computeRepoFingerprint, computeUpgradeImpact, detectVcs, driftBar, ensureDir2 as ensureDir, fetchScanPreflight, findPackageAnyEcosystem, findPackageTimeline, findVersionCrossings, getChangelogSignals, gitHistoryAvailable, normalizeConstraint, parseDsn, pathExists2 as pathExists, prepareCompressedUpload, projectTypeToVulnEcosystem, readJsonFile2 as readJsonFile, resolveRepositoryName, runCoreScan, severityRank, titleBox, versionSatisfies, writeDefaultConfig, writeJsonFile2 as writeJsonFile, writeTextFile2 as writeTextFile };
11388
- //# sourceMappingURL=chunk-YN5OGRWU.js.map
11389
- //# sourceMappingURL=chunk-YN5OGRWU.js.map
11420
+ export { VERSION, brandProgressBar, buildVersionTimelines, computeDriftScore, computeRepoFingerprint, computeUpgradeImpact, detectVcs, driftBar, ensureDir2 as ensureDir, fetchScanPreflight, findPackageAnyEcosystem, findPackageTimeline, findVersionCrossings, getChangelogSignals, gitHistoryAvailable, normalizeConstraint, parseDsn, pathExists2 as pathExists, prepareCompressedUpload, projectTypeToVulnEcosystem, readJsonFile2 as readJsonFile, resolveHead, resolveRepositoryName, runCoreScan, severityRank, titleBox, versionSatisfies, workingTreeDirty, writeDefaultConfig, writeJsonFile2 as writeJsonFile, writeTextFile2 as writeTextFile };
11421
+ //# sourceMappingURL=chunk-ICBBG6U3.js.map
11422
+ //# sourceMappingURL=chunk-ICBBG6U3.js.map