@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
|
@@ -15,12 +15,14 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
addEvent,
|
|
17
17
|
addFailIfTriggered,
|
|
18
|
+
context,
|
|
18
19
|
emitNdjsonFallback,
|
|
19
20
|
emitNdjsonSpanWithEvents,
|
|
20
21
|
fallback_ndjson_exports,
|
|
21
22
|
init_fallback_ndjson,
|
|
23
|
+
trace,
|
|
22
24
|
withActiveSpan
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-33QVZ2D4.mjs";
|
|
24
26
|
import {
|
|
25
27
|
__esm,
|
|
26
28
|
__export,
|
|
@@ -956,7 +958,7 @@ ${prContext}
|
|
|
956
958
|
log("\u{1F50D} Including code diffs in AI context");
|
|
957
959
|
}
|
|
958
960
|
if (isIssue) {
|
|
959
|
-
let
|
|
961
|
+
let context3 = `<issue>
|
|
960
962
|
<!-- Core issue metadata including identification, status, and timeline information -->
|
|
961
963
|
<metadata>
|
|
962
964
|
<number>${prInfo.number}</number>
|
|
@@ -968,7 +970,7 @@ ${prContext}
|
|
|
968
970
|
<comments_count>${prInfo.eventContext?.issue?.comments || 0}</comments_count>
|
|
969
971
|
</metadata>`;
|
|
970
972
|
if (prInfo.body) {
|
|
971
|
-
|
|
973
|
+
context3 += `
|
|
972
974
|
<!-- Full issue description and body text provided by the issue author -->
|
|
973
975
|
<description>
|
|
974
976
|
${this.escapeXml(prInfo.body)}
|
|
@@ -977,33 +979,33 @@ ${this.escapeXml(prInfo.body)}
|
|
|
977
979
|
const eventContext = prInfo;
|
|
978
980
|
const labels = eventContext.eventContext?.issue?.labels;
|
|
979
981
|
if (labels && labels.length > 0) {
|
|
980
|
-
|
|
982
|
+
context3 += `
|
|
981
983
|
<!-- Applied labels for issue categorization and organization -->
|
|
982
984
|
<labels>`;
|
|
983
985
|
labels.forEach((label) => {
|
|
984
986
|
const labelName = typeof label === "string" ? label : label.name || "unknown";
|
|
985
|
-
|
|
987
|
+
context3 += `
|
|
986
988
|
<label>${this.escapeXml(labelName)}</label>`;
|
|
987
989
|
});
|
|
988
|
-
|
|
990
|
+
context3 += `
|
|
989
991
|
</labels>`;
|
|
990
992
|
}
|
|
991
993
|
const assignees = prInfo.eventContext?.issue?.assignees;
|
|
992
994
|
if (assignees && assignees.length > 0) {
|
|
993
|
-
|
|
995
|
+
context3 += `
|
|
994
996
|
<!-- Users assigned to work on this issue -->
|
|
995
997
|
<assignees>`;
|
|
996
998
|
assignees.forEach((assignee) => {
|
|
997
999
|
const assigneeName = typeof assignee === "string" ? assignee : assignee.login || "unknown";
|
|
998
|
-
|
|
1000
|
+
context3 += `
|
|
999
1001
|
<assignee>${this.escapeXml(assigneeName)}</assignee>`;
|
|
1000
1002
|
});
|
|
1001
|
-
|
|
1003
|
+
context3 += `
|
|
1002
1004
|
</assignees>`;
|
|
1003
1005
|
}
|
|
1004
1006
|
const milestone = prInfo.eventContext?.issue?.milestone;
|
|
1005
1007
|
if (milestone) {
|
|
1006
|
-
|
|
1008
|
+
context3 += `
|
|
1007
1009
|
<!-- Associated project milestone information -->
|
|
1008
1010
|
<milestone>
|
|
1009
1011
|
<title>${this.escapeXml(milestone.title || "")}</title>
|
|
@@ -1013,7 +1015,7 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1013
1015
|
}
|
|
1014
1016
|
const triggeringComment2 = prInfo.eventContext?.comment;
|
|
1015
1017
|
if (triggeringComment2) {
|
|
1016
|
-
|
|
1018
|
+
context3 += `
|
|
1017
1019
|
<!-- The comment that triggered this analysis -->
|
|
1018
1020
|
<triggering_comment>
|
|
1019
1021
|
<author>${this.escapeXml(triggeringComment2.user?.login || "unknown")}</author>
|
|
@@ -1030,26 +1032,26 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1030
1032
|
);
|
|
1031
1033
|
}
|
|
1032
1034
|
if (historicalComments.length > 0) {
|
|
1033
|
-
|
|
1035
|
+
context3 += `
|
|
1034
1036
|
<!-- Previous comments in chronological order (excluding triggering comment) -->
|
|
1035
1037
|
<comment_history>`;
|
|
1036
1038
|
historicalComments.forEach((comment) => {
|
|
1037
|
-
|
|
1039
|
+
context3 += `
|
|
1038
1040
|
<comment>
|
|
1039
1041
|
<author>${this.escapeXml(comment.author || "unknown")}</author>
|
|
1040
1042
|
<created_at>${comment.createdAt || ""}</created_at>
|
|
1041
1043
|
<body>${this.escapeXml(comment.body || "")}</body>
|
|
1042
1044
|
</comment>`;
|
|
1043
1045
|
});
|
|
1044
|
-
|
|
1046
|
+
context3 += `
|
|
1045
1047
|
</comment_history>`;
|
|
1046
1048
|
}
|
|
1047
1049
|
}
|
|
1048
|
-
|
|
1050
|
+
context3 += `
|
|
1049
1051
|
</issue>`;
|
|
1050
|
-
return
|
|
1052
|
+
return context3;
|
|
1051
1053
|
}
|
|
1052
|
-
let
|
|
1054
|
+
let context2 = `<pull_request>
|
|
1053
1055
|
<!-- Core pull request metadata including identification, branches, and change statistics -->
|
|
1054
1056
|
<metadata>
|
|
1055
1057
|
<number>${prInfo.number}</number>
|
|
@@ -1062,7 +1064,7 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1062
1064
|
<files_changed_count>${prInfo.files.length}</files_changed_count>
|
|
1063
1065
|
</metadata>`;
|
|
1064
1066
|
if (prInfo.body) {
|
|
1065
|
-
|
|
1067
|
+
context2 += `
|
|
1066
1068
|
<!-- Full pull request description provided by the author -->
|
|
1067
1069
|
<description>
|
|
1068
1070
|
${this.escapeXml(prInfo.body)}
|
|
@@ -1071,7 +1073,7 @@ ${this.escapeXml(prInfo.body)}
|
|
|
1071
1073
|
if (includeCodeContext) {
|
|
1072
1074
|
if (prInfo.fullDiff) {
|
|
1073
1075
|
const processedFullDiff = await processDiffWithOutline(prInfo.fullDiff);
|
|
1074
|
-
|
|
1076
|
+
context2 += `
|
|
1075
1077
|
<!-- Complete unified diff showing all changes in the pull request (processed with outline-diff) -->
|
|
1076
1078
|
<full_diff>
|
|
1077
1079
|
${this.escapeXml(processedFullDiff)}
|
|
@@ -1080,14 +1082,14 @@ ${this.escapeXml(processedFullDiff)}
|
|
|
1080
1082
|
if (prInfo.isIncremental) {
|
|
1081
1083
|
if (prInfo.commitDiff && prInfo.commitDiff.length > 0) {
|
|
1082
1084
|
const processedCommitDiff = await processDiffWithOutline(prInfo.commitDiff);
|
|
1083
|
-
|
|
1085
|
+
context2 += `
|
|
1084
1086
|
<!-- Diff of only the latest commit for incremental analysis (processed with outline-diff) -->
|
|
1085
1087
|
<commit_diff>
|
|
1086
1088
|
${this.escapeXml(processedCommitDiff)}
|
|
1087
1089
|
</commit_diff>`;
|
|
1088
1090
|
} else {
|
|
1089
1091
|
const processedFallbackDiff = prInfo.fullDiff ? await processDiffWithOutline(prInfo.fullDiff) : "";
|
|
1090
|
-
|
|
1092
|
+
context2 += `
|
|
1091
1093
|
<!-- Commit diff could not be retrieved - falling back to full diff analysis (processed with outline-diff) -->
|
|
1092
1094
|
<commit_diff>
|
|
1093
1095
|
${this.escapeXml(processedFallbackDiff)}
|
|
@@ -1095,15 +1097,15 @@ ${this.escapeXml(processedFallbackDiff)}
|
|
|
1095
1097
|
}
|
|
1096
1098
|
}
|
|
1097
1099
|
} else {
|
|
1098
|
-
|
|
1100
|
+
context2 += `
|
|
1099
1101
|
<!-- Code diffs excluded to reduce token usage (no code-review schema detected or disabled by flag) -->`;
|
|
1100
1102
|
}
|
|
1101
1103
|
if (prInfo.files.length > 0) {
|
|
1102
|
-
|
|
1104
|
+
context2 += `
|
|
1103
1105
|
<!-- Summary of all files changed with statistics -->
|
|
1104
1106
|
<files_summary>`;
|
|
1105
1107
|
prInfo.files.forEach((file) => {
|
|
1106
|
-
|
|
1108
|
+
context2 += `
|
|
1107
1109
|
<file>
|
|
1108
1110
|
<filename>${this.escapeXml(file.filename)}</filename>
|
|
1109
1111
|
<status>${file.status}</status>
|
|
@@ -1111,12 +1113,12 @@ ${this.escapeXml(processedFallbackDiff)}
|
|
|
1111
1113
|
<deletions>${file.deletions}</deletions>
|
|
1112
1114
|
</file>`;
|
|
1113
1115
|
});
|
|
1114
|
-
|
|
1116
|
+
context2 += `
|
|
1115
1117
|
</files_summary>`;
|
|
1116
1118
|
}
|
|
1117
1119
|
const triggeringComment = prInfo.eventContext?.comment;
|
|
1118
1120
|
if (triggeringComment) {
|
|
1119
|
-
|
|
1121
|
+
context2 += `
|
|
1120
1122
|
<!-- The comment that triggered this analysis -->
|
|
1121
1123
|
<triggering_comment>
|
|
1122
1124
|
<author>${this.escapeXml(triggeringComment.user?.login || "unknown")}</author>
|
|
@@ -1133,24 +1135,24 @@ ${this.escapeXml(processedFallbackDiff)}
|
|
|
1133
1135
|
);
|
|
1134
1136
|
}
|
|
1135
1137
|
if (historicalComments.length > 0) {
|
|
1136
|
-
|
|
1138
|
+
context2 += `
|
|
1137
1139
|
<!-- Previous PR comments in chronological order (excluding triggering comment) -->
|
|
1138
1140
|
<comment_history>`;
|
|
1139
1141
|
historicalComments.forEach((comment) => {
|
|
1140
|
-
|
|
1142
|
+
context2 += `
|
|
1141
1143
|
<comment>
|
|
1142
1144
|
<author>${this.escapeXml(comment.author || "unknown")}</author>
|
|
1143
1145
|
<created_at>${comment.createdAt || ""}</created_at>
|
|
1144
1146
|
<body>${this.escapeXml(comment.body || "")}</body>
|
|
1145
1147
|
</comment>`;
|
|
1146
1148
|
});
|
|
1147
|
-
|
|
1149
|
+
context2 += `
|
|
1148
1150
|
</comment_history>`;
|
|
1149
1151
|
}
|
|
1150
1152
|
}
|
|
1151
|
-
|
|
1153
|
+
context2 += `
|
|
1152
1154
|
</pull_request>`;
|
|
1153
|
-
return
|
|
1155
|
+
return context2;
|
|
1154
1156
|
}
|
|
1155
1157
|
/**
|
|
1156
1158
|
* No longer escaping XML - returning text as-is
|
|
@@ -2274,7 +2276,7 @@ var PRReviewer = class {
|
|
|
2274
2276
|
async reviewPR(owner, repo, prNumber, prInfo, options = {}) {
|
|
2275
2277
|
const { debug = false, config, checks } = options;
|
|
2276
2278
|
if (config && checks && checks.length > 0) {
|
|
2277
|
-
const { CheckExecutionEngine: CheckExecutionEngine2 } = await import("./check-execution-engine-
|
|
2279
|
+
const { CheckExecutionEngine: CheckExecutionEngine2 } = await import("./check-execution-engine-6QJXYYON.mjs");
|
|
2278
2280
|
const engine = new CheckExecutionEngine2();
|
|
2279
2281
|
const { results } = await engine.executeGroupedChecks(
|
|
2280
2282
|
prInfo,
|
|
@@ -3358,7 +3360,6 @@ var IssueFilter = class {
|
|
|
3358
3360
|
// src/providers/ai-check-provider.ts
|
|
3359
3361
|
import fs4 from "fs/promises";
|
|
3360
3362
|
import path6 from "path";
|
|
3361
|
-
import { trace, context as otContext } from "@opentelemetry/api";
|
|
3362
3363
|
|
|
3363
3364
|
// src/telemetry/state-capture.ts
|
|
3364
3365
|
var MAX_ATTRIBUTE_LENGTH = 1e4;
|
|
@@ -3385,20 +3386,20 @@ function safeSerialize(value, maxLength = MAX_ATTRIBUTE_LENGTH) {
|
|
|
3385
3386
|
return `[Error serializing: ${err instanceof Error ? err.message : String(err)}]`;
|
|
3386
3387
|
}
|
|
3387
3388
|
}
|
|
3388
|
-
function captureCheckInputContext(span,
|
|
3389
|
+
function captureCheckInputContext(span, context2) {
|
|
3389
3390
|
try {
|
|
3390
|
-
const keys = Object.keys(
|
|
3391
|
+
const keys = Object.keys(context2);
|
|
3391
3392
|
span.setAttribute("visor.check.input.keys", keys.join(","));
|
|
3392
3393
|
span.setAttribute("visor.check.input.count", keys.length);
|
|
3393
|
-
span.setAttribute("visor.check.input.context", safeSerialize(
|
|
3394
|
-
if (
|
|
3395
|
-
span.setAttribute("visor.check.input.pr", safeSerialize(
|
|
3394
|
+
span.setAttribute("visor.check.input.context", safeSerialize(context2));
|
|
3395
|
+
if (context2.pr) {
|
|
3396
|
+
span.setAttribute("visor.check.input.pr", safeSerialize(context2.pr, 1e3));
|
|
3396
3397
|
}
|
|
3397
|
-
if (
|
|
3398
|
-
span.setAttribute("visor.check.input.outputs", safeSerialize(
|
|
3398
|
+
if (context2.outputs) {
|
|
3399
|
+
span.setAttribute("visor.check.input.outputs", safeSerialize(context2.outputs, 5e3));
|
|
3399
3400
|
}
|
|
3400
|
-
if (
|
|
3401
|
-
span.setAttribute("visor.check.input.env_keys", Object.keys(
|
|
3401
|
+
if (context2.env) {
|
|
3402
|
+
span.setAttribute("visor.check.input.env_keys", Object.keys(context2.env).join(","));
|
|
3402
3403
|
}
|
|
3403
3404
|
} catch (err) {
|
|
3404
3405
|
try {
|
|
@@ -3841,7 +3842,7 @@ var AICheckProvider = class extends CheckProvider {
|
|
|
3841
3842
|
) : {}
|
|
3842
3843
|
};
|
|
3843
3844
|
try {
|
|
3844
|
-
const span = trace.getSpan(
|
|
3845
|
+
const span = trace.getSpan(context.active());
|
|
3845
3846
|
if (span) {
|
|
3846
3847
|
captureCheckInputContext(span, templateContext);
|
|
3847
3848
|
}
|
|
@@ -3915,7 +3916,7 @@ var AICheckProvider = class extends CheckProvider {
|
|
|
3915
3916
|
issues: filteredIssues
|
|
3916
3917
|
};
|
|
3917
3918
|
try {
|
|
3918
|
-
const span = trace.getSpan(
|
|
3919
|
+
const span = trace.getSpan(context.active());
|
|
3919
3920
|
if (span) {
|
|
3920
3921
|
captureProviderCall(
|
|
3921
3922
|
span,
|
|
@@ -3991,7 +3992,6 @@ var AICheckProvider = class extends CheckProvider {
|
|
|
3991
3992
|
};
|
|
3992
3993
|
|
|
3993
3994
|
// src/providers/http-check-provider.ts
|
|
3994
|
-
import { trace as trace2, context as otContext2 } from "@opentelemetry/api";
|
|
3995
3995
|
var HttpCheckProvider = class extends CheckProvider {
|
|
3996
3996
|
liquid;
|
|
3997
3997
|
constructor() {
|
|
@@ -4054,7 +4054,7 @@ var HttpCheckProvider = class extends CheckProvider {
|
|
|
4054
4054
|
metadata: config.metadata || {}
|
|
4055
4055
|
};
|
|
4056
4056
|
try {
|
|
4057
|
-
const span =
|
|
4057
|
+
const span = trace.getSpan(context.active());
|
|
4058
4058
|
if (span) {
|
|
4059
4059
|
captureCheckInputContext(span, templateContext);
|
|
4060
4060
|
}
|
|
@@ -4087,7 +4087,7 @@ var HttpCheckProvider = class extends CheckProvider {
|
|
|
4087
4087
|
issues: filteredIssues
|
|
4088
4088
|
};
|
|
4089
4089
|
try {
|
|
4090
|
-
const span =
|
|
4090
|
+
const span = trace.getSpan(context.active());
|
|
4091
4091
|
if (span) {
|
|
4092
4092
|
captureProviderCall(
|
|
4093
4093
|
span,
|
|
@@ -4622,8 +4622,8 @@ var LogCheckProvider = class extends CheckProvider {
|
|
|
4622
4622
|
};
|
|
4623
4623
|
}
|
|
4624
4624
|
buildTemplateContext(prInfo, dependencyResults, _includePrContext = true, _includeDependencies = true, includeMetadata = true, outputHistory) {
|
|
4625
|
-
const
|
|
4626
|
-
|
|
4625
|
+
const context2 = {};
|
|
4626
|
+
context2.pr = {
|
|
4627
4627
|
number: prInfo.number,
|
|
4628
4628
|
title: prInfo.title,
|
|
4629
4629
|
body: prInfo.body,
|
|
@@ -4640,13 +4640,13 @@ var LogCheckProvider = class extends CheckProvider {
|
|
|
4640
4640
|
changes: f.changes
|
|
4641
4641
|
}))
|
|
4642
4642
|
};
|
|
4643
|
-
|
|
4644
|
-
|
|
4643
|
+
context2.filenames = prInfo.files.map((f) => f.filename);
|
|
4644
|
+
context2.fileCount = prInfo.files.length;
|
|
4645
4645
|
if (dependencyResults) {
|
|
4646
4646
|
const dependencies = {};
|
|
4647
4647
|
const outputs = {};
|
|
4648
4648
|
const history = {};
|
|
4649
|
-
|
|
4649
|
+
context2.dependencyCount = dependencyResults.size;
|
|
4650
4650
|
for (const [checkName, result] of dependencyResults.entries()) {
|
|
4651
4651
|
dependencies[checkName] = {
|
|
4652
4652
|
issueCount: result.issues?.length || 0,
|
|
@@ -4662,11 +4662,11 @@ var LogCheckProvider = class extends CheckProvider {
|
|
|
4662
4662
|
}
|
|
4663
4663
|
}
|
|
4664
4664
|
outputs.history = history;
|
|
4665
|
-
|
|
4666
|
-
|
|
4665
|
+
context2.dependencies = dependencies;
|
|
4666
|
+
context2.outputs = outputs;
|
|
4667
4667
|
}
|
|
4668
4668
|
if (includeMetadata) {
|
|
4669
|
-
|
|
4669
|
+
context2.metadata = {
|
|
4670
4670
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4671
4671
|
executionTime: Date.now(),
|
|
4672
4672
|
nodeVersion: process.version,
|
|
@@ -4674,7 +4674,7 @@ var LogCheckProvider = class extends CheckProvider {
|
|
|
4674
4674
|
workingDirectory: process.cwd()
|
|
4675
4675
|
};
|
|
4676
4676
|
}
|
|
4677
|
-
return
|
|
4677
|
+
return context2;
|
|
4678
4678
|
}
|
|
4679
4679
|
formatLogOutput(level, message, templateContext, includePrContext, includeDependencies, includeMetadata) {
|
|
4680
4680
|
const sections = [];
|
|
@@ -5540,7 +5540,6 @@ var ClaudeCodeCheckProvider = class extends CheckProvider {
|
|
|
5540
5540
|
|
|
5541
5541
|
// src/providers/command-check-provider.ts
|
|
5542
5542
|
init_logger();
|
|
5543
|
-
import { trace as trace3, context as otContext3 } from "@opentelemetry/api";
|
|
5544
5543
|
var CommandCheckProvider = class extends CheckProvider {
|
|
5545
5544
|
liquid;
|
|
5546
5545
|
sandbox;
|
|
@@ -5603,7 +5602,7 @@ var CommandCheckProvider = class extends CheckProvider {
|
|
|
5603
5602
|
`\u{1F527} Debug: Template outputs keys: ${Object.keys(templateContext.outputs || {}).join(", ")}`
|
|
5604
5603
|
);
|
|
5605
5604
|
try {
|
|
5606
|
-
const span =
|
|
5605
|
+
const span = trace.getSpan(context.active());
|
|
5607
5606
|
if (span) {
|
|
5608
5607
|
captureCheckInputContext(span, templateContext);
|
|
5609
5608
|
}
|
|
@@ -6231,7 +6230,7 @@ ${bodyWithReturn}
|
|
|
6231
6230
|
...promoted
|
|
6232
6231
|
};
|
|
6233
6232
|
try {
|
|
6234
|
-
const span =
|
|
6233
|
+
const span = trace.getSpan(context.active());
|
|
6235
6234
|
if (span) {
|
|
6236
6235
|
captureCheckOutput(span, outputForDependents);
|
|
6237
6236
|
if (transformJs && output !== finalOutput) {
|
|
@@ -6757,7 +6756,7 @@ ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
|
|
|
6757
6756
|
}
|
|
6758
6757
|
return null;
|
|
6759
6758
|
}
|
|
6760
|
-
async renderCommandTemplate(template,
|
|
6759
|
+
async renderCommandTemplate(template, context2) {
|
|
6761
6760
|
try {
|
|
6762
6761
|
let tpl = template;
|
|
6763
6762
|
if (tpl.includes("{{")) {
|
|
@@ -6766,10 +6765,10 @@ ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
|
|
|
6766
6765
|
return `{{ ${fixed} }}`;
|
|
6767
6766
|
});
|
|
6768
6767
|
}
|
|
6769
|
-
let rendered = await this.liquid.parseAndRender(tpl,
|
|
6768
|
+
let rendered = await this.liquid.parseAndRender(tpl, context2);
|
|
6770
6769
|
if (/\{\{[\s\S]*?\}\}/.test(rendered)) {
|
|
6771
6770
|
try {
|
|
6772
|
-
rendered = this.renderWithJsExpressions(rendered,
|
|
6771
|
+
rendered = this.renderWithJsExpressions(rendered, context2);
|
|
6773
6772
|
} catch {
|
|
6774
6773
|
}
|
|
6775
6774
|
}
|
|
@@ -6777,18 +6776,18 @@ ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
|
|
|
6777
6776
|
} catch (error) {
|
|
6778
6777
|
logger.debug(`\u{1F527} Debug: Liquid templating failed, trying JS-expression fallback: ${error}`);
|
|
6779
6778
|
try {
|
|
6780
|
-
return this.renderWithJsExpressions(template,
|
|
6779
|
+
return this.renderWithJsExpressions(template, context2);
|
|
6781
6780
|
} catch {
|
|
6782
6781
|
return template;
|
|
6783
6782
|
}
|
|
6784
6783
|
}
|
|
6785
6784
|
}
|
|
6786
|
-
renderWithJsExpressions(template,
|
|
6785
|
+
renderWithJsExpressions(template, context2) {
|
|
6787
6786
|
const scope = {
|
|
6788
|
-
pr:
|
|
6789
|
-
files:
|
|
6790
|
-
outputs:
|
|
6791
|
-
env:
|
|
6787
|
+
pr: context2.pr,
|
|
6788
|
+
files: context2.files,
|
|
6789
|
+
outputs: context2.outputs,
|
|
6790
|
+
env: context2.env
|
|
6792
6791
|
};
|
|
6793
6792
|
const expressionRegex = /\{\{\s*([^{}]+?)\s*\}\}/g;
|
|
6794
6793
|
return template.replace(expressionRegex, (_match, expr) => {
|
|
@@ -6938,16 +6937,16 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
6938
6937
|
);
|
|
6939
6938
|
return value;
|
|
6940
6939
|
}
|
|
6941
|
-
async handleSet(store, key, config, namespace,
|
|
6942
|
-
const value = await this.computeValue(config,
|
|
6940
|
+
async handleSet(store, key, config, namespace, context2) {
|
|
6941
|
+
const value = await this.computeValue(config, context2);
|
|
6943
6942
|
await store.set(key, value, namespace);
|
|
6944
6943
|
logger.debug(
|
|
6945
6944
|
`Memory SET: ${namespace || store.getDefaultNamespace()}.${key} = ${JSON.stringify(value)}`
|
|
6946
6945
|
);
|
|
6947
6946
|
return value;
|
|
6948
6947
|
}
|
|
6949
|
-
async handleAppend(store, key, config, namespace,
|
|
6950
|
-
const value = await this.computeValue(config,
|
|
6948
|
+
async handleAppend(store, key, config, namespace, context2) {
|
|
6949
|
+
const value = await this.computeValue(config, context2);
|
|
6951
6950
|
await store.append(key, value, namespace);
|
|
6952
6951
|
const result = store.get(key, namespace);
|
|
6953
6952
|
logger.debug(
|
|
@@ -6955,10 +6954,10 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
6955
6954
|
);
|
|
6956
6955
|
return result;
|
|
6957
6956
|
}
|
|
6958
|
-
async handleIncrement(store, key, config, namespace,
|
|
6957
|
+
async handleIncrement(store, key, config, namespace, context2) {
|
|
6959
6958
|
let amount = 1;
|
|
6960
6959
|
if (config.value !== void 0 || config.value_js) {
|
|
6961
|
-
const computedValue = await this.computeValue(config,
|
|
6960
|
+
const computedValue = await this.computeValue(config, context2);
|
|
6962
6961
|
if (typeof computedValue === "number") {
|
|
6963
6962
|
amount = computedValue;
|
|
6964
6963
|
} else {
|
|
@@ -6987,11 +6986,11 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
6987
6986
|
logger.debug(`Memory LIST: ${namespace || store.getDefaultNamespace()} (${keys.length} keys)`);
|
|
6988
6987
|
return keys;
|
|
6989
6988
|
}
|
|
6990
|
-
async handleExecJs(store, config,
|
|
6989
|
+
async handleExecJs(store, config, context2) {
|
|
6991
6990
|
const script = config.memory_js;
|
|
6992
6991
|
const pendingOps = [];
|
|
6993
6992
|
const enhancedContext = {
|
|
6994
|
-
...
|
|
6993
|
+
...context2,
|
|
6995
6994
|
memory: {
|
|
6996
6995
|
get: (key, ns) => store.get(key, ns),
|
|
6997
6996
|
set: (key, value, ns) => {
|
|
@@ -7094,34 +7093,34 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
7094
7093
|
/**
|
|
7095
7094
|
* Compute value from config using value, value_js, transform, or transform_js
|
|
7096
7095
|
*/
|
|
7097
|
-
async computeValue(config,
|
|
7096
|
+
async computeValue(config, context2) {
|
|
7098
7097
|
let value;
|
|
7099
7098
|
if (config.value_js && typeof config.value_js === "string") {
|
|
7100
|
-
value = this.evaluateJavaScript(config.value_js,
|
|
7099
|
+
value = this.evaluateJavaScript(config.value_js, context2);
|
|
7101
7100
|
} else {
|
|
7102
7101
|
value = config.value;
|
|
7103
7102
|
}
|
|
7104
7103
|
if (config.transform && typeof config.transform === "string") {
|
|
7105
7104
|
const rendered = await this.liquid.parseAndRender(config.transform, {
|
|
7106
|
-
...
|
|
7105
|
+
...context2,
|
|
7107
7106
|
value
|
|
7108
7107
|
});
|
|
7109
7108
|
value = rendered;
|
|
7110
7109
|
}
|
|
7111
7110
|
if (config.transform_js && typeof config.transform_js === "string") {
|
|
7112
|
-
value = this.evaluateJavaScript(config.transform_js, { ...
|
|
7111
|
+
value = this.evaluateJavaScript(config.transform_js, { ...context2, value });
|
|
7113
7112
|
}
|
|
7114
7113
|
return value;
|
|
7115
7114
|
}
|
|
7116
7115
|
/**
|
|
7117
7116
|
* Evaluate JavaScript expression in context using SandboxJS for secure execution
|
|
7118
7117
|
*/
|
|
7119
|
-
evaluateJavaScript(expression,
|
|
7118
|
+
evaluateJavaScript(expression, context2) {
|
|
7120
7119
|
if (!this.sandbox) {
|
|
7121
7120
|
this.sandbox = this.createSecureSandbox();
|
|
7122
7121
|
}
|
|
7123
7122
|
try {
|
|
7124
|
-
const scope = { ...
|
|
7123
|
+
const scope = { ...context2 };
|
|
7125
7124
|
return compileAndRun(this.sandbox, `return (${expression});`, scope, {
|
|
7126
7125
|
injectLog: true,
|
|
7127
7126
|
wrapFunction: false,
|
|
@@ -7136,12 +7135,12 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
7136
7135
|
* Evaluate JavaScript block (multi-line script) using SandboxJS for secure execution
|
|
7137
7136
|
* Unlike evaluateJavaScript, this supports full scripts with statements, not just expressions
|
|
7138
7137
|
*/
|
|
7139
|
-
evaluateJavaScriptBlock(script,
|
|
7138
|
+
evaluateJavaScriptBlock(script, context2) {
|
|
7140
7139
|
if (!this.sandbox) {
|
|
7141
7140
|
this.sandbox = this.createSecureSandbox();
|
|
7142
7141
|
}
|
|
7143
7142
|
try {
|
|
7144
|
-
const scope = { ...
|
|
7143
|
+
const scope = { ...context2 };
|
|
7145
7144
|
return compileAndRun(this.sandbox, script, scope, {
|
|
7146
7145
|
injectLog: true,
|
|
7147
7146
|
wrapFunction: false,
|
|
@@ -7157,8 +7156,8 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
7157
7156
|
* Build template context for Liquid and JS evaluation
|
|
7158
7157
|
*/
|
|
7159
7158
|
buildTemplateContext(prInfo, dependencyResults, memoryStore, outputHistory) {
|
|
7160
|
-
const
|
|
7161
|
-
|
|
7159
|
+
const context2 = {};
|
|
7160
|
+
context2.pr = {
|
|
7162
7161
|
number: prInfo.number,
|
|
7163
7162
|
title: prInfo.title,
|
|
7164
7163
|
body: prInfo.body,
|
|
@@ -7189,16 +7188,16 @@ var MemoryCheckProvider = class extends CheckProvider {
|
|
|
7189
7188
|
}
|
|
7190
7189
|
}
|
|
7191
7190
|
outputs.history = history;
|
|
7192
|
-
|
|
7191
|
+
context2.outputs = outputs;
|
|
7193
7192
|
if (memoryStore) {
|
|
7194
|
-
|
|
7193
|
+
context2.memory = {
|
|
7195
7194
|
get: (key, ns) => memoryStore.get(key, ns),
|
|
7196
7195
|
has: (key, ns) => memoryStore.has(key, ns),
|
|
7197
7196
|
list: (ns) => memoryStore.list(ns),
|
|
7198
7197
|
getAll: (ns) => memoryStore.getAll(ns)
|
|
7199
7198
|
};
|
|
7200
7199
|
}
|
|
7201
|
-
return
|
|
7200
|
+
return context2;
|
|
7202
7201
|
}
|
|
7203
7202
|
getSupportedConfigKeys() {
|
|
7204
7203
|
return [
|
|
@@ -8111,14 +8110,14 @@ var HumanInputCheckProvider = class _HumanInputCheckProvider extends CheckProvid
|
|
|
8111
8110
|
/**
|
|
8112
8111
|
* Get user input through various methods
|
|
8113
8112
|
*/
|
|
8114
|
-
async getUserInput(checkName, config,
|
|
8113
|
+
async getUserInput(checkName, config, context2) {
|
|
8115
8114
|
const prompt = config.prompt || "Please provide input:";
|
|
8116
8115
|
const placeholder = config.placeholder || "Enter your response...";
|
|
8117
8116
|
const allowEmpty = config.allow_empty ?? false;
|
|
8118
8117
|
const multiline = config.multiline ?? false;
|
|
8119
8118
|
const timeout = config.timeout ? config.timeout * 1e3 : void 0;
|
|
8120
8119
|
const defaultValue = config.default;
|
|
8121
|
-
const cliMessage =
|
|
8120
|
+
const cliMessage = context2?.cliMessage ?? _HumanInputCheckProvider.cliMessage;
|
|
8122
8121
|
if (cliMessage !== void 0) {
|
|
8123
8122
|
const message = cliMessage;
|
|
8124
8123
|
if (this.looksLikePath(message)) {
|
|
@@ -8133,7 +8132,7 @@ var HumanInputCheckProvider = class _HumanInputCheckProvider extends CheckProvid
|
|
|
8133
8132
|
if (stdinInput !== null && stdinInput.length > 0) {
|
|
8134
8133
|
return stdinInput;
|
|
8135
8134
|
}
|
|
8136
|
-
const hooks =
|
|
8135
|
+
const hooks = context2?.hooks ?? _HumanInputCheckProvider.hooks;
|
|
8137
8136
|
if (hooks?.onHumanInput) {
|
|
8138
8137
|
const request = {
|
|
8139
8138
|
checkId: checkName,
|
|
@@ -8182,10 +8181,10 @@ var HumanInputCheckProvider = class _HumanInputCheckProvider extends CheckProvid
|
|
|
8182
8181
|
);
|
|
8183
8182
|
}
|
|
8184
8183
|
}
|
|
8185
|
-
async execute(_prInfo, config, _dependencyResults,
|
|
8184
|
+
async execute(_prInfo, config, _dependencyResults, context2) {
|
|
8186
8185
|
const checkName = config.checkName || "human-input";
|
|
8187
8186
|
try {
|
|
8188
|
-
const userInput = await this.getUserInput(checkName, config,
|
|
8187
|
+
const userInput = await this.getUserInput(checkName, config, context2);
|
|
8189
8188
|
const sanitizedInput = this.sanitizeInput(userInput);
|
|
8190
8189
|
return {
|
|
8191
8190
|
issues: [],
|
|
@@ -8581,7 +8580,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8581
8580
|
* Evaluate simple fail_if condition
|
|
8582
8581
|
*/
|
|
8583
8582
|
async evaluateSimpleCondition(checkName, checkSchema, checkGroup, reviewSummary, expression, previousOutputs, authorAssociation) {
|
|
8584
|
-
const
|
|
8583
|
+
const context2 = this.buildEvaluationContext(
|
|
8585
8584
|
checkName,
|
|
8586
8585
|
checkSchema,
|
|
8587
8586
|
checkGroup,
|
|
@@ -8591,17 +8590,17 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8591
8590
|
);
|
|
8592
8591
|
try {
|
|
8593
8592
|
try {
|
|
8594
|
-
const isObj =
|
|
8595
|
-
const keys = isObj ? Object.keys(
|
|
8593
|
+
const isObj = context2.output && typeof context2.output === "object";
|
|
8594
|
+
const keys = isObj ? Object.keys(context2.output).join(",") : typeof context2.output;
|
|
8596
8595
|
let errorVal = void 0;
|
|
8597
|
-
if (isObj &&
|
|
8598
|
-
errorVal =
|
|
8596
|
+
if (isObj && context2.output.error !== void 0)
|
|
8597
|
+
errorVal = context2.output.error;
|
|
8599
8598
|
(init_logger(), __toCommonJS(logger_exports)).logger.debug(
|
|
8600
8599
|
` fail_if: evaluating '${expression}' with output keys=${keys} error=${String(errorVal)}`
|
|
8601
8600
|
);
|
|
8602
8601
|
} catch {
|
|
8603
8602
|
}
|
|
8604
|
-
const res = this.evaluateExpression(expression,
|
|
8603
|
+
const res = this.evaluateExpression(expression, context2);
|
|
8605
8604
|
if (res === true) {
|
|
8606
8605
|
try {
|
|
8607
8606
|
addEvent("fail_if.triggered", {
|
|
@@ -8660,7 +8659,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8660
8659
|
* Evaluate if condition to determine whether a check should run
|
|
8661
8660
|
*/
|
|
8662
8661
|
async evaluateIfCondition(checkName, expression, contextData) {
|
|
8663
|
-
const
|
|
8662
|
+
const context2 = {
|
|
8664
8663
|
// Check metadata
|
|
8665
8664
|
checkName,
|
|
8666
8665
|
// Git context
|
|
@@ -8709,7 +8708,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8709
8708
|
}
|
|
8710
8709
|
};
|
|
8711
8710
|
try {
|
|
8712
|
-
return this.evaluateExpression(expression,
|
|
8711
|
+
return this.evaluateExpression(expression, context2);
|
|
8713
8712
|
} catch (error) {
|
|
8714
8713
|
console.warn(`Failed to evaluate if expression for check '${checkName}': ${error}`);
|
|
8715
8714
|
return true;
|
|
@@ -8719,7 +8718,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8719
8718
|
* Evaluate all failure conditions for a check result
|
|
8720
8719
|
*/
|
|
8721
8720
|
async evaluateConditions(checkName, checkSchema, checkGroup, reviewSummary, globalConditions, checkConditions, previousOutputs, authorAssociation) {
|
|
8722
|
-
const
|
|
8721
|
+
const context2 = this.buildEvaluationContext(
|
|
8723
8722
|
checkName,
|
|
8724
8723
|
checkSchema,
|
|
8725
8724
|
checkGroup,
|
|
@@ -8729,11 +8728,11 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8729
8728
|
);
|
|
8730
8729
|
const results = [];
|
|
8731
8730
|
if (globalConditions) {
|
|
8732
|
-
const globalResults = await this.evaluateConditionSet(globalConditions,
|
|
8731
|
+
const globalResults = await this.evaluateConditionSet(globalConditions, context2, "global");
|
|
8733
8732
|
results.push(...globalResults);
|
|
8734
8733
|
}
|
|
8735
8734
|
if (checkConditions) {
|
|
8736
|
-
const checkResults = await this.evaluateConditionSet(checkConditions,
|
|
8735
|
+
const checkResults = await this.evaluateConditionSet(checkConditions, context2, "check");
|
|
8737
8736
|
const overriddenConditions = new Set(Object.keys(checkConditions));
|
|
8738
8737
|
const filteredResults = results.filter(
|
|
8739
8738
|
(result) => !overriddenConditions.has(result.conditionName)
|
|
@@ -8745,7 +8744,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8745
8744
|
if (checkName === "B") {
|
|
8746
8745
|
console.error(
|
|
8747
8746
|
`\u{1F527} Debug: fail_if results for ${checkName}: ${JSON.stringify(results)} context.output=${JSON.stringify(
|
|
8748
|
-
|
|
8747
|
+
context2.output
|
|
8749
8748
|
)}`
|
|
8750
8749
|
);
|
|
8751
8750
|
}
|
|
@@ -8756,12 +8755,12 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8756
8755
|
/**
|
|
8757
8756
|
* Evaluate a set of failure conditions
|
|
8758
8757
|
*/
|
|
8759
|
-
async evaluateConditionSet(conditions,
|
|
8758
|
+
async evaluateConditionSet(conditions, context2, source) {
|
|
8760
8759
|
const results = [];
|
|
8761
8760
|
for (const [conditionName, condition] of Object.entries(conditions)) {
|
|
8762
8761
|
try {
|
|
8763
8762
|
addEvent("fail_if.evaluated", {
|
|
8764
|
-
check:
|
|
8763
|
+
check: context2.checkName,
|
|
8765
8764
|
scope: source,
|
|
8766
8765
|
name: conditionName,
|
|
8767
8766
|
expression: this.extractExpression(condition)
|
|
@@ -8772,12 +8771,12 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8772
8771
|
const { emitNdjsonSpanWithEvents: emitNdjsonSpanWithEvents2 } = (init_fallback_ndjson(), __toCommonJS(fallback_ndjson_exports));
|
|
8773
8772
|
emitNdjsonSpanWithEvents2(
|
|
8774
8773
|
"visor.fail_if",
|
|
8775
|
-
{ check:
|
|
8774
|
+
{ check: context2.checkName || "unknown", scope: source, name: conditionName },
|
|
8776
8775
|
[
|
|
8777
8776
|
{
|
|
8778
8777
|
name: "fail_if.evaluated",
|
|
8779
8778
|
attrs: {
|
|
8780
|
-
check:
|
|
8779
|
+
check: context2.checkName,
|
|
8781
8780
|
scope: source,
|
|
8782
8781
|
name: conditionName,
|
|
8783
8782
|
expression: this.extractExpression(condition)
|
|
@@ -8788,12 +8787,12 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8788
8787
|
} catch {
|
|
8789
8788
|
}
|
|
8790
8789
|
try {
|
|
8791
|
-
const result = await this.evaluateSingleCondition(conditionName, condition,
|
|
8790
|
+
const result = await this.evaluateSingleCondition(conditionName, condition, context2);
|
|
8792
8791
|
results.push(result);
|
|
8793
8792
|
if (result.failed) {
|
|
8794
8793
|
try {
|
|
8795
8794
|
addEvent("fail_if.triggered", {
|
|
8796
|
-
check:
|
|
8795
|
+
check: context2.checkName,
|
|
8797
8796
|
scope: source,
|
|
8798
8797
|
name: conditionName,
|
|
8799
8798
|
expression: result.expression,
|
|
@@ -8803,7 +8802,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8803
8802
|
} catch {
|
|
8804
8803
|
}
|
|
8805
8804
|
try {
|
|
8806
|
-
addFailIfTriggered(
|
|
8805
|
+
addFailIfTriggered(context2.checkName || "unknown", source);
|
|
8807
8806
|
} catch {
|
|
8808
8807
|
}
|
|
8809
8808
|
}
|
|
@@ -8823,11 +8822,11 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8823
8822
|
/**
|
|
8824
8823
|
* Evaluate a single failure condition
|
|
8825
8824
|
*/
|
|
8826
|
-
async evaluateSingleCondition(conditionName, condition,
|
|
8825
|
+
async evaluateSingleCondition(conditionName, condition, context2) {
|
|
8827
8826
|
const expression = this.extractExpression(condition);
|
|
8828
8827
|
const config = this.extractConditionConfig(condition);
|
|
8829
8828
|
try {
|
|
8830
|
-
const failed = this.evaluateExpression(expression,
|
|
8829
|
+
const failed = this.evaluateExpression(expression, context2);
|
|
8831
8830
|
return {
|
|
8832
8831
|
conditionName,
|
|
8833
8832
|
failed,
|
|
@@ -8846,7 +8845,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8846
8845
|
* Secure expression evaluation using SandboxJS
|
|
8847
8846
|
* Supports the same GitHub Actions-style functions as the previous implementation
|
|
8848
8847
|
*/
|
|
8849
|
-
evaluateExpression(condition,
|
|
8848
|
+
evaluateExpression(condition, context2) {
|
|
8850
8849
|
try {
|
|
8851
8850
|
const normalize2 = (expr) => {
|
|
8852
8851
|
const trimmed = expr.trim();
|
|
@@ -8891,7 +8890,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8891
8890
|
const hasIssueWith = hasIssue;
|
|
8892
8891
|
const hasFileWith = hasFileMatching;
|
|
8893
8892
|
const permissionHelpers = createPermissionHelpers(
|
|
8894
|
-
|
|
8893
|
+
context2.authorAssociation,
|
|
8895
8894
|
detectLocalMode()
|
|
8896
8895
|
);
|
|
8897
8896
|
const hasMinPermission = permissionHelpers.hasMinPermission;
|
|
@@ -8900,35 +8899,35 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
8900
8899
|
const isCollaborator = permissionHelpers.isCollaborator;
|
|
8901
8900
|
const isContributor = permissionHelpers.isContributor;
|
|
8902
8901
|
const isFirstTimer = permissionHelpers.isFirstTimer;
|
|
8903
|
-
const output =
|
|
8902
|
+
const output = context2.output || {};
|
|
8904
8903
|
const issues = output.issues || [];
|
|
8905
|
-
const metadata =
|
|
8906
|
-
checkName:
|
|
8907
|
-
schema:
|
|
8908
|
-
group:
|
|
8904
|
+
const metadata = context2.metadata || {
|
|
8905
|
+
checkName: context2.checkName || "",
|
|
8906
|
+
schema: context2.schema || "",
|
|
8907
|
+
group: context2.group || "",
|
|
8909
8908
|
criticalIssues: issues.filter((i) => i.severity === "critical").length,
|
|
8910
8909
|
errorIssues: issues.filter((i) => i.severity === "error").length,
|
|
8911
8910
|
warningIssues: issues.filter((i) => i.severity === "warning").length,
|
|
8912
8911
|
infoIssues: issues.filter((i) => i.severity === "info").length,
|
|
8913
8912
|
totalIssues: issues.length,
|
|
8914
|
-
hasChanges:
|
|
8913
|
+
hasChanges: context2.hasChanges || false
|
|
8915
8914
|
};
|
|
8916
8915
|
const criticalIssues = metadata.criticalIssues;
|
|
8917
8916
|
const errorIssues = metadata.errorIssues;
|
|
8918
8917
|
const totalIssues = metadata.totalIssues;
|
|
8919
8918
|
const warningIssues = metadata.warningIssues;
|
|
8920
8919
|
const infoIssues = metadata.infoIssues;
|
|
8921
|
-
const checkName =
|
|
8922
|
-
const schema =
|
|
8923
|
-
const group =
|
|
8924
|
-
const branch =
|
|
8925
|
-
const baseBranch =
|
|
8926
|
-
const filesChanged =
|
|
8927
|
-
const filesCount =
|
|
8928
|
-
const event =
|
|
8929
|
-
const env =
|
|
8930
|
-
const outputs =
|
|
8931
|
-
const debugData =
|
|
8920
|
+
const checkName = context2.checkName || "";
|
|
8921
|
+
const schema = context2.schema || "";
|
|
8922
|
+
const group = context2.group || "";
|
|
8923
|
+
const branch = context2.branch || "unknown";
|
|
8924
|
+
const baseBranch = context2.baseBranch || "main";
|
|
8925
|
+
const filesChanged = context2.filesChanged || [];
|
|
8926
|
+
const filesCount = context2.filesCount || 0;
|
|
8927
|
+
const event = context2.event || "manual";
|
|
8928
|
+
const env = context2.env || {};
|
|
8929
|
+
const outputs = context2.outputs || {};
|
|
8930
|
+
const debugData = context2.debug || null;
|
|
8932
8931
|
const memoryStore = MemoryStore.getInstance();
|
|
8933
8932
|
const memoryAccessor = {
|
|
8934
8933
|
get: (key, ns) => memoryStore.get(key, ns),
|
|
@@ -9129,7 +9128,7 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
9129
9128
|
} catch {
|
|
9130
9129
|
}
|
|
9131
9130
|
const memoryStore = MemoryStore.getInstance();
|
|
9132
|
-
const
|
|
9131
|
+
const context2 = {
|
|
9133
9132
|
output: aggregatedOutput,
|
|
9134
9133
|
outputs: (() => {
|
|
9135
9134
|
if (!previousOutputs) return {};
|
|
@@ -9154,14 +9153,14 @@ var FailureConditionEvaluator = class _FailureConditionEvaluator {
|
|
|
9154
9153
|
authorAssociation
|
|
9155
9154
|
};
|
|
9156
9155
|
if (debug) {
|
|
9157
|
-
|
|
9156
|
+
context2.debug = {
|
|
9158
9157
|
errors: debug.errors || [],
|
|
9159
9158
|
processingTime: debug.processingTime || 0,
|
|
9160
9159
|
provider: debug.provider || "unknown",
|
|
9161
9160
|
model: debug.model || "unknown"
|
|
9162
9161
|
};
|
|
9163
9162
|
}
|
|
9164
|
-
return
|
|
9163
|
+
return context2;
|
|
9165
9164
|
}
|
|
9166
9165
|
// Minimal JSON-from-end extractor for fail_if context fallback
|
|
9167
9166
|
tryExtractJsonFromEnd(text) {
|
|
@@ -9678,7 +9677,6 @@ Please check your configuration and try again.`
|
|
|
9678
9677
|
// src/check-execution-engine.ts
|
|
9679
9678
|
init_logger();
|
|
9680
9679
|
init_fallback_ndjson();
|
|
9681
|
-
import { trace as trace4, context as otContext4 } from "@opentelemetry/api";
|
|
9682
9680
|
function getSafeEnvironmentVariables() {
|
|
9683
9681
|
const safeEnvVars = [
|
|
9684
9682
|
"CI",
|
|
@@ -9755,8 +9753,8 @@ var CheckExecutionEngine = class _CheckExecutionEngine {
|
|
|
9755
9753
|
* Set execution context for providers (CLI message, hooks, etc.)
|
|
9756
9754
|
* This allows passing state without using static properties
|
|
9757
9755
|
*/
|
|
9758
|
-
setExecutionContext(
|
|
9759
|
-
this.executionContext =
|
|
9756
|
+
setExecutionContext(context2) {
|
|
9757
|
+
this.executionContext = context2;
|
|
9760
9758
|
}
|
|
9761
9759
|
/**
|
|
9762
9760
|
* Lazily create a secure sandbox for routing JS (goto_js, run_js)
|
|
@@ -10052,7 +10050,7 @@ ${expr}`;
|
|
|
10052
10050
|
});
|
|
10053
10051
|
} catch {
|
|
10054
10052
|
}
|
|
10055
|
-
const
|
|
10053
|
+
const context2 = {
|
|
10056
10054
|
...sessionInfo,
|
|
10057
10055
|
...this.executionContext
|
|
10058
10056
|
};
|
|
@@ -10065,7 +10063,7 @@ ${expr}`;
|
|
|
10065
10063
|
},
|
|
10066
10064
|
async () => {
|
|
10067
10065
|
try {
|
|
10068
|
-
return await provider.execute(prInfo, providerConfig, dependencyResults,
|
|
10066
|
+
return await provider.execute(prInfo, providerConfig, dependencyResults, context2);
|
|
10069
10067
|
} finally {
|
|
10070
10068
|
try {
|
|
10071
10069
|
emitNdjsonSpanWithEvents("visor.check", { "visor.check.id": checkName }, [
|
|
@@ -11217,7 +11215,7 @@ ${expr}`;
|
|
|
11217
11215
|
}
|
|
11218
11216
|
const finalRendered = rendered.trim();
|
|
11219
11217
|
try {
|
|
11220
|
-
const { emitMermaidFromMarkdown } = await import("./mermaid-telemetry-
|
|
11218
|
+
const { emitMermaidFromMarkdown } = await import("./mermaid-telemetry-YCTIG76M.mjs");
|
|
11221
11219
|
emitMermaidFromMarkdown(checkName, finalRendered, "content");
|
|
11222
11220
|
} catch {
|
|
11223
11221
|
}
|
|
@@ -11797,7 +11795,7 @@ ${expr}`;
|
|
|
11797
11795
|
} catch {
|
|
11798
11796
|
}
|
|
11799
11797
|
try {
|
|
11800
|
-
const span =
|
|
11798
|
+
const span = trace.getSpan(context.active());
|
|
11801
11799
|
if (span) {
|
|
11802
11800
|
captureForEachState(span, forEachItems, itemIndex, item);
|
|
11803
11801
|
}
|
|
@@ -12624,7 +12622,7 @@ ${error.stack || ""}` : String(error);
|
|
|
12624
12622
|
}
|
|
12625
12623
|
results.set(checkName, reviewResult);
|
|
12626
12624
|
try {
|
|
12627
|
-
const span =
|
|
12625
|
+
const span = trace.getSpan(context.active());
|
|
12628
12626
|
if (span) {
|
|
12629
12627
|
const allOutputs = {};
|
|
12630
12628
|
results.forEach((result2, name) => {
|
|
@@ -14091,4 +14089,4 @@ ${result.value.result.debug.rawResponse}`;
|
|
|
14091
14089
|
export {
|
|
14092
14090
|
CheckExecutionEngine
|
|
14093
14091
|
};
|
|
14094
|
-
//# sourceMappingURL=chunk-
|
|
14092
|
+
//# sourceMappingURL=chunk-O4RP4BRH.mjs.map
|