@leitwerk-dev/server 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-7PKX73TU.js +8 -0
- package/dist/{app-D4XHIbwA.d.ts → app-WfwKzrVk.d.ts} +2029 -410
- package/dist/app.d.ts +55 -12
- package/dist/app.d.ts.map +1 -1
- package/dist/{chunk-XTXH6623.js → chunk-CNITOV76.js} +1359 -991
- package/dist/chunk-CNITOV76.js.map +1 -0
- package/dist/{chunk-AGC2ND53.js → chunk-ZSKM25SD.js} +588 -667
- package/dist/chunk-ZSKM25SD.js.map +1 -0
- package/dist/config/config-loader.d.ts +11 -0
- package/dist/config/config-loader.d.ts.map +1 -1
- package/dist/config/config-types.d.ts +152 -51
- package/dist/config/config-types.d.ts.map +1 -1
- package/dist/db/api-token-repo.d.ts +24 -0
- package/dist/db/api-token-repo.d.ts.map +1 -1
- package/dist/db/auth-repo.d.ts +30 -0
- package/dist/db/auth-repo.d.ts.map +1 -1
- package/dist/db/credential-cipher.d.ts +8 -3
- package/dist/db/credential-cipher.d.ts.map +1 -1
- package/dist/db/database.d.ts +19 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/external-write-log-repo.d.ts +6 -1
- package/dist/db/external-write-log-repo.d.ts.map +1 -1
- package/dist/db/future-execution-repo.d.ts +47 -0
- package/dist/db/future-execution-repo.d.ts.map +1 -1
- package/dist/db/launch-run-repo.d.ts +17 -0
- package/dist/db/launch-run-repo.d.ts.map +1 -1
- package/dist/db/launcher-recent-value-repo.d.ts +15 -0
- package/dist/db/launcher-recent-value-repo.d.ts.map +1 -1
- package/dist/db/pending-external-source-fire-repo.d.ts +33 -0
- package/dist/db/pending-external-source-fire-repo.d.ts.map +1 -1
- package/dist/db/process-event-repo.d.ts +17 -0
- package/dist/db/process-event-repo.d.ts.map +1 -1
- package/dist/db/process-handoff-dedup-key-repo.d.ts +8 -0
- package/dist/db/process-handoff-dedup-key-repo.d.ts.map +1 -1
- package/dist/db/process-input-repo.d.ts +15 -0
- package/dist/db/process-input-repo.d.ts.map +1 -1
- package/dist/db/process-instance-repo.d.ts +49 -0
- package/dist/db/process-instance-repo.d.ts.map +1 -1
- package/dist/db/process-leaf-outcome-snapshot-repo.d.ts +18 -0
- package/dist/db/process-leaf-outcome-snapshot-repo.d.ts.map +1 -1
- package/dist/db/process-project-repo.d.ts +20 -0
- package/dist/db/process-project-repo.d.ts.map +1 -1
- package/dist/db/process-question-request-repo.d.ts +19 -0
- package/dist/db/process-question-request-repo.d.ts.map +1 -1
- package/dist/db/process-relation-repo.d.ts +5 -0
- package/dist/db/process-relation-repo.d.ts.map +1 -1
- package/dist/db/process-skill-repo.d.ts +4 -0
- package/dist/db/process-skill-repo.d.ts.map +1 -1
- package/dist/db/process-title-job-repo.d.ts +22 -0
- package/dist/db/process-title-job-repo.d.ts.map +1 -1
- package/dist/db/process-tool-approval-request-repo.d.ts +20 -0
- package/dist/db/process-tool-approval-request-repo.d.ts.map +1 -1
- package/dist/db/process-turn-annotation-repo.d.ts +22 -2
- package/dist/db/process-turn-annotation-repo.d.ts.map +1 -1
- package/dist/db/process-turn-record-repo.d.ts +27 -0
- package/dist/db/process-turn-record-repo.d.ts.map +1 -1
- package/dist/db/provider-credential-repo.d.ts +16 -0
- package/dist/db/provider-credential-repo.d.ts.map +1 -1
- package/dist/db/repositories.d.ts +33 -0
- package/dist/db/repositories.d.ts.map +1 -1
- package/dist/db/session-transfer-repo.d.ts +49 -1
- package/dist/db/session-transfer-repo.d.ts.map +1 -1
- package/dist/db/skill-repo.d.ts +20 -0
- package/dist/db/skill-repo.d.ts.map +1 -1
- package/dist/db/startup-observation-repo.d.ts +3 -0
- package/dist/db/startup-observation-repo.d.ts.map +1 -1
- package/dist/db/ticket-destination-recent-repo.d.ts +14 -0
- package/dist/db/ticket-destination-recent-repo.d.ts.map +1 -1
- package/dist/db/turn-start-record-repo.d.ts +9 -0
- package/dist/db/turn-start-record-repo.d.ts.map +1 -1
- package/dist/db/turn-summary-repo.d.ts +18 -0
- package/dist/db/turn-summary-repo.d.ts.map +1 -1
- package/dist/db/worker-lease-repo.d.ts +31 -1
- package/dist/db/worker-lease-repo.d.ts.map +1 -1
- package/dist/effects/post-commit-effect.d.ts +29 -0
- package/dist/effects/post-commit-effect.d.ts.map +1 -1
- package/dist/effects/post-commit-runner.d.ts +1 -0
- package/dist/effects/post-commit-runner.d.ts.map +1 -1
- package/dist/entry-ref-patch.d.ts +3 -0
- package/dist/entry-ref-patch.d.ts.map +1 -1
- package/dist/extension-ui/catalog.d.ts +15 -0
- package/dist/extension-ui/catalog.d.ts.map +1 -1
- package/dist/extensions/extension-host.d.ts +6 -0
- package/dist/extensions/extension-host.d.ts.map +1 -1
- package/dist/external-source-service.d.ts +8 -0
- package/dist/external-source-service.d.ts.map +1 -1
- package/dist/future-execution/execution.d.ts +23 -1
- package/dist/future-execution/execution.d.ts.map +1 -1
- package/dist/future-execution/launch-lifecycle.d.ts +76 -0
- package/dist/future-execution/launch-lifecycle.d.ts.map +1 -1
- package/dist/future-execution/lifecycle.d.ts +99 -0
- package/dist/future-execution/lifecycle.d.ts.map +1 -1
- package/dist/future-execution/model-projection.d.ts +6 -0
- package/dist/future-execution/model-projection.d.ts.map +1 -1
- package/dist/future-execution/transition-planner.d.ts +25 -0
- package/dist/future-execution/transition-planner.d.ts.map +1 -1
- package/dist/future-execution-scheduler.d.ts +1 -1
- package/dist/future-execution-scheduler.d.ts.map +1 -1
- package/dist/index.d.ts +3 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -239
- package/dist/index.js.map +1 -1
- package/dist/instance-tree.d.ts +3 -0
- package/dist/instance-tree.d.ts.map +1 -1
- package/dist/integration-tool-registry.d.ts +4 -1
- package/dist/integration-tool-registry.d.ts.map +1 -1
- package/dist/launch-coordinator.d.ts +33 -0
- package/dist/launch-coordinator.d.ts.map +1 -1
- package/dist/launch-pipeline.d.ts +60 -0
- package/dist/launch-pipeline.d.ts.map +1 -1
- package/dist/launcher-recent-values-service.d.ts +3 -0
- package/dist/launcher-recent-values-service.d.ts.map +1 -1
- package/dist/main.js +7 -14
- package/dist/main.js.map +1 -1
- package/dist/model-providers/builtin-server-adapter.d.ts +1 -0
- package/dist/model-providers/builtin-server-adapter.d.ts.map +1 -1
- package/dist/model-providers/credentials.d.ts +17 -0
- package/dist/model-providers/credentials.d.ts.map +1 -1
- package/dist/model-providers/model-status-cache.d.ts +30 -1
- package/dist/model-providers/model-status-cache.d.ts.map +1 -1
- package/dist/model-providers/provider-options.d.ts +21 -1
- package/dist/model-providers/provider-options.d.ts.map +1 -1
- package/dist/model-providers/registry.d.ts +22 -2
- package/dist/model-providers/registry.d.ts.map +1 -1
- package/dist/model-providers/server-adapters.d.ts +19 -0
- package/dist/model-providers/server-adapters.d.ts.map +1 -1
- package/dist/pi-resources/assemble.d.ts +24 -4
- package/dist/pi-resources/assemble.d.ts.map +1 -1
- package/dist/pi-resources/bundle-cache.d.ts +20 -1
- package/dist/pi-resources/bundle-cache.d.ts.map +1 -1
- package/dist/pi-resources/bundle-pin-lifecycle.d.ts +5 -1
- package/dist/pi-resources/bundle-pin-lifecycle.d.ts.map +1 -1
- package/dist/pi-resources/resource-collector.d.ts +11 -0
- package/dist/pi-resources/resource-collector.d.ts.map +1 -1
- package/dist/pi-session-tree.d.ts +13 -1
- package/dist/pi-session-tree.d.ts.map +1 -1
- package/dist/process-action-registry.d.ts +47 -0
- package/dist/process-action-registry.d.ts.map +1 -1
- package/dist/process-deletion-service.d.ts +12 -0
- package/dist/process-deletion-service.d.ts.map +1 -1
- package/dist/process-engine/decision.d.ts +12 -0
- package/dist/process-engine/decision.d.ts.map +1 -1
- package/dist/process-engine/engine.d.ts +1 -0
- package/dist/process-engine/engine.d.ts.map +1 -1
- package/dist/process-engine/operation.d.ts +23 -2
- package/dist/process-engine/operation.d.ts.map +1 -1
- package/dist/process-engine/startup-reconciliation.d.ts +14 -0
- package/dist/process-engine/startup-reconciliation.d.ts.map +1 -1
- package/dist/process-engine/types.d.ts +112 -1
- package/dist/process-engine/types.d.ts.map +1 -1
- package/dist/process-engine/writes/build-process-park-writes.d.ts +3 -0
- package/dist/process-engine/writes/build-process-park-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-recovery-start-writes.d.ts +4 -0
- package/dist/process-engine/writes/build-recovery-start-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-retry-writes.d.ts +3 -0
- package/dist/process-engine/writes/build-retry-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-turn-failed-writes.d.ts +6 -0
- package/dist/process-engine/writes/build-turn-failed-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-turn-outcome-writes.d.ts +8 -0
- package/dist/process-engine/writes/build-turn-outcome-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-turn-selection-writes.d.ts +8 -0
- package/dist/process-engine/writes/build-turn-selection-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/commit-writes.d.ts +14 -0
- package/dist/process-engine/writes/commit-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/deferred-extension-events.d.ts +4 -0
- package/dist/process-engine/writes/deferred-extension-events.d.ts.map +1 -1
- package/dist/process-engine/writes/writes.d.ts +67 -0
- package/dist/process-engine/writes/writes.d.ts.map +1 -1
- package/dist/process-graph.d.ts +1 -1
- package/dist/process-graph.d.ts.map +1 -1
- package/dist/process-input-dispatch.d.ts +1 -0
- package/dist/process-input-dispatch.d.ts.map +1 -1
- package/dist/process-launch-executor.d.ts +1 -0
- package/dist/process-launch-executor.d.ts.map +1 -1
- package/dist/process-model-policy/types.d.ts +157 -1
- package/dist/process-model-policy/types.d.ts.map +1 -1
- package/dist/process-operation-coordinator.d.ts +3 -0
- package/dist/process-operation-coordinator.d.ts.map +1 -1
- package/dist/process-question-service.d.ts +36 -20
- package/dist/process-question-service.d.ts.map +1 -1
- package/dist/process-runtime-availability.d.ts +2 -1
- package/dist/process-runtime-availability.d.ts.map +1 -1
- package/dist/process-session-store.d.ts +15 -4
- package/dist/process-session-store.d.ts.map +1 -1
- package/dist/process-title-generator.d.ts +53 -0
- package/dist/process-title-generator.d.ts.map +1 -1
- package/dist/process-turn-navigation.d.ts +1 -30
- package/dist/process-turn-navigation.d.ts.map +1 -1
- package/dist/process-turn-trace.d.ts +7 -0
- package/dist/process-turn-trace.d.ts.map +1 -1
- package/dist/process-ui-registry.d.ts +2 -0
- package/dist/process-ui-registry.d.ts.map +1 -1
- package/dist/process-ui-snapshot-presenter.d.ts +68 -1
- package/dist/process-ui-snapshot-presenter.d.ts.map +1 -1
- package/dist/process-watcher-registry.d.ts +5 -0
- package/dist/process-watcher-registry.d.ts.map +1 -1
- package/dist/product-ref-state.d.ts +1 -0
- package/dist/product-ref-state.d.ts.map +1 -1
- package/dist/project-mutation-service.d.ts +19 -0
- package/dist/project-mutation-service.d.ts.map +1 -1
- package/dist/result-image-store.d.ts +20 -0
- package/dist/result-image-store.d.ts.map +1 -1
- package/dist/routes/process-route-helpers.d.ts +30 -0
- package/dist/routes/process-route-helpers.d.ts.map +1 -1
- package/dist/routes/ui-renderers.d.ts +4 -0
- package/dist/routes/ui-renderers.d.ts.map +1 -1
- package/dist/routes/watchers.d.ts +3 -0
- package/dist/routes/watchers.d.ts.map +1 -1
- package/dist/semantic-entry-ref-state.d.ts +1 -0
- package/dist/semantic-entry-ref-state.d.ts.map +1 -1
- package/dist/server-bootstrap/app-lifecycle.d.ts +24 -0
- package/dist/server-bootstrap/app-lifecycle.d.ts.map +1 -0
- package/dist/server-bootstrap/build-host-capabilities.d.ts +5 -1
- package/dist/server-bootstrap/build-host-capabilities.d.ts.map +1 -1
- package/dist/server-topology.d.ts +8 -1
- package/dist/server-topology.d.ts.map +1 -1
- package/dist/session-transfer-helper-relays.d.ts +24 -0
- package/dist/session-transfer-helper-relays.d.ts.map +1 -1
- package/dist/session-transfer-service.d.ts +63 -1
- package/dist/session-transfer-service.d.ts.map +1 -1
- package/dist/skills/catalog-service.d.ts +7 -0
- package/dist/skills/catalog-service.d.ts.map +1 -1
- package/dist/skills/source-importer.d.ts +8 -0
- package/dist/skills/source-importer.d.ts.map +1 -1
- package/dist/startup-evidence.d.ts.map +1 -1
- package/dist/supervisor/ipc-handler.d.ts +28 -0
- package/dist/supervisor/ipc-handler.d.ts.map +1 -1
- package/dist/supervisor/worker-event-ingestor.d.ts +10 -0
- package/dist/supervisor/worker-event-ingestor.d.ts.map +1 -1
- package/dist/supervisor/worker-start-payload-builder.d.ts +13 -0
- package/dist/supervisor/worker-start-payload-builder.d.ts.map +1 -1
- package/dist/supervisor/worker-storage-layout.d.ts +12 -0
- package/dist/supervisor/worker-storage-layout.d.ts.map +1 -1
- package/dist/supervisor/worker-supervisor.d.ts +47 -3
- package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
- package/dist/supervisor/worker-turn-ipc-recorder.d.ts +19 -0
- package/dist/supervisor/worker-turn-ipc-recorder.d.ts.map +1 -1
- package/dist/supervisor/worker-unit-reclaimer.d.ts +3 -0
- package/dist/supervisor/worker-unit-reclaimer.d.ts.map +1 -1
- package/dist/supervisor/worker-websocket-ipc.d.ts +37 -0
- package/dist/supervisor/worker-websocket-ipc.d.ts.map +1 -1
- package/dist/test-helpers/accepted-turn-start.d.ts +17 -0
- package/dist/test-helpers/accepted-turn-start.d.ts.map +1 -1
- package/dist/test-helpers/session-snapshot-fixtures.d.ts +1 -1
- package/dist/test-helpers/session-snapshot-fixtures.d.ts.map +1 -1
- package/dist/test-helpers/turn-start-preflight-fixtures.d.ts +8 -1
- package/dist/test-helpers/turn-start-preflight-fixtures.d.ts.map +1 -1
- package/dist/test-helpers/unit-deps.d.ts +8 -0
- package/dist/test-helpers/unit-deps.d.ts.map +1 -1
- package/dist/testing.d.ts +4 -7
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -53
- package/dist/testing.js.map +1 -1
- package/dist/tool-approval-gate.d.ts +21 -0
- package/dist/tool-approval-gate.d.ts.map +1 -1
- package/dist/turn-result-markdown.d.ts +2 -0
- package/dist/turn-result-markdown.d.ts.map +1 -1
- package/dist/worker-runtime-profile-selection.d.ts +20 -4
- package/dist/worker-runtime-profile-selection.d.ts.map +1 -1
- package/dist/ws/broadcast.d.ts +10 -0
- package/dist/ws/broadcast.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/app.ts +916 -892
- package/src/config/config-loader.ts +12 -0
- package/src/config/config-types.ts +166 -66
- package/src/db/api-token-repo.ts +35 -2
- package/src/db/auth-repo.ts +35 -1
- package/src/db/credential-cipher.ts +8 -3
- package/src/db/database.ts +14 -0
- package/src/db/external-write-log-repo.ts +6 -1
- package/src/db/future-execution-repo.ts +51 -1
- package/src/db/launch-run-repo.ts +17 -0
- package/src/db/launcher-recent-value-repo.ts +15 -0
- package/src/db/pending-external-source-fire-repo.ts +33 -0
- package/src/db/process-event-repo.ts +21 -1
- package/src/db/process-handoff-dedup-key-repo.ts +8 -0
- package/src/db/process-input-repo.ts +15 -0
- package/src/db/process-instance-repo.ts +57 -2
- package/src/db/process-leaf-outcome-snapshot-repo.ts +18 -0
- package/src/db/process-project-repo.ts +20 -0
- package/src/db/process-question-request-repo.ts +19 -0
- package/src/db/process-relation-repo.ts +8 -1
- package/src/db/process-skill-repo.ts +4 -0
- package/src/db/process-title-job-repo.ts +30 -2
- package/src/db/process-tool-approval-request-repo.ts +24 -1
- package/src/db/process-turn-annotation-repo.ts +22 -2
- package/src/db/process-turn-record-repo.ts +27 -0
- package/src/db/provider-credential-repo.ts +20 -1
- package/src/db/repositories.ts +36 -1
- package/src/db/session-transfer-repo.ts +71 -9
- package/src/db/skill-repo.ts +24 -1
- package/src/db/startup-observation-repo.ts +3 -0
- package/src/db/ticket-destination-recent-repo.ts +14 -0
- package/src/db/turn-start-record-repo.ts +12 -1
- package/src/db/turn-summary-repo.ts +29 -2
- package/src/db/worker-lease-repo.ts +31 -1
- package/src/deployment-preflight.ts +1 -1
- package/src/effects/post-commit-effect.ts +42 -3
- package/src/effects/post-commit-runner.ts +1 -0
- package/src/entry-ref-patch.ts +9 -1
- package/src/extension-ui/catalog.ts +15 -0
- package/src/extensions/extension-host.ts +6 -0
- package/src/external-source-service.ts +12 -1
- package/src/future-execution/execution.ts +45 -8
- package/src/future-execution/launch-lifecycle.ts +145 -17
- package/src/future-execution/lifecycle.ts +124 -13
- package/src/future-execution/model-projection.ts +6 -0
- package/src/future-execution/transition-planner.ts +25 -0
- package/src/future-execution-scheduler.ts +7 -6
- package/src/index.ts +5 -153
- package/src/instance-tree.ts +3 -0
- package/src/integration-tool-registry.ts +17 -8
- package/src/launch-coordinator.ts +55 -5
- package/src/launch-pipeline.ts +103 -12
- package/src/launcher-recent-values-service.ts +3 -0
- package/src/main.ts +3 -10
- package/src/model-providers/builtin-server-adapter.ts +1 -0
- package/src/model-providers/credentials.ts +17 -0
- package/src/model-providers/model-status-cache.ts +30 -1
- package/src/model-providers/provider-options.ts +25 -2
- package/src/model-providers/registry.ts +22 -2
- package/src/model-providers/server-adapters.ts +19 -0
- package/src/pi-resources/assemble.ts +24 -4
- package/src/pi-resources/bundle-cache.ts +20 -1
- package/src/pi-resources/bundle-pin-lifecycle.ts +8 -2
- package/src/pi-resources/resource-collector.ts +11 -0
- package/src/pi-session-tree.ts +13 -1
- package/src/process-action-registry.ts +53 -1
- package/src/process-deletion-service.ts +29 -4
- package/src/process-engine/decision.ts +12 -0
- package/src/process-engine/engine.ts +1 -0
- package/src/process-engine/operation.ts +23 -2
- package/src/process-engine/startup-reconciliation.ts +14 -0
- package/src/process-engine/types.ts +176 -14
- package/src/process-engine/writes/build-process-park-writes.ts +3 -0
- package/src/process-engine/writes/build-recovery-start-writes.ts +4 -0
- package/src/process-engine/writes/build-retry-writes.ts +3 -0
- package/src/process-engine/writes/build-turn-failed-writes.ts +6 -0
- package/src/process-engine/writes/build-turn-outcome-writes.ts +8 -0
- package/src/process-engine/writes/build-turn-selection-writes.ts +8 -0
- package/src/process-engine/writes/commit-writes.ts +14 -0
- package/src/process-engine/writes/deferred-extension-events.ts +4 -0
- package/src/process-engine/writes/writes.ts +104 -10
- package/src/process-graph.ts +0 -3
- package/src/process-input-dispatch.ts +1 -0
- package/src/process-launch-executor.ts +1 -0
- package/src/process-model-policy/types.ts +195 -11
- package/src/process-operation-coordinator.ts +3 -0
- package/src/process-question-service.ts +53 -11
- package/src/process-runtime-availability.ts +4 -3
- package/src/process-session-store.ts +15 -4
- package/src/process-title-generator.ts +71 -5
- package/src/process-turn-navigation.ts +4 -1
- package/src/process-turn-trace.ts +7 -0
- package/src/process-ui-registry.ts +2 -0
- package/src/process-ui-snapshot-presenter.ts +75 -3
- package/src/process-watcher-registry.ts +5 -0
- package/src/product-ref-state.ts +1 -0
- package/src/project-mutation-service.ts +22 -1
- package/src/result-image-store.ts +27 -2
- package/src/routes/process-route-helpers.ts +30 -0
- package/src/routes/ui-renderers.ts +4 -0
- package/src/routes/watchers.ts +3 -0
- package/src/semantic-entry-ref-state.ts +1 -0
- package/src/server-bootstrap/app-lifecycle.ts +150 -0
- package/src/server-topology.ts +8 -1
- package/src/session-transfer-helper-relays.ts +33 -2
- package/src/session-transfer-service.ts +75 -7
- package/src/skills/catalog-service.ts +7 -0
- package/src/skills/source-importer.ts +8 -0
- package/src/startup-evidence.ts +23 -41
- package/src/supervisor/ipc-handler.ts +33 -1
- package/src/supervisor/worker-event-ingestor.ts +10 -0
- package/src/supervisor/worker-start-payload-builder.ts +16 -1
- package/src/supervisor/worker-storage-layout.ts +12 -0
- package/src/supervisor/worker-supervisor.ts +119 -133
- package/src/supervisor/worker-turn-ipc-recorder.ts +19 -0
- package/src/supervisor/worker-unit-reclaimer.ts +3 -0
- package/src/supervisor/worker-websocket-ipc.ts +57 -3
- package/src/test-helpers/accepted-turn-start.ts +28 -2
- package/src/test-helpers/session-snapshot-fixtures.ts +1 -1
- package/src/test-helpers/turn-start-preflight-fixtures.ts +8 -1
- package/src/test-helpers/unit-deps.ts +13 -1
- package/src/testing.ts +4 -23
- package/src/tool-approval-gate.ts +32 -3
- package/src/turn-result-markdown.ts +2 -0
- package/src/worker-runtime-profile-selection.ts +24 -5
- package/src/ws/broadcast.ts +20 -1
- package/dist/app-I4QQUL5B.js +0 -10
- package/dist/chunk-AGC2ND53.js.map +0 -1
- package/dist/chunk-XTXH6623.js.map +0 -1
- /package/dist/{app-I4QQUL5B.js.map → app-7PKX73TU.js.map} +0 -0
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
|
|
42
42
|
const ONE_TIME_FAILURE_RETRY_DELAY_MS = 60_000;
|
|
43
43
|
|
|
44
|
+
/** @internal */
|
|
44
45
|
export interface FutureExecutionExecutorDeps
|
|
45
46
|
extends Pick<
|
|
46
47
|
RepositoryBundle,
|
|
@@ -53,19 +54,31 @@ export interface FutureExecutionExecutorDeps
|
|
|
53
54
|
| "handoffDedupKeys"
|
|
54
55
|
| "transaction"
|
|
55
56
|
> {
|
|
57
|
+
/** @internal */
|
|
56
58
|
turnRecords?: RepositoryBundle["turnRecords"];
|
|
59
|
+
/** @internal */
|
|
57
60
|
broadcaster: Broadcaster;
|
|
61
|
+
/** @internal */
|
|
58
62
|
commands: ProcessEngine;
|
|
63
|
+
/** @internal */
|
|
59
64
|
processOperations: ProcessOperationCoordinator;
|
|
65
|
+
/** @internal */
|
|
60
66
|
processTitles?: ProcessTitleGenerator;
|
|
67
|
+
/** @internal */
|
|
61
68
|
extensionHost?: ExtensionHost;
|
|
69
|
+
/** @internal */
|
|
62
70
|
processGraphs?: ProcessGraphRegistry;
|
|
71
|
+
/** @internal */
|
|
63
72
|
processActionRegistry?: ProcessActionRegistry;
|
|
64
|
-
/** Required for every server-owned scheduled execution. */
|
|
73
|
+
/** Required for every server-owned scheduled execution. @internal */
|
|
65
74
|
processModelPolicy: ServerProcessModelPolicy;
|
|
75
|
+
/** @internal */
|
|
66
76
|
launchPlans: ProcessLaunchPlanServiceLike;
|
|
77
|
+
/** @internal */
|
|
67
78
|
modelStatusCache: Pick<ModelStatusCache, "snapshot">;
|
|
79
|
+
/** @internal */
|
|
68
80
|
launchPipeline: LaunchPipeline;
|
|
81
|
+
/** @internal */
|
|
69
82
|
logger?: ProcessEngineLogger;
|
|
70
83
|
}
|
|
71
84
|
|
|
@@ -78,14 +91,38 @@ export type FutureExecutionDisposition =
|
|
|
78
91
|
| { kind: "retry_later"; error: Error }
|
|
79
92
|
| { kind: "remove"; error?: Error };
|
|
80
93
|
|
|
94
|
+
/** @internal */
|
|
81
95
|
export type FutureExecutionItemOutcome =
|
|
82
|
-
| {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
| {
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
| {
|
|
97
|
+
/** @internal */
|
|
98
|
+
kind: "no_work";
|
|
99
|
+
}
|
|
100
|
+
| {
|
|
101
|
+
/** @internal */
|
|
102
|
+
kind: "blocked";
|
|
103
|
+
}
|
|
104
|
+
| {
|
|
105
|
+
/** @internal */
|
|
106
|
+
kind: "retry_scheduled";
|
|
107
|
+
}
|
|
108
|
+
| {
|
|
109
|
+
/** @internal */
|
|
110
|
+
kind: "occurrence_advanced";
|
|
111
|
+
}
|
|
112
|
+
| {
|
|
113
|
+
/** @internal */
|
|
114
|
+
kind: "terminal_invalid_removed";
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
/** @internal */
|
|
118
|
+
kind: "durable_work_committed";
|
|
119
|
+
}
|
|
120
|
+
| {
|
|
121
|
+
/** @internal */
|
|
122
|
+
kind: "durable_work_committed_with_reaction_error";
|
|
123
|
+
/** @internal */
|
|
124
|
+
error: string;
|
|
125
|
+
};
|
|
89
126
|
|
|
90
127
|
function toError(error: unknown, fallbackMessage: string): Error {
|
|
91
128
|
return error instanceof Error ? error : new Error(fallbackMessage);
|
|
@@ -61,61 +61,154 @@ import {
|
|
|
61
61
|
} from "./support.js";
|
|
62
62
|
import { planConsumeFutureExecution } from "./transition-planner.js";
|
|
63
63
|
|
|
64
|
+
/** @internal */
|
|
64
65
|
export interface FutureExecutionIssue extends LauncherValidationError {}
|
|
65
66
|
|
|
67
|
+
/** @internal */
|
|
66
68
|
type LaunchFailure =
|
|
67
|
-
| {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
| {
|
|
70
|
+
/** @internal */
|
|
71
|
+
kind: "invalid";
|
|
72
|
+
/** @internal */
|
|
73
|
+
issues: readonly FutureExecutionIssue[];
|
|
74
|
+
}
|
|
75
|
+
| {
|
|
76
|
+
/** @internal */
|
|
77
|
+
kind: "not_found";
|
|
78
|
+
/** @internal */
|
|
79
|
+
target: "future_execution" | "launch" | "action" | "process";
|
|
80
|
+
}
|
|
81
|
+
| {
|
|
82
|
+
/** @internal */
|
|
83
|
+
kind: "conflict";
|
|
84
|
+
/** @internal */
|
|
85
|
+
issue: FutureExecutionIssue;
|
|
86
|
+
}
|
|
87
|
+
| {
|
|
88
|
+
/** @internal */
|
|
89
|
+
kind: "unavailable";
|
|
90
|
+
/** @internal */
|
|
91
|
+
reason: string;
|
|
92
|
+
}
|
|
93
|
+
| {
|
|
94
|
+
/** @internal */
|
|
95
|
+
kind: "failed";
|
|
96
|
+
/** @internal */
|
|
97
|
+
issue: FutureExecutionIssue;
|
|
98
|
+
};
|
|
72
99
|
|
|
100
|
+
/** @internal */
|
|
73
101
|
export type LaunchMutationOutcome =
|
|
74
|
-
| { kind: "scheduled"; execution: FutureExecution; operation: "created" | "updated" }
|
|
75
102
|
| {
|
|
103
|
+
/** @internal */
|
|
104
|
+
kind: "scheduled";
|
|
105
|
+
/** @internal */
|
|
106
|
+
execution: FutureExecution;
|
|
107
|
+
/** @internal */
|
|
108
|
+
operation: "created" | "updated";
|
|
109
|
+
}
|
|
110
|
+
| {
|
|
111
|
+
/** @internal */
|
|
76
112
|
kind: "launched";
|
|
113
|
+
/** @internal */
|
|
77
114
|
process: ProcessInstance;
|
|
115
|
+
/** @internal */
|
|
78
116
|
projects: ProcessProject[];
|
|
117
|
+
/** @internal */
|
|
79
118
|
operation: "created" | "updated";
|
|
80
119
|
}
|
|
81
120
|
| {
|
|
121
|
+
/** @internal */
|
|
82
122
|
kind: "committed_with_reaction_error";
|
|
123
|
+
/** @internal */
|
|
83
124
|
process: ProcessInstance;
|
|
125
|
+
/** @internal */
|
|
84
126
|
projects: ProcessProject[];
|
|
127
|
+
/** @internal */
|
|
85
128
|
error: string;
|
|
129
|
+
/** @internal */
|
|
86
130
|
code?: string;
|
|
87
131
|
}
|
|
88
132
|
| {
|
|
133
|
+
/** @internal */
|
|
89
134
|
kind: "committed_with_reaction_error";
|
|
135
|
+
/** @internal */
|
|
90
136
|
execution: FutureExecution;
|
|
137
|
+
/** @internal */
|
|
91
138
|
operation: "created" | "updated";
|
|
139
|
+
/** @internal */
|
|
92
140
|
error: string;
|
|
141
|
+
/** @internal */
|
|
93
142
|
code: string;
|
|
94
143
|
}
|
|
95
144
|
| LaunchFailure;
|
|
96
145
|
|
|
146
|
+
/** @internal */
|
|
97
147
|
export interface NormalizedScheduledLaunchInput extends ParsedLauncherRequestBody {}
|
|
98
148
|
|
|
149
|
+
/** @internal */
|
|
99
150
|
export type ValidatedLaunchSchedule =
|
|
100
|
-
| {
|
|
101
|
-
|
|
102
|
-
|
|
151
|
+
| {
|
|
152
|
+
/** @internal */
|
|
153
|
+
mode: "now";
|
|
154
|
+
/** @internal */
|
|
155
|
+
nextRunAt: null;
|
|
156
|
+
/** @internal */
|
|
157
|
+
cronExpression: null;
|
|
158
|
+
}
|
|
159
|
+
| {
|
|
160
|
+
/** @internal */
|
|
161
|
+
mode: "once";
|
|
162
|
+
/** @internal */
|
|
163
|
+
nextRunAt: string;
|
|
164
|
+
/** @internal */
|
|
165
|
+
cronExpression: null;
|
|
166
|
+
}
|
|
167
|
+
| {
|
|
168
|
+
/** @internal */
|
|
169
|
+
mode: "cron";
|
|
170
|
+
/** @internal */
|
|
171
|
+
nextRunAt: string;
|
|
172
|
+
/** @internal */
|
|
173
|
+
cronExpression: string;
|
|
174
|
+
};
|
|
103
175
|
|
|
176
|
+
/** @internal */
|
|
104
177
|
export interface PreparedLaunch {
|
|
178
|
+
/** @internal */
|
|
105
179
|
processId: string;
|
|
180
|
+
/** @internal */
|
|
106
181
|
launcherId: string;
|
|
182
|
+
/** @internal */
|
|
107
183
|
launcherInput: Record<string, unknown>;
|
|
184
|
+
/** @internal */
|
|
108
185
|
modelConfig: LauncherModelConfigDefaults;
|
|
186
|
+
/** @internal */
|
|
109
187
|
launchPlan: ProcessLaunchPlan;
|
|
188
|
+
/** @internal */
|
|
110
189
|
selectedSkillIds: readonly string[];
|
|
190
|
+
/** @internal */
|
|
111
191
|
resourceSelections: readonly SkillSelection[];
|
|
192
|
+
/** @internal */
|
|
112
193
|
modelState: ReturnType<typeof projectLaunchPlanModelState>;
|
|
194
|
+
/** @internal */
|
|
113
195
|
schedule: ValidatedLaunchSchedule;
|
|
114
196
|
}
|
|
115
197
|
|
|
198
|
+
/** @internal */
|
|
116
199
|
export type PreparedLaunchResult =
|
|
117
|
-
| {
|
|
118
|
-
|
|
200
|
+
| {
|
|
201
|
+
/** @internal */
|
|
202
|
+
ok: true;
|
|
203
|
+
/** @internal */
|
|
204
|
+
prepared: PreparedLaunch;
|
|
205
|
+
}
|
|
206
|
+
| {
|
|
207
|
+
/** @internal */
|
|
208
|
+
ok: false;
|
|
209
|
+
/** @internal */
|
|
210
|
+
outcome: LaunchMutationOutcome;
|
|
211
|
+
};
|
|
119
212
|
|
|
120
213
|
export interface FutureLaunchLifecycleDeps
|
|
121
214
|
extends Pick<
|
|
@@ -538,10 +631,14 @@ export function createFutureLaunchLifecycle(
|
|
|
538
631
|
}
|
|
539
632
|
|
|
540
633
|
return {
|
|
634
|
+
/** @internal */
|
|
541
635
|
async prepareLaunch(
|
|
542
636
|
launcherId: string,
|
|
543
637
|
request: NormalizedScheduledLaunchInput,
|
|
544
|
-
opts?: {
|
|
638
|
+
opts?: {
|
|
639
|
+
/** @internal */
|
|
640
|
+
resolvedLauncher?: ResolvedProcessLauncher;
|
|
641
|
+
},
|
|
545
642
|
): Promise<PreparedLaunchResult> {
|
|
546
643
|
return prepareLaunchInternal({
|
|
547
644
|
launcherId,
|
|
@@ -549,9 +646,15 @@ export function createFutureLaunchLifecycle(
|
|
|
549
646
|
...(opts?.resolvedLauncher ? { resolvedLauncher: opts.resolvedLauncher } : {}),
|
|
550
647
|
});
|
|
551
648
|
},
|
|
649
|
+
/** @internal */
|
|
552
650
|
async commitPreparedLaunch(
|
|
553
651
|
prepared: PreparedLaunch,
|
|
554
|
-
opts?: {
|
|
652
|
+
opts?: {
|
|
653
|
+
/** @internal */
|
|
654
|
+
actor?: Actor;
|
|
655
|
+
/** @internal */
|
|
656
|
+
launchRunId?: string;
|
|
657
|
+
},
|
|
555
658
|
): Promise<LaunchMutationOutcome> {
|
|
556
659
|
if (prepared.schedule.mode !== "now")
|
|
557
660
|
return persistPreparedLaunch({ ...prepared, actor: opts?.actor ?? SYSTEM_ACTOR });
|
|
@@ -569,20 +672,41 @@ export function createFutureLaunchLifecycle(
|
|
|
569
672
|
operation: "created",
|
|
570
673
|
};
|
|
571
674
|
},
|
|
675
|
+
/** @internal */
|
|
572
676
|
async applyGeneratedFutureLaunchTitleIfUnchanged(input: {
|
|
677
|
+
/** @internal */
|
|
573
678
|
futureExecutionId: string;
|
|
679
|
+
/** @internal */
|
|
574
680
|
expectedPayloadJson: string;
|
|
681
|
+
/** @internal */
|
|
575
682
|
title: string;
|
|
576
683
|
}): Promise<
|
|
577
|
-
| { kind: "applied"; execution: FutureExecution }
|
|
578
684
|
| {
|
|
685
|
+
/** @internal */
|
|
686
|
+
kind: "applied";
|
|
687
|
+
/** @internal */
|
|
688
|
+
execution: FutureExecution;
|
|
689
|
+
}
|
|
690
|
+
| {
|
|
691
|
+
/** @internal */
|
|
579
692
|
kind: "applied_with_reaction_error";
|
|
693
|
+
/** @internal */
|
|
580
694
|
execution: FutureExecution;
|
|
695
|
+
/** @internal */
|
|
581
696
|
error: string;
|
|
697
|
+
/** @internal */
|
|
582
698
|
code: string;
|
|
583
699
|
}
|
|
584
|
-
| {
|
|
585
|
-
|
|
700
|
+
| {
|
|
701
|
+
/** @internal */
|
|
702
|
+
kind: "superseded";
|
|
703
|
+
}
|
|
704
|
+
| {
|
|
705
|
+
/** @internal */
|
|
706
|
+
kind: "failed";
|
|
707
|
+
/** @internal */
|
|
708
|
+
error: string;
|
|
709
|
+
}
|
|
586
710
|
> {
|
|
587
711
|
return runFutureExecutionExclusive(
|
|
588
712
|
deps.processOperations,
|
|
@@ -630,10 +754,14 @@ export function createFutureLaunchLifecycle(
|
|
|
630
754
|
},
|
|
631
755
|
);
|
|
632
756
|
},
|
|
757
|
+
/** @internal */
|
|
633
758
|
async reviseScheduledLaunch(
|
|
634
759
|
futureExecutionId: string,
|
|
635
760
|
request: NormalizedScheduledLaunchInput,
|
|
636
|
-
opts?: {
|
|
761
|
+
opts?: {
|
|
762
|
+
/** @internal */
|
|
763
|
+
actor?: Actor;
|
|
764
|
+
},
|
|
637
765
|
): Promise<LaunchMutationOutcome> {
|
|
638
766
|
const operationTime = now();
|
|
639
767
|
return runFutureExecutionExclusive(deps.processOperations, futureExecutionId, async () => {
|
|
@@ -43,74 +43,149 @@ export type {
|
|
|
43
43
|
PreparedLaunchResult,
|
|
44
44
|
} from "./launch-lifecycle.js";
|
|
45
45
|
|
|
46
|
+
/** @internal */
|
|
46
47
|
export interface FutureExecutionLifecycleDeps extends FutureExecutionExecutorDeps {
|
|
48
|
+
/** @internal */
|
|
47
49
|
turnRecords: RepositoryBundle["turnRecords"];
|
|
50
|
+
/** @internal */
|
|
48
51
|
launcherService?: ProcessLauncherService;
|
|
52
|
+
/** @internal */
|
|
49
53
|
launcherRecentValues?: LauncherRecentValuesService;
|
|
54
|
+
/** @internal */
|
|
50
55
|
assertRuntimeAvailable?: (processId: string) => Promise<void>;
|
|
51
56
|
}
|
|
52
57
|
|
|
58
|
+
/** @internal */
|
|
53
59
|
export interface FutureExecutionLifecycleOptions {
|
|
60
|
+
/** @internal */
|
|
54
61
|
now?: () => Date;
|
|
55
62
|
}
|
|
56
63
|
|
|
64
|
+
/** @internal */
|
|
57
65
|
type LifecycleFailure =
|
|
58
|
-
| {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
| {
|
|
67
|
+
/** @internal */
|
|
68
|
+
kind: "invalid";
|
|
69
|
+
/** @internal */
|
|
70
|
+
issues: readonly FutureExecutionIssue[];
|
|
71
|
+
}
|
|
72
|
+
| {
|
|
73
|
+
/** @internal */
|
|
74
|
+
kind: "not_found";
|
|
75
|
+
/** @internal */
|
|
76
|
+
target: "future_execution" | "launch" | "action" | "process";
|
|
77
|
+
}
|
|
78
|
+
| {
|
|
79
|
+
/** @internal */
|
|
80
|
+
kind: "conflict";
|
|
81
|
+
/** @internal */
|
|
82
|
+
issue: FutureExecutionIssue;
|
|
83
|
+
}
|
|
84
|
+
| {
|
|
85
|
+
/** @internal */
|
|
86
|
+
kind: "unavailable";
|
|
87
|
+
/** @internal */
|
|
88
|
+
reason: string;
|
|
89
|
+
}
|
|
90
|
+
| {
|
|
91
|
+
/** @internal */
|
|
92
|
+
kind: "failed";
|
|
93
|
+
/** @internal */
|
|
94
|
+
issue: FutureExecutionIssue;
|
|
95
|
+
};
|
|
63
96
|
|
|
97
|
+
/** @internal */
|
|
64
98
|
export type ActionMutationOutcome =
|
|
65
99
|
| {
|
|
100
|
+
/** @internal */
|
|
66
101
|
kind: "scheduled";
|
|
102
|
+
/** @internal */
|
|
67
103
|
execution: FutureExecution;
|
|
104
|
+
/** @internal */
|
|
68
105
|
instanceId: string;
|
|
106
|
+
/** @internal */
|
|
69
107
|
operation: "created" | "updated";
|
|
70
108
|
}
|
|
71
109
|
| {
|
|
110
|
+
/** @internal */
|
|
72
111
|
kind: "executed";
|
|
112
|
+
/** @internal */
|
|
73
113
|
process: ProcessInstance;
|
|
114
|
+
/** @internal */
|
|
74
115
|
data?: Record<string, unknown>;
|
|
75
116
|
}
|
|
76
117
|
| {
|
|
118
|
+
/** @internal */
|
|
77
119
|
kind: "committed_with_reaction_error";
|
|
120
|
+
/** @internal */
|
|
78
121
|
process: ProcessInstance;
|
|
122
|
+
/** @internal */
|
|
79
123
|
error: string;
|
|
124
|
+
/** @internal */
|
|
80
125
|
code?: string;
|
|
81
126
|
}
|
|
82
127
|
| {
|
|
128
|
+
/** @internal */
|
|
83
129
|
kind: "committed_with_reaction_error";
|
|
130
|
+
/** @internal */
|
|
84
131
|
execution: FutureExecution;
|
|
132
|
+
/** @internal */
|
|
85
133
|
instanceId: string;
|
|
134
|
+
/** @internal */
|
|
86
135
|
operation: "created" | "updated";
|
|
136
|
+
/** @internal */
|
|
87
137
|
error: string;
|
|
138
|
+
/** @internal */
|
|
88
139
|
code: string;
|
|
89
140
|
}
|
|
90
141
|
| LifecycleFailure;
|
|
91
142
|
|
|
143
|
+
/** @internal */
|
|
92
144
|
export type CancelFutureExecutionOutcome =
|
|
93
|
-
| { kind: "canceled"; execution: FutureExecution }
|
|
94
145
|
| {
|
|
146
|
+
/** @internal */
|
|
147
|
+
kind: "canceled";
|
|
148
|
+
/** @internal */
|
|
149
|
+
execution: FutureExecution;
|
|
150
|
+
}
|
|
151
|
+
| {
|
|
152
|
+
/** @internal */
|
|
95
153
|
kind: "committed_with_reaction_error";
|
|
154
|
+
/** @internal */
|
|
96
155
|
execution: FutureExecution;
|
|
156
|
+
/** @internal */
|
|
97
157
|
error: string;
|
|
158
|
+
/** @internal */
|
|
98
159
|
code: string;
|
|
99
160
|
}
|
|
100
|
-
| {
|
|
161
|
+
| {
|
|
162
|
+
/** @internal */
|
|
163
|
+
kind: "not_found";
|
|
164
|
+
/** @internal */
|
|
165
|
+
target: "future_execution";
|
|
166
|
+
};
|
|
101
167
|
|
|
168
|
+
/** @internal */
|
|
102
169
|
export interface FutureExecutionDueItemOutcome {
|
|
170
|
+
/** @internal */
|
|
103
171
|
futureExecutionId: string;
|
|
172
|
+
/** @internal */
|
|
104
173
|
kind: FutureExecutionItemOutcome["kind"] | "unexpected_error";
|
|
174
|
+
/** @internal */
|
|
105
175
|
error?: string;
|
|
106
176
|
}
|
|
107
177
|
|
|
178
|
+
/** @internal */
|
|
108
179
|
export interface FutureExecutionDueBatchOutcome {
|
|
180
|
+
/** @internal */
|
|
109
181
|
kind: "batch_completed";
|
|
182
|
+
/** @internal */
|
|
110
183
|
asOf: string;
|
|
184
|
+
/** @internal */
|
|
111
185
|
items: FutureExecutionDueItemOutcome[];
|
|
112
186
|
}
|
|
113
187
|
|
|
188
|
+
/** @internal */
|
|
114
189
|
export interface NormalizedScheduledActionInput extends ParsedActionRequestBody {}
|
|
115
190
|
|
|
116
191
|
type Resolved<T> = { ok: true; value: T } | { ok: false; issue: FutureExecutionIssue };
|
|
@@ -295,6 +370,7 @@ async function executeActionMutation(
|
|
|
295
370
|
: actionFailureOutcome(result);
|
|
296
371
|
}
|
|
297
372
|
|
|
373
|
+
/** @internal */
|
|
298
374
|
export function createFutureExecutionLifecycle(
|
|
299
375
|
deps: FutureExecutionLifecycleDeps,
|
|
300
376
|
_options: FutureExecutionLifecycleOptions = {},
|
|
@@ -400,17 +476,24 @@ export function createFutureExecutionLifecycle(
|
|
|
400
476
|
}
|
|
401
477
|
|
|
402
478
|
return {
|
|
479
|
+
/** @internal */
|
|
403
480
|
prepareLaunch: launchLifecycle.prepareLaunch,
|
|
404
481
|
|
|
482
|
+
/** @internal */
|
|
405
483
|
commitPreparedLaunch: launchLifecycle.commitPreparedLaunch,
|
|
406
484
|
|
|
485
|
+
/** @internal */
|
|
407
486
|
reviseScheduledLaunch: launchLifecycle.reviseScheduledLaunch,
|
|
408
487
|
|
|
488
|
+
/** @internal */
|
|
409
489
|
async scheduleAction(
|
|
410
490
|
process: ProcessInstance,
|
|
411
491
|
actionId: string,
|
|
412
492
|
request: NormalizedScheduledActionInput,
|
|
413
|
-
opts?: {
|
|
493
|
+
opts?: {
|
|
494
|
+
/** @internal */
|
|
495
|
+
actor?: Actor;
|
|
496
|
+
},
|
|
414
497
|
): Promise<ActionMutationOutcome> {
|
|
415
498
|
const operationTime = nowFn();
|
|
416
499
|
const scheduleValidation = validateScheduleRequestInput(request.schedule, ["now", "once"]);
|
|
@@ -459,10 +542,14 @@ export function createFutureExecutionLifecycle(
|
|
|
459
542
|
});
|
|
460
543
|
},
|
|
461
544
|
|
|
545
|
+
/** @internal */
|
|
462
546
|
async reviseScheduledAction(
|
|
463
547
|
futureExecutionId: string,
|
|
464
548
|
request: NormalizedScheduledActionInput,
|
|
465
|
-
opts?: {
|
|
549
|
+
opts?: {
|
|
550
|
+
/** @internal */
|
|
551
|
+
actor?: Actor;
|
|
552
|
+
},
|
|
466
553
|
): Promise<ActionMutationOutcome> {
|
|
467
554
|
const operationTime = nowFn();
|
|
468
555
|
return runFutureExecutionExclusive(
|
|
@@ -550,6 +637,7 @@ export function createFutureExecutionLifecycle(
|
|
|
550
637
|
);
|
|
551
638
|
},
|
|
552
639
|
|
|
640
|
+
/** @internal */
|
|
553
641
|
async cancel(futureExecutionId: string): Promise<CancelFutureExecutionOutcome> {
|
|
554
642
|
return runFutureExecutionExclusive(deps.processOperations, futureExecutionId, async () => {
|
|
555
643
|
const execution = deps.futureExecutions.getById(futureExecutionId);
|
|
@@ -568,12 +656,17 @@ export function createFutureExecutionLifecycle(
|
|
|
568
656
|
});
|
|
569
657
|
},
|
|
570
658
|
|
|
659
|
+
/** @internal */
|
|
571
660
|
applyGeneratedFutureLaunchTitleIfUnchanged:
|
|
572
661
|
launchLifecycle.applyGeneratedFutureLaunchTitleIfUnchanged,
|
|
573
662
|
|
|
663
|
+
/** @internal */
|
|
574
664
|
async reconcileModelAvailability(input: {
|
|
665
|
+
/** @internal */
|
|
575
666
|
availability: ModelStatusCacheSnapshot;
|
|
667
|
+
/** @internal */
|
|
576
668
|
profileIds?: ReadonlySet<string>;
|
|
669
|
+
/** @internal */
|
|
577
670
|
asOf?: string;
|
|
578
671
|
}) {
|
|
579
672
|
const asOf = input.asOf ?? nowFn().toISOString();
|
|
@@ -597,23 +690,40 @@ export function createFutureExecutionLifecycle(
|
|
|
597
690
|
asOf,
|
|
598
691
|
});
|
|
599
692
|
return result.reaction.ok
|
|
600
|
-
? {
|
|
693
|
+
? {
|
|
694
|
+
/** @internal */
|
|
695
|
+
kind: "reconciled",
|
|
696
|
+
/** @internal */
|
|
697
|
+
changed: result.changed,
|
|
698
|
+
/** @internal */
|
|
699
|
+
asOf,
|
|
700
|
+
}
|
|
601
701
|
: {
|
|
702
|
+
/** @internal */
|
|
602
703
|
kind: "committed_with_reaction_error",
|
|
704
|
+
/** @internal */
|
|
603
705
|
changed: result.changed,
|
|
706
|
+
/** @internal */
|
|
604
707
|
asOf,
|
|
708
|
+
/** @internal */
|
|
605
709
|
error: result.reaction.message,
|
|
710
|
+
/** @internal */
|
|
606
711
|
code: result.reaction.code,
|
|
607
712
|
};
|
|
608
713
|
},
|
|
609
714
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
715
|
+
/** @internal */
|
|
716
|
+
async reconcileMissedScheduleOccurrences(asOf: string): Promise<{
|
|
717
|
+
/** @internal */
|
|
718
|
+
kind: "occurrences_advanced";
|
|
719
|
+
/** @internal */
|
|
720
|
+
asOf: string;
|
|
721
|
+
}> {
|
|
613
722
|
await executor.reconcileMissedCronRowsOnStartup(asOf);
|
|
614
723
|
return { kind: "occurrences_advanced", asOf };
|
|
615
724
|
},
|
|
616
725
|
|
|
726
|
+
/** @internal */
|
|
617
727
|
async runDueWork(asOf: string): Promise<FutureExecutionDueBatchOutcome> {
|
|
618
728
|
const blockedItems = await executeDueRows(
|
|
619
729
|
deps.futureExecutions.listBlockedCronDue(asOf),
|
|
@@ -633,4 +743,5 @@ export function createFutureExecutionLifecycle(
|
|
|
633
743
|
};
|
|
634
744
|
}
|
|
635
745
|
|
|
746
|
+
/** @internal */
|
|
636
747
|
export type FutureExecutionLifecycle = ReturnType<typeof createFutureExecutionLifecycle>;
|
|
@@ -27,6 +27,7 @@ export interface FutureModelProjectionDeps {
|
|
|
27
27
|
now?: () => Date;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/** @internal */
|
|
30
31
|
export type FutureModelSelectionState = Pick<FutureExecution, "modelSelection" | "blockedReason">;
|
|
31
32
|
|
|
32
33
|
type ModelEvaluationResult = ProcessModelPolicyEvaluation;
|
|
@@ -89,12 +90,17 @@ export function evaluateFutureModelSelection(input: {
|
|
|
89
90
|
);
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
/** @internal */
|
|
92
94
|
export function projectLaunchPlanModelState(
|
|
93
95
|
plan: ProcessLaunchPlan,
|
|
94
96
|
input: {
|
|
97
|
+
/** @internal */
|
|
95
98
|
policy: ServerProcessModelPolicy;
|
|
99
|
+
/** @internal */
|
|
96
100
|
availability: ModelStatusCacheSnapshot;
|
|
101
|
+
/** @internal */
|
|
97
102
|
detectedAt?: string;
|
|
103
|
+
/** @internal */
|
|
98
104
|
existingBlockedReason?: FutureExecutionBlockReason | null;
|
|
99
105
|
},
|
|
100
106
|
): FutureModelSelectionState {
|