@probelabs/visor 0.1.107 → 0.1.112
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 +6 -0
- package/defaults/task-refinement.yaml +7 -3
- package/defaults/visor.tests.yaml +13 -2
- package/defaults/visor.yaml +1 -0
- package/dist/663.index.js +3 -2
- package/dist/80.index.js +3 -2
- package/dist/ai-review-service.d.ts +13 -9
- 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.d.ts.map +1 -1
- package/dist/debug-visualizer/ws-server.d.ts +7 -1
- package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
- package/dist/defaults/task-refinement.yaml +7 -3
- package/dist/defaults/visor.tests.yaml +13 -2
- package/dist/defaults/visor.yaml +1 -0
- package/dist/docs/advanced-ai.md +60 -1
- package/dist/docs/ai-configuration.md +67 -0
- package/dist/docs/ai-custom-tools-usage.md +261 -0
- package/dist/docs/ai-custom-tools.md +392 -0
- package/dist/docs/bot-transports-rfc.md +23 -0
- package/dist/docs/configuration.md +21 -0
- package/dist/docs/engine-pause-resume-rfc.md +192 -0
- package/dist/docs/lifecycle-hooks.md +253 -0
- package/dist/docs/liquid-templates.md +143 -0
- package/dist/docs/providers/git-checkout.md +589 -0
- package/dist/docs/recipes.md +458 -5
- package/dist/docs/rfc/git-checkout-step.md +601 -0
- package/dist/docs/rfc/on_init-hook.md +1294 -0
- package/dist/docs/rfc/workspace-isolation.md +216 -0
- package/dist/docs/router-patterns.md +339 -0
- package/dist/event-bus/types.d.ts +14 -0
- package/dist/event-bus/types.d.ts.map +1 -1
- package/dist/examples/ai-custom-tools-example.yaml +206 -0
- package/dist/examples/ai-custom-tools-simple.yaml +76 -0
- package/dist/examples/git-checkout-basic.yaml +32 -0
- package/dist/examples/git-checkout-compare.yaml +59 -0
- package/dist/examples/git-checkout-cross-repo.yaml +76 -0
- package/dist/examples/on-init-import-demo.yaml +179 -0
- package/dist/examples/reusable-tools.yaml +92 -0
- package/dist/examples/reusable-workflows.yaml +88 -0
- package/dist/examples/session-reuse-self.yaml +81 -0
- package/dist/examples/slack-simple-chat.yaml +775 -0
- package/dist/failure-condition-evaluator.d.ts +2 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts +20 -0
- package/dist/frontends/github-frontend.d.ts.map +1 -1
- package/dist/frontends/host.d.ts +4 -0
- package/dist/frontends/host.d.ts.map +1 -1
- package/dist/frontends/slack-frontend.d.ts +58 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -0
- package/dist/generated/config-schema.d.ts +409 -41
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +436 -47
- package/dist/github-comments.d.ts +2 -0
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83587 -56085
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/output/traces/{run-2025-11-21T11-50-46-505Z.ndjson → run-2026-01-21T05-37-24-446Z.ndjson} +91 -91
- package/dist/output/traces/run-2026-01-21T05-38-18-580Z.ndjson +1067 -0
- package/dist/output-formatters.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts +12 -0
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +9 -0
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/custom-tool-executor.d.ts.map +1 -1
- package/dist/providers/git-checkout-provider.d.ts +25 -0
- package/dist/providers/git-checkout-provider.d.ts.map +1 -0
- package/dist/providers/http-client-provider.d.ts +3 -0
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts +2 -0
- package/dist/providers/human-input-check-provider.d.ts.map +1 -1
- package/dist/providers/log-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts +1 -1
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +66 -0
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -0
- package/dist/providers/memory-check-provider.d.ts.map +1 -1
- package/dist/providers/script-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/reviewer.d.ts.map +1 -1
- package/dist/sdk/check-provider-registry-534KL5HT.mjs +27 -0
- package/dist/sdk/chunk-23L3QRYX.mjs +16872 -0
- package/dist/sdk/chunk-23L3QRYX.mjs.map +1 -0
- package/dist/sdk/{chunk-OOZITMRU.mjs → chunk-3OMWVM6J.mjs} +11 -1
- package/dist/sdk/{chunk-OOZITMRU.mjs.map → chunk-3OMWVM6J.mjs.map} +1 -1
- package/dist/sdk/{chunk-37ZSCMFC.mjs → chunk-7UK3NIIT.mjs} +2 -2
- package/dist/sdk/{chunk-VMPLF6FT.mjs → chunk-AGIZJ4UZ.mjs} +50 -4
- package/dist/sdk/chunk-AGIZJ4UZ.mjs.map +1 -0
- package/dist/sdk/{chunk-IEO6CFLG.mjs → chunk-AIVFBIS4.mjs} +161 -5
- package/dist/sdk/chunk-AIVFBIS4.mjs.map +1 -0
- package/dist/sdk/chunk-AK6BVWIT.mjs +426 -0
- package/dist/sdk/chunk-AK6BVWIT.mjs.map +1 -0
- package/dist/sdk/chunk-AUT26LHW.mjs +139 -0
- package/dist/sdk/chunk-AUT26LHW.mjs.map +1 -0
- package/dist/sdk/chunk-BOVFH3LI.mjs +232 -0
- package/dist/sdk/chunk-BOVFH3LI.mjs.map +1 -0
- package/dist/sdk/chunk-HTOKWMPO.mjs +157 -0
- package/dist/sdk/chunk-HTOKWMPO.mjs.map +1 -0
- package/dist/sdk/{chunk-6Y4YTKCF.mjs → chunk-NAW3DB3I.mjs} +2 -2
- package/dist/sdk/{chunk-OWUVOILT.mjs → chunk-QR7MOMJH.mjs} +4 -3
- package/dist/sdk/{chunk-OWUVOILT.mjs.map → chunk-QR7MOMJH.mjs.map} +1 -1
- package/dist/sdk/{chunk-PTL3K3PN.mjs → chunk-QY2XYPEV.mjs} +488 -60
- package/dist/sdk/chunk-QY2XYPEV.mjs.map +1 -0
- package/dist/sdk/{chunk-OZJ263FM.mjs → chunk-SIWNBRTK.mjs} +29 -215
- package/dist/sdk/chunk-SIWNBRTK.mjs.map +1 -0
- package/dist/sdk/command-executor-TYUV6HUS.mjs +14 -0
- package/dist/sdk/{config-M4ZNO6NU.mjs → config-YNC2EOOT.mjs} +5 -3
- package/dist/sdk/{failure-condition-evaluator-NBO5YRXW.mjs → failure-condition-evaluator-YGTF2GHG.mjs} +6 -5
- package/dist/sdk/{github-frontend-4AWRJT7D.mjs → github-frontend-SIAEOCON.mjs} +190 -12
- package/dist/sdk/github-frontend-SIAEOCON.mjs.map +1 -0
- package/dist/sdk/{host-7GBC3S7L.mjs → host-DXUYTNMU.mjs} +5 -2
- package/dist/sdk/host-DXUYTNMU.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-C7EG3YKH.mjs → liquid-extensions-PKWCKK7E.mjs} +5 -4
- package/dist/sdk/memory-store-XGBB7LX7.mjs +12 -0
- package/dist/sdk/prompt-state-YRJY6QAL.mjs +16 -0
- package/dist/sdk/{renderer-schema-6RF26VUS.mjs → renderer-schema-LPKN5UJS.mjs} +3 -2
- package/dist/sdk/{renderer-schema-6RF26VUS.mjs.map → renderer-schema-LPKN5UJS.mjs.map} +1 -1
- package/dist/sdk/{routing-RP56JTV2.mjs → routing-6N45MJ4F.mjs} +7 -6
- package/dist/sdk/sdk.d.mts +219 -5
- package/dist/sdk/sdk.d.ts +219 -5
- package/dist/sdk/sdk.js +21329 -14908
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +407 -12874
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/{session-registry-N5FFYFTM.mjs → session-registry-4E6YRQ77.mjs} +2 -2
- package/dist/sdk/session-registry-4E6YRQ77.mjs.map +1 -0
- package/dist/sdk/slack-frontend-BVKW3GD5.mjs +735 -0
- package/dist/sdk/slack-frontend-BVKW3GD5.mjs.map +1 -0
- package/dist/sdk/{tracer-init-WP4X46IF.mjs → tracer-init-GSLPPLCD.mjs} +2 -2
- package/dist/sdk/tracer-init-GSLPPLCD.mjs.map +1 -0
- package/dist/sdk/workflow-registry-R6KSACFR.mjs +12 -0
- package/dist/sdk/workflow-registry-R6KSACFR.mjs.map +1 -0
- package/dist/slack/adapter.d.ts +36 -0
- package/dist/slack/adapter.d.ts.map +1 -0
- package/dist/slack/cache-prewarmer.d.ts +31 -0
- package/dist/slack/cache-prewarmer.d.ts.map +1 -0
- package/dist/slack/client.d.ts +77 -0
- package/dist/slack/client.d.ts.map +1 -0
- package/dist/slack/markdown.d.ts +45 -0
- package/dist/slack/markdown.d.ts.map +1 -0
- package/dist/slack/prompt-state.d.ts +33 -0
- package/dist/slack/prompt-state.d.ts.map +1 -0
- package/dist/slack/rate-limiter.d.ts +56 -0
- package/dist/slack/rate-limiter.d.ts.map +1 -0
- package/dist/slack/signature.d.ts +2 -0
- package/dist/slack/signature.d.ts.map +1 -0
- package/dist/slack/socket-runner.d.ts +42 -0
- package/dist/slack/socket-runner.d.ts.map +1 -0
- package/dist/slack/thread-cache.d.ts +51 -0
- package/dist/slack/thread-cache.d.ts.map +1 -0
- package/dist/state-machine/context/build-engine-context.d.ts +8 -0
- package/dist/state-machine/context/build-engine-context.d.ts.map +1 -1
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
- package/dist/state-machine/dispatch/on-init-handlers.d.ts +43 -0
- package/dist/state-machine/dispatch/on-init-handlers.d.ts.map +1 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
- package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -1
- package/dist/state-machine/runner.d.ts +6 -0
- package/dist/state-machine/runner.d.ts.map +1 -1
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
- package/dist/state-machine/states/plan-ready.d.ts.map +1 -1
- package/dist/state-machine/states/routing.d.ts.map +1 -1
- package/dist/state-machine/states/wave-planning.d.ts.map +1 -1
- package/dist/state-machine/workflow-projection.d.ts.map +1 -1
- package/dist/state-machine-execution-engine.d.ts +21 -9
- package/dist/state-machine-execution-engine.d.ts.map +1 -1
- package/dist/telemetry/state-capture.d.ts +5 -0
- package/dist/telemetry/state-capture.d.ts.map +1 -1
- package/dist/test-runner/core/flow-stage.d.ts.map +1 -1
- package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -1
- package/dist/test-runner/evaluators.d.ts +37 -4
- 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/recorders/slack-recorder.d.ts +17 -0
- package/dist/test-runner/recorders/slack-recorder.d.ts.map +1 -0
- package/dist/test-runner/validator.d.ts.map +1 -1
- package/dist/traces/{run-2025-11-21T11-50-46-505Z.ndjson → run-2026-01-21T05-37-24-446Z.ndjson} +91 -91
- package/dist/traces/run-2026-01-21T05-38-18-580Z.ndjson +1067 -0
- package/dist/types/bot.d.ts +109 -0
- package/dist/types/bot.d.ts.map +1 -0
- package/dist/types/cli.d.ts +4 -0
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +182 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +5 -0
- package/dist/types/engine.d.ts.map +1 -1
- package/dist/types/git-checkout.d.ts +76 -0
- package/dist/types/git-checkout.d.ts.map +1 -0
- package/dist/utils/json-text-extractor.d.ts +17 -0
- package/dist/utils/json-text-extractor.d.ts.map +1 -0
- package/dist/utils/sandbox.d.ts +10 -0
- package/dist/utils/sandbox.d.ts.map +1 -1
- package/dist/utils/template-context.d.ts +1 -0
- package/dist/utils/template-context.d.ts.map +1 -1
- package/dist/utils/tracer-init.d.ts.map +1 -1
- package/dist/utils/workspace-manager.d.ts +118 -0
- package/dist/utils/workspace-manager.d.ts.map +1 -0
- package/dist/utils/worktree-cleanup.d.ts +33 -0
- package/dist/utils/worktree-cleanup.d.ts.map +1 -0
- package/dist/utils/worktree-manager.d.ts +153 -0
- package/dist/utils/worktree-manager.d.ts.map +1 -0
- package/dist/webhook-server.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts.map +1 -1
- package/dist/workflow-registry.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/output/traces/run-2025-11-21T11-51-33-674Z.ndjson +0 -839
- package/dist/sdk/chunk-IEO6CFLG.mjs.map +0 -1
- package/dist/sdk/chunk-JEHPDJIF.mjs +0 -223
- package/dist/sdk/chunk-JEHPDJIF.mjs.map +0 -1
- package/dist/sdk/chunk-OZJ263FM.mjs.map +0 -1
- package/dist/sdk/chunk-PTL3K3PN.mjs.map +0 -1
- package/dist/sdk/chunk-VMPLF6FT.mjs.map +0 -1
- package/dist/sdk/github-frontend-4AWRJT7D.mjs.map +0 -1
- package/dist/sdk/host-7GBC3S7L.mjs.map +0 -1
- package/dist/sdk/memory-store-GJACZC2A.mjs +0 -11
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs +0 -11
- package/dist/traces/run-2025-11-21T11-51-33-674Z.ndjson +0 -839
- /package/dist/sdk/{config-M4ZNO6NU.mjs.map → check-provider-registry-534KL5HT.mjs.map} +0 -0
- /package/dist/sdk/{chunk-37ZSCMFC.mjs.map → chunk-7UK3NIIT.mjs.map} +0 -0
- /package/dist/sdk/{chunk-6Y4YTKCF.mjs.map → chunk-NAW3DB3I.mjs.map} +0 -0
- /package/dist/sdk/{failure-condition-evaluator-NBO5YRXW.mjs.map → command-executor-TYUV6HUS.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-C7EG3YKH.mjs.map → config-YNC2EOOT.mjs.map} +0 -0
- /package/dist/sdk/{memory-store-GJACZC2A.mjs.map → failure-condition-evaluator-YGTF2GHG.mjs.map} +0 -0
- /package/dist/sdk/{routing-RP56JTV2.mjs.map → liquid-extensions-PKWCKK7E.mjs.map} +0 -0
- /package/dist/sdk/{session-registry-N5FFYFTM.mjs.map → memory-store-XGBB7LX7.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-WP4X46IF.mjs.map → prompt-state-YRJY6QAL.mjs.map} +0 -0
- /package/dist/sdk/{workflow-registry-2YIIXQCK.mjs.map → routing-6N45MJ4F.mjs.map} +0 -0
|
@@ -4,14 +4,15 @@ import {
|
|
|
4
4
|
evaluateTransitions,
|
|
5
5
|
handleRouting,
|
|
6
6
|
init_routing
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-AIVFBIS4.mjs";
|
|
8
|
+
import "./chunk-SIWNBRTK.mjs";
|
|
9
|
+
import "./chunk-BOVFH3LI.mjs";
|
|
10
10
|
import "./chunk-ZYAUYXSW.mjs";
|
|
11
11
|
import "./chunk-S2RUE2RG.mjs";
|
|
12
|
+
import "./chunk-CNX7V5JK.mjs";
|
|
13
|
+
import "./chunk-7UK3NIIT.mjs";
|
|
14
|
+
import "./chunk-AGIZJ4UZ.mjs";
|
|
12
15
|
import "./chunk-YSN4G6CI.mjs";
|
|
13
|
-
import "./chunk-37ZSCMFC.mjs";
|
|
14
|
-
import "./chunk-VMPLF6FT.mjs";
|
|
15
16
|
import "./chunk-WMJKH4XE.mjs";
|
|
16
17
|
init_routing();
|
|
17
18
|
export {
|
|
@@ -20,4 +21,4 @@ export {
|
|
|
20
21
|
evaluateTransitions,
|
|
21
22
|
handleRouting
|
|
22
23
|
};
|
|
23
|
-
//# sourceMappingURL=routing-
|
|
24
|
+
//# sourceMappingURL=routing-6N45MJ4F.mjs.map
|
package/dist/sdk/sdk.d.mts
CHANGED
|
@@ -120,7 +120,7 @@ interface FailureConditionResult {
|
|
|
120
120
|
/**
|
|
121
121
|
* Valid check types in configuration
|
|
122
122
|
*/
|
|
123
|
-
type ConfigCheckType = 'ai' | 'command' | 'script' | 'http' | 'http_input' | 'http_client' | 'noop' | 'log' | 'memory' | 'github' | 'claude-code' | 'mcp' | 'human-input' | 'workflow';
|
|
123
|
+
type ConfigCheckType = 'ai' | 'command' | 'script' | 'http' | 'http_input' | 'http_client' | 'noop' | 'log' | 'memory' | 'github' | 'claude-code' | 'mcp' | 'human-input' | 'workflow' | 'git-checkout';
|
|
124
124
|
/**
|
|
125
125
|
* Valid event triggers for checks
|
|
126
126
|
*/
|
|
@@ -235,6 +235,15 @@ interface AIProviderConfig {
|
|
|
235
235
|
custom_prompt?: string;
|
|
236
236
|
/** Skip adding code context (diffs, files, PR info) to the prompt */
|
|
237
237
|
skip_code_context?: boolean;
|
|
238
|
+
/** Skip adding Slack conversation context to the prompt (when running under Slack) */
|
|
239
|
+
skip_slack_context?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Skip adding transport-specific context (e.g., GitHub PR/issue XML, Slack
|
|
242
|
+
* conversation XML) to the prompt. When true, this behaves like setting both
|
|
243
|
+
* skip_code_context and skip_slack_context to true, unless those are
|
|
244
|
+
* explicitly overridden.
|
|
245
|
+
*/
|
|
246
|
+
skip_transport_context?: boolean;
|
|
238
247
|
/** MCP servers configuration */
|
|
239
248
|
mcpServers?: Record<string, McpServerConfig>;
|
|
240
249
|
/** Enable the delegate tool for task distribution to subagents */
|
|
@@ -253,6 +262,8 @@ interface AIProviderConfig {
|
|
|
253
262
|
allowBash?: boolean;
|
|
254
263
|
/** Advanced bash command execution configuration */
|
|
255
264
|
bashConfig?: BashConfig;
|
|
265
|
+
/** Completion prompt for post-completion validation/review (runs after attempt_completion) */
|
|
266
|
+
completion_prompt?: string;
|
|
256
267
|
}
|
|
257
268
|
/**
|
|
258
269
|
* MCP Server configuration
|
|
@@ -347,14 +358,16 @@ interface CheckConfig {
|
|
|
347
358
|
ai_custom_prompt?: string;
|
|
348
359
|
/** MCP servers for this AI check - overrides global setting */
|
|
349
360
|
ai_mcp_servers?: Record<string, McpServerConfig>;
|
|
361
|
+
/** List of custom tool names to expose to this AI check via ephemeral SSE MCP server */
|
|
362
|
+
ai_custom_tools?: string[];
|
|
350
363
|
/** Claude Code configuration (for claude-code type checks) */
|
|
351
364
|
claude_code?: ClaudeCodeConfig;
|
|
352
365
|
/** Environment variables for this check */
|
|
353
366
|
env?: EnvConfig;
|
|
354
367
|
/** Timeout in seconds for command execution (default: 60) */
|
|
355
368
|
timeout?: number;
|
|
356
|
-
/** Check IDs that this check depends on (optional) */
|
|
357
|
-
depends_on?: string[];
|
|
369
|
+
/** Check IDs that this check depends on (optional). Accepts single string or array. */
|
|
370
|
+
depends_on?: string | string[];
|
|
358
371
|
/** Group name for comment separation (e.g., "code-review", "pr-overview") - optional */
|
|
359
372
|
group?: string;
|
|
360
373
|
/** Schema type for template rendering (e.g., "code-review", "markdown") or inline JSON schema object - optional */
|
|
@@ -409,6 +422,8 @@ interface CheckConfig {
|
|
|
409
422
|
fanout?: 'map' | 'reduce';
|
|
410
423
|
/** Alias for fanout: 'reduce' */
|
|
411
424
|
reduce?: boolean;
|
|
425
|
+
/** Init routing configuration for this check (runs before execution/preprocessing) */
|
|
426
|
+
on_init?: OnInitConfig;
|
|
412
427
|
/** Failure routing configuration for this check (retry/goto/run) */
|
|
413
428
|
on_fail?: OnFailConfig;
|
|
414
429
|
/** Success routing configuration for this check (post-actions and optional goto) */
|
|
@@ -510,6 +525,43 @@ interface CheckConfig {
|
|
|
510
525
|
overrides?: Record<string, Partial<CheckConfig>>;
|
|
511
526
|
/** Map workflow outputs to check outputs */
|
|
512
527
|
output_mapping?: Record<string, string>;
|
|
528
|
+
/** Alias for args - workflow inputs (backward compatibility) */
|
|
529
|
+
workflow_inputs?: Record<string, unknown>;
|
|
530
|
+
/** Config file path - alternative to workflow ID (loads a Visor config file as workflow) */
|
|
531
|
+
config?: string;
|
|
532
|
+
/** Alias for overrides - workflow step overrides (backward compatibility) */
|
|
533
|
+
workflow_overrides?: Record<string, Partial<CheckConfig>>;
|
|
534
|
+
/**
|
|
535
|
+
* Git-checkout provider specific options (optional, only used when type === 'git-checkout').
|
|
536
|
+
*/
|
|
537
|
+
/** Git reference to checkout (branch, tag, commit SHA) - supports templates */
|
|
538
|
+
ref?: string;
|
|
539
|
+
/** Repository URL or owner/repo format (defaults to current repository) */
|
|
540
|
+
repository?: string;
|
|
541
|
+
/** GitHub token for private repositories (defaults to GITHUB_TOKEN env) */
|
|
542
|
+
token?: string;
|
|
543
|
+
/** Number of commits to fetch (0 for full history, default: 1) */
|
|
544
|
+
fetch_depth?: number;
|
|
545
|
+
/** Whether to fetch tags (default: false) */
|
|
546
|
+
fetch_tags?: boolean;
|
|
547
|
+
/** Checkout submodules: false, true, or 'recursive' */
|
|
548
|
+
submodules?: boolean | 'recursive';
|
|
549
|
+
/** Working directory for the checkout (defaults to temp directory) */
|
|
550
|
+
working_directory?: string;
|
|
551
|
+
/** Use git worktree for efficient parallel checkouts (default: true) */
|
|
552
|
+
use_worktree?: boolean;
|
|
553
|
+
/** Clean the working directory before checkout (default: true) */
|
|
554
|
+
clean?: boolean;
|
|
555
|
+
/** Sparse checkout paths - only checkout specific directories/files */
|
|
556
|
+
sparse_checkout?: string[];
|
|
557
|
+
/** Enable Git LFS (Large File Storage) */
|
|
558
|
+
lfs?: boolean;
|
|
559
|
+
/** Timeout in ms for cloning the bare repository (default: 300000 = 5 min) */
|
|
560
|
+
clone_timeout_ms?: number;
|
|
561
|
+
/** Clean up worktree on failure (default: true) */
|
|
562
|
+
cleanup_on_failure?: boolean;
|
|
563
|
+
/** Keep worktree after workflow completion (default: false) */
|
|
564
|
+
persist_worktree?: boolean;
|
|
513
565
|
}
|
|
514
566
|
/**
|
|
515
567
|
* Backoff policy for retries
|
|
@@ -587,6 +639,59 @@ interface OnFinishConfig {
|
|
|
587
639
|
/** Declarative transitions (see OnFailConfig.transitions). */
|
|
588
640
|
transitions?: TransitionRule[];
|
|
589
641
|
}
|
|
642
|
+
/**
|
|
643
|
+
* Init routing configuration per check
|
|
644
|
+
* Runs BEFORE the check executes (preprocessing/setup)
|
|
645
|
+
*/
|
|
646
|
+
interface OnInitConfig {
|
|
647
|
+
/** Items to run before this check executes */
|
|
648
|
+
run?: OnInitRunItem[];
|
|
649
|
+
/** Dynamic init items: JS expression returning OnInitRunItem[] */
|
|
650
|
+
run_js?: string;
|
|
651
|
+
/** Declarative transitions (optional, for advanced use cases) */
|
|
652
|
+
transitions?: TransitionRule[];
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Unified on_init run item - can be tool, step, workflow, or plain string
|
|
656
|
+
*/
|
|
657
|
+
type OnInitRunItem = OnInitToolInvocation | OnInitStepInvocation | OnInitWorkflowInvocation | string;
|
|
658
|
+
/**
|
|
659
|
+
* Invoke a custom tool (from tools: section)
|
|
660
|
+
*/
|
|
661
|
+
interface OnInitToolInvocation {
|
|
662
|
+
/** Tool name (must exist in tools: section) */
|
|
663
|
+
tool: string;
|
|
664
|
+
/** Arguments to pass to the tool (Liquid templates supported) */
|
|
665
|
+
with?: Record<string, unknown>;
|
|
666
|
+
/** Custom output name (defaults to tool name) */
|
|
667
|
+
as?: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Invoke a helper step (regular check)
|
|
671
|
+
*/
|
|
672
|
+
interface OnInitStepInvocation {
|
|
673
|
+
/** Step name (must exist in steps: section) */
|
|
674
|
+
step: string;
|
|
675
|
+
/** Arguments to pass to the step (Liquid templates supported) */
|
|
676
|
+
with?: Record<string, unknown>;
|
|
677
|
+
/** Custom output name (defaults to step name) */
|
|
678
|
+
as?: string;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Invoke a reusable workflow
|
|
682
|
+
*/
|
|
683
|
+
interface OnInitWorkflowInvocation {
|
|
684
|
+
/** Workflow ID or path */
|
|
685
|
+
workflow: string;
|
|
686
|
+
/** Workflow inputs (Liquid templates supported) */
|
|
687
|
+
with?: Record<string, unknown>;
|
|
688
|
+
/** Custom output name (defaults to workflow name) */
|
|
689
|
+
as?: string;
|
|
690
|
+
/** Step overrides */
|
|
691
|
+
overrides?: Record<string, Partial<CheckConfig>>;
|
|
692
|
+
/** Output mapping */
|
|
693
|
+
output_mapping?: Record<string, string>;
|
|
694
|
+
}
|
|
590
695
|
/**
|
|
591
696
|
* Declarative transition rule for on_* blocks.
|
|
592
697
|
*/
|
|
@@ -654,6 +759,8 @@ interface DebugConfig {
|
|
|
654
759
|
* PR comment output configuration
|
|
655
760
|
*/
|
|
656
761
|
interface PrCommentOutput {
|
|
762
|
+
/** Whether PR comments are enabled */
|
|
763
|
+
enabled?: boolean;
|
|
657
764
|
/** Format of the output */
|
|
658
765
|
format: ConfigOutputFormat;
|
|
659
766
|
/** How to group the results */
|
|
@@ -829,6 +936,34 @@ interface CustomToolDefinition {
|
|
|
829
936
|
/** Expected output schema for validation */
|
|
830
937
|
outputSchema?: Record<string, unknown>;
|
|
831
938
|
}
|
|
939
|
+
/**
|
|
940
|
+
* Workflow input definition for standalone reusable workflows
|
|
941
|
+
*/
|
|
942
|
+
interface WorkflowInput {
|
|
943
|
+
/** Input parameter name */
|
|
944
|
+
name: string;
|
|
945
|
+
/** JSON Schema for the input */
|
|
946
|
+
schema?: Record<string, unknown>;
|
|
947
|
+
/** Whether this input is required */
|
|
948
|
+
required?: boolean;
|
|
949
|
+
/** Default value if not provided */
|
|
950
|
+
default?: unknown;
|
|
951
|
+
/** Human-readable description */
|
|
952
|
+
description?: string;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Workflow output definition for standalone reusable workflows
|
|
956
|
+
*/
|
|
957
|
+
interface WorkflowOutput {
|
|
958
|
+
/** Output name */
|
|
959
|
+
name: string;
|
|
960
|
+
/** Human-readable description */
|
|
961
|
+
description?: string;
|
|
962
|
+
/** Value using Liquid template syntax (references step outputs) */
|
|
963
|
+
value?: string;
|
|
964
|
+
/** Value using JavaScript expression (alternative to value) */
|
|
965
|
+
value_js?: string;
|
|
966
|
+
}
|
|
832
967
|
/**
|
|
833
968
|
* Main Visor configuration
|
|
834
969
|
*/
|
|
@@ -843,12 +978,16 @@ interface VisorConfig {
|
|
|
843
978
|
tools?: Record<string, CustomToolDefinition>;
|
|
844
979
|
/** Import workflow definitions from external files or URLs */
|
|
845
980
|
imports?: string[];
|
|
981
|
+
/** Workflow inputs (for standalone reusable workflows) */
|
|
982
|
+
inputs?: WorkflowInput[];
|
|
983
|
+
/** Workflow outputs (for standalone reusable workflows) */
|
|
984
|
+
outputs?: WorkflowOutput[];
|
|
846
985
|
/** Step configurations (recommended) */
|
|
847
986
|
steps?: Record<string, CheckConfig>;
|
|
848
987
|
/** Check configurations (legacy, use 'steps' instead) - always populated after normalization */
|
|
849
988
|
checks?: Record<string, CheckConfig>;
|
|
850
|
-
/** Output configuration */
|
|
851
|
-
output
|
|
989
|
+
/** Output configuration (optional - defaults provided) */
|
|
990
|
+
output?: OutputConfig;
|
|
852
991
|
/** HTTP server configuration for receiving webhooks */
|
|
853
992
|
http_server?: HttpServerConfig;
|
|
854
993
|
/** Memory storage configuration */
|
|
@@ -884,6 +1023,42 @@ interface VisorConfig {
|
|
|
884
1023
|
/** Frontend-specific configuration */
|
|
885
1024
|
config?: unknown;
|
|
886
1025
|
}>;
|
|
1026
|
+
/** Workspace isolation configuration for sandboxed execution */
|
|
1027
|
+
workspace?: WorkspaceConfig;
|
|
1028
|
+
/** Slack configuration */
|
|
1029
|
+
slack?: SlackConfig;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Workspace isolation configuration
|
|
1033
|
+
*/
|
|
1034
|
+
interface WorkspaceConfig {
|
|
1035
|
+
/** Enable workspace isolation (default: true when config present) */
|
|
1036
|
+
enabled?: boolean;
|
|
1037
|
+
/** Base path for workspaces (default: /tmp/visor-workspaces) */
|
|
1038
|
+
base_path?: string;
|
|
1039
|
+
/** Clean up workspace on exit (default: true) */
|
|
1040
|
+
cleanup_on_exit?: boolean;
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Slack configuration
|
|
1044
|
+
*/
|
|
1045
|
+
interface SlackConfig {
|
|
1046
|
+
/** Slack API version */
|
|
1047
|
+
version?: string;
|
|
1048
|
+
/** Mention handling: 'all', 'direct', etc. */
|
|
1049
|
+
mentions?: string;
|
|
1050
|
+
/** Thread handling: 'required', 'optional', etc. */
|
|
1051
|
+
threads?: string;
|
|
1052
|
+
/** Show raw output in Slack responses */
|
|
1053
|
+
show_raw_output?: boolean;
|
|
1054
|
+
/**
|
|
1055
|
+
* Append telemetry identifiers to Slack replies.
|
|
1056
|
+
*/
|
|
1057
|
+
telemetry?: SlackTelemetryConfig;
|
|
1058
|
+
}
|
|
1059
|
+
interface SlackTelemetryConfig {
|
|
1060
|
+
/** Enable telemetry ID suffix in Slack messages */
|
|
1061
|
+
enabled?: boolean;
|
|
887
1062
|
}
|
|
888
1063
|
|
|
889
1064
|
/**
|
|
@@ -975,6 +1150,36 @@ interface DebugInfo {
|
|
|
975
1150
|
}>;
|
|
976
1151
|
}
|
|
977
1152
|
|
|
1153
|
+
interface EventEnvelope<T = any> {
|
|
1154
|
+
id: string;
|
|
1155
|
+
version: 1;
|
|
1156
|
+
timestamp: string;
|
|
1157
|
+
runId: string;
|
|
1158
|
+
workflowId?: string;
|
|
1159
|
+
caseId?: string;
|
|
1160
|
+
wave?: number;
|
|
1161
|
+
attempt?: number;
|
|
1162
|
+
checkId?: string;
|
|
1163
|
+
traceId?: string;
|
|
1164
|
+
spanId?: string;
|
|
1165
|
+
causationId?: string;
|
|
1166
|
+
correlationId?: string;
|
|
1167
|
+
payload: T;
|
|
1168
|
+
}
|
|
1169
|
+
type AnyEvent = any;
|
|
1170
|
+
|
|
1171
|
+
type EventHandler<T = AnyEvent> = (event: T | EventEnvelope<T>) => void | Promise<void>;
|
|
1172
|
+
interface Subscription {
|
|
1173
|
+
unsubscribe(): void;
|
|
1174
|
+
}
|
|
1175
|
+
declare class EventBus {
|
|
1176
|
+
private handlers;
|
|
1177
|
+
private anyHandlers;
|
|
1178
|
+
on<T = AnyEvent>(eventType: string, handler: EventHandler<T>): Subscription;
|
|
1179
|
+
onAny(handler: EventHandler): Subscription;
|
|
1180
|
+
emit(event: AnyEvent | EventEnvelope): Promise<void>;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
978
1183
|
/**
|
|
979
1184
|
* Execution context passed to check providers
|
|
980
1185
|
*/
|
|
@@ -994,6 +1199,8 @@ interface ExecutionContext {
|
|
|
994
1199
|
stageHistoryBase?: Record<string, number>;
|
|
995
1200
|
/** Workflow inputs - available when executing within a workflow */
|
|
996
1201
|
workflowInputs?: Record<string, unknown>;
|
|
1202
|
+
/** Custom arguments passed from on_init 'with' directive */
|
|
1203
|
+
args?: Record<string, unknown>;
|
|
997
1204
|
/** SDK hooks for human input */
|
|
998
1205
|
hooks?: {
|
|
999
1206
|
onHumanInput?: (request: HumanInputRequest) => Promise<string>;
|
|
@@ -1018,6 +1225,13 @@ interface ExecutionContext {
|
|
|
1018
1225
|
/** reset per-run guard state before grouped execution */
|
|
1019
1226
|
resetPerRunState?: boolean;
|
|
1020
1227
|
};
|
|
1228
|
+
/** Optional event bus for emitting integration events (e.g., HumanInputRequested) */
|
|
1229
|
+
eventBus?: EventBus;
|
|
1230
|
+
/** Optional webhook context (e.g., Slack Events API payload) */
|
|
1231
|
+
webhookContext?: {
|
|
1232
|
+
webhookData?: Map<string, unknown>;
|
|
1233
|
+
eventType?: string;
|
|
1234
|
+
};
|
|
1021
1235
|
}
|
|
1022
1236
|
|
|
1023
1237
|
interface VisorOptions {
|
package/dist/sdk/sdk.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ interface FailureConditionResult {
|
|
|
120
120
|
/**
|
|
121
121
|
* Valid check types in configuration
|
|
122
122
|
*/
|
|
123
|
-
type ConfigCheckType = 'ai' | 'command' | 'script' | 'http' | 'http_input' | 'http_client' | 'noop' | 'log' | 'memory' | 'github' | 'claude-code' | 'mcp' | 'human-input' | 'workflow';
|
|
123
|
+
type ConfigCheckType = 'ai' | 'command' | 'script' | 'http' | 'http_input' | 'http_client' | 'noop' | 'log' | 'memory' | 'github' | 'claude-code' | 'mcp' | 'human-input' | 'workflow' | 'git-checkout';
|
|
124
124
|
/**
|
|
125
125
|
* Valid event triggers for checks
|
|
126
126
|
*/
|
|
@@ -235,6 +235,15 @@ interface AIProviderConfig {
|
|
|
235
235
|
custom_prompt?: string;
|
|
236
236
|
/** Skip adding code context (diffs, files, PR info) to the prompt */
|
|
237
237
|
skip_code_context?: boolean;
|
|
238
|
+
/** Skip adding Slack conversation context to the prompt (when running under Slack) */
|
|
239
|
+
skip_slack_context?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Skip adding transport-specific context (e.g., GitHub PR/issue XML, Slack
|
|
242
|
+
* conversation XML) to the prompt. When true, this behaves like setting both
|
|
243
|
+
* skip_code_context and skip_slack_context to true, unless those are
|
|
244
|
+
* explicitly overridden.
|
|
245
|
+
*/
|
|
246
|
+
skip_transport_context?: boolean;
|
|
238
247
|
/** MCP servers configuration */
|
|
239
248
|
mcpServers?: Record<string, McpServerConfig>;
|
|
240
249
|
/** Enable the delegate tool for task distribution to subagents */
|
|
@@ -253,6 +262,8 @@ interface AIProviderConfig {
|
|
|
253
262
|
allowBash?: boolean;
|
|
254
263
|
/** Advanced bash command execution configuration */
|
|
255
264
|
bashConfig?: BashConfig;
|
|
265
|
+
/** Completion prompt for post-completion validation/review (runs after attempt_completion) */
|
|
266
|
+
completion_prompt?: string;
|
|
256
267
|
}
|
|
257
268
|
/**
|
|
258
269
|
* MCP Server configuration
|
|
@@ -347,14 +358,16 @@ interface CheckConfig {
|
|
|
347
358
|
ai_custom_prompt?: string;
|
|
348
359
|
/** MCP servers for this AI check - overrides global setting */
|
|
349
360
|
ai_mcp_servers?: Record<string, McpServerConfig>;
|
|
361
|
+
/** List of custom tool names to expose to this AI check via ephemeral SSE MCP server */
|
|
362
|
+
ai_custom_tools?: string[];
|
|
350
363
|
/** Claude Code configuration (for claude-code type checks) */
|
|
351
364
|
claude_code?: ClaudeCodeConfig;
|
|
352
365
|
/** Environment variables for this check */
|
|
353
366
|
env?: EnvConfig;
|
|
354
367
|
/** Timeout in seconds for command execution (default: 60) */
|
|
355
368
|
timeout?: number;
|
|
356
|
-
/** Check IDs that this check depends on (optional) */
|
|
357
|
-
depends_on?: string[];
|
|
369
|
+
/** Check IDs that this check depends on (optional). Accepts single string or array. */
|
|
370
|
+
depends_on?: string | string[];
|
|
358
371
|
/** Group name for comment separation (e.g., "code-review", "pr-overview") - optional */
|
|
359
372
|
group?: string;
|
|
360
373
|
/** Schema type for template rendering (e.g., "code-review", "markdown") or inline JSON schema object - optional */
|
|
@@ -409,6 +422,8 @@ interface CheckConfig {
|
|
|
409
422
|
fanout?: 'map' | 'reduce';
|
|
410
423
|
/** Alias for fanout: 'reduce' */
|
|
411
424
|
reduce?: boolean;
|
|
425
|
+
/** Init routing configuration for this check (runs before execution/preprocessing) */
|
|
426
|
+
on_init?: OnInitConfig;
|
|
412
427
|
/** Failure routing configuration for this check (retry/goto/run) */
|
|
413
428
|
on_fail?: OnFailConfig;
|
|
414
429
|
/** Success routing configuration for this check (post-actions and optional goto) */
|
|
@@ -510,6 +525,43 @@ interface CheckConfig {
|
|
|
510
525
|
overrides?: Record<string, Partial<CheckConfig>>;
|
|
511
526
|
/** Map workflow outputs to check outputs */
|
|
512
527
|
output_mapping?: Record<string, string>;
|
|
528
|
+
/** Alias for args - workflow inputs (backward compatibility) */
|
|
529
|
+
workflow_inputs?: Record<string, unknown>;
|
|
530
|
+
/** Config file path - alternative to workflow ID (loads a Visor config file as workflow) */
|
|
531
|
+
config?: string;
|
|
532
|
+
/** Alias for overrides - workflow step overrides (backward compatibility) */
|
|
533
|
+
workflow_overrides?: Record<string, Partial<CheckConfig>>;
|
|
534
|
+
/**
|
|
535
|
+
* Git-checkout provider specific options (optional, only used when type === 'git-checkout').
|
|
536
|
+
*/
|
|
537
|
+
/** Git reference to checkout (branch, tag, commit SHA) - supports templates */
|
|
538
|
+
ref?: string;
|
|
539
|
+
/** Repository URL or owner/repo format (defaults to current repository) */
|
|
540
|
+
repository?: string;
|
|
541
|
+
/** GitHub token for private repositories (defaults to GITHUB_TOKEN env) */
|
|
542
|
+
token?: string;
|
|
543
|
+
/** Number of commits to fetch (0 for full history, default: 1) */
|
|
544
|
+
fetch_depth?: number;
|
|
545
|
+
/** Whether to fetch tags (default: false) */
|
|
546
|
+
fetch_tags?: boolean;
|
|
547
|
+
/** Checkout submodules: false, true, or 'recursive' */
|
|
548
|
+
submodules?: boolean | 'recursive';
|
|
549
|
+
/** Working directory for the checkout (defaults to temp directory) */
|
|
550
|
+
working_directory?: string;
|
|
551
|
+
/** Use git worktree for efficient parallel checkouts (default: true) */
|
|
552
|
+
use_worktree?: boolean;
|
|
553
|
+
/** Clean the working directory before checkout (default: true) */
|
|
554
|
+
clean?: boolean;
|
|
555
|
+
/** Sparse checkout paths - only checkout specific directories/files */
|
|
556
|
+
sparse_checkout?: string[];
|
|
557
|
+
/** Enable Git LFS (Large File Storage) */
|
|
558
|
+
lfs?: boolean;
|
|
559
|
+
/** Timeout in ms for cloning the bare repository (default: 300000 = 5 min) */
|
|
560
|
+
clone_timeout_ms?: number;
|
|
561
|
+
/** Clean up worktree on failure (default: true) */
|
|
562
|
+
cleanup_on_failure?: boolean;
|
|
563
|
+
/** Keep worktree after workflow completion (default: false) */
|
|
564
|
+
persist_worktree?: boolean;
|
|
513
565
|
}
|
|
514
566
|
/**
|
|
515
567
|
* Backoff policy for retries
|
|
@@ -587,6 +639,59 @@ interface OnFinishConfig {
|
|
|
587
639
|
/** Declarative transitions (see OnFailConfig.transitions). */
|
|
588
640
|
transitions?: TransitionRule[];
|
|
589
641
|
}
|
|
642
|
+
/**
|
|
643
|
+
* Init routing configuration per check
|
|
644
|
+
* Runs BEFORE the check executes (preprocessing/setup)
|
|
645
|
+
*/
|
|
646
|
+
interface OnInitConfig {
|
|
647
|
+
/** Items to run before this check executes */
|
|
648
|
+
run?: OnInitRunItem[];
|
|
649
|
+
/** Dynamic init items: JS expression returning OnInitRunItem[] */
|
|
650
|
+
run_js?: string;
|
|
651
|
+
/** Declarative transitions (optional, for advanced use cases) */
|
|
652
|
+
transitions?: TransitionRule[];
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Unified on_init run item - can be tool, step, workflow, or plain string
|
|
656
|
+
*/
|
|
657
|
+
type OnInitRunItem = OnInitToolInvocation | OnInitStepInvocation | OnInitWorkflowInvocation | string;
|
|
658
|
+
/**
|
|
659
|
+
* Invoke a custom tool (from tools: section)
|
|
660
|
+
*/
|
|
661
|
+
interface OnInitToolInvocation {
|
|
662
|
+
/** Tool name (must exist in tools: section) */
|
|
663
|
+
tool: string;
|
|
664
|
+
/** Arguments to pass to the tool (Liquid templates supported) */
|
|
665
|
+
with?: Record<string, unknown>;
|
|
666
|
+
/** Custom output name (defaults to tool name) */
|
|
667
|
+
as?: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Invoke a helper step (regular check)
|
|
671
|
+
*/
|
|
672
|
+
interface OnInitStepInvocation {
|
|
673
|
+
/** Step name (must exist in steps: section) */
|
|
674
|
+
step: string;
|
|
675
|
+
/** Arguments to pass to the step (Liquid templates supported) */
|
|
676
|
+
with?: Record<string, unknown>;
|
|
677
|
+
/** Custom output name (defaults to step name) */
|
|
678
|
+
as?: string;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Invoke a reusable workflow
|
|
682
|
+
*/
|
|
683
|
+
interface OnInitWorkflowInvocation {
|
|
684
|
+
/** Workflow ID or path */
|
|
685
|
+
workflow: string;
|
|
686
|
+
/** Workflow inputs (Liquid templates supported) */
|
|
687
|
+
with?: Record<string, unknown>;
|
|
688
|
+
/** Custom output name (defaults to workflow name) */
|
|
689
|
+
as?: string;
|
|
690
|
+
/** Step overrides */
|
|
691
|
+
overrides?: Record<string, Partial<CheckConfig>>;
|
|
692
|
+
/** Output mapping */
|
|
693
|
+
output_mapping?: Record<string, string>;
|
|
694
|
+
}
|
|
590
695
|
/**
|
|
591
696
|
* Declarative transition rule for on_* blocks.
|
|
592
697
|
*/
|
|
@@ -654,6 +759,8 @@ interface DebugConfig {
|
|
|
654
759
|
* PR comment output configuration
|
|
655
760
|
*/
|
|
656
761
|
interface PrCommentOutput {
|
|
762
|
+
/** Whether PR comments are enabled */
|
|
763
|
+
enabled?: boolean;
|
|
657
764
|
/** Format of the output */
|
|
658
765
|
format: ConfigOutputFormat;
|
|
659
766
|
/** How to group the results */
|
|
@@ -829,6 +936,34 @@ interface CustomToolDefinition {
|
|
|
829
936
|
/** Expected output schema for validation */
|
|
830
937
|
outputSchema?: Record<string, unknown>;
|
|
831
938
|
}
|
|
939
|
+
/**
|
|
940
|
+
* Workflow input definition for standalone reusable workflows
|
|
941
|
+
*/
|
|
942
|
+
interface WorkflowInput {
|
|
943
|
+
/** Input parameter name */
|
|
944
|
+
name: string;
|
|
945
|
+
/** JSON Schema for the input */
|
|
946
|
+
schema?: Record<string, unknown>;
|
|
947
|
+
/** Whether this input is required */
|
|
948
|
+
required?: boolean;
|
|
949
|
+
/** Default value if not provided */
|
|
950
|
+
default?: unknown;
|
|
951
|
+
/** Human-readable description */
|
|
952
|
+
description?: string;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Workflow output definition for standalone reusable workflows
|
|
956
|
+
*/
|
|
957
|
+
interface WorkflowOutput {
|
|
958
|
+
/** Output name */
|
|
959
|
+
name: string;
|
|
960
|
+
/** Human-readable description */
|
|
961
|
+
description?: string;
|
|
962
|
+
/** Value using Liquid template syntax (references step outputs) */
|
|
963
|
+
value?: string;
|
|
964
|
+
/** Value using JavaScript expression (alternative to value) */
|
|
965
|
+
value_js?: string;
|
|
966
|
+
}
|
|
832
967
|
/**
|
|
833
968
|
* Main Visor configuration
|
|
834
969
|
*/
|
|
@@ -843,12 +978,16 @@ interface VisorConfig {
|
|
|
843
978
|
tools?: Record<string, CustomToolDefinition>;
|
|
844
979
|
/** Import workflow definitions from external files or URLs */
|
|
845
980
|
imports?: string[];
|
|
981
|
+
/** Workflow inputs (for standalone reusable workflows) */
|
|
982
|
+
inputs?: WorkflowInput[];
|
|
983
|
+
/** Workflow outputs (for standalone reusable workflows) */
|
|
984
|
+
outputs?: WorkflowOutput[];
|
|
846
985
|
/** Step configurations (recommended) */
|
|
847
986
|
steps?: Record<string, CheckConfig>;
|
|
848
987
|
/** Check configurations (legacy, use 'steps' instead) - always populated after normalization */
|
|
849
988
|
checks?: Record<string, CheckConfig>;
|
|
850
|
-
/** Output configuration */
|
|
851
|
-
output
|
|
989
|
+
/** Output configuration (optional - defaults provided) */
|
|
990
|
+
output?: OutputConfig;
|
|
852
991
|
/** HTTP server configuration for receiving webhooks */
|
|
853
992
|
http_server?: HttpServerConfig;
|
|
854
993
|
/** Memory storage configuration */
|
|
@@ -884,6 +1023,42 @@ interface VisorConfig {
|
|
|
884
1023
|
/** Frontend-specific configuration */
|
|
885
1024
|
config?: unknown;
|
|
886
1025
|
}>;
|
|
1026
|
+
/** Workspace isolation configuration for sandboxed execution */
|
|
1027
|
+
workspace?: WorkspaceConfig;
|
|
1028
|
+
/** Slack configuration */
|
|
1029
|
+
slack?: SlackConfig;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Workspace isolation configuration
|
|
1033
|
+
*/
|
|
1034
|
+
interface WorkspaceConfig {
|
|
1035
|
+
/** Enable workspace isolation (default: true when config present) */
|
|
1036
|
+
enabled?: boolean;
|
|
1037
|
+
/** Base path for workspaces (default: /tmp/visor-workspaces) */
|
|
1038
|
+
base_path?: string;
|
|
1039
|
+
/** Clean up workspace on exit (default: true) */
|
|
1040
|
+
cleanup_on_exit?: boolean;
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Slack configuration
|
|
1044
|
+
*/
|
|
1045
|
+
interface SlackConfig {
|
|
1046
|
+
/** Slack API version */
|
|
1047
|
+
version?: string;
|
|
1048
|
+
/** Mention handling: 'all', 'direct', etc. */
|
|
1049
|
+
mentions?: string;
|
|
1050
|
+
/** Thread handling: 'required', 'optional', etc. */
|
|
1051
|
+
threads?: string;
|
|
1052
|
+
/** Show raw output in Slack responses */
|
|
1053
|
+
show_raw_output?: boolean;
|
|
1054
|
+
/**
|
|
1055
|
+
* Append telemetry identifiers to Slack replies.
|
|
1056
|
+
*/
|
|
1057
|
+
telemetry?: SlackTelemetryConfig;
|
|
1058
|
+
}
|
|
1059
|
+
interface SlackTelemetryConfig {
|
|
1060
|
+
/** Enable telemetry ID suffix in Slack messages */
|
|
1061
|
+
enabled?: boolean;
|
|
887
1062
|
}
|
|
888
1063
|
|
|
889
1064
|
/**
|
|
@@ -975,6 +1150,36 @@ interface DebugInfo {
|
|
|
975
1150
|
}>;
|
|
976
1151
|
}
|
|
977
1152
|
|
|
1153
|
+
interface EventEnvelope<T = any> {
|
|
1154
|
+
id: string;
|
|
1155
|
+
version: 1;
|
|
1156
|
+
timestamp: string;
|
|
1157
|
+
runId: string;
|
|
1158
|
+
workflowId?: string;
|
|
1159
|
+
caseId?: string;
|
|
1160
|
+
wave?: number;
|
|
1161
|
+
attempt?: number;
|
|
1162
|
+
checkId?: string;
|
|
1163
|
+
traceId?: string;
|
|
1164
|
+
spanId?: string;
|
|
1165
|
+
causationId?: string;
|
|
1166
|
+
correlationId?: string;
|
|
1167
|
+
payload: T;
|
|
1168
|
+
}
|
|
1169
|
+
type AnyEvent = any;
|
|
1170
|
+
|
|
1171
|
+
type EventHandler<T = AnyEvent> = (event: T | EventEnvelope<T>) => void | Promise<void>;
|
|
1172
|
+
interface Subscription {
|
|
1173
|
+
unsubscribe(): void;
|
|
1174
|
+
}
|
|
1175
|
+
declare class EventBus {
|
|
1176
|
+
private handlers;
|
|
1177
|
+
private anyHandlers;
|
|
1178
|
+
on<T = AnyEvent>(eventType: string, handler: EventHandler<T>): Subscription;
|
|
1179
|
+
onAny(handler: EventHandler): Subscription;
|
|
1180
|
+
emit(event: AnyEvent | EventEnvelope): Promise<void>;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
978
1183
|
/**
|
|
979
1184
|
* Execution context passed to check providers
|
|
980
1185
|
*/
|
|
@@ -994,6 +1199,8 @@ interface ExecutionContext {
|
|
|
994
1199
|
stageHistoryBase?: Record<string, number>;
|
|
995
1200
|
/** Workflow inputs - available when executing within a workflow */
|
|
996
1201
|
workflowInputs?: Record<string, unknown>;
|
|
1202
|
+
/** Custom arguments passed from on_init 'with' directive */
|
|
1203
|
+
args?: Record<string, unknown>;
|
|
997
1204
|
/** SDK hooks for human input */
|
|
998
1205
|
hooks?: {
|
|
999
1206
|
onHumanInput?: (request: HumanInputRequest) => Promise<string>;
|
|
@@ -1018,6 +1225,13 @@ interface ExecutionContext {
|
|
|
1018
1225
|
/** reset per-run guard state before grouped execution */
|
|
1019
1226
|
resetPerRunState?: boolean;
|
|
1020
1227
|
};
|
|
1228
|
+
/** Optional event bus for emitting integration events (e.g., HumanInputRequested) */
|
|
1229
|
+
eventBus?: EventBus;
|
|
1230
|
+
/** Optional webhook context (e.g., Slack Events API payload) */
|
|
1231
|
+
webhookContext?: {
|
|
1232
|
+
webhookData?: Map<string, unknown>;
|
|
1233
|
+
eventType?: string;
|
|
1234
|
+
};
|
|
1021
1235
|
}
|
|
1022
1236
|
|
|
1023
1237
|
interface VisorOptions {
|