@vibgrate/cli 2026.710.1 → 2026.711.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.
- package/DOCS.md +23 -10
- package/README.md +14 -10
- package/dist/baseline-SRVG4ZAD.js +6 -0
- package/dist/{baseline-EONSXRN7.js.map → baseline-SRVG4ZAD.js.map} +1 -1
- package/dist/{chunk-OGRPKYRW.js → chunk-4IHO6VUL.js} +3 -3
- package/dist/{chunk-OGRPKYRW.js.map → chunk-4IHO6VUL.js.map} +1 -1
- package/dist/{chunk-NOHVVB7K.js → chunk-75ZJYYJE.js} +69 -8
- package/dist/chunk-75ZJYYJE.js.map +1 -0
- package/dist/{chunk-ZNCJZVNT.js → chunk-NNU2PW2H.js} +74 -24
- package/dist/chunk-NNU2PW2H.js.map +1 -0
- package/dist/cli.js +321 -10
- 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/skills/README.md +2 -2
- package/dist/baseline-EONSXRN7.js +0 -6
- package/dist/chunk-NOHVVB7K.js.map +0 -1
- package/dist/chunk-ZNCJZVNT.js.map +0 -1
|
@@ -13,14 +13,13 @@ import { readFile, mkdir, writeFile, mkdtemp, rm } from 'fs/promises';
|
|
|
13
13
|
import { XMLParser } from 'fast-xml-parser';
|
|
14
14
|
import { parse as parse$1 } from 'smol-toml';
|
|
15
15
|
import * as crypto from 'crypto';
|
|
16
|
-
import ts from 'typescript';
|
|
17
16
|
import * as fs5 from 'fs';
|
|
18
17
|
import { mkdirSync, writeFileSync } from 'fs';
|
|
19
18
|
import * as zlib from 'zlib';
|
|
20
19
|
import { promisify } from 'util';
|
|
21
20
|
|
|
22
21
|
// src/version.ts
|
|
23
|
-
var VERSION = "2026.
|
|
22
|
+
var VERSION = "2026.711.2";
|
|
24
23
|
var TOP_LEVEL_NODE_MODULES = /^node_modules\/((?:@[^/]+\/)?[^/]+)$/;
|
|
25
24
|
function parsePackageLock(json) {
|
|
26
25
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -1055,14 +1054,14 @@ function rank(v) {
|
|
|
1055
1054
|
}
|
|
1056
1055
|
function isReleased(cycle, now) {
|
|
1057
1056
|
if (typeof cycle.releaseDate !== "string") return true;
|
|
1058
|
-
const
|
|
1059
|
-
return Number.isNaN(
|
|
1057
|
+
const ts = Date.parse(cycle.releaseDate);
|
|
1058
|
+
return Number.isNaN(ts) ? true : ts <= now;
|
|
1060
1059
|
}
|
|
1061
1060
|
function isLts(cycle, now) {
|
|
1062
1061
|
if (cycle.lts === true) return true;
|
|
1063
1062
|
if (typeof cycle.lts === "string") {
|
|
1064
|
-
const
|
|
1065
|
-
return !Number.isNaN(
|
|
1063
|
+
const ts = Date.parse(cycle.lts);
|
|
1064
|
+
return !Number.isNaN(ts) && ts <= now;
|
|
1066
1065
|
}
|
|
1067
1066
|
return false;
|
|
1068
1067
|
}
|
|
@@ -7264,14 +7263,14 @@ function formatExtended(ext) {
|
|
|
7264
7263
|
}
|
|
7265
7264
|
}
|
|
7266
7265
|
if (ext.tsModernity && ext.tsModernity.typescriptVersion) {
|
|
7267
|
-
const
|
|
7266
|
+
const ts = ext.tsModernity;
|
|
7268
7267
|
lines.push(chalk3.bold.underline(" TypeScript"));
|
|
7269
7268
|
const parts = [];
|
|
7270
|
-
parts.push(`v${
|
|
7271
|
-
if (
|
|
7272
|
-
else if (
|
|
7273
|
-
if (
|
|
7274
|
-
if (
|
|
7269
|
+
parts.push(`v${ts.typescriptVersion}`);
|
|
7270
|
+
if (ts.strict === true) parts.push(chalk3.green("strict \u2714"));
|
|
7271
|
+
else if (ts.strict === false) parts.push(chalk3.yellow("strict \u2716"));
|
|
7272
|
+
if (ts.moduleType) parts.push(ts.moduleType.toUpperCase());
|
|
7273
|
+
if (ts.target) parts.push(`target: ${ts.target}`);
|
|
7275
7274
|
lines.push(` ${parts.join(chalk3.dim(" \xB7 "))}`);
|
|
7276
7275
|
lines.push("");
|
|
7277
7276
|
}
|
|
@@ -7851,11 +7850,19 @@ var CONFIG_FILES = [
|
|
|
7851
7850
|
"vibgrate.config.json"
|
|
7852
7851
|
];
|
|
7853
7852
|
var TRUSTED_CONFIG_ENV = "VIBGRATE_TRUST_CONFIG";
|
|
7853
|
+
var tsPromise = null;
|
|
7854
|
+
function loadTypeScript() {
|
|
7855
|
+
tsPromise ??= import('typescript').then((m) => {
|
|
7856
|
+
const mod = m;
|
|
7857
|
+
return mod.default ?? m;
|
|
7858
|
+
});
|
|
7859
|
+
return tsPromise;
|
|
7860
|
+
}
|
|
7854
7861
|
function isRecord(value) {
|
|
7855
7862
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7856
7863
|
}
|
|
7857
|
-
function toStaticValue(expr, constBindings) {
|
|
7858
|
-
if (ts.isParenthesizedExpression(expr)) return toStaticValue(expr.expression, constBindings);
|
|
7864
|
+
function toStaticValue(expr, constBindings, ts) {
|
|
7865
|
+
if (ts.isParenthesizedExpression(expr)) return toStaticValue(expr.expression, constBindings, ts);
|
|
7859
7866
|
if (ts.isStringLiteralLike(expr)) return expr.text;
|
|
7860
7867
|
if (ts.isNumericLiteral(expr)) return Number(expr.text);
|
|
7861
7868
|
if (expr.kind === ts.SyntaxKind.TrueKeyword) return true;
|
|
@@ -7864,7 +7871,7 @@ function toStaticValue(expr, constBindings) {
|
|
|
7864
7871
|
if (ts.isArrayLiteralExpression(expr)) {
|
|
7865
7872
|
return expr.elements.map((el) => {
|
|
7866
7873
|
if (ts.isSpreadElement(el)) throw new Error("Spread not supported in static config arrays");
|
|
7867
|
-
return toStaticValue(el, constBindings);
|
|
7874
|
+
return toStaticValue(el, constBindings, ts);
|
|
7868
7875
|
});
|
|
7869
7876
|
}
|
|
7870
7877
|
if (ts.isObjectLiteralExpression(expr)) {
|
|
@@ -7880,18 +7887,19 @@ function toStaticValue(expr, constBindings) {
|
|
|
7880
7887
|
if (key === null) {
|
|
7881
7888
|
throw new Error("Unsupported object key in static config");
|
|
7882
7889
|
}
|
|
7883
|
-
out[key] = toStaticValue(prop.initializer, constBindings);
|
|
7890
|
+
out[key] = toStaticValue(prop.initializer, constBindings, ts);
|
|
7884
7891
|
}
|
|
7885
7892
|
return out;
|
|
7886
7893
|
}
|
|
7887
7894
|
if (ts.isIdentifier(expr)) {
|
|
7888
7895
|
const bound = constBindings.get(expr.text);
|
|
7889
7896
|
if (!bound) throw new Error(`Unknown identifier in static config: ${expr.text}`);
|
|
7890
|
-
return toStaticValue(bound, constBindings);
|
|
7897
|
+
return toStaticValue(bound, constBindings, ts);
|
|
7891
7898
|
}
|
|
7892
7899
|
throw new Error("Non-static expression in config");
|
|
7893
7900
|
}
|
|
7894
|
-
function tryParseStaticConfig(text, configPath) {
|
|
7901
|
+
async function tryParseStaticConfig(text, configPath) {
|
|
7902
|
+
const ts = await loadTypeScript();
|
|
7895
7903
|
const scriptKind = configPath.endsWith(".ts") ? ts.ScriptKind.TS : ts.ScriptKind.JS;
|
|
7896
7904
|
const source = ts.createSourceFile(configPath, text, ts.ScriptTarget.ESNext, true, scriptKind);
|
|
7897
7905
|
const constBindings = /* @__PURE__ */ new Map();
|
|
@@ -7906,7 +7914,7 @@ function tryParseStaticConfig(text, configPath) {
|
|
|
7906
7914
|
}
|
|
7907
7915
|
for (const stmt of source.statements) {
|
|
7908
7916
|
if (!ts.isExportAssignment(stmt)) continue;
|
|
7909
|
-
const parsed = toStaticValue(stmt.expression, constBindings);
|
|
7917
|
+
const parsed = toStaticValue(stmt.expression, constBindings, ts);
|
|
7910
7918
|
if (!isRecord(parsed)) return null;
|
|
7911
7919
|
return { ...DEFAULT_CONFIG, ...parsed };
|
|
7912
7920
|
}
|
|
@@ -7943,7 +7951,7 @@ async function loadConfig(rootDir) {
|
|
|
7943
7951
|
const txt = await readTextFile(configPath);
|
|
7944
7952
|
let staticConfig = null;
|
|
7945
7953
|
try {
|
|
7946
|
-
staticConfig = tryParseStaticConfig(txt, configPath);
|
|
7954
|
+
staticConfig = await tryParseStaticConfig(txt, configPath);
|
|
7947
7955
|
} catch {
|
|
7948
7956
|
staticConfig = null;
|
|
7949
7957
|
}
|
|
@@ -8227,7 +8235,7 @@ var ROBOT = [
|
|
|
8227
8235
|
function getBrand(version) {
|
|
8228
8236
|
return [
|
|
8229
8237
|
chalk3.bold.white(" V I B G R A T E"),
|
|
8230
|
-
chalk3.dim(`
|
|
8238
|
+
chalk3.dim(` Drift Intelligence Engine`) + chalk3.dim(` v${version}`)
|
|
8231
8239
|
];
|
|
8232
8240
|
}
|
|
8233
8241
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -11314,6 +11322,48 @@ async function fetchScanPreflight(parsed, ingestHost, options) {
|
|
|
11314
11322
|
}
|
|
11315
11323
|
return body;
|
|
11316
11324
|
}
|
|
11325
|
+
|
|
11326
|
+
// src/core-open/utils/symbols-preflight.ts
|
|
11327
|
+
var PROJECT_TYPE_TO_OSV_ECOSYSTEM = {
|
|
11328
|
+
node: "npm",
|
|
11329
|
+
typescript: "npm",
|
|
11330
|
+
dotnet: "NuGet",
|
|
11331
|
+
"visual-basic": "NuGet",
|
|
11332
|
+
python: "PyPI",
|
|
11333
|
+
ruby: "RubyGems",
|
|
11334
|
+
java: "Maven",
|
|
11335
|
+
kotlin: "Maven",
|
|
11336
|
+
scala: "Maven",
|
|
11337
|
+
groovy: "Maven",
|
|
11338
|
+
clojure: "Maven",
|
|
11339
|
+
go: "Go",
|
|
11340
|
+
rust: "crates.io",
|
|
11341
|
+
php: "Packagist",
|
|
11342
|
+
dart: "Pub",
|
|
11343
|
+
elixir: "Hex"
|
|
11344
|
+
};
|
|
11345
|
+
var MAX_DEPENDENCIES = 4e3;
|
|
11346
|
+
async function fetchRiskySymbols(parsed, ingestHost, dependencies) {
|
|
11347
|
+
const url = `${parsed.scheme}://${ingestHost}/v1/ingest/scan/preflight/symbols`;
|
|
11348
|
+
const body = JSON.stringify({
|
|
11349
|
+
schemaVersion: "1",
|
|
11350
|
+
dependencies: dependencies.slice(0, MAX_DEPENDENCIES)
|
|
11351
|
+
});
|
|
11352
|
+
const response = await fetch(url, {
|
|
11353
|
+
method: "POST",
|
|
11354
|
+
headers: {
|
|
11355
|
+
"Content-Type": "application/json",
|
|
11356
|
+
"X-Vibgrate-Timestamp": String(Date.now()),
|
|
11357
|
+
Authorization: `VibgrateDSN ${parsed.keyId}:${parsed.secret}`
|
|
11358
|
+
},
|
|
11359
|
+
body
|
|
11360
|
+
});
|
|
11361
|
+
const payload = await response.json();
|
|
11362
|
+
if (!response.ok && payload.status !== "error") {
|
|
11363
|
+
throw new Error(`HTTP ${response.status}: ${JSON.stringify(payload)}`);
|
|
11364
|
+
}
|
|
11365
|
+
return payload;
|
|
11366
|
+
}
|
|
11317
11367
|
var SKIP_DIRS2 = /* @__PURE__ */ new Set([
|
|
11318
11368
|
"node_modules",
|
|
11319
11369
|
".git",
|
|
@@ -11417,6 +11467,6 @@ async function writeTextFile2(filePath, content) {
|
|
|
11417
11467
|
await fs2.writeFile(filePath, content, "utf8");
|
|
11418
11468
|
}
|
|
11419
11469
|
|
|
11420
|
-
export { VERSION, brandProgressBar, buildVersionTimelines, compactUiPurpose, 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-
|
|
11422
|
-
//# sourceMappingURL=chunk-
|
|
11470
|
+
export { PROJECT_TYPE_TO_OSV_ECOSYSTEM, VERSION, brandProgressBar, buildVersionTimelines, compactUiPurpose, computeDriftScore, computeRepoFingerprint, computeUpgradeImpact, detectVcs, driftBar, ensureDir2 as ensureDir, fetchRiskySymbols, 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 };
|
|
11471
|
+
//# sourceMappingURL=chunk-NNU2PW2H.js.map
|
|
11472
|
+
//# sourceMappingURL=chunk-NNU2PW2H.js.map
|