@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
package/src/db/skill-repo.ts
CHANGED
|
@@ -202,7 +202,9 @@ function activateSkill(
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
function catalogView(db: LeitwerkDb): {
|
|
205
|
+
/** @internal */
|
|
205
206
|
availableSkills: SkillCatalogItem[];
|
|
207
|
+
/** @internal */
|
|
206
208
|
installedSkills: InstalledSkillCatalogItem[];
|
|
207
209
|
} {
|
|
208
210
|
const candidates = db.select().from(skillCatalogEntries).all();
|
|
@@ -279,8 +281,10 @@ function catalogView(db: LeitwerkDb): {
|
|
|
279
281
|
return { availableSkills, installedSkills };
|
|
280
282
|
}
|
|
281
283
|
|
|
284
|
+
/** @internal */
|
|
282
285
|
export function createSkillRepo(db: LeitwerkDb) {
|
|
283
286
|
return {
|
|
287
|
+
/** @internal */
|
|
284
288
|
listAvailable(): SkillOptionSummary[] {
|
|
285
289
|
return db
|
|
286
290
|
.select({ id: skills.id, label: skills.label, description: skills.description })
|
|
@@ -289,6 +293,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
289
293
|
.orderBy(asc(skills.label), asc(skills.id))
|
|
290
294
|
.all();
|
|
291
295
|
},
|
|
296
|
+
/** @internal */
|
|
292
297
|
resolveActive(ids: readonly string[]): SkillSelection[] {
|
|
293
298
|
const activeSkills = db
|
|
294
299
|
.select({ id: skills.id, revisionId: skillRevisions.id })
|
|
@@ -318,6 +323,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
318
323
|
for (const id of ids) add(id);
|
|
319
324
|
return [...resolved.values()];
|
|
320
325
|
},
|
|
326
|
+
/** @internal */
|
|
321
327
|
reconcile(imported: readonly ImportedSkill[]): void {
|
|
322
328
|
const timestamp = now();
|
|
323
329
|
db.update(skills)
|
|
@@ -334,6 +340,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
334
340
|
.run();
|
|
335
341
|
for (const item of imported) activateSkill(db, item, "configuration", timestamp);
|
|
336
342
|
},
|
|
343
|
+
/** @internal */
|
|
337
344
|
backfillDependencies(): void {
|
|
338
345
|
for (const revision of db.select().from(skillRevisions).all()) {
|
|
339
346
|
recordRevisionDependencies(
|
|
@@ -343,6 +350,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
343
350
|
);
|
|
344
351
|
}
|
|
345
352
|
},
|
|
353
|
+
/** @internal */
|
|
346
354
|
markUnconfiguredCatalogEntries(configuredRepositoryIds: readonly string[]): void {
|
|
347
355
|
db.update(skillCatalogEntries)
|
|
348
356
|
.set({ available: false })
|
|
@@ -350,6 +358,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
350
358
|
.run();
|
|
351
359
|
pruneNeverInstalledCatalogEntries(db);
|
|
352
360
|
},
|
|
361
|
+
/** @internal */
|
|
353
362
|
mergeCatalog(repositoryId: string, imported: readonly ImportedRepositorySkill[]): void {
|
|
354
363
|
const timestamp = now();
|
|
355
364
|
db.update(skillCatalogEntries)
|
|
@@ -377,6 +386,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
377
386
|
}
|
|
378
387
|
pruneNeverInstalledCatalogEntries(db);
|
|
379
388
|
},
|
|
389
|
+
/** @internal */
|
|
380
390
|
registerCatalogEntry(repositoryId: string, skillId: string): string {
|
|
381
391
|
const candidates = db
|
|
382
392
|
.select()
|
|
@@ -445,6 +455,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
445
455
|
throw new Error(`Remote skill '${repositoryId}/${skillId}' was not installed`);
|
|
446
456
|
return revisionId;
|
|
447
457
|
},
|
|
458
|
+
/** @internal */
|
|
448
459
|
remove(skillId: string): boolean {
|
|
449
460
|
const current = db.select().from(skills).where(eq(skills.id, skillId)).get();
|
|
450
461
|
if (!current?.activeRevisionId || current.registrationKind !== "catalog") return false;
|
|
@@ -454,9 +465,11 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
454
465
|
.run();
|
|
455
466
|
return true;
|
|
456
467
|
},
|
|
468
|
+
/** @internal */
|
|
457
469
|
catalog() {
|
|
458
470
|
return catalogView(db);
|
|
459
471
|
},
|
|
472
|
+
/** @internal */
|
|
460
473
|
getCatalogDetail(repositoryId: string, skillId: string): SkillCatalogDetail | null {
|
|
461
474
|
const item = catalogView(db).availableSkills.find(
|
|
462
475
|
(candidate) => candidate.repositoryId === repositoryId && candidate.id === skillId,
|
|
@@ -482,6 +495,7 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
482
495
|
processes: processUsage(db, skillId),
|
|
483
496
|
};
|
|
484
497
|
},
|
|
498
|
+
/** @internal */
|
|
485
499
|
getInstalledDetail(skillId: string): InstalledSkillCatalogDetail | null {
|
|
486
500
|
const item = catalogView(db).installedSkills.find((candidate) => candidate.id === skillId);
|
|
487
501
|
if (!item) return null;
|
|
@@ -512,10 +526,19 @@ export function createSkillRepo(db: LeitwerkDb) {
|
|
|
512
526
|
revisions,
|
|
513
527
|
};
|
|
514
528
|
},
|
|
529
|
+
/** @internal */
|
|
515
530
|
recordInvocations(input: {
|
|
531
|
+
/** @internal */
|
|
516
532
|
instanceId: string;
|
|
533
|
+
/** @internal */
|
|
517
534
|
turnRecordId: string;
|
|
518
|
-
|
|
535
|
+
/** @internal */
|
|
536
|
+
invocations: readonly {
|
|
537
|
+
/** @internal */
|
|
538
|
+
skillId: string;
|
|
539
|
+
/** @internal */
|
|
540
|
+
invokedAt: string;
|
|
541
|
+
}[];
|
|
519
542
|
}): void {
|
|
520
543
|
const selections = db
|
|
521
544
|
.select()
|
|
@@ -2,8 +2,10 @@ import type { StartupObservation } from "@leitwerk-dev/domain";
|
|
|
2
2
|
import { eq } from "drizzle-orm";
|
|
3
3
|
import type { LeitwerkDb } from "./database.js";
|
|
4
4
|
import * as s from "./schema.js";
|
|
5
|
+
/** @internal */
|
|
5
6
|
export function createStartupObservationRepo(db: LeitwerkDb) {
|
|
6
7
|
return {
|
|
8
|
+
/** @internal */
|
|
7
9
|
record(observation: StartupObservation): boolean {
|
|
8
10
|
if (
|
|
9
11
|
!Number.isFinite(Date.parse(observation.observedAt)) ||
|
|
@@ -28,6 +30,7 @@ export function createStartupObservationRepo(db: LeitwerkDb) {
|
|
|
28
30
|
.run().changes > 0
|
|
29
31
|
);
|
|
30
32
|
},
|
|
33
|
+
/** @internal */
|
|
31
34
|
listByLease(workerLeaseId: string): StartupObservation[] {
|
|
32
35
|
return db
|
|
33
36
|
.select()
|
|
@@ -3,12 +3,19 @@ import type { LeitwerkDb } from "./database.js";
|
|
|
3
3
|
import { generateId, now } from "./repo-helpers.js";
|
|
4
4
|
import * as s from "./schema.js";
|
|
5
5
|
|
|
6
|
+
/** @internal */
|
|
6
7
|
export interface TicketDestinationRecent {
|
|
8
|
+
/** @internal */
|
|
7
9
|
id: string;
|
|
10
|
+
/** @internal */
|
|
8
11
|
actorKey: string;
|
|
12
|
+
/** @internal */
|
|
9
13
|
toolName: string;
|
|
14
|
+
/** @internal */
|
|
10
15
|
destinationId: string;
|
|
16
|
+
/** @internal */
|
|
11
17
|
createdAt: string;
|
|
18
|
+
/** @internal */
|
|
12
19
|
updatedAt: string;
|
|
13
20
|
}
|
|
14
21
|
|
|
@@ -16,8 +23,10 @@ function map(row: typeof s.ticketDestinationRecents.$inferSelect): TicketDestina
|
|
|
16
23
|
return { ...row };
|
|
17
24
|
}
|
|
18
25
|
|
|
26
|
+
/** @internal */
|
|
19
27
|
export function createTicketDestinationRecentRepo(db: LeitwerkDb) {
|
|
20
28
|
return {
|
|
29
|
+
/** @internal */
|
|
21
30
|
list(actorKey: string, toolName: string, limit = 5): TicketDestinationRecent[] {
|
|
22
31
|
return db
|
|
23
32
|
.select()
|
|
@@ -37,10 +46,15 @@ export function createTicketDestinationRecentRepo(db: LeitwerkDb) {
|
|
|
37
46
|
.map(map);
|
|
38
47
|
},
|
|
39
48
|
|
|
49
|
+
/** @internal */
|
|
40
50
|
record(input: {
|
|
51
|
+
/** @internal */
|
|
41
52
|
actorKey: string;
|
|
53
|
+
/** @internal */
|
|
42
54
|
toolName: string;
|
|
55
|
+
/** @internal */
|
|
43
56
|
destinationId: string;
|
|
57
|
+
/** @internal */
|
|
44
58
|
limit?: number;
|
|
45
59
|
}): TicketDestinationRecent {
|
|
46
60
|
const match = and(
|
|
@@ -27,10 +27,15 @@ function map(row: typeof s.turnStartRecords.$inferSelect): TurnStartRecord {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/** @internal */
|
|
30
31
|
export function createTurnStartRecordRepo(db: LeitwerkDb) {
|
|
31
32
|
return {
|
|
33
|
+
/** @internal */
|
|
32
34
|
create(
|
|
33
|
-
input: Omit<TurnStartRecord, "id" | "createdAt" | "updatedAt"> & {
|
|
35
|
+
input: Omit<TurnStartRecord, "id" | "createdAt" | "updatedAt"> & {
|
|
36
|
+
/** @internal */
|
|
37
|
+
id?: string;
|
|
38
|
+
},
|
|
34
39
|
): TurnStartRecord {
|
|
35
40
|
const ts = now();
|
|
36
41
|
const id = input.id ?? generateId("tsr");
|
|
@@ -50,10 +55,12 @@ export function createTurnStartRecordRepo(db: LeitwerkDb) {
|
|
|
50
55
|
db.insert(s.turnStartRecords).values(value).run();
|
|
51
56
|
return map(value);
|
|
52
57
|
},
|
|
58
|
+
/** @internal */
|
|
53
59
|
getById(id: string): TurnStartRecord | null {
|
|
54
60
|
const value = db.select().from(s.turnStartRecords).where(eq(s.turnStartRecords.id, id)).get();
|
|
55
61
|
return value ? map(value) : null;
|
|
56
62
|
},
|
|
63
|
+
/** @internal */
|
|
57
64
|
listByInstance(instanceId: string): TurnStartRecord[] {
|
|
58
65
|
return db
|
|
59
66
|
.select()
|
|
@@ -62,9 +69,13 @@ export function createTurnStartRecordRepo(db: LeitwerkDb) {
|
|
|
62
69
|
.all()
|
|
63
70
|
.map(map);
|
|
64
71
|
},
|
|
72
|
+
/** @internal */
|
|
65
73
|
compareAndSetState(input: {
|
|
74
|
+
/** @internal */
|
|
66
75
|
id: string;
|
|
76
|
+
/** @internal */
|
|
67
77
|
expectedKind: TurnStartRecordState["kind"];
|
|
78
|
+
/** @internal */
|
|
68
79
|
state: TurnStartRecordState;
|
|
69
80
|
}): TurnStartRecord | null {
|
|
70
81
|
const current = this.getById(input.id);
|
|
@@ -7,20 +7,42 @@ import { eq } from "drizzle-orm";
|
|
|
7
7
|
import type { LeitwerkDb } from "./database.js";
|
|
8
8
|
import { sessionSummaries, turnSummaries } from "./schema.js";
|
|
9
9
|
|
|
10
|
+
/** @internal */
|
|
10
11
|
export interface SessionSummary {
|
|
12
|
+
/** @internal */
|
|
11
13
|
signature: string | null;
|
|
14
|
+
/** @internal */
|
|
12
15
|
leafId: string | null;
|
|
16
|
+
/** @internal */
|
|
13
17
|
primaryPath: Pick<
|
|
14
18
|
PrimaryPathUiSnapshot,
|
|
15
19
|
"currentLeaf" | "semanticEntryRefs" | "entryCount" | "turnAnnotations"
|
|
16
20
|
>;
|
|
17
|
-
|
|
21
|
+
/** @internal */
|
|
22
|
+
prompt: {
|
|
23
|
+
/** @internal */
|
|
24
|
+
text: string | null;
|
|
25
|
+
/** @internal */
|
|
26
|
+
createdAt: string | null;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
18
29
|
tracePreviewsByTurnRecordId: Record<string, TurnTracePreview>;
|
|
19
|
-
|
|
30
|
+
/** @internal */
|
|
31
|
+
continuationByTurnRecordId: Record<
|
|
32
|
+
string,
|
|
33
|
+
{
|
|
34
|
+
/** @internal */
|
|
35
|
+
hasProgress: boolean;
|
|
36
|
+
/** @internal */
|
|
37
|
+
userPrompt: string | null;
|
|
38
|
+
}
|
|
39
|
+
>;
|
|
20
40
|
}
|
|
21
41
|
|
|
42
|
+
/** @internal */
|
|
22
43
|
export function createTurnSummaryRepo(db: LeitwerkDb) {
|
|
23
44
|
return {
|
|
45
|
+
/** @internal */
|
|
24
46
|
get(turnRecordId: string): CompactTurnSummary | null {
|
|
25
47
|
const row = db
|
|
26
48
|
.select()
|
|
@@ -29,6 +51,7 @@ export function createTurnSummaryRepo(db: LeitwerkDb) {
|
|
|
29
51
|
.get();
|
|
30
52
|
return row ? (JSON.parse(row.summaryJson) as CompactTurnSummary) : null;
|
|
31
53
|
},
|
|
54
|
+
/** @internal */
|
|
32
55
|
put(instanceId: string, turnRecordId: string, summary: CompactTurnSummary) {
|
|
33
56
|
const summaryJson = JSON.stringify(summary);
|
|
34
57
|
db.insert(turnSummaries)
|
|
@@ -36,6 +59,7 @@ export function createTurnSummaryRepo(db: LeitwerkDb) {
|
|
|
36
59
|
.onConflictDoUpdate({ target: turnSummaries.turnRecordId, set: { summaryJson } })
|
|
37
60
|
.run();
|
|
38
61
|
},
|
|
62
|
+
/** @internal */
|
|
39
63
|
listByInstance(instanceId: string): Record<string, CompactTurnSummary> {
|
|
40
64
|
return Object.fromEntries(
|
|
41
65
|
db
|
|
@@ -46,6 +70,7 @@ export function createTurnSummaryRepo(db: LeitwerkDb) {
|
|
|
46
70
|
.map((row) => [row.turnRecordId, JSON.parse(row.summaryJson) as CompactTurnSummary]),
|
|
47
71
|
);
|
|
48
72
|
},
|
|
73
|
+
/** @internal */
|
|
49
74
|
getSession(instanceId: string): SessionSummary | null {
|
|
50
75
|
const row = db
|
|
51
76
|
.select()
|
|
@@ -54,6 +79,7 @@ export function createTurnSummaryRepo(db: LeitwerkDb) {
|
|
|
54
79
|
.get();
|
|
55
80
|
return row ? (JSON.parse(row.summaryJson) as SessionSummary) : null;
|
|
56
81
|
},
|
|
82
|
+
/** @internal */
|
|
57
83
|
putSession(instanceId: string, summary: SessionSummary) {
|
|
58
84
|
const summaryJson = JSON.stringify(summary);
|
|
59
85
|
db.insert(sessionSummaries)
|
|
@@ -61,6 +87,7 @@ export function createTurnSummaryRepo(db: LeitwerkDb) {
|
|
|
61
87
|
.onConflictDoUpdate({ target: sessionSummaries.instanceId, set: { summaryJson } })
|
|
62
88
|
.run();
|
|
63
89
|
},
|
|
90
|
+
/** @internal */
|
|
64
91
|
deleteSession(instanceId: string) {
|
|
65
92
|
db.delete(sessionSummaries).where(eq(sessionSummaries.instanceId, instanceId)).run();
|
|
66
93
|
},
|
|
@@ -5,28 +5,49 @@ import type { LeitwerkDb } from "./database.js";
|
|
|
5
5
|
import { generateId, now } from "./repo-helpers.js";
|
|
6
6
|
import * as s from "./schema.js";
|
|
7
7
|
|
|
8
|
+
/** @internal */
|
|
8
9
|
export interface CreateWorkerLeaseInput {
|
|
10
|
+
/** @internal */
|
|
9
11
|
instanceId: string;
|
|
12
|
+
/** @internal */
|
|
10
13
|
workerId: string;
|
|
14
|
+
/** @internal */
|
|
11
15
|
state: WorkerState;
|
|
16
|
+
/** @internal */
|
|
12
17
|
serverEpoch?: string | null;
|
|
18
|
+
/** @internal */
|
|
13
19
|
connectTokenHash?: string | null;
|
|
20
|
+
/** @internal */
|
|
14
21
|
snapshotTokenHash?: string | null;
|
|
22
|
+
/** @internal */
|
|
15
23
|
modelPolicyFingerprint?: string | null;
|
|
24
|
+
/** @internal */
|
|
16
25
|
bootstrapReceipt?: WorkerBootstrapReceipt | null;
|
|
26
|
+
/** @internal */
|
|
17
27
|
turnStartRecordId?: string | null;
|
|
18
28
|
}
|
|
19
29
|
|
|
30
|
+
/** @internal */
|
|
20
31
|
export interface UpdateWorkerLeaseInput {
|
|
32
|
+
/** @internal */
|
|
21
33
|
state?: WorkerState;
|
|
34
|
+
/** @internal */
|
|
22
35
|
serverEpoch?: string | null;
|
|
36
|
+
/** @internal */
|
|
23
37
|
connectTokenHash?: string | null;
|
|
38
|
+
/** @internal */
|
|
24
39
|
snapshotTokenHash?: string | null;
|
|
40
|
+
/** @internal */
|
|
25
41
|
modelPolicyFingerprint?: string | null;
|
|
42
|
+
/** @internal */
|
|
26
43
|
lastHeartbeatAt?: string | null;
|
|
44
|
+
/** @internal */
|
|
27
45
|
connectedAt?: string | null;
|
|
46
|
+
/** @internal */
|
|
28
47
|
workspacePreparationStartedAt?: string | null;
|
|
48
|
+
/** @internal */
|
|
29
49
|
readyAt?: string | null;
|
|
50
|
+
/** @internal */
|
|
30
51
|
exitedAt?: string | null;
|
|
31
52
|
}
|
|
32
53
|
|
|
@@ -53,8 +74,10 @@ function rowToWorkerLease(row: typeof s.workerLeases.$inferSelect): WorkerLease
|
|
|
53
74
|
};
|
|
54
75
|
}
|
|
55
76
|
|
|
77
|
+
/** @internal */
|
|
56
78
|
export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
57
79
|
return {
|
|
80
|
+
/** @internal */
|
|
58
81
|
create(input: CreateWorkerLeaseInput): WorkerLease {
|
|
59
82
|
const id = generateId("wls");
|
|
60
83
|
const ts = now();
|
|
@@ -80,6 +103,7 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
80
103
|
return rowToWorkerLease(values);
|
|
81
104
|
},
|
|
82
105
|
|
|
106
|
+
/** @internal */
|
|
83
107
|
getByInstance(instanceId: string): WorkerLease | null {
|
|
84
108
|
const row = db
|
|
85
109
|
.select()
|
|
@@ -89,11 +113,13 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
89
113
|
return row ? rowToWorkerLease(row) : null;
|
|
90
114
|
},
|
|
91
115
|
|
|
116
|
+
/** @internal */
|
|
92
117
|
getById(id: string): WorkerLease | null {
|
|
93
118
|
const row = db.select().from(s.workerLeases).where(eq(s.workerLeases.id, id)).get();
|
|
94
119
|
return row ? rowToWorkerLease(row) : null;
|
|
95
120
|
},
|
|
96
121
|
|
|
122
|
+
/** @internal */
|
|
97
123
|
listByInstance(instanceId: string): WorkerLease[] {
|
|
98
124
|
return db
|
|
99
125
|
.select()
|
|
@@ -104,6 +130,7 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
104
130
|
.map(rowToWorkerLease);
|
|
105
131
|
},
|
|
106
132
|
|
|
133
|
+
/** @internal */
|
|
107
134
|
listActive(): WorkerLease[] {
|
|
108
135
|
return db
|
|
109
136
|
.select()
|
|
@@ -113,6 +140,7 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
113
140
|
.map(rowToWorkerLease);
|
|
114
141
|
},
|
|
115
142
|
|
|
143
|
+
/** @internal */
|
|
116
144
|
update(id: string, input: UpdateWorkerLeaseInput): WorkerLease | null {
|
|
117
145
|
const setValues: SQLiteUpdateSetSource<typeof s.workerLeases> = {
|
|
118
146
|
state: input.state,
|
|
@@ -132,6 +160,7 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
132
160
|
return row ? rowToWorkerLease(row) : null;
|
|
133
161
|
},
|
|
134
162
|
|
|
163
|
+
/** @internal */
|
|
135
164
|
observeTimestamp(
|
|
136
165
|
id: string,
|
|
137
166
|
field: "connectedAt" | "workspacePreparationStartedAt" | "readyAt",
|
|
@@ -144,6 +173,7 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
144
173
|
return this.getById(id);
|
|
145
174
|
},
|
|
146
175
|
|
|
176
|
+
/** @internal */
|
|
147
177
|
updateHeartbeat(workerId: string): boolean {
|
|
148
178
|
const result = db
|
|
149
179
|
.update(s.workerLeases)
|
|
@@ -153,7 +183,7 @@ export function createWorkerLeaseRepo(db: LeitwerkDb) {
|
|
|
153
183
|
return result.changes > 0;
|
|
154
184
|
},
|
|
155
185
|
|
|
156
|
-
/** Stores the first receipt only. Exact replay is accepted; changed receipts are rejected. */
|
|
186
|
+
/** Stores the first receipt only. Exact replay is accepted; changed receipts are rejected. @internal */
|
|
157
187
|
compareAndSetBootstrapReceipt(
|
|
158
188
|
id: string,
|
|
159
189
|
receipt: WorkerBootstrapReceipt,
|
|
@@ -12,8 +12,10 @@ import {
|
|
|
12
12
|
} from "../process-engine/writes/deferred-extension-events.js";
|
|
13
13
|
import type { WorkerIntent } from "../process-engine/writes/writes.js";
|
|
14
14
|
|
|
15
|
+
/** @internal */
|
|
15
16
|
export interface WorkerReconcileEffectChange extends ProcessTurnSelectionChange {}
|
|
16
17
|
|
|
18
|
+
/** @internal */
|
|
17
19
|
export type FutureExecutionUpdatedOperation = "created" | "updated" | "deleted";
|
|
18
20
|
|
|
19
21
|
export function buildExtensionEventEffect<K extends ServerExtensionEventName>(
|
|
@@ -27,36 +29,73 @@ export function buildExtensionEventEffect<K extends ServerExtensionEventName>(
|
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
/** @internal */
|
|
30
33
|
export type PostCommitEffect =
|
|
31
|
-
| { kind: "broadcast"; frame: DurableWsFrameInput }
|
|
32
34
|
| {
|
|
35
|
+
/** @internal */
|
|
36
|
+
kind: "broadcast";
|
|
37
|
+
/** @internal */
|
|
38
|
+
frame: DurableWsFrameInput;
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
/** @internal */
|
|
33
42
|
kind: "future_execution_updated";
|
|
43
|
+
/** @internal */
|
|
34
44
|
futureExecution: Pick<FutureExecution, "id" | "kind" | "instanceId">;
|
|
45
|
+
/** @internal */
|
|
35
46
|
operation: FutureExecutionUpdatedOperation;
|
|
36
47
|
}
|
|
37
48
|
| {
|
|
49
|
+
/** @internal */
|
|
38
50
|
kind: "dispatch_inputs";
|
|
51
|
+
/** @internal */
|
|
39
52
|
instanceId: string;
|
|
53
|
+
/** @internal */
|
|
40
54
|
inputs: ProcessInput[];
|
|
55
|
+
/** @internal */
|
|
41
56
|
spawnIfMissing: boolean;
|
|
42
57
|
}
|
|
43
|
-
| { kind: "worker"; instanceId: string; effect: WorkerIntent }
|
|
44
58
|
| {
|
|
59
|
+
/** @internal */
|
|
60
|
+
kind: "worker";
|
|
61
|
+
/** @internal */
|
|
62
|
+
instanceId: string;
|
|
63
|
+
/** @internal */
|
|
64
|
+
effect: WorkerIntent;
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
/** @internal */
|
|
45
68
|
kind: "worker_reconcile";
|
|
69
|
+
/** @internal */
|
|
46
70
|
instanceId: string;
|
|
71
|
+
/** @internal */
|
|
47
72
|
processId: string;
|
|
73
|
+
/** @internal */
|
|
48
74
|
change: WorkerReconcileEffectChange;
|
|
49
75
|
}
|
|
50
|
-
| { kind: "extension_event"; event: DeferredProcessExtensionEvent }
|
|
51
76
|
| {
|
|
77
|
+
/** @internal */
|
|
78
|
+
kind: "extension_event";
|
|
79
|
+
/** @internal */
|
|
80
|
+
event: DeferredProcessExtensionEvent;
|
|
81
|
+
}
|
|
82
|
+
| {
|
|
83
|
+
/** @internal */
|
|
52
84
|
kind: "queue_process_title";
|
|
85
|
+
/** @internal */
|
|
53
86
|
processId: string;
|
|
87
|
+
/** @internal */
|
|
54
88
|
launchPlan: ProcessLaunchPlan;
|
|
89
|
+
/** @internal */
|
|
55
90
|
launchRunId?: string;
|
|
56
91
|
}
|
|
57
92
|
| {
|
|
93
|
+
/** @internal */
|
|
58
94
|
kind: "queue_future_execution_title";
|
|
95
|
+
/** @internal */
|
|
59
96
|
futureExecutionId: string;
|
|
97
|
+
/** @internal */
|
|
60
98
|
launchPlan: ProcessLaunchPlan;
|
|
99
|
+
/** @internal */
|
|
61
100
|
expectedPayloadJson?: string;
|
|
62
101
|
};
|
|
@@ -19,6 +19,7 @@ import type { WorkerSupervisor } from "../supervisor/worker-supervisor.js";
|
|
|
19
19
|
import type { Broadcaster } from "../ws/broadcast.js";
|
|
20
20
|
import type { PostCommitEffect } from "./post-commit-effect.js";
|
|
21
21
|
|
|
22
|
+
/** @internal */
|
|
22
23
|
export type PostCommitEffectFailureCode =
|
|
23
24
|
| "input_dispatch_failed"
|
|
24
25
|
| "worker_reconcile_failed"
|
package/src/entry-ref-patch.ts
CHANGED
|
@@ -8,9 +8,17 @@ import {
|
|
|
8
8
|
type SemanticEntryRef,
|
|
9
9
|
} from "@leitwerk-dev/domain";
|
|
10
10
|
|
|
11
|
+
/** @internal */
|
|
11
12
|
export type EntryRefPatch = Record<
|
|
12
13
|
string,
|
|
13
|
-
|
|
14
|
+
| {
|
|
15
|
+
/** @internal */
|
|
16
|
+
entryId: string;
|
|
17
|
+
/** @internal */
|
|
18
|
+
turnRecordId?: string | null;
|
|
19
|
+
}
|
|
20
|
+
| null
|
|
21
|
+
| undefined
|
|
14
22
|
>;
|
|
15
23
|
|
|
16
24
|
export function mergeEntryRefPatchIntoStateJson(
|
|
@@ -40,19 +40,29 @@ interface RawExtensionUiBrowserModuleManifestEntry {
|
|
|
40
40
|
browserApiVersion?: unknown;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/** @internal */
|
|
43
44
|
export type ExtensionUiRendererDescriptor = Omit<LeafOutcomeRendererDescriptor, "ok" | "moduleUrl">;
|
|
45
|
+
/** @internal */
|
|
44
46
|
export type ExtensionUiRendererLookup = Omit<LeafOutcomeRendererDescriptor, "ok">;
|
|
45
47
|
export type ExtensionUiBrowserModuleDescriptor = Omit<BrowserUiExtensionDescriptor, "moduleUrl">;
|
|
48
|
+
/** @internal */
|
|
46
49
|
export type ExtensionUiBrowserModuleLookup = BrowserUiExtensionDescriptor;
|
|
47
50
|
|
|
51
|
+
/** @internal */
|
|
48
52
|
export interface ExtensionUiAssetRoot {
|
|
53
|
+
/** @internal */
|
|
49
54
|
extensionManifestId: string;
|
|
55
|
+
/** @internal */
|
|
50
56
|
assetRootDir: string;
|
|
51
57
|
}
|
|
52
58
|
|
|
59
|
+
/** @internal */
|
|
53
60
|
export interface ExtensionUiCatalog {
|
|
61
|
+
/** @internal */
|
|
54
62
|
getRenderer(rendererId: string): ExtensionUiRendererLookup | null;
|
|
63
|
+
/** @internal */
|
|
55
64
|
listBrowserModules(): readonly ExtensionUiBrowserModuleLookup[];
|
|
65
|
+
/** @internal */
|
|
56
66
|
getAssetRoot(extensionManifestId: string): ExtensionUiAssetRoot | null;
|
|
57
67
|
}
|
|
58
68
|
|
|
@@ -254,10 +264,13 @@ function parseManifestBrowserModuleEntries(
|
|
|
254
264
|
});
|
|
255
265
|
}
|
|
256
266
|
|
|
267
|
+
/** @internal */
|
|
257
268
|
export interface BuildExtensionUiCatalogOptions {
|
|
269
|
+
/** @internal */
|
|
258
270
|
runtimeLane?: LeitwerkRuntimeLane;
|
|
259
271
|
}
|
|
260
272
|
|
|
273
|
+
/** @internal */
|
|
261
274
|
export async function buildExtensionUiCatalog(
|
|
262
275
|
loadedModules: readonly LoadedExtensionModule[],
|
|
263
276
|
options: BuildExtensionUiCatalogOptions = {},
|
|
@@ -371,6 +384,7 @@ export async function buildExtensionUiCatalog(
|
|
|
371
384
|
return createCatalog(rendererDescriptors, browserModules, assetRoots);
|
|
372
385
|
}
|
|
373
386
|
|
|
387
|
+
/** @internal */
|
|
374
388
|
export function resolveExtensionUiAssetPath(
|
|
375
389
|
catalog: ExtensionUiCatalog,
|
|
376
390
|
extensionManifestId: string,
|
|
@@ -391,6 +405,7 @@ export function resolveExtensionUiAssetPath(
|
|
|
391
405
|
}
|
|
392
406
|
}
|
|
393
407
|
|
|
408
|
+
/** @internal */
|
|
394
409
|
export function inferExtensionUiAssetContentType(pathname: string): string {
|
|
395
410
|
switch (path.extname(pathname).toLowerCase()) {
|
|
396
411
|
case ".js":
|
|
@@ -6,20 +6,26 @@ import type { ServerExtensionEventMap } from "@leitwerk-dev/process-sdk";
|
|
|
6
6
|
* when IPC messages arrive or commands execute.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
/** @internal */
|
|
9
10
|
export type ExtensionEventHandler<T = unknown> = (payload: T) => void | Promise<void>;
|
|
10
11
|
|
|
12
|
+
/** @internal */
|
|
11
13
|
export interface ExtensionHost<TEventMap extends object = ServerExtensionEventMap> {
|
|
14
|
+
/** @internal */
|
|
12
15
|
on<K extends keyof TEventMap & string>(
|
|
13
16
|
event: K,
|
|
14
17
|
handler: ExtensionEventHandler<TEventMap[K]>,
|
|
15
18
|
): void;
|
|
19
|
+
/** @internal */
|
|
16
20
|
off<K extends keyof TEventMap & string>(
|
|
17
21
|
event: K,
|
|
18
22
|
handler: ExtensionEventHandler<TEventMap[K]>,
|
|
19
23
|
): void;
|
|
24
|
+
/** @internal */
|
|
20
25
|
emit<K extends keyof TEventMap & string>(event: K, payload: TEventMap[K]): Promise<void>;
|
|
21
26
|
}
|
|
22
27
|
|
|
28
|
+
/** @internal */
|
|
23
29
|
export function createExtensionHost<
|
|
24
30
|
TEventMap extends object = ServerExtensionEventMap,
|
|
25
31
|
>(): ExtensionHost<TEventMap> {
|
|
@@ -84,11 +84,22 @@ export interface ExternalSourceServiceDeps
|
|
|
84
84
|
processActionRegistry: ProcessActionRegistry;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/** @public */
|
|
87
88
|
export interface ExternalSourceService extends ExternalSourceServiceLike {
|
|
88
|
-
|
|
89
|
+
/** @internal */
|
|
90
|
+
currentGenerations(instanceId: string): Array<{
|
|
91
|
+
/** @internal */
|
|
92
|
+
id: string;
|
|
93
|
+
/** @internal */
|
|
94
|
+
generation: string;
|
|
95
|
+
}>;
|
|
96
|
+
/** @internal */
|
|
89
97
|
drainQueued(instanceId: string): Promise<void>;
|
|
98
|
+
/** @internal */
|
|
90
99
|
invalidateArmings(instanceId: string): void;
|
|
100
|
+
/** @internal */
|
|
91
101
|
reconcileArmings(instanceId: string): Promise<void>;
|
|
102
|
+
/** @internal */
|
|
92
103
|
reconcileAllArmings(): Promise<void>;
|
|
93
104
|
}
|
|
94
105
|
|