@leitwerk-dev/server 0.2.0 → 0.3.0
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-4QSV4FUQ.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-AGC2ND53.js → chunk-KIOQNNG6.js} +1645 -750
- package/dist/chunk-KIOQNNG6.js.map +1 -0
- package/dist/{chunk-XTXH6623.js → chunk-LK3RO6C7.js} +1543 -2111
- package/dist/chunk-LK3RO6C7.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 +22 -0
- package/dist/test-helpers/accepted-turn-start.d.ts.map +1 -1
- package/dist/test-helpers/prepared-fixture-start.d.ts +14 -0
- package/dist/test-helpers/prepared-fixture-start.d.ts.map +1 -0
- 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 +5 -7
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +60 -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 +32 -3
- package/src/test-helpers/prepared-fixture-start.ts +74 -0
- 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 +5 -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-4QSV4FUQ.js.map} +0 -0
|
@@ -31,80 +31,131 @@ import type {
|
|
|
31
31
|
ProcessSelectedTurnSummary,
|
|
32
32
|
} from "@leitwerk-dev/protocol/http-contracts";
|
|
33
33
|
|
|
34
|
+
/** @internal */
|
|
34
35
|
export interface ProcessContextData {
|
|
36
|
+
/** @internal */
|
|
35
37
|
params: unknown;
|
|
38
|
+
/** @internal */
|
|
36
39
|
state: unknown;
|
|
37
40
|
}
|
|
38
41
|
|
|
42
|
+
/** @internal */
|
|
39
43
|
export interface ResolvedUiHumanTurnAction {
|
|
44
|
+
/** @internal */
|
|
40
45
|
kind: "ui_human_action";
|
|
46
|
+
/** @internal */
|
|
41
47
|
turnId: string;
|
|
48
|
+
/** @internal */
|
|
42
49
|
turnType: "human";
|
|
50
|
+
/** @internal */
|
|
43
51
|
semanticEntryRefKey: ProcessSemanticEntryRefKey | null;
|
|
52
|
+
/** @internal */
|
|
44
53
|
acceptanceState: TurnAcceptanceState;
|
|
45
54
|
}
|
|
46
55
|
|
|
56
|
+
/** @internal */
|
|
47
57
|
export interface ResolvedExternalHumanTriggerAction {
|
|
58
|
+
/** @internal */
|
|
48
59
|
kind: "external_human_trigger";
|
|
60
|
+
/** @internal */
|
|
49
61
|
turnId: string;
|
|
62
|
+
/** @internal */
|
|
50
63
|
turnType: "external";
|
|
64
|
+
/** @internal */
|
|
51
65
|
semanticEntryRefKey: ProcessSemanticEntryRefKey | null;
|
|
66
|
+
/** @internal */
|
|
52
67
|
acceptanceState: TurnAcceptanceState;
|
|
53
|
-
|
|
68
|
+
/** @internal */
|
|
69
|
+
externalTrigger: {
|
|
70
|
+
/** @internal */
|
|
71
|
+
id: string;
|
|
72
|
+
/** @internal */
|
|
73
|
+
actionId: string;
|
|
74
|
+
/** @internal */
|
|
75
|
+
label: string;
|
|
76
|
+
/** @internal */
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
54
79
|
}
|
|
55
80
|
|
|
81
|
+
/** @internal */
|
|
56
82
|
export type ResolvedTurnScopedAction =
|
|
57
83
|
| ResolvedUiHumanTurnAction
|
|
58
84
|
| ResolvedExternalHumanTriggerAction;
|
|
59
85
|
|
|
86
|
+
/** @internal */
|
|
60
87
|
interface ResolvedAction<Definition> {
|
|
88
|
+
/** @internal */
|
|
61
89
|
definition: Definition;
|
|
90
|
+
/** @internal */
|
|
62
91
|
candidateSelectedTurnId: string | null;
|
|
92
|
+
/** @internal */
|
|
63
93
|
lifecycleStatus: ProcessTurnTerminalLifecycleStatus | null;
|
|
64
94
|
}
|
|
65
95
|
|
|
96
|
+
/** @internal */
|
|
66
97
|
export type ResolvedActionPreview = ResolvedAction<ProcessActionPreviewDefinition>;
|
|
98
|
+
/** @internal */
|
|
67
99
|
export type ResolvedActionScheduling = ResolvedAction<ProcessActionSchedulingDefinition>;
|
|
68
100
|
|
|
101
|
+
/** @internal */
|
|
69
102
|
export interface VisibleProcessActionSummary {
|
|
103
|
+
/** @internal */
|
|
70
104
|
id: string;
|
|
105
|
+
/** @internal */
|
|
71
106
|
label: string;
|
|
107
|
+
/** @internal */
|
|
72
108
|
description: string | null;
|
|
109
|
+
/** @internal */
|
|
73
110
|
form?: ProcessActionDefinition["form"];
|
|
111
|
+
/** @internal */
|
|
74
112
|
preview: ResolvedActionPreview | null;
|
|
75
113
|
}
|
|
76
114
|
|
|
115
|
+
/** @internal */
|
|
77
116
|
export interface ProcessActionRegistry {
|
|
117
|
+
/** @internal */
|
|
78
118
|
getAction(processId: string, actionId: string): ProcessActionDefinition | undefined;
|
|
119
|
+
/** @internal */
|
|
79
120
|
isTurnScopedAction(processId: string, actionId: string): boolean;
|
|
121
|
+
/** @internal */
|
|
80
122
|
listVisibleActions(processId: string, ctx: ServerProcessContext): VisibleProcessActionSummary[];
|
|
123
|
+
/** @internal */
|
|
81
124
|
getSelectedTurnSummary(
|
|
82
125
|
processId: string,
|
|
83
126
|
process: ProcessInstance,
|
|
84
127
|
projects?: readonly ProcessProject[],
|
|
85
128
|
): ProcessSelectedTurnSummary | null;
|
|
129
|
+
/** @internal */
|
|
86
130
|
getServerDefinition(processId: string): BuiltServerProcessDefinition | undefined;
|
|
131
|
+
/** @internal */
|
|
87
132
|
getTurnDefinition(
|
|
88
133
|
processId: string,
|
|
89
134
|
turnId: string,
|
|
90
135
|
): TurnDefinition<unknown, unknown> | undefined;
|
|
136
|
+
/** @internal */
|
|
91
137
|
getProcessGraph(processId: string): ExtensionProcessDefinition | undefined;
|
|
138
|
+
/** @internal */
|
|
92
139
|
getProcessDisplayName(processId: string): string | undefined;
|
|
140
|
+
/** @internal */
|
|
93
141
|
resolveContextData(
|
|
94
142
|
processId: string,
|
|
95
143
|
process: Pick<ProcessInstance, "paramsJson" | "stateJson">,
|
|
96
144
|
): ProcessContextData;
|
|
145
|
+
/** @internal */
|
|
97
146
|
resolveTurnScopedAction(
|
|
98
147
|
processId: string,
|
|
99
148
|
process: Pick<ProcessInstance, "selectedTurnId" | "paramsJson" | "stateJson">,
|
|
100
149
|
actionId: string,
|
|
101
150
|
source: ProcessActionExecutionSource,
|
|
102
151
|
): ResolvedTurnScopedAction | null;
|
|
152
|
+
/** @internal */
|
|
103
153
|
resolveActionPreview(
|
|
104
154
|
processId: string,
|
|
105
155
|
process: Pick<ProcessInstance, "selectedTurnId" | "paramsJson" | "stateJson">,
|
|
106
156
|
actionId: string,
|
|
107
157
|
): ResolvedActionPreview | null;
|
|
158
|
+
/** @internal */
|
|
108
159
|
resolveActionScheduling(
|
|
109
160
|
processId: string,
|
|
110
161
|
process: Pick<ProcessInstance, "selectedTurnId" | "paramsJson" | "stateJson">,
|
|
@@ -360,6 +411,7 @@ function resolveTurnScopedActionForProcess(
|
|
|
360
411
|
};
|
|
361
412
|
}
|
|
362
413
|
|
|
414
|
+
/** @internal */
|
|
363
415
|
export function buildProcessActionRegistry(
|
|
364
416
|
catalog: Pick<ExtensionCatalog, "processes">,
|
|
365
417
|
): ProcessActionRegistry {
|
|
@@ -9,13 +9,38 @@ import type { SessionTransferService } from "./session-transfer-service.js";
|
|
|
9
9
|
import type { WorkerSupervisor } from "./supervisor/worker-supervisor.js";
|
|
10
10
|
import type { Broadcaster } from "./ws/broadcast.js";
|
|
11
11
|
|
|
12
|
+
/** @internal */
|
|
12
13
|
export type ProcessDeletionResult =
|
|
13
|
-
| {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
| {
|
|
15
|
+
/** @internal */
|
|
16
|
+
ok: true;
|
|
17
|
+
}
|
|
18
|
+
| {
|
|
19
|
+
/** @internal */
|
|
20
|
+
ok: false;
|
|
21
|
+
/** @internal */
|
|
22
|
+
kind: "not_found";
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
/** @internal */
|
|
26
|
+
ok: false;
|
|
27
|
+
/** @internal */
|
|
28
|
+
kind: "abort_failed";
|
|
29
|
+
/** @internal */
|
|
30
|
+
failure: EngineFailure<void>;
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
/** @internal */
|
|
34
|
+
ok: false;
|
|
35
|
+
/** @internal */
|
|
36
|
+
kind: "cleanup_failed";
|
|
37
|
+
/** @internal */
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
17
40
|
|
|
41
|
+
/** @internal */
|
|
18
42
|
export interface ProcessDeletionService {
|
|
43
|
+
/** @internal */
|
|
19
44
|
deleteProcess(instanceId: string, actor: Actor): Promise<ProcessDeletionResult>;
|
|
20
45
|
}
|
|
21
46
|
|
|
@@ -9,25 +9,37 @@ import type { EngineErrorCode } from "./types.js";
|
|
|
9
9
|
|
|
10
10
|
export type Reaction = PostCommitEffect;
|
|
11
11
|
|
|
12
|
+
/** @internal */
|
|
12
13
|
export interface Decision<TData = void> {
|
|
14
|
+
/** @internal */
|
|
13
15
|
ok: true;
|
|
16
|
+
/** @internal */
|
|
14
17
|
writes: Writes;
|
|
18
|
+
/** @internal */
|
|
15
19
|
data: TData;
|
|
20
|
+
/** @internal */
|
|
16
21
|
metadata?: DecisionMetadata;
|
|
17
22
|
/**
|
|
18
23
|
* Used when operation data is only known after the durable commit. For example,
|
|
19
24
|
* queued inputs receive durable sequence numbers while recording.
|
|
20
25
|
*/
|
|
26
|
+
/** @internal */
|
|
21
27
|
deriveData?: (commit: RecordCommit) => TData;
|
|
22
28
|
}
|
|
23
29
|
|
|
30
|
+
/** @internal */
|
|
24
31
|
export interface RejectedDecision<TData = unknown> {
|
|
32
|
+
/** @internal */
|
|
25
33
|
ok: false;
|
|
34
|
+
/** @internal */
|
|
26
35
|
code: EngineErrorCode;
|
|
36
|
+
/** @internal */
|
|
27
37
|
message: string;
|
|
38
|
+
/** @internal */
|
|
28
39
|
data?: TData;
|
|
29
40
|
}
|
|
30
41
|
|
|
42
|
+
/** @internal */
|
|
31
43
|
export type DecideResult<TData> = Decision<TData> | RejectedDecision<TData>;
|
|
32
44
|
|
|
33
45
|
export function accept<TData = void>(
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
/** @internal */
|
|
1
2
|
export interface OperationInputBase {
|
|
3
|
+
/** @internal */
|
|
2
4
|
instanceId: string;
|
|
3
5
|
}
|
|
4
6
|
|
|
7
|
+
/** @internal */
|
|
5
8
|
export interface OperationMessages {
|
|
9
|
+
/** @internal */
|
|
6
10
|
dispatchErrorMessage?: string;
|
|
11
|
+
/** @internal */
|
|
7
12
|
reconcileErrorMessage?: string;
|
|
8
13
|
}
|
|
9
14
|
|
|
15
|
+
/** @internal */
|
|
10
16
|
type DecideFunction<TInput extends OperationInputBase, TData> = {
|
|
17
|
+
/** @internal */
|
|
11
18
|
bivarianceHack(
|
|
12
19
|
ctx: import("./types.js").DecideContext,
|
|
13
20
|
input: TInput,
|
|
@@ -16,22 +23,31 @@ type DecideFunction<TInput extends OperationInputBase, TData> = {
|
|
|
16
23
|
| import("./decision.js").DecideResult<TData>;
|
|
17
24
|
}["bivarianceHack"];
|
|
18
25
|
|
|
26
|
+
/** @internal */
|
|
19
27
|
type MessageResolver<TInput extends OperationInputBase> = {
|
|
28
|
+
/** @internal */
|
|
20
29
|
bivarianceHack(input: TInput): OperationMessages;
|
|
21
30
|
}["bivarianceHack"];
|
|
22
31
|
|
|
32
|
+
/** @internal */
|
|
23
33
|
type BestEffortFailureReportingResolver<TInput extends OperationInputBase> = {
|
|
34
|
+
/** @internal */
|
|
24
35
|
bivarianceHack(input: TInput): boolean;
|
|
25
36
|
}["bivarianceHack"];
|
|
26
37
|
|
|
38
|
+
/** @internal */
|
|
27
39
|
type AfterRecordFunction<TInput extends OperationInputBase, TData> = {
|
|
40
|
+
/** @internal */
|
|
28
41
|
bivarianceHack(input: TInput, data: TData): void;
|
|
29
42
|
}["bivarianceHack"];
|
|
30
43
|
|
|
44
|
+
/** @internal */
|
|
31
45
|
export interface OperationSpec<TKind extends string, TInput extends OperationInputBase, TData> {
|
|
46
|
+
/** @internal */
|
|
32
47
|
kind: TKind;
|
|
48
|
+
/** @internal */
|
|
33
49
|
label?: string;
|
|
34
|
-
/** Reject this operation while another subsystem has reserved new-turn admission. */
|
|
50
|
+
/** Reject this operation while another subsystem has reserved new-turn admission. @internal */
|
|
35
51
|
admission?: "new_turn";
|
|
36
52
|
|
|
37
53
|
/**
|
|
@@ -40,11 +56,14 @@ export interface OperationSpec<TKind extends string, TInput extends OperationInp
|
|
|
40
56
|
* but they must not commit state, broadcast, dispatch inputs, control workers,
|
|
41
57
|
* or emit extension events.
|
|
42
58
|
*/
|
|
59
|
+
/** @internal */
|
|
43
60
|
decide: DecideFunction<TInput, TData>;
|
|
44
61
|
|
|
45
|
-
/** Runs after the transaction and process lock complete, before reactions are dispatched. */
|
|
62
|
+
/** Runs after the transaction and process lock complete, before reactions are dispatched. @internal */
|
|
46
63
|
afterRecord?: AfterRecordFunction<TInput, TData>;
|
|
64
|
+
/** @internal */
|
|
47
65
|
messages?: OperationMessages | MessageResolver<TInput>;
|
|
66
|
+
/** @internal */
|
|
48
67
|
reportBestEffortFailures?: boolean | BestEffortFailureReportingResolver<TInput>;
|
|
49
68
|
}
|
|
50
69
|
|
|
@@ -56,8 +75,10 @@ export function defineOperation<
|
|
|
56
75
|
return spec;
|
|
57
76
|
}
|
|
58
77
|
|
|
78
|
+
/** @internal */
|
|
59
79
|
export type OperationInput<TOp> =
|
|
60
80
|
TOp extends OperationSpec<string, infer TInput, unknown> ? TInput : never;
|
|
61
81
|
|
|
82
|
+
/** @internal */
|
|
62
83
|
export type OperationData<TOp> =
|
|
63
84
|
TOp extends OperationSpec<string, OperationInputBase, infer TData> ? TData : never;
|
|
@@ -8,23 +8,36 @@ import type { WorkerSupervisor } from "../supervisor/worker-supervisor.js";
|
|
|
8
8
|
import type { Broadcaster } from "../ws/broadcast.js";
|
|
9
9
|
import type { ProcessEngine } from "./types.js";
|
|
10
10
|
|
|
11
|
+
/** @internal */
|
|
11
12
|
interface LoggerLike {
|
|
13
|
+
/** @internal */
|
|
12
14
|
info?: (...args: unknown[]) => void;
|
|
15
|
+
/** @internal */
|
|
13
16
|
warn?: (...args: unknown[]) => void;
|
|
17
|
+
/** @internal */
|
|
14
18
|
error?: (...args: unknown[]) => void;
|
|
15
19
|
}
|
|
16
20
|
|
|
21
|
+
/** @internal */
|
|
17
22
|
export interface StartupReconciliationDeps
|
|
18
23
|
extends Pick<RepositoryBundle, "processes" | "leases" | "turnStarts" | "turnRecords"> {
|
|
24
|
+
/** @internal */
|
|
19
25
|
config: LeitwerkConfig;
|
|
26
|
+
/** @internal */
|
|
20
27
|
broadcaster: Broadcaster;
|
|
28
|
+
/** @internal */
|
|
21
29
|
supervisor: WorkerSupervisor;
|
|
30
|
+
/** @internal */
|
|
22
31
|
commands: Partial<Pick<ProcessEngine, "recordWorkerFailure">>;
|
|
32
|
+
/** @internal */
|
|
23
33
|
bundlePins?: PiResourceBundlePinReconciler;
|
|
34
|
+
/** @internal */
|
|
24
35
|
processActionRegistry: ProcessActionRegistry;
|
|
36
|
+
/** @internal */
|
|
25
37
|
logger?: LoggerLike;
|
|
26
38
|
}
|
|
27
39
|
|
|
40
|
+
/** @internal */
|
|
28
41
|
export function shouldResumeProcessOnStartup(
|
|
29
42
|
process: Pick<ProcessInstance, "selectedTurnId" | "lifecycleStatus" | "currentExecution">,
|
|
30
43
|
config: Pick<LeitwerkConfig, "workers">,
|
|
@@ -74,6 +87,7 @@ function reclaimPersistedLease(
|
|
|
74
87
|
);
|
|
75
88
|
}
|
|
76
89
|
|
|
90
|
+
/** @internal */
|
|
77
91
|
export async function reconcileProcessesOnStartup(deps: StartupReconciliationDeps): Promise<void> {
|
|
78
92
|
const processes = deps.processes
|
|
79
93
|
.listAll()
|