@probelabs/visor 0.1.127 → 0.1.129
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 +31 -1
- package/defaults/.visor.yaml +420 -0
- package/dist/ai-review-service.d.ts +1 -0
- package/dist/ai-review-service.d.ts.map +1 -1
- 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/daemon.js +19 -0
- package/dist/defaults/.visor.yaml +420 -0
- package/dist/docs/commands.md +1 -1
- package/dist/docs/debugging.md +133 -0
- package/dist/docs/dev-playbook.md +10 -0
- package/dist/docs/index.md +1 -0
- package/dist/docs/scheduler.md +503 -0
- package/dist/docs/slack-integration.md +21 -0
- package/dist/docs/timeouts.md +1 -1
- package/dist/docs/workflow-creation-guide.md +39 -0
- package/dist/examples/README.md +30 -0
- package/dist/examples/calculator-config.yaml +4 -4
- package/dist/examples/sandbox-basic.yaml +18 -0
- package/dist/examples/sandbox-cache.yaml +32 -0
- package/dist/examples/sandbox-dockerfile-inline.yaml +22 -0
- package/dist/examples/sandbox-env-passthrough.yaml +26 -0
- package/dist/examples/sandbox-multi-env.yaml +27 -0
- package/dist/examples/sandbox-read-only.yaml +33 -0
- package/dist/examples/scheduler-example.yaml +118 -0
- package/dist/frontends/host.d.ts.map +1 -1
- package/dist/frontends/slack-frontend.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +230 -9
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/index.js +13676 -1604
- package/dist/mcp-server.d.ts +8 -8
- package/dist/{traces/run-2026-02-01T09-59-08-165Z.ndjson → output/traces/run-2026-02-08T18-16-04-160Z.ndjson} +84 -84
- package/dist/{traces/run-2026-02-01T09-59-52-595Z.ndjson → output/traces/run-2026-02-08T18-16-51-253Z.ndjson} +1029 -1029
- package/dist/providers/ai-check-provider.d.ts +16 -0
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +5 -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/log-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts +3 -0
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +22 -2
- 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/providers/workflow-tool-executor.d.ts +2 -0
- package/dist/providers/workflow-tool-executor.d.ts.map +1 -1
- package/dist/sandbox/cache-volume-manager.d.ts +48 -0
- package/dist/sandbox/cache-volume-manager.d.ts.map +1 -0
- package/dist/sandbox/check-runner.d.ts +25 -0
- package/dist/sandbox/check-runner.d.ts.map +1 -0
- package/dist/sandbox/docker-compose-sandbox.d.ts +25 -0
- package/dist/sandbox/docker-compose-sandbox.d.ts.map +1 -0
- package/dist/sandbox/docker-image-sandbox.d.ts +32 -0
- package/dist/sandbox/docker-image-sandbox.d.ts.map +1 -0
- package/dist/sandbox/env-filter.d.ts +19 -0
- package/dist/sandbox/env-filter.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +9 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/sandbox-manager.d.ts +39 -0
- package/dist/sandbox/sandbox-manager.d.ts.map +1 -0
- package/dist/sandbox/sandbox-telemetry.d.ts +9 -0
- package/dist/sandbox/sandbox-telemetry.d.ts.map +1 -0
- package/dist/sandbox/trace-ingester.d.ts +19 -0
- package/dist/sandbox/trace-ingester.d.ts.map +1 -0
- package/dist/sandbox/types.d.ts +149 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/scheduler/cli-handler.d.ts +6 -0
- package/dist/scheduler/cli-handler.d.ts.map +1 -0
- package/dist/scheduler/index.d.ts +14 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/schedule-parser.d.ts +34 -0
- package/dist/scheduler/schedule-parser.d.ts.map +1 -0
- package/dist/scheduler/schedule-store.d.ts +182 -0
- package/dist/scheduler/schedule-store.d.ts.map +1 -0
- package/dist/scheduler/schedule-tool.d.ts +137 -0
- package/dist/scheduler/schedule-tool.d.ts.map +1 -0
- package/dist/scheduler/scheduler.d.ts +195 -0
- package/dist/scheduler/scheduler.d.ts.map +1 -0
- package/dist/sdk/check-provider-registry-ACRGIYOB.mjs +28 -0
- package/dist/sdk/check-provider-registry-VYHKFHK2.mjs +28 -0
- package/dist/sdk/{chunk-CNX7V5JK.mjs → chunk-25IC7KXZ.mjs} +2 -2
- package/dist/sdk/{chunk-IHZOSIF4.mjs → chunk-2KB35MB7.mjs} +3 -3
- package/dist/sdk/{chunk-HQL734ZI.mjs → chunk-6W75IMDC.mjs} +3 -3
- package/dist/sdk/{chunk-XWJPT5KQ.mjs → chunk-7YSOINAQ.mjs} +392 -18
- package/dist/sdk/chunk-7YSOINAQ.mjs.map +1 -0
- package/dist/sdk/{chunk-3OMWVM6J.mjs → chunk-B7BVQM5K.mjs} +2 -2
- package/dist/sdk/chunk-BDGUM6BA.mjs +38825 -0
- package/dist/sdk/chunk-BDGUM6BA.mjs.map +1 -0
- package/dist/sdk/{chunk-VW2GBXQT.mjs → chunk-D5KI4YQ4.mjs} +3 -3
- package/dist/sdk/chunk-DGZPPGJJ.mjs +38825 -0
- package/dist/sdk/chunk-DGZPPGJJ.mjs.map +1 -0
- package/dist/sdk/chunk-H5BOW5CR.mjs +91 -0
- package/dist/sdk/chunk-H5BOW5CR.mjs.map +1 -0
- package/dist/sdk/{chunk-YSN4G6CI.mjs → chunk-HEX3RL32.mjs} +81 -3
- package/dist/sdk/{chunk-YSN4G6CI.mjs.map → chunk-HEX3RL32.mjs.map} +1 -1
- package/dist/sdk/{chunk-ZYAUYXSW.mjs → chunk-J5RGJQ53.mjs} +14 -3
- package/dist/sdk/{chunk-ZYAUYXSW.mjs.map → chunk-J5RGJQ53.mjs.map} +1 -1
- package/dist/sdk/{chunk-WMJKH4XE.mjs → chunk-J7LXIPZS.mjs} +16 -1
- package/dist/sdk/{chunk-EXFGO4FX.mjs → chunk-KFKHU6CM.mjs} +2 -2
- package/dist/sdk/{chunk-MPS4HVQI.mjs → chunk-N7HO6KKC.mjs} +8 -8
- package/dist/sdk/{chunk-O5EZDNYL.mjs → chunk-NCWIZVOT.mjs} +2 -2
- package/dist/sdk/{chunk-3NMLT3YS.mjs → chunk-PO7X5XI7.mjs} +3 -3
- package/dist/sdk/{chunk-BHOKBQPB.mjs → chunk-R5Z7YWPB.mjs} +5 -5
- package/dist/sdk/{chunk-EORMDOZU.mjs → chunk-SGS2VMEL.mjs} +7 -7
- package/dist/sdk/{chunk-BOVFH3LI.mjs → chunk-VF6XIUE4.mjs} +21 -10
- package/dist/sdk/chunk-VF6XIUE4.mjs.map +1 -0
- package/dist/sdk/{chunk-J2QWVDXK.mjs → chunk-XDLQ3UNF.mjs} +3 -3
- package/dist/sdk/{chunk-S2RUE2RG.mjs → chunk-XR7XXGL7.mjs} +3 -3
- package/dist/sdk/{chunk-NAW3DB3I.mjs → chunk-XXAEN5KU.mjs} +3 -3
- package/dist/sdk/command-executor-DVVXERLR.mjs +14 -0
- package/dist/sdk/config-7VTT64SQ.mjs +16 -0
- package/dist/sdk/config-merger-RKCZJQ44.mjs +10 -0
- package/dist/sdk/event-bus-5K3Y2FCS.mjs +43 -0
- package/dist/sdk/{event-bus-5BEVPQ6T.mjs.map → event-bus-5K3Y2FCS.mjs.map} +1 -1
- package/dist/sdk/failure-condition-evaluator-4WMDF4Q3.mjs +17 -0
- package/dist/sdk/git-repository-analyzer-QFMW6WIS.mjs +471 -0
- package/dist/sdk/git-repository-analyzer-QFMW6WIS.mjs.map +1 -0
- package/dist/sdk/{github-frontend-5PCKKHVC.mjs → github-frontend-3N2NLO66.mjs} +520 -588
- package/dist/sdk/github-frontend-3N2NLO66.mjs.map +1 -0
- package/dist/sdk/host-ONVMEHAA.mjs +63 -0
- package/dist/sdk/host-ONVMEHAA.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-I7O7KMHF.mjs → liquid-extensions-5IZLTFSZ.mjs} +8 -8
- package/dist/sdk/memory-store-3N4AZCYB.mjs +12 -0
- package/dist/sdk/{metrics-7PP3EJUH.mjs → metrics-GXQ2EDXA.mjs} +4 -4
- package/dist/sdk/ndjson-sink-FD2PSXGD.mjs +52 -0
- package/dist/sdk/{ndjson-sink-B4V4NTAQ.mjs.map → ndjson-sink-FD2PSXGD.mjs.map} +1 -1
- package/dist/sdk/{prompt-state-EZYOUG75.mjs → prompt-state-YHGXB2OA.mjs} +5 -5
- package/dist/sdk/{renderer-schema-CKFB5NDB.mjs → renderer-schema-CMXOLNIG.mjs} +4 -4
- package/dist/sdk/routing-S3Y7T2X3.mjs +24 -0
- package/dist/sdk/sdk.d.mts +212 -4
- package/dist/sdk/sdk.d.ts +212 -4
- package/dist/sdk/sdk.js +26927 -6264
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +23 -1278
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-6PV6SGEJ.mjs +10 -0
- package/dist/sdk/slack-frontend-R3M2CACB.mjs +899 -0
- package/dist/sdk/slack-frontend-R3M2CACB.mjs.map +1 -0
- package/dist/sdk/{trace-helpers-VP6QYVBX.mjs → trace-helpers-YHNPC7MR.mjs} +4 -4
- package/dist/sdk/tracer-init-XPRWKMZT.mjs +10 -0
- package/dist/sdk/tui-frontend-S546M7A7.mjs +281 -0
- package/dist/sdk/tui-frontend-S546M7A7.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-4F3432ZP.mjs +28 -0
- package/dist/sdk/workflow-check-provider-A44PBPG2.mjs +28 -0
- package/dist/sdk/workflow-check-provider-A44PBPG2.mjs.map +1 -0
- package/dist/sdk/workflow-registry-ZAYYXLEP.mjs +12 -0
- package/dist/sdk/workflow-registry-ZAYYXLEP.mjs.map +1 -0
- package/dist/slack/client.d.ts +28 -0
- package/dist/slack/client.d.ts.map +1 -1
- package/dist/slack/schedule-tool-handler.d.ts +46 -0
- package/dist/slack/schedule-tool-handler.d.ts.map +1 -0
- package/dist/slack/slack-output-adapter.d.ts +44 -0
- package/dist/slack/slack-output-adapter.d.ts.map +1 -0
- package/dist/slack/socket-runner.d.ts +22 -0
- 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/foreach-processor.d.ts.map +1 -1
- package/dist/state-machine/dispatch/sandbox-routing.d.ts +21 -0
- package/dist/state-machine/dispatch/sandbox-routing.d.ts.map +1 -0
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
- package/dist/state-machine-execution-engine.d.ts.map +1 -1
- package/dist/test-runner/index.d.ts +5 -0
- package/dist/test-runner/index.d.ts.map +1 -1
- package/dist/{output/traces/run-2026-02-01T09-59-08-165Z.ndjson → traces/run-2026-02-08T18-16-04-160Z.ndjson} +84 -84
- package/dist/{output/traces/run-2026-02-01T09-59-52-595Z.ndjson → traces/run-2026-02-08T18-16-51-253Z.ndjson} +1029 -1029
- package/dist/tui/chat-runner.d.ts +39 -0
- package/dist/tui/chat-runner.d.ts.map +1 -0
- package/dist/tui/chat-state.d.ts +56 -0
- package/dist/tui/chat-state.d.ts.map +1 -0
- package/dist/tui/chat-tui.d.ts +69 -0
- package/dist/tui/chat-tui.d.ts.map +1 -0
- package/dist/tui/components/chat-box.d.ts +33 -0
- package/dist/tui/components/chat-box.d.ts.map +1 -0
- package/dist/tui/components/input-bar.d.ts +50 -0
- package/dist/tui/components/input-bar.d.ts.map +1 -0
- package/dist/tui/components/status-bar.d.ts +31 -0
- package/dist/tui/components/status-bar.d.ts.map +1 -0
- package/dist/tui/components/trace-viewer.d.ts +73 -0
- package/dist/tui/components/trace-viewer.d.ts.map +1 -0
- package/dist/tui/index.d.ts +14 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/tui-frontend.d.ts +29 -0
- package/dist/tui/tui-frontend.d.ts.map +1 -0
- package/dist/types/bot.d.ts +35 -0
- package/dist/types/bot.d.ts.map +1 -1
- package/dist/types/config.d.ts +152 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +3 -0
- package/dist/types/engine.d.ts.map +1 -1
- package/dist/utils/sandbox.d.ts.map +1 -1
- package/dist/utils/workspace-manager.d.ts +22 -2
- package/dist/utils/workspace-manager.d.ts.map +1 -1
- package/dist/utils/worktree-manager.d.ts +2 -1
- package/dist/utils/worktree-manager.d.ts.map +1 -1
- package/package.json +4 -2
- package/dist/docs/NPM_USAGE.md +0 -281
- package/dist/generated/config-schema.json +0 -2161
- package/dist/sdk/check-provider-registry-CVUONJ5A.mjs +0 -28
- package/dist/sdk/chunk-BOVFH3LI.mjs.map +0 -1
- package/dist/sdk/chunk-TS6BUNAI.mjs +0 -17722
- package/dist/sdk/chunk-TS6BUNAI.mjs.map +0 -1
- package/dist/sdk/chunk-XWJPT5KQ.mjs.map +0 -1
- package/dist/sdk/command-executor-Q7MHJKZJ.mjs +0 -14
- package/dist/sdk/config-DXX64GD3.mjs +0 -16
- package/dist/sdk/config-merger-PX3WIT57.mjs +0 -10
- package/dist/sdk/event-bus-5BEVPQ6T.mjs +0 -35
- package/dist/sdk/failure-condition-evaluator-G4HMJPXF.mjs +0 -17
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +0 -458
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +0 -1
- package/dist/sdk/github-frontend-5PCKKHVC.mjs.map +0 -1
- package/dist/sdk/host-H3AWNZ2F.mjs +0 -52
- package/dist/sdk/host-H3AWNZ2F.mjs.map +0 -1
- package/dist/sdk/memory-store-RW5N2NGJ.mjs +0 -12
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +0 -44
- package/dist/sdk/routing-QHTGDIXF.mjs +0 -24
- package/dist/sdk/session-registry-4E6YRQ77.mjs +0 -10
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs +0 -821
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +0 -1
- package/dist/sdk/tracer-init-GSLPPLCD.mjs +0 -10
- package/dist/sdk/workflow-check-provider-3IWBAZP7.mjs +0 -28
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs +0 -12
- package/dist/tui.d.ts +0 -51
- package/dist/tui.d.ts.map +0 -1
- /package/dist/sdk/{check-provider-registry-CVUONJ5A.mjs.map → check-provider-registry-ACRGIYOB.mjs.map} +0 -0
- /package/dist/sdk/{chunk-WMJKH4XE.mjs.map → check-provider-registry-VYHKFHK2.mjs.map} +0 -0
- /package/dist/sdk/{chunk-CNX7V5JK.mjs.map → chunk-25IC7KXZ.mjs.map} +0 -0
- /package/dist/sdk/{chunk-IHZOSIF4.mjs.map → chunk-2KB35MB7.mjs.map} +0 -0
- /package/dist/sdk/{chunk-HQL734ZI.mjs.map → chunk-6W75IMDC.mjs.map} +0 -0
- /package/dist/sdk/{chunk-3OMWVM6J.mjs.map → chunk-B7BVQM5K.mjs.map} +0 -0
- /package/dist/sdk/{chunk-VW2GBXQT.mjs.map → chunk-D5KI4YQ4.mjs.map} +0 -0
- /package/dist/sdk/{command-executor-Q7MHJKZJ.mjs.map → chunk-J7LXIPZS.mjs.map} +0 -0
- /package/dist/sdk/{chunk-EXFGO4FX.mjs.map → chunk-KFKHU6CM.mjs.map} +0 -0
- /package/dist/sdk/{chunk-MPS4HVQI.mjs.map → chunk-N7HO6KKC.mjs.map} +0 -0
- /package/dist/sdk/{chunk-O5EZDNYL.mjs.map → chunk-NCWIZVOT.mjs.map} +0 -0
- /package/dist/sdk/{chunk-3NMLT3YS.mjs.map → chunk-PO7X5XI7.mjs.map} +0 -0
- /package/dist/sdk/{chunk-BHOKBQPB.mjs.map → chunk-R5Z7YWPB.mjs.map} +0 -0
- /package/dist/sdk/{chunk-EORMDOZU.mjs.map → chunk-SGS2VMEL.mjs.map} +0 -0
- /package/dist/sdk/{chunk-J2QWVDXK.mjs.map → chunk-XDLQ3UNF.mjs.map} +0 -0
- /package/dist/sdk/{chunk-S2RUE2RG.mjs.map → chunk-XR7XXGL7.mjs.map} +0 -0
- /package/dist/sdk/{chunk-NAW3DB3I.mjs.map → chunk-XXAEN5KU.mjs.map} +0 -0
- /package/dist/sdk/{config-DXX64GD3.mjs.map → command-executor-DVVXERLR.mjs.map} +0 -0
- /package/dist/sdk/{config-merger-PX3WIT57.mjs.map → config-7VTT64SQ.mjs.map} +0 -0
- /package/dist/sdk/{failure-condition-evaluator-G4HMJPXF.mjs.map → config-merger-RKCZJQ44.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-I7O7KMHF.mjs.map → failure-condition-evaluator-4WMDF4Q3.mjs.map} +0 -0
- /package/dist/sdk/{memory-store-RW5N2NGJ.mjs.map → liquid-extensions-5IZLTFSZ.mjs.map} +0 -0
- /package/dist/sdk/{metrics-7PP3EJUH.mjs.map → memory-store-3N4AZCYB.mjs.map} +0 -0
- /package/dist/sdk/{prompt-state-EZYOUG75.mjs.map → metrics-GXQ2EDXA.mjs.map} +0 -0
- /package/dist/sdk/{routing-QHTGDIXF.mjs.map → prompt-state-YHGXB2OA.mjs.map} +0 -0
- /package/dist/sdk/{renderer-schema-CKFB5NDB.mjs.map → renderer-schema-CMXOLNIG.mjs.map} +0 -0
- /package/dist/sdk/{session-registry-4E6YRQ77.mjs.map → routing-S3Y7T2X3.mjs.map} +0 -0
- /package/dist/sdk/{trace-helpers-VP6QYVBX.mjs.map → session-registry-6PV6SGEJ.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-GSLPPLCD.mjs.map → trace-helpers-YHNPC7MR.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-3IWBAZP7.mjs.map → tracer-init-XPRWKMZT.mjs.map} +0 -0
- /package/dist/sdk/{workflow-registry-KFWSDSLM.mjs.map → workflow-check-provider-4F3432ZP.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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C;KAChB,CAAC,CAAC;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,KAAK,EAAE,WAAW,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-handler.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/scheduler/cli-handler.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAmC1C;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EAAE,EACd,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,IAAI,CAAC,CAmCf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduler module public exports
|
|
3
|
+
*
|
|
4
|
+
* This module provides a generic, frontend-agnostic scheduler for executing
|
|
5
|
+
* workflows at specified times. It supports both:
|
|
6
|
+
* - Static schedules defined in YAML configuration
|
|
7
|
+
* - Dynamic schedules created via AI tool at runtime
|
|
8
|
+
*/
|
|
9
|
+
export { ScheduleStore, Schedule, ScheduleOutputContext, ScheduleStoreConfig, ScheduleLimits, } from './schedule-store';
|
|
10
|
+
export { parseScheduleExpression, getNextRunTime, isValidCronExpression, ParsedSchedule, } from './schedule-parser';
|
|
11
|
+
export { Scheduler, SchedulerConfig, ScheduleOutputAdapter, ScheduleExecutionResult, getScheduler, resetScheduler, } from './scheduler';
|
|
12
|
+
export { handleScheduleAction, getScheduleToolDefinition, isScheduleTool, buildScheduleToolContext, ScheduleToolArgs, ScheduleToolContext, ScheduleToolResult, ScheduleAction, ScheduleType, SchedulePermissions, } from './schedule-tool';
|
|
13
|
+
export { handleScheduleCommand } from './cli-handler';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/scheduler/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,aAAa,EACb,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,SAAS,EACT,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedule parsing utilities
|
|
3
|
+
* Note: Natural language parsing is handled by the AI which generates
|
|
4
|
+
* cron expressions or ISO timestamps directly. This module provides
|
|
5
|
+
* validation and helper functions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parsed schedule result
|
|
9
|
+
*/
|
|
10
|
+
export interface ParsedSchedule {
|
|
11
|
+
type: 'one-time' | 'recurring';
|
|
12
|
+
cronExpression?: string;
|
|
13
|
+
runAt?: Date;
|
|
14
|
+
timezone: string;
|
|
15
|
+
description: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse a natural language schedule expression
|
|
19
|
+
*
|
|
20
|
+
* @param expression Natural language time expression (e.g., "every Monday at 9am", "in 2 hours")
|
|
21
|
+
* @param userTimezone IANA timezone string (e.g., "America/New_York")
|
|
22
|
+
* @param referenceDate Optional reference date for parsing (defaults to now)
|
|
23
|
+
* @returns Parsed schedule information
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseScheduleExpression(expression: string, userTimezone?: string, _referenceDate?: Date): ParsedSchedule;
|
|
26
|
+
/**
|
|
27
|
+
* Calculate the next run time for a cron expression
|
|
28
|
+
*/
|
|
29
|
+
export declare function getNextRunTime(cronExpression: string, _timezone?: string): Date;
|
|
30
|
+
/**
|
|
31
|
+
* Validate a cron expression
|
|
32
|
+
*/
|
|
33
|
+
export declare function isValidCronExpression(expr: string): boolean;
|
|
34
|
+
//# sourceMappingURL=schedule-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-parser.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/scheduler/schedule-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,GAAG,WAAW,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AA0CD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAc,EAC5B,cAAc,CAAC,EAAE,IAAI,GACpB,cAAc,CA8ChB;AAwUD;;GAEG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,GAAE,MAAc,GAAG,IAAI,CAwCtF;AAyCD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAiC3D"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output context for schedule execution results
|
|
3
|
+
*/
|
|
4
|
+
export interface ScheduleOutputContext {
|
|
5
|
+
/** Output destination type */
|
|
6
|
+
type: 'slack' | 'github' | 'webhook' | 'none';
|
|
7
|
+
/** Target identifier (channel ID, repo name, webhook URL, etc.) */
|
|
8
|
+
target?: string;
|
|
9
|
+
/** Thread/issue/PR identifier for threaded outputs */
|
|
10
|
+
threadId?: string;
|
|
11
|
+
/** Additional destination-specific metadata */
|
|
12
|
+
metadata?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Represents a scheduled workflow execution
|
|
16
|
+
*/
|
|
17
|
+
export interface Schedule {
|
|
18
|
+
id: string;
|
|
19
|
+
creatorId: string;
|
|
20
|
+
creatorContext?: string;
|
|
21
|
+
creatorName?: string;
|
|
22
|
+
timezone: string;
|
|
23
|
+
schedule: string;
|
|
24
|
+
runAt?: number;
|
|
25
|
+
isRecurring: boolean;
|
|
26
|
+
originalExpression: string;
|
|
27
|
+
workflow?: string;
|
|
28
|
+
workflowInputs?: Record<string, unknown>;
|
|
29
|
+
outputContext?: ScheduleOutputContext;
|
|
30
|
+
status: 'active' | 'paused' | 'completed' | 'failed';
|
|
31
|
+
createdAt: number;
|
|
32
|
+
lastRunAt?: number;
|
|
33
|
+
nextRunAt?: number;
|
|
34
|
+
runCount: number;
|
|
35
|
+
failureCount: number;
|
|
36
|
+
lastError?: string;
|
|
37
|
+
previousResponse?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for the schedule store
|
|
41
|
+
*/
|
|
42
|
+
export interface ScheduleStoreConfig {
|
|
43
|
+
/** Path to the JSON file for persistence */
|
|
44
|
+
path?: string;
|
|
45
|
+
/** Auto-save after changes (default: true) */
|
|
46
|
+
autoSave?: boolean;
|
|
47
|
+
/** Debounce save operations in ms (default: 1000) */
|
|
48
|
+
saveDebounceMs?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Limits configuration for schedules
|
|
52
|
+
*/
|
|
53
|
+
export interface ScheduleLimits {
|
|
54
|
+
maxPerUser?: number;
|
|
55
|
+
maxRecurringPerUser?: number;
|
|
56
|
+
maxGlobal?: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Storage class for scheduled workflows with JSON file persistence
|
|
60
|
+
*/
|
|
61
|
+
export declare class ScheduleStore {
|
|
62
|
+
private static instance;
|
|
63
|
+
private schedules;
|
|
64
|
+
private filePath;
|
|
65
|
+
private autoSave;
|
|
66
|
+
private saveDebounceMs;
|
|
67
|
+
private initialized;
|
|
68
|
+
private saveTimeout;
|
|
69
|
+
private limits;
|
|
70
|
+
private saveLock;
|
|
71
|
+
private pendingSave;
|
|
72
|
+
private dirtyCount;
|
|
73
|
+
private constructor();
|
|
74
|
+
/**
|
|
75
|
+
* Get singleton instance
|
|
76
|
+
*
|
|
77
|
+
* Note: Config and limits are only applied on first call. Subsequent calls
|
|
78
|
+
* with different parameters will log a warning and return the existing instance.
|
|
79
|
+
* Use createIsolated() for testing with different configurations.
|
|
80
|
+
*/
|
|
81
|
+
static getInstance(config?: ScheduleStoreConfig, limits?: ScheduleLimits): ScheduleStore;
|
|
82
|
+
/**
|
|
83
|
+
* Create a new isolated instance (for testing)
|
|
84
|
+
*/
|
|
85
|
+
static createIsolated(config?: ScheduleStoreConfig, limits?: ScheduleLimits): ScheduleStore;
|
|
86
|
+
/**
|
|
87
|
+
* Reset singleton instance (for testing)
|
|
88
|
+
*/
|
|
89
|
+
static resetInstance(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Initialize the store - load from file if it exists
|
|
92
|
+
*/
|
|
93
|
+
initialize(): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Save schedules to file with atomic write and concurrency protection
|
|
96
|
+
*/
|
|
97
|
+
save(): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Schedule a debounced save operation with dirty tracking
|
|
100
|
+
*/
|
|
101
|
+
private scheduleSave;
|
|
102
|
+
/**
|
|
103
|
+
* Immediately save if there are pending changes (for critical operations)
|
|
104
|
+
*/
|
|
105
|
+
private saveImmediate;
|
|
106
|
+
/**
|
|
107
|
+
* Create a new schedule (saves immediately to prevent data loss)
|
|
108
|
+
*/
|
|
109
|
+
createAsync(schedule: Omit<Schedule, 'id' | 'createdAt' | 'runCount' | 'failureCount' | 'status'>): Promise<Schedule>;
|
|
110
|
+
/**
|
|
111
|
+
* Create a new schedule (synchronous, uses debounced save)
|
|
112
|
+
* @deprecated Use createAsync for reliable persistence
|
|
113
|
+
*/
|
|
114
|
+
create(schedule: Omit<Schedule, 'id' | 'createdAt' | 'runCount' | 'failureCount' | 'status'>): Schedule;
|
|
115
|
+
/**
|
|
116
|
+
* Validate schedule limits before creation
|
|
117
|
+
*/
|
|
118
|
+
private validateLimits;
|
|
119
|
+
/**
|
|
120
|
+
* Get a schedule by ID
|
|
121
|
+
*/
|
|
122
|
+
get(id: string): Schedule | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Update a schedule
|
|
125
|
+
*/
|
|
126
|
+
update(id: string, patch: Partial<Schedule>): Schedule | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Delete a schedule (saves immediately to prevent data loss)
|
|
129
|
+
*/
|
|
130
|
+
deleteAsync(id: string): Promise<boolean>;
|
|
131
|
+
/**
|
|
132
|
+
* Delete a schedule (synchronous, uses debounced save)
|
|
133
|
+
* @deprecated Use deleteAsync for reliable persistence
|
|
134
|
+
*/
|
|
135
|
+
delete(id: string): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Get all schedules for a specific creator
|
|
138
|
+
*/
|
|
139
|
+
getByCreator(creatorId: string): Schedule[];
|
|
140
|
+
/**
|
|
141
|
+
* Get all active schedules
|
|
142
|
+
*/
|
|
143
|
+
getActiveSchedules(): Schedule[];
|
|
144
|
+
/**
|
|
145
|
+
* Get all schedules due for execution
|
|
146
|
+
* @param now Current timestamp in milliseconds
|
|
147
|
+
*/
|
|
148
|
+
getDueSchedules(now?: number): Schedule[];
|
|
149
|
+
/**
|
|
150
|
+
* Find schedules by workflow name
|
|
151
|
+
*/
|
|
152
|
+
findByWorkflow(creatorId: string, workflowName: string): Schedule[];
|
|
153
|
+
/**
|
|
154
|
+
* Get schedule count statistics
|
|
155
|
+
*/
|
|
156
|
+
getStats(): {
|
|
157
|
+
total: number;
|
|
158
|
+
active: number;
|
|
159
|
+
paused: number;
|
|
160
|
+
completed: number;
|
|
161
|
+
failed: number;
|
|
162
|
+
recurring: number;
|
|
163
|
+
oneTime: number;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Force immediate save (useful for shutdown)
|
|
167
|
+
*/
|
|
168
|
+
flush(): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Check if initialized
|
|
171
|
+
*/
|
|
172
|
+
isInitialized(): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Check if there are unsaved changes
|
|
175
|
+
*/
|
|
176
|
+
hasPendingChanges(): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Get all schedules (for iteration)
|
|
179
|
+
*/
|
|
180
|
+
getAll(): Schedule[];
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=schedule-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-store.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/scheduler/schedule-store.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAC9C,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGzC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAGtC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,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AClB,OAAO,EAAE,MAAM,CAAC;KACjB;IAaD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,MAAM,IAAI,QAAQ,EAAE;CAGrB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic AI Tool for scheduling and managing workflow executions
|
|
3
|
+
* This tool is frontend-agnostic and can work with any context (Slack, CLI, GitHub, etc.)
|
|
4
|
+
*/
|
|
5
|
+
import { CustomToolDefinition } from '../types/config';
|
|
6
|
+
import { Schedule } from './schedule-store';
|
|
7
|
+
/**
|
|
8
|
+
* Tool action types
|
|
9
|
+
*/
|
|
10
|
+
export type ScheduleAction = 'create' | 'list' | 'cancel' | 'pause' | 'resume';
|
|
11
|
+
/**
|
|
12
|
+
* Target type for where to send the reminder/output
|
|
13
|
+
*/
|
|
14
|
+
export type TargetType = 'channel' | 'dm' | 'thread' | 'user';
|
|
15
|
+
/**
|
|
16
|
+
* Tool input arguments - AI provides structured data, no parsing needed
|
|
17
|
+
*/
|
|
18
|
+
export interface ScheduleToolArgs {
|
|
19
|
+
action: ScheduleAction;
|
|
20
|
+
/** What to say/do when the schedule fires */
|
|
21
|
+
reminder_text?: string;
|
|
22
|
+
/** Where to send: channel, dm (to self), thread, or user (DM to specific user) */
|
|
23
|
+
target_type?: TargetType;
|
|
24
|
+
/** The Slack channel ID (C... for channels, D... for DMs) */
|
|
25
|
+
target_id?: string;
|
|
26
|
+
/** For thread replies: the thread_ts to reply to */
|
|
27
|
+
thread_ts?: string;
|
|
28
|
+
/** Is this a recurring schedule? */
|
|
29
|
+
is_recurring?: boolean;
|
|
30
|
+
/** For recurring: cron expression (AI generates this, e.g., "* * * * *" for every minute) */
|
|
31
|
+
cron?: string;
|
|
32
|
+
/** For one-time: ISO 8601 timestamp when to run */
|
|
33
|
+
run_at?: string;
|
|
34
|
+
/** Original natural language expression (for display only) */
|
|
35
|
+
original_expression?: string;
|
|
36
|
+
/** Optional workflow to run instead of just sending reminder_text */
|
|
37
|
+
workflow?: string;
|
|
38
|
+
/** Optional workflow inputs */
|
|
39
|
+
workflow_inputs?: Record<string, unknown>;
|
|
40
|
+
schedule_id?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Schedule type for permission checking
|
|
44
|
+
*/
|
|
45
|
+
export type ScheduleType = 'personal' | 'channel' | 'dm';
|
|
46
|
+
/**
|
|
47
|
+
* Permissions configuration for dynamic schedules
|
|
48
|
+
*/
|
|
49
|
+
export interface SchedulePermissions {
|
|
50
|
+
/** Allow personal schedules (via DM or CLI) */
|
|
51
|
+
allowPersonal?: boolean;
|
|
52
|
+
/** Allow channel schedules (in Slack channels) */
|
|
53
|
+
allowChannel?: boolean;
|
|
54
|
+
/** Allow DM schedules (to specific users) */
|
|
55
|
+
allowDm?: boolean;
|
|
56
|
+
/** List of allowed workflow patterns (glob-style, e.g., "report-*") */
|
|
57
|
+
allowedWorkflows?: string[];
|
|
58
|
+
/** List of denied workflow patterns */
|
|
59
|
+
deniedWorkflows?: string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Context passed to the tool handler
|
|
63
|
+
* This is generic and works with any frontend
|
|
64
|
+
*/
|
|
65
|
+
export interface ScheduleToolContext {
|
|
66
|
+
/** Generic user ID (can be Slack user, GitHub user, CLI user, etc.) */
|
|
67
|
+
userId: string;
|
|
68
|
+
/** User display name (optional) */
|
|
69
|
+
userName?: string;
|
|
70
|
+
/** Context identifier: "slack:U123", "github:user", "cli", etc. */
|
|
71
|
+
contextType: string;
|
|
72
|
+
/** User's timezone (IANA format) */
|
|
73
|
+
timezone?: string;
|
|
74
|
+
/** Available workflows in the current config */
|
|
75
|
+
availableWorkflows?: string[];
|
|
76
|
+
/** Schedule type being created (for permission checking) */
|
|
77
|
+
scheduleType?: ScheduleType;
|
|
78
|
+
/** Permissions for dynamic schedule creation */
|
|
79
|
+
permissions?: SchedulePermissions;
|
|
80
|
+
/**
|
|
81
|
+
* Allowed schedule type based on originating context.
|
|
82
|
+
* When set, only schedules of this type can be created/managed.
|
|
83
|
+
* - From DM: only 'personal' allowed
|
|
84
|
+
* - From channel: only 'channel' allowed
|
|
85
|
+
* - From group DM: only 'dm' allowed (targeting the group)
|
|
86
|
+
*/
|
|
87
|
+
allowedScheduleType?: ScheduleType;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Tool execution result
|
|
91
|
+
*/
|
|
92
|
+
export interface ScheduleToolResult {
|
|
93
|
+
success: boolean;
|
|
94
|
+
message: string;
|
|
95
|
+
schedule?: Schedule;
|
|
96
|
+
schedules?: Schedule[];
|
|
97
|
+
error?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Handle schedule tool actions
|
|
101
|
+
*/
|
|
102
|
+
export declare function handleScheduleAction(args: ScheduleToolArgs, context: ScheduleToolContext): Promise<ScheduleToolResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Get the schedule tool definition for registration with AI providers
|
|
105
|
+
*
|
|
106
|
+
* The AI is responsible for:
|
|
107
|
+
* 1. Extracting the target (channel ID, user ID, thread_ts) from the conversation context
|
|
108
|
+
* 2. Determining if the schedule is recurring or one-time
|
|
109
|
+
* 3. Generating the cron expression OR ISO timestamp
|
|
110
|
+
* 4. Extracting the reminder text or workflow name
|
|
111
|
+
*/
|
|
112
|
+
export declare function getScheduleToolDefinition(): CustomToolDefinition;
|
|
113
|
+
/**
|
|
114
|
+
* Check if this is the schedule tool and should be handled specially
|
|
115
|
+
*/
|
|
116
|
+
export declare function isScheduleTool(toolName: string): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Build schedule tool context from various sources
|
|
119
|
+
*/
|
|
120
|
+
export declare function buildScheduleToolContext(sources: {
|
|
121
|
+
slackContext?: {
|
|
122
|
+
userId: string;
|
|
123
|
+
userName?: string;
|
|
124
|
+
timezone?: string;
|
|
125
|
+
channelType?: 'channel' | 'dm' | 'group';
|
|
126
|
+
};
|
|
127
|
+
cliContext?: {
|
|
128
|
+
userId?: string;
|
|
129
|
+
};
|
|
130
|
+
githubContext?: {
|
|
131
|
+
login: string;
|
|
132
|
+
};
|
|
133
|
+
}, availableWorkflows?: string[], permissions?: SchedulePermissions, outputInfo?: {
|
|
134
|
+
outputType?: 'slack' | 'github' | 'webhook' | 'none';
|
|
135
|
+
outputTarget?: string;
|
|
136
|
+
}): ScheduleToolContext;
|
|
137
|
+
//# sourceMappingURL=schedule-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-tool.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/scheduler/schedule-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAiB,QAAQ,EAAyB,MAAM,kBAAkB,CAAC;AA+HlF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IAGvB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,MAAM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QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0FD;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CA+B7B;AA6UD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,IAAI,oBAAoB,CA+JhE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AA6CD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE;IACP,YAAY,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC;KAC1C,CAAC;IACF,UAAU,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,aAAa,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC,EACD,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,WAAW,CAAC,EAAE,mBAAmB,EACjC,UAAU,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3F,mBAAmB,CAyDrB"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ScheduleStore, Schedule, ScheduleLimits } from './schedule-store';
|
|
2
|
+
import type { VisorConfig } from '../types/config';
|
|
3
|
+
import { StateMachineExecutionEngine } from '../state-machine-execution-engine';
|
|
4
|
+
/**
|
|
5
|
+
* Context enricher interface for frontend-specific functionality
|
|
6
|
+
* This allows frontends (Slack, GitHub, etc.) to inject their specific context
|
|
7
|
+
* without polluting the generic scheduler.
|
|
8
|
+
*/
|
|
9
|
+
export interface ScheduleContextEnricher {
|
|
10
|
+
/**
|
|
11
|
+
* Enrich the schedule context before execution
|
|
12
|
+
* @returns Additional context to merge into the synthetic payload
|
|
13
|
+
*/
|
|
14
|
+
enrichContext?(schedule: Schedule): Promise<{
|
|
15
|
+
threadMessages?: Array<{
|
|
16
|
+
user: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}>;
|
|
19
|
+
additionalPayload?: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Prepare the execution environment before running the workflow
|
|
23
|
+
* @param schedule The schedule being executed
|
|
24
|
+
* @param reminderText The reminder text (for simple reminders)
|
|
25
|
+
*/
|
|
26
|
+
prepareExecution?(schedule: Schedule, reminderText: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the webhook endpoint for this frontend
|
|
29
|
+
*/
|
|
30
|
+
getWebhookEndpoint?(): string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Output adapter interface for sending schedule results to different destinations
|
|
34
|
+
*/
|
|
35
|
+
export interface ScheduleOutputAdapter {
|
|
36
|
+
/** Adapter type identifier */
|
|
37
|
+
type: 'slack' | 'github' | 'webhook' | 'none';
|
|
38
|
+
/**
|
|
39
|
+
* Send schedule execution result to the destination
|
|
40
|
+
* @param schedule The schedule that was executed
|
|
41
|
+
* @param result The execution result (success/failure + output)
|
|
42
|
+
*/
|
|
43
|
+
sendResult(schedule: Schedule, result: ScheduleExecutionResult): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Result of schedule execution
|
|
47
|
+
*/
|
|
48
|
+
export interface ScheduleExecutionResult {
|
|
49
|
+
success: boolean;
|
|
50
|
+
output?: unknown;
|
|
51
|
+
error?: string;
|
|
52
|
+
executionTimeMs: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Configuration for the scheduler
|
|
56
|
+
*/
|
|
57
|
+
export interface SchedulerConfig {
|
|
58
|
+
/** Enable/disable the scheduler (default: true) */
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
/** Path to the schedules storage file */
|
|
61
|
+
storagePath?: string;
|
|
62
|
+
/** Check interval for due schedules in ms (default: 60000 - 1 minute) */
|
|
63
|
+
checkIntervalMs?: number;
|
|
64
|
+
/** Limits for schedules */
|
|
65
|
+
limits?: ScheduleLimits;
|
|
66
|
+
/** Default timezone for schedules (default: UTC) */
|
|
67
|
+
defaultTimezone?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generic scheduler that manages schedule execution
|
|
71
|
+
*/
|
|
72
|
+
export declare class Scheduler {
|
|
73
|
+
private store;
|
|
74
|
+
private visorConfig;
|
|
75
|
+
private checkIntervalMs;
|
|
76
|
+
private defaultTimezone;
|
|
77
|
+
private checkInterval;
|
|
78
|
+
private cronJobs;
|
|
79
|
+
private oneTimeTimeouts;
|
|
80
|
+
private running;
|
|
81
|
+
private engine?;
|
|
82
|
+
private outputAdapters;
|
|
83
|
+
private executionContext;
|
|
84
|
+
private contextEnricher?;
|
|
85
|
+
constructor(visorConfig: VisorConfig, config?: SchedulerConfig);
|
|
86
|
+
/**
|
|
87
|
+
* Set the execution engine (called after construction to avoid circular deps)
|
|
88
|
+
*/
|
|
89
|
+
setEngine(engine: StateMachineExecutionEngine): void;
|
|
90
|
+
/**
|
|
91
|
+
* Set the execution context (e.g., Slack client) for workflow executions
|
|
92
|
+
*/
|
|
93
|
+
setExecutionContext(context: Record<string, unknown>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Register an output adapter for a specific type
|
|
96
|
+
*/
|
|
97
|
+
registerOutputAdapter(adapter: ScheduleOutputAdapter): void;
|
|
98
|
+
/**
|
|
99
|
+
* Register a context enricher for frontend-specific functionality
|
|
100
|
+
* This allows frontends to inject thread history, prompt state, etc.
|
|
101
|
+
*/
|
|
102
|
+
registerContextEnricher(enricher: ScheduleContextEnricher): void;
|
|
103
|
+
/**
|
|
104
|
+
* Get the schedule store instance
|
|
105
|
+
*/
|
|
106
|
+
getStore(): ScheduleStore;
|
|
107
|
+
/**
|
|
108
|
+
* Start the scheduler
|
|
109
|
+
*/
|
|
110
|
+
start(): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Load and schedule static cron jobs from visor config
|
|
113
|
+
* These are defined in scheduler.cron section and always run regardless of permissions
|
|
114
|
+
*/
|
|
115
|
+
private loadStaticCronJobs;
|
|
116
|
+
/**
|
|
117
|
+
* Schedule a static cron job from config
|
|
118
|
+
*/
|
|
119
|
+
private scheduleStaticCronJob;
|
|
120
|
+
/**
|
|
121
|
+
* Execute a static cron job
|
|
122
|
+
*/
|
|
123
|
+
private executeStaticCronJob;
|
|
124
|
+
/**
|
|
125
|
+
* Stop the scheduler
|
|
126
|
+
*/
|
|
127
|
+
stop(): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Restore schedules from persistent storage
|
|
130
|
+
*/
|
|
131
|
+
private restoreSchedules;
|
|
132
|
+
/**
|
|
133
|
+
* Schedule a workflow for execution
|
|
134
|
+
*/
|
|
135
|
+
private scheduleExecution;
|
|
136
|
+
/**
|
|
137
|
+
* Schedule a recurring workflow using cron
|
|
138
|
+
*/
|
|
139
|
+
private scheduleRecurring;
|
|
140
|
+
/**
|
|
141
|
+
* Schedule a one-time workflow using setTimeout
|
|
142
|
+
*/
|
|
143
|
+
private scheduleOneTime;
|
|
144
|
+
/**
|
|
145
|
+
* Check for and execute due schedules
|
|
146
|
+
*/
|
|
147
|
+
private checkDueSchedules;
|
|
148
|
+
/**
|
|
149
|
+
* Execute a scheduled workflow
|
|
150
|
+
*/
|
|
151
|
+
private executeSchedule;
|
|
152
|
+
/**
|
|
153
|
+
* Helper to prepare execution environment - reduces duplication between workflow and reminder execution
|
|
154
|
+
*/
|
|
155
|
+
private prepareExecution;
|
|
156
|
+
/**
|
|
157
|
+
* Execute the workflow for a schedule
|
|
158
|
+
*/
|
|
159
|
+
private executeWorkflow;
|
|
160
|
+
/**
|
|
161
|
+
* Execute a simple reminder by running it through the visor pipeline
|
|
162
|
+
* Treats the reminder text as if the user sent it as a message
|
|
163
|
+
*/
|
|
164
|
+
private executeSimpleReminder;
|
|
165
|
+
/**
|
|
166
|
+
* Handle schedule execution failure
|
|
167
|
+
*/
|
|
168
|
+
private handleScheduleFailure;
|
|
169
|
+
/**
|
|
170
|
+
* Send execution result to the appropriate output adapter
|
|
171
|
+
*/
|
|
172
|
+
private sendResult;
|
|
173
|
+
/**
|
|
174
|
+
* Check if scheduler is running
|
|
175
|
+
*/
|
|
176
|
+
isRunning(): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Get scheduler stats
|
|
179
|
+
*/
|
|
180
|
+
getStats(): {
|
|
181
|
+
running: boolean;
|
|
182
|
+
activeCronJobs: number;
|
|
183
|
+
pendingOneTimeSchedules: number;
|
|
184
|
+
storeStats: ReturnType<ScheduleStore['getStats']>;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get the singleton scheduler instance
|
|
189
|
+
*/
|
|
190
|
+
export declare function getScheduler(visorConfig?: VisorConfig, config?: SchedulerConfig): Scheduler | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* Reset the scheduler instance (for testing)
|
|
193
|
+
*/
|
|
194
|
+
export declare function resetScheduler(): void;
|
|
195
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/scheduler/scheduler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AAGhG,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,C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0D7B;;;OAGG;YACW,qBAAqB;IA+JnC;;OAEG;YACW,qBAAqB;IA2BnC;;OAEG;YACW,UAAU;IAuBxB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,QAAQ,IAAI;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,uBAAuB,EAAE,MAAM,CAAC;QAChC,UAAU,EAAE,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;KACnD;CAQF;AAKD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,MAAM,CAAC,EAAE,eAAe,GACvB,SAAS,GAAG,SAAS,CAKvB;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAKrC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckProviderRegistry,
|
|
3
|
+
init_check_provider_registry
|
|
4
|
+
} from "./chunk-BDGUM6BA.mjs";
|
|
5
|
+
import "./chunk-KFKHU6CM.mjs";
|
|
6
|
+
import "./chunk-XXAEN5KU.mjs";
|
|
7
|
+
import "./chunk-XDLQ3UNF.mjs";
|
|
8
|
+
import "./chunk-D5KI4YQ4.mjs";
|
|
9
|
+
import "./chunk-7YSOINAQ.mjs";
|
|
10
|
+
import "./chunk-NCWIZVOT.mjs";
|
|
11
|
+
import "./chunk-6W75IMDC.mjs";
|
|
12
|
+
import "./chunk-SGS2VMEL.mjs";
|
|
13
|
+
import "./chunk-N7HO6KKC.mjs";
|
|
14
|
+
import "./chunk-J5RGJQ53.mjs";
|
|
15
|
+
import "./chunk-XR7XXGL7.mjs";
|
|
16
|
+
import "./chunk-R5Z7YWPB.mjs";
|
|
17
|
+
import "./chunk-25IC7KXZ.mjs";
|
|
18
|
+
import "./chunk-VF6XIUE4.mjs";
|
|
19
|
+
import "./chunk-2KB35MB7.mjs";
|
|
20
|
+
import "./chunk-PO7X5XI7.mjs";
|
|
21
|
+
import "./chunk-HEX3RL32.mjs";
|
|
22
|
+
import "./chunk-B7BVQM5K.mjs";
|
|
23
|
+
import "./chunk-J7LXIPZS.mjs";
|
|
24
|
+
init_check_provider_registry();
|
|
25
|
+
export {
|
|
26
|
+
CheckProviderRegistry
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=check-provider-registry-ACRGIYOB.mjs.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckProviderRegistry,
|
|
3
|
+
init_check_provider_registry
|
|
4
|
+
} from "./chunk-DGZPPGJJ.mjs";
|
|
5
|
+
import "./chunk-KFKHU6CM.mjs";
|
|
6
|
+
import "./chunk-XXAEN5KU.mjs";
|
|
7
|
+
import "./chunk-XDLQ3UNF.mjs";
|
|
8
|
+
import "./chunk-D5KI4YQ4.mjs";
|
|
9
|
+
import "./chunk-7YSOINAQ.mjs";
|
|
10
|
+
import "./chunk-NCWIZVOT.mjs";
|
|
11
|
+
import "./chunk-6W75IMDC.mjs";
|
|
12
|
+
import "./chunk-SGS2VMEL.mjs";
|
|
13
|
+
import "./chunk-N7HO6KKC.mjs";
|
|
14
|
+
import "./chunk-J5RGJQ53.mjs";
|
|
15
|
+
import "./chunk-XR7XXGL7.mjs";
|
|
16
|
+
import "./chunk-R5Z7YWPB.mjs";
|
|
17
|
+
import "./chunk-25IC7KXZ.mjs";
|
|
18
|
+
import "./chunk-VF6XIUE4.mjs";
|
|
19
|
+
import "./chunk-2KB35MB7.mjs";
|
|
20
|
+
import "./chunk-PO7X5XI7.mjs";
|
|
21
|
+
import "./chunk-HEX3RL32.mjs";
|
|
22
|
+
import "./chunk-B7BVQM5K.mjs";
|
|
23
|
+
import "./chunk-J7LXIPZS.mjs";
|
|
24
|
+
init_check_provider_registry();
|
|
25
|
+
export {
|
|
26
|
+
CheckProviderRegistry
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=check-provider-registry-VYHKFHK2.mjs.map
|