@vibgrate/cli 1.0.60 → 1.0.62
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-OWCILWV6.js +10 -0
- package/dist/{chunk-ZE2RZFB4.js → chunk-DFHLPCMT.js} +2 -2
- package/dist/{chunk-BEASN7E5.js → chunk-RS22BX42.js} +102 -3
- package/dist/{chunk-43ACU2WV.js → chunk-TBE6NQ5Z.js} +0 -1
- package/dist/cli.js +4 -4
- package/dist/{fs-TWKR3VSL.js → fs-B2ZS4NOP.js} +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/baseline-MNQTPXHY.js +0 -10
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
readTextFile,
|
|
14
14
|
writeJsonFile,
|
|
15
15
|
writeTextFile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TBE6NQ5Z.js";
|
|
17
17
|
|
|
18
18
|
// src/scoring/drift-score.ts
|
|
19
19
|
import * as crypto from "crypto";
|
|
@@ -2499,7 +2499,7 @@ async function scanPythonProjects(rootDir, pypiCache, cache) {
|
|
|
2499
2499
|
return results;
|
|
2500
2500
|
}
|
|
2501
2501
|
async function findPythonManifests(rootDir) {
|
|
2502
|
-
const { findFiles: findFiles2 } = await import("./fs-
|
|
2502
|
+
const { findFiles: findFiles2 } = await import("./fs-B2ZS4NOP.js");
|
|
2503
2503
|
return findFiles2(rootDir, (name) => PYTHON_MANIFEST_FILES.has(name) || /^requirements.*\.txt$/.test(name));
|
|
2504
2504
|
}
|
|
2505
2505
|
async function scanOnePythonProject(dir, manifestFiles, rootDir, pypiCache, cache) {
|
|
@@ -2898,7 +2898,7 @@ async function scanJavaProjects(rootDir, mavenCache, cache) {
|
|
|
2898
2898
|
return results;
|
|
2899
2899
|
}
|
|
2900
2900
|
async function findJavaManifests(rootDir) {
|
|
2901
|
-
const { findFiles: findFiles2 } = await import("./fs-
|
|
2901
|
+
const { findFiles: findFiles2 } = await import("./fs-B2ZS4NOP.js");
|
|
2902
2902
|
return findFiles2(rootDir, (name) => JAVA_MANIFEST_FILES.has(name));
|
|
2903
2903
|
}
|
|
2904
2904
|
async function scanOneJavaProject(dir, manifestFiles, rootDir, mavenCache, cache) {
|
|
@@ -7442,6 +7442,98 @@ function isUsefulString(s) {
|
|
|
7442
7442
|
return true;
|
|
7443
7443
|
}
|
|
7444
7444
|
|
|
7445
|
+
// src/utils/compact-evidence.ts
|
|
7446
|
+
var CATEGORY_PATTERNS = [
|
|
7447
|
+
{ category: "pricing", pattern: /price|pricing|billing|subscri|trial|credit|plan|tier|upgrade|premium|pro|enterprise/i },
|
|
7448
|
+
{ category: "auth", pattern: /sign[- ]?in|sign[- ]?up|log[- ]?in|log[- ]?out|auth|sso|oauth|password|register|invite|onboard/i },
|
|
7449
|
+
{ category: "dashboard", pattern: /dashboard|overview|home|main|summary|stats/i },
|
|
7450
|
+
{ category: "settings", pattern: /setting|config|preference|option|profile|account/i },
|
|
7451
|
+
{ category: "users", pattern: /user|member|team|role|permission|access|admin|owner/i },
|
|
7452
|
+
{ category: "integrations", pattern: /integrat|connect|webhook|api[- ]?key|sync|import|export/i },
|
|
7453
|
+
{ category: "reports", pattern: /report|analy|metric|chart|graph|insight|track/i },
|
|
7454
|
+
{ category: "workflows", pattern: /workflow|automat|schedule|trigger|action|job|task|pipeline/i },
|
|
7455
|
+
{ category: "projects", pattern: /project|workspace|organization|folder|repo/i },
|
|
7456
|
+
{ category: "navigation", pattern: /menu|nav|sidebar|header|footer|breadcrumb/i }
|
|
7457
|
+
];
|
|
7458
|
+
function compactUiPurpose(result, maxSamplesPerCategory = 3) {
|
|
7459
|
+
const evidence = result.topEvidence;
|
|
7460
|
+
const dependencies = evidence.filter((e) => e.kind === "dependency").map((e) => e.value).slice(0, 10);
|
|
7461
|
+
const routes = dedupeRoutes(
|
|
7462
|
+
evidence.filter((e) => e.kind === "route").map((e) => e.value)
|
|
7463
|
+
).slice(0, 15);
|
|
7464
|
+
const textEvidence = evidence.filter(
|
|
7465
|
+
(e) => e.kind !== "dependency" && e.kind !== "route" && e.kind !== "feature_flag"
|
|
7466
|
+
);
|
|
7467
|
+
const byCategory = /* @__PURE__ */ new Map();
|
|
7468
|
+
const categoryCounts = {};
|
|
7469
|
+
for (const item of textEvidence) {
|
|
7470
|
+
const category = categorize(item.value);
|
|
7471
|
+
if (!byCategory.has(category)) {
|
|
7472
|
+
byCategory.set(category, /* @__PURE__ */ new Set());
|
|
7473
|
+
}
|
|
7474
|
+
const normalized = normalizeValue(item.value);
|
|
7475
|
+
if (normalized.length >= 3) {
|
|
7476
|
+
byCategory.get(category).add(normalized);
|
|
7477
|
+
}
|
|
7478
|
+
}
|
|
7479
|
+
const samples = [];
|
|
7480
|
+
for (const [category, values] of byCategory) {
|
|
7481
|
+
const deduped = dedupeStrings([...values]);
|
|
7482
|
+
categoryCounts[category] = deduped.length;
|
|
7483
|
+
for (const value of deduped.slice(0, maxSamplesPerCategory)) {
|
|
7484
|
+
samples.push({ kind: "text", value, category });
|
|
7485
|
+
}
|
|
7486
|
+
}
|
|
7487
|
+
const featureFlags = evidence.filter((e) => e.kind === "feature_flag");
|
|
7488
|
+
if (featureFlags.length > 0) {
|
|
7489
|
+
categoryCounts["feature_flags"] = featureFlags.length;
|
|
7490
|
+
samples.push({ kind: "feature_flag", value: "feature flags detected", category: "feature_flags" });
|
|
7491
|
+
}
|
|
7492
|
+
return {
|
|
7493
|
+
samples,
|
|
7494
|
+
categoryCounts,
|
|
7495
|
+
originalCount: evidence.length,
|
|
7496
|
+
dependencies,
|
|
7497
|
+
routes,
|
|
7498
|
+
detectedFrameworks: result.detectedFrameworks
|
|
7499
|
+
};
|
|
7500
|
+
}
|
|
7501
|
+
function categorize(value) {
|
|
7502
|
+
for (const { category, pattern } of CATEGORY_PATTERNS) {
|
|
7503
|
+
if (pattern.test(value)) return category;
|
|
7504
|
+
}
|
|
7505
|
+
return "general";
|
|
7506
|
+
}
|
|
7507
|
+
function normalizeValue(value) {
|
|
7508
|
+
return value.toLowerCase().replace(/[^a-z0-9\s-]/g, " ").replace(/\s+/g, " ").trim().slice(0, 60);
|
|
7509
|
+
}
|
|
7510
|
+
function dedupeStrings(values) {
|
|
7511
|
+
const sorted = values.sort((a, b) => b.length - a.length);
|
|
7512
|
+
const kept = [];
|
|
7513
|
+
for (const value of sorted) {
|
|
7514
|
+
const isDupe = kept.some((k) => {
|
|
7515
|
+
const stem = value.slice(0, 6);
|
|
7516
|
+
return k.startsWith(stem) || k.includes(value) || value.includes(k);
|
|
7517
|
+
});
|
|
7518
|
+
if (!isDupe) {
|
|
7519
|
+
kept.push(value);
|
|
7520
|
+
}
|
|
7521
|
+
}
|
|
7522
|
+
return kept;
|
|
7523
|
+
}
|
|
7524
|
+
function dedupeRoutes(routes) {
|
|
7525
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7526
|
+
const result = [];
|
|
7527
|
+
for (const route of routes) {
|
|
7528
|
+
const normalized = route.replace(/:[a-z_]+/gi, ":param").replace(/\[\[*\.*\.*[a-z_]+\]*\]/gi, ":param").replace(/\/+$/, "").toLowerCase();
|
|
7529
|
+
if (!seen.has(normalized)) {
|
|
7530
|
+
seen.add(normalized);
|
|
7531
|
+
result.push(route);
|
|
7532
|
+
}
|
|
7533
|
+
}
|
|
7534
|
+
return result;
|
|
7535
|
+
}
|
|
7536
|
+
|
|
7445
7537
|
// src/utils/tool-installer.ts
|
|
7446
7538
|
import { spawn as spawn5 } from "child_process";
|
|
7447
7539
|
import chalk5 from "chalk";
|
|
@@ -8067,6 +8159,13 @@ async function runScan(rootDir, opts) {
|
|
|
8067
8159
|
const up = extended.uiPurpose;
|
|
8068
8160
|
const summary = [`${up.topEvidence.length} evidence`, ...up.capped ? ["capped"] : []].join(" \xB7 ");
|
|
8069
8161
|
progress.completeStep("uipurpose", summary, up.topEvidence.length);
|
|
8162
|
+
await Promise.all(allProjects.map(async (project) => {
|
|
8163
|
+
const projectDir = path23.join(rootDir, project.path);
|
|
8164
|
+
const projectResult = await scanUiPurpose(projectDir, fileCache, 150);
|
|
8165
|
+
if (projectResult.topEvidence.length > 0) {
|
|
8166
|
+
project.uiPurpose = compactUiPurpose(projectResult);
|
|
8167
|
+
}
|
|
8168
|
+
}));
|
|
8070
8169
|
}
|
|
8071
8170
|
if (scannerPolicy.architecture && scanners?.architecture?.enabled !== false) {
|
|
8072
8171
|
progress.startStep("architecture");
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
baselineCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DFHLPCMT.js";
|
|
5
5
|
import {
|
|
6
6
|
VERSION,
|
|
7
7
|
dsnCommand,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
pushCommand,
|
|
11
11
|
scanCommand,
|
|
12
12
|
writeDefaultConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RS22BX42.js";
|
|
14
14
|
import {
|
|
15
15
|
ensureDir,
|
|
16
16
|
pathExists,
|
|
17
17
|
readJsonFile,
|
|
18
18
|
writeTextFile
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TBE6NQ5Z.js";
|
|
20
20
|
|
|
21
21
|
// src/cli.ts
|
|
22
22
|
import { Command as Command6 } from "commander";
|
|
@@ -39,7 +39,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
|
|
|
39
39
|
console.log(chalk.green("\u2714") + ` Created ${chalk.bold("vibgrate.config.ts")}`);
|
|
40
40
|
}
|
|
41
41
|
if (opts.baseline) {
|
|
42
|
-
const { runBaseline } = await import("./baseline-
|
|
42
|
+
const { runBaseline } = await import("./baseline-OWCILWV6.js");
|
|
43
43
|
await runBaseline(rootDir);
|
|
44
44
|
}
|
|
45
45
|
console.log("");
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ interface ProjectScan {
|
|
|
57
57
|
architectureMermaid?: string;
|
|
58
58
|
/** Project-level relationship diagram (first-level parents + children) */
|
|
59
59
|
relationshipDiagram?: MermaidDiagram;
|
|
60
|
+
/** Compacted UI purpose evidence for this project */
|
|
61
|
+
uiPurpose?: CompactUiPurpose;
|
|
60
62
|
}
|
|
61
63
|
interface SolutionScan {
|
|
62
64
|
/** Deterministic solution ID: SHA-256 hash of `${path}:${name}:${workspaceId}` */
|
|
@@ -458,6 +460,25 @@ interface UiPurposeEvidenceItem {
|
|
|
458
460
|
file: string;
|
|
459
461
|
weight: number;
|
|
460
462
|
}
|
|
463
|
+
/** Compacted UI evidence for LLM inference - reduces token usage by ~80-90% */
|
|
464
|
+
interface CompactUiPurpose {
|
|
465
|
+
/** Top unique samples per category (typically ~40-60 items) */
|
|
466
|
+
samples: Array<{
|
|
467
|
+
kind: string;
|
|
468
|
+
value: string;
|
|
469
|
+
category: string;
|
|
470
|
+
}>;
|
|
471
|
+
/** Count of evidence items per semantic category */
|
|
472
|
+
categoryCounts: Record<string, number>;
|
|
473
|
+
/** Total evidence count before compaction */
|
|
474
|
+
originalCount: number;
|
|
475
|
+
/** High-signal dependencies (stripe, auth0, etc.) */
|
|
476
|
+
dependencies: string[];
|
|
477
|
+
/** Deduplicated route patterns */
|
|
478
|
+
routes: string[];
|
|
479
|
+
/** Detected UI frameworks (nextjs, react, vue, etc.) */
|
|
480
|
+
detectedFrameworks: string[];
|
|
481
|
+
}
|
|
461
482
|
interface UiPurposeResult {
|
|
462
483
|
enabled: boolean;
|
|
463
484
|
detectedFrameworks: string[];
|
package/dist/index.js
CHANGED
package/package.json
CHANGED