@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
|
@@ -5,39 +5,64 @@ import type {
|
|
|
5
5
|
} from "@leitwerk-dev/domain";
|
|
6
6
|
import type { RepositoryBundle } from "../db/repositories.js";
|
|
7
7
|
|
|
8
|
+
/** @internal */
|
|
8
9
|
export type FutureExecutionTransitionPlan =
|
|
9
10
|
| {
|
|
11
|
+
/** @internal */
|
|
10
12
|
kind: "consume";
|
|
13
|
+
/** @internal */
|
|
11
14
|
futureExecutionId: string;
|
|
15
|
+
/** @internal */
|
|
12
16
|
expectedKind: FutureExecution["kind"];
|
|
17
|
+
/** @internal */
|
|
13
18
|
expectedNextRunAt: string;
|
|
14
19
|
}
|
|
15
20
|
| {
|
|
21
|
+
/** @internal */
|
|
16
22
|
kind: "advance";
|
|
23
|
+
/** @internal */
|
|
17
24
|
futureExecutionId: string;
|
|
25
|
+
/** @internal */
|
|
18
26
|
expectedKind: FutureExecution["kind"];
|
|
27
|
+
/** @internal */
|
|
19
28
|
expectedNextRunAt: string;
|
|
29
|
+
/** @internal */
|
|
20
30
|
nextRunAt: string;
|
|
21
31
|
}
|
|
22
32
|
| {
|
|
33
|
+
/** @internal */
|
|
23
34
|
kind: "block";
|
|
35
|
+
/** @internal */
|
|
24
36
|
futureExecutionId: string;
|
|
37
|
+
/** @internal */
|
|
25
38
|
expectedKind: FutureExecution["kind"];
|
|
39
|
+
/** @internal */
|
|
26
40
|
expectedNextRunAt: string;
|
|
41
|
+
/** @internal */
|
|
27
42
|
blockedReason: FutureExecutionBlockReason;
|
|
43
|
+
/** @internal */
|
|
28
44
|
modelSelection: DurableModelSelection | null;
|
|
45
|
+
/** @internal */
|
|
29
46
|
nextRunAt?: string;
|
|
30
47
|
}
|
|
31
48
|
| {
|
|
49
|
+
/** @internal */
|
|
32
50
|
kind: "retry";
|
|
51
|
+
/** @internal */
|
|
33
52
|
futureExecutionId: string;
|
|
53
|
+
/** @internal */
|
|
34
54
|
expectedKind: FutureExecution["kind"];
|
|
55
|
+
/** @internal */
|
|
35
56
|
expectedNextRunAt: string;
|
|
57
|
+
/** @internal */
|
|
36
58
|
nextRunAt: string;
|
|
37
59
|
}
|
|
38
60
|
| {
|
|
61
|
+
/** @internal */
|
|
39
62
|
kind: "cancel_action";
|
|
63
|
+
/** @internal */
|
|
40
64
|
futureExecutionId: string;
|
|
65
|
+
/** @internal */
|
|
41
66
|
expectedInstanceId: string;
|
|
42
67
|
};
|
|
43
68
|
|
|
@@ -12,17 +12,17 @@ export function startFutureExecutionScheduler(
|
|
|
12
12
|
const pollIntervalMs = options.pollIntervalMs ?? 1_000;
|
|
13
13
|
const nowFn = options.now ?? (() => new Date());
|
|
14
14
|
let timer: ReturnType<typeof setInterval> | null = null;
|
|
15
|
-
let tickInProgress
|
|
15
|
+
let tickInProgress: Promise<void> | undefined;
|
|
16
16
|
|
|
17
17
|
async function tick(): Promise<void> {
|
|
18
18
|
if (tickInProgress) {
|
|
19
|
-
return;
|
|
19
|
+
return tickInProgress;
|
|
20
20
|
}
|
|
21
|
-
tickInProgress =
|
|
21
|
+
tickInProgress = lifecycle.runDueWork(nowFn().toISOString()).then(() => {});
|
|
22
22
|
try {
|
|
23
|
-
await
|
|
23
|
+
await tickInProgress;
|
|
24
24
|
} finally {
|
|
25
|
-
tickInProgress =
|
|
25
|
+
tickInProgress = undefined;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -37,11 +37,12 @@ export function startFutureExecutionScheduler(
|
|
|
37
37
|
void tick();
|
|
38
38
|
}, pollIntervalMs);
|
|
39
39
|
},
|
|
40
|
-
stop(): void {
|
|
40
|
+
async stop(): Promise<void> {
|
|
41
41
|
if (timer) {
|
|
42
42
|
clearInterval(timer);
|
|
43
43
|
timer = null;
|
|
44
44
|
}
|
|
45
|
+
await tickInProgress;
|
|
45
46
|
},
|
|
46
47
|
};
|
|
47
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,159 +1,11 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
buildWorkerUnitLabels,
|
|
7
|
-
createDockerWorkerRunner,
|
|
8
|
-
createKubernetesWorkerRunner,
|
|
9
|
-
createLocalWorkerRunner,
|
|
10
|
-
type DockerEngineClient,
|
|
11
|
-
type DockerProcessVolumeOptions,
|
|
12
|
-
type DockerWorkerRunnerOptions,
|
|
13
|
-
FakeKubernetesApiClient,
|
|
14
|
-
type IsolatedStartWorkerInput,
|
|
15
|
-
isManagedWorkerUnitLabels,
|
|
16
|
-
type KubernetesApiClient,
|
|
17
|
-
type KubernetesNamespaceSummary,
|
|
18
|
-
type KubernetesPersistentVolumeClaimManifest,
|
|
19
|
-
type KubernetesPodManifest,
|
|
20
|
-
type KubernetesPodSpecOptions,
|
|
21
|
-
type KubernetesPodSummary,
|
|
22
|
-
type KubernetesProcessNamespaceManifest,
|
|
23
|
-
type KubernetesProcessVolumeSpec,
|
|
24
|
-
type KubernetesWorkerRunnerOptions,
|
|
25
|
-
kubernetesProcessNamespaceName,
|
|
26
|
-
kubernetesProcessPvcName,
|
|
27
|
-
kubernetesWorkerPodName,
|
|
28
|
-
type LocalStartWorkerInput,
|
|
29
|
-
type LocalWorkerRunnerOptions,
|
|
30
|
-
managedProcessNamespaceLabelSelector,
|
|
31
|
-
managedWorkerLabelSelector,
|
|
32
|
-
mapKubernetesPodExit,
|
|
33
|
-
PROCESS_NAMESPACE_COMPONENT_VALUE,
|
|
34
|
-
PROCESS_SERVER_CA_COMPONENT_VALUE,
|
|
35
|
-
PROCESS_VOLUME_COMPONENT_VALUE,
|
|
36
|
-
type ProcessVolume,
|
|
37
|
-
parseWorkerUnitIdentity,
|
|
38
|
-
type ResolvedWorkerImage,
|
|
39
|
-
type StartWorkerInput,
|
|
40
|
-
type StopWorkerOptions,
|
|
41
|
-
sanitizeKubernetesNameSegment,
|
|
42
|
-
type VolumeRef,
|
|
43
|
-
WORKER_LABEL_COMPONENT,
|
|
44
|
-
WORKER_LABEL_INSTANCE_ID,
|
|
45
|
-
WORKER_LABEL_MANAGED_BY,
|
|
46
|
-
WORKER_LABEL_SERVER_EPOCH,
|
|
47
|
-
WORKER_LABEL_WORKER_ID,
|
|
48
|
-
type WorkerExitInfo,
|
|
49
|
-
type WorkerResourceLimits,
|
|
50
|
-
type WorkerRunner,
|
|
51
|
-
type WorkerUnit,
|
|
52
|
-
type WorkerUnitDescriptor,
|
|
53
|
-
type WorkerUnitIdentity,
|
|
54
|
-
type WorkerUnitRef,
|
|
55
|
-
} from "@leitwerk-dev/worker-runners";
|
|
56
|
-
export { type AppContext, type AppOptions, createApp, createAppContext } from "./app.js";
|
|
2
|
+
type AppContext,
|
|
3
|
+
type AppOptions,
|
|
4
|
+
createAppContext,
|
|
5
|
+
} from "./app.js";
|
|
57
6
|
export {
|
|
58
|
-
applyConfigDefaults,
|
|
59
7
|
getDefaultConfig,
|
|
60
8
|
type LeitwerkConfig,
|
|
61
9
|
loadConfig,
|
|
62
|
-
sanitizeConfigForLogging,
|
|
63
10
|
} from "./config/index.js";
|
|
64
|
-
export {
|
|
65
|
-
closeDatabase,
|
|
66
|
-
createDatabase,
|
|
67
|
-
createInMemoryDatabase,
|
|
68
|
-
DatabaseSchemaMismatchError,
|
|
69
|
-
type InitializeSchemaOptions,
|
|
70
|
-
initializeSchema,
|
|
71
|
-
type LeitwerkDb,
|
|
72
|
-
} from "./db/database.js";
|
|
73
|
-
export * from "./db/repositories.js";
|
|
74
|
-
export {
|
|
75
|
-
buildExtensionUiCatalog,
|
|
76
|
-
type ExtensionUiAssetRoot,
|
|
77
|
-
type ExtensionUiCatalog,
|
|
78
|
-
type ExtensionUiRendererDescriptor,
|
|
79
|
-
type ExtensionUiRendererLookup,
|
|
80
|
-
inferExtensionUiAssetContentType,
|
|
81
|
-
resolveExtensionUiAssetPath,
|
|
82
|
-
} from "./extension-ui/catalog.js";
|
|
83
|
-
export { createExtensionHost, type ExtensionHost } from "./extensions/extension-host.js";
|
|
84
|
-
export * from "./model-providers/index.js";
|
|
85
|
-
export * from "./pi-resources/index.js";
|
|
86
|
-
export {
|
|
87
|
-
type ActionExecutionResult,
|
|
88
|
-
createProcessEngine,
|
|
89
|
-
type EngineResult,
|
|
90
|
-
type ProcessEngine,
|
|
91
|
-
type ProcessEngineDeps,
|
|
92
|
-
} from "./process-engine/index.js";
|
|
93
|
-
export {
|
|
94
|
-
reconcileProcessesOnStartup,
|
|
95
|
-
type StartupReconciliationDeps,
|
|
96
|
-
shouldResumeProcessOnStartup,
|
|
97
|
-
} from "./process-engine/startup-reconciliation.js";
|
|
98
|
-
export { buildParkProcessWrites } from "./process-engine/writes/build-process-park-writes.js";
|
|
99
|
-
export { buildRetryWrites } from "./process-engine/writes/build-retry-writes.js";
|
|
100
|
-
export { buildTurnFailedWrites } from "./process-engine/writes/build-turn-failed-writes.js";
|
|
101
|
-
export { buildTurnOutcomeWrites } from "./process-engine/writes/build-turn-outcome-writes.js";
|
|
102
|
-
export { buildTurnSelectionWrites } from "./process-engine/writes/build-turn-selection-writes.js";
|
|
103
|
-
export {
|
|
104
|
-
type DeferredProcessExtensionEvent,
|
|
105
|
-
emitDeferredExtensionEvent,
|
|
106
|
-
} from "./process-engine/writes/deferred-extension-events.js";
|
|
107
|
-
export {
|
|
108
|
-
buildProcessTitlePrompt,
|
|
109
|
-
buildProcessTitleSourceFields,
|
|
110
|
-
createProcessTitleGenerator,
|
|
111
|
-
normalizeProcessTitle,
|
|
112
|
-
type ProcessTitleGenerator,
|
|
113
|
-
type ProcessTitleLogger,
|
|
114
|
-
} from "./process-title-generator.js";
|
|
115
|
-
export { buildProcessWatcherRegistry } from "./process-watcher-registry.js";
|
|
116
|
-
export {
|
|
117
|
-
buildProjectUpdatedEffect,
|
|
118
|
-
buildProjectUpdatedFrame,
|
|
119
|
-
commitProjectCreate,
|
|
120
|
-
commitProjectUpdate,
|
|
121
|
-
createProjectMutationService,
|
|
122
|
-
type ProjectMutationService,
|
|
123
|
-
} from "./project-mutation-service.js";
|
|
124
|
-
export { ResultImageStore } from "./result-image-store.js";
|
|
125
|
-
export type { RouteDeps } from "./routes/processes.js";
|
|
126
|
-
export { registerUiRendererRoutes, type UiRouteDeps } from "./routes/ui-renderers.js";
|
|
127
|
-
export { registerWatcherRoutes, type WatcherRouteDeps } from "./routes/watchers.js";
|
|
128
|
-
export {
|
|
129
|
-
type FileReader,
|
|
130
|
-
resolveServerTlsOptions,
|
|
131
|
-
type ServerTlsOptions,
|
|
132
|
-
} from "./server-topology.js";
|
|
133
|
-
export {
|
|
134
|
-
createIpcHandler,
|
|
135
|
-
type IpcHandler,
|
|
136
|
-
type IpcHandlerCallbacks,
|
|
137
|
-
type IpcHandlerDeps,
|
|
138
|
-
} from "./supervisor/ipc-handler.js";
|
|
139
|
-
export {
|
|
140
|
-
createLocalWorkerStorageLayout,
|
|
141
|
-
createProcessVolumeWorkerStorageLayout,
|
|
142
|
-
createWorkerStorageLayout,
|
|
143
|
-
type WorkerStorageLayout,
|
|
144
|
-
type WorkerTreePaths,
|
|
145
|
-
} from "./supervisor/worker-storage-layout.js";
|
|
146
|
-
export {
|
|
147
|
-
createWorkerSupervisor,
|
|
148
|
-
type SupervisorDeps,
|
|
149
|
-
type WorkerHandle,
|
|
150
|
-
type WorkerSupervisor,
|
|
151
|
-
} from "./supervisor/worker-supervisor.js";
|
|
152
|
-
export {
|
|
153
|
-
buildRuntimeProfileSelectionInput,
|
|
154
|
-
type ComponentRuntimeProfileSelection,
|
|
155
|
-
type RuntimeProfileSelectionInput,
|
|
156
|
-
type RuntimeProfileSelectionResult,
|
|
157
|
-
selectWorkerRuntimeProfile,
|
|
158
|
-
} from "./worker-runtime-profile-selection.js";
|
|
159
|
-
export { type Broadcaster, createBroadcaster, type WsFrame } from "./ws/broadcast.js";
|
|
11
|
+
export type { WsFrame } from "./ws/broadcast.js";
|
package/src/instance-tree.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { PrimaryPathEntrySnapshot } from "@leitwerk-dev/protocol";
|
|
2
2
|
import { parsePiSessionTreeContent, type ReadonlyPiSessionTree } from "./pi-session-tree.js";
|
|
3
3
|
|
|
4
|
+
/** @internal */
|
|
4
5
|
export interface ParsedInstanceTree {
|
|
6
|
+
/** @internal */
|
|
5
7
|
entriesById: Map<string, PrimaryPathEntrySnapshot>;
|
|
8
|
+
/** @internal */
|
|
6
9
|
labelsByEntryId: Map<string, string>;
|
|
7
10
|
}
|
|
8
11
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { Actor } from "@leitwerk-dev/domain";
|
|
2
|
+
import {
|
|
3
|
+
bindExternalWrites,
|
|
4
|
+
type ExternalWriteLogRepoLike,
|
|
5
|
+
} from "@leitwerk-dev/external-writes/internal";
|
|
2
6
|
import {
|
|
3
7
|
type IntegrationToolDefinition,
|
|
4
8
|
type IntegrationToolExecutionContext,
|
|
9
|
+
objectArg,
|
|
5
10
|
parseJsonData,
|
|
6
11
|
RESERVED_INTEGRATION_TOOL_NAMES,
|
|
7
12
|
type TicketCreationCapability,
|
|
@@ -27,7 +32,10 @@ import type { ToolApprovalGate } from "./tool-approval-gate.js";
|
|
|
27
32
|
|
|
28
33
|
type RegisteredIntegrationTool = IntegrationToolDefinition<unknown>;
|
|
29
34
|
type TicketCreationTool = RegisteredIntegrationTool & { capability: TicketCreationCapability };
|
|
30
|
-
type IntegrationToolExecutionInput = Omit<
|
|
35
|
+
type IntegrationToolExecutionInput = Omit<
|
|
36
|
+
IntegrationToolExecutionContext,
|
|
37
|
+
"signal" | "externalWrites"
|
|
38
|
+
>;
|
|
31
39
|
|
|
32
40
|
interface PendingIntegrationToolExecution {
|
|
33
41
|
readonly controller: AbortController;
|
|
@@ -196,12 +204,8 @@ function resolveJsonPointer(value: unknown, pointer: string): unknown {
|
|
|
196
204
|
}, value);
|
|
197
205
|
}
|
|
198
206
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
throw new Error("Integration tool arguments must be an object");
|
|
202
|
-
}
|
|
203
|
-
return value as Record<string, unknown>;
|
|
204
|
-
}
|
|
207
|
+
const parseToolArgs = (value: unknown) =>
|
|
208
|
+
objectArg(value, "Integration tool arguments must be an object");
|
|
205
209
|
|
|
206
210
|
function persistedTicketActor(value: unknown): Actor {
|
|
207
211
|
return parseSchema(persistedActorSchema, value, "Ticket creation actor is invalid");
|
|
@@ -259,6 +263,7 @@ function withTicketDestinationParameter(
|
|
|
259
263
|
}
|
|
260
264
|
|
|
261
265
|
export class IntegrationToolRegistry {
|
|
266
|
+
constructor(private readonly writes: ExternalWriteLogRepoLike) {}
|
|
262
267
|
private readonly tools = new Map<string, RegisteredIntegrationTool>();
|
|
263
268
|
private readonly executions = new Map<string, PendingIntegrationToolExecution>();
|
|
264
269
|
|
|
@@ -373,7 +378,11 @@ export class IntegrationToolRegistry {
|
|
|
373
378
|
throw new Error("Integration tool execution cancelled");
|
|
374
379
|
}
|
|
375
380
|
return definition.execute(
|
|
376
|
-
{
|
|
381
|
+
{
|
|
382
|
+
...ctx,
|
|
383
|
+
signal: controller.signal,
|
|
384
|
+
externalWrites: bindExternalWrites(this.writes, ctx.process.id),
|
|
385
|
+
},
|
|
377
386
|
definition.parse?.(args) ?? parseToolArgs(args),
|
|
378
387
|
);
|
|
379
388
|
})
|
|
@@ -86,41 +86,91 @@ function mergeProcessMetadata(
|
|
|
86
86
|
return merge(base ?? {}, patch);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/** @internal */
|
|
89
90
|
export interface StartLaunchRequest {
|
|
91
|
+
/** @internal */
|
|
90
92
|
launcherId: string;
|
|
93
|
+
/** @internal */
|
|
91
94
|
idempotencyKey?: string | null;
|
|
95
|
+
/** @internal */
|
|
92
96
|
request: NormalizedScheduledLaunchInput;
|
|
97
|
+
/** @internal */
|
|
93
98
|
actor: Actor;
|
|
99
|
+
/** @internal */
|
|
94
100
|
processMetadata?: Record<string, unknown>;
|
|
95
101
|
}
|
|
96
102
|
|
|
103
|
+
/** @internal */
|
|
97
104
|
export interface PreparedPlanLaunchRequest {
|
|
105
|
+
/** @internal */
|
|
98
106
|
launchPlan: ProcessLaunchPlan;
|
|
107
|
+
/** @internal */
|
|
99
108
|
idempotencyKey: string;
|
|
109
|
+
/** @internal */
|
|
100
110
|
actor: Actor;
|
|
111
|
+
/** @internal */
|
|
101
112
|
origin: LaunchRun["origin"];
|
|
113
|
+
/** @internal */
|
|
102
114
|
relation?: ProcessLaunchRelationInput;
|
|
103
115
|
}
|
|
104
116
|
|
|
117
|
+
/** @internal */
|
|
105
118
|
export interface LaunchCoordinator {
|
|
106
|
-
|
|
119
|
+
/** @internal */
|
|
120
|
+
start(request: StartLaunchRequest): Promise<{
|
|
121
|
+
/** @internal */
|
|
122
|
+
launchRunId: string;
|
|
123
|
+
}>;
|
|
124
|
+
/** @internal */
|
|
107
125
|
startPreparedPlan(request: PreparedPlanLaunchRequest): Promise<{
|
|
126
|
+
/** @internal */
|
|
108
127
|
launchRunId: string;
|
|
128
|
+
/** @internal */
|
|
109
129
|
process: ProcessInstance | null;
|
|
130
|
+
/** @internal */
|
|
110
131
|
error: string | null;
|
|
111
132
|
}>;
|
|
133
|
+
/** @internal */
|
|
112
134
|
startProgrammatic(
|
|
113
135
|
request: ProgrammaticLaunchRequestLike,
|
|
114
|
-
opts: {
|
|
136
|
+
opts: {
|
|
137
|
+
/** @internal */
|
|
138
|
+
idempotencyKey: string;
|
|
139
|
+
/** @internal */
|
|
140
|
+
actor: Actor;
|
|
141
|
+
},
|
|
115
142
|
): Promise<ProgrammaticLaunchResultLike>;
|
|
143
|
+
/** @internal */
|
|
116
144
|
startWatcher<TConfig, TEvent>(
|
|
117
145
|
watcher: RegisteredProcessWatcherLike<TConfig, TEvent>,
|
|
118
146
|
event: TEvent,
|
|
119
|
-
request: {
|
|
120
|
-
|
|
121
|
-
|
|
147
|
+
request: {
|
|
148
|
+
/** @internal */
|
|
149
|
+
idempotencyKey: string;
|
|
150
|
+
/** @internal */
|
|
151
|
+
actor: Actor;
|
|
152
|
+
},
|
|
153
|
+
): Promise<{
|
|
154
|
+
/** @internal */
|
|
155
|
+
launchRunId: string;
|
|
156
|
+
/** @internal */
|
|
157
|
+
process: ProcessInstance | null;
|
|
158
|
+
/** @internal */
|
|
159
|
+
error: string | null;
|
|
160
|
+
}>;
|
|
161
|
+
/** @internal */
|
|
162
|
+
retryStartup(
|
|
163
|
+
instanceId: string,
|
|
164
|
+
actor: Actor,
|
|
165
|
+
): Promise<{
|
|
166
|
+
/** @internal */
|
|
167
|
+
launchRunId: string;
|
|
168
|
+
}>;
|
|
169
|
+
/** @internal */
|
|
122
170
|
get(launchRunId: string): LaunchRun | null;
|
|
171
|
+
/** @internal */
|
|
123
172
|
refresh(instanceId: string): LaunchRun | null;
|
|
173
|
+
/** @internal */
|
|
124
174
|
reconcileIncomplete(): Promise<void>;
|
|
125
175
|
}
|
|
126
176
|
|
package/src/launch-pipeline.ts
CHANGED
|
@@ -34,63 +34,141 @@ export const STARTUP_STEP_IDS = [
|
|
|
34
34
|
"start_first_turn",
|
|
35
35
|
] as const;
|
|
36
36
|
|
|
37
|
+
/** @internal */
|
|
37
38
|
export type LaunchStageFailure<TFailure> = {
|
|
39
|
+
/** @internal */
|
|
38
40
|
safeSummary: string;
|
|
41
|
+
/** @internal */
|
|
39
42
|
value: TFailure;
|
|
40
43
|
};
|
|
41
44
|
|
|
45
|
+
/** @internal */
|
|
42
46
|
export type LaunchResolution<TResolved, TFailure> =
|
|
43
|
-
| {
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
| {
|
|
48
|
+
/** @internal */
|
|
49
|
+
kind: "resolved";
|
|
50
|
+
/** @internal */
|
|
51
|
+
value: TResolved;
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
/** @internal */
|
|
55
|
+
kind: "skipped";
|
|
56
|
+
}
|
|
57
|
+
| {
|
|
58
|
+
/** @internal */
|
|
59
|
+
kind: "failed";
|
|
60
|
+
/** @internal */
|
|
61
|
+
failure: LaunchStageFailure<TFailure>;
|
|
62
|
+
};
|
|
46
63
|
|
|
64
|
+
/** @internal */
|
|
47
65
|
export interface LaunchPipelineCheck {
|
|
66
|
+
/** @internal */
|
|
48
67
|
id: string;
|
|
68
|
+
/** @internal */
|
|
49
69
|
label: string;
|
|
70
|
+
/** @internal */
|
|
50
71
|
run(input: {
|
|
72
|
+
/** @internal */
|
|
51
73
|
signal: AbortSignal;
|
|
52
|
-
|
|
74
|
+
/** @internal */
|
|
75
|
+
logger: {
|
|
76
|
+
/** @internal */
|
|
77
|
+
info(message: string): void;
|
|
78
|
+
/** @internal */
|
|
79
|
+
warn(message: string): void;
|
|
80
|
+
};
|
|
53
81
|
}): Promise<void>;
|
|
54
82
|
}
|
|
55
83
|
|
|
84
|
+
/** @internal */
|
|
56
85
|
export type LaunchCommit<TResult, TFailure> =
|
|
57
86
|
| {
|
|
87
|
+
/** @internal */
|
|
58
88
|
kind: "committed";
|
|
89
|
+
/** @internal */
|
|
59
90
|
result: TResult;
|
|
91
|
+
/** @internal */
|
|
60
92
|
process: ProcessInstance;
|
|
93
|
+
/** @internal */
|
|
61
94
|
startTurnId: string | null;
|
|
95
|
+
/** @internal */
|
|
62
96
|
reused: boolean;
|
|
63
97
|
}
|
|
64
98
|
| {
|
|
99
|
+
/** @internal */
|
|
65
100
|
kind: "committed_with_reaction_error";
|
|
101
|
+
/** @internal */
|
|
66
102
|
result: TResult;
|
|
103
|
+
/** @internal */
|
|
67
104
|
process: ProcessInstance;
|
|
105
|
+
/** @internal */
|
|
68
106
|
startTurnId: string | null;
|
|
107
|
+
/** @internal */
|
|
69
108
|
safeSummary: string;
|
|
70
109
|
}
|
|
71
|
-
| {
|
|
110
|
+
| {
|
|
111
|
+
/** @internal */
|
|
112
|
+
kind: "failed";
|
|
113
|
+
/** @internal */
|
|
114
|
+
failure: LaunchStageFailure<TFailure>;
|
|
115
|
+
};
|
|
72
116
|
|
|
117
|
+
/** @internal */
|
|
73
118
|
export interface LaunchAdapter<TResolved, TPrepared, TResult, TFailure> {
|
|
119
|
+
/** @internal */
|
|
74
120
|
resolve(): Promise<LaunchResolution<TResolved, TFailure>>;
|
|
121
|
+
/** @internal */
|
|
75
122
|
preparationChecks?(resolved: TResolved): readonly LaunchPipelineCheck[];
|
|
123
|
+
/** @internal */
|
|
76
124
|
preparationCheckFailure?(error: unknown, safeSummary: string): TFailure;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
125
|
+
/** @internal */
|
|
126
|
+
prepare(resolved: TResolved): Promise<
|
|
127
|
+
| {
|
|
128
|
+
/** @internal */
|
|
129
|
+
ok: true;
|
|
130
|
+
/** @internal */
|
|
131
|
+
value: TPrepared;
|
|
132
|
+
}
|
|
133
|
+
| {
|
|
134
|
+
/** @internal */
|
|
135
|
+
ok: false;
|
|
136
|
+
/** @internal */
|
|
137
|
+
failure: LaunchStageFailure<TFailure>;
|
|
138
|
+
}
|
|
139
|
+
>;
|
|
140
|
+
/** @internal */
|
|
80
141
|
commit(
|
|
81
142
|
prepared: TPrepared,
|
|
82
|
-
ctx: {
|
|
143
|
+
ctx: {
|
|
144
|
+
/** @internal */
|
|
145
|
+
launchRunId: string;
|
|
146
|
+
},
|
|
83
147
|
): Promise<LaunchCommit<TResult, TFailure>>;
|
|
148
|
+
/** @internal */
|
|
84
149
|
unexpectedFailure?(error: unknown): LaunchStageFailure<TFailure>;
|
|
85
150
|
}
|
|
86
151
|
|
|
152
|
+
/** @internal */
|
|
87
153
|
export type LaunchPipelineRunResult<TResult, TFailure> =
|
|
88
|
-
| { kind: "skipped" }
|
|
89
|
-
| { kind: "failed"; failure: LaunchStageFailure<TFailure> }
|
|
90
154
|
| {
|
|
155
|
+
/** @internal */
|
|
156
|
+
kind: "skipped";
|
|
157
|
+
}
|
|
158
|
+
| {
|
|
159
|
+
/** @internal */
|
|
160
|
+
kind: "failed";
|
|
161
|
+
/** @internal */
|
|
162
|
+
failure: LaunchStageFailure<TFailure>;
|
|
163
|
+
}
|
|
164
|
+
| {
|
|
165
|
+
/** @internal */
|
|
91
166
|
kind: "committed" | "committed_with_reaction_error";
|
|
167
|
+
/** @internal */
|
|
92
168
|
result: TResult;
|
|
169
|
+
/** @internal */
|
|
93
170
|
process: ProcessInstance;
|
|
171
|
+
/** @internal */
|
|
94
172
|
reused: boolean;
|
|
95
173
|
};
|
|
96
174
|
|
|
@@ -113,14 +191,27 @@ export function presentPipelineResult<TResult, TFailure>(
|
|
|
113
191
|
};
|
|
114
192
|
}
|
|
115
193
|
|
|
194
|
+
/** @internal */
|
|
116
195
|
export interface LaunchPipeline {
|
|
196
|
+
/** @internal */
|
|
117
197
|
open(input: {
|
|
198
|
+
/** @internal */
|
|
118
199
|
launcherId: string | null;
|
|
200
|
+
/** @internal */
|
|
119
201
|
idempotencyKey?: string | null;
|
|
202
|
+
/** @internal */
|
|
120
203
|
origin: LaunchRun["origin"];
|
|
204
|
+
/** @internal */
|
|
121
205
|
broadcast?: boolean;
|
|
122
|
-
}): {
|
|
206
|
+
}): {
|
|
207
|
+
/** @internal */
|
|
208
|
+
launchRunId: string;
|
|
209
|
+
/** @internal */
|
|
210
|
+
existing: boolean;
|
|
211
|
+
};
|
|
212
|
+
/** @internal */
|
|
123
213
|
update(id: string, fn: (run: LaunchRun) => LaunchRun): LaunchRun;
|
|
214
|
+
/** @internal */
|
|
124
215
|
run<TResolved, TPrepared, TResult, TFailure>(
|
|
125
216
|
launchRunId: string,
|
|
126
217
|
adapter: LaunchAdapter<TResolved, TPrepared, TResult, TFailure>,
|
|
@@ -9,8 +9,11 @@ import {
|
|
|
9
9
|
} from "@leitwerk-dev/process-sdk";
|
|
10
10
|
import type { RepositoryBundle } from "./db/repositories.js";
|
|
11
11
|
|
|
12
|
+
/** @internal */
|
|
12
13
|
export interface LauncherRecentValuesService {
|
|
14
|
+
/** @internal */
|
|
13
15
|
list(launcherId: string): Record<string, readonly string[]>;
|
|
16
|
+
/** @internal */
|
|
14
17
|
record(launcherId: string, launcherInput: Record<string, unknown>): void;
|
|
15
18
|
}
|
|
16
19
|
|
package/src/main.ts
CHANGED
|
@@ -69,8 +69,7 @@ async function shutdown(signal: keyof typeof SIGNAL_EXIT_CODES) {
|
|
|
69
69
|
}
|
|
70
70
|
shuttingDown = true;
|
|
71
71
|
try {
|
|
72
|
-
await ctx.
|
|
73
|
-
await ctx.app.close();
|
|
72
|
+
await ctx.close();
|
|
74
73
|
process.exit(SIGNAL_EXIT_CODES[signal]);
|
|
75
74
|
} catch (error) {
|
|
76
75
|
ctx.app.log.error(error);
|
|
@@ -86,17 +85,11 @@ process.once("SIGTERM", () => {
|
|
|
86
85
|
});
|
|
87
86
|
|
|
88
87
|
try {
|
|
89
|
-
|
|
90
|
-
await ctx.app.listen({ host: runtimeServer.host, port: runtimeServer.port });
|
|
91
|
-
ctx.app.log.info(
|
|
92
|
-
{ listenDurationMs: Math.round((performance.now() - listenStartedAt) * 10) / 10 },
|
|
93
|
-
"Server HTTP listener ready",
|
|
94
|
-
);
|
|
95
|
-
await ctx.startBackgroundServices();
|
|
88
|
+
await ctx.listen({ host: runtimeServer.host, port: runtimeServer.port });
|
|
96
89
|
} catch (err) {
|
|
97
90
|
ctx.app.log.error(err);
|
|
98
91
|
try {
|
|
99
|
-
await ctx.
|
|
92
|
+
await ctx.close();
|
|
100
93
|
} catch (closeError) {
|
|
101
94
|
ctx.app.log.error(closeError);
|
|
102
95
|
}
|
|
@@ -51,6 +51,7 @@ function configuredModel(
|
|
|
51
51
|
* Direct, server-only Pi AI adapter. It never reads PI_CODING_AGENT_DIR or an
|
|
52
52
|
* ambient auth file; the current credential revision is supplied per call.
|
|
53
53
|
*/
|
|
54
|
+
/** @internal */
|
|
54
55
|
export function createBuiltinPiServerAdapter(builtinProviderId: string): PiServerAdapter {
|
|
55
56
|
return definePiServerAdapter({
|
|
56
57
|
async generateText(input) {
|