@vibecheck-ai/cli 7.5.1 → 18.5.0
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 +390 -190
- package/dist/cli.js.map +1 -1
- package/dist/guardrail/index.js +4 -3
- package/dist/guardrail/index.js.map +1 -1
- package/dist/v2/index.js +390 -190
- package/dist/v2/index.js.map +1 -1
- package/package.json +8 -4
package/dist/cli.js
CHANGED
|
@@ -3065,9 +3065,181 @@ var init_file_walker = __esm({
|
|
|
3065
3065
|
});
|
|
3066
3066
|
|
|
3067
3067
|
// ../../packages/core/src/utils/logger.ts
|
|
3068
|
+
function getLogger(component) {
|
|
3069
|
+
if (!defaultLogger) {
|
|
3070
|
+
defaultLogger = new Logger({ level: "info", component: "vibecheck" });
|
|
3071
|
+
}
|
|
3072
|
+
return component ? defaultLogger.child(component) : defaultLogger;
|
|
3073
|
+
}
|
|
3074
|
+
var LOG_LEVELS, DEFAULT_CONFIG2, Logger, LogGroup, defaultLogger;
|
|
3068
3075
|
var init_logger = __esm({
|
|
3069
3076
|
"../../packages/core/src/utils/logger.ts"() {
|
|
3070
3077
|
"use strict";
|
|
3078
|
+
LOG_LEVELS = {
|
|
3079
|
+
debug: 0,
|
|
3080
|
+
info: 1,
|
|
3081
|
+
warn: 2,
|
|
3082
|
+
error: 3
|
|
3083
|
+
};
|
|
3084
|
+
DEFAULT_CONFIG2 = {
|
|
3085
|
+
level: "info",
|
|
3086
|
+
component: "vibecheck",
|
|
3087
|
+
enableConsole: true,
|
|
3088
|
+
enableStructured: false
|
|
3089
|
+
};
|
|
3090
|
+
Logger = class _Logger {
|
|
3091
|
+
config;
|
|
3092
|
+
constructor(config = {}) {
|
|
3093
|
+
this.config = { ...DEFAULT_CONFIG2, ...config };
|
|
3094
|
+
}
|
|
3095
|
+
/**
|
|
3096
|
+
* Create a child logger with a new component name
|
|
3097
|
+
*/
|
|
3098
|
+
child(component) {
|
|
3099
|
+
return new _Logger({
|
|
3100
|
+
...this.config,
|
|
3101
|
+
component: `${this.config.component}.${component}`
|
|
3102
|
+
});
|
|
3103
|
+
}
|
|
3104
|
+
/**
|
|
3105
|
+
* Log at debug level
|
|
3106
|
+
*/
|
|
3107
|
+
debug(message, context) {
|
|
3108
|
+
this.log("debug", message, context);
|
|
3109
|
+
}
|
|
3110
|
+
/**
|
|
3111
|
+
* Log at info level
|
|
3112
|
+
*/
|
|
3113
|
+
info(message, context) {
|
|
3114
|
+
this.log("info", message, context);
|
|
3115
|
+
}
|
|
3116
|
+
/**
|
|
3117
|
+
* Log at warn level
|
|
3118
|
+
*/
|
|
3119
|
+
warn(message, context) {
|
|
3120
|
+
this.log("warn", message, context);
|
|
3121
|
+
}
|
|
3122
|
+
/**
|
|
3123
|
+
* Log at error level
|
|
3124
|
+
*/
|
|
3125
|
+
error(message, error2, context) {
|
|
3126
|
+
const errorInfo = error2 ? {
|
|
3127
|
+
name: error2.name,
|
|
3128
|
+
message: error2.message,
|
|
3129
|
+
code: error2.code,
|
|
3130
|
+
stack: error2.stack
|
|
3131
|
+
} : void 0;
|
|
3132
|
+
this.log("error", message, context, errorInfo);
|
|
3133
|
+
}
|
|
3134
|
+
/**
|
|
3135
|
+
* Log with timing
|
|
3136
|
+
*/
|
|
3137
|
+
timed(operation, fn, context) {
|
|
3138
|
+
const start = performance.now();
|
|
3139
|
+
const logCompletion = (success2, error2) => {
|
|
3140
|
+
const duration = Math.round(performance.now() - start);
|
|
3141
|
+
if (success2) {
|
|
3142
|
+
this.debug(`${operation} completed`, { ...context, duration });
|
|
3143
|
+
} else {
|
|
3144
|
+
this.error(`${operation} failed`, error2, { ...context, duration });
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
try {
|
|
3148
|
+
const result = fn();
|
|
3149
|
+
if (result instanceof Promise) {
|
|
3150
|
+
return result.then((value) => {
|
|
3151
|
+
logCompletion(true);
|
|
3152
|
+
return value;
|
|
3153
|
+
}).catch((error2) => {
|
|
3154
|
+
logCompletion(false, error2);
|
|
3155
|
+
throw error2;
|
|
3156
|
+
});
|
|
3157
|
+
}
|
|
3158
|
+
logCompletion(true);
|
|
3159
|
+
return result;
|
|
3160
|
+
} catch (error2) {
|
|
3161
|
+
logCompletion(false, error2);
|
|
3162
|
+
throw error2;
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
/**
|
|
3166
|
+
* Create a log group for related operations
|
|
3167
|
+
*/
|
|
3168
|
+
group(name) {
|
|
3169
|
+
return new LogGroup(this, name);
|
|
3170
|
+
}
|
|
3171
|
+
log(level, message, context, error2) {
|
|
3172
|
+
if (LOG_LEVELS[level] < LOG_LEVELS[this.config.level]) {
|
|
3173
|
+
return;
|
|
3174
|
+
}
|
|
3175
|
+
const entry = {
|
|
3176
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3177
|
+
level,
|
|
3178
|
+
component: this.config.component,
|
|
3179
|
+
message,
|
|
3180
|
+
context,
|
|
3181
|
+
error: error2
|
|
3182
|
+
};
|
|
3183
|
+
if (this.config.onLog) {
|
|
3184
|
+
this.config.onLog(entry);
|
|
3185
|
+
}
|
|
3186
|
+
if (this.config.enableConsole) {
|
|
3187
|
+
this.writeToConsole(entry);
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
writeToConsole(entry) {
|
|
3191
|
+
const prefix = `[${entry.timestamp}] [${entry.level.toUpperCase()}] [${entry.component}]`;
|
|
3192
|
+
const contextStr = entry.context ? ` ${JSON.stringify(entry.context)}` : "";
|
|
3193
|
+
if (this.config.enableStructured) {
|
|
3194
|
+
const output = JSON.stringify(entry);
|
|
3195
|
+
process.stderr.write(output + "\n");
|
|
3196
|
+
} else {
|
|
3197
|
+
const message = `${prefix} ${entry.message}${contextStr}`;
|
|
3198
|
+
process.stderr.write(message + "\n");
|
|
3199
|
+
if (entry.level === "error" && entry.error?.stack) {
|
|
3200
|
+
process.stderr.write(entry.error.stack + "\n");
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
};
|
|
3205
|
+
LogGroup = class {
|
|
3206
|
+
logger;
|
|
3207
|
+
name;
|
|
3208
|
+
startTime;
|
|
3209
|
+
operations = [];
|
|
3210
|
+
constructor(logger9, name) {
|
|
3211
|
+
this.logger = logger9;
|
|
3212
|
+
this.name = name;
|
|
3213
|
+
this.startTime = performance.now();
|
|
3214
|
+
this.logger.debug(`Starting: ${name}`);
|
|
3215
|
+
}
|
|
3216
|
+
/**
|
|
3217
|
+
* Add an operation to the group
|
|
3218
|
+
*/
|
|
3219
|
+
addOperation(name, duration, success2) {
|
|
3220
|
+
this.operations.push({ name, duration, success: success2 });
|
|
3221
|
+
}
|
|
3222
|
+
/**
|
|
3223
|
+
* End the group and log summary
|
|
3224
|
+
*/
|
|
3225
|
+
end(success2 = true) {
|
|
3226
|
+
const totalDuration = Math.round(performance.now() - this.startTime);
|
|
3227
|
+
const failed = this.operations.filter((op) => !op.success).length;
|
|
3228
|
+
if (success2 && failed === 0) {
|
|
3229
|
+
this.logger.info(`Completed: ${this.name}`, {
|
|
3230
|
+
duration: totalDuration,
|
|
3231
|
+
operationCount: this.operations.length
|
|
3232
|
+
});
|
|
3233
|
+
} else {
|
|
3234
|
+
this.logger.warn(`Completed with issues: ${this.name}`, {
|
|
3235
|
+
duration: totalDuration,
|
|
3236
|
+
operationCount: this.operations.length,
|
|
3237
|
+
failedCount: failed
|
|
3238
|
+
});
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
};
|
|
3242
|
+
defaultLogger = null;
|
|
3071
3243
|
}
|
|
3072
3244
|
});
|
|
3073
3245
|
|
|
@@ -3215,24 +3387,27 @@ var init_dist = __esm({
|
|
|
3215
3387
|
FILE_LOCKING: "file_locking",
|
|
3216
3388
|
AUTOFIX_LIMITED: "autofix_limited",
|
|
3217
3389
|
// 3 fixes per month for free tier
|
|
3218
|
-
// ===
|
|
3390
|
+
// === VIBECODER ($9.99) Tier Entitlements ===
|
|
3219
3391
|
REALITY_MODE: "reality_mode",
|
|
3220
|
-
CONTEXT_ENGINE: "context_engine",
|
|
3221
|
-
ISL_STUDIO: "isl_studio",
|
|
3222
|
-
FIREWALL_AGENT: "firewall_agent",
|
|
3223
|
-
FIREWALL_ENFORCE: "firewall_enforce",
|
|
3224
|
-
FIREWALL_LOCKDOWN: "firewall_lockdown",
|
|
3225
3392
|
AUTOFIX: "autofix",
|
|
3226
3393
|
AUTOFIX_APPLY: "autofix_apply",
|
|
3227
3394
|
CERTIFY: "certify",
|
|
3228
3395
|
BADGE_VERIFIED: "badge_verified",
|
|
3229
|
-
CHAOS_AGENT: "chaos_agent",
|
|
3230
3396
|
REPORTS_PDF: "reports_pdf",
|
|
3231
3397
|
REPORTS_EXECUTIVE: "reports_executive",
|
|
3232
|
-
FORGE_EXTENDED: "forge_extended",
|
|
3233
|
-
REPLAY_VIEWER_FULL: "replay_viewer_full",
|
|
3234
3398
|
PROOF_HISTORY: "proof_history",
|
|
3235
3399
|
CLOUD_SYNC: "cloud_sync",
|
|
3400
|
+
PRIORITY_SUPPORT: "priority_support",
|
|
3401
|
+
SHAREABLE_REPORTS: "shareable_reports",
|
|
3402
|
+
// === DEVELOPER ($29.99) Tier Entitlements ===
|
|
3403
|
+
CONTEXT_ENGINE: "context_engine",
|
|
3404
|
+
ISL_STUDIO: "isl_studio",
|
|
3405
|
+
FIREWALL_AGENT: "firewall_agent",
|
|
3406
|
+
FIREWALL_ENFORCE: "firewall_enforce",
|
|
3407
|
+
FIREWALL_LOCKDOWN: "firewall_lockdown",
|
|
3408
|
+
CHAOS_AGENT: "chaos_agent",
|
|
3409
|
+
FORGE_EXTENDED: "forge_extended",
|
|
3410
|
+
REPLAY_VIEWER_FULL: "replay_viewer_full",
|
|
3236
3411
|
TEAM_COLLABORATION: "team_collaboration",
|
|
3237
3412
|
API_ACCESS: "api_access",
|
|
3238
3413
|
WEBHOOKS: "webhooks",
|
|
@@ -3240,9 +3415,7 @@ var init_dist = __esm({
|
|
|
3240
3415
|
AI_GENERATION: "ai_generation",
|
|
3241
3416
|
POLICIES: "policies",
|
|
3242
3417
|
WORKFLOWS: "workflows",
|
|
3243
|
-
PRIORITY_SUPPORT: "priority_support",
|
|
3244
3418
|
PROMPT_TEMPLATES_PRO: "prompt_templates_pro",
|
|
3245
|
-
SHAREABLE_REPORTS: "shareable_reports",
|
|
3246
3419
|
// === TEAM Tier Entitlements ===
|
|
3247
3420
|
TEAM_SHARED_POLICIES: "team_shared_policies",
|
|
3248
3421
|
TEAM_SLACK_ALERTS: "team_slack_alerts",
|
|
@@ -3304,6 +3477,7 @@ var init_dist = __esm({
|
|
|
3304
3477
|
ENTITLEMENTS.REALITY_MODE,
|
|
3305
3478
|
ENTITLEMENTS.AUTOFIX,
|
|
3306
3479
|
ENTITLEMENTS.AUTOFIX_APPLY,
|
|
3480
|
+
ENTITLEMENTS.CERTIFY,
|
|
3307
3481
|
ENTITLEMENTS.BADGE_VERIFIED,
|
|
3308
3482
|
ENTITLEMENTS.REPORTS_PDF,
|
|
3309
3483
|
ENTITLEMENTS.REPORTS_EXECUTIVE,
|
|
@@ -3320,7 +3494,6 @@ var init_dist = __esm({
|
|
|
3320
3494
|
ENTITLEMENTS.FIREWALL_AGENT,
|
|
3321
3495
|
ENTITLEMENTS.FIREWALL_ENFORCE,
|
|
3322
3496
|
ENTITLEMENTS.FIREWALL_LOCKDOWN,
|
|
3323
|
-
ENTITLEMENTS.CERTIFY,
|
|
3324
3497
|
ENTITLEMENTS.CHAOS_AGENT,
|
|
3325
3498
|
ENTITLEMENTS.FORGE_EXTENDED,
|
|
3326
3499
|
ENTITLEMENTS.REPLAY_VIEWER_FULL,
|
|
@@ -6145,7 +6318,7 @@ var init_engine = __esm({
|
|
|
6145
6318
|
}
|
|
6146
6319
|
}
|
|
6147
6320
|
const riskScore = this.riskScorer.score({ stagedFiles, stagedContents, config: this.config });
|
|
6148
|
-
|
|
6321
|
+
const securityFindings = [];
|
|
6149
6322
|
const issues = [];
|
|
6150
6323
|
if (this.isTierAtLeast("pro")) {
|
|
6151
6324
|
for (const [file3, content] of stagedContents) {
|
|
@@ -8388,7 +8561,7 @@ var init_entitlement_gate = __esm({
|
|
|
8388
8561
|
init_auth();
|
|
8389
8562
|
PLAN_LIMITS_LOCAL = {
|
|
8390
8563
|
free: {
|
|
8391
|
-
findingDetailLimit:
|
|
8564
|
+
findingDetailLimit: 3,
|
|
8392
8565
|
canAutoFix: false,
|
|
8393
8566
|
canHealPR: false,
|
|
8394
8567
|
canModelFingerprint: false,
|
|
@@ -11610,7 +11783,7 @@ var init_chunk_H4JJSH7P = __esm({
|
|
|
11610
11783
|
// ../../packages/context-engine/dist/chunk-TNEI3MUW.js
|
|
11611
11784
|
import * as fs67 from "fs";
|
|
11612
11785
|
import * as path75 from "path";
|
|
11613
|
-
var EnhancedRuleEvaluator, RuleParser,
|
|
11786
|
+
var EnhancedRuleEvaluator, RuleParser, DEFAULT_CONFIG33, CLEAN_ARCHITECTURE_TEMPLATE, API_SAFETY_TEMPLATE, MICROSERVICE_TEMPLATE, REACT_TEMPLATE, TESTING_TEMPLATE, MONOREPO_TEMPLATE, FULLSTACK_NEXTJS_TEMPLATE, EXPRESS_API_TEMPLATE;
|
|
11614
11787
|
var init_chunk_TNEI3MUW = __esm({
|
|
11615
11788
|
"../../packages/context-engine/dist/chunk-TNEI3MUW.js"() {
|
|
11616
11789
|
"use strict";
|
|
@@ -12460,7 +12633,7 @@ var init_chunk_TNEI3MUW = __esm({
|
|
|
12460
12633
|
}
|
|
12461
12634
|
static createDefaultConfig(workspaceRoot, template) {
|
|
12462
12635
|
const configPath = path75.join(workspaceRoot, ".vibecheck-rules.yaml");
|
|
12463
|
-
const content = template ? _RuleParser.getTemplate(template) :
|
|
12636
|
+
const content = template ? _RuleParser.getTemplate(template) : DEFAULT_CONFIG33;
|
|
12464
12637
|
fs67.writeFileSync(configPath, content);
|
|
12465
12638
|
return configPath;
|
|
12466
12639
|
}
|
|
@@ -12563,7 +12736,7 @@ var init_chunk_TNEI3MUW = __esm({
|
|
|
12563
12736
|
return val;
|
|
12564
12737
|
}
|
|
12565
12738
|
};
|
|
12566
|
-
|
|
12739
|
+
DEFAULT_CONFIG33 = `# VibeCheck Architecture Rules
|
|
12567
12740
|
# Enhanced with 16 rule types for world-class codebase intelligence
|
|
12568
12741
|
version: 1
|
|
12569
12742
|
rules: []
|
|
@@ -13871,6 +14044,145 @@ var require_picocolors = __commonJS({
|
|
|
13871
14044
|
}
|
|
13872
14045
|
});
|
|
13873
14046
|
|
|
14047
|
+
// src/lib/analytics.ts
|
|
14048
|
+
import * as fs73 from "fs";
|
|
14049
|
+
import * as path82 from "path";
|
|
14050
|
+
import * as os13 from "os";
|
|
14051
|
+
import * as crypto18 from "crypto";
|
|
14052
|
+
function isEnabled() {
|
|
14053
|
+
if (_enabled !== null) return _enabled;
|
|
14054
|
+
if (process.env.VIBECHECK_TELEMETRY === "false" || process.env.VIBECHECK_TELEMETRY === "0") {
|
|
14055
|
+
_enabled = false;
|
|
14056
|
+
return false;
|
|
14057
|
+
}
|
|
14058
|
+
if (process.env.DO_NOT_TRACK === "1") {
|
|
14059
|
+
_enabled = false;
|
|
14060
|
+
return false;
|
|
14061
|
+
}
|
|
14062
|
+
if (process.env.CI && process.env.VIBECHECK_TELEMETRY !== "true") {
|
|
14063
|
+
_enabled = false;
|
|
14064
|
+
return false;
|
|
14065
|
+
}
|
|
14066
|
+
const key = process.env.POSTHOG_API_KEY;
|
|
14067
|
+
if (!key) {
|
|
14068
|
+
_enabled = false;
|
|
14069
|
+
return false;
|
|
14070
|
+
}
|
|
14071
|
+
_enabled = true;
|
|
14072
|
+
return true;
|
|
14073
|
+
}
|
|
14074
|
+
function getOrCreateDistinctId() {
|
|
14075
|
+
if (_distinctId) return _distinctId;
|
|
14076
|
+
try {
|
|
14077
|
+
if (fs73.existsSync(ANALYTICS_ID_FILE)) {
|
|
14078
|
+
_distinctId = fs73.readFileSync(ANALYTICS_ID_FILE, "utf-8").trim();
|
|
14079
|
+
if (_distinctId) return _distinctId;
|
|
14080
|
+
}
|
|
14081
|
+
} catch {
|
|
14082
|
+
}
|
|
14083
|
+
_distinctId = `cli_${crypto18.randomUUID()}`;
|
|
14084
|
+
try {
|
|
14085
|
+
const dir = path82.dirname(ANALYTICS_ID_FILE);
|
|
14086
|
+
if (!fs73.existsSync(dir)) {
|
|
14087
|
+
fs73.mkdirSync(dir, { recursive: true });
|
|
14088
|
+
}
|
|
14089
|
+
fs73.writeFileSync(ANALYTICS_ID_FILE, _distinctId, "utf-8");
|
|
14090
|
+
} catch {
|
|
14091
|
+
}
|
|
14092
|
+
return _distinctId;
|
|
14093
|
+
}
|
|
14094
|
+
async function getClient() {
|
|
14095
|
+
if (!isEnabled()) return null;
|
|
14096
|
+
if (_posthog) return _posthog;
|
|
14097
|
+
try {
|
|
14098
|
+
const { PostHog } = await import("posthog-node");
|
|
14099
|
+
const apiKey = process.env.POSTHOG_API_KEY;
|
|
14100
|
+
const host = process.env.POSTHOG_HOST || "https://us.i.posthog.com";
|
|
14101
|
+
_posthog = new PostHog(apiKey, {
|
|
14102
|
+
host,
|
|
14103
|
+
flushAt: 10,
|
|
14104
|
+
flushInterval: 1e4,
|
|
14105
|
+
// CLI is short-lived — flush fast
|
|
14106
|
+
requestTimeout: 5e3
|
|
14107
|
+
});
|
|
14108
|
+
_sessionId = `sess_${Date.now()}_${crypto18.randomBytes(4).toString("hex")}`;
|
|
14109
|
+
return _posthog;
|
|
14110
|
+
} catch {
|
|
14111
|
+
_enabled = false;
|
|
14112
|
+
return null;
|
|
14113
|
+
}
|
|
14114
|
+
}
|
|
14115
|
+
function setCliVersion(version) {
|
|
14116
|
+
_version = version;
|
|
14117
|
+
}
|
|
14118
|
+
async function capture(event, properties) {
|
|
14119
|
+
const client = await getClient();
|
|
14120
|
+
if (!client) return;
|
|
14121
|
+
client.capture({
|
|
14122
|
+
distinctId: getOrCreateDistinctId(),
|
|
14123
|
+
event,
|
|
14124
|
+
properties: {
|
|
14125
|
+
...getSuperProperties(),
|
|
14126
|
+
...properties
|
|
14127
|
+
}
|
|
14128
|
+
});
|
|
14129
|
+
}
|
|
14130
|
+
async function trackCommand(command, properties) {
|
|
14131
|
+
await capture("cli_command_executed", {
|
|
14132
|
+
command,
|
|
14133
|
+
...properties
|
|
14134
|
+
});
|
|
14135
|
+
}
|
|
14136
|
+
async function captureException(error2, additionalProperties) {
|
|
14137
|
+
const client = await getClient();
|
|
14138
|
+
if (!client) return;
|
|
14139
|
+
const err = error2 instanceof Error ? error2 : new Error(String(error2));
|
|
14140
|
+
client.capture({
|
|
14141
|
+
distinctId: getOrCreateDistinctId(),
|
|
14142
|
+
event: "$exception",
|
|
14143
|
+
properties: {
|
|
14144
|
+
...getSuperProperties(),
|
|
14145
|
+
$exception_type: err.name || "Error",
|
|
14146
|
+
$exception_message: err.message?.slice(0, 1e3) || "Unknown error",
|
|
14147
|
+
$exception_stack_trace_raw: err.stack?.slice(0, 4e3) || "",
|
|
14148
|
+
$exception_source: "cli",
|
|
14149
|
+
...additionalProperties
|
|
14150
|
+
}
|
|
14151
|
+
});
|
|
14152
|
+
}
|
|
14153
|
+
async function shutdown() {
|
|
14154
|
+
if (_posthog) {
|
|
14155
|
+
await _posthog.shutdown().catch(() => {
|
|
14156
|
+
});
|
|
14157
|
+
_posthog = null;
|
|
14158
|
+
}
|
|
14159
|
+
}
|
|
14160
|
+
function getSuperProperties() {
|
|
14161
|
+
return {
|
|
14162
|
+
cli_version: _version,
|
|
14163
|
+
platform: process.platform,
|
|
14164
|
+
arch: process.arch,
|
|
14165
|
+
node_version: process.version,
|
|
14166
|
+
session_id: _sessionId,
|
|
14167
|
+
is_ci: !!process.env.CI,
|
|
14168
|
+
ci_provider: process.env.VIBECHECK_CI_PROVIDER || process.env.CI_NAME || "none",
|
|
14169
|
+
is_tty: !!process.stdout.isTTY,
|
|
14170
|
+
source: "cli"
|
|
14171
|
+
};
|
|
14172
|
+
}
|
|
14173
|
+
var _posthog, _distinctId, _enabled, _version, _sessionId, ANALYTICS_ID_FILE;
|
|
14174
|
+
var init_analytics = __esm({
|
|
14175
|
+
"src/lib/analytics.ts"() {
|
|
14176
|
+
"use strict";
|
|
14177
|
+
_posthog = null;
|
|
14178
|
+
_distinctId = "";
|
|
14179
|
+
_enabled = null;
|
|
14180
|
+
_version = "0.0.0";
|
|
14181
|
+
_sessionId = "";
|
|
14182
|
+
ANALYTICS_ID_FILE = path82.join(os13.homedir(), ".vibecheck", "analytics-id");
|
|
14183
|
+
}
|
|
14184
|
+
});
|
|
14185
|
+
|
|
13874
14186
|
// ../../node_modules/.pnpm/@inquirer+core@11.1.1_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/key.js
|
|
13875
14187
|
var isUpKey, isDownKey, isSpaceKey, isBackspaceKey, isNumberKey, isEnterKey;
|
|
13876
14188
|
var init_key = __esm({
|
|
@@ -17116,7 +17428,7 @@ async function reportCliEvent(event) {
|
|
|
17116
17428
|
init_logger();
|
|
17117
17429
|
|
|
17118
17430
|
// ../../packages/core/src/utils/cache.ts
|
|
17119
|
-
var
|
|
17431
|
+
var DEFAULT_CONFIG3 = {
|
|
17120
17432
|
maxSize: 1e3,
|
|
17121
17433
|
defaultTtlMs: 5 * 60 * 1e3,
|
|
17122
17434
|
// 5 minutes
|
|
@@ -17179,7 +17491,7 @@ var SEVERITY_ORDER = Object.freeze({
|
|
|
17179
17491
|
});
|
|
17180
17492
|
|
|
17181
17493
|
// ../../packages/core/src/context/freshness-scorer.ts
|
|
17182
|
-
var
|
|
17494
|
+
var DEFAULT_CONFIG4 = {
|
|
17183
17495
|
maxAge: 24 * 60 * 60 * 1e3,
|
|
17184
17496
|
// 24 hours
|
|
17185
17497
|
decayFunction: "exponential",
|
|
@@ -17192,7 +17504,7 @@ var DEFAULT_CONFIG3 = {
|
|
|
17192
17504
|
};
|
|
17193
17505
|
|
|
17194
17506
|
// ../../packages/core/src/context/advanced-context-manager.ts
|
|
17195
|
-
var
|
|
17507
|
+
var DEFAULT_CONFIG5 = {
|
|
17196
17508
|
projectRoot: process.cwd(),
|
|
17197
17509
|
truthpackPath: ".vibecheck/truthpack",
|
|
17198
17510
|
maxContextTokens: 8e3,
|
|
@@ -17202,7 +17514,7 @@ var DEFAULT_CONFIG4 = {
|
|
|
17202
17514
|
};
|
|
17203
17515
|
|
|
17204
17516
|
// ../../packages/core/src/context/context-validator.ts
|
|
17205
|
-
var
|
|
17517
|
+
var DEFAULT_CONFIG6 = {
|
|
17206
17518
|
projectRoot: process.cwd(),
|
|
17207
17519
|
truthpackPath: ".vibecheck/truthpack",
|
|
17208
17520
|
freshnessThresholds: {
|
|
@@ -17220,7 +17532,7 @@ var DEFAULT_CONFIG5 = {
|
|
|
17220
17532
|
};
|
|
17221
17533
|
|
|
17222
17534
|
// ../../packages/core/src/context/drift-detector.ts
|
|
17223
|
-
var
|
|
17535
|
+
var DEFAULT_CONFIG7 = {
|
|
17224
17536
|
projectRoot: process.cwd(),
|
|
17225
17537
|
truthpackPath: ".vibecheck/truthpack",
|
|
17226
17538
|
maxScopeExpansion: 50,
|
|
@@ -17228,7 +17540,7 @@ var DEFAULT_CONFIG6 = {
|
|
|
17228
17540
|
};
|
|
17229
17541
|
|
|
17230
17542
|
// ../../packages/core/src/context/context-sync.ts
|
|
17231
|
-
var
|
|
17543
|
+
var DEFAULT_CONFIG8 = {
|
|
17232
17544
|
projectRoot: process.cwd(),
|
|
17233
17545
|
truthpackPath: ".vibecheck/truthpack",
|
|
17234
17546
|
watchPatterns: [
|
|
@@ -17256,7 +17568,7 @@ var DEFAULT_CONFIG7 = {
|
|
|
17256
17568
|
// ../../packages/core/src/truthpack/scanners/route-scanner.ts
|
|
17257
17569
|
import { glob } from "glob";
|
|
17258
17570
|
init_logger();
|
|
17259
|
-
var
|
|
17571
|
+
var DEFAULT_CONFIG9 = {
|
|
17260
17572
|
frameworks: ["express", "nextjs", "fastify", "hono"],
|
|
17261
17573
|
includePatterns: ["**/*.ts", "**/*.js", "**/route.ts", "**/route.js"],
|
|
17262
17574
|
excludePatterns: ["node_modules/**", "dist/**", "build/**", ".next/**", "coverage/**", "**/*.test.*", "**/*.spec.*"],
|
|
@@ -17295,7 +17607,9 @@ var DEFAULT_CACHE_CONFIG = {
|
|
|
17295
17607
|
};
|
|
17296
17608
|
|
|
17297
17609
|
// ../../packages/core/src/truthpack/generator.ts
|
|
17298
|
-
|
|
17610
|
+
init_logger();
|
|
17611
|
+
var logger = getLogger("truthpack.generator");
|
|
17612
|
+
var DEFAULT_CONFIG10 = {
|
|
17299
17613
|
projectRoot: process.cwd(),
|
|
17300
17614
|
outputDir: ".vibecheck/truthpack",
|
|
17301
17615
|
scanners: {
|
|
@@ -17698,7 +18012,7 @@ import * as _traverse from "@babel/traverse";
|
|
|
17698
18012
|
// ../../packages/core/src/firewall/evidence-resolver.ts
|
|
17699
18013
|
init_logger();
|
|
17700
18014
|
import { glob as glob7 } from "glob";
|
|
17701
|
-
var
|
|
18015
|
+
var DEFAULT_CONFIG11 = {
|
|
17702
18016
|
sources: ["truthpack", "filesystem", "package_json", "ast"],
|
|
17703
18017
|
truthpackPath: ".vibecheck/truthpack",
|
|
17704
18018
|
projectRoot: process.cwd(),
|
|
@@ -17713,7 +18027,7 @@ var DEFAULT_CONFIG10 = {
|
|
|
17713
18027
|
|
|
17714
18028
|
// ../../packages/core/src/firewall/agent-firewall.ts
|
|
17715
18029
|
init_logger();
|
|
17716
|
-
var
|
|
18030
|
+
var DEFAULT_CONFIG12 = {
|
|
17717
18031
|
mode: "enforce",
|
|
17718
18032
|
strictMode: true,
|
|
17719
18033
|
allowPartialMatches: false,
|
|
@@ -17748,9 +18062,11 @@ import { parse as parseISL2 } from "@isl-lang/parser";
|
|
|
17748
18062
|
|
|
17749
18063
|
// ../../packages/core/src/firewall/mission-service.ts
|
|
17750
18064
|
init_dist();
|
|
18065
|
+
init_logger();
|
|
18066
|
+
var logger2 = getLogger("firewall.mission-service");
|
|
17751
18067
|
|
|
17752
18068
|
// ../../packages/core/src/validation/hallucination-detector.ts
|
|
17753
|
-
var
|
|
18069
|
+
var DEFAULT_CONFIG13 = {
|
|
17754
18070
|
strictness: "medium",
|
|
17755
18071
|
truthpackPath: ".vibecheck/truthpack",
|
|
17756
18072
|
projectRoot: process.cwd()
|
|
@@ -17777,7 +18093,7 @@ import { glob as glob8 } from "glob";
|
|
|
17777
18093
|
|
|
17778
18094
|
// ../../packages/core/src/verification/verification-engine.ts
|
|
17779
18095
|
init_logger();
|
|
17780
|
-
var
|
|
18096
|
+
var DEFAULT_CONFIG14 = {
|
|
17781
18097
|
requiredSources: 2,
|
|
17782
18098
|
consensusThreshold: 0.7,
|
|
17783
18099
|
enabledSources: ["truthpack", "filesystem", "package_json", "ast"],
|
|
@@ -17794,7 +18110,7 @@ var DEFAULT_CONFIG13 = {
|
|
|
17794
18110
|
|
|
17795
18111
|
// ../../packages/core/src/validation/code-validator.ts
|
|
17796
18112
|
init_logger();
|
|
17797
|
-
var
|
|
18113
|
+
var DEFAULT_CONFIG15 = {
|
|
17798
18114
|
strictMode: true,
|
|
17799
18115
|
checkTypes: true,
|
|
17800
18116
|
checkStyle: true,
|
|
@@ -17817,7 +18133,7 @@ var SAFETY_LIMITS = {
|
|
|
17817
18133
|
SCAN_TIMEOUT_MS: 6e4
|
|
17818
18134
|
// 1 minute
|
|
17819
18135
|
};
|
|
17820
|
-
var
|
|
18136
|
+
var DEFAULT_CONFIG16 = {
|
|
17821
18137
|
truthpackPath: ".vibecheck/truthpack",
|
|
17822
18138
|
projectRoot: process.cwd(),
|
|
17823
18139
|
ignorePatterns: ["node_modules/**", "dist/**", "build/**", ".next/**", "*.test.ts", "*.spec.ts"],
|
|
@@ -17840,7 +18156,7 @@ var DEFAULT_CONFIG15 = {
|
|
|
17840
18156
|
// ../../packages/core/src/validation/ghost-detector.ts
|
|
17841
18157
|
import { glob as glob10 } from "glob";
|
|
17842
18158
|
init_logger();
|
|
17843
|
-
var
|
|
18159
|
+
var DEFAULT_CONFIG17 = {
|
|
17844
18160
|
projectRoot: process.cwd(),
|
|
17845
18161
|
truthpackPath: ".vibecheck/truthpack",
|
|
17846
18162
|
sourcePatterns: [
|
|
@@ -18665,7 +18981,9 @@ init_logger();
|
|
|
18665
18981
|
var taskTypeValidator = oneOf(["generate", "modify", "review", "explain"]);
|
|
18666
18982
|
|
|
18667
18983
|
// ../../packages/core/src/agents/skills-loader.ts
|
|
18984
|
+
init_logger();
|
|
18668
18985
|
import { glob as glob11 } from "glob";
|
|
18986
|
+
var logger3 = getLogger("agents.skills-loader");
|
|
18669
18987
|
|
|
18670
18988
|
// ../../packages/core/src/autofix/types.ts
|
|
18671
18989
|
var ISSUE_TYPES = [
|
|
@@ -19292,6 +19610,8 @@ var PatchGenerator = class {
|
|
|
19292
19610
|
};
|
|
19293
19611
|
|
|
19294
19612
|
// ../../packages/core/src/autofix/patch-applier.ts
|
|
19613
|
+
init_logger();
|
|
19614
|
+
var logger4 = getLogger("autofix.patch-applier");
|
|
19295
19615
|
var DEFAULT_APPLY_OPTIONS = Object.freeze({
|
|
19296
19616
|
dryRun: false,
|
|
19297
19617
|
createBackup: true,
|
|
@@ -19325,7 +19645,9 @@ var gzipAsync = promisify(gzip);
|
|
|
19325
19645
|
var gunzipAsync = promisify(gunzip);
|
|
19326
19646
|
|
|
19327
19647
|
// ../../packages/core/src/autofix/rollback-manager.ts
|
|
19328
|
-
|
|
19648
|
+
init_logger();
|
|
19649
|
+
var logger5 = getLogger("autofix.rollback-manager");
|
|
19650
|
+
var DEFAULT_CONFIG18 = Object.freeze({
|
|
19329
19651
|
enabled: true,
|
|
19330
19652
|
maxHistory: 50,
|
|
19331
19653
|
logPath: ".vibecheck/autofix-log.json",
|
|
@@ -19336,7 +19658,7 @@ var DEFAULT_CONFIG17 = Object.freeze({
|
|
|
19336
19658
|
var MAX_BACKUP_SIZE = 50 * 1024 * 1024;
|
|
19337
19659
|
|
|
19338
19660
|
// ../../packages/core/src/autofix/confidence-scorer.ts
|
|
19339
|
-
var
|
|
19661
|
+
var DEFAULT_CONFIG19 = Object.freeze({
|
|
19340
19662
|
autoApplyThreshold: 0.85,
|
|
19341
19663
|
suggestThreshold: 0.3,
|
|
19342
19664
|
allowCriticalAutoApply: false,
|
|
@@ -20494,7 +20816,7 @@ var AuthGapFixModule = class extends BaseFixModule {
|
|
|
20494
20816
|
if (!ast) {
|
|
20495
20817
|
return content;
|
|
20496
20818
|
}
|
|
20497
|
-
|
|
20819
|
+
const modified = content;
|
|
20498
20820
|
const lines = content.split("\n");
|
|
20499
20821
|
const indent = this.detectIndentation(content);
|
|
20500
20822
|
const hasAuthImport = content.includes("requireAuth");
|
|
@@ -22612,7 +22934,7 @@ var DEFAULT_APPLY_OPTIONS2 = Object.freeze({
|
|
|
22612
22934
|
// ../../packages/core/src/performance/incremental-engine.ts
|
|
22613
22935
|
import { glob as glob12 } from "glob";
|
|
22614
22936
|
init_logger();
|
|
22615
|
-
var
|
|
22937
|
+
var DEFAULT_CONFIG20 = {
|
|
22616
22938
|
statePath: ".vibecheck/incremental-state.json",
|
|
22617
22939
|
trackDependencies: true,
|
|
22618
22940
|
useGitDiff: true,
|
|
@@ -22621,8 +22943,16 @@ var DEFAULT_CONFIG19 = {
|
|
|
22621
22943
|
excludePatterns: ["node_modules/**", "dist/**", "build/**", ".next/**", "coverage/**"]
|
|
22622
22944
|
};
|
|
22623
22945
|
|
|
22946
|
+
// ../../packages/core/src/autofix/fix-chain-engine.ts
|
|
22947
|
+
init_logger();
|
|
22948
|
+
var logger6 = getLogger("autofix.chain-engine");
|
|
22949
|
+
|
|
22950
|
+
// ../../packages/core/src/ai/mcp-ai-bridge.ts
|
|
22951
|
+
init_logger();
|
|
22952
|
+
var logger7 = getLogger("ai.mcp-bridge");
|
|
22953
|
+
|
|
22624
22954
|
// ../../packages/core/src/hooks/post-save-hook.ts
|
|
22625
|
-
var
|
|
22955
|
+
var DEFAULT_CONFIG21 = {
|
|
22626
22956
|
projectRoot: process.cwd(),
|
|
22627
22957
|
truthpackPath: ".vibecheck/truthpack",
|
|
22628
22958
|
validateImports: true,
|
|
@@ -22634,7 +22964,7 @@ var DEFAULT_CONFIG20 = {
|
|
|
22634
22964
|
import { exec } from "child_process";
|
|
22635
22965
|
import { promisify as promisify2 } from "util";
|
|
22636
22966
|
var execAsync = promisify2(exec);
|
|
22637
|
-
var
|
|
22967
|
+
var DEFAULT_CONFIG22 = {
|
|
22638
22968
|
projectRoot: process.cwd(),
|
|
22639
22969
|
truthpackPath: ".vibecheck/truthpack",
|
|
22640
22970
|
checkHallucinations: true,
|
|
@@ -22645,7 +22975,7 @@ var DEFAULT_CONFIG21 = {
|
|
|
22645
22975
|
};
|
|
22646
22976
|
|
|
22647
22977
|
// ../../packages/core/src/hooks/dependency-check-hook.ts
|
|
22648
|
-
var
|
|
22978
|
+
var DEFAULT_CONFIG23 = {
|
|
22649
22979
|
projectRoot: process.cwd(),
|
|
22650
22980
|
checkUnused: true,
|
|
22651
22981
|
checkMissing: true,
|
|
@@ -22659,7 +22989,7 @@ var DEFAULT_CONFIG22 = {
|
|
|
22659
22989
|
|
|
22660
22990
|
// ../../packages/core/src/hooks/hooks-manager.ts
|
|
22661
22991
|
init_logger();
|
|
22662
|
-
var
|
|
22992
|
+
var DEFAULT_CONFIG24 = {
|
|
22663
22993
|
projectRoot: process.cwd(),
|
|
22664
22994
|
truthpackPath: ".vibecheck/truthpack",
|
|
22665
22995
|
enabled: {
|
|
@@ -22687,7 +23017,7 @@ init_commit_shield();
|
|
|
22687
23017
|
|
|
22688
23018
|
// ../../packages/core/src/tracing/audit-logger.ts
|
|
22689
23019
|
init_logger();
|
|
22690
|
-
var
|
|
23020
|
+
var DEFAULT_CONFIG25 = {
|
|
22691
23021
|
logDirectory: ".vibecheck/audit",
|
|
22692
23022
|
maxFileSize: 10 * 1024 * 1024,
|
|
22693
23023
|
// 10MB
|
|
@@ -24941,7 +25271,7 @@ var DEFAULT_INTELLIGENCE_CONFIG = {
|
|
|
24941
25271
|
// ../../packages/core/src/intelligence/project-learner.ts
|
|
24942
25272
|
import { glob as glob13 } from "glob";
|
|
24943
25273
|
init_logger();
|
|
24944
|
-
var
|
|
25274
|
+
var DEFAULT_CONFIG26 = {
|
|
24945
25275
|
dataPath: ".vibecheck/intelligence",
|
|
24946
25276
|
autoLearn: true,
|
|
24947
25277
|
minFeedbackForPattern: 3,
|
|
@@ -24953,7 +25283,7 @@ var DEFAULT_CONFIG25 = {
|
|
|
24953
25283
|
|
|
24954
25284
|
// ../../packages/core/src/intelligence/semantic-context.ts
|
|
24955
25285
|
init_logger();
|
|
24956
|
-
var
|
|
25286
|
+
var DEFAULT_CONFIG27 = {
|
|
24957
25287
|
cacheTtlMs: 5 * 60 * 1e3,
|
|
24958
25288
|
// 5 minutes
|
|
24959
25289
|
maxFileSize: 500 * 1024,
|
|
@@ -24967,7 +25297,7 @@ init_logger();
|
|
|
24967
25297
|
|
|
24968
25298
|
// ../../packages/core/src/intelligence/intelligence-engine.ts
|
|
24969
25299
|
init_logger();
|
|
24970
|
-
var
|
|
25300
|
+
var DEFAULT_CONFIG28 = {
|
|
24971
25301
|
dataPath: ".vibecheck/intelligence",
|
|
24972
25302
|
autoLearn: true,
|
|
24973
25303
|
minFeedbackForPattern: 3,
|
|
@@ -25027,7 +25357,7 @@ var DEFAULT_MULTI_CACHE_CONFIG = {
|
|
|
25027
25357
|
// ../../packages/core/src/performance/worker-pool.ts
|
|
25028
25358
|
init_logger();
|
|
25029
25359
|
import os6 from "os";
|
|
25030
|
-
var
|
|
25360
|
+
var DEFAULT_CONFIG29 = {
|
|
25031
25361
|
poolSize: Math.max(1, os6.cpus().length - 1),
|
|
25032
25362
|
maxQueueSize: 1e3,
|
|
25033
25363
|
taskTimeout: 3e4,
|
|
@@ -25044,7 +25374,7 @@ import { gzip as gzip2, gunzip as gunzip2 } from "zlib";
|
|
|
25044
25374
|
import { promisify as promisify7 } from "util";
|
|
25045
25375
|
var gzipAsync2 = promisify7(gzip2);
|
|
25046
25376
|
var gunzipAsync2 = promisify7(gunzip2);
|
|
25047
|
-
var
|
|
25377
|
+
var DEFAULT_CONFIG30 = {
|
|
25048
25378
|
memory: {
|
|
25049
25379
|
enabled: true,
|
|
25050
25380
|
maxSize: 100 * 1024 * 1024,
|
|
@@ -25068,7 +25398,7 @@ var DEFAULT_CONFIG29 = {
|
|
|
25068
25398
|
// ../../packages/core/src/performance/performance-scanner.ts
|
|
25069
25399
|
init_logger();
|
|
25070
25400
|
import os7 from "os";
|
|
25071
|
-
var
|
|
25401
|
+
var DEFAULT_CONFIG31 = {
|
|
25072
25402
|
incremental: true,
|
|
25073
25403
|
parallel: true,
|
|
25074
25404
|
workers: Math.max(1, os7.cpus().length - 1),
|
|
@@ -26074,7 +26404,7 @@ init_logger();
|
|
|
26074
26404
|
|
|
26075
26405
|
// ../../packages/core/src/engine/realtime-analyzer.ts
|
|
26076
26406
|
init_logger();
|
|
26077
|
-
var
|
|
26407
|
+
var DEFAULT_CONFIG32 = {
|
|
26078
26408
|
projectRoot: process.cwd(),
|
|
26079
26409
|
debounceMs: 150,
|
|
26080
26410
|
enableVerification: false,
|
|
@@ -26187,6 +26517,8 @@ var DEFAULT_OPTIONS2 = {
|
|
|
26187
26517
|
};
|
|
26188
26518
|
|
|
26189
26519
|
// ../../packages/core/src/plugins/sandbox.ts
|
|
26520
|
+
init_logger();
|
|
26521
|
+
var logger8 = getLogger("plugins.sandbox");
|
|
26190
26522
|
var DEFAULT_SANDBOX_OPTIONS = {
|
|
26191
26523
|
permissions: ["read-ast", "read-source", "report", "config"],
|
|
26192
26524
|
timeoutMs: 5e3,
|
|
@@ -26438,7 +26770,7 @@ var ShipScoreCalculator = class {
|
|
|
26438
26770
|
const authDrifts = input.driftResults.authDrifts;
|
|
26439
26771
|
authPercentage = authDrifts > 0 ? Math.max(0, 100 - authDrifts * 10) : 100;
|
|
26440
26772
|
}
|
|
26441
|
-
|
|
26773
|
+
const score = authPercentage / 100 * config.maxScore;
|
|
26442
26774
|
if (authPercentage < 100) {
|
|
26443
26775
|
const pointsLost = config.maxScore - score;
|
|
26444
26776
|
const uncoveredAuth = coverageReport ? coverageReport.summary.authCoverage.total - coverageReport.summary.authCoverage.covered : Math.ceil((100 - authPercentage) / 10);
|
|
@@ -26463,7 +26795,7 @@ var ShipScoreCalculator = class {
|
|
|
26463
26795
|
if (coverageReport) {
|
|
26464
26796
|
errorPercentage = coverageReport.summary.errorPathCoverage.percentage;
|
|
26465
26797
|
}
|
|
26466
|
-
|
|
26798
|
+
const score = errorPercentage / 100 * config.maxScore;
|
|
26467
26799
|
if (coverageReport && errorPercentage < 100) {
|
|
26468
26800
|
const uncoveredErrors = coverageReport.summary.errorPathCoverage.total - coverageReport.summary.errorPathCoverage.covered;
|
|
26469
26801
|
if (uncoveredErrors > 0) {
|
|
@@ -26493,7 +26825,7 @@ var ShipScoreCalculator = class {
|
|
|
26493
26825
|
} else if (input.driftResults) {
|
|
26494
26826
|
schemaPercentage = input.driftResults.contractDrifts > 0 ? Math.max(0, 100 - input.driftResults.contractDrifts * 15) : 100;
|
|
26495
26827
|
}
|
|
26496
|
-
|
|
26828
|
+
const score = schemaPercentage / 100 * config.maxScore;
|
|
26497
26829
|
if (schemaPercentage < 100) {
|
|
26498
26830
|
const pointsLost = config.maxScore - score;
|
|
26499
26831
|
if (pointsLost > 1) {
|
|
@@ -37708,8 +38040,8 @@ function registerLintISL(program3) {
|
|
|
37708
38040
|
const source = fs74.readFileSync(file3, "utf-8");
|
|
37709
38041
|
const relPath = path84.relative(process.cwd(), file3);
|
|
37710
38042
|
const lintResult = lintISL2(source, relPath);
|
|
37711
|
-
|
|
37712
|
-
|
|
38043
|
+
const errs = [...lintResult.errors];
|
|
38044
|
+
const warns = [...lintResult.warnings];
|
|
37713
38045
|
if (externalParse) {
|
|
37714
38046
|
try {
|
|
37715
38047
|
const parseResult = externalParse(source, file3);
|
|
@@ -39011,7 +39343,7 @@ async function heal(findings, opts) {
|
|
|
39011
39343
|
const skipped = [];
|
|
39012
39344
|
const filesModified = [];
|
|
39013
39345
|
const filesRolledBack = [];
|
|
39014
|
-
|
|
39346
|
+
const regressions = [];
|
|
39015
39347
|
const gradeBefore = computeGrade(findings);
|
|
39016
39348
|
const fileCache = /* @__PURE__ */ new Map();
|
|
39017
39349
|
const backups = /* @__PURE__ */ new Map();
|
|
@@ -42714,7 +43046,7 @@ ${icons.success} ${colors.info(name)} \u2014 defined in:`);
|
|
|
42714
43046
|
|
|
42715
43047
|
// src/v2/cli.ts
|
|
42716
43048
|
function getVersion() {
|
|
42717
|
-
if ("
|
|
43049
|
+
if ("18.5.0") return "18.5.0";
|
|
42718
43050
|
try {
|
|
42719
43051
|
const pkgPath = path79.resolve(__dirname, "..", "package.json");
|
|
42720
43052
|
if (fs70.existsSync(pkgPath)) {
|
|
@@ -43704,145 +44036,13 @@ function renderContextualTip(tip) {
|
|
|
43704
44036
|
console.log(chalk2.dim(" Tip: ") + chalk2.dim(tip.message));
|
|
43705
44037
|
}
|
|
43706
44038
|
|
|
43707
|
-
// src/lib/analytics.ts
|
|
43708
|
-
import * as fs73 from "fs";
|
|
43709
|
-
import * as path82 from "path";
|
|
43710
|
-
import * as os13 from "os";
|
|
43711
|
-
import * as crypto18 from "crypto";
|
|
43712
|
-
var _posthog = null;
|
|
43713
|
-
var _distinctId = "";
|
|
43714
|
-
var _enabled = null;
|
|
43715
|
-
var _version = "0.0.0";
|
|
43716
|
-
var _sessionId = "";
|
|
43717
|
-
var ANALYTICS_ID_FILE = path82.join(os13.homedir(), ".vibecheck", "analytics-id");
|
|
43718
|
-
function isEnabled() {
|
|
43719
|
-
if (_enabled !== null) return _enabled;
|
|
43720
|
-
if (process.env.VIBECHECK_TELEMETRY === "false" || process.env.VIBECHECK_TELEMETRY === "0") {
|
|
43721
|
-
_enabled = false;
|
|
43722
|
-
return false;
|
|
43723
|
-
}
|
|
43724
|
-
if (process.env.DO_NOT_TRACK === "1") {
|
|
43725
|
-
_enabled = false;
|
|
43726
|
-
return false;
|
|
43727
|
-
}
|
|
43728
|
-
if (process.env.CI && process.env.VIBECHECK_TELEMETRY !== "true") {
|
|
43729
|
-
_enabled = false;
|
|
43730
|
-
return false;
|
|
43731
|
-
}
|
|
43732
|
-
const key = process.env.POSTHOG_API_KEY;
|
|
43733
|
-
if (!key) {
|
|
43734
|
-
_enabled = false;
|
|
43735
|
-
return false;
|
|
43736
|
-
}
|
|
43737
|
-
_enabled = true;
|
|
43738
|
-
return true;
|
|
43739
|
-
}
|
|
43740
|
-
function getOrCreateDistinctId() {
|
|
43741
|
-
if (_distinctId) return _distinctId;
|
|
43742
|
-
try {
|
|
43743
|
-
if (fs73.existsSync(ANALYTICS_ID_FILE)) {
|
|
43744
|
-
_distinctId = fs73.readFileSync(ANALYTICS_ID_FILE, "utf-8").trim();
|
|
43745
|
-
if (_distinctId) return _distinctId;
|
|
43746
|
-
}
|
|
43747
|
-
} catch {
|
|
43748
|
-
}
|
|
43749
|
-
_distinctId = `cli_${crypto18.randomUUID()}`;
|
|
43750
|
-
try {
|
|
43751
|
-
const dir = path82.dirname(ANALYTICS_ID_FILE);
|
|
43752
|
-
if (!fs73.existsSync(dir)) {
|
|
43753
|
-
fs73.mkdirSync(dir, { recursive: true });
|
|
43754
|
-
}
|
|
43755
|
-
fs73.writeFileSync(ANALYTICS_ID_FILE, _distinctId, "utf-8");
|
|
43756
|
-
} catch {
|
|
43757
|
-
}
|
|
43758
|
-
return _distinctId;
|
|
43759
|
-
}
|
|
43760
|
-
async function getClient() {
|
|
43761
|
-
if (!isEnabled()) return null;
|
|
43762
|
-
if (_posthog) return _posthog;
|
|
43763
|
-
try {
|
|
43764
|
-
const { PostHog } = await import("posthog-node");
|
|
43765
|
-
const apiKey = process.env.POSTHOG_API_KEY;
|
|
43766
|
-
const host = process.env.POSTHOG_HOST || "https://us.i.posthog.com";
|
|
43767
|
-
_posthog = new PostHog(apiKey, {
|
|
43768
|
-
host,
|
|
43769
|
-
flushAt: 10,
|
|
43770
|
-
flushInterval: 1e4,
|
|
43771
|
-
// CLI is short-lived — flush fast
|
|
43772
|
-
requestTimeout: 5e3
|
|
43773
|
-
});
|
|
43774
|
-
_sessionId = `sess_${Date.now()}_${crypto18.randomBytes(4).toString("hex")}`;
|
|
43775
|
-
return _posthog;
|
|
43776
|
-
} catch {
|
|
43777
|
-
_enabled = false;
|
|
43778
|
-
return null;
|
|
43779
|
-
}
|
|
43780
|
-
}
|
|
43781
|
-
function setCliVersion(version) {
|
|
43782
|
-
_version = version;
|
|
43783
|
-
}
|
|
43784
|
-
async function capture(event, properties) {
|
|
43785
|
-
const client = await getClient();
|
|
43786
|
-
if (!client) return;
|
|
43787
|
-
client.capture({
|
|
43788
|
-
distinctId: getOrCreateDistinctId(),
|
|
43789
|
-
event,
|
|
43790
|
-
properties: {
|
|
43791
|
-
...getSuperProperties(),
|
|
43792
|
-
...properties
|
|
43793
|
-
}
|
|
43794
|
-
});
|
|
43795
|
-
}
|
|
43796
|
-
async function trackCommand(command, properties) {
|
|
43797
|
-
await capture("cli_command_executed", {
|
|
43798
|
-
command,
|
|
43799
|
-
...properties
|
|
43800
|
-
});
|
|
43801
|
-
}
|
|
43802
|
-
async function captureException(error2, additionalProperties) {
|
|
43803
|
-
const client = await getClient();
|
|
43804
|
-
if (!client) return;
|
|
43805
|
-
const err = error2 instanceof Error ? error2 : new Error(String(error2));
|
|
43806
|
-
client.capture({
|
|
43807
|
-
distinctId: getOrCreateDistinctId(),
|
|
43808
|
-
event: "$exception",
|
|
43809
|
-
properties: {
|
|
43810
|
-
...getSuperProperties(),
|
|
43811
|
-
$exception_type: err.name || "Error",
|
|
43812
|
-
$exception_message: err.message?.slice(0, 1e3) || "Unknown error",
|
|
43813
|
-
$exception_stack_trace_raw: err.stack?.slice(0, 4e3) || "",
|
|
43814
|
-
$exception_source: "cli",
|
|
43815
|
-
...additionalProperties
|
|
43816
|
-
}
|
|
43817
|
-
});
|
|
43818
|
-
}
|
|
43819
|
-
async function shutdown() {
|
|
43820
|
-
if (_posthog) {
|
|
43821
|
-
await _posthog.shutdown().catch(() => {
|
|
43822
|
-
});
|
|
43823
|
-
_posthog = null;
|
|
43824
|
-
}
|
|
43825
|
-
}
|
|
43826
|
-
function getSuperProperties() {
|
|
43827
|
-
return {
|
|
43828
|
-
cli_version: _version,
|
|
43829
|
-
platform: process.platform,
|
|
43830
|
-
arch: process.arch,
|
|
43831
|
-
node_version: process.version,
|
|
43832
|
-
session_id: _sessionId,
|
|
43833
|
-
is_ci: !!process.env.CI,
|
|
43834
|
-
ci_provider: process.env.VIBECHECK_CI_PROVIDER || process.env.CI_NAME || "none",
|
|
43835
|
-
is_tty: !!process.stdout.isTTY,
|
|
43836
|
-
source: "cli"
|
|
43837
|
-
};
|
|
43838
|
-
}
|
|
43839
|
-
|
|
43840
44039
|
// src/v2/index.ts
|
|
44040
|
+
init_analytics();
|
|
43841
44041
|
if (process.env.SENTRY_DSN && process.env.VIBECHECK_TELEMETRY !== "false") {
|
|
43842
44042
|
Sentry.init({
|
|
43843
44043
|
dsn: process.env.SENTRY_DSN,
|
|
43844
44044
|
environment: process.env.NODE_ENV ?? "production",
|
|
43845
|
-
release: `vibecheck-cli@${"
|
|
44045
|
+
release: `vibecheck-cli@${"18.5.0"}`,
|
|
43846
44046
|
// CLI is short-lived — send all errors, sample traces lightly
|
|
43847
44047
|
tracesSampleRate: 0.05,
|
|
43848
44048
|
// Don't send PII from user machines
|
|
@@ -43855,7 +44055,7 @@ if (process.env.SENTRY_DSN && process.env.VIBECHECK_TELEMETRY !== "false") {
|
|
|
43855
44055
|
}
|
|
43856
44056
|
var SCAN_COMMANDS = /* @__PURE__ */ new Set(["scan", "ship", "audit", "check", "validate", "certify", "doctor"]);
|
|
43857
44057
|
function getVersion2() {
|
|
43858
|
-
if ("
|
|
44058
|
+
if ("18.5.0") return "18.5.0";
|
|
43859
44059
|
try {
|
|
43860
44060
|
const fs74 = __require("fs");
|
|
43861
44061
|
const pkgPath = path83.resolve(__dirname, "..", "package.json");
|