@probelabs/visor 0.1.130 → 0.1.131
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/README.md +7 -0
- package/defaults/visor.yaml +5 -2
- package/dist/ai-review-service.d.ts +2 -0
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config/cli-handler.d.ts +5 -0
- package/dist/config/cli-handler.d.ts.map +1 -0
- package/dist/config/config-reloader.d.ts +24 -0
- package/dist/config/config-reloader.d.ts.map +1 -0
- package/dist/config/config-snapshot-store.d.ts +21 -0
- package/dist/config/config-snapshot-store.d.ts.map +1 -0
- package/dist/config/config-watcher.d.ts +19 -0
- package/dist/config/config-watcher.d.ts.map +1 -0
- package/dist/config/types.d.ts +16 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/defaults/visor.yaml +5 -2
- package/dist/docs/ai-configuration.md +139 -0
- package/dist/docs/ai-custom-tools.md +30 -0
- package/dist/docs/capacity-planning.md +359 -0
- package/dist/docs/commands.md +35 -0
- package/dist/docs/database-operations.md +487 -0
- package/dist/docs/index.md +6 -1
- package/dist/docs/licensing.md +372 -0
- package/dist/docs/production-deployment.md +583 -0
- package/dist/examples/ai-with-bash.yaml +17 -0
- package/dist/generated/config-schema.d.ts +4 -0
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/index.js +9945 -10907
- package/dist/liquid-extensions.d.ts +7 -0
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/output/traces/{run-2026-02-11T16-20-59-999Z.ndjson → run-2026-02-15T19-14-20-379Z.ndjson} +84 -84
- package/dist/{traces/run-2026-02-11T16-21-47-711Z.ndjson → output/traces/run-2026-02-15T19-15-09-410Z.ndjson} +1019 -1019
- package/dist/providers/ai-check-provider.d.ts +5 -0
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/scheduler/schedule-tool.d.ts.map +1 -1
- package/dist/sdk/{check-provider-registry-PANIXYRB.mjs → check-provider-registry-AAPPJ4CP.mjs} +7 -7
- package/dist/sdk/{check-provider-registry-M3Y6JMTW.mjs → check-provider-registry-S7BMQ2FC.mjs} +7 -7
- package/dist/sdk/check-provider-registry-ZOLEYDKM.mjs +28 -0
- package/dist/sdk/{chunk-VMLORODQ.mjs → chunk-2GCSK3PD.mjs} +4 -4
- package/dist/sdk/{chunk-EUUAQBTW.mjs → chunk-6ZZ4DPAA.mjs} +240 -48
- package/dist/sdk/chunk-6ZZ4DPAA.mjs.map +1 -0
- package/dist/sdk/{chunk-HOKQOO3G.mjs → chunk-EBTD2D4L.mjs} +2 -2
- package/dist/sdk/chunk-LDFUW34H.mjs +39912 -0
- package/dist/sdk/chunk-LDFUW34H.mjs.map +1 -0
- package/dist/sdk/{chunk-UCNT3PDT.mjs → chunk-LQ5B4T6L.mjs} +5 -1
- package/dist/sdk/chunk-LQ5B4T6L.mjs.map +1 -0
- package/dist/sdk/{chunk-S6CD7GFM.mjs → chunk-MQ57AB4U.mjs} +211 -35
- package/dist/sdk/chunk-MQ57AB4U.mjs.map +1 -0
- package/dist/sdk/chunk-N4I6ZDCJ.mjs +436 -0
- package/dist/sdk/chunk-N4I6ZDCJ.mjs.map +1 -0
- package/dist/sdk/chunk-OMFPM576.mjs +739 -0
- package/dist/sdk/chunk-OMFPM576.mjs.map +1 -0
- package/dist/sdk/chunk-RI77TA6V.mjs +436 -0
- package/dist/sdk/chunk-RI77TA6V.mjs.map +1 -0
- package/dist/sdk/chunk-VO4N6TEL.mjs +1502 -0
- package/dist/sdk/chunk-VO4N6TEL.mjs.map +1 -0
- package/dist/sdk/{chunk-V2IV3ILA.mjs → chunk-XJQKTK6V.mjs} +31 -5
- package/dist/sdk/chunk-XJQKTK6V.mjs.map +1 -0
- package/dist/sdk/{config-OGOS4ZU4.mjs → config-4EG7IQIU.mjs} +2 -2
- package/dist/sdk/{failure-condition-evaluator-HC3M5377.mjs → failure-condition-evaluator-GLHZZF47.mjs} +3 -3
- package/dist/sdk/failure-condition-evaluator-KN55WXRO.mjs +17 -0
- package/dist/sdk/{github-frontend-E2KJSC3Y.mjs → github-frontend-F4TE2JY7.mjs} +3 -3
- package/dist/sdk/github-frontend-HCOKL53D.mjs +1356 -0
- package/dist/sdk/github-frontend-HCOKL53D.mjs.map +1 -0
- package/dist/sdk/{host-EE6EJ2FM.mjs → host-SAT6RHDX.mjs} +2 -2
- package/dist/sdk/host-VA3ET7N6.mjs +63 -0
- package/dist/sdk/host-VA3ET7N6.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-E4EUOCES.mjs → liquid-extensions-YDIIH33Q.mjs} +2 -2
- package/dist/sdk/{routing-OZQWAGAI.mjs → routing-KFYQGOYU.mjs} +5 -5
- package/dist/sdk/routing-OXQKETSA.mjs +25 -0
- package/dist/sdk/{schedule-tool-handler-IEB2VS7O.mjs → schedule-tool-handler-G353DHS6.mjs} +7 -7
- package/dist/sdk/{schedule-tool-handler-B7TMSG6A.mjs → schedule-tool-handler-OQF57URO.mjs} +7 -7
- package/dist/sdk/schedule-tool-handler-PJVKWSYX.mjs +38 -0
- package/dist/sdk/schedule-tool-handler-PJVKWSYX.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +15 -0
- package/dist/sdk/sdk.d.ts +15 -0
- package/dist/sdk/sdk.js +621 -183
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +6 -6
- package/dist/sdk/{trace-helpers-PP3YHTAM.mjs → trace-helpers-LOPBHYYX.mjs} +4 -2
- package/dist/sdk/trace-helpers-LOPBHYYX.mjs.map +1 -0
- package/dist/sdk/trace-helpers-R2ETIEC2.mjs +25 -0
- package/dist/sdk/trace-helpers-R2ETIEC2.mjs.map +1 -0
- package/dist/sdk/{workflow-check-provider-2ET3SFZH.mjs → workflow-check-provider-57KAR4Y4.mjs} +7 -7
- package/dist/sdk/workflow-check-provider-57KAR4Y4.mjs.map +1 -0
- package/dist/sdk/{workflow-check-provider-HB4XTD4Z.mjs → workflow-check-provider-LRWD52WN.mjs} +7 -7
- package/dist/sdk/workflow-check-provider-LRWD52WN.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-N2DRFQDB.mjs +28 -0
- package/dist/sdk/workflow-check-provider-N2DRFQDB.mjs.map +1 -0
- package/dist/slack/socket-runner.d.ts.map +1 -1
- package/dist/state-machine/context/build-engine-context.d.ts.map +1 -1
- package/dist/state-machine/runner.d.ts.map +1 -1
- package/dist/state-machine/states/completed.d.ts.map +1 -1
- package/dist/telemetry/trace-helpers.d.ts +5 -0
- package/dist/telemetry/trace-helpers.d.ts.map +1 -1
- package/dist/test-runner/evaluators.d.ts.map +1 -1
- package/dist/test-runner/index.d.ts +7 -0
- package/dist/test-runner/index.d.ts.map +1 -1
- package/dist/test-runner/validator.d.ts.map +1 -1
- package/dist/traces/{run-2026-02-11T16-20-59-999Z.ndjson → run-2026-02-15T19-14-20-379Z.ndjson} +84 -84
- package/dist/{output/traces/run-2026-02-11T16-21-47-711Z.ndjson → traces/run-2026-02-15T19-15-09-410Z.ndjson} +1019 -1019
- package/dist/tui/chat-runner.d.ts.map +1 -1
- package/dist/types/cli.d.ts +2 -0
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +15 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +2 -0
- package/dist/types/engine.d.ts.map +1 -1
- package/package.json +3 -3
- package/defaults/.visor.yaml +0 -420
- package/dist/sdk/chunk-EUUAQBTW.mjs.map +0 -1
- package/dist/sdk/chunk-S6CD7GFM.mjs.map +0 -1
- package/dist/sdk/chunk-UCNT3PDT.mjs.map +0 -1
- package/dist/sdk/chunk-V2IV3ILA.mjs.map +0 -1
- package/dist/sdk/chunk-YJRBN3XS.mjs +0 -217
- package/dist/sdk/chunk-YJRBN3XS.mjs.map +0 -1
- /package/dist/sdk/{check-provider-registry-M3Y6JMTW.mjs.map → check-provider-registry-AAPPJ4CP.mjs.map} +0 -0
- /package/dist/sdk/{check-provider-registry-PANIXYRB.mjs.map → check-provider-registry-S7BMQ2FC.mjs.map} +0 -0
- /package/dist/sdk/{config-OGOS4ZU4.mjs.map → check-provider-registry-ZOLEYDKM.mjs.map} +0 -0
- /package/dist/sdk/{chunk-VMLORODQ.mjs.map → chunk-2GCSK3PD.mjs.map} +0 -0
- /package/dist/sdk/{chunk-HOKQOO3G.mjs.map → chunk-EBTD2D4L.mjs.map} +0 -0
- /package/dist/sdk/{failure-condition-evaluator-HC3M5377.mjs.map → config-4EG7IQIU.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-E4EUOCES.mjs.map → failure-condition-evaluator-GLHZZF47.mjs.map} +0 -0
- /package/dist/sdk/{routing-OZQWAGAI.mjs.map → failure-condition-evaluator-KN55WXRO.mjs.map} +0 -0
- /package/dist/sdk/{github-frontend-E2KJSC3Y.mjs.map → github-frontend-F4TE2JY7.mjs.map} +0 -0
- /package/dist/sdk/{host-EE6EJ2FM.mjs.map → host-SAT6RHDX.mjs.map} +0 -0
- /package/dist/sdk/{schedule-tool-handler-B7TMSG6A.mjs.map → liquid-extensions-YDIIH33Q.mjs.map} +0 -0
- /package/dist/sdk/{schedule-tool-handler-IEB2VS7O.mjs.map → routing-KFYQGOYU.mjs.map} +0 -0
- /package/dist/sdk/{trace-helpers-PP3YHTAM.mjs.map → routing-OXQKETSA.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-2ET3SFZH.mjs.map → schedule-tool-handler-G353DHS6.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-HB4XTD4Z.mjs.map → schedule-tool-handler-OQF57URO.mjs.map} +0 -0
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
config_exports,
|
|
30
30
|
init_config
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-LQ5B4T6L.mjs";
|
|
32
32
|
import {
|
|
33
33
|
ExecutionJournal,
|
|
34
34
|
checkLoopBudget,
|
|
@@ -37,11 +37,11 @@ import {
|
|
|
37
37
|
init_routing,
|
|
38
38
|
init_snapshot_store,
|
|
39
39
|
snapshot_store_exports
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-2GCSK3PD.mjs";
|
|
41
41
|
import {
|
|
42
42
|
FailureConditionEvaluator,
|
|
43
43
|
init_failure_condition_evaluator
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-EBTD2D4L.mjs";
|
|
45
45
|
import {
|
|
46
46
|
addEvent,
|
|
47
47
|
emitNdjsonFallback,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
setSpanAttributes,
|
|
53
53
|
trace_helpers_exports,
|
|
54
54
|
withActiveSpan
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-N4I6ZDCJ.mjs";
|
|
56
56
|
import {
|
|
57
57
|
addDiagramBlock,
|
|
58
58
|
init_metrics
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
import {
|
|
61
61
|
createExtendedLiquid,
|
|
62
62
|
init_liquid_extensions
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-XJQKTK6V.mjs";
|
|
64
64
|
import {
|
|
65
65
|
createPermissionHelpers,
|
|
66
66
|
detectLocalMode,
|
|
@@ -681,6 +681,8 @@ var init_ai_review_service = __esm({
|
|
|
681
681
|
const isCodeReviewSchema = schema === "code-review";
|
|
682
682
|
const prContext = skipPRContext ? "" : await this.formatPRContext(prInfo, isCodeReviewSchema);
|
|
683
683
|
const slackContextXml = skipSlackContext === true ? "" : this.formatSlackContextFromPRInfo(prInfo);
|
|
684
|
+
const traceIdXml = prInfo.otelTraceId ? `
|
|
685
|
+
<trace_id>${this.escapeXml(String(prInfo.otelTraceId))}</trace_id>` : "";
|
|
684
686
|
const isIssue = prInfo.isIssue === true;
|
|
685
687
|
if (isIssue) {
|
|
686
688
|
if (skipPRContext && !slackContextXml) {
|
|
@@ -694,7 +696,7 @@ ${customInstructions}
|
|
|
694
696
|
</instructions>
|
|
695
697
|
|
|
696
698
|
<context>
|
|
697
|
-
${getCurrentDateXml()}
|
|
699
|
+
${getCurrentDateXml()}${traceIdXml}
|
|
698
700
|
${prContext}${slackContextXml}
|
|
699
701
|
</context>
|
|
700
702
|
|
|
@@ -736,7 +738,7 @@ ${customInstructions}
|
|
|
736
738
|
</instructions>
|
|
737
739
|
|
|
738
740
|
<context>
|
|
739
|
-
${getCurrentDateXml()}
|
|
741
|
+
${getCurrentDateXml()}${traceIdXml}
|
|
740
742
|
${prContext}${slackContextXml}
|
|
741
743
|
</context>
|
|
742
744
|
|
|
@@ -764,7 +766,7 @@ ${customInstructions}
|
|
|
764
766
|
</instructions>
|
|
765
767
|
|
|
766
768
|
<context>
|
|
767
|
-
${getCurrentDateXml()}
|
|
769
|
+
${getCurrentDateXml()}${traceIdXml}
|
|
768
770
|
${prContext}${slackContextXml}
|
|
769
771
|
</context>`;
|
|
770
772
|
}
|
|
@@ -2997,7 +2999,7 @@ async function executeWorkflowAsTool(workflowId, args, context2, argsOverrides)
|
|
|
2997
2999
|
...args,
|
|
2998
3000
|
...argsOverrides
|
|
2999
3001
|
};
|
|
3000
|
-
const { WorkflowCheckProvider: WorkflowCheckProvider2 } = await import("./workflow-check-provider-
|
|
3002
|
+
const { WorkflowCheckProvider: WorkflowCheckProvider2 } = await import("./workflow-check-provider-57KAR4Y4.mjs");
|
|
3001
3003
|
const provider = new WorkflowCheckProvider2();
|
|
3002
3004
|
const checkConfig = {
|
|
3003
3005
|
type: "workflow",
|
|
@@ -3996,7 +3998,7 @@ function formatScheduleList(schedules) {
|
|
|
3996
3998
|
if (schedules.length === 0) {
|
|
3997
3999
|
return `You don't have any active schedules.
|
|
3998
4000
|
|
|
3999
|
-
To create one: "schedule daily-report every Monday at 9am"`;
|
|
4001
|
+
To create one: "remind me every Monday at 9am to check PRs" or "schedule %daily-report every Monday at 9am"`;
|
|
4000
4002
|
}
|
|
4001
4003
|
const lines = schedules.map((s, i) => `${i + 1}. ${formatSchedule(s)}`);
|
|
4002
4004
|
return `**Your active schedules:**
|
|
@@ -4272,6 +4274,12 @@ function getScheduleToolDefinition() {
|
|
|
4272
4274
|
|
|
4273
4275
|
YOU (the AI) must extract and structure all scheduling parameters. Do NOT pass natural language time expressions - convert them to cron or ISO timestamps.
|
|
4274
4276
|
|
|
4277
|
+
CRITICAL WORKFLOW RULE:
|
|
4278
|
+
- To schedule a WORKFLOW, the user MUST use a '%' prefix (e.g., "schedule %my-workflow daily").
|
|
4279
|
+
- If the '%' prefix is present, extract the word following it as the 'workflow' parameter (without the '%').
|
|
4280
|
+
- If the '%' prefix is NOT present, the request is a simple text reminder. The ENTIRE user request (excluding the schedule expression) MUST be placed in the 'reminder_text' parameter.
|
|
4281
|
+
- DO NOT guess or infer a workflow name from a user's request without the '%' prefix.
|
|
4282
|
+
|
|
4275
4283
|
ACTIONS:
|
|
4276
4284
|
- create: Schedule a new reminder or workflow
|
|
4277
4285
|
- list: Show user's active schedules
|
|
@@ -4279,7 +4287,9 @@ ACTIONS:
|
|
|
4279
4287
|
- pause/resume: Temporarily disable/enable a schedule
|
|
4280
4288
|
|
|
4281
4289
|
FOR CREATE ACTION - Extract these from user's request:
|
|
4282
|
-
1. WHAT:
|
|
4290
|
+
1. WHAT:
|
|
4291
|
+
- If user says "schedule %some-workflow ...", populate 'workflow' with "some-workflow".
|
|
4292
|
+
- Otherwise, populate 'reminder_text' with the user's full request text.
|
|
4283
4293
|
2. WHERE: Use the CURRENT channel from context
|
|
4284
4294
|
- target_id: The channel ID from context (C... for channels, D... for DMs)
|
|
4285
4295
|
- target_type: "channel" for public/private channels, "dm" for direct messages
|
|
@@ -4314,7 +4324,7 @@ User in DM: "remind me to check builds every day at 9am"
|
|
|
4314
4324
|
"original_expression": "every day at 9am"
|
|
4315
4325
|
}
|
|
4316
4326
|
|
|
4317
|
-
User in #security channel: "
|
|
4327
|
+
User in #security channel: "schedule %security-scan every Monday at 10am"
|
|
4318
4328
|
\u2192 {
|
|
4319
4329
|
"action": "create",
|
|
4320
4330
|
"workflow": "security-scan",
|
|
@@ -4325,6 +4335,17 @@ User in #security channel: "run security-scan every Monday at 10am"
|
|
|
4325
4335
|
"original_expression": "every Monday at 10am"
|
|
4326
4336
|
}
|
|
4327
4337
|
|
|
4338
|
+
User in #security channel: "run security-scan every Monday at 10am" (NO % prefix!)
|
|
4339
|
+
\u2192 {
|
|
4340
|
+
"action": "create",
|
|
4341
|
+
"reminder_text": "run security-scan every Monday at 10am",
|
|
4342
|
+
"is_recurring": true,
|
|
4343
|
+
"cron": "0 10 * * 1",
|
|
4344
|
+
"target_type": "channel",
|
|
4345
|
+
"target_id": "<channel ID from context, e.g., C05ABC123>",
|
|
4346
|
+
"original_expression": "every Monday at 10am"
|
|
4347
|
+
}
|
|
4348
|
+
|
|
4328
4349
|
User in DM: "remind me in 2 hours to review the PR"
|
|
4329
4350
|
\u2192 {
|
|
4330
4351
|
"action": "create",
|
|
@@ -4368,7 +4389,7 @@ User: "cancel schedule abc123"
|
|
|
4368
4389
|
},
|
|
4369
4390
|
workflow: {
|
|
4370
4391
|
type: "string",
|
|
4371
|
-
description:
|
|
4392
|
+
description: 'For create: workflow ID to run. ONLY populate this if the user used the % prefix (e.g., "%my-workflow"). Extract the name without the % symbol. If no % prefix, use reminder_text instead.'
|
|
4372
4393
|
},
|
|
4373
4394
|
workflow_inputs: {
|
|
4374
4395
|
type: "object",
|
|
@@ -5978,7 +5999,7 @@ var init_dependency_gating = __esm({
|
|
|
5978
5999
|
// src/state-machine/dispatch/template-renderer.ts
|
|
5979
6000
|
async function renderTemplateContent(checkId, checkConfig, reviewSummary) {
|
|
5980
6001
|
try {
|
|
5981
|
-
const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-
|
|
6002
|
+
const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-YDIIH33Q.mjs");
|
|
5982
6003
|
const fs11 = await import("fs/promises");
|
|
5983
6004
|
const path14 = await import("path");
|
|
5984
6005
|
const schemaRaw = checkConfig.schema || "plain";
|
|
@@ -8690,7 +8711,7 @@ async function executeCheckWithForEachItems2(checkId, forEachParent, forEachItem
|
|
|
8690
8711
|
}
|
|
8691
8712
|
}
|
|
8692
8713
|
try {
|
|
8693
|
-
const { evaluateTransitions } = await import("./routing-
|
|
8714
|
+
const { evaluateTransitions } = await import("./routing-OXQKETSA.mjs");
|
|
8694
8715
|
const transTarget = await evaluateTransitions(
|
|
8695
8716
|
onFinish.transitions,
|
|
8696
8717
|
forEachParent,
|
|
@@ -8750,7 +8771,7 @@ async function executeCheckWithForEachItems2(checkId, forEachParent, forEachItem
|
|
|
8750
8771
|
`[LevelDispatch] Error evaluating on_finish transitions for ${forEachParent}: ${e instanceof Error ? e.message : String(e)}`
|
|
8751
8772
|
);
|
|
8752
8773
|
}
|
|
8753
|
-
const { evaluateGoto: evaluateGoto2 } = await import("./routing-
|
|
8774
|
+
const { evaluateGoto: evaluateGoto2 } = await import("./routing-OXQKETSA.mjs");
|
|
8754
8775
|
if (context2.debug) {
|
|
8755
8776
|
logger.info(
|
|
8756
8777
|
`[LevelDispatch] Evaluating on_finish.goto_js for forEach parent: ${forEachParent}`
|
|
@@ -10002,7 +10023,7 @@ function updateStats2(results, state, isForEachIteration = false) {
|
|
|
10002
10023
|
}
|
|
10003
10024
|
async function renderTemplateContent2(checkId, checkConfig, reviewSummary) {
|
|
10004
10025
|
try {
|
|
10005
|
-
const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-
|
|
10026
|
+
const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-YDIIH33Q.mjs");
|
|
10006
10027
|
const fs11 = await import("fs/promises");
|
|
10007
10028
|
const path14 = await import("path");
|
|
10008
10029
|
const schemaRaw = checkConfig.schema || "plain";
|
|
@@ -10233,6 +10254,9 @@ var init_runner = __esm({
|
|
|
10233
10254
|
break;
|
|
10234
10255
|
}
|
|
10235
10256
|
}
|
|
10257
|
+
if (this.state.currentState === "Completed" && !this.context._parentContext && !process.env.VISOR_TEST_MODE) {
|
|
10258
|
+
logger.info("All workflows finished \u2014 waiting for events");
|
|
10259
|
+
}
|
|
10236
10260
|
return this.buildExecutionResult();
|
|
10237
10261
|
} catch (error) {
|
|
10238
10262
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
@@ -11899,7 +11923,7 @@ var init_state_machine_execution_engine = __esm({
|
|
|
11899
11923
|
try {
|
|
11900
11924
|
const map = options?.webhookContext?.webhookData;
|
|
11901
11925
|
if (map) {
|
|
11902
|
-
const { CheckProviderRegistry: CheckProviderRegistry2 } = await import("./check-provider-registry-
|
|
11926
|
+
const { CheckProviderRegistry: CheckProviderRegistry2 } = await import("./check-provider-registry-ZOLEYDKM.mjs");
|
|
11903
11927
|
const reg = CheckProviderRegistry2.getInstance();
|
|
11904
11928
|
const p = reg.getProvider("http_input");
|
|
11905
11929
|
if (p && typeof p.setWebhookContext === "function") p.setWebhookContext(map);
|
|
@@ -12012,7 +12036,7 @@ var init_state_machine_execution_engine = __esm({
|
|
|
12012
12036
|
logger.info("[StateMachine] Using state machine engine");
|
|
12013
12037
|
}
|
|
12014
12038
|
if (!config) {
|
|
12015
|
-
const { ConfigManager } = await import("./config-
|
|
12039
|
+
const { ConfigManager } = await import("./config-4EG7IQIU.mjs");
|
|
12016
12040
|
const configManager = new ConfigManager();
|
|
12017
12041
|
config = await configManager.getDefaultConfig();
|
|
12018
12042
|
logger.debug("[StateMachine] Using default configuration (no config provided)");
|
|
@@ -12077,7 +12101,7 @@ var init_state_machine_execution_engine = __esm({
|
|
|
12077
12101
|
try {
|
|
12078
12102
|
const webhookData = this.executionContext?.webhookContext?.webhookData;
|
|
12079
12103
|
if (webhookData instanceof Map) {
|
|
12080
|
-
const { extractSlackContext: extractSlackContext2 } = await import("./schedule-tool-handler-
|
|
12104
|
+
const { extractSlackContext: extractSlackContext2 } = await import("./schedule-tool-handler-PJVKWSYX.mjs");
|
|
12081
12105
|
const slackCtx = extractSlackContext2(webhookData);
|
|
12082
12106
|
if (slackCtx) {
|
|
12083
12107
|
const payload = Array.from(webhookData.values())[0];
|
|
@@ -12106,7 +12130,7 @@ var init_state_machine_execution_engine = __esm({
|
|
|
12106
12130
|
if (Array.isArray(configWithTagFilter.frontends) && configWithTagFilter.frontends.length > 0) {
|
|
12107
12131
|
try {
|
|
12108
12132
|
const { EventBus } = await import("./event-bus-5K3Y2FCS.mjs");
|
|
12109
|
-
const { FrontendsHost } = await import("./host-
|
|
12133
|
+
const { FrontendsHost } = await import("./host-VA3ET7N6.mjs");
|
|
12110
12134
|
const bus = new EventBus();
|
|
12111
12135
|
context2.eventBus = bus;
|
|
12112
12136
|
frontendsHost = new FrontendsHost(bus, logger);
|
|
@@ -12456,9 +12480,9 @@ var init_state_machine_execution_engine = __esm({
|
|
|
12456
12480
|
* @returns Array of failure condition evaluation results
|
|
12457
12481
|
*/
|
|
12458
12482
|
async evaluateFailureConditions(checkName, reviewSummary, config, previousOutputs, authorAssociation) {
|
|
12459
|
-
const { FailureConditionEvaluator: FailureConditionEvaluator2 } = await import("./failure-condition-evaluator-
|
|
12483
|
+
const { FailureConditionEvaluator: FailureConditionEvaluator2 } = await import("./failure-condition-evaluator-GLHZZF47.mjs");
|
|
12460
12484
|
const evaluator = new FailureConditionEvaluator2();
|
|
12461
|
-
const { addEvent: addEvent3 } = await import("./trace-helpers-
|
|
12485
|
+
const { addEvent: addEvent3 } = await import("./trace-helpers-R2ETIEC2.mjs");
|
|
12462
12486
|
const { addFailIfTriggered } = await import("./metrics-I6A7IHG4.mjs");
|
|
12463
12487
|
const checkConfig = config.checks?.[checkName];
|
|
12464
12488
|
if (!checkConfig) {
|
|
@@ -13507,16 +13531,13 @@ var init_mcp_custom_sse_server = __esm({
|
|
|
13507
13531
|
logger.error(
|
|
13508
13532
|
`[CustomToolsSSEServer:${this.sessionId}] Tool execution failed: ${toolName} - ${errorMsg}`
|
|
13509
13533
|
);
|
|
13534
|
+
const isValidationError = errorMsg.startsWith("Invalid workflow inputs:");
|
|
13510
13535
|
return {
|
|
13511
13536
|
jsonrpc: "2.0",
|
|
13512
13537
|
id,
|
|
13513
13538
|
error: {
|
|
13514
|
-
code: -32603,
|
|
13515
|
-
message:
|
|
13516
|
-
data: {
|
|
13517
|
-
tool: toolName,
|
|
13518
|
-
error: errorMsg
|
|
13519
|
-
}
|
|
13539
|
+
code: isValidationError ? -32602 : -32603,
|
|
13540
|
+
message: isValidationError ? `Invalid tool parameters: ${errorMsg}` : `Internal error during tool execution: ${errorMsg}`
|
|
13520
13541
|
}
|
|
13521
13542
|
};
|
|
13522
13543
|
} finally {
|
|
@@ -14513,13 +14534,13 @@ ${preview}`);
|
|
|
14513
14534
|
`[AICheckProvider] Started custom tools SSE server '${customToolsServerName}' on port ${port} for ${customTools.size} tools`
|
|
14514
14535
|
);
|
|
14515
14536
|
}
|
|
14537
|
+
const workflowToolTimeout = config.ai?.timeout || 18e5;
|
|
14516
14538
|
mcpServers[customToolsServerName] = {
|
|
14517
14539
|
command: "",
|
|
14518
14540
|
args: [],
|
|
14519
14541
|
url: `http://localhost:${port}/sse`,
|
|
14520
14542
|
transport: "sse",
|
|
14521
|
-
timeout:
|
|
14522
|
-
// 10 minutes for workflow tools
|
|
14543
|
+
timeout: workflowToolTimeout
|
|
14523
14544
|
};
|
|
14524
14545
|
}
|
|
14525
14546
|
} catch (error) {
|
|
@@ -14532,6 +14553,37 @@ ${preview}`);
|
|
|
14532
14553
|
aiConfig.mcpServers = mcpServers;
|
|
14533
14554
|
} else if (config.ai?.disableTools) {
|
|
14534
14555
|
}
|
|
14556
|
+
const bashConfigJsExpr = config.ai_bash_config_js;
|
|
14557
|
+
if (bashConfigJsExpr && _dependencyResults) {
|
|
14558
|
+
try {
|
|
14559
|
+
const dynamicBashConfig = this.evaluateBashConfigJs(
|
|
14560
|
+
bashConfigJsExpr,
|
|
14561
|
+
prInfo,
|
|
14562
|
+
_dependencyResults,
|
|
14563
|
+
config
|
|
14564
|
+
);
|
|
14565
|
+
if (!aiConfig.bashConfig) aiConfig.bashConfig = {};
|
|
14566
|
+
if (dynamicBashConfig.allow?.length) {
|
|
14567
|
+
aiConfig.bashConfig.allow = [
|
|
14568
|
+
...aiConfig.bashConfig.allow || [],
|
|
14569
|
+
...dynamicBashConfig.allow
|
|
14570
|
+
];
|
|
14571
|
+
}
|
|
14572
|
+
if (dynamicBashConfig.deny?.length) {
|
|
14573
|
+
aiConfig.bashConfig.deny = [
|
|
14574
|
+
...aiConfig.bashConfig.deny || [],
|
|
14575
|
+
...dynamicBashConfig.deny
|
|
14576
|
+
];
|
|
14577
|
+
}
|
|
14578
|
+
if (dynamicBashConfig.allow?.length || dynamicBashConfig.deny?.length) {
|
|
14579
|
+
aiConfig.allowBash = true;
|
|
14580
|
+
}
|
|
14581
|
+
} catch (error) {
|
|
14582
|
+
logger.error(
|
|
14583
|
+
`[AICheckProvider] Failed to evaluate ai_bash_config_js: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
14584
|
+
);
|
|
14585
|
+
}
|
|
14586
|
+
}
|
|
14535
14587
|
const templateContext = {
|
|
14536
14588
|
pr: {
|
|
14537
14589
|
number: prInfo.number,
|
|
@@ -14553,6 +14605,10 @@ ${preview}`);
|
|
|
14553
14605
|
const span = trace.getSpan(context.active());
|
|
14554
14606
|
if (span) {
|
|
14555
14607
|
captureCheckInputContext(span, templateContext);
|
|
14608
|
+
const spanTraceId = span.spanContext()?.traceId;
|
|
14609
|
+
if (spanTraceId) {
|
|
14610
|
+
prInfo.otelTraceId = spanTraceId;
|
|
14611
|
+
}
|
|
14556
14612
|
}
|
|
14557
14613
|
} catch {
|
|
14558
14614
|
}
|
|
@@ -14957,6 +15013,80 @@ ${processedPrompt}` : processedPrompt;
|
|
|
14957
15013
|
return {};
|
|
14958
15014
|
}
|
|
14959
15015
|
}
|
|
15016
|
+
/**
|
|
15017
|
+
* Evaluate ai_bash_config_js expression to dynamically compute bash configuration.
|
|
15018
|
+
* Returns a partial BashConfig object with optional allow/deny arrays.
|
|
15019
|
+
*/
|
|
15020
|
+
evaluateBashConfigJs(expression, prInfo, dependencyResults, config) {
|
|
15021
|
+
if (!this.sandbox) {
|
|
15022
|
+
this.sandbox = createSecureSandbox();
|
|
15023
|
+
}
|
|
15024
|
+
const outputs = {};
|
|
15025
|
+
for (const [checkId, result] of dependencyResults.entries()) {
|
|
15026
|
+
const summary = result;
|
|
15027
|
+
outputs[checkId] = summary.output !== void 0 ? summary.output : summary;
|
|
15028
|
+
}
|
|
15029
|
+
const jsContext = {
|
|
15030
|
+
outputs,
|
|
15031
|
+
inputs: config.inputs || {},
|
|
15032
|
+
pr: {
|
|
15033
|
+
number: prInfo.number,
|
|
15034
|
+
title: prInfo.title,
|
|
15035
|
+
description: prInfo.body,
|
|
15036
|
+
author: prInfo.author,
|
|
15037
|
+
branch: prInfo.head,
|
|
15038
|
+
base: prInfo.base,
|
|
15039
|
+
authorAssociation: prInfo.authorAssociation
|
|
15040
|
+
},
|
|
15041
|
+
files: prInfo.files?.map((f) => ({
|
|
15042
|
+
filename: f.filename,
|
|
15043
|
+
status: f.status,
|
|
15044
|
+
additions: f.additions,
|
|
15045
|
+
deletions: f.deletions,
|
|
15046
|
+
changes: f.changes
|
|
15047
|
+
})) || [],
|
|
15048
|
+
env: this.buildSafeEnv(),
|
|
15049
|
+
memory: config.__memoryAccessor || {}
|
|
15050
|
+
};
|
|
15051
|
+
try {
|
|
15052
|
+
const result = compileAndRun(this.sandbox, expression, jsContext, {
|
|
15053
|
+
injectLog: true,
|
|
15054
|
+
wrapFunction: true,
|
|
15055
|
+
logPrefix: "[ai_bash_config_js]"
|
|
15056
|
+
});
|
|
15057
|
+
if (typeof result !== "object" || result === null || Array.isArray(result)) {
|
|
15058
|
+
logger.warn(
|
|
15059
|
+
`[AICheckProvider] ai_bash_config_js must return an object, got ${Array.isArray(result) ? "array" : typeof result}`
|
|
15060
|
+
);
|
|
15061
|
+
return {};
|
|
15062
|
+
}
|
|
15063
|
+
const cfg = result;
|
|
15064
|
+
const validConfig = {};
|
|
15065
|
+
if (cfg.allow !== void 0) {
|
|
15066
|
+
if (Array.isArray(cfg.allow) && cfg.allow.every((item) => typeof item === "string")) {
|
|
15067
|
+
validConfig.allow = cfg.allow;
|
|
15068
|
+
} else {
|
|
15069
|
+
logger.warn(`[AICheckProvider] ai_bash_config_js: 'allow' must be a string array`);
|
|
15070
|
+
}
|
|
15071
|
+
}
|
|
15072
|
+
if (cfg.deny !== void 0) {
|
|
15073
|
+
if (Array.isArray(cfg.deny) && cfg.deny.every((item) => typeof item === "string")) {
|
|
15074
|
+
validConfig.deny = cfg.deny;
|
|
15075
|
+
} else {
|
|
15076
|
+
logger.warn(`[AICheckProvider] ai_bash_config_js: 'deny' must be a string array`);
|
|
15077
|
+
}
|
|
15078
|
+
}
|
|
15079
|
+
logger.debug(
|
|
15080
|
+
`[AICheckProvider] ai_bash_config_js evaluated: allow=${validConfig.allow?.length ?? 0}, deny=${validConfig.deny?.length ?? 0}`
|
|
15081
|
+
);
|
|
15082
|
+
return validConfig;
|
|
15083
|
+
} catch (error) {
|
|
15084
|
+
logger.error(
|
|
15085
|
+
`[AICheckProvider] Failed to evaluate ai_bash_config_js: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
15086
|
+
);
|
|
15087
|
+
return {};
|
|
15088
|
+
}
|
|
15089
|
+
}
|
|
14960
15090
|
/**
|
|
14961
15091
|
* Build a safe subset of environment variables for sandbox access.
|
|
14962
15092
|
* Excludes sensitive keys like API keys, secrets, tokens.
|
|
@@ -15053,6 +15183,7 @@ ${processedPrompt}` : processedPrompt;
|
|
|
15053
15183
|
"ai_mcp_servers_js",
|
|
15054
15184
|
"ai_custom_tools",
|
|
15055
15185
|
"ai_custom_tools_js",
|
|
15186
|
+
"ai_bash_config_js",
|
|
15056
15187
|
"env"
|
|
15057
15188
|
];
|
|
15058
15189
|
}
|
|
@@ -39395,6 +39526,31 @@ var init_workflow_check_provider = __esm({
|
|
|
39395
39526
|
`[WorkflowProvider] NO WORKSPACE from parent - nested checkouts won't be added to workspace!`
|
|
39396
39527
|
);
|
|
39397
39528
|
}
|
|
39529
|
+
const stepPrefix = config.checkName || workflow.id;
|
|
39530
|
+
const parentExecCtx = parentContext?.executionContext;
|
|
39531
|
+
let childExecCtx = parentExecCtx;
|
|
39532
|
+
if (parentExecCtx?.hooks) {
|
|
39533
|
+
const parentHooks = parentExecCtx.hooks;
|
|
39534
|
+
childExecCtx = {
|
|
39535
|
+
...parentExecCtx,
|
|
39536
|
+
hooks: {
|
|
39537
|
+
...parentHooks,
|
|
39538
|
+
// Wrap onPromptCaptured: emit with prefixed step name so parent sees "route-intent.classify"
|
|
39539
|
+
onPromptCaptured: parentHooks.onPromptCaptured ? (info) => {
|
|
39540
|
+
parentHooks.onPromptCaptured({
|
|
39541
|
+
...info,
|
|
39542
|
+
step: `${stepPrefix}.${info.step}`
|
|
39543
|
+
});
|
|
39544
|
+
} : void 0,
|
|
39545
|
+
// Wrap mockForStep: try prefixed name first, fall back to unprefixed for backward compat
|
|
39546
|
+
mockForStep: parentHooks.mockForStep ? (step) => {
|
|
39547
|
+
const prefixed = parentHooks.mockForStep(`${stepPrefix}.${step}`);
|
|
39548
|
+
if (prefixed !== void 0) return prefixed;
|
|
39549
|
+
return parentHooks.mockForStep(step);
|
|
39550
|
+
} : void 0
|
|
39551
|
+
}
|
|
39552
|
+
};
|
|
39553
|
+
}
|
|
39398
39554
|
const childContext = {
|
|
39399
39555
|
mode: "state-machine",
|
|
39400
39556
|
config: workflowConfig,
|
|
@@ -39416,9 +39572,9 @@ var init_workflow_check_provider = __esm({
|
|
|
39416
39572
|
debug: parentContext?.debug || false,
|
|
39417
39573
|
maxParallelism: parentContext?.maxParallelism,
|
|
39418
39574
|
failFast: parentContext?.failFast,
|
|
39419
|
-
// Propagate execution hooks (mocks, octokit, etc.) into the child so
|
|
39420
|
-
// nested steps can be mocked/observed by the YAML test runner.
|
|
39421
|
-
executionContext:
|
|
39575
|
+
// Propagate wrapped execution hooks (mocks, octokit, etc.) into the child so
|
|
39576
|
+
// nested steps can be mocked/observed by the YAML test runner with dotted prefixes.
|
|
39577
|
+
executionContext: childExecCtx,
|
|
39422
39578
|
// Ensure all workflow steps are considered requested to avoid tag/event filtering surprises
|
|
39423
39579
|
requestedChecks: Object.keys(checksMetadata)
|
|
39424
39580
|
};
|
|
@@ -39432,6 +39588,26 @@ var init_workflow_check_provider = __esm({
|
|
|
39432
39588
|
`[WorkflowProvider] Executing nested workflow '${workflow.id}' at depth ${currentDepth + 1}`
|
|
39433
39589
|
);
|
|
39434
39590
|
const result = await runner.run();
|
|
39591
|
+
if (parentContext?.journal && parentContext?.sessionId) {
|
|
39592
|
+
const parentJournal = parentContext.journal;
|
|
39593
|
+
const childSnapshot = childJournal.beginSnapshot();
|
|
39594
|
+
const childSessionId = childContext.sessionId;
|
|
39595
|
+
const childEntries = childJournal.readVisible(childSessionId, childSnapshot, void 0);
|
|
39596
|
+
for (const entry of childEntries) {
|
|
39597
|
+
parentJournal.commitEntry({
|
|
39598
|
+
sessionId: parentContext.sessionId,
|
|
39599
|
+
scope: entry.scope,
|
|
39600
|
+
checkId: `${stepPrefix}.${entry.checkId}`,
|
|
39601
|
+
result: entry.result,
|
|
39602
|
+
event: entry.event
|
|
39603
|
+
});
|
|
39604
|
+
}
|
|
39605
|
+
if (childEntries.length > 0) {
|
|
39606
|
+
logger.debug(
|
|
39607
|
+
`[WorkflowProvider] Propagated ${childEntries.length} child journal entries to parent with prefix '${stepPrefix}.'`
|
|
39608
|
+
);
|
|
39609
|
+
}
|
|
39610
|
+
}
|
|
39435
39611
|
const bubbledEvents = childContext._bubbledEvents || [];
|
|
39436
39612
|
if (bubbledEvents.length > 0 && parentContext) {
|
|
39437
39613
|
if (parentContext.debug) {
|
|
@@ -39717,4 +39893,4 @@ undici/lib/fetch/body.js:
|
|
|
39717
39893
|
undici/lib/websocket/frame.js:
|
|
39718
39894
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
39719
39895
|
*/
|
|
39720
|
-
//# sourceMappingURL=chunk-
|
|
39896
|
+
//# sourceMappingURL=chunk-MQ57AB4U.mjs.map
|