@leitwerk-dev/server 0.3.0 → 0.4.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-WfwKzrVk.d.ts → app-CsuxFZT5.d.ts} +332 -111
- package/dist/app-JM4CBTND.js +8 -0
- package/dist/app.d.ts +9 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/auth/fastify-auth.d.ts +9 -0
- package/dist/auth/fastify-auth.d.ts.map +1 -1
- package/dist/{chunk-LK3RO6C7.js → chunk-FPMDWQF7.js} +3050 -645
- package/dist/chunk-FPMDWQF7.js.map +1 -0
- package/dist/{chunk-KIOQNNG6.js → chunk-MBHRCQFE.js} +2781 -1822
- package/dist/chunk-MBHRCQFE.js.map +1 -0
- package/dist/config/config-loader.d.ts +1 -1
- package/dist/config/config-loader.d.ts.map +1 -1
- package/dist/config/config-types.d.ts +14 -1
- package/dist/config/config-types.d.ts.map +1 -1
- package/dist/config/kubernetes-docker-isolation.d.ts +7 -0
- package/dist/config/kubernetes-docker-isolation.d.ts.map +1 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/execution-inspection-repo.d.ts +15 -0
- package/dist/db/execution-inspection-repo.d.ts.map +1 -0
- package/dist/db/history-window.d.ts +11 -0
- package/dist/db/history-window.d.ts.map +1 -0
- package/dist/db/mapped-llm-run-repo.d.ts +56 -0
- package/dist/db/mapped-llm-run-repo.d.ts.map +1 -0
- package/dist/db/process-event-repo.d.ts +2 -0
- package/dist/db/process-event-repo.d.ts.map +1 -1
- package/dist/db/process-instance-repo.d.ts +4 -1
- package/dist/db/process-instance-repo.d.ts.map +1 -1
- package/dist/db/process-leaf-outcome-snapshot-repo.d.ts +2 -1
- package/dist/db/process-leaf-outcome-snapshot-repo.d.ts.map +1 -1
- package/dist/db/process-project-repo.d.ts +2 -0
- package/dist/db/process-project-repo.d.ts.map +1 -1
- package/dist/db/process-skill-repo.d.ts.map +1 -1
- package/dist/db/process-turn-annotation-repo.d.ts +4 -1
- package/dist/db/process-turn-annotation-repo.d.ts.map +1 -1
- package/dist/db/process-turn-record-repo.d.ts +7 -1
- package/dist/db/process-turn-record-repo.d.ts.map +1 -1
- package/dist/db/publication-repo.d.ts +5 -0
- package/dist/db/publication-repo.d.ts.map +1 -0
- package/dist/db/repo-helpers.d.ts +6 -0
- package/dist/db/repo-helpers.d.ts.map +1 -1
- package/dist/db/repositories.d.ts +16 -0
- package/dist/db/repositories.d.ts.map +1 -1
- package/dist/db/schema.d.ts +1177 -71
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/scoped-settings-repo.d.ts +37 -0
- package/dist/db/scoped-settings-repo.d.ts.map +1 -0
- package/dist/db/skill-repo.d.ts +3 -0
- package/dist/db/skill-repo.d.ts.map +1 -1
- package/dist/db/turn-start-record-repo.d.ts +2 -1
- package/dist/db/turn-start-record-repo.d.ts.map +1 -1
- package/dist/db/turn-summary-repo.d.ts +1 -1
- package/dist/db/turn-summary-repo.d.ts.map +1 -1
- package/dist/db/worker-lease-repo.d.ts +2 -1
- package/dist/db/worker-lease-repo.d.ts.map +1 -1
- package/dist/domain-logic/outcome-tools.d.ts.map +1 -1
- package/dist/external-source-service.d.ts.map +1 -1
- package/dist/future-execution/execution.d.ts +4 -1
- package/dist/future-execution/execution.d.ts.map +1 -1
- package/dist/future-execution/launch-lifecycle.d.ts +9 -25
- package/dist/future-execution/launch-lifecycle.d.ts.map +1 -1
- package/dist/future-execution/lifecycle.d.ts +3 -28
- package/dist/future-execution/lifecycle.d.ts.map +1 -1
- package/dist/future-execution/model-projection.d.ts.map +1 -1
- package/dist/future-execution/reconciliation.d.ts +1 -0
- package/dist/future-execution/reconciliation.d.ts.map +1 -1
- package/dist/future-execution-presenter.d.ts +4 -14
- package/dist/future-execution-presenter.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/integration-tool-registry.d.ts +11 -2
- package/dist/integration-tool-registry.d.ts.map +1 -1
- package/dist/launch-coordinator-test-harness.d.ts.map +1 -1
- package/dist/launch-coordinator.d.ts.map +1 -1
- package/dist/launcher-model-config-service.d.ts +7 -1
- package/dist/launcher-model-config-service.d.ts.map +1 -1
- package/dist/leaf-outcome-snapshot-capture.d.ts +1 -0
- package/dist/leaf-outcome-snapshot-capture.d.ts.map +1 -1
- package/dist/main.js +3 -3
- package/dist/primary-path-snapshot.d.ts.map +1 -1
- package/dist/process-action-presenter.d.ts +11 -0
- package/dist/process-action-presenter.d.ts.map +1 -0
- package/dist/process-action-registry.d.ts.map +1 -1
- package/dist/process-engine/decision.d.ts +2 -0
- package/dist/process-engine/decision.d.ts.map +1 -1
- package/dist/process-engine/engine.d.ts.map +1 -1
- package/dist/process-engine/mapped-turns.d.ts +45 -0
- package/dist/process-engine/mapped-turns.d.ts.map +1 -0
- package/dist/process-engine/operation.d.ts +1 -1
- package/dist/process-engine/operation.d.ts.map +1 -1
- package/dist/process-engine/ops/accept-worker-turn-start.d.ts +2 -0
- package/dist/process-engine/ops/accept-worker-turn-start.d.ts.map +1 -1
- package/dist/process-engine/ops/continue-failed-turn.d.ts.map +1 -1
- package/dist/process-engine/ops/process-observation.d.ts +6 -0
- package/dist/process-engine/ops/process-observation.d.ts.map +1 -0
- package/dist/process-engine/ops/retry-failed-turn.d.ts.map +1 -1
- package/dist/process-engine/ops/retry-startup.d.ts.map +1 -1
- package/dist/process-engine/ops/start-process.d.ts +2 -0
- package/dist/process-engine/ops/start-process.d.ts.map +1 -1
- package/dist/process-engine/ops/turn-outcome.d.ts.map +1 -1
- package/dist/process-engine/ops/turn-wait.d.ts +30 -0
- package/dist/process-engine/ops/turn-wait.d.ts.map +1 -0
- package/dist/process-engine/ops/update-model-config.d.ts +9 -0
- package/dist/process-engine/ops/update-model-config.d.ts.map +1 -0
- package/dist/process-engine/recorder.d.ts.map +1 -1
- package/dist/process-engine/turn-start-preflight.d.ts +6 -0
- package/dist/process-engine/turn-start-preflight.d.ts.map +1 -1
- package/dist/process-engine/turn-wait-state.d.ts +24 -0
- package/dist/process-engine/turn-wait-state.d.ts.map +1 -0
- package/dist/process-engine/turn-worker-requirement.d.ts +2 -0
- package/dist/process-engine/turn-worker-requirement.d.ts.map +1 -1
- package/dist/process-engine/types.d.ts +10 -1
- package/dist/process-engine/types.d.ts.map +1 -1
- package/dist/process-engine/writes/build-process-abort-writes.d.ts +3 -1
- package/dist/process-engine/writes/build-process-abort-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-recovery-start-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-turn-outcome-writes.d.ts +10 -1
- 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.map +1 -1
- package/dist/process-engine/writes/commit-writes.d.ts +2 -0
- package/dist/process-engine/writes/commit-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/reserve-selected-turn-start.d.ts +5 -0
- package/dist/process-engine/writes/reserve-selected-turn-start.d.ts.map +1 -0
- package/dist/process-engine/writes/writes.d.ts +35 -49
- 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-inspection-reader.d.ts +21 -0
- package/dist/process-inspection-reader.d.ts.map +1 -0
- package/dist/process-inspection-trace.d.ts +13 -0
- package/dist/process-inspection-trace.d.ts.map +1 -0
- package/dist/process-inspection.d.ts +22 -0
- package/dist/process-inspection.d.ts.map +1 -0
- package/dist/process-instance-tree-presenter.d.ts +4 -3
- package/dist/process-instance-tree-presenter.d.ts.map +1 -1
- package/dist/process-launch-executor.d.ts +2 -0
- package/dist/process-launch-executor.d.ts.map +1 -1
- package/dist/process-launch-plan.d.ts +1 -0
- package/dist/process-launch-plan.d.ts.map +1 -1
- package/dist/process-launcher-registry.d.ts.map +1 -1
- package/dist/process-model-config.d.ts +19 -0
- package/dist/process-model-config.d.ts.map +1 -0
- package/dist/process-model-policy/construct.d.ts.map +1 -1
- package/dist/process-model-policy/evaluate.d.ts.map +1 -1
- package/dist/process-model-policy/index.d.ts +4 -1
- package/dist/process-model-policy/index.d.ts.map +1 -1
- package/dist/process-model-policy/project.d.ts.map +1 -1
- package/dist/process-model-policy/types.d.ts +18 -0
- package/dist/process-model-policy/types.d.ts.map +1 -1
- package/dist/process-model-policy-presenter.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-turn-navigation.d.ts +12 -2
- package/dist/process-turn-navigation.d.ts.map +1 -1
- package/dist/process-turn-trace.d.ts.map +1 -1
- package/dist/process-ui-snapshot-presenter.d.ts +15 -3
- package/dist/process-ui-snapshot-presenter.d.ts.map +1 -1
- package/dist/routes/future-executions.d.ts.map +1 -1
- package/dist/routes/launchers.d.ts.map +1 -1
- package/dist/routes/process-actions.d.ts.map +1 -1
- package/dist/routes/process-detail.d.ts.map +1 -1
- package/dist/routes/process-diagnostics-assembler.d.ts +3 -1
- package/dist/routes/process-diagnostics-assembler.d.ts.map +1 -1
- package/dist/routes/process-model-config.d.ts +4 -0
- package/dist/routes/process-model-config.d.ts.map +1 -0
- package/dist/routes/process-primary-path-assembler.d.ts +4 -12
- package/dist/routes/process-primary-path-assembler.d.ts.map +1 -1
- package/dist/routes/process-route-helpers.d.ts +15 -41
- package/dist/routes/process-route-helpers.d.ts.map +1 -1
- package/dist/routes/processes.d.ts.map +1 -1
- package/dist/routes/settings.d.ts +11 -0
- package/dist/routes/settings.d.ts.map +1 -0
- package/dist/routes/ticket-creation.d.ts.map +1 -1
- package/dist/scoped-settings-service.d.ts +83 -0
- package/dist/scoped-settings-service.d.ts.map +1 -0
- package/dist/server-bootstrap/build-host-capabilities.d.ts +2 -0
- package/dist/server-bootstrap/build-host-capabilities.d.ts.map +1 -1
- package/dist/server-bootstrap/register-http.d.ts.map +1 -1
- package/dist/session-summary-projection.d.ts.map +1 -1
- package/dist/skills/bundled-skills.d.ts +5 -0
- package/dist/skills/bundled-skills.d.ts.map +1 -0
- package/dist/skills/catalog-service.d.ts +1 -0
- package/dist/skills/catalog-service.d.ts.map +1 -1
- package/dist/skills/extension-importer.d.ts +11 -0
- package/dist/skills/extension-importer.d.ts.map +1 -0
- package/dist/skills/launch-skills.d.ts +11 -0
- package/dist/skills/launch-skills.d.ts.map +1 -0
- package/dist/skills/skill-frontmatter.d.ts +5 -0
- package/dist/skills/skill-frontmatter.d.ts.map +1 -1
- package/dist/skills/source-importer.d.ts +3 -0
- package/dist/skills/source-importer.d.ts.map +1 -1
- package/dist/startup-evidence.d.ts +3 -0
- package/dist/startup-evidence.d.ts.map +1 -1
- package/dist/supervisor/execution-inspection-ingestor.d.ts +9 -0
- package/dist/supervisor/execution-inspection-ingestor.d.ts.map +1 -0
- package/dist/supervisor/ipc-handler.d.ts +2 -0
- package/dist/supervisor/ipc-handler.d.ts.map +1 -1
- package/dist/supervisor/worker-event-ingestor.d.ts +1 -0
- package/dist/supervisor/worker-event-ingestor.d.ts.map +1 -1
- package/dist/supervisor/worker-start-payload-builder.d.ts +2 -0
- package/dist/supervisor/worker-start-payload-builder.d.ts.map +1 -1
- package/dist/supervisor/worker-supervisor.d.ts +4 -0
- package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
- package/dist/supervisor/worker-turn-ipc-recorder.d.ts +2 -2
- package/dist/supervisor/worker-turn-ipc-recorder.d.ts.map +1 -1
- package/dist/test-helpers/accepted-turn-start.d.ts +18 -4
- package/dist/test-helpers/accepted-turn-start.d.ts.map +1 -1
- package/dist/test-helpers/owned-test-deps.d.ts +18 -0
- package/dist/test-helpers/owned-test-deps.d.ts.map +1 -0
- package/dist/test-helpers/prepared-fixture-start.d.ts.map +1 -1
- package/dist/test-helpers/process-model-fixtures.d.ts +1 -0
- package/dist/test-helpers/process-model-fixtures.d.ts.map +1 -1
- package/dist/test-helpers/scoped-settings-fixtures.d.ts +16 -0
- package/dist/test-helpers/scoped-settings-fixtures.d.ts.map +1 -0
- package/dist/test-helpers/skill-fixtures.d.ts +4 -0
- package/dist/test-helpers/skill-fixtures.d.ts.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +14 -10
- package/dist/testing.js.map +1 -1
- package/dist/tool-approval-gate.d.ts +3 -0
- package/dist/tool-approval-gate.d.ts.map +1 -1
- package/dist/turn-progress.d.ts.map +1 -1
- package/dist/turn-wait-service.d.ts +28 -0
- package/dist/turn-wait-service.d.ts.map +1 -0
- package/dist/worker-runtime-profile-selection.d.ts +2 -0
- package/dist/worker-runtime-profile-selection.d.ts.map +1 -1
- package/package.json +20 -19
- package/src/app.ts +117 -5
- package/src/auth/fastify-auth.ts +13 -0
- package/src/config/config-loader.ts +40 -2
- package/src/config/config-types.ts +14 -1
- package/src/config/kubernetes-docker-isolation.ts +21 -0
- package/src/db/database.ts +159 -40
- package/src/db/execution-inspection-repo.ts +163 -0
- package/src/db/history-window.ts +18 -0
- package/src/db/mapped-llm-run-repo.ts +177 -0
- package/src/db/process-event-repo.ts +88 -10
- package/src/db/process-instance-repo.ts +9 -2
- package/src/db/process-leaf-outcome-snapshot-repo.ts +8 -2
- package/src/db/process-project-repo.ts +4 -0
- package/src/db/process-skill-repo.ts +9 -2
- package/src/db/process-turn-annotation-repo.ts +27 -9
- package/src/db/process-turn-record-repo.ts +53 -13
- package/src/db/publication-repo.ts +63 -0
- package/src/db/repo-helpers.ts +11 -1
- package/src/db/repositories.ts +22 -0
- package/src/db/schema.ts +173 -2
- package/src/db/scoped-settings-repo.ts +234 -0
- package/src/db/skill-repo.ts +89 -27
- package/src/db/turn-start-record-repo.ts +13 -3
- package/src/db/turn-summary-repo.ts +12 -3
- package/src/db/worker-lease-repo.ts +8 -2
- package/src/domain-logic/outcome-tools.ts +4 -149
- package/src/external-source-service.ts +33 -7
- package/src/future-execution/execution.ts +9 -2
- package/src/future-execution/launch-lifecycle.ts +87 -78
- package/src/future-execution/lifecycle.ts +5 -34
- package/src/future-execution/model-projection.ts +2 -0
- package/src/future-execution/reconciliation.ts +7 -0
- package/src/future-execution-presenter.ts +14 -22
- package/src/integration-tool-registry.ts +59 -26
- package/src/launch-coordinator-test-harness.ts +8 -4
- package/src/launch-coordinator.ts +10 -1
- package/src/launcher-model-config-service.ts +24 -3
- package/src/leaf-outcome-snapshot-capture.ts +2 -0
- package/src/primary-path-snapshot.ts +3 -4
- package/src/process-action-presenter.ts +98 -0
- package/src/process-action-registry.ts +31 -39
- package/src/process-engine/decision.ts +10 -0
- package/src/process-engine/engine.ts +13 -4
- package/src/process-engine/mapped-turns.ts +328 -0
- package/src/process-engine/operation.ts +1 -1
- package/src/process-engine/ops/accept-worker-turn-start.ts +6 -0
- package/src/process-engine/ops/continue-failed-turn.ts +2 -13
- package/src/process-engine/ops/process-observation.ts +119 -0
- package/src/process-engine/ops/retry-failed-turn.ts +2 -12
- package/src/process-engine/ops/retry-startup.ts +10 -13
- package/src/process-engine/ops/start-process.ts +34 -2
- package/src/process-engine/ops/turn-outcome.ts +65 -62
- package/src/process-engine/ops/turn-wait.ts +225 -0
- package/src/process-engine/ops/update-model-config.ts +66 -0
- package/src/process-engine/recorder.ts +33 -5
- package/src/process-engine/runner.ts +8 -8
- package/src/process-engine/turn-start-preflight.ts +168 -105
- package/src/process-engine/turn-wait-state.ts +126 -0
- package/src/process-engine/turn-worker-requirement.ts +4 -0
- package/src/process-engine/types.ts +15 -0
- package/src/process-engine/writes/build-process-abort-writes.ts +30 -19
- package/src/process-engine/writes/build-recovery-start-writes.ts +1 -0
- package/src/process-engine/writes/build-turn-outcome-writes.ts +118 -21
- package/src/process-engine/writes/build-turn-selection-writes.ts +2 -31
- package/src/process-engine/writes/commit-writes.ts +20 -2
- package/src/process-engine/writes/reserve-selected-turn-start.ts +44 -0
- package/src/process-engine/writes/writes.ts +73 -61
- package/src/process-graph.ts +0 -1
- package/src/process-inspection-reader.ts +305 -0
- package/src/process-inspection-trace.ts +176 -0
- package/src/process-inspection.ts +169 -0
- package/src/process-instance-tree-presenter.ts +56 -216
- package/src/process-launch-executor.ts +5 -2
- package/src/process-launch-plan.ts +17 -2
- package/src/process-launcher-registry.ts +28 -16
- package/src/process-model-config.ts +100 -0
- package/src/process-model-policy/construct.ts +1 -0
- package/src/process-model-policy/evaluate.ts +34 -32
- package/src/process-model-policy/index.ts +45 -3
- package/src/process-model-policy/project.ts +62 -76
- package/src/process-model-policy/types.ts +26 -0
- package/src/process-model-policy-presenter.ts +7 -3
- package/src/process-runtime-availability.ts +9 -4
- package/src/process-turn-navigation.ts +86 -8
- package/src/process-turn-trace.ts +12 -24
- package/src/process-ui-snapshot-presenter.ts +249 -298
- package/src/routes/future-executions.ts +5 -5
- package/src/routes/launchers.ts +51 -1
- package/src/routes/process-actions.ts +10 -10
- package/src/routes/process-detail.ts +25 -2
- package/src/routes/process-diagnostics-assembler.ts +32 -6
- package/src/routes/process-model-config.ts +70 -0
- package/src/routes/process-primary-path-assembler.ts +17 -33
- package/src/routes/process-route-helpers.ts +161 -327
- package/src/routes/processes.ts +2 -0
- package/src/routes/settings.ts +173 -0
- package/src/routes/ticket-creation.ts +28 -5
- package/src/scoped-settings-service.ts +736 -0
- package/src/server-bootstrap/build-host-capabilities.ts +42 -0
- package/src/server-bootstrap/register-http.ts +7 -1
- package/src/session-summary-projection.ts +1 -2
- package/src/skills/bundled-skills.ts +64 -0
- package/src/skills/catalog-service.ts +35 -6
- package/src/skills/extension-importer.ts +97 -0
- package/src/skills/launch-skills.ts +19 -0
- package/src/skills/skill-frontmatter.ts +13 -0
- package/src/skills/source-importer.ts +3 -0
- package/src/startup-evidence.ts +20 -0
- package/src/supervisor/execution-inspection-ingestor.ts +55 -0
- package/src/supervisor/ipc-handler.ts +29 -18
- package/src/supervisor/worker-event-ingestor.ts +30 -14
- package/src/supervisor/worker-start-payload-builder.ts +42 -0
- package/src/supervisor/worker-supervisor.ts +5 -0
- package/src/supervisor/worker-turn-ipc-recorder.ts +13 -1
- package/src/test-helpers/accepted-turn-start.ts +51 -27
- package/src/test-helpers/owned-test-deps.ts +45 -0
- package/src/test-helpers/prepared-fixture-start.ts +1 -0
- package/src/test-helpers/process-model-fixtures.ts +2 -0
- package/src/test-helpers/scoped-settings-fixtures.ts +126 -0
- package/src/test-helpers/skill-fixtures.ts +28 -0
- package/src/testing.ts +4 -1
- package/src/tool-approval-gate.ts +16 -0
- package/src/turn-progress.ts +3 -2
- package/src/turn-wait-service.ts +228 -0
- package/src/worker-runtime-profile-selection.ts +8 -1
- package/dist/app-4QSV4FUQ.js +0 -8
- package/dist/chunk-KIOQNNG6.js.map +0 -1
- package/dist/chunk-LK3RO6C7.js.map +0 -1
- /package/dist/{app-4QSV4FUQ.js.map → app-JM4CBTND.js.map} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type TurnWaitContext } from "@leitwerk-dev/process-sdk";
|
|
2
|
+
import type { CommitMessageConfig } from "./config/config-types.js";
|
|
3
|
+
import type { RepositoryBundle } from "./db/repositories.js";
|
|
4
|
+
import type { ProcessActionRegistry } from "./process-action-registry.js";
|
|
5
|
+
import type { ProcessEngine } from "./process-engine/types.js";
|
|
6
|
+
import type { ProcessGraphRegistry } from "./process-graph.js";
|
|
7
|
+
interface TurnWaitServiceDeps {
|
|
8
|
+
processes: RepositoryBundle["processes"];
|
|
9
|
+
projects: RepositoryBundle["projects"];
|
|
10
|
+
processGraphs: ProcessGraphRegistry;
|
|
11
|
+
registry: Pick<ProcessActionRegistry, "resolveContextData">;
|
|
12
|
+
commands: ProcessEngine;
|
|
13
|
+
require: TurnWaitContext["require"];
|
|
14
|
+
now?: () => number;
|
|
15
|
+
pollIntervalMs?: number;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
commitMessages?: CommitMessageConfig;
|
|
18
|
+
}
|
|
19
|
+
/** Runs read-only predicates outside lifecycle locks. The engine fences every result. */
|
|
20
|
+
export declare function createTurnWaitService(deps: TurnWaitServiceDeps): {
|
|
21
|
+
check: (instanceId: string) => Promise<void>;
|
|
22
|
+
poll(): Promise<{
|
|
23
|
+
errors: string[];
|
|
24
|
+
}>;
|
|
25
|
+
stop(): Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=turn-wait-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-wait-service.d.ts","sourceRoot":"","sources":["../src/turn-wait-service.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,eAAe,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,UAAU,mBAAmB;IAC5B,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC,aAAa,EAAE,oBAAoB,CAAC;IACpC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;IAC5D,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAED,yFAAyF;AACzF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB;wBA6JnC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;EAyCjD"}
|
|
@@ -67,5 +67,7 @@ export declare function buildRuntimeProfileSelectionInput(args: {
|
|
|
67
67
|
processId: string;
|
|
68
68
|
/** @internal */
|
|
69
69
|
componentKeys: string[];
|
|
70
|
+
/** The registered process definition requires Docker. @internal */
|
|
71
|
+
docker?: boolean;
|
|
70
72
|
}): RuntimeProfileSelectionInput;
|
|
71
73
|
//# sourceMappingURL=worker-runtime-profile-selection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-runtime-profile-selection.d.ts","sourceRoot":"","sources":["../src/worker-runtime-profile-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3F;;;GAGG;AACH,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAChD,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gBAAgB;AAChB,MAAM,WAAW,4BAA4B;IAC5C,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,iBAAiB,EAAE,gCAAgC,EAAE,CAAC;IACtD,uHAAuH;IACvH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACrD;AAED,gBAAgB;AAChB,MAAM,MAAM,6BAA6B,GACtC;IACA,gBAAgB;IAChB,EAAE,EAAE,IAAI,CAAC;IACT,gBAAgB;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,KAAK,EAAE,mBAAmB,CAAC;CAC1B,GACD;IACA,gBAAgB;IAChB,EAAE,EAAE,KAAK,CAAC;IACV,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;CACb,CAAC;AAUL,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAWjF;AAED;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,4BAA4B,GACjC,6BAA6B,CAqC/B;AAoBD;;;GAGG;AACH,gBAAgB;AAChB,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACvD,gBAAgB;IAChB,MAAM,EAAE,cAAc,CAAC;IACvB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"worker-runtime-profile-selection.d.ts","sourceRoot":"","sources":["../src/worker-runtime-profile-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3F;;;GAGG;AACH,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAChD,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gBAAgB;AAChB,MAAM,WAAW,4BAA4B;IAC5C,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,iBAAiB,EAAE,gCAAgC,EAAE,CAAC;IACtD,uHAAuH;IACvH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACrD;AAED,gBAAgB;AAChB,MAAM,MAAM,6BAA6B,GACtC;IACA,gBAAgB;IAChB,EAAE,EAAE,IAAI,CAAC;IACT,gBAAgB;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,KAAK,EAAE,mBAAmB,CAAC;CAC1B,GACD;IACA,gBAAgB;IAChB,EAAE,EAAE,KAAK,CAAC;IACV,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;CACb,CAAC;AAUL,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAWjF;AAED;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,4BAA4B,GACjC,6BAA6B,CAqC/B;AAoBD;;;GAGG;AACH,gBAAgB;AAChB,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACvD,gBAAgB;IAChB,MAAM,EAAE,cAAc,CAAC;IACvB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,4BAA4B,CAkB/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leitwerk-dev/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/leitwerk-dev/leitwerk.git",
|
|
@@ -24,31 +24,32 @@
|
|
|
24
24
|
"start": "node dist/main.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@earendil-works/pi-ai": "^0.
|
|
28
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
29
|
-
"@fastify/cookie": "11.
|
|
27
|
+
"@earendil-works/pi-ai": "^0.87.0",
|
|
28
|
+
"@earendil-works/pi-coding-agent": "^0.87.0",
|
|
29
|
+
"@fastify/cookie": "11.1.2",
|
|
30
30
|
"@fastify/websocket": "^11.2.0",
|
|
31
|
-
"@leitwerk-dev/domain": "0.
|
|
32
|
-
"@leitwerk-dev/extension-runtime": "0.
|
|
33
|
-
"@leitwerk-dev/external-writes": "0.
|
|
34
|
-
"@leitwerk-dev/process-sdk": "0.
|
|
35
|
-
"@leitwerk-dev/protocol": "0.
|
|
36
|
-
"@leitwerk-dev/session-transfer": "0.
|
|
37
|
-
"@leitwerk-dev/watcher-utils": "0.
|
|
38
|
-
"@leitwerk-dev/worker-protocol": "0.
|
|
39
|
-
"@leitwerk-dev/worker-runners": "0.
|
|
31
|
+
"@leitwerk-dev/domain": "0.4.0",
|
|
32
|
+
"@leitwerk-dev/extension-runtime": "0.4.0",
|
|
33
|
+
"@leitwerk-dev/external-writes": "0.4.0",
|
|
34
|
+
"@leitwerk-dev/process-sdk": "0.4.0",
|
|
35
|
+
"@leitwerk-dev/protocol": "0.4.0",
|
|
36
|
+
"@leitwerk-dev/session-transfer": "0.4.0",
|
|
37
|
+
"@leitwerk-dev/watcher-utils": "0.4.0",
|
|
38
|
+
"@leitwerk-dev/worker-protocol": "0.4.0",
|
|
39
|
+
"@leitwerk-dev/worker-runners": "0.4.0",
|
|
40
40
|
"cron-parser": "^5.5.0",
|
|
41
41
|
"defu": "^6.1.7",
|
|
42
|
-
"drizzle-orm": "1.0.0-rc.
|
|
43
|
-
"esbuild": "0.28.
|
|
42
|
+
"drizzle-orm": "1.0.0-rc.5-ab785fc",
|
|
43
|
+
"esbuild": "0.28.2",
|
|
44
44
|
"fastify": "^5.8.4",
|
|
45
|
-
"openid-client": "6.8.
|
|
46
|
-
"sharp": "^0.
|
|
45
|
+
"openid-client": "6.8.8",
|
|
46
|
+
"sharp": "^0.35.0",
|
|
47
47
|
"valibot": "^1.3.1",
|
|
48
|
-
"yaml": "^2.8.3"
|
|
48
|
+
"yaml": "^2.8.3",
|
|
49
|
+
"@leitwerk-dev/wiki": "0.4.0"
|
|
49
50
|
},
|
|
50
51
|
"optionalDependencies": {
|
|
51
|
-
"@leitwerk-dev/worker": "0.
|
|
52
|
+
"@leitwerk-dev/worker": "0.4.0"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"tsup": "^8.5.1",
|
package/src/app.ts
CHANGED
|
@@ -14,9 +14,12 @@ import type {
|
|
|
14
14
|
ProvidedCapability,
|
|
15
15
|
ServerExtensionEventMap,
|
|
16
16
|
} from "@leitwerk-dev/process-sdk";
|
|
17
|
+
import { scopedSettingsCapability } from "@leitwerk-dev/process-sdk";
|
|
17
18
|
import type { ModelProfileSnapshot } from "@leitwerk-dev/protocol";
|
|
18
19
|
import { DEFAULT_SESSION_TRANSFER_LIMITS } from "@leitwerk-dev/session-transfer";
|
|
19
20
|
import { createPollingCoordinator, parseDurationMs } from "@leitwerk-dev/watcher-utils";
|
|
21
|
+
import { topicWikiCapability } from "@leitwerk-dev/wiki/integration";
|
|
22
|
+
import { createTopicWikiRepo, registerWikiTools } from "@leitwerk-dev/wiki/server";
|
|
20
23
|
import {
|
|
21
24
|
cleanupRetainedProcessVolumes,
|
|
22
25
|
type ProcessStateExporter,
|
|
@@ -105,6 +108,7 @@ import {
|
|
|
105
108
|
import { RepositoryCredentialService } from "./repository-credentials/service.js";
|
|
106
109
|
import { ResultImageStore } from "./result-image-store.js";
|
|
107
110
|
import type { RouteDeps } from "./routes/processes.js";
|
|
111
|
+
import { createScopedSettingsService } from "./scoped-settings-service.js";
|
|
108
112
|
import { collectCleanupErrors, createAppLifecycle } from "./server-bootstrap/app-lifecycle.js";
|
|
109
113
|
import { buildHostCapabilities } from "./server-bootstrap/build-host-capabilities.js";
|
|
110
114
|
import { loadServerExtensionCatalog } from "./server-bootstrap/load-extension-catalog.js";
|
|
@@ -114,7 +118,9 @@ import { resolveServerTlsOptions } from "./server-topology.js";
|
|
|
114
118
|
import { createProjectedSessionSnapshotStore } from "./session-summary-projection.js";
|
|
115
119
|
import { createSessionTransferHelperRelays } from "./session-transfer-helper-relays.js";
|
|
116
120
|
import { createSessionTransferService } from "./session-transfer-service.js";
|
|
121
|
+
import { importBundledSkills } from "./skills/bundled-skills.js";
|
|
117
122
|
import { createSkillCatalogService } from "./skills/catalog-service.js";
|
|
123
|
+
import { importExtensionSkills } from "./skills/extension-importer.js";
|
|
118
124
|
import { createDiagnosticTraceWriter } from "./supervisor/diagnostic-trace-writer.js";
|
|
119
125
|
import { createIpcHandler, type IpcHandler } from "./supervisor/ipc-handler.js";
|
|
120
126
|
import { startStaleHeartbeatWatchdog } from "./supervisor/stale-heartbeat-watchdog.js";
|
|
@@ -124,11 +130,22 @@ import {
|
|
|
124
130
|
type WorkerWebSocketIpcManager,
|
|
125
131
|
} from "./supervisor/worker-websocket-ipc.js";
|
|
126
132
|
import { createToolApprovalGate } from "./tool-approval-gate.js";
|
|
133
|
+
import { recordTurnProgress } from "./turn-progress.js";
|
|
134
|
+
import { createTurnWaitService } from "./turn-wait-service.js";
|
|
127
135
|
import { defaultWorkerRuntimeProfile } from "./worker-runtime-profile-selection.js";
|
|
128
136
|
import { type Broadcaster, createBroadcaster } from "./ws/broadcast.js";
|
|
129
137
|
|
|
130
138
|
/** @public */
|
|
131
139
|
export interface AppOptions {
|
|
140
|
+
/** Clock and cadence seam for readiness integration tests. @internal */
|
|
141
|
+
turnWait?: {
|
|
142
|
+
/** @internal */
|
|
143
|
+
now?: () => number;
|
|
144
|
+
/** @internal */
|
|
145
|
+
pollIntervalMs?: number;
|
|
146
|
+
/** @internal */
|
|
147
|
+
timeoutMs?: number;
|
|
148
|
+
};
|
|
132
149
|
/** @public */
|
|
133
150
|
config?: LeitwerkConfig;
|
|
134
151
|
/** @internal */
|
|
@@ -243,6 +260,11 @@ async function createConfiguredWorkerRunnerRuntime(input: {
|
|
|
243
260
|
provided?: AppOptions["workerRunnerRuntime"];
|
|
244
261
|
helperRelays: ProcessStateExportHelperRelayProvider;
|
|
245
262
|
onVolumePoolError: () => void;
|
|
263
|
+
onImagePreparationEvent: NonNullable<
|
|
264
|
+
Parameters<
|
|
265
|
+
typeof import("@leitwerk-dev/worker-runners/kubernetes").createKubernetesWorkerRunner
|
|
266
|
+
>[0]["imagePreload"]
|
|
267
|
+
>["onEvent"];
|
|
246
268
|
localWorkerSpawnImpl?: AppOptions["localWorkerSpawnImpl"];
|
|
247
269
|
localWorkerDockerPreflightImpl?: AppOptions["localWorkerDockerPreflightImpl"];
|
|
248
270
|
}): Promise<{
|
|
@@ -250,7 +272,7 @@ async function createConfiguredWorkerRunnerRuntime(input: {
|
|
|
250
272
|
volume?: ProcessVolume;
|
|
251
273
|
exporter: ProcessStateExporter;
|
|
252
274
|
webSocketIpc: WorkerWebSocketIpcManager;
|
|
253
|
-
|
|
275
|
+
preparation?: { start(): void; stop(): Promise<void> };
|
|
254
276
|
}> {
|
|
255
277
|
if (input.provided) {
|
|
256
278
|
return {
|
|
@@ -289,6 +311,14 @@ async function createConfiguredWorkerRunnerRuntime(input: {
|
|
|
289
311
|
preProvision: processVolume?.pre_provision
|
|
290
312
|
? { ...processVolume.pre_provision, onError: input.onVolumePoolError }
|
|
291
313
|
: undefined,
|
|
314
|
+
imagePreload: input.config.kubernetes?.image_preload?.enabled
|
|
315
|
+
? {
|
|
316
|
+
images: Object.values(input.config.worker_runtime_profiles ?? {}).map(
|
|
317
|
+
(profile) => profile.image,
|
|
318
|
+
),
|
|
319
|
+
onEvent: input.onImagePreparationEvent,
|
|
320
|
+
}
|
|
321
|
+
: undefined,
|
|
292
322
|
processNamespacePrefix:
|
|
293
323
|
input.config.kubernetes?.process_namespace_prefix ?? "leitwerk-process-",
|
|
294
324
|
volume: {
|
|
@@ -421,7 +451,9 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
421
451
|
const repos = createAllRepos(db, {
|
|
422
452
|
...(credentialCipher ? { credentialCipher } : {}),
|
|
423
453
|
});
|
|
454
|
+
const extensionSkills = await importExtensionSkills(extensionCatalog.modules);
|
|
424
455
|
repos.transaction((transactionRepos) => {
|
|
456
|
+
transactionRepos.skills.reconcileExtensions(extensionSkills);
|
|
425
457
|
// Directly configured skills are no longer supported. Deactivate any left by an older release.
|
|
426
458
|
transactionRepos.skills.reconcile([]);
|
|
427
459
|
transactionRepos.skills.backfillDependencies();
|
|
@@ -429,6 +461,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
429
461
|
const skillCatalog = createSkillCatalogService({
|
|
430
462
|
repositories: config.skill_repositories ?? [],
|
|
431
463
|
repos,
|
|
464
|
+
bundledSkills: await importBundledSkills(extensionCatalog.piContributions),
|
|
432
465
|
});
|
|
433
466
|
await skillCatalog.refresh();
|
|
434
467
|
markStartup("skill_catalog");
|
|
@@ -467,12 +500,34 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
467
500
|
markStartup("model_providers");
|
|
468
501
|
|
|
469
502
|
const broadcaster = createBroadcaster();
|
|
503
|
+
repos.topicWiki = createTopicWikiRepo(db, (topicId) =>
|
|
504
|
+
broadcaster.sendDurable("wiki.updated", { topicId }),
|
|
505
|
+
);
|
|
470
506
|
const processOperations = createProcessOperationCoordinator();
|
|
471
507
|
const processGraphs = extensionCatalog.processes;
|
|
472
508
|
const processActionRegistry = buildProcessActionRegistry(extensionCatalog);
|
|
473
509
|
const integrationTools = new IntegrationToolRegistry(repos.externalWrites);
|
|
474
510
|
const processUiRegistry = buildProcessUiRegistry(extensionCatalog);
|
|
511
|
+
const scopedSettings = createScopedSettingsService({
|
|
512
|
+
repos,
|
|
513
|
+
catalog: extensionCatalog,
|
|
514
|
+
config,
|
|
515
|
+
modelChoices: () =>
|
|
516
|
+
config.pi.model_profiles.map((profile) => {
|
|
517
|
+
const status = modelStatusCache
|
|
518
|
+
.snapshot()
|
|
519
|
+
.profiles.find((entry) => entry.profileId === profile.id);
|
|
520
|
+
return {
|
|
521
|
+
value: profile.id,
|
|
522
|
+
label: `${profile.id} — ${profile.provider}/${profile.model_id}`,
|
|
523
|
+
...(status?.availability === "available"
|
|
524
|
+
? {}
|
|
525
|
+
: { disabledReason: status?.safeReason ?? "Model unavailable" }),
|
|
526
|
+
};
|
|
527
|
+
}),
|
|
528
|
+
});
|
|
475
529
|
const processModelPolicy = createServerProcessModelPolicy({
|
|
530
|
+
scopedSettings,
|
|
476
531
|
config,
|
|
477
532
|
processGraphs,
|
|
478
533
|
processActionRegistry,
|
|
@@ -590,6 +645,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
590
645
|
},
|
|
591
646
|
};
|
|
592
647
|
const launcherModelConfigs = createLauncherModelConfigService({
|
|
648
|
+
scopedSettingsService: scopedSettings,
|
|
593
649
|
launcherService,
|
|
594
650
|
launchPlans,
|
|
595
651
|
processModelPolicy,
|
|
@@ -721,6 +777,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
721
777
|
turnStarts: baseDeps.turnStarts,
|
|
722
778
|
leases: baseDeps.leases,
|
|
723
779
|
turnAnnotations: baseDeps.turnAnnotations,
|
|
780
|
+
mappedRuns: baseDeps.mappedRuns,
|
|
724
781
|
transaction: baseDeps.transaction,
|
|
725
782
|
broadcaster,
|
|
726
783
|
config,
|
|
@@ -736,6 +793,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
736
793
|
processModelPolicy,
|
|
737
794
|
getModelAvailabilitySnapshot: () => modelStatusCache.snapshot(),
|
|
738
795
|
afterRecord(process) {
|
|
796
|
+
invalidateExternalSourceArmings?.(process.id);
|
|
739
797
|
// The process volume is the durable source for an already-created start.
|
|
740
798
|
// A missing server-cache entry is valid after restart.
|
|
741
799
|
piResourceBundlePins.reconcile(process);
|
|
@@ -748,11 +806,15 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
748
806
|
{
|
|
749
807
|
config,
|
|
750
808
|
registry: modelProviderRegistry,
|
|
809
|
+
processActionRegistry,
|
|
810
|
+
mappedRuns: baseDeps.mappedRuns,
|
|
751
811
|
modelStatusCache,
|
|
752
812
|
piContributions: extensionCatalog.piContributions,
|
|
753
813
|
bundleCache: piResourceBundles,
|
|
754
814
|
projects: baseDeps.projects,
|
|
755
815
|
processSkills: baseDeps.processSkills,
|
|
816
|
+
scopedSettings,
|
|
817
|
+
processModelPolicy,
|
|
756
818
|
},
|
|
757
819
|
process,
|
|
758
820
|
writes,
|
|
@@ -782,18 +844,23 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
782
844
|
const toolApprovalGate = createToolApprovalGate({
|
|
783
845
|
repos: baseDeps,
|
|
784
846
|
processOperations,
|
|
847
|
+
broadcaster,
|
|
785
848
|
});
|
|
786
849
|
const integrationToolRequests = createIntegrationToolRequestService({
|
|
787
850
|
registry: integrationTools,
|
|
788
851
|
repos: baseDeps,
|
|
789
852
|
processActionRegistry,
|
|
790
853
|
toolApprovalGate,
|
|
854
|
+
reportProgress: (report) => {
|
|
855
|
+
recordTurnProgress(baseDeps, report);
|
|
856
|
+
},
|
|
791
857
|
});
|
|
792
858
|
const diagnosticTraceWriter = createDiagnosticTraceWriter(
|
|
793
859
|
path.join(config.storage.tree_files_dir, "diagnostic-traces"),
|
|
794
860
|
);
|
|
795
861
|
const ipcHandler = createIpcHandler(
|
|
796
862
|
{
|
|
863
|
+
executionInspections: baseDeps.executionInspections,
|
|
797
864
|
startupObservations: baseDeps.startupObservations,
|
|
798
865
|
processes: baseDeps.processes,
|
|
799
866
|
getLaunchCoordinator: () => launchCoordinator,
|
|
@@ -900,15 +967,20 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
900
967
|
helperRelays: sessionTransferHelperRelays,
|
|
901
968
|
onVolumePoolError: () =>
|
|
902
969
|
app.log.warn("Volume pre-provisioning failed; retrying in the background"),
|
|
970
|
+
onImagePreparationEvent: (event) => {
|
|
971
|
+
if (event.outcome === "succeeded") app.log.info(event, "Worker image prepared");
|
|
972
|
+
else app.log.warn(event, "Worker image preparation failed; retrying in the background");
|
|
973
|
+
},
|
|
903
974
|
localWorkerSpawnImpl: opts.localWorkerSpawnImpl,
|
|
904
975
|
localWorkerDockerPreflightImpl: opts.localWorkerDockerPreflightImpl,
|
|
905
976
|
});
|
|
906
|
-
if (runnerRuntime.
|
|
907
|
-
startHooks.push(() => runnerRuntime.
|
|
908
|
-
stopHooks.push(() => runnerRuntime.
|
|
977
|
+
if (runnerRuntime.preparation) {
|
|
978
|
+
startHooks.push(() => runnerRuntime.preparation?.start());
|
|
979
|
+
stopHooks.push(() => runnerRuntime.preparation?.stop());
|
|
909
980
|
}
|
|
910
981
|
markStartup("worker_runner");
|
|
911
982
|
supervisor = createWorkerSupervisor({
|
|
983
|
+
executionInspections: baseDeps.executionInspections,
|
|
912
984
|
startupObservations: baseDeps.startupObservations,
|
|
913
985
|
config: supervisorConfig,
|
|
914
986
|
processGraphs,
|
|
@@ -922,6 +994,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
922
994
|
inputs: baseDeps.inputs,
|
|
923
995
|
turnRecords: baseDeps.turnRecords,
|
|
924
996
|
turnStarts: baseDeps.turnStarts,
|
|
997
|
+
mappedRuns: baseDeps.mappedRuns,
|
|
925
998
|
events: baseDeps.events,
|
|
926
999
|
broadcaster,
|
|
927
1000
|
runnerRuntime,
|
|
@@ -1043,6 +1116,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
1043
1116
|
);
|
|
1044
1117
|
const processLaunchDeps = {
|
|
1045
1118
|
...baseDeps,
|
|
1119
|
+
skillDefaults: config,
|
|
1046
1120
|
broadcaster,
|
|
1047
1121
|
commands: processEngine,
|
|
1048
1122
|
processTitles,
|
|
@@ -1054,6 +1128,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
1054
1128
|
};
|
|
1055
1129
|
const createProcess = createProcessFromLaunchPlan.bind(null, processLaunchDeps);
|
|
1056
1130
|
futureExecutionLifecycle = createFutureExecutionLifecycle({
|
|
1131
|
+
skillDefaults: config,
|
|
1057
1132
|
futureExecutions: baseDeps.futureExecutions,
|
|
1058
1133
|
processes: baseDeps.processes,
|
|
1059
1134
|
projects: baseDeps.projects,
|
|
@@ -1185,6 +1260,7 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
1185
1260
|
modelStatusCache,
|
|
1186
1261
|
});
|
|
1187
1262
|
const hostCapabilities = buildHostCapabilities({
|
|
1263
|
+
integrationTools,
|
|
1188
1264
|
config,
|
|
1189
1265
|
baseDeps,
|
|
1190
1266
|
projectMutations,
|
|
@@ -1209,6 +1285,33 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
1209
1285
|
preProvidedCapabilities: opts.preProvidedCapabilities,
|
|
1210
1286
|
});
|
|
1211
1287
|
|
|
1288
|
+
hostCapabilities.provide(scopedSettingsCapability, scopedSettings);
|
|
1289
|
+
const turnWaitService = createTurnWaitService({
|
|
1290
|
+
commitMessages: config.commit_messages,
|
|
1291
|
+
processes: baseDeps.processes,
|
|
1292
|
+
projects: baseDeps.projects,
|
|
1293
|
+
processGraphs,
|
|
1294
|
+
registry: processActionRegistry,
|
|
1295
|
+
commands: processEngine,
|
|
1296
|
+
require: hostCapabilities.require.bind(hostCapabilities),
|
|
1297
|
+
...opts.turnWait,
|
|
1298
|
+
});
|
|
1299
|
+
polling.create({
|
|
1300
|
+
id: "turn-readiness",
|
|
1301
|
+
pollOnce: turnWaitService.poll,
|
|
1302
|
+
isEnabled: () => true,
|
|
1303
|
+
pollInterval: () => "1s",
|
|
1304
|
+
defaultIntervalMs: 1000,
|
|
1305
|
+
});
|
|
1306
|
+
afterSuccessHooks.add((instanceId) => {
|
|
1307
|
+
// Resolving readiness invokes this hook again; never await our own check.
|
|
1308
|
+
void turnWaitService.check(instanceId).catch((error: unknown) => {
|
|
1309
|
+
app.log.error({ err: error, instanceId }, "Turn readiness check failed");
|
|
1310
|
+
});
|
|
1311
|
+
});
|
|
1312
|
+
const wiki = hostCapabilities.require(topicWikiCapability);
|
|
1313
|
+
if (Array.isArray(wiki)) throw new Error("Wiki integration must be singular");
|
|
1314
|
+
registerWikiTools({ tool: (definition) => integrationTools.register(definition) }, wiki);
|
|
1212
1315
|
await setupServerExtensions(
|
|
1213
1316
|
extensionCatalog,
|
|
1214
1317
|
{
|
|
@@ -1229,7 +1332,10 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
1229
1332
|
);
|
|
1230
1333
|
integrationTools.validateTicketProcesses(extensionCatalog.processes);
|
|
1231
1334
|
startHooks.push(() => polling.start());
|
|
1232
|
-
stopHooks.push(() =>
|
|
1335
|
+
stopHooks.push(async () => {
|
|
1336
|
+
await turnWaitService.stop();
|
|
1337
|
+
await polling.stop();
|
|
1338
|
+
});
|
|
1233
1339
|
for (const process of extensionCatalog.processes.values()) {
|
|
1234
1340
|
for (const [turnId, binding] of process.turns) {
|
|
1235
1341
|
const definition = binding.definition;
|
|
@@ -1246,6 +1352,12 @@ export async function createAppContext(opts: AppOptions = {}): Promise<AppContex
|
|
|
1246
1352
|
markStartup("server_extensions");
|
|
1247
1353
|
|
|
1248
1354
|
const deps: RouteDeps = {
|
|
1355
|
+
onSettingsChanged: async () => {
|
|
1356
|
+
await futureExecutionLifecycle.reconcileModelAvailability({
|
|
1357
|
+
availability: modelStatusCache.snapshot(),
|
|
1358
|
+
});
|
|
1359
|
+
},
|
|
1360
|
+
scopedSettingsService: scopedSettings,
|
|
1249
1361
|
externalSourceService,
|
|
1250
1362
|
...baseDeps,
|
|
1251
1363
|
launchCoordinator,
|
package/src/auth/fastify-auth.ts
CHANGED
|
@@ -2,16 +2,25 @@ import { type Actor, ADMIN_ACTOR } from "@leitwerk-dev/domain";
|
|
|
2
2
|
import type { FastifyReply, FastifyRequest } from "fastify";
|
|
3
3
|
import type { AuthService } from "./auth-service.js";
|
|
4
4
|
|
|
5
|
+
/** @internal */
|
|
5
6
|
export interface TokenAuditContext {
|
|
7
|
+
/** @internal */
|
|
6
8
|
operation: string;
|
|
9
|
+
/** @internal */
|
|
7
10
|
tokenId?: string;
|
|
11
|
+
/** @internal */
|
|
8
12
|
actor?: Actor;
|
|
13
|
+
/** @internal */
|
|
9
14
|
ownerKind?: "user" | "anonymous";
|
|
15
|
+
/** @internal */
|
|
10
16
|
count?: number;
|
|
11
17
|
}
|
|
12
18
|
declare module "fastify" {
|
|
19
|
+
/** @internal */
|
|
13
20
|
interface FastifyRequest {
|
|
21
|
+
/** @internal */
|
|
14
22
|
actor?: Actor;
|
|
23
|
+
/** @internal */
|
|
15
24
|
tokenAudit?: TokenAuditContext;
|
|
16
25
|
}
|
|
17
26
|
}
|
|
@@ -57,9 +66,13 @@ export function authenticateRequest(auth: AuthService, request: FastifyRequest):
|
|
|
57
66
|
const result = auth.apiTokens.resolve(match[1]);
|
|
58
67
|
if (result.token) {
|
|
59
68
|
request.tokenAudit = {
|
|
69
|
+
/** @internal */
|
|
60
70
|
operation: "bearer_request",
|
|
71
|
+
/** @internal */
|
|
61
72
|
tokenId: result.token.id,
|
|
73
|
+
/** @internal */
|
|
62
74
|
actor: result.token.owner.actor,
|
|
75
|
+
/** @internal */
|
|
63
76
|
ownerKind: result.token.owner.kind,
|
|
64
77
|
};
|
|
65
78
|
}
|
|
@@ -17,6 +17,7 @@ import { resolveDockerRegistryCredentials } from "../docker-registry-credentials
|
|
|
17
17
|
import { isValidStorageSize } from "../process-storage-size.js";
|
|
18
18
|
import { SAFE_SKILL_ID_PATTERN } from "../skills/skill-id.js";
|
|
19
19
|
import type { LeitwerkConfig } from "./config-types.js";
|
|
20
|
+
import { resolveKubernetesDockerIsolation } from "./kubernetes-docker-isolation.js";
|
|
20
21
|
import { isHttpsOrLoopbackHttpUrl, isValidHttpUrl, parseHttpUrl } from "./url-policy.js";
|
|
21
22
|
|
|
22
23
|
const DEFAULT_SEARCH_PATHS = ["./leitwerk.yaml", "~/.leitwerk/leitwerk.yaml"];
|
|
@@ -135,12 +136,19 @@ export function loadConfigFromFile(filePath: string): ConfigLoadResult | ConfigL
|
|
|
135
136
|
export function loadConfig(explicitPath?: string): ConfigLoadResult | ConfigLoadError {
|
|
136
137
|
const filePath = resolveConfigPath(explicitPath);
|
|
137
138
|
if (!filePath) {
|
|
138
|
-
return {
|
|
139
|
+
return {
|
|
140
|
+
ok: false,
|
|
141
|
+
error:
|
|
142
|
+
"Configuration file required: configure pi.default_model_profile and pi.model_profiles",
|
|
143
|
+
};
|
|
139
144
|
}
|
|
140
145
|
return loadConfigFromFile(filePath);
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
const stringArraySchema = v.array(v.string());
|
|
149
|
+
const skillIdsSchema = v.array(
|
|
150
|
+
v.pipe(v.string(), v.regex(SAFE_SKILL_ID_PATTERN, "Invalid skill ID")),
|
|
151
|
+
);
|
|
144
152
|
const modelTurnConfigSchema = v.looseObject({
|
|
145
153
|
model_profile: v.optional(v.string()),
|
|
146
154
|
});
|
|
@@ -287,6 +295,10 @@ const configSchema = v.looseObject({
|
|
|
287
295
|
),
|
|
288
296
|
pi: v.looseObject({
|
|
289
297
|
agent_dir: v.string(),
|
|
298
|
+
default_model_profile: v.pipe(
|
|
299
|
+
v.string(),
|
|
300
|
+
v.check((value) => value.trim() !== "", "Must be a non-empty model profile ID"),
|
|
301
|
+
),
|
|
290
302
|
model_profiles: v.array(
|
|
291
303
|
v.looseObject({
|
|
292
304
|
id: v.string(),
|
|
@@ -320,6 +332,7 @@ const configSchema = v.looseObject({
|
|
|
320
332
|
v.record(
|
|
321
333
|
v.string(),
|
|
322
334
|
v.looseObject({
|
|
335
|
+
default_skills: v.optional(skillIdsSchema),
|
|
323
336
|
default_model_profile: v.optional(v.string()),
|
|
324
337
|
allowed_model_profiles: v.optional(v.pipe(stringArraySchema, v.nonEmpty())),
|
|
325
338
|
worker_runtime_profile: v.optional(v.string()),
|
|
@@ -350,6 +363,7 @@ const configSchema = v.looseObject({
|
|
|
350
363
|
sources: stringArraySchema,
|
|
351
364
|
}),
|
|
352
365
|
auth: v.optional(authConfigSchema),
|
|
366
|
+
default_skills: v.optional(skillIdsSchema),
|
|
353
367
|
docker_registries: v.optional(
|
|
354
368
|
v.strictObject({
|
|
355
369
|
profiles: v.record(v.string(), v.strictObject(dockerRegistryCredentialSchema.entries)),
|
|
@@ -381,6 +395,7 @@ const configSchema = v.looseObject({
|
|
|
381
395
|
api_server_url: v.optional(v.string()),
|
|
382
396
|
default_worker_runtime_profile: v.optional(v.string()),
|
|
383
397
|
worker_service_account: v.optional(v.string()),
|
|
398
|
+
image_preload: v.optional(v.strictObject({ enabled: v.boolean() })),
|
|
384
399
|
process_volume: v.looseObject({
|
|
385
400
|
storage_class_name: v.optional(v.string()),
|
|
386
401
|
pre_provision: v.optional(
|
|
@@ -392,8 +407,11 @@ const configSchema = v.looseObject({
|
|
|
392
407
|
}),
|
|
393
408
|
docker: v.optional(
|
|
394
409
|
v.strictObject({
|
|
410
|
+
worker_runtime_profile: v.optional(v.pipe(v.string(), v.trim(), v.nonEmpty())),
|
|
411
|
+
node_selector: v.optional(v.record(v.string(), v.string())),
|
|
395
412
|
runtime_class_name: v.optional(v.string()),
|
|
396
413
|
host_users: v.optional(v.boolean()),
|
|
414
|
+
isolation: v.optional(v.picklist(["gvisor", "virtual-machine"])),
|
|
397
415
|
gvisor: v.optional(v.boolean()),
|
|
398
416
|
process_storage_class_name: v.optional(v.string()),
|
|
399
417
|
network: v.optional(dockerNetworkSchema),
|
|
@@ -495,6 +513,11 @@ function collectModelProfileReferenceErrors(config: LeitwerkConfig): string[] {
|
|
|
495
513
|
.filter((profileId) => typeof profileId === "string" && profileId.trim() !== ""),
|
|
496
514
|
);
|
|
497
515
|
const titleModelProfile = config.pi.process_title_generation.model_profile;
|
|
516
|
+
if (!configuredModelProfileIds.has(config.pi.default_model_profile)) {
|
|
517
|
+
errors.push(
|
|
518
|
+
`Unknown model profile '${config.pi.default_model_profile}' at pi.default_model_profile`,
|
|
519
|
+
);
|
|
520
|
+
}
|
|
498
521
|
if (typeof titleModelProfile === "string") {
|
|
499
522
|
if (titleModelProfile.trim() === "") {
|
|
500
523
|
errors.push(
|
|
@@ -560,6 +583,10 @@ function collectWorkerRuntimeProfileErrors(config: LeitwerkConfig): string[] {
|
|
|
560
583
|
config.kubernetes?.default_worker_runtime_profile,
|
|
561
584
|
"kubernetes.default_worker_runtime_profile",
|
|
562
585
|
);
|
|
586
|
+
checkReference(
|
|
587
|
+
config.kubernetes?.docker?.worker_runtime_profile,
|
|
588
|
+
"kubernetes.docker.worker_runtime_profile",
|
|
589
|
+
);
|
|
563
590
|
}
|
|
564
591
|
for (const [key, component] of Object.entries(config.components)) {
|
|
565
592
|
checkReference(component.worker_runtime_profile, `components.${key}.worker_runtime_profile`);
|
|
@@ -737,6 +764,14 @@ function collectKubernetesRunnerConfigErrors(config: LeitwerkConfig): string[] {
|
|
|
737
764
|
errors.push(
|
|
738
765
|
"worker_runtime_profiles must include at least one profile when workers.runner is 'kubernetes'",
|
|
739
766
|
);
|
|
767
|
+
if (k.image_preload?.enabled) {
|
|
768
|
+
for (const [id, profile] of Object.entries(config.worker_runtime_profiles ?? {})) {
|
|
769
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9._:/-]*@sha256:[0-9a-f]{64}$/.test(profile.image))
|
|
770
|
+
errors.push(
|
|
771
|
+
`worker_runtime_profiles.${id}.image must be digest-qualified when kubernetes.image_preload.enabled is true`,
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
740
775
|
const defaultProfile = k.default_worker_runtime_profile ?? config.workers.default_runtime_profile;
|
|
741
776
|
if (!defaultProfile?.trim())
|
|
742
777
|
errors.push(
|
|
@@ -935,6 +970,7 @@ function validateResolvedConfig(config: Record<string, unknown>): string[] {
|
|
|
935
970
|
...collectLocalRunnerConfigErrors(resolvedConfig),
|
|
936
971
|
...collectDockerRunnerConfigErrors(resolvedConfig),
|
|
937
972
|
...collectKubernetesRunnerConfigErrors(resolvedConfig),
|
|
973
|
+
...resolveKubernetesDockerIsolation(resolvedConfig.kubernetes?.docker).errors,
|
|
938
974
|
...collectInternalTlsConfigErrors(resolvedConfig),
|
|
939
975
|
...collectAuthConfigErrors(resolvedConfig),
|
|
940
976
|
];
|
|
@@ -974,7 +1010,7 @@ export function sanitizeConfigForLogging(value: unknown, path: readonly string[]
|
|
|
974
1010
|
return sanitized;
|
|
975
1011
|
}
|
|
976
1012
|
|
|
977
|
-
/** @public */
|
|
1013
|
+
/** Configuration template; set model_profiles and default_model_profile before startup. @public */
|
|
978
1014
|
export function getDefaultConfig(): LeitwerkConfig {
|
|
979
1015
|
return {
|
|
980
1016
|
skill_repositories: [],
|
|
@@ -1028,6 +1064,7 @@ export function getDefaultConfig(): LeitwerkConfig {
|
|
|
1028
1064
|
pi: {
|
|
1029
1065
|
agent_dir: "~/.pi/leitwerk",
|
|
1030
1066
|
model_profiles: [],
|
|
1067
|
+
default_model_profile: "",
|
|
1031
1068
|
process_title_generation: {
|
|
1032
1069
|
model_profile: null,
|
|
1033
1070
|
retry: {
|
|
@@ -1048,6 +1085,7 @@ export function getDefaultConfig(): LeitwerkConfig {
|
|
|
1048
1085
|
},
|
|
1049
1086
|
},
|
|
1050
1087
|
process_configs: {},
|
|
1088
|
+
default_skills: [],
|
|
1051
1089
|
notifications: {
|
|
1052
1090
|
all: { enabled: false, type: "teams_webhook", url: "" },
|
|
1053
1091
|
debug: { enabled: false, type: "teams_webhook", url: "" },
|
|
@@ -165,11 +165,17 @@ export interface KubernetesProcessVolumeConfig {
|
|
|
165
165
|
|
|
166
166
|
/** @internal */
|
|
167
167
|
export interface KubernetesDockerConfig {
|
|
168
|
+
/** Default profile for Docker processes without an explicit process/component profile. @internal */
|
|
169
|
+
worker_runtime_profile?: string;
|
|
170
|
+
/** Docker-only selector keys override matching global Pod selector keys. @internal */
|
|
171
|
+
node_selector?: Record<string, string>;
|
|
168
172
|
/** Pod RuntimeClass selected for every Docker-requiring process. @internal */
|
|
169
173
|
runtime_class_name?: string;
|
|
170
174
|
/** Pod user-namespace policy passed directly to spec.hostUsers. @internal */
|
|
171
175
|
host_users?: boolean;
|
|
172
|
-
/**
|
|
176
|
+
/** Trusted sandbox policy for a separately qualified cluster runtime. @internal */
|
|
177
|
+
isolation?: "gvisor" | "virtual-machine";
|
|
178
|
+
/** Legacy alias for isolation: gvisor when isolation is omitted. @internal */
|
|
173
179
|
gvisor?: boolean;
|
|
174
180
|
/** StorageClass selected for the process's single retained PVC. @internal */
|
|
175
181
|
process_storage_class_name?: string;
|
|
@@ -217,6 +223,11 @@ export interface LocalWorkerRunnerConfig {
|
|
|
217
223
|
|
|
218
224
|
/** @internal */
|
|
219
225
|
export interface KubernetesRunnerConfig {
|
|
226
|
+
/** Optional worker image preparation on eligible nodes; disabled by default. @internal */
|
|
227
|
+
image_preload?: {
|
|
228
|
+
/** @internal */
|
|
229
|
+
enabled: boolean;
|
|
230
|
+
};
|
|
220
231
|
/** Dedicated namespace where the singleton server runs. @internal */
|
|
221
232
|
server_namespace: string;
|
|
222
233
|
/** Safe DNS prefix used to derive one namespace per process instance. @internal */
|
|
@@ -394,6 +405,8 @@ export interface LeitwerkConfig extends ConfigSnapshot {
|
|
|
394
405
|
internal_tls?: InternalTlsConfig;
|
|
395
406
|
/** Git repositories scanned for operator-managed skills. @internal */
|
|
396
407
|
skill_repositories?: SkillRepositoryConfig[];
|
|
408
|
+
/** Installed skill IDs included in new launches unless replaced by process defaults. @public */
|
|
409
|
+
default_skills?: string[];
|
|
397
410
|
/** Server-owned repository-aware commit-message generation rules. @internal */
|
|
398
411
|
commit_messages?: CommitMessageConfig;
|
|
399
412
|
/** Bounded archive and extraction ceilings for local session transfer. @internal */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { KubernetesDockerConfig } from "./config-types.js";
|
|
2
|
+
|
|
3
|
+
/** Normalize trusted sandbox selection before passing it to a worker runner. @internal */
|
|
4
|
+
export function resolveKubernetesDockerIsolation(docker: KubernetesDockerConfig | undefined): {
|
|
5
|
+
isolation: KubernetesDockerConfig["isolation"];
|
|
6
|
+
errors: string[];
|
|
7
|
+
} {
|
|
8
|
+
const isolation = docker?.isolation ?? (docker?.gvisor ? "gvisor" : undefined);
|
|
9
|
+
const errors: string[] = [];
|
|
10
|
+
if (
|
|
11
|
+
docker?.isolation !== undefined &&
|
|
12
|
+
docker.gvisor !== undefined &&
|
|
13
|
+
docker.gvisor !== (docker.isolation === "gvisor")
|
|
14
|
+
) {
|
|
15
|
+
errors.push("kubernetes.docker.gvisor conflicts with kubernetes.docker.isolation");
|
|
16
|
+
}
|
|
17
|
+
if (isolation !== undefined && docker?.host_users !== undefined) {
|
|
18
|
+
errors.push("kubernetes.docker.host_users must be omitted for sandbox isolation");
|
|
19
|
+
}
|
|
20
|
+
return { isolation, errors };
|
|
21
|
+
}
|