@probelabs/visor 0.1.129 → 0.1.130
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 +23 -0
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/docs/author-permissions.md +20 -0
- package/dist/docs/enterprise-policy.md +1325 -0
- package/dist/docs/index.md +10 -0
- package/dist/docs/scheduler-storage.md +433 -0
- package/dist/docs/scheduler.md +12 -2
- package/dist/enterprise/license/validator.d.ts +39 -0
- package/dist/enterprise/license/validator.d.ts.map +1 -0
- package/dist/enterprise/loader.d.ts +25 -0
- package/dist/enterprise/loader.d.ts.map +1 -0
- package/dist/enterprise/policy/opa-compiler.d.ts +37 -0
- package/dist/enterprise/policy/opa-compiler.d.ts.map +1 -0
- package/dist/enterprise/policy/opa-http-evaluator.d.ts +36 -0
- package/dist/enterprise/policy/opa-http-evaluator.d.ts.map +1 -0
- package/dist/enterprise/policy/opa-policy-engine.d.ts +48 -0
- package/dist/enterprise/policy/opa-policy-engine.d.ts.map +1 -0
- package/dist/enterprise/policy/opa-wasm-evaluator.d.ts +34 -0
- package/dist/enterprise/policy/opa-wasm-evaluator.d.ts.map +1 -0
- package/dist/enterprise/policy/policy-input-builder.d.ts +120 -0
- package/dist/enterprise/policy/policy-input-builder.d.ts.map +1 -0
- package/dist/enterprise/scheduler/knex-store.d.ts +41 -0
- package/dist/enterprise/scheduler/knex-store.d.ts.map +1 -0
- package/dist/examples/README.md +23 -0
- package/dist/examples/enterprise-policy/README.md +344 -0
- package/dist/examples/enterprise-policy/policies/capability_resolve.rego +29 -0
- package/dist/examples/enterprise-policy/policies/capability_resolve_test.rego +230 -0
- package/dist/examples/enterprise-policy/policies/check_execute.rego +71 -0
- package/dist/examples/enterprise-policy/policies/check_execute_test.rego +321 -0
- package/dist/examples/enterprise-policy/policies/deploy_production.rego +33 -0
- package/dist/examples/enterprise-policy/policies/deploy_production_test.rego +29 -0
- package/dist/examples/enterprise-policy/policies/slack_channel_gate.rego +17 -0
- package/dist/examples/enterprise-policy/policies/slack_tool_restrict.rego +16 -0
- package/dist/examples/enterprise-policy/policies/tool_invoke.rego +24 -0
- package/dist/examples/enterprise-policy/policies/tool_invoke_test.rego +227 -0
- package/dist/examples/enterprise-policy/visor.yaml +64 -0
- package/dist/failure-condition-evaluator.d.ts +18 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/slack-frontend.d.ts +1 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +139 -0
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/index.js +12121 -7169
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/output/traces/{run-2026-02-08T18-16-04-160Z.ndjson → run-2026-02-11T16-20-59-999Z.ndjson} +84 -84
- package/dist/{traces/run-2026-02-08T18-16-51-253Z.ndjson → output/traces/run-2026-02-11T16-21-47-711Z.ndjson} +1032 -1032
- package/dist/policy/default-engine.d.ts +17 -0
- package/dist/policy/default-engine.d.ts.map +1 -0
- package/dist/policy/index.d.ts +4 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/policy-check-command.d.ts +65 -0
- package/dist/policy/policy-check-command.d.ts.map +1 -0
- package/dist/policy/types.d.ts +81 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +2 -0
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +2 -0
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/schedule-store.d.ts +33 -59
- package/dist/scheduler/schedule-store.d.ts.map +1 -1
- package/dist/scheduler/schedule-tool.d.ts.map +1 -1
- package/dist/scheduler/scheduler.d.ts +24 -3
- package/dist/scheduler/scheduler.d.ts.map +1 -1
- package/dist/scheduler/store/index.d.ts +7 -0
- package/dist/scheduler/store/index.d.ts.map +1 -0
- package/dist/scheduler/store/json-migrator.d.ts +10 -0
- package/dist/scheduler/store/json-migrator.d.ts.map +1 -0
- package/dist/scheduler/store/sqlite-store.d.ts +32 -0
- package/dist/scheduler/store/sqlite-store.d.ts.map +1 -0
- package/dist/scheduler/store/types.d.ts +127 -0
- package/dist/scheduler/store/types.d.ts.map +1 -0
- package/dist/sdk/check-provider-registry-M3Y6JMTW.mjs +28 -0
- package/dist/sdk/check-provider-registry-PANIXYRB.mjs +28 -0
- package/dist/sdk/{chunk-D5KI4YQ4.mjs → chunk-DIND4ZCV.mjs} +2 -2
- package/dist/sdk/{chunk-DGZPPGJJ.mjs → chunk-EUUAQBTW.mjs} +1463 -568
- package/dist/sdk/chunk-EUUAQBTW.mjs.map +1 -0
- package/dist/sdk/{chunk-XDLQ3UNF.mjs → chunk-GEW6LS32.mjs} +2 -2
- package/dist/sdk/{chunk-N7HO6KKC.mjs → chunk-HOKQOO3G.mjs} +11 -6
- package/dist/sdk/chunk-HOKQOO3G.mjs.map +1 -0
- package/dist/sdk/{chunk-XR7XXGL7.mjs → chunk-JL7JXCET.mjs} +2 -2
- package/dist/sdk/{chunk-6W75IMDC.mjs → chunk-LG4AUKHB.mjs} +2 -2
- package/dist/sdk/{chunk-BDGUM6BA.mjs → chunk-S6CD7GFM.mjs} +1463 -568
- package/dist/sdk/chunk-S6CD7GFM.mjs.map +1 -0
- package/dist/sdk/{chunk-PO7X5XI7.mjs → chunk-SZXICFQ3.mjs} +2 -2
- package/dist/sdk/{chunk-HEX3RL32.mjs → chunk-UCMJJ3IM.mjs} +5 -2
- package/dist/sdk/{chunk-HEX3RL32.mjs.map → chunk-UCMJJ3IM.mjs.map} +1 -1
- package/dist/sdk/{chunk-7YSOINAQ.mjs → chunk-UCNT3PDT.mjs} +342 -5
- package/dist/sdk/chunk-UCNT3PDT.mjs.map +1 -0
- package/dist/sdk/{chunk-R5Z7YWPB.mjs → chunk-V2IV3ILA.mjs} +7 -5
- package/dist/sdk/chunk-V2IV3ILA.mjs.map +1 -0
- package/dist/sdk/{chunk-SGS2VMEL.mjs → chunk-VMLORODQ.mjs} +107 -20
- package/dist/sdk/chunk-VMLORODQ.mjs.map +1 -0
- package/dist/sdk/{chunk-2KB35MB7.mjs → chunk-VPC3QSPW.mjs} +2 -2
- package/dist/sdk/{chunk-J5RGJQ53.mjs → chunk-YJRBN3XS.mjs} +2 -2
- package/dist/sdk/{command-executor-DVVXERLR.mjs → command-executor-TOYBBE7S.mjs} +4 -4
- package/dist/sdk/{config-7VTT64SQ.mjs → config-OGOS4ZU4.mjs} +4 -4
- package/dist/sdk/failure-condition-evaluator-HC3M5377.mjs +17 -0
- package/dist/sdk/{github-frontend-3N2NLO66.mjs → github-frontend-E2KJSC3Y.mjs} +7 -7
- package/dist/sdk/{host-ONVMEHAA.mjs → host-EE6EJ2FM.mjs} +4 -4
- package/dist/sdk/lazy-otel-5NH4ZJJM.mjs +24 -0
- package/dist/sdk/{liquid-extensions-5IZLTFSZ.mjs → liquid-extensions-E4EUOCES.mjs} +5 -5
- package/dist/sdk/memory-store-AAPL2MTE.mjs +12 -0
- package/dist/sdk/{metrics-GXQ2EDXA.mjs → metrics-I6A7IHG4.mjs} +3 -3
- package/dist/sdk/{prompt-state-YHGXB2OA.mjs → prompt-state-VAKKC773.mjs} +4 -4
- package/dist/sdk/{renderer-schema-CMXOLNIG.mjs → renderer-schema-HXEW6BRJ.mjs} +3 -3
- package/dist/sdk/{routing-S3Y7T2X3.mjs → routing-OZQWAGAI.mjs} +9 -8
- package/dist/sdk/schedule-tool-handler-B7TMSG6A.mjs +38 -0
- package/dist/sdk/schedule-tool-handler-IEB2VS7O.mjs +38 -0
- package/dist/sdk/sdk.d.mts +134 -4
- package/dist/sdk/sdk.d.ts +134 -4
- package/dist/sdk/sdk.js +2509 -1085
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +14 -14
- package/dist/sdk/{slack-frontend-R3M2CACB.mjs → slack-frontend-LAY45IBR.mjs} +119 -29
- package/dist/sdk/slack-frontend-LAY45IBR.mjs.map +1 -0
- package/dist/sdk/{trace-helpers-YHNPC7MR.mjs → trace-helpers-PP3YHTAM.mjs} +3 -3
- package/dist/sdk/{tui-frontend-S546M7A7.mjs → tui-frontend-T56PZB67.mjs} +25 -16
- package/dist/sdk/tui-frontend-T56PZB67.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-2ET3SFZH.mjs +28 -0
- package/dist/sdk/workflow-check-provider-2ET3SFZH.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-HB4XTD4Z.mjs +28 -0
- package/dist/sdk/workflow-check-provider-HB4XTD4Z.mjs.map +1 -0
- package/dist/sdk/workflow-registry-AAD37XKZ.mjs +12 -0
- package/dist/sdk/workflow-registry-AAD37XKZ.mjs.map +1 -0
- package/dist/slack/client.d.ts +12 -0
- package/dist/slack/client.d.ts.map +1 -1
- package/dist/slack/slack-output-adapter.d.ts.map +1 -1
- package/dist/slack/socket-runner.d.ts.map +1 -1
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/dist/state-machine/dispatch/policy-gate.d.ts +28 -0
- package/dist/state-machine/dispatch/policy-gate.d.ts.map +1 -0
- package/dist/state-machine/states/level-dispatch.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-execution-engine.d.ts.map +1 -1
- package/dist/test-runner/core/flow-stage.d.ts.map +1 -1
- package/dist/test-runner/validator.d.ts.map +1 -1
- package/dist/traces/{run-2026-02-08T18-16-04-160Z.ndjson → run-2026-02-11T16-20-59-999Z.ndjson} +84 -84
- package/dist/{output/traces/run-2026-02-08T18-16-51-253Z.ndjson → traces/run-2026-02-11T16-21-47-711Z.ndjson} +1032 -1032
- package/dist/tui/chat-runner.d.ts.map +1 -1
- package/dist/tui/chat-state.d.ts +1 -0
- package/dist/tui/chat-state.d.ts.map +1 -1
- package/dist/tui/chat-tui.d.ts +3 -2
- package/dist/tui/chat-tui.d.ts.map +1 -1
- package/dist/tui/components/chat-box.d.ts +9 -0
- package/dist/tui/components/chat-box.d.ts.map +1 -1
- package/dist/tui/components/input-bar.d.ts +18 -1
- package/dist/tui/components/input-bar.d.ts.map +1 -1
- package/dist/tui/components/status-bar.d.ts +5 -2
- package/dist/tui/components/status-bar.d.ts.map +1 -1
- package/dist/tui/components/trace-viewer.d.ts +1 -0
- package/dist/tui/components/trace-viewer.d.ts.map +1 -1
- package/dist/tui/tui-frontend.d.ts.map +1 -1
- package/dist/types/config.d.ts +107 -3
- 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/execution.d.ts +1 -1
- package/dist/types/execution.d.ts.map +1 -1
- package/package.json +14 -4
- package/dist/sdk/check-provider-registry-ACRGIYOB.mjs +0 -28
- package/dist/sdk/check-provider-registry-VYHKFHK2.mjs +0 -28
- package/dist/sdk/chunk-7YSOINAQ.mjs.map +0 -1
- package/dist/sdk/chunk-BDGUM6BA.mjs.map +0 -1
- package/dist/sdk/chunk-DGZPPGJJ.mjs.map +0 -1
- package/dist/sdk/chunk-N7HO6KKC.mjs.map +0 -1
- package/dist/sdk/chunk-R5Z7YWPB.mjs.map +0 -1
- package/dist/sdk/chunk-SGS2VMEL.mjs.map +0 -1
- package/dist/sdk/failure-condition-evaluator-4WMDF4Q3.mjs +0 -17
- package/dist/sdk/memory-store-3N4AZCYB.mjs +0 -12
- package/dist/sdk/slack-frontend-R3M2CACB.mjs.map +0 -1
- package/dist/sdk/tui-frontend-S546M7A7.mjs.map +0 -1
- package/dist/sdk/workflow-check-provider-4F3432ZP.mjs +0 -28
- package/dist/sdk/workflow-check-provider-A44PBPG2.mjs +0 -28
- package/dist/sdk/workflow-registry-ZAYYXLEP.mjs +0 -12
- /package/dist/sdk/{check-provider-registry-ACRGIYOB.mjs.map → check-provider-registry-M3Y6JMTW.mjs.map} +0 -0
- /package/dist/sdk/{check-provider-registry-VYHKFHK2.mjs.map → check-provider-registry-PANIXYRB.mjs.map} +0 -0
- /package/dist/sdk/{chunk-D5KI4YQ4.mjs.map → chunk-DIND4ZCV.mjs.map} +0 -0
- /package/dist/sdk/{chunk-XDLQ3UNF.mjs.map → chunk-GEW6LS32.mjs.map} +0 -0
- /package/dist/sdk/{chunk-XR7XXGL7.mjs.map → chunk-JL7JXCET.mjs.map} +0 -0
- /package/dist/sdk/{chunk-6W75IMDC.mjs.map → chunk-LG4AUKHB.mjs.map} +0 -0
- /package/dist/sdk/{chunk-PO7X5XI7.mjs.map → chunk-SZXICFQ3.mjs.map} +0 -0
- /package/dist/sdk/{chunk-2KB35MB7.mjs.map → chunk-VPC3QSPW.mjs.map} +0 -0
- /package/dist/sdk/{chunk-J5RGJQ53.mjs.map → chunk-YJRBN3XS.mjs.map} +0 -0
- /package/dist/sdk/{command-executor-DVVXERLR.mjs.map → command-executor-TOYBBE7S.mjs.map} +0 -0
- /package/dist/sdk/{config-7VTT64SQ.mjs.map → config-OGOS4ZU4.mjs.map} +0 -0
- /package/dist/sdk/{failure-condition-evaluator-4WMDF4Q3.mjs.map → failure-condition-evaluator-HC3M5377.mjs.map} +0 -0
- /package/dist/sdk/{github-frontend-3N2NLO66.mjs.map → github-frontend-E2KJSC3Y.mjs.map} +0 -0
- /package/dist/sdk/{host-ONVMEHAA.mjs.map → host-EE6EJ2FM.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-5IZLTFSZ.mjs.map → lazy-otel-5NH4ZJJM.mjs.map} +0 -0
- /package/dist/sdk/{memory-store-3N4AZCYB.mjs.map → liquid-extensions-E4EUOCES.mjs.map} +0 -0
- /package/dist/sdk/{metrics-GXQ2EDXA.mjs.map → memory-store-AAPL2MTE.mjs.map} +0 -0
- /package/dist/sdk/{prompt-state-YHGXB2OA.mjs.map → metrics-I6A7IHG4.mjs.map} +0 -0
- /package/dist/sdk/{routing-S3Y7T2X3.mjs.map → prompt-state-VAKKC773.mjs.map} +0 -0
- /package/dist/sdk/{renderer-schema-CMXOLNIG.mjs.map → renderer-schema-HXEW6BRJ.mjs.map} +0 -0
- /package/dist/sdk/{trace-helpers-YHNPC7MR.mjs.map → routing-OZQWAGAI.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-4F3432ZP.mjs.map → schedule-tool-handler-B7TMSG6A.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-A44PBPG2.mjs.map → schedule-tool-handler-IEB2VS7O.mjs.map} +0 -0
- /package/dist/sdk/{workflow-registry-ZAYYXLEP.mjs.map → trace-helpers-PP3YHTAM.mjs.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
context,
|
|
3
3
|
init_lazy_otel,
|
|
4
4
|
trace
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UCMJJ3IM.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__esm,
|
|
8
8
|
__export
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
logger_exports,
|
|
205
205
|
init_logger
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-SZXICFQ3.mjs.map
|
|
@@ -91,7 +91,6 @@ function createNoOpMeter() {
|
|
|
91
91
|
var otelApi, otelApiAttempted, OTEL_API_MODULE, trace, context, metrics, SpanStatusCode, SpanKind, diag, DiagConsoleLogger, DiagLogLevel;
|
|
92
92
|
var init_lazy_otel = __esm({
|
|
93
93
|
"src/telemetry/lazy-otel.ts"() {
|
|
94
|
-
"use strict";
|
|
95
94
|
otelApi = null;
|
|
96
95
|
otelApiAttempted = false;
|
|
97
96
|
OTEL_API_MODULE = "@opentelemetry/api";
|
|
@@ -218,7 +217,11 @@ export {
|
|
|
218
217
|
context,
|
|
219
218
|
metrics,
|
|
220
219
|
SpanStatusCode,
|
|
220
|
+
SpanKind,
|
|
221
|
+
diag,
|
|
222
|
+
DiagConsoleLogger,
|
|
223
|
+
DiagLogLevel,
|
|
221
224
|
lazy_otel_exports,
|
|
222
225
|
init_lazy_otel
|
|
223
226
|
};
|
|
224
|
-
//# sourceMappingURL=chunk-
|
|
227
|
+
//# sourceMappingURL=chunk-UCMJJ3IM.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/telemetry/lazy-otel.ts"],"sourcesContent":["/**\n * Lazy-loading wrapper for OpenTelemetry API.\n * Returns no-op implementations if OpenTelemetry is not installed.\n * Uses hardcoded module name for security - no dynamic module loading.\n */\n\nlet otelApi: any = null;\nlet otelApiAttempted = false;\n\n// Hardcoded allowed module name to prevent module loading attacks\nconst OTEL_API_MODULE = '@opentelemetry/api';\n\nfunction getOtelApi() {\n if (otelApiAttempted) return otelApi;\n otelApiAttempted = true;\n\n try {\n // Security: Only load the specific @opentelemetry/api module\n // Use dynamic require to prevent bundlers from including this module\n\n otelApi = (function (name: string) {\n return require(name);\n })(OTEL_API_MODULE);\n } catch {\n // OpenTelemetry not installed - provide no-op implementations\n otelApi = null;\n }\n\n return otelApi;\n}\n\n// Export lazy-loaded trace API\nexport const trace = {\n getTracer(name: string, version?: string) {\n const api = getOtelApi();\n if (!api) return createNoOpTracer();\n return api.trace.getTracer(name, version);\n },\n getSpan(context: any) {\n const api = getOtelApi();\n if (!api) return undefined;\n return api.trace.getSpan(context);\n },\n getActiveSpan() {\n const api = getOtelApi();\n if (!api) return undefined;\n return api.trace.getActiveSpan();\n },\n};\n\n// Export lazy-loaded context API\nexport const context = {\n active() {\n const api = getOtelApi();\n if (!api) return {};\n return api.context.active();\n },\n with(context: any, fn: Function, thisArg?: any, ...args: any[]) {\n const api = getOtelApi();\n if (!api) return fn.call(thisArg, ...args);\n return api.context.with(context, fn, thisArg, ...args);\n },\n};\n\n// Export lazy-loaded metrics API\nexport const metrics = {\n getMeter(name: string, version?: string) {\n const api = getOtelApi();\n if (!api?.metrics) return createNoOpMeter();\n return api.metrics.getMeter(name, version);\n },\n};\n\n// Export types and enums\nexport const SpanStatusCode = {\n get UNSET() {\n const api = getOtelApi();\n return api?.SpanStatusCode?.UNSET ?? 0;\n },\n get OK() {\n const api = getOtelApi();\n return api?.SpanStatusCode?.OK ?? 1;\n },\n get ERROR() {\n const api = getOtelApi();\n return api?.SpanStatusCode?.ERROR ?? 2;\n },\n};\n\nexport const SpanKind = {\n get INTERNAL() {\n const api = getOtelApi();\n return api?.SpanKind?.INTERNAL ?? 0;\n },\n get SERVER() {\n const api = getOtelApi();\n return api?.SpanKind?.SERVER ?? 1;\n },\n get CLIENT() {\n const api = getOtelApi();\n return api?.SpanKind?.CLIENT ?? 2;\n },\n get PRODUCER() {\n const api = getOtelApi();\n return api?.SpanKind?.PRODUCER ?? 3;\n },\n get CONSUMER() {\n const api = getOtelApi();\n return api?.SpanKind?.CONSUMER ?? 4;\n },\n};\n\n// Export diag API\nexport const diag = {\n setLogger(logger: any, level?: any) {\n const api = getOtelApi();\n if (!api) return;\n return api.diag.setLogger(logger, level);\n },\n};\n\n// Lazy-loaded DiagConsoleLogger and DiagLogLevel for consistency\nexport const DiagConsoleLogger = {\n get() {\n const api = getOtelApi();\n return api?.DiagConsoleLogger;\n },\n};\n\nexport const DiagLogLevel = {\n get NONE() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.NONE ?? 0;\n },\n get ERROR() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.ERROR ?? 30;\n },\n get WARN() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.WARN ?? 50;\n },\n get INFO() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.INFO ?? 60;\n },\n get DEBUG() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.DEBUG ?? 70;\n },\n get VERBOSE() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.VERBOSE ?? 80;\n },\n get ALL() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.ALL ?? 9999;\n },\n};\n\n// Type exports for TypeScript\nexport type Span = any;\nexport type Attributes = Record<string, any>;\nexport type HrTime = [number, number];\n\n// No-op implementations\nfunction createNoOpTracer() {\n return {\n startSpan: () => createNoOpSpan(),\n // Support both OTel v1 and v2 overloads:\n // - startActiveSpan(name, callback)\n // - startActiveSpan(name, options, callback)\n // - startActiveSpan(name, options, context, callback)\n startActiveSpan: (name: string, arg2?: any, arg3?: any, arg4?: any) => {\n const span = createNoOpSpan();\n let cb: any = undefined;\n if (typeof arg2 === 'function') cb = arg2;\n else if (typeof arg3 === 'function') cb = arg3;\n else if (typeof arg4 === 'function') cb = arg4;\n if (typeof cb === 'function') {\n try {\n return cb(span);\n } catch {\n // swallow errors in no-op implementation\n return undefined;\n }\n }\n // No callback supplied: return a no-op span like the real API would\n return span;\n },\n };\n}\n\nfunction createNoOpSpan() {\n return {\n spanContext: () => ({ traceId: '', spanId: '', traceFlags: 0 }),\n setAttribute: () => {},\n setAttributes: () => {},\n addEvent: () => {},\n setStatus: () => {},\n updateName: () => {},\n end: () => {},\n isRecording: () => false,\n recordException: () => {},\n };\n}\n\nfunction createNoOpMeter() {\n return {\n createCounter: () => ({ add: () => {} }),\n createHistogram: () => ({ record: () => {} }),\n createUpDownCounter: () => ({ add: () => {} }),\n createObservableGauge: () => {},\n createObservableCounter: () => {},\n createObservableUpDownCounter: () => {},\n };\n}\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,aAAa;AACpB,MAAI,iBAAkB,QAAO;AAC7B,qBAAmB;AAEnB,MAAI;AAIF,eAAW,SAAU,MAAc;AACjC,aAAO,UAAQ,IAAI;AAAA,IACrB,GAAG,eAAe;AAAA,EACpB,QAAQ;AAEN,cAAU;AAAA,EACZ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MI,SACA,kBAGE,iBAsBO,OAmBA,SAcA,SASA,gBAeA,UAwBA,MASA,mBAOA;AAjIb;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/telemetry/lazy-otel.ts"],"sourcesContent":["/**\n * Lazy-loading wrapper for OpenTelemetry API.\n * Returns no-op implementations if OpenTelemetry is not installed.\n * Uses hardcoded module name for security - no dynamic module loading.\n */\n\nlet otelApi: any = null;\nlet otelApiAttempted = false;\n\n// Hardcoded allowed module name to prevent module loading attacks\nconst OTEL_API_MODULE = '@opentelemetry/api';\n\nfunction getOtelApi() {\n if (otelApiAttempted) return otelApi;\n otelApiAttempted = true;\n\n try {\n // Security: Only load the specific @opentelemetry/api module\n // Use dynamic require to prevent bundlers from including this module\n\n otelApi = (function (name: string) {\n return require(name);\n })(OTEL_API_MODULE);\n } catch {\n // OpenTelemetry not installed - provide no-op implementations\n otelApi = null;\n }\n\n return otelApi;\n}\n\n// Export lazy-loaded trace API\nexport const trace = {\n getTracer(name: string, version?: string) {\n const api = getOtelApi();\n if (!api) return createNoOpTracer();\n return api.trace.getTracer(name, version);\n },\n getSpan(context: any) {\n const api = getOtelApi();\n if (!api) return undefined;\n return api.trace.getSpan(context);\n },\n getActiveSpan() {\n const api = getOtelApi();\n if (!api) return undefined;\n return api.trace.getActiveSpan();\n },\n};\n\n// Export lazy-loaded context API\nexport const context = {\n active() {\n const api = getOtelApi();\n if (!api) return {};\n return api.context.active();\n },\n with(context: any, fn: Function, thisArg?: any, ...args: any[]) {\n const api = getOtelApi();\n if (!api) return fn.call(thisArg, ...args);\n return api.context.with(context, fn, thisArg, ...args);\n },\n};\n\n// Export lazy-loaded metrics API\nexport const metrics = {\n getMeter(name: string, version?: string) {\n const api = getOtelApi();\n if (!api?.metrics) return createNoOpMeter();\n return api.metrics.getMeter(name, version);\n },\n};\n\n// Export types and enums\nexport const SpanStatusCode = {\n get UNSET() {\n const api = getOtelApi();\n return api?.SpanStatusCode?.UNSET ?? 0;\n },\n get OK() {\n const api = getOtelApi();\n return api?.SpanStatusCode?.OK ?? 1;\n },\n get ERROR() {\n const api = getOtelApi();\n return api?.SpanStatusCode?.ERROR ?? 2;\n },\n};\n\nexport const SpanKind = {\n get INTERNAL() {\n const api = getOtelApi();\n return api?.SpanKind?.INTERNAL ?? 0;\n },\n get SERVER() {\n const api = getOtelApi();\n return api?.SpanKind?.SERVER ?? 1;\n },\n get CLIENT() {\n const api = getOtelApi();\n return api?.SpanKind?.CLIENT ?? 2;\n },\n get PRODUCER() {\n const api = getOtelApi();\n return api?.SpanKind?.PRODUCER ?? 3;\n },\n get CONSUMER() {\n const api = getOtelApi();\n return api?.SpanKind?.CONSUMER ?? 4;\n },\n};\n\n// Export diag API\nexport const diag = {\n setLogger(logger: any, level?: any) {\n const api = getOtelApi();\n if (!api) return;\n return api.diag.setLogger(logger, level);\n },\n};\n\n// Lazy-loaded DiagConsoleLogger and DiagLogLevel for consistency\nexport const DiagConsoleLogger = {\n get() {\n const api = getOtelApi();\n return api?.DiagConsoleLogger;\n },\n};\n\nexport const DiagLogLevel = {\n get NONE() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.NONE ?? 0;\n },\n get ERROR() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.ERROR ?? 30;\n },\n get WARN() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.WARN ?? 50;\n },\n get INFO() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.INFO ?? 60;\n },\n get DEBUG() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.DEBUG ?? 70;\n },\n get VERBOSE() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.VERBOSE ?? 80;\n },\n get ALL() {\n const api = getOtelApi();\n return api?.DiagLogLevel?.ALL ?? 9999;\n },\n};\n\n// Type exports for TypeScript\nexport type Span = any;\nexport type Attributes = Record<string, any>;\nexport type HrTime = [number, number];\n\n// No-op implementations\nfunction createNoOpTracer() {\n return {\n startSpan: () => createNoOpSpan(),\n // Support both OTel v1 and v2 overloads:\n // - startActiveSpan(name, callback)\n // - startActiveSpan(name, options, callback)\n // - startActiveSpan(name, options, context, callback)\n startActiveSpan: (name: string, arg2?: any, arg3?: any, arg4?: any) => {\n const span = createNoOpSpan();\n let cb: any = undefined;\n if (typeof arg2 === 'function') cb = arg2;\n else if (typeof arg3 === 'function') cb = arg3;\n else if (typeof arg4 === 'function') cb = arg4;\n if (typeof cb === 'function') {\n try {\n return cb(span);\n } catch {\n // swallow errors in no-op implementation\n return undefined;\n }\n }\n // No callback supplied: return a no-op span like the real API would\n return span;\n },\n };\n}\n\nfunction createNoOpSpan() {\n return {\n spanContext: () => ({ traceId: '', spanId: '', traceFlags: 0 }),\n setAttribute: () => {},\n setAttributes: () => {},\n addEvent: () => {},\n setStatus: () => {},\n updateName: () => {},\n end: () => {},\n isRecording: () => false,\n recordException: () => {},\n };\n}\n\nfunction createNoOpMeter() {\n return {\n createCounter: () => ({ add: () => {} }),\n createHistogram: () => ({ record: () => {} }),\n createUpDownCounter: () => ({ add: () => {} }),\n createObservableGauge: () => {},\n createObservableCounter: () => {},\n createObservableUpDownCounter: () => {},\n };\n}\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,aAAa;AACpB,MAAI,iBAAkB,QAAO;AAC7B,qBAAmB;AAEnB,MAAI;AAIF,eAAW,SAAU,MAAc;AACjC,aAAO,UAAQ,IAAI;AAAA,IACrB,GAAG,eAAe;AAAA,EACpB,QAAQ;AAEN,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;AAyIA,SAAS,mBAAmB;AAC1B,SAAO;AAAA,IACL,WAAW,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKhC,iBAAiB,CAAC,MAAc,MAAY,MAAY,SAAe;AACrE,YAAM,OAAO,eAAe;AAC5B,UAAI,KAAU;AACd,UAAI,OAAO,SAAS,WAAY,MAAK;AAAA,eAC5B,OAAO,SAAS,WAAY,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M,MAAM,WAAW;AACvB,eAAO,KAAK,cAAc,OAAO;AAAA,MACnC;AAAA,IACF;AAAA;AAAA;","names":["context"]}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
init_logger,
|
|
12
12
|
logger
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SZXICFQ3.mjs";
|
|
14
14
|
import {
|
|
15
15
|
__esm,
|
|
16
16
|
__export,
|
|
@@ -568,6 +568,10 @@ var init_config_schema = __esm({
|
|
|
568
568
|
scheduler: {
|
|
569
569
|
$ref: "#/definitions/SchedulerConfig",
|
|
570
570
|
description: "Scheduler configuration for scheduled workflow execution"
|
|
571
|
+
},
|
|
572
|
+
policy: {
|
|
573
|
+
$ref: "#/definitions/PolicyConfig",
|
|
574
|
+
description: "Enterprise policy engine configuration (EE feature)"
|
|
571
575
|
}
|
|
572
576
|
},
|
|
573
577
|
required: ["version"],
|
|
@@ -1217,6 +1221,10 @@ var init_config_schema = __esm({
|
|
|
1217
1221
|
persist_worktree: {
|
|
1218
1222
|
type: "boolean",
|
|
1219
1223
|
description: "Keep worktree after workflow completion (default: false)"
|
|
1224
|
+
},
|
|
1225
|
+
policy: {
|
|
1226
|
+
$ref: "#/definitions/StepPolicyOverride",
|
|
1227
|
+
description: "Per-step policy override (enterprise)"
|
|
1220
1228
|
}
|
|
1221
1229
|
},
|
|
1222
1230
|
additionalProperties: false,
|
|
@@ -2530,6 +2538,48 @@ var init_config_schema = __esm({
|
|
|
2530
2538
|
"^x-": {}
|
|
2531
2539
|
}
|
|
2532
2540
|
},
|
|
2541
|
+
PolicyConfig: {
|
|
2542
|
+
type: "object",
|
|
2543
|
+
properties: {
|
|
2544
|
+
engine: {
|
|
2545
|
+
type: "string",
|
|
2546
|
+
enum: ["local", "remote", "disabled"],
|
|
2547
|
+
description: "Policy engine mode: 'local' (WASM), 'remote' (HTTP OPA server), or 'disabled'"
|
|
2548
|
+
},
|
|
2549
|
+
rules: {
|
|
2550
|
+
anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
|
|
2551
|
+
description: "Path to .rego files or .wasm bundle (local mode)"
|
|
2552
|
+
},
|
|
2553
|
+
data: {
|
|
2554
|
+
type: "string",
|
|
2555
|
+
description: "Path to a JSON file to load as OPA data document (local mode)"
|
|
2556
|
+
},
|
|
2557
|
+
url: {
|
|
2558
|
+
type: "string",
|
|
2559
|
+
description: "OPA server URL (remote mode)"
|
|
2560
|
+
},
|
|
2561
|
+
fallback: {
|
|
2562
|
+
type: "string",
|
|
2563
|
+
enum: ["allow", "deny", "warn"],
|
|
2564
|
+
description: "Default decision when policy evaluation fails (default: 'deny'). Use 'warn' for audit mode: violations are logged but not enforced."
|
|
2565
|
+
},
|
|
2566
|
+
timeout: {
|
|
2567
|
+
type: "number",
|
|
2568
|
+
description: "Evaluation timeout in milliseconds (default: 5000)"
|
|
2569
|
+
},
|
|
2570
|
+
roles: {
|
|
2571
|
+
type: "object",
|
|
2572
|
+
additionalProperties: {
|
|
2573
|
+
$ref: "#/definitions/PolicyRoleConfig"
|
|
2574
|
+
},
|
|
2575
|
+
description: "Role definitions: map role names to conditions"
|
|
2576
|
+
}
|
|
2577
|
+
},
|
|
2578
|
+
additionalProperties: false,
|
|
2579
|
+
patternProperties: {
|
|
2580
|
+
"^x-": {}
|
|
2581
|
+
}
|
|
2582
|
+
},
|
|
2533
2583
|
SchedulerLimitsConfig: {
|
|
2534
2584
|
type: "object",
|
|
2535
2585
|
properties: {
|
|
@@ -2588,6 +2638,45 @@ var init_config_schema = __esm({
|
|
|
2588
2638
|
"^x-": {}
|
|
2589
2639
|
}
|
|
2590
2640
|
},
|
|
2641
|
+
PolicyRoleConfig: {
|
|
2642
|
+
type: "object",
|
|
2643
|
+
properties: {
|
|
2644
|
+
author_association: {
|
|
2645
|
+
type: "array",
|
|
2646
|
+
items: { type: "string" },
|
|
2647
|
+
description: "GitHub author associations that map to this role"
|
|
2648
|
+
},
|
|
2649
|
+
teams: {
|
|
2650
|
+
type: "array",
|
|
2651
|
+
items: { type: "string" },
|
|
2652
|
+
description: "GitHub team slugs"
|
|
2653
|
+
},
|
|
2654
|
+
users: {
|
|
2655
|
+
type: "array",
|
|
2656
|
+
items: { type: "string" },
|
|
2657
|
+
description: "Explicit GitHub usernames"
|
|
2658
|
+
},
|
|
2659
|
+
slack_users: {
|
|
2660
|
+
type: "array",
|
|
2661
|
+
items: { type: "string" },
|
|
2662
|
+
description: "Slack user IDs (e.g., U0123ABC)"
|
|
2663
|
+
},
|
|
2664
|
+
emails: {
|
|
2665
|
+
type: "array",
|
|
2666
|
+
items: { type: "string" },
|
|
2667
|
+
description: "Email addresses for identity matching"
|
|
2668
|
+
},
|
|
2669
|
+
slack_channels: {
|
|
2670
|
+
type: "array",
|
|
2671
|
+
items: { type: "string" },
|
|
2672
|
+
description: "Slack channel IDs \u2014 role only applies when triggered from these channels"
|
|
2673
|
+
}
|
|
2674
|
+
},
|
|
2675
|
+
additionalProperties: false,
|
|
2676
|
+
patternProperties: {
|
|
2677
|
+
"^x-": {}
|
|
2678
|
+
}
|
|
2679
|
+
},
|
|
2591
2680
|
"Record<string,StaticCronJob>": {
|
|
2592
2681
|
type: "object",
|
|
2593
2682
|
additionalProperties: {
|
|
@@ -2652,6 +2741,28 @@ var init_config_schema = __esm({
|
|
|
2652
2741
|
patternProperties: {
|
|
2653
2742
|
"^x-": {}
|
|
2654
2743
|
}
|
|
2744
|
+
},
|
|
2745
|
+
StepPolicyOverride: {
|
|
2746
|
+
type: "object",
|
|
2747
|
+
properties: {
|
|
2748
|
+
require: {
|
|
2749
|
+
anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
|
|
2750
|
+
description: "Required role(s) \u2014 any of these roles suffices"
|
|
2751
|
+
},
|
|
2752
|
+
deny: {
|
|
2753
|
+
type: "array",
|
|
2754
|
+
items: { type: "string" },
|
|
2755
|
+
description: "Explicit deny for roles"
|
|
2756
|
+
},
|
|
2757
|
+
rule: {
|
|
2758
|
+
type: "string",
|
|
2759
|
+
description: "Custom OPA rule path for this step"
|
|
2760
|
+
}
|
|
2761
|
+
},
|
|
2762
|
+
additionalProperties: false,
|
|
2763
|
+
patternProperties: {
|
|
2764
|
+
"^x-": {}
|
|
2765
|
+
}
|
|
2655
2766
|
}
|
|
2656
2767
|
}
|
|
2657
2768
|
};
|
|
@@ -3002,7 +3113,7 @@ var init_config = __esm({
|
|
|
3002
3113
|
* When a workflow YAML is run standalone, register the workflow and use its tests as checks
|
|
3003
3114
|
*/
|
|
3004
3115
|
async convertWorkflowToConfig(workflowData, basePath) {
|
|
3005
|
-
const { WorkflowRegistry } = await import("./workflow-registry-
|
|
3116
|
+
const { WorkflowRegistry } = await import("./workflow-registry-AAD37XKZ.mjs");
|
|
3006
3117
|
const registry = WorkflowRegistry.getInstance();
|
|
3007
3118
|
const workflowId = workflowData.id;
|
|
3008
3119
|
logger.info(`Detected standalone workflow file: ${workflowId}`);
|
|
@@ -3067,7 +3178,7 @@ ${errors}`);
|
|
|
3067
3178
|
if (!config.imports || config.imports.length === 0) {
|
|
3068
3179
|
return;
|
|
3069
3180
|
}
|
|
3070
|
-
const { WorkflowRegistry } = await import("./workflow-registry-
|
|
3181
|
+
const { WorkflowRegistry } = await import("./workflow-registry-AAD37XKZ.mjs");
|
|
3071
3182
|
const registry = WorkflowRegistry.getInstance();
|
|
3072
3183
|
for (const source of config.imports) {
|
|
3073
3184
|
const results = await registry.import(source, { basePath, validate: true });
|
|
@@ -3281,6 +3392,55 @@ ${errors}`);
|
|
|
3281
3392
|
}
|
|
3282
3393
|
}
|
|
3283
3394
|
}
|
|
3395
|
+
if (config.scheduler?.ha?.enabled && (!config.scheduler.storage?.driver || config.scheduler.storage.driver === "sqlite")) {
|
|
3396
|
+
warnings.push({
|
|
3397
|
+
field: "scheduler.ha",
|
|
3398
|
+
message: 'HA mode is enabled but storage driver is SQLite (single-node only). Distributed locking will use in-memory locks which do not coordinate across nodes. Use driver: "postgresql", "mysql", or "mssql" for true multi-node HA.'
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
const schedulerDriver = config.scheduler?.storage?.driver;
|
|
3402
|
+
if (schedulerDriver && schedulerDriver !== "sqlite") {
|
|
3403
|
+
const conn = config.scheduler?.storage?.connection;
|
|
3404
|
+
if (!conn) {
|
|
3405
|
+
errors.push({
|
|
3406
|
+
field: "scheduler.storage.connection",
|
|
3407
|
+
message: `The '${schedulerDriver}' driver requires a connection configuration.`
|
|
3408
|
+
});
|
|
3409
|
+
} else {
|
|
3410
|
+
const hasConnStr = !!conn.connection_string;
|
|
3411
|
+
const hasHost = !!conn.host;
|
|
3412
|
+
const hasDb = !!conn.database;
|
|
3413
|
+
if (!hasConnStr && !hasHost) {
|
|
3414
|
+
errors.push({
|
|
3415
|
+
field: "scheduler.storage.connection",
|
|
3416
|
+
message: `The '${schedulerDriver}' driver requires either 'connection_string' or 'host' (with 'database') to be specified.`
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3419
|
+
if (!hasConnStr && hasHost && !hasDb) {
|
|
3420
|
+
errors.push({
|
|
3421
|
+
field: "scheduler.storage.connection.database",
|
|
3422
|
+
message: `The '${schedulerDriver}' driver requires 'database' when using host-based connection.`
|
|
3423
|
+
});
|
|
3424
|
+
}
|
|
3425
|
+
if (hasConnStr && hasHost) {
|
|
3426
|
+
warnings.push({
|
|
3427
|
+
field: "scheduler.storage.connection",
|
|
3428
|
+
message: "Both connection_string and host are set. connection_string takes precedence; host/port/database/user/password will be ignored."
|
|
3429
|
+
});
|
|
3430
|
+
}
|
|
3431
|
+
if (hasHost && !hasConnStr) {
|
|
3432
|
+
const host = conn.host || "";
|
|
3433
|
+
const ssl = conn.ssl;
|
|
3434
|
+
const isLocal = host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "0.0.0.0" || host === "[::]";
|
|
3435
|
+
if (!isLocal && !ssl) {
|
|
3436
|
+
warnings.push({
|
|
3437
|
+
field: "scheduler.storage.connection.ssl",
|
|
3438
|
+
message: `SSL is not enabled for remote host '${host}'. Consider enabling SSL for secure database connections.`
|
|
3439
|
+
});
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3284
3444
|
if (config.ai_mcp_servers) {
|
|
3285
3445
|
this.validateMcpServersObject(config.ai_mcp_servers, "ai_mcp_servers", errors, warnings);
|
|
3286
3446
|
}
|
|
@@ -3305,6 +3465,9 @@ ${errors}`);
|
|
|
3305
3465
|
if (config.tag_filter) {
|
|
3306
3466
|
this.validateTagFilter(config.tag_filter, errors);
|
|
3307
3467
|
}
|
|
3468
|
+
if (config.policy) {
|
|
3469
|
+
this.validatePolicyConfig(config.policy, errors, warnings);
|
|
3470
|
+
}
|
|
3308
3471
|
if (strict && warnings.length > 0) {
|
|
3309
3472
|
errors.push(...warnings);
|
|
3310
3473
|
}
|
|
@@ -3663,6 +3826,179 @@ ${errors}`);
|
|
|
3663
3826
|
} catch {
|
|
3664
3827
|
}
|
|
3665
3828
|
}
|
|
3829
|
+
/**
|
|
3830
|
+
* Validate policy engine configuration
|
|
3831
|
+
*/
|
|
3832
|
+
validatePolicyConfig(policy, errors, warnings) {
|
|
3833
|
+
const validEngines = ["local", "remote", "disabled"];
|
|
3834
|
+
if (policy.engine && !validEngines.includes(policy.engine)) {
|
|
3835
|
+
errors.push({
|
|
3836
|
+
field: "policy.engine",
|
|
3837
|
+
message: `policy.engine must be one of: ${validEngines.join(", ")}`,
|
|
3838
|
+
value: policy.engine
|
|
3839
|
+
});
|
|
3840
|
+
}
|
|
3841
|
+
if (policy.engine === "local" && !policy.rules) {
|
|
3842
|
+
errors.push({
|
|
3843
|
+
field: "policy.rules",
|
|
3844
|
+
message: 'policy.rules is required when policy.engine is "local"'
|
|
3845
|
+
});
|
|
3846
|
+
}
|
|
3847
|
+
if (policy.rules && typeof policy.rules !== "string" && !Array.isArray(policy.rules)) {
|
|
3848
|
+
errors.push({
|
|
3849
|
+
field: "policy.rules",
|
|
3850
|
+
message: "policy.rules must be a string or array of strings",
|
|
3851
|
+
value: policy.rules
|
|
3852
|
+
});
|
|
3853
|
+
}
|
|
3854
|
+
if (Array.isArray(policy.rules) && !policy.rules.every((r) => typeof r === "string")) {
|
|
3855
|
+
errors.push({
|
|
3856
|
+
field: "policy.rules",
|
|
3857
|
+
message: "policy.rules array must contain only strings",
|
|
3858
|
+
value: policy.rules
|
|
3859
|
+
});
|
|
3860
|
+
}
|
|
3861
|
+
if (policy.engine === "local" && policy.rules) {
|
|
3862
|
+
const rulesPath = Array.isArray(policy.rules) ? policy.rules : [policy.rules];
|
|
3863
|
+
for (const rp of rulesPath) {
|
|
3864
|
+
if (typeof rp === "string" && !fs2.existsSync(path2.resolve(rp))) {
|
|
3865
|
+
warnings.push({
|
|
3866
|
+
field: "policy.rules",
|
|
3867
|
+
message: `Policy rules path does not exist: ${rp}. It will be resolved at runtime.`,
|
|
3868
|
+
value: rp
|
|
3869
|
+
});
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
if (policy.engine === "remote") {
|
|
3874
|
+
if (!policy.url) {
|
|
3875
|
+
errors.push({
|
|
3876
|
+
field: "policy.url",
|
|
3877
|
+
message: 'policy.url is required when policy.engine is "remote"'
|
|
3878
|
+
});
|
|
3879
|
+
} else if (typeof policy.url !== "string" || !/^https?:\/\//i.test(policy.url)) {
|
|
3880
|
+
errors.push({
|
|
3881
|
+
field: "policy.url",
|
|
3882
|
+
message: "policy.url must use http:// or https:// protocol"
|
|
3883
|
+
});
|
|
3884
|
+
}
|
|
3885
|
+
}
|
|
3886
|
+
if (policy.fallback !== void 0) {
|
|
3887
|
+
const validFallbacks = ["allow", "deny", "warn"];
|
|
3888
|
+
if (!validFallbacks.includes(policy.fallback)) {
|
|
3889
|
+
errors.push({
|
|
3890
|
+
field: "policy.fallback",
|
|
3891
|
+
message: `policy.fallback must be one of: ${validFallbacks.join(", ")}`,
|
|
3892
|
+
value: policy.fallback
|
|
3893
|
+
});
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
if (policy.timeout !== void 0) {
|
|
3897
|
+
if (typeof policy.timeout !== "number" || policy.timeout < 0) {
|
|
3898
|
+
errors.push({
|
|
3899
|
+
field: "policy.timeout",
|
|
3900
|
+
message: "policy.timeout must be a non-negative number (milliseconds)",
|
|
3901
|
+
value: policy.timeout
|
|
3902
|
+
});
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
if (policy.data !== void 0) {
|
|
3906
|
+
if (typeof policy.data !== "string") {
|
|
3907
|
+
errors.push({
|
|
3908
|
+
field: "policy.data",
|
|
3909
|
+
message: "policy.data must be a string (path to a JSON file)",
|
|
3910
|
+
value: policy.data
|
|
3911
|
+
});
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
if (policy.data && typeof policy.data === "string" && !fs2.existsSync(path2.resolve(policy.data))) {
|
|
3915
|
+
warnings.push({
|
|
3916
|
+
field: "policy.data",
|
|
3917
|
+
message: `Policy data file does not exist: ${policy.data}. It will be resolved at runtime.`,
|
|
3918
|
+
value: policy.data
|
|
3919
|
+
});
|
|
3920
|
+
}
|
|
3921
|
+
if (policy.roles && typeof policy.roles === "object") {
|
|
3922
|
+
for (const [roleName, roleConfig] of Object.entries(policy.roles)) {
|
|
3923
|
+
if (typeof roleConfig !== "object" || roleConfig === null) {
|
|
3924
|
+
errors.push({
|
|
3925
|
+
field: `policy.roles.${roleName}`,
|
|
3926
|
+
message: `Role '${roleName}' must be an object with author_association, teams, or users`,
|
|
3927
|
+
value: roleConfig
|
|
3928
|
+
});
|
|
3929
|
+
} else {
|
|
3930
|
+
if (Array.isArray(roleConfig.teams) && roleConfig.teams.length > 0) {
|
|
3931
|
+
warnings.push({
|
|
3932
|
+
field: `policy.roles.${roleName}.teams`,
|
|
3933
|
+
message: `Role '${roleName}' uses 'teams' which is not yet implemented. Team-based role resolution requires a future update. Only author_association and users are currently supported.`,
|
|
3934
|
+
value: roleConfig.teams
|
|
3935
|
+
});
|
|
3936
|
+
}
|
|
3937
|
+
const validAssociations = [
|
|
3938
|
+
"OWNER",
|
|
3939
|
+
"MEMBER",
|
|
3940
|
+
"COLLABORATOR",
|
|
3941
|
+
"CONTRIBUTOR",
|
|
3942
|
+
"FIRST_TIME_CONTRIBUTOR",
|
|
3943
|
+
"FIRST_TIMER",
|
|
3944
|
+
"MANNEQUIN",
|
|
3945
|
+
"NONE"
|
|
3946
|
+
];
|
|
3947
|
+
if (roleConfig.author_association && Array.isArray(roleConfig.author_association)) {
|
|
3948
|
+
for (const assoc of roleConfig.author_association) {
|
|
3949
|
+
if (!validAssociations.includes(assoc)) {
|
|
3950
|
+
warnings.push({
|
|
3951
|
+
field: `policy.roles.${roleName}.author_association`,
|
|
3952
|
+
message: `Unknown author_association value: '${assoc}'. Valid values: ${validAssociations.join(", ")}`,
|
|
3953
|
+
value: assoc
|
|
3954
|
+
});
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
if (Array.isArray(roleConfig.slack_users)) {
|
|
3959
|
+
for (const uid of roleConfig.slack_users) {
|
|
3960
|
+
if (typeof uid === "string" && !uid.startsWith("U")) {
|
|
3961
|
+
warnings.push({
|
|
3962
|
+
field: `policy.roles.${roleName}.slack_users`,
|
|
3963
|
+
message: `Slack user ID '${uid}' does not start with 'U'. Slack user IDs typically start with 'U' (e.g., U0123ABC).`,
|
|
3964
|
+
value: uid
|
|
3965
|
+
});
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3969
|
+
if (Array.isArray(roleConfig.emails)) {
|
|
3970
|
+
for (const email of roleConfig.emails) {
|
|
3971
|
+
if (typeof email === "string" && !email.includes("@")) {
|
|
3972
|
+
warnings.push({
|
|
3973
|
+
field: `policy.roles.${roleName}.emails`,
|
|
3974
|
+
message: `Email '${email}' does not contain '@'. Expected a valid email address.`,
|
|
3975
|
+
value: email
|
|
3976
|
+
});
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
if (roleConfig.emails.length > 0) {
|
|
3980
|
+
warnings.push({
|
|
3981
|
+
field: `policy.roles.${roleName}.emails`,
|
|
3982
|
+
message: `Role '${roleName}' uses 'emails' for identity matching. This requires the Slack bot to have the 'users:read.email' OAuth scope.`,
|
|
3983
|
+
value: roleConfig.emails
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
if (Array.isArray(roleConfig.slack_channels)) {
|
|
3988
|
+
for (const chId of roleConfig.slack_channels) {
|
|
3989
|
+
if (typeof chId === "string" && !chId.startsWith("C")) {
|
|
3990
|
+
warnings.push({
|
|
3991
|
+
field: `policy.roles.${roleName}.slack_channels`,
|
|
3992
|
+
message: `Slack channel ID '${chId}' does not start with 'C'. Public channel IDs typically start with 'C' (e.g., C0123ENG).`,
|
|
3993
|
+
value: chId
|
|
3994
|
+
});
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
3666
4002
|
/**
|
|
3667
4003
|
* Validate MCP servers object shape and values (basic shape only)
|
|
3668
4004
|
*/
|
|
@@ -3769,7 +4105,8 @@ ${errors}`);
|
|
|
3769
4105
|
"slack",
|
|
3770
4106
|
"sandboxes",
|
|
3771
4107
|
"sandbox",
|
|
3772
|
-
"sandbox_defaults"
|
|
4108
|
+
"sandbox_defaults",
|
|
4109
|
+
"policy"
|
|
3773
4110
|
]);
|
|
3774
4111
|
if (topLevel && allowedTopLevelKeys.has(addl)) {
|
|
3775
4112
|
continue;
|
|
@@ -3979,4 +4316,4 @@ export {
|
|
|
3979
4316
|
config_exports,
|
|
3980
4317
|
init_config
|
|
3981
4318
|
};
|
|
3982
|
-
//# sourceMappingURL=chunk-
|
|
4319
|
+
//# sourceMappingURL=chunk-UCNT3PDT.mjs.map
|