@probelabs/visor 0.1.100 → 0.1.102
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/debug-visualizer/debug-span-exporter.d.ts +5 -3
- package/dist/debug-visualizer/debug-span-exporter.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +11 -0
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +11 -0
- package/dist/index.js +48587 -193583
- package/dist/sdk/{check-execution-engine-F3662LY7.mjs → check-execution-engine-6QJXYYON.mjs} +3 -3
- package/dist/sdk/{chunk-FVS5CJ5S.mjs → chunk-33QVZ2D4.mjs} +117 -4
- package/dist/sdk/chunk-33QVZ2D4.mjs.map +1 -0
- package/dist/sdk/{chunk-X2JKUOE5.mjs → chunk-O4RP4BRH.mjs} +144 -146
- package/dist/sdk/chunk-O4RP4BRH.mjs.map +1 -0
- package/dist/sdk/{mermaid-telemetry-FBF6D35S.mjs → mermaid-telemetry-YCTIG76M.mjs} +2 -2
- package/dist/sdk/sdk.d.mts +4 -0
- package/dist/sdk/sdk.d.ts +4 -0
- package/dist/sdk/sdk.js +282 -154
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +13 -2
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/telemetry/file-span-exporter.d.ts +4 -3
- package/dist/telemetry/file-span-exporter.d.ts.map +1 -1
- package/dist/telemetry/lazy-otel.d.ts +48 -0
- package/dist/telemetry/lazy-otel.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/telemetry/state-capture.d.ts +1 -1
- package/dist/telemetry/state-capture.d.ts.map +1 -1
- package/dist/telemetry/trace-helpers.d.ts +2 -2
- package/dist/telemetry/trace-helpers.d.ts.map +1 -1
- package/dist/telemetry/trace-report-exporter.d.ts +4 -3
- package/dist/telemetry/trace-report-exporter.d.ts.map +1 -1
- package/dist/types/config.d.ts +4 -0
- package/dist/types/config.d.ts.map +1 -1
- package/package.json +15 -13
- package/dist/136.index.js +0 -82
- package/dist/146.index.js +0 -82
- package/dist/159.index.js +0 -38
- package/dist/160.index.js +0 -82
- package/dist/179.index.js +0 -48
- package/dist/191.index.js +0 -82
- package/dist/201.index.js +0 -82
- package/dist/262.index.js +0 -48
- package/dist/273.index.js +0 -48
- package/dist/34.index.js +0 -81
- package/dist/384.index.js +0 -38
- package/dist/405.index.js +0 -48
- package/dist/42.index.js +0 -38
- package/dist/437.index.js +0 -82
- package/dist/441.index.js +0 -81
- package/dist/448.index.js +0 -48
- package/dist/450.index.js +0 -82
- package/dist/491.index.js +0 -81
- package/dist/558.index.js +0 -82
- package/dist/69.index.js +0 -38
- package/dist/715.index.js +0 -38
- package/dist/737.index.js +0 -82
- package/dist/760.index.js +0 -81
- package/dist/834.index.js +0 -48
- package/dist/886.index.js +0 -81
- package/dist/917.index.js +0 -82
- package/dist/940.index.js +0 -38
- package/dist/955.index.js +0 -82
- package/dist/989.index.js +0 -81
- package/dist/996.index.js +0 -82
- package/dist/proto/channelz.proto +0 -564
- package/dist/proto/protoc-gen-validate/LICENSE +0 -202
- package/dist/proto/protoc-gen-validate/validate/validate.proto +0 -797
- package/dist/proto/xds/LICENSE +0 -201
- package/dist/proto/xds/xds/data/orca/v3/orca_load_report.proto +0 -58
- package/dist/proto/xds/xds/service/orca/v3/orca.proto +0 -36
- package/dist/protoc-gen-validate/LICENSE +0 -202
- package/dist/protoc-gen-validate/validate/validate.proto +0 -797
- package/dist/sdk/chunk-FVS5CJ5S.mjs.map +0 -1
- package/dist/sdk/chunk-X2JKUOE5.mjs.map +0 -1
- package/dist/xds/LICENSE +0 -201
- package/dist/xds/xds/data/orca/v3/orca_load_report.proto +0 -58
- package/dist/xds/xds/service/orca/v3/orca.proto +0 -36
- /package/dist/output/traces/{run-2025-10-22T10-40-34-055Z.ndjson → run-2025-10-22T13-28-22-633Z.ndjson} +0 -0
- /package/dist/sdk/{check-execution-engine-F3662LY7.mjs.map → check-execution-engine-6QJXYYON.mjs.map} +0 -0
- /package/dist/sdk/{mermaid-telemetry-FBF6D35S.mjs.map → mermaid-telemetry-YCTIG76M.mjs.map} +0 -0
- /package/dist/traces/{run-2025-10-22T10-40-34-055Z.ndjson → run-2025-10-22T13-28-22-633Z.ndjson} +0 -0
package/dist/sdk/sdk.js
CHANGED
|
@@ -1151,7 +1151,7 @@ ${prContext}
|
|
|
1151
1151
|
log("\u{1F50D} Including code diffs in AI context");
|
|
1152
1152
|
}
|
|
1153
1153
|
if (isIssue) {
|
|
1154
|
-
let
|
|
1154
|
+
let context3 = `<issue>
|
|
1155
1155
|
<!-- Core issue metadata including identification, status, and timeline information -->
|
|
1156
1156
|
<metadata>
|
|
1157
1157
|
<number>${prInfo.number}</number>
|
|
@@ -1163,7 +1163,7 @@ ${prContext}
|
|
|
1163
1163
|
<comments_count>${prInfo.eventContext?.issue?.comments || 0}</comments_count>
|
|
1164
1164
|
</metadata>`;
|
|
1165
1165
|
if (prInfo.body) {
|
|
1166
|
-
|
|
1166
|
+
context3 += `
|
|
1167
1167
|
<!-- Full issue description and body text provided by the issue author -->
|
|
1168
1168
|
<description>
|
|
1169
1169
|
${this.escapeXml(prInfo.body)}
|
|
@@ -1172,33 +1172,33 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1172
1172
|
const eventContext = prInfo;
|
|
1173
1173
|
const labels = eventContext.eventContext?.issue?.labels;
|
|
1174
1174
|
if (labels && labels.length > 0) {
|
|
1175
|
-
|
|
1175
|
+
context3 += `
|
|
1176
1176
|
<!-- Applied labels for issue categorization and organization -->
|
|
1177
1177
|
<labels>`;
|
|
1178
1178
|
labels.forEach((label) => {
|
|
1179
1179
|
const labelName = typeof label === "string" ? label : label.name || "unknown";
|
|
1180
|
-
|
|
1180
|
+
context3 += `
|
|
1181
1181
|
<label>${this.escapeXml(labelName)}</label>`;
|
|
1182
1182
|
});
|
|
1183
|
-
|
|
1183
|
+
context3 += `
|
|
1184
1184
|
</labels>`;
|
|
1185
1185
|
}
|
|
1186
1186
|
const assignees = prInfo.eventContext?.issue?.assignees;
|
|
1187
1187
|
if (assignees && assignees.length > 0) {
|
|
1188
|
-
|
|
1188
|
+
context3 += `
|
|
1189
1189
|
<!-- Users assigned to work on this issue -->
|
|
1190
1190
|
<assignees>`;
|
|
1191
1191
|
assignees.forEach((assignee) => {
|
|
1192
1192
|
const assigneeName = typeof assignee === "string" ? assignee : assignee.login || "unknown";
|
|
1193
|
-
|
|
1193
|
+
context3 += `
|
|
1194
1194
|
<assignee>${this.escapeXml(assigneeName)}</assignee>`;
|
|
1195
1195
|
});
|
|
1196
|
-
|
|
1196
|
+
context3 += `
|
|
1197
1197
|
</assignees>`;
|
|
1198
1198
|
}
|
|
1199
1199
|
const milestone = prInfo.eventContext?.issue?.milestone;
|
|
1200
1200
|
if (milestone) {
|
|
1201
|
-
|
|
1201
|
+
context3 += `
|
|
1202
1202
|
<!-- Associated project milestone information -->
|
|
1203
1203
|
<milestone>
|
|
1204
1204
|
<title>${this.escapeXml(milestone.title || "")}</title>
|
|
@@ -1208,7 +1208,7 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1208
1208
|
}
|
|
1209
1209
|
const triggeringComment2 = prInfo.eventContext?.comment;
|
|
1210
1210
|
if (triggeringComment2) {
|
|
1211
|
-
|
|
1211
|
+
context3 += `
|
|
1212
1212
|
<!-- The comment that triggered this analysis -->
|
|
1213
1213
|
<triggering_comment>
|
|
1214
1214
|
<author>${this.escapeXml(triggeringComment2.user?.login || "unknown")}</author>
|
|
@@ -1225,26 +1225,26 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1225
1225
|
);
|
|
1226
1226
|
}
|
|
1227
1227
|
if (historicalComments.length > 0) {
|
|
1228
|
-
|
|
1228
|
+
context3 += `
|
|
1229
1229
|
<!-- Previous comments in chronological order (excluding triggering comment) -->
|
|
1230
1230
|
<comment_history>`;
|
|
1231
1231
|
historicalComments.forEach((comment) => {
|
|
1232
|
-
|
|
1232
|
+
context3 += `
|
|
1233
1233
|
<comment>
|
|
1234
1234
|
<author>${this.escapeXml(comment.author || "unknown")}</author>
|
|
1235
1235
|
<created_at>${comment.createdAt || ""}</created_at>
|
|
1236
1236
|
<body>${this.escapeXml(comment.body || "")}</body>
|
|
1237
1237
|
</comment>`;
|
|
1238
1238
|
});
|
|
1239
|
-
|
|
1239
|
+
context3 += `
|
|
1240
1240
|
</comment_history>`;
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
|
-
|
|
1243
|
+
context3 += `
|
|
1244
1244
|
</issue>`;
|
|
1245
|
-
return
|
|
1245
|
+
return context3;
|
|
1246
1246
|
}
|
|
1247
|
-
let
|
|
1247
|
+
let context2 = `<pull_request>
|
|
1248
1248
|
<!-- Core pull request metadata including identification, branches, and change statistics -->
|
|
1249
1249
|
<metadata>
|
|
1250
1250
|
<number>${prInfo.number}</number>
|
|
@@ -1257,7 +1257,7 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1257
1257
|
<files_changed_count>${prInfo.files.length}</files_changed_count>
|
|
1258
1258
|
</metadata>`;
|
|
1259
1259
|
if (prInfo.body) {
|
|
1260
|
-
|
|
1260
|
+
context2 += `
|
|
1261
1261
|
<!-- Full pull request description provided by the author -->
|
|
1262
1262
|
<description>
|
|
1263
1263
|
${this.escapeXml(prInfo.body)}
|
|
@@ -1266,7 +1266,7 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1266
1266
|
if (includeCodeContext) {
|
|
1267
1267
|
if (prInfo.fullDiff) {
|
|
1268
1268
|
const processedFullDiff = await processDiffWithOutline(prInfo.fullDiff);
|
|
1269
|
-
|
|
1269
|
+
context2 += `
|
|
1270
1270
|
<!-- Complete unified diff showing all changes in the pull request (processed with outline-diff) -->
|
|
1271
1271
|
<full_diff>
|
|
1272
1272
|
${this.escapeXml(processedFullDiff)}
|
|
@@ -1275,14 +1275,14 @@ ${this.escapeXml(processedFullDiff)}
|
|
|
1275
1275
|
if (prInfo.isIncremental) {
|
|
1276
1276
|
if (prInfo.commitDiff && prInfo.commitDiff.length > 0) {
|
|
1277
1277
|
const processedCommitDiff = await processDiffWithOutline(prInfo.commitDiff);
|
|
1278
|
-
|
|
1278
|
+
context2 += `
|
|
1279
1279
|
<!-- Diff of only the latest commit for incremental analysis (processed with outline-diff) -->
|
|
1280
1280
|
<commit_diff>
|
|
1281
1281
|
${this.escapeXml(processedCommitDiff)}
|
|
1282
1282
|
</commit_diff>`;
|
|
1283
1283
|
} else {
|
|
1284
1284
|
const processedFallbackDiff = prInfo.fullDiff ? await processDiffWithOutline(prInfo.fullDiff) : "";
|
|
1285
|
-
|
|
1285
|
+
context2 += `
|
|
1286
1286
|
<!-- Commit diff could not be retrieved - falling back to full diff analysis (processed with outline-diff) -->
|
|
1287
1287
|
<commit_diff>
|
|
1288
1288
|
${this.escapeXml(processedFallbackDiff)}
|
|
@@ -1290,15 +1290,15 @@ ${this.escapeXml(processedFallbackDiff)}
|
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
1292
|
} else {
|
|
1293
|
-
|
|
1293
|
+
context2 += `
|
|
1294
1294
|
<!-- Code diffs excluded to reduce token usage (no code-review schema detected or disabled by flag) -->`;
|
|
1295
1295
|
}
|
|
1296
1296
|
if (prInfo.files.length > 0) {
|
|
1297
|
-
|
|
1297
|
+
context2 += `
|
|
1298
1298
|
<!-- Summary of all files changed with statistics -->
|
|
1299
1299
|
<files_summary>`;
|
|
1300
1300
|
prInfo.files.forEach((file) => {
|
|
1301
|
-
|
|
1301
|
+
context2 += `
|
|
1302
1302
|
<file>
|
|
1303
1303
|
<filename>${this.escapeXml(file.filename)}</filename>
|
|
1304
1304
|
<status>${file.status}</status>
|
|
@@ -1306,12 +1306,12 @@ ${this.escapeXml(processedFallbackDiff)}
|
|
|
1306
1306
|
<deletions>${file.deletions}</deletions>
|
|
1307
1307
|
</file>`;
|
|
1308
1308
|
});
|
|
1309
|
-
|
|
1309
|
+
context2 += `
|
|
1310
1310
|
</files_summary>`;
|
|
1311
1311
|
}
|
|
1312
1312
|
const triggeringComment = prInfo.eventContext?.comment;
|
|
1313
1313
|
if (triggeringComment) {
|
|
1314
|
-
|
|
1314
|
+
context2 += `
|
|
1315
1315
|
<!-- The comment that triggered this analysis -->
|
|
1316
1316
|
<triggering_comment>
|
|
1317
1317
|
<author>${this.escapeXml(triggeringComment.user?.login || "unknown")}</author>
|
|
@@ -1328,24 +1328,24 @@ ${this.escapeXml(processedFallbackDiff)}
|
|
|
1328
1328
|
);
|
|
1329
1329
|
}
|
|
1330
1330
|
if (historicalComments.length > 0) {
|
|
1331
|
-
|
|
1331
|
+
context2 += `
|
|
1332
1332
|
<!-- Previous PR comments in chronological order (excluding triggering comment) -->
|
|
1333
1333
|
<comment_history>`;
|
|
1334
1334
|
historicalComments.forEach((comment) => {
|
|
1335
|
-
|
|
1335
|
+
context2 += `
|
|
1336
1336
|
<comment>
|
|
1337
1337
|
<author>${this.escapeXml(comment.author || "unknown")}</author>
|
|
1338
1338
|
<created_at>${comment.createdAt || ""}</created_at>
|
|
1339
1339
|
<body>${this.escapeXml(comment.body || "")}</body>
|
|
1340
1340
|
</comment>`;
|
|
1341
1341
|
});
|
|
1342
|
-
|
|
1342
|
+
context2 += `
|
|
1343
1343
|
</comment_history>`;
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
|
-
|
|
1346
|
+
context2 += `
|
|
1347
1347
|
</pull_request>`;
|
|
1348
|
-
return
|
|
1348
|
+
return context2;
|
|
1349
1349
|
}
|
|
1350
1350
|
/**
|
|
1351
1351
|
* No longer escaping XML - returning text as-is
|
|
@@ -4248,6 +4248,124 @@ var init_liquid_extensions = __esm({
|
|
|
4248
4248
|
}
|
|
4249
4249
|
});
|
|
4250
4250
|
|
|
4251
|
+
// src/telemetry/lazy-otel.ts
|
|
4252
|
+
function getOtelApi() {
|
|
4253
|
+
if (otelApiAttempted) return otelApi;
|
|
4254
|
+
otelApiAttempted = true;
|
|
4255
|
+
try {
|
|
4256
|
+
otelApi = (function(name) {
|
|
4257
|
+
return require(name);
|
|
4258
|
+
})(OTEL_API_MODULE);
|
|
4259
|
+
} catch {
|
|
4260
|
+
otelApi = null;
|
|
4261
|
+
}
|
|
4262
|
+
return otelApi;
|
|
4263
|
+
}
|
|
4264
|
+
function createNoOpTracer() {
|
|
4265
|
+
return {
|
|
4266
|
+
startSpan: () => createNoOpSpan(),
|
|
4267
|
+
startActiveSpan: (name, fn) => {
|
|
4268
|
+
if (typeof fn === "function") return fn(createNoOpSpan());
|
|
4269
|
+
return createNoOpSpan();
|
|
4270
|
+
}
|
|
4271
|
+
};
|
|
4272
|
+
}
|
|
4273
|
+
function createNoOpSpan() {
|
|
4274
|
+
return {
|
|
4275
|
+
spanContext: () => ({ traceId: "", spanId: "", traceFlags: 0 }),
|
|
4276
|
+
setAttribute: () => {
|
|
4277
|
+
},
|
|
4278
|
+
setAttributes: () => {
|
|
4279
|
+
},
|
|
4280
|
+
addEvent: () => {
|
|
4281
|
+
},
|
|
4282
|
+
setStatus: () => {
|
|
4283
|
+
},
|
|
4284
|
+
updateName: () => {
|
|
4285
|
+
},
|
|
4286
|
+
end: () => {
|
|
4287
|
+
},
|
|
4288
|
+
isRecording: () => false,
|
|
4289
|
+
recordException: () => {
|
|
4290
|
+
}
|
|
4291
|
+
};
|
|
4292
|
+
}
|
|
4293
|
+
function createNoOpMeter() {
|
|
4294
|
+
return {
|
|
4295
|
+
createCounter: () => ({ add: () => {
|
|
4296
|
+
} }),
|
|
4297
|
+
createHistogram: () => ({ record: () => {
|
|
4298
|
+
} }),
|
|
4299
|
+
createUpDownCounter: () => ({ add: () => {
|
|
4300
|
+
} }),
|
|
4301
|
+
createObservableGauge: () => {
|
|
4302
|
+
},
|
|
4303
|
+
createObservableCounter: () => {
|
|
4304
|
+
},
|
|
4305
|
+
createObservableUpDownCounter: () => {
|
|
4306
|
+
}
|
|
4307
|
+
};
|
|
4308
|
+
}
|
|
4309
|
+
var otelApi, otelApiAttempted, OTEL_API_MODULE, trace, context, metrics, SpanStatusCode;
|
|
4310
|
+
var init_lazy_otel = __esm({
|
|
4311
|
+
"src/telemetry/lazy-otel.ts"() {
|
|
4312
|
+
"use strict";
|
|
4313
|
+
otelApi = null;
|
|
4314
|
+
otelApiAttempted = false;
|
|
4315
|
+
OTEL_API_MODULE = "@opentelemetry/api";
|
|
4316
|
+
trace = {
|
|
4317
|
+
getTracer(name, version) {
|
|
4318
|
+
const api = getOtelApi();
|
|
4319
|
+
if (!api) return createNoOpTracer();
|
|
4320
|
+
return api.trace.getTracer(name, version);
|
|
4321
|
+
},
|
|
4322
|
+
getSpan(context2) {
|
|
4323
|
+
const api = getOtelApi();
|
|
4324
|
+
if (!api) return void 0;
|
|
4325
|
+
return api.trace.getSpan(context2);
|
|
4326
|
+
},
|
|
4327
|
+
getActiveSpan() {
|
|
4328
|
+
const api = getOtelApi();
|
|
4329
|
+
if (!api) return void 0;
|
|
4330
|
+
return api.trace.getActiveSpan();
|
|
4331
|
+
}
|
|
4332
|
+
};
|
|
4333
|
+
context = {
|
|
4334
|
+
active() {
|
|
4335
|
+
const api = getOtelApi();
|
|
4336
|
+
if (!api) return {};
|
|
4337
|
+
return api.context.active();
|
|
4338
|
+
},
|
|
4339
|
+
with(context2, fn, thisArg, ...args) {
|
|
4340
|
+
const api = getOtelApi();
|
|
4341
|
+
if (!api) return fn.call(thisArg, ...args);
|
|
4342
|
+
return api.context.with(context2, fn, thisArg, ...args);
|
|
4343
|
+
}
|
|
4344
|
+
};
|
|
4345
|
+
metrics = {
|
|
4346
|
+
getMeter(name, version) {
|
|
4347
|
+
const api = getOtelApi();
|
|
4348
|
+
if (!api?.metrics) return createNoOpMeter();
|
|
4349
|
+
return api.metrics.getMeter(name, version);
|
|
4350
|
+
}
|
|
4351
|
+
};
|
|
4352
|
+
SpanStatusCode = {
|
|
4353
|
+
get UNSET() {
|
|
4354
|
+
const api = getOtelApi();
|
|
4355
|
+
return api?.SpanStatusCode?.UNSET ?? 0;
|
|
4356
|
+
},
|
|
4357
|
+
get OK() {
|
|
4358
|
+
const api = getOtelApi();
|
|
4359
|
+
return api?.SpanStatusCode?.OK ?? 1;
|
|
4360
|
+
},
|
|
4361
|
+
get ERROR() {
|
|
4362
|
+
const api = getOtelApi();
|
|
4363
|
+
return api?.SpanStatusCode?.ERROR ?? 2;
|
|
4364
|
+
}
|
|
4365
|
+
};
|
|
4366
|
+
}
|
|
4367
|
+
});
|
|
4368
|
+
|
|
4251
4369
|
// src/telemetry/state-capture.ts
|
|
4252
4370
|
function safeSerialize(value, maxLength = MAX_ATTRIBUTE_LENGTH) {
|
|
4253
4371
|
try {
|
|
@@ -4271,20 +4389,20 @@ function safeSerialize(value, maxLength = MAX_ATTRIBUTE_LENGTH) {
|
|
|
4271
4389
|
return `[Error serializing: ${err instanceof Error ? err.message : String(err)}]`;
|
|
4272
4390
|
}
|
|
4273
4391
|
}
|
|
4274
|
-
function captureCheckInputContext(span,
|
|
4392
|
+
function captureCheckInputContext(span, context2) {
|
|
4275
4393
|
try {
|
|
4276
|
-
const keys = Object.keys(
|
|
4394
|
+
const keys = Object.keys(context2);
|
|
4277
4395
|
span.setAttribute("visor.check.input.keys", keys.join(","));
|
|
4278
4396
|
span.setAttribute("visor.check.input.count", keys.length);
|
|
4279
|
-
span.setAttribute("visor.check.input.context", safeSerialize(
|
|
4280
|
-
if (
|
|
4281
|
-
span.setAttribute("visor.check.input.pr", safeSerialize(
|
|
4397
|
+
span.setAttribute("visor.check.input.context", safeSerialize(context2));
|
|
4398
|
+
if (context2.pr) {
|
|
4399
|
+
span.setAttribute("visor.check.input.pr", safeSerialize(context2.pr, 1e3));
|
|
4282
4400
|
}
|
|
4283
|
-
if (
|
|
4284
|
-
span.setAttribute("visor.check.input.outputs", safeSerialize(
|
|
4401
|
+
if (context2.outputs) {
|
|
4402
|
+
span.setAttribute("visor.check.input.outputs", safeSerialize(context2.outputs, 5e3));
|
|
4285
4403
|
}
|
|
4286
|
-
if (
|
|
4287
|
-
span.setAttribute("visor.check.input.env_keys", Object.keys(
|
|
4404
|
+
if (context2.env) {
|
|
4405
|
+
span.setAttribute("visor.check.input.env_keys", Object.keys(context2.env).join(","));
|
|
4288
4406
|
}
|
|
4289
4407
|
} catch (err) {
|
|
4290
4408
|
try {
|
|
@@ -4450,7 +4568,7 @@ var init_fallback_ndjson = __esm({
|
|
|
4450
4568
|
});
|
|
4451
4569
|
|
|
4452
4570
|
// src/providers/ai-check-provider.ts
|
|
4453
|
-
var import_promises3, import_path3,
|
|
4571
|
+
var import_promises3, import_path3, AICheckProvider;
|
|
4454
4572
|
var init_ai_check_provider = __esm({
|
|
4455
4573
|
"src/providers/ai-check-provider.ts"() {
|
|
4456
4574
|
"use strict";
|
|
@@ -4461,7 +4579,7 @@ var init_ai_check_provider = __esm({
|
|
|
4461
4579
|
init_liquid_extensions();
|
|
4462
4580
|
import_promises3 = __toESM(require("fs/promises"));
|
|
4463
4581
|
import_path3 = __toESM(require("path"));
|
|
4464
|
-
|
|
4582
|
+
init_lazy_otel();
|
|
4465
4583
|
init_state_capture();
|
|
4466
4584
|
AICheckProvider = class extends CheckProvider {
|
|
4467
4585
|
aiReviewService;
|
|
@@ -4819,7 +4937,7 @@ var init_ai_check_provider = __esm({
|
|
|
4819
4937
|
) : {}
|
|
4820
4938
|
};
|
|
4821
4939
|
try {
|
|
4822
|
-
const span =
|
|
4940
|
+
const span = trace.getSpan(context.active());
|
|
4823
4941
|
if (span) {
|
|
4824
4942
|
captureCheckInputContext(span, templateContext);
|
|
4825
4943
|
}
|
|
@@ -4893,7 +5011,7 @@ var init_ai_check_provider = __esm({
|
|
|
4893
5011
|
issues: filteredIssues
|
|
4894
5012
|
};
|
|
4895
5013
|
try {
|
|
4896
|
-
const span =
|
|
5014
|
+
const span = trace.getSpan(context.active());
|
|
4897
5015
|
if (span) {
|
|
4898
5016
|
captureProviderCall(
|
|
4899
5017
|
span,
|
|
@@ -4971,14 +5089,14 @@ var init_ai_check_provider = __esm({
|
|
|
4971
5089
|
});
|
|
4972
5090
|
|
|
4973
5091
|
// src/providers/http-check-provider.ts
|
|
4974
|
-
var
|
|
5092
|
+
var HttpCheckProvider;
|
|
4975
5093
|
var init_http_check_provider = __esm({
|
|
4976
5094
|
"src/providers/http-check-provider.ts"() {
|
|
4977
5095
|
"use strict";
|
|
4978
5096
|
init_check_provider_interface();
|
|
4979
5097
|
init_issue_filter();
|
|
4980
5098
|
init_liquid_extensions();
|
|
4981
|
-
|
|
5099
|
+
init_lazy_otel();
|
|
4982
5100
|
init_state_capture();
|
|
4983
5101
|
HttpCheckProvider = class extends CheckProvider {
|
|
4984
5102
|
liquid;
|
|
@@ -5042,7 +5160,7 @@ var init_http_check_provider = __esm({
|
|
|
5042
5160
|
metadata: config.metadata || {}
|
|
5043
5161
|
};
|
|
5044
5162
|
try {
|
|
5045
|
-
const span =
|
|
5163
|
+
const span = trace.getSpan(context.active());
|
|
5046
5164
|
if (span) {
|
|
5047
5165
|
captureCheckInputContext(span, templateContext);
|
|
5048
5166
|
}
|
|
@@ -5075,7 +5193,7 @@ var init_http_check_provider = __esm({
|
|
|
5075
5193
|
issues: filteredIssues
|
|
5076
5194
|
};
|
|
5077
5195
|
try {
|
|
5078
|
-
const span =
|
|
5196
|
+
const span = trace.getSpan(context.active());
|
|
5079
5197
|
if (span) {
|
|
5080
5198
|
captureProviderCall(
|
|
5081
5199
|
span,
|
|
@@ -5641,8 +5759,8 @@ var init_log_check_provider = __esm({
|
|
|
5641
5759
|
};
|
|
5642
5760
|
}
|
|
5643
5761
|
buildTemplateContext(prInfo, dependencyResults, _includePrContext = true, _includeDependencies = true, includeMetadata = true, outputHistory) {
|
|
5644
|
-
const
|
|
5645
|
-
|
|
5762
|
+
const context2 = {};
|
|
5763
|
+
context2.pr = {
|
|
5646
5764
|
number: prInfo.number,
|
|
5647
5765
|
title: prInfo.title,
|
|
5648
5766
|
body: prInfo.body,
|
|
@@ -5659,13 +5777,13 @@ var init_log_check_provider = __esm({
|
|
|
5659
5777
|
changes: f.changes
|
|
5660
5778
|
}))
|
|
5661
5779
|
};
|
|
5662
|
-
|
|
5663
|
-
|
|
5780
|
+
context2.filenames = prInfo.files.map((f) => f.filename);
|
|
5781
|
+
context2.fileCount = prInfo.files.length;
|
|
5664
5782
|
if (dependencyResults) {
|
|
5665
5783
|
const dependencies = {};
|
|
5666
5784
|
const outputs = {};
|
|
5667
5785
|
const history = {};
|
|
5668
|
-
|
|
5786
|
+
context2.dependencyCount = dependencyResults.size;
|
|
5669
5787
|
for (const [checkName, result] of dependencyResults.entries()) {
|
|
5670
5788
|
dependencies[checkName] = {
|
|
5671
5789
|
issueCount: result.issues?.length || 0,
|
|
@@ -5681,11 +5799,11 @@ var init_log_check_provider = __esm({
|
|
|
5681
5799
|
}
|
|
5682
5800
|
}
|
|
5683
5801
|
outputs.history = history;
|
|
5684
|
-
|
|
5685
|
-
|
|
5802
|
+
context2.dependencies = dependencies;
|
|
5803
|
+
context2.outputs = outputs;
|
|
5686
5804
|
}
|
|
5687
5805
|
if (includeMetadata) {
|
|
5688
|
-
|
|
5806
|
+
context2.metadata = {
|
|
5689
5807
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5690
5808
|
executionTime: Date.now(),
|
|
5691
5809
|
nodeVersion: process.version,
|
|
@@ -5693,7 +5811,7 @@ var init_log_check_provider = __esm({
|
|
|
5693
5811
|
workingDirectory: process.cwd()
|
|
5694
5812
|
};
|
|
5695
5813
|
}
|
|
5696
|
-
return
|
|
5814
|
+
return context2;
|
|
5697
5815
|
}
|
|
5698
5816
|
formatLogOutput(level, message, templateContext, includePrContext, includeDependencies, includeMetadata) {
|
|
5699
5817
|
const sections = [];
|
|
@@ -6589,7 +6707,7 @@ var init_claude_code_check_provider = __esm({
|
|
|
6589
6707
|
});
|
|
6590
6708
|
|
|
6591
6709
|
// src/providers/command-check-provider.ts
|
|
6592
|
-
var
|
|
6710
|
+
var CommandCheckProvider;
|
|
6593
6711
|
var init_command_check_provider = __esm({
|
|
6594
6712
|
"src/providers/command-check-provider.ts"() {
|
|
6595
6713
|
"use strict";
|
|
@@ -6598,7 +6716,7 @@ var init_command_check_provider = __esm({
|
|
|
6598
6716
|
init_liquid_extensions();
|
|
6599
6717
|
init_logger();
|
|
6600
6718
|
init_author_permissions();
|
|
6601
|
-
|
|
6719
|
+
init_lazy_otel();
|
|
6602
6720
|
init_state_capture();
|
|
6603
6721
|
CommandCheckProvider = class extends CheckProvider {
|
|
6604
6722
|
liquid;
|
|
@@ -6662,7 +6780,7 @@ var init_command_check_provider = __esm({
|
|
|
6662
6780
|
`\u{1F527} Debug: Template outputs keys: ${Object.keys(templateContext.outputs || {}).join(", ")}`
|
|
6663
6781
|
);
|
|
6664
6782
|
try {
|
|
6665
|
-
const span =
|
|
6783
|
+
const span = trace.getSpan(context.active());
|
|
6666
6784
|
if (span) {
|
|
6667
6785
|
captureCheckInputContext(span, templateContext);
|
|
6668
6786
|
}
|
|
@@ -7290,7 +7408,7 @@ ${bodyWithReturn}
|
|
|
7290
7408
|
...promoted
|
|
7291
7409
|
};
|
|
7292
7410
|
try {
|
|
7293
|
-
const span =
|
|
7411
|
+
const span = trace.getSpan(context.active());
|
|
7294
7412
|
if (span) {
|
|
7295
7413
|
captureCheckOutput(span, outputForDependents);
|
|
7296
7414
|
if (transformJs && output !== finalOutput) {
|
|
@@ -7816,7 +7934,7 @@ ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
|
|
|
7816
7934
|
}
|
|
7817
7935
|
return null;
|
|
7818
7936
|
}
|
|
7819
|
-
async renderCommandTemplate(template,
|
|
7937
|
+
async renderCommandTemplate(template, context2) {
|
|
7820
7938
|
try {
|
|
7821
7939
|
let tpl = template;
|
|
7822
7940
|
if (tpl.includes("{{")) {
|
|
@@ -7825,10 +7943,10 @@ ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
|
|
|
7825
7943
|
return `{{ ${fixed} }}`;
|
|
7826
7944
|
});
|
|
7827
7945
|
}
|
|
7828
|
-
let rendered = await this.liquid.parseAndRender(tpl,
|
|
7946
|
+
let rendered = await this.liquid.parseAndRender(tpl, context2);
|
|
7829
7947
|
if (/\{\{[\s\S]*?\}\}/.test(rendered)) {
|
|
7830
7948
|
try {
|
|
7831
|
-
rendered = this.renderWithJsExpressions(rendered,
|
|
7949
|
+
rendered = this.renderWithJsExpressions(rendered, context2);
|
|
7832
7950
|
} catch {
|
|
7833
7951
|
}
|
|
7834
7952
|
}
|
|
@@ -7836,18 +7954,18 @@ ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
|
|
|
7836
7954
|
} catch (error) {
|
|
7837
7955
|
logger.debug(`\u{1F527} Debug: Liquid templating failed, trying JS-expression fallback: ${error}`);
|
|
7838
7956
|
try {
|
|
7839
|
-
return this.renderWithJsExpressions(template,
|
|
7957
|
+
return this.renderWithJsExpressions(template, context2);
|
|
7840
7958
|
} catch {
|
|
7841
7959
|
return template;
|
|
7842
7960
|
}
|
|
7843
7961
|
}
|
|
7844
7962
|
}
|
|
7845
|
-
renderWithJsExpressions(template,
|
|
7963
|
+
renderWithJsExpressions(template, context2) {
|
|
7846
7964
|
const scope = {
|
|
7847
|
-
pr:
|
|
7848
|
-
files:
|
|
7849
|
-
outputs:
|
|
7850
|
-
env:
|
|
7965
|
+
pr: context2.pr,
|
|
7966
|
+
files: context2.files,
|
|
7967
|
+
outputs: context2.outputs,
|
|
7968
|
+
env: context2.env
|
|
7851
7969
|
};
|
|
7852
7970
|
const expressionRegex = /\{\{\s*([^{}]+?)\s*\}\}/g;
|
|
7853
7971
|
return template.replace(expressionRegex, (_match, expr) => {
|
|
@@ -8007,16 +8125,16 @@ var init_memory_check_provider = __esm({
|
|
|
8007
8125
|
);
|
|
8008
8126
|
return value;
|
|
8009
8127
|
}
|
|
8010
|
-
async handleSet(store, key, config, namespace,
|
|
8011
|
-
const value = await this.computeValue(config,
|
|
8128
|
+
async handleSet(store, key, config, namespace, context2) {
|
|
8129
|
+
const value = await this.computeValue(config, context2);
|
|
8012
8130
|
await store.set(key, value, namespace);
|
|
8013
8131
|
logger.debug(
|
|
8014
8132
|
`Memory SET: ${namespace || store.getDefaultNamespace()}.${key} = ${JSON.stringify(value)}`
|
|
8015
8133
|
);
|
|
8016
8134
|
return value;
|
|
8017
8135
|
}
|
|
8018
|
-
async handleAppend(store, key, config, namespace,
|
|
8019
|
-
const value = await this.computeValue(config,
|
|
8136
|
+
async handleAppend(store, key, config, namespace, context2) {
|
|
8137
|
+
const value = await this.computeValue(config, context2);
|
|
8020
8138
|
await store.append(key, value, namespace);
|
|
8021
8139
|
const result = store.get(key, namespace);
|
|
8022
8140
|
logger.debug(
|
|
@@ -8024,10 +8142,10 @@ var init_memory_check_provider = __esm({
|
|
|
8024
8142
|
);
|
|
8025
8143
|
return result;
|
|
8026
8144
|
}
|
|
8027
|
-
async handleIncrement(store, key, config, namespace,
|
|
8145
|
+
async handleIncrement(store, key, config, namespace, context2) {
|
|
8028
8146
|
let amount = 1;
|
|
8029
8147
|
if (config.value !== void 0 || config.value_js) {
|
|
8030
|
-
const computedValue = await this.computeValue(config,
|
|
8148
|
+
const computedValue = await this.computeValue(config, context2);
|
|
8031
8149
|
if (typeof computedValue === "number") {
|
|
8032
8150
|
amount = computedValue;
|
|
8033
8151
|
} else {
|
|
@@ -8056,11 +8174,11 @@ var init_memory_check_provider = __esm({
|
|
|
8056
8174
|
logger.debug(`Memory LIST: ${namespace || store.getDefaultNamespace()} (${keys.length} keys)`);
|
|
8057
8175
|
return keys;
|
|
8058
8176
|
}
|
|
8059
|
-
async handleExecJs(store, config,
|
|
8177
|
+
async handleExecJs(store, config, context2) {
|
|
8060
8178
|
const script = config.memory_js;
|
|
8061
8179
|
const pendingOps = [];
|
|
8062
8180
|
const enhancedContext = {
|
|
8063
|
-
...
|
|
8181
|
+
...context2,
|
|
8064
8182
|
memory: {
|
|
8065
8183
|
get: (key, ns) => store.get(key, ns),
|
|
8066
8184
|
set: (key, value, ns) => {
|
|
@@ -8163,34 +8281,34 @@ var init_memory_check_provider = __esm({
|
|
|
8163
8281
|
/**
|
|
8164
8282
|
* Compute value from config using value, value_js, transform, or transform_js
|
|
8165
8283
|
*/
|
|
8166
|
-
async computeValue(config,
|
|
8284
|
+
async computeValue(config, context2) {
|
|
8167
8285
|
let value;
|
|
8168
8286
|
if (config.value_js && typeof config.value_js === "string") {
|
|
8169
|
-
value = this.evaluateJavaScript(config.value_js,
|
|
8287
|
+
value = this.evaluateJavaScript(config.value_js, context2);
|
|
8170
8288
|
} else {
|
|
8171
8289
|
value = config.value;
|
|
8172
8290
|
}
|
|
8173
8291
|
if (config.transform && typeof config.transform === "string") {
|
|
8174
8292
|
const rendered = await this.liquid.parseAndRender(config.transform, {
|
|
8175
|
-
...
|
|
8293
|
+
...context2,
|
|
8176
8294
|
value
|
|
8177
8295
|
});
|
|
8178
8296
|
value = rendered;
|
|
8179
8297
|
}
|
|
8180
8298
|
if (config.transform_js && typeof config.transform_js === "string") {
|
|
8181
|
-
value = this.evaluateJavaScript(config.transform_js, { ...
|
|
8299
|
+
value = this.evaluateJavaScript(config.transform_js, { ...context2, value });
|
|
8182
8300
|
}
|
|
8183
8301
|
return value;
|
|
8184
8302
|
}
|
|
8185
8303
|
/**
|
|
8186
8304
|
* Evaluate JavaScript expression in context using SandboxJS for secure execution
|
|
8187
8305
|
*/
|
|
8188
|
-
evaluateJavaScript(expression,
|
|
8306
|
+
evaluateJavaScript(expression, context2) {
|
|
8189
8307
|
if (!this.sandbox) {
|
|
8190
8308
|
this.sandbox = this.createSecureSandbox();
|
|
8191
8309
|
}
|
|
8192
8310
|
try {
|
|
8193
|
-
const scope = { ...
|
|
8311
|
+
const scope = { ...context2 };
|
|
8194
8312
|
return compileAndRun(this.sandbox, `return (${expression});`, scope, {
|
|
8195
8313
|
injectLog: true,
|
|
8196
8314
|
wrapFunction: false,
|
|
@@ -8205,12 +8323,12 @@ var init_memory_check_provider = __esm({
|
|
|
8205
8323
|
* Evaluate JavaScript block (multi-line script) using SandboxJS for secure execution
|
|
8206
8324
|
* Unlike evaluateJavaScript, this supports full scripts with statements, not just expressions
|
|
8207
8325
|
*/
|
|
8208
|
-
evaluateJavaScriptBlock(script,
|
|
8326
|
+
evaluateJavaScriptBlock(script, context2) {
|
|
8209
8327
|
if (!this.sandbox) {
|
|
8210
8328
|
this.sandbox = this.createSecureSandbox();
|
|
8211
8329
|
}
|
|
8212
8330
|
try {
|
|
8213
|
-
const scope = { ...
|
|
8331
|
+
const scope = { ...context2 };
|
|
8214
8332
|
return compileAndRun(this.sandbox, script, scope, {
|
|
8215
8333
|
injectLog: true,
|
|
8216
8334
|
wrapFunction: false,
|
|
@@ -8226,8 +8344,8 @@ var init_memory_check_provider = __esm({
|
|
|
8226
8344
|
* Build template context for Liquid and JS evaluation
|
|
8227
8345
|
*/
|
|
8228
8346
|
buildTemplateContext(prInfo, dependencyResults, memoryStore, outputHistory) {
|
|
8229
|
-
const
|
|
8230
|
-
|
|
8347
|
+
const context2 = {};
|
|
8348
|
+
context2.pr = {
|
|
8231
8349
|
number: prInfo.number,
|
|
8232
8350
|
title: prInfo.title,
|
|
8233
8351
|
body: prInfo.body,
|
|
@@ -8258,16 +8376,16 @@ var init_memory_check_provider = __esm({
|
|
|
8258
8376
|
}
|
|
8259
8377
|
}
|
|
8260
8378
|
outputs.history = history;
|
|
8261
|
-
|
|
8379
|
+
context2.outputs = outputs;
|
|
8262
8380
|
if (memoryStore) {
|
|
8263
|
-
|
|
8381
|
+
context2.memory = {
|
|
8264
8382
|
get: (key, ns) => memoryStore.get(key, ns),
|
|
8265
8383
|
has: (key, ns) => memoryStore.has(key, ns),
|
|
8266
8384
|
list: (ns) => memoryStore.list(ns),
|
|
8267
8385
|
getAll: (ns) => memoryStore.getAll(ns)
|
|
8268
8386
|
};
|
|
8269
8387
|
}
|
|
8270
|
-
return
|
|
8388
|
+
return context2;
|
|
8271
8389
|
}
|
|
8272
8390
|
getSupportedConfigKeys() {
|
|
8273
8391
|
return [
|
|
@@ -9209,14 +9327,14 @@ var init_human_input_check_provider = __esm({
|
|
|
9209
9327
|
/**
|
|
9210
9328
|
* Get user input through various methods
|
|
9211
9329
|
*/
|
|
9212
|
-
async getUserInput(checkName, config,
|
|
9330
|
+
async getUserInput(checkName, config, context2) {
|
|
9213
9331
|
const prompt = config.prompt || "Please provide input:";
|
|
9214
9332
|
const placeholder = config.placeholder || "Enter your response...";
|
|
9215
9333
|
const allowEmpty = config.allow_empty ?? false;
|
|
9216
9334
|
const multiline = config.multiline ?? false;
|
|
9217
9335
|
const timeout = config.timeout ? config.timeout * 1e3 : void 0;
|
|
9218
9336
|
const defaultValue = config.default;
|
|
9219
|
-
const cliMessage =
|
|
9337
|
+
const cliMessage = context2?.cliMessage ?? _HumanInputCheckProvider.cliMessage;
|
|
9220
9338
|
if (cliMessage !== void 0) {
|
|
9221
9339
|
const message = cliMessage;
|
|
9222
9340
|
if (this.looksLikePath(message)) {
|
|
@@ -9231,7 +9349,7 @@ var init_human_input_check_provider = __esm({
|
|
|
9231
9349
|
if (stdinInput !== null && stdinInput.length > 0) {
|
|
9232
9350
|
return stdinInput;
|
|
9233
9351
|
}
|
|
9234
|
-
const hooks =
|
|
9352
|
+
const hooks = context2?.hooks ?? _HumanInputCheckProvider.hooks;
|
|
9235
9353
|
if (hooks?.onHumanInput) {
|
|
9236
9354
|
const request = {
|
|
9237
9355
|
checkId: checkName,
|
|
@@ -9280,10 +9398,10 @@ var init_human_input_check_provider = __esm({
|
|
|
9280
9398
|
);
|
|
9281
9399
|
}
|
|
9282
9400
|
}
|
|
9283
|
-
async execute(_prInfo, config, _dependencyResults,
|
|
9401
|
+
async execute(_prInfo, config, _dependencyResults, context2) {
|
|
9284
9402
|
const checkName = config.checkName || "human-input";
|
|
9285
9403
|
try {
|
|
9286
|
-
const userInput = await this.getUserInput(checkName, config,
|
|
9404
|
+
const userInput = await this.getUserInput(checkName, config, context2);
|
|
9287
9405
|
const sanitizedInput = this.sanitizeInput(userInput);
|
|
9288
9406
|
return {
|
|
9289
9407
|
issues: [],
|
|
@@ -9692,7 +9810,7 @@ var init_dependency_resolver = __esm({
|
|
|
9692
9810
|
|
|
9693
9811
|
// src/telemetry/trace-helpers.ts
|
|
9694
9812
|
function getTracer() {
|
|
9695
|
-
return
|
|
9813
|
+
return trace.getTracer("visor");
|
|
9696
9814
|
}
|
|
9697
9815
|
async function withActiveSpan(name, attrs, fn) {
|
|
9698
9816
|
const tracer = getTracer();
|
|
@@ -9704,7 +9822,7 @@ async function withActiveSpan(name, attrs, fn) {
|
|
|
9704
9822
|
} catch (err) {
|
|
9705
9823
|
try {
|
|
9706
9824
|
if (err instanceof Error) span.recordException(err);
|
|
9707
|
-
span.setStatus({ code:
|
|
9825
|
+
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
9708
9826
|
} catch {
|
|
9709
9827
|
}
|
|
9710
9828
|
reject(err);
|
|
@@ -9720,7 +9838,7 @@ async function withActiveSpan(name, attrs, fn) {
|
|
|
9720
9838
|
});
|
|
9721
9839
|
}
|
|
9722
9840
|
function addEvent(name, attrs) {
|
|
9723
|
-
const span =
|
|
9841
|
+
const span = trace.getSpan(context.active());
|
|
9724
9842
|
if (span) {
|
|
9725
9843
|
try {
|
|
9726
9844
|
span.addEvent(name, attrs);
|
|
@@ -9739,11 +9857,10 @@ function addEvent(name, attrs) {
|
|
|
9739
9857
|
} catch {
|
|
9740
9858
|
}
|
|
9741
9859
|
}
|
|
9742
|
-
var import_api4;
|
|
9743
9860
|
var init_trace_helpers = __esm({
|
|
9744
9861
|
"src/telemetry/trace-helpers.ts"() {
|
|
9745
9862
|
"use strict";
|
|
9746
|
-
|
|
9863
|
+
init_lazy_otel();
|
|
9747
9864
|
}
|
|
9748
9865
|
});
|
|
9749
9866
|
|
|
@@ -9798,13 +9915,13 @@ function addDiagramBlock(origin) {
|
|
|
9798
9915
|
} catch {
|
|
9799
9916
|
}
|
|
9800
9917
|
}
|
|
9801
|
-
var
|
|
9918
|
+
var initialized, meter, TEST_ENABLED, TEST_SNAPSHOT, checkDurationHist, providerDurationHist, foreachDurationHist, issuesCounter, activeChecks, failIfCounter, diagramBlocks;
|
|
9802
9919
|
var init_metrics = __esm({
|
|
9803
9920
|
"src/telemetry/metrics.ts"() {
|
|
9804
9921
|
"use strict";
|
|
9805
|
-
|
|
9922
|
+
init_lazy_otel();
|
|
9806
9923
|
initialized = false;
|
|
9807
|
-
meter =
|
|
9924
|
+
meter = metrics.getMeter("visor");
|
|
9808
9925
|
TEST_ENABLED = process.env.VISOR_TEST_METRICS === "true";
|
|
9809
9926
|
TEST_SNAPSHOT = { fail_if_triggered: 0 };
|
|
9810
9927
|
}
|
|
@@ -9834,7 +9951,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9834
9951
|
* Evaluate simple fail_if condition
|
|
9835
9952
|
*/
|
|
9836
9953
|
async evaluateSimpleCondition(checkName, checkSchema, checkGroup, reviewSummary, expression, previousOutputs, authorAssociation) {
|
|
9837
|
-
const
|
|
9954
|
+
const context2 = this.buildEvaluationContext(
|
|
9838
9955
|
checkName,
|
|
9839
9956
|
checkSchema,
|
|
9840
9957
|
checkGroup,
|
|
@@ -9844,17 +9961,17 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9844
9961
|
);
|
|
9845
9962
|
try {
|
|
9846
9963
|
try {
|
|
9847
|
-
const isObj =
|
|
9848
|
-
const keys = isObj ? Object.keys(
|
|
9964
|
+
const isObj = context2.output && typeof context2.output === "object";
|
|
9965
|
+
const keys = isObj ? Object.keys(context2.output).join(",") : typeof context2.output;
|
|
9849
9966
|
let errorVal = void 0;
|
|
9850
|
-
if (isObj &&
|
|
9851
|
-
errorVal =
|
|
9967
|
+
if (isObj && context2.output.error !== void 0)
|
|
9968
|
+
errorVal = context2.output.error;
|
|
9852
9969
|
(init_logger(), __toCommonJS(logger_exports)).logger.debug(
|
|
9853
9970
|
` fail_if: evaluating '${expression}' with output keys=${keys} error=${String(errorVal)}`
|
|
9854
9971
|
);
|
|
9855
9972
|
} catch {
|
|
9856
9973
|
}
|
|
9857
|
-
const res = this.evaluateExpression(expression,
|
|
9974
|
+
const res = this.evaluateExpression(expression, context2);
|
|
9858
9975
|
if (res === true) {
|
|
9859
9976
|
try {
|
|
9860
9977
|
addEvent("fail_if.triggered", {
|
|
@@ -9913,7 +10030,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9913
10030
|
* Evaluate if condition to determine whether a check should run
|
|
9914
10031
|
*/
|
|
9915
10032
|
async evaluateIfCondition(checkName, expression, contextData) {
|
|
9916
|
-
const
|
|
10033
|
+
const context2 = {
|
|
9917
10034
|
// Check metadata
|
|
9918
10035
|
checkName,
|
|
9919
10036
|
// Git context
|
|
@@ -9962,7 +10079,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9962
10079
|
}
|
|
9963
10080
|
};
|
|
9964
10081
|
try {
|
|
9965
|
-
return this.evaluateExpression(expression,
|
|
10082
|
+
return this.evaluateExpression(expression, context2);
|
|
9966
10083
|
} catch (error) {
|
|
9967
10084
|
console.warn(`Failed to evaluate if expression for check '${checkName}': ${error}`);
|
|
9968
10085
|
return true;
|
|
@@ -9972,7 +10089,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9972
10089
|
* Evaluate all failure conditions for a check result
|
|
9973
10090
|
*/
|
|
9974
10091
|
async evaluateConditions(checkName, checkSchema, checkGroup, reviewSummary, globalConditions, checkConditions, previousOutputs, authorAssociation) {
|
|
9975
|
-
const
|
|
10092
|
+
const context2 = this.buildEvaluationContext(
|
|
9976
10093
|
checkName,
|
|
9977
10094
|
checkSchema,
|
|
9978
10095
|
checkGroup,
|
|
@@ -9982,11 +10099,11 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9982
10099
|
);
|
|
9983
10100
|
const results = [];
|
|
9984
10101
|
if (globalConditions) {
|
|
9985
|
-
const globalResults = await this.evaluateConditionSet(globalConditions,
|
|
10102
|
+
const globalResults = await this.evaluateConditionSet(globalConditions, context2, "global");
|
|
9986
10103
|
results.push(...globalResults);
|
|
9987
10104
|
}
|
|
9988
10105
|
if (checkConditions) {
|
|
9989
|
-
const checkResults = await this.evaluateConditionSet(checkConditions,
|
|
10106
|
+
const checkResults = await this.evaluateConditionSet(checkConditions, context2, "check");
|
|
9990
10107
|
const overriddenConditions = new Set(Object.keys(checkConditions));
|
|
9991
10108
|
const filteredResults = results.filter(
|
|
9992
10109
|
(result) => !overriddenConditions.has(result.conditionName)
|
|
@@ -9998,7 +10115,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
9998
10115
|
if (checkName === "B") {
|
|
9999
10116
|
console.error(
|
|
10000
10117
|
`\u{1F527} Debug: fail_if results for ${checkName}: ${JSON.stringify(results)} context.output=${JSON.stringify(
|
|
10001
|
-
|
|
10118
|
+
context2.output
|
|
10002
10119
|
)}`
|
|
10003
10120
|
);
|
|
10004
10121
|
}
|
|
@@ -10009,12 +10126,12 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10009
10126
|
/**
|
|
10010
10127
|
* Evaluate a set of failure conditions
|
|
10011
10128
|
*/
|
|
10012
|
-
async evaluateConditionSet(conditions,
|
|
10129
|
+
async evaluateConditionSet(conditions, context2, source) {
|
|
10013
10130
|
const results = [];
|
|
10014
10131
|
for (const [conditionName, condition] of Object.entries(conditions)) {
|
|
10015
10132
|
try {
|
|
10016
10133
|
addEvent("fail_if.evaluated", {
|
|
10017
|
-
check:
|
|
10134
|
+
check: context2.checkName,
|
|
10018
10135
|
scope: source,
|
|
10019
10136
|
name: conditionName,
|
|
10020
10137
|
expression: this.extractExpression(condition)
|
|
@@ -10025,12 +10142,12 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10025
10142
|
const { emitNdjsonSpanWithEvents: emitNdjsonSpanWithEvents2 } = (init_fallback_ndjson(), __toCommonJS(fallback_ndjson_exports));
|
|
10026
10143
|
emitNdjsonSpanWithEvents2(
|
|
10027
10144
|
"visor.fail_if",
|
|
10028
|
-
{ check:
|
|
10145
|
+
{ check: context2.checkName || "unknown", scope: source, name: conditionName },
|
|
10029
10146
|
[
|
|
10030
10147
|
{
|
|
10031
10148
|
name: "fail_if.evaluated",
|
|
10032
10149
|
attrs: {
|
|
10033
|
-
check:
|
|
10150
|
+
check: context2.checkName,
|
|
10034
10151
|
scope: source,
|
|
10035
10152
|
name: conditionName,
|
|
10036
10153
|
expression: this.extractExpression(condition)
|
|
@@ -10041,12 +10158,12 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10041
10158
|
} catch {
|
|
10042
10159
|
}
|
|
10043
10160
|
try {
|
|
10044
|
-
const result = await this.evaluateSingleCondition(conditionName, condition,
|
|
10161
|
+
const result = await this.evaluateSingleCondition(conditionName, condition, context2);
|
|
10045
10162
|
results.push(result);
|
|
10046
10163
|
if (result.failed) {
|
|
10047
10164
|
try {
|
|
10048
10165
|
addEvent("fail_if.triggered", {
|
|
10049
|
-
check:
|
|
10166
|
+
check: context2.checkName,
|
|
10050
10167
|
scope: source,
|
|
10051
10168
|
name: conditionName,
|
|
10052
10169
|
expression: result.expression,
|
|
@@ -10056,7 +10173,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10056
10173
|
} catch {
|
|
10057
10174
|
}
|
|
10058
10175
|
try {
|
|
10059
|
-
addFailIfTriggered(
|
|
10176
|
+
addFailIfTriggered(context2.checkName || "unknown", source);
|
|
10060
10177
|
} catch {
|
|
10061
10178
|
}
|
|
10062
10179
|
}
|
|
@@ -10076,11 +10193,11 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10076
10193
|
/**
|
|
10077
10194
|
* Evaluate a single failure condition
|
|
10078
10195
|
*/
|
|
10079
|
-
async evaluateSingleCondition(conditionName, condition,
|
|
10196
|
+
async evaluateSingleCondition(conditionName, condition, context2) {
|
|
10080
10197
|
const expression = this.extractExpression(condition);
|
|
10081
10198
|
const config = this.extractConditionConfig(condition);
|
|
10082
10199
|
try {
|
|
10083
|
-
const failed = this.evaluateExpression(expression,
|
|
10200
|
+
const failed = this.evaluateExpression(expression, context2);
|
|
10084
10201
|
return {
|
|
10085
10202
|
conditionName,
|
|
10086
10203
|
failed,
|
|
@@ -10099,7 +10216,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10099
10216
|
* Secure expression evaluation using SandboxJS
|
|
10100
10217
|
* Supports the same GitHub Actions-style functions as the previous implementation
|
|
10101
10218
|
*/
|
|
10102
|
-
evaluateExpression(condition,
|
|
10219
|
+
evaluateExpression(condition, context2) {
|
|
10103
10220
|
try {
|
|
10104
10221
|
const normalize3 = (expr) => {
|
|
10105
10222
|
const trimmed = expr.trim();
|
|
@@ -10144,7 +10261,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10144
10261
|
const hasIssueWith = hasIssue;
|
|
10145
10262
|
const hasFileWith = hasFileMatching;
|
|
10146
10263
|
const permissionHelpers = createPermissionHelpers(
|
|
10147
|
-
|
|
10264
|
+
context2.authorAssociation,
|
|
10148
10265
|
detectLocalMode()
|
|
10149
10266
|
);
|
|
10150
10267
|
const hasMinPermission2 = permissionHelpers.hasMinPermission;
|
|
@@ -10153,35 +10270,35 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10153
10270
|
const isCollaborator2 = permissionHelpers.isCollaborator;
|
|
10154
10271
|
const isContributor2 = permissionHelpers.isContributor;
|
|
10155
10272
|
const isFirstTimer2 = permissionHelpers.isFirstTimer;
|
|
10156
|
-
const output =
|
|
10273
|
+
const output = context2.output || {};
|
|
10157
10274
|
const issues = output.issues || [];
|
|
10158
|
-
const metadata =
|
|
10159
|
-
checkName:
|
|
10160
|
-
schema:
|
|
10161
|
-
group:
|
|
10275
|
+
const metadata = context2.metadata || {
|
|
10276
|
+
checkName: context2.checkName || "",
|
|
10277
|
+
schema: context2.schema || "",
|
|
10278
|
+
group: context2.group || "",
|
|
10162
10279
|
criticalIssues: issues.filter((i) => i.severity === "critical").length,
|
|
10163
10280
|
errorIssues: issues.filter((i) => i.severity === "error").length,
|
|
10164
10281
|
warningIssues: issues.filter((i) => i.severity === "warning").length,
|
|
10165
10282
|
infoIssues: issues.filter((i) => i.severity === "info").length,
|
|
10166
10283
|
totalIssues: issues.length,
|
|
10167
|
-
hasChanges:
|
|
10284
|
+
hasChanges: context2.hasChanges || false
|
|
10168
10285
|
};
|
|
10169
10286
|
const criticalIssues = metadata.criticalIssues;
|
|
10170
10287
|
const errorIssues = metadata.errorIssues;
|
|
10171
10288
|
const totalIssues = metadata.totalIssues;
|
|
10172
10289
|
const warningIssues = metadata.warningIssues;
|
|
10173
10290
|
const infoIssues = metadata.infoIssues;
|
|
10174
|
-
const checkName =
|
|
10175
|
-
const schema =
|
|
10176
|
-
const group =
|
|
10177
|
-
const branch =
|
|
10178
|
-
const baseBranch =
|
|
10179
|
-
const filesChanged =
|
|
10180
|
-
const filesCount =
|
|
10181
|
-
const event =
|
|
10182
|
-
const env =
|
|
10183
|
-
const outputs =
|
|
10184
|
-
const debugData =
|
|
10291
|
+
const checkName = context2.checkName || "";
|
|
10292
|
+
const schema = context2.schema || "";
|
|
10293
|
+
const group = context2.group || "";
|
|
10294
|
+
const branch = context2.branch || "unknown";
|
|
10295
|
+
const baseBranch = context2.baseBranch || "main";
|
|
10296
|
+
const filesChanged = context2.filesChanged || [];
|
|
10297
|
+
const filesCount = context2.filesCount || 0;
|
|
10298
|
+
const event = context2.event || "manual";
|
|
10299
|
+
const env = context2.env || {};
|
|
10300
|
+
const outputs = context2.outputs || {};
|
|
10301
|
+
const debugData = context2.debug || null;
|
|
10185
10302
|
const memoryStore = MemoryStore.getInstance();
|
|
10186
10303
|
const memoryAccessor = {
|
|
10187
10304
|
get: (key, ns) => memoryStore.get(key, ns),
|
|
@@ -10382,7 +10499,7 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10382
10499
|
} catch {
|
|
10383
10500
|
}
|
|
10384
10501
|
const memoryStore = MemoryStore.getInstance();
|
|
10385
|
-
const
|
|
10502
|
+
const context2 = {
|
|
10386
10503
|
output: aggregatedOutput,
|
|
10387
10504
|
outputs: (() => {
|
|
10388
10505
|
if (!previousOutputs) return {};
|
|
@@ -10407,14 +10524,14 @@ var init_failure_condition_evaluator = __esm({
|
|
|
10407
10524
|
authorAssociation
|
|
10408
10525
|
};
|
|
10409
10526
|
if (debug) {
|
|
10410
|
-
|
|
10527
|
+
context2.debug = {
|
|
10411
10528
|
errors: debug.errors || [],
|
|
10412
10529
|
processingTime: debug.processingTime || 0,
|
|
10413
10530
|
provider: debug.provider || "unknown",
|
|
10414
10531
|
model: debug.model || "unknown"
|
|
10415
10532
|
};
|
|
10416
10533
|
}
|
|
10417
|
-
return
|
|
10534
|
+
return context2;
|
|
10418
10535
|
}
|
|
10419
10536
|
// Minimal JSON-from-end extractor for fail_if context fallback
|
|
10420
10537
|
tryExtractJsonFromEnd(text) {
|
|
@@ -11029,7 +11146,7 @@ function getSafeEnvironmentVariables() {
|
|
|
11029
11146
|
}
|
|
11030
11147
|
return safeEnv;
|
|
11031
11148
|
}
|
|
11032
|
-
var
|
|
11149
|
+
var CheckExecutionEngine;
|
|
11033
11150
|
var init_check_execution_engine = __esm({
|
|
11034
11151
|
"src/check-execution-engine.ts"() {
|
|
11035
11152
|
"use strict";
|
|
@@ -11048,7 +11165,7 @@ var init_check_execution_engine = __esm({
|
|
|
11048
11165
|
init_fallback_ndjson();
|
|
11049
11166
|
init_trace_helpers();
|
|
11050
11167
|
init_metrics();
|
|
11051
|
-
|
|
11168
|
+
init_lazy_otel();
|
|
11052
11169
|
init_state_capture();
|
|
11053
11170
|
CheckExecutionEngine = class _CheckExecutionEngine {
|
|
11054
11171
|
gitAnalyzer;
|
|
@@ -11103,8 +11220,8 @@ var init_check_execution_engine = __esm({
|
|
|
11103
11220
|
* Set execution context for providers (CLI message, hooks, etc.)
|
|
11104
11221
|
* This allows passing state without using static properties
|
|
11105
11222
|
*/
|
|
11106
|
-
setExecutionContext(
|
|
11107
|
-
this.executionContext =
|
|
11223
|
+
setExecutionContext(context2) {
|
|
11224
|
+
this.executionContext = context2;
|
|
11108
11225
|
}
|
|
11109
11226
|
/**
|
|
11110
11227
|
* Lazily create a secure sandbox for routing JS (goto_js, run_js)
|
|
@@ -11400,7 +11517,7 @@ ${expr}`;
|
|
|
11400
11517
|
});
|
|
11401
11518
|
} catch {
|
|
11402
11519
|
}
|
|
11403
|
-
const
|
|
11520
|
+
const context2 = {
|
|
11404
11521
|
...sessionInfo,
|
|
11405
11522
|
...this.executionContext
|
|
11406
11523
|
};
|
|
@@ -11413,7 +11530,7 @@ ${expr}`;
|
|
|
11413
11530
|
},
|
|
11414
11531
|
async () => {
|
|
11415
11532
|
try {
|
|
11416
|
-
return await provider.execute(prInfo, providerConfig, dependencyResults,
|
|
11533
|
+
return await provider.execute(prInfo, providerConfig, dependencyResults, context2);
|
|
11417
11534
|
} finally {
|
|
11418
11535
|
try {
|
|
11419
11536
|
emitNdjsonSpanWithEvents("visor.check", { "visor.check.id": checkName }, [
|
|
@@ -13145,7 +13262,7 @@ ${expr}`;
|
|
|
13145
13262
|
} catch {
|
|
13146
13263
|
}
|
|
13147
13264
|
try {
|
|
13148
|
-
const span =
|
|
13265
|
+
const span = trace.getSpan(context.active());
|
|
13149
13266
|
if (span) {
|
|
13150
13267
|
captureForEachState(span, forEachItems, itemIndex, item);
|
|
13151
13268
|
}
|
|
@@ -13972,7 +14089,7 @@ ${error.stack || ""}` : String(error);
|
|
|
13972
14089
|
}
|
|
13973
14090
|
results.set(checkName, reviewResult);
|
|
13974
14091
|
try {
|
|
13975
|
-
const span =
|
|
14092
|
+
const span = trace.getSpan(context.active());
|
|
13976
14093
|
if (span) {
|
|
13977
14094
|
const allOutputs = {};
|
|
13978
14095
|
results.forEach((result2, name) => {
|
|
@@ -16048,6 +16165,17 @@ var init_config_schema = __esm({
|
|
|
16048
16165
|
sessionId: {
|
|
16049
16166
|
type: "string",
|
|
16050
16167
|
description: "Session ID for HTTP transport (optional, server may generate one)"
|
|
16168
|
+
},
|
|
16169
|
+
args: {
|
|
16170
|
+
type: "array",
|
|
16171
|
+
items: {
|
|
16172
|
+
type: "string"
|
|
16173
|
+
},
|
|
16174
|
+
description: "Command arguments (for stdio transport in MCP checks)"
|
|
16175
|
+
},
|
|
16176
|
+
workingDirectory: {
|
|
16177
|
+
type: "string",
|
|
16178
|
+
description: "Working directory (for stdio transport in MCP checks)"
|
|
16051
16179
|
}
|
|
16052
16180
|
},
|
|
16053
16181
|
additionalProperties: false,
|