@vibgrate/cli 2026.703.3 → 2026.703.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/baseline-AQKQEA2O.js +6 -0
- package/dist/{baseline-ZBXJONQ6.js.map → baseline-AQKQEA2O.js.map} +1 -1
- package/dist/{chunk-FPUNJNXD.js → chunk-6T3R7RF2.js} +3 -3
- package/dist/{chunk-FPUNJNXD.js.map → chunk-6T3R7RF2.js.map} +1 -1
- package/dist/{chunk-2PJRXVUW.js → chunk-L7YBNIBF.js} +4 -4
- package/dist/chunk-L7YBNIBF.js.map +1 -0
- package/dist/{chunk-J4DFLN2Q.js → chunk-W2QP2YH6.js} +3 -3
- package/dist/{chunk-J4DFLN2Q.js.map → chunk-W2QP2YH6.js.map} +1 -1
- package/dist/cli.js +14 -9
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/baseline-ZBXJONQ6.js +0 -6
- package/dist/chunk-2PJRXVUW.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { resolveDsn, resolveIngestHost, dashHostForIngestHost, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, inventory, uploadScanArtifact, dsnCommand, pushCommand, ExitCode, CliError, verifyDeterminism, refreshIfStale, driftCount, embeddingsCached, resolveEmbedModel, loadEmbedder, getNodeEmbeddings, queryGraphSemantic, queryGraph, unavailableMessage, countPending, resolveOne, GraphIndex, shortestPath, renderReport, impactOf, testsToRun, detectRunner, defaultGraphPath, serveStdio, ASSISTANTS, usageError, loadGraph, detectServeLaunch, installAssistant, uninstallAssistant, buildGraph, serializeGraph, coveringTests, FREE_PACK, readScanArtifact, enrichOnline, ECOSYSTEMS, discoverModels, readSavings, exportGraph, catalogPath, libDir, stableStringify, writeArtifacts, writeSnapshot, UsageError, cacheDir, probeFreshness, discover, vibgrateDir, modelCacheInfo, clearModelCache, GraphSource, createServer, assistantById, loadCatalog, driftFor, addLibrary, parseDsn as parseDsn$1, publishPrivateLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface, assessDocQuality, symbolsFromApi, fetchHostedDocs, selectForBudget, formatForExt, renderHtml, isModelReady } from './chunk-
|
|
2
|
+
import { resolveDsn, resolveIngestHost, dashHostForIngestHost, availableRegionIds, createWorkspaceDsn, writeStoredCredentials, credentialsPath, findGitRoot, ensureGitignored, gitignoreEntryForCredentials, clearStoredCredentials, inventory, uploadScanArtifact, dsnCommand, pushCommand, ExitCode, CliError, verifyDeterminism, refreshIfStale, driftCount, embeddingsCached, resolveEmbedModel, loadEmbedder, getNodeEmbeddings, queryGraphSemantic, queryGraph, unavailableMessage, countPending, resolveOne, GraphIndex, shortestPath, renderReport, impactOf, testsToRun, detectRunner, defaultGraphPath, serveStdio, ASSISTANTS, usageError, loadGraph, detectServeLaunch, installAssistant, uninstallAssistant, buildGraph, serializeGraph, coveringTests, FREE_PACK, readScanArtifact, enrichOnline, ECOSYSTEMS, discoverModels, readSavings, exportGraph, catalogPath, libDir, stableStringify, writeArtifacts, writeSnapshot, UsageError, cacheDir, probeFreshness, discover, vibgrateDir, modelCacheInfo, clearModelCache, GraphSource, createServer, assistantById, loadCatalog, driftFor, addLibrary, parseDsn as parseDsn$1, publishPrivateLibrary, resolveLib, libId, resolveVersion, readDoc, localPackageDocs, localApiSurface, assessDocQuality, symbolsFromApi, fetchHostedDocs, selectForBudget, formatForExt, renderHtml, isModelReady } from './chunk-W2QP2YH6.js';
|
|
3
3
|
import { resolvedGrammarFiles, grammarSetVersion } from './chunk-X5YT263H.js';
|
|
4
|
-
import { loadAdvancedScanHook, baselineCommand } from './chunk-
|
|
5
|
-
import { ensureDir, pathExists, writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, readJsonFile, writeTextFile, prepareCompressedUpload, titleBox, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, brandProgressBar } from './chunk-
|
|
4
|
+
import { loadAdvancedScanHook, baselineCommand } from './chunk-6T3R7RF2.js';
|
|
5
|
+
import { ensureDir, pathExists, writeDefaultConfig, parseDsn, detectVcs, computeRepoFingerprint, resolveRepositoryName, fetchScanPreflight, runCoreScan, VERSION, readJsonFile, writeTextFile, prepareCompressedUpload, titleBox, driftBar, gitHistoryAvailable, buildVersionTimelines, findPackageAnyEcosystem, normalizeConstraint, findVersionCrossings, versionSatisfies, brandProgressBar } from './chunk-L7YBNIBF.js';
|
|
6
6
|
import './chunk-RXP66R2E.js';
|
|
7
7
|
import { pathExists as pathExists$1, parseExcludePatterns } from './chunk-4M2MUQRO.js';
|
|
8
8
|
import * as fs4 from 'fs';
|
|
@@ -1882,7 +1882,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
|
|
|
1882
1882
|
console.log(chalk5.green("\u2714") + ` Created ${chalk5.bold("vibgrate.config.ts")}`);
|
|
1883
1883
|
}
|
|
1884
1884
|
if (opts.baseline) {
|
|
1885
|
-
const { runBaseline } = await import('./baseline-
|
|
1885
|
+
const { runBaseline } = await import('./baseline-AQKQEA2O.js');
|
|
1886
1886
|
await runBaseline(rootDir);
|
|
1887
1887
|
}
|
|
1888
1888
|
console.log("");
|
|
@@ -1941,6 +1941,9 @@ function printAiContextPrompt(detectedAssistant) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
|
|
1943
1943
|
// src/reporting/commands/scan.ts
|
|
1944
|
+
function shouldBuildCodeMap(opts) {
|
|
1945
|
+
return opts.graph !== false && !opts.maxPrivacy && !opts.noLocalArtifacts;
|
|
1946
|
+
}
|
|
1944
1947
|
async function autoPush(artifact, rootDir, opts) {
|
|
1945
1948
|
const dsn = resolveDsn(opts.dsn);
|
|
1946
1949
|
if (!dsn) {
|
|
@@ -2055,7 +2058,7 @@ var scanCommand = new Command("scan").description("Scan a project for upgrade dr
|
|
|
2055
2058
|
'Exclude paths matching a glob pattern. Repeatable, and a single value may list several patterns separated by commas or semicolons (e.g. --exclude "legacy/**,vendor/**"). Merged with excludes from the config file.',
|
|
2056
2059
|
collectExcludes,
|
|
2057
2060
|
[]
|
|
2058
|
-
).option("--concurrency <n>", "Max concurrent npm calls", "8").option("--push", "Auto-push results to Vibgrate API after scan").option("--dsn <dsn>", "DSN token for push (or use VIBGRATE_DSN env)").option("--region <region>", "Override data residency region for push (us, eu)").option("--strict", "Fail on push errors").option("--ui-purpose", "Enable optional UI purpose evidence extraction (slower)").option("--no-local-artifacts", "Do not write .vibgrate JSON artifacts to disk").option("--max-privacy", "Enable strongest privacy mode (minimal scanners, no local artifacts)").option("--offline", "Run without network calls; do not upload results").option("--full", "Comprehensive scan: turns on known-vulnerability detection (= --vulns) and, when a standards policy exists, a banned-dependency report \u2014 on top of drift scoring and the code map").option("--vulns", "Also scan installed dependencies for known vulnerabilities (OSV online, or advisories from --package-manifest when offline)").option("--package-manifest <file>", "Use local package-version manifest JSON/ZIP (for offline mode)").option("--project-scan-timeout <seconds>", "Per-project scan timeout in seconds (default: 180)").option("--drift-budget <score>", "Fail if drift score is above budget (0-100)").option("--drift-worsening <percent>", "Fail if drift worsens by more than % since baseline").option("--repository-name <name>", "Override the repository name recorded for this scan (defaults to the directory or package.json name)").option("--force", "Always create a fresh scan ingest, even if the repository is unchanged since the last scan (skips the unchanged/reuse optimization). Used by scheduled and dashboard-triggered scans.").option("--no-graph", "Skip building the local code map (the AI/docs index) that scan produces after scoring drift").action(async (targetPath, opts) => {
|
|
2061
|
+
).option("--concurrency <n>", "Max concurrent npm calls", "8").option("--push", "Auto-push results to Vibgrate API after scan").option("--dsn <dsn>", "DSN token for push (or use VIBGRATE_DSN env)").option("--region <region>", "Override data residency region for push (us, eu)").option("--strict", "Fail on push errors").option("--ui-purpose", "Enable optional UI purpose evidence extraction (slower)").option("--no-local-artifacts", "Do not write .vibgrate JSON artifacts to disk").option("--max-privacy", "Enable strongest privacy mode (minimal scanners, no local artifacts)").option("--offline", "Run without network calls; do not upload results").option("--full", "Comprehensive scan: turns on known-vulnerability detection (= --vulns) and, when a standards policy exists, a banned-dependency report \u2014 on top of drift scoring and the code map").option("--vulns", "Also scan installed dependencies for known vulnerabilities (OSV online, or advisories from --package-manifest when offline)").option("--package-manifest <file>", "Use local package-version manifest JSON/ZIP (for offline mode)").option("--project-scan-timeout <seconds>", "Per-project scan timeout in seconds (default: 180)").option("--drift-budget <score>", "Fail if drift score is above budget (0-100)").option("--drift-worsening <percent>", "Fail if drift worsens by more than % since baseline").option("--repository-name <name>", "Override the repository name recorded for this scan (defaults to the directory or package.json name)").option("--force", "Always create a fresh scan ingest, even if the repository is unchanged since the last scan (skips the unchanged/reuse optimization). Used by scheduled and dashboard-triggered scans.").option("--no-graph", "Skip building the local code map (the AI/docs index) that scan produces after scoring drift").option("--quiet", "Suppress promotional output (the free-plan tracking panel and the AI Context install prompt); scan results are unaffected").action(async (targetPath, opts) => {
|
|
2059
2062
|
const rootDir = path9.resolve(targetPath);
|
|
2060
2063
|
if (!await pathExists$1(rootDir)) {
|
|
2061
2064
|
console.error(chalk5.red(`Path does not exist: ${rootDir}`));
|
|
@@ -2063,6 +2066,7 @@ var scanCommand = new Command("scan").description("Scan a project for upgrade dr
|
|
|
2063
2066
|
}
|
|
2064
2067
|
const hasDsn = !!resolveDsn(opts.dsn);
|
|
2065
2068
|
const willPush = !opts.offline && (opts.push || hasDsn);
|
|
2069
|
+
const noLocalArtifacts = opts.localArtifacts === false;
|
|
2066
2070
|
const isFirstRun = !await pathExists$1(path9.join(rootDir, ".vibgrate", "scan_result.json"));
|
|
2067
2071
|
let pinnedRegion;
|
|
2068
2072
|
if (willPush && hasDsn) {
|
|
@@ -2157,7 +2161,7 @@ var scanCommand = new Command("scan").description("Scan a project for upgrade dr
|
|
|
2157
2161
|
region: opts.region ?? pinnedRegion,
|
|
2158
2162
|
strict: opts.strict,
|
|
2159
2163
|
uiPurpose: opts.uiPurpose,
|
|
2160
|
-
noLocalArtifacts
|
|
2164
|
+
noLocalArtifacts,
|
|
2161
2165
|
maxPrivacy: opts.maxPrivacy,
|
|
2162
2166
|
offline: opts.offline,
|
|
2163
2167
|
// `--full` is the comprehensive umbrella: it turns on vulnerability scanning.
|
|
@@ -2167,9 +2171,10 @@ var scanCommand = new Command("scan").description("Scan a project for upgrade dr
|
|
|
2167
2171
|
driftWorseningPercent: parseNonNegativeNumber(opts.driftWorsening, "--drift-worsening"),
|
|
2168
2172
|
projectScanTimeout: opts.projectScanTimeout ? parseInt(opts.projectScanTimeout, 10) || void 0 : void 0,
|
|
2169
2173
|
repositoryName: opts.repositoryName?.trim() || void 0,
|
|
2170
|
-
force: opts.force
|
|
2174
|
+
force: opts.force,
|
|
2175
|
+
quiet: opts.quiet
|
|
2171
2176
|
};
|
|
2172
|
-
const wantGraph = opts.graph
|
|
2177
|
+
const wantGraph = shouldBuildCodeMap({ graph: opts.graph, maxPrivacy: opts.maxPrivacy, noLocalArtifacts });
|
|
2173
2178
|
if (wantGraph) {
|
|
2174
2179
|
scanOpts.postScan = async (report) => {
|
|
2175
2180
|
const result = await buildGraph({
|
|
@@ -2229,7 +2234,7 @@ Failing fitness function: drift worsened by ${worseningPercent.toFixed(2)}% (thr
|
|
|
2229
2234
|
if (willPush) {
|
|
2230
2235
|
await autoPush(artifact, rootDir, scanOpts);
|
|
2231
2236
|
}
|
|
2232
|
-
const showAiPrompt = scanOpts.format === "text" && !hasDsn && !opts.offline && !
|
|
2237
|
+
const showAiPrompt = scanOpts.format === "text" && !opts.quiet && !hasDsn && !opts.offline && !noLocalArtifacts && !opts.maxPrivacy && isFirstRun;
|
|
2233
2238
|
if (showAiPrompt) {
|
|
2234
2239
|
const detectedAssistant = await detectAiAssistant(rootDir);
|
|
2235
2240
|
printAiContextPrompt(detectedAssistant);
|