@leitwerk-dev/server 0.3.1 → 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-BuJCdkvy.d.ts → app-CsuxFZT5.d.ts} +262 -121
- 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-QCHS3X33.js → chunk-FPMDWQF7.js} +2617 -562
- package/dist/chunk-FPMDWQF7.js.map +1 -0
- package/dist/{chunk-HK6BLLHA.js → chunk-MBHRCQFE.js} +2303 -1576
- 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/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 +4 -0
- 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/repositories.d.ts +12 -0
- package/dist/db/repositories.d.ts.map +1 -1
- package/dist/db/schema.d.ts +693 -2
- 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.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.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 +1 -6
- package/dist/process-action-presenter.d.ts.map +1 -1
- 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.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 +5 -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-turn-outcome-writes.d.ts +2 -0
- package/dist/process-engine/writes/build-turn-outcome-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/writes.d.ts +28 -60
- 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-trace.d.ts.map +1 -1
- package/dist/process-ui-snapshot-presenter.d.ts +14 -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-model-config.d.ts +4 -0
- package/dist/routes/process-model-config.d.ts.map +1 -0
- package/dist/routes/process-route-helpers.d.ts +8 -9
- 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.map +1 -1
- package/dist/supervisor/worker-supervisor.d.ts +2 -0
- package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
- 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.js +2 -1
- 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 +115 -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 +131 -40
- package/src/db/execution-inspection-repo.ts +163 -0
- package/src/db/history-window.ts +18 -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 +45 -12
- package/src/db/publication-repo.ts +63 -0
- package/src/db/repositories.ts +17 -0
- package/src/db/schema.ts +103 -1
- 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 +8 -2
- 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 -193
- 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 +7 -8
- package/src/integration-tool-registry.ts +59 -26
- 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 +22 -57
- package/src/process-action-registry.ts +31 -39
- package/src/process-engine/decision.ts +10 -0
- package/src/process-engine/engine.ts +11 -2
- package/src/process-engine/mapped-turns.ts +5 -7
- 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 +9 -13
- package/src/process-engine/ops/start-process.ts +34 -2
- package/src/process-engine/ops/turn-outcome.ts +61 -60
- 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 +21 -5
- 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 +9 -0
- package/src/process-engine/writes/build-process-abort-writes.ts +30 -20
- package/src/process-engine/writes/build-turn-outcome-writes.ts +39 -2
- package/src/process-engine/writes/commit-writes.ts +15 -2
- package/src/process-engine/writes/writes.ts +59 -74
- 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-trace.ts +12 -24
- package/src/process-ui-snapshot-presenter.ts +210 -295
- package/src/routes/future-executions.ts +5 -5
- package/src/routes/launchers.ts +51 -1
- package/src/routes/process-actions.ts +9 -9
- package/src/routes/process-detail.ts +25 -2
- package/src/routes/process-model-config.ts +70 -0
- package/src/routes/process-route-helpers.ts +153 -162
- 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 +2 -0
- package/src/supervisor/worker-event-ingestor.ts +30 -14
- package/src/supervisor/worker-start-payload-builder.ts +17 -0
- package/src/supervisor/worker-supervisor.ts +3 -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/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-MSJXFK33.js +0 -8
- package/dist/chunk-HK6BLLHA.js.map +0 -1
- package/dist/chunk-QCHS3X33.js.map +0 -1
- /package/dist/{app-MSJXFK33.js.map → app-JM4CBTND.js.map} +0 -0
|
@@ -82,6 +82,8 @@ export interface SupervisorDeps
|
|
|
82
82
|
/** @internal */
|
|
83
83
|
startupObservations?: RepositoryBundle["startupObservations"];
|
|
84
84
|
/** @internal */
|
|
85
|
+
executionInspections?: RepositoryBundle["executionInspections"];
|
|
86
|
+
/** @internal */
|
|
85
87
|
mappedRuns?: RepositoryBundle["mappedRuns"];
|
|
86
88
|
/** @internal */
|
|
87
89
|
config: LeitwerkConfig;
|
|
@@ -717,6 +719,7 @@ export function createWorkerSupervisor(deps: SupervisorDeps): WorkerSupervisor {
|
|
|
717
719
|
config: deps.config,
|
|
718
720
|
processId: process.processId,
|
|
719
721
|
componentKeys: deps.projects.listByInstance(process.id).map((project) => project.key),
|
|
722
|
+
docker: deps.processGraphs.get(process.processId)?.runtime?.docker === true,
|
|
720
723
|
}),
|
|
721
724
|
);
|
|
722
725
|
if (!selection.ok) {
|
|
@@ -46,6 +46,7 @@ export async function prepareAcceptedFixtureStart(
|
|
|
46
46
|
const result = await prepareCreatedTurnStarts(
|
|
47
47
|
{
|
|
48
48
|
config: ctx.config,
|
|
49
|
+
processModelPolicy: ctx.deps.processModelPolicy,
|
|
49
50
|
registry: ctx.modelProviderRegistry,
|
|
50
51
|
modelStatusCache: ctx.modelStatusCache,
|
|
51
52
|
piContributions: contributions,
|
|
@@ -114,6 +114,7 @@ export function createModelAvailabilitySnapshot(
|
|
|
114
114
|
|
|
115
115
|
export function createTestModelPolicy(
|
|
116
116
|
input: {
|
|
117
|
+
defaultProfileId?: string;
|
|
117
118
|
profiles?: readonly {
|
|
118
119
|
id: string;
|
|
119
120
|
model_id?: string;
|
|
@@ -132,6 +133,7 @@ export function createTestModelPolicy(
|
|
|
132
133
|
processActionRegistry: { getTurnDefinition: () => ReturnType<typeof createTestLlmTurn> };
|
|
133
134
|
} {
|
|
134
135
|
const config = getDefaultConfig();
|
|
136
|
+
config.pi.default_model_profile = input.defaultProfileId ?? "first";
|
|
135
137
|
config.pi.model_profiles = (
|
|
136
138
|
input.profiles ?? [
|
|
137
139
|
{ id: "first", model_id: "one" },
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { ExtensionCatalog } from "@leitwerk-dev/extension-runtime";
|
|
2
|
+
import { buildExtensionCatalogFromModules } from "@leitwerk-dev/extension-runtime/testing";
|
|
3
|
+
import type { LeitwerkExtensionModule, SettingDefinition } from "@leitwerk-dev/process-sdk";
|
|
4
|
+
import { getDefaultConfig } from "../config/config-loader.js";
|
|
5
|
+
import { createAllRepos } from "../db/repositories.js";
|
|
6
|
+
import { buildProcessActionRegistry } from "../process-action-registry.js";
|
|
7
|
+
import { createServerProcessModelPolicy } from "../process-model-policy/index.js";
|
|
8
|
+
import { createScopedSettingsService } from "../scoped-settings-service.js";
|
|
9
|
+
import { createOwnedInMemoryDatabase } from "./owned-test-deps.js";
|
|
10
|
+
import {
|
|
11
|
+
createFixtureHumanTurn,
|
|
12
|
+
createFixtureLlmTurn,
|
|
13
|
+
createFixtureProcess,
|
|
14
|
+
} from "./process-fixtures.js";
|
|
15
|
+
|
|
16
|
+
export const reportLabel: SettingDefinition<string> = {
|
|
17
|
+
key: "settings-test.report_label",
|
|
18
|
+
schemaVersion: 1,
|
|
19
|
+
defaultValue: "Default report",
|
|
20
|
+
scopes: [
|
|
21
|
+
"instance",
|
|
22
|
+
"settings-test.issue-type",
|
|
23
|
+
"settings-test.project",
|
|
24
|
+
"settings-test.project-issue-type",
|
|
25
|
+
],
|
|
26
|
+
merge: "replace",
|
|
27
|
+
schema: {
|
|
28
|
+
parse(value) {
|
|
29
|
+
if (typeof value !== "string") throw new Error("Expected text");
|
|
30
|
+
return value;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
form: { label: "Report label", control: "textarea", group: "Planning" },
|
|
34
|
+
};
|
|
35
|
+
export const repositoryLabel: SettingDefinition<string> = {
|
|
36
|
+
...reportLabel,
|
|
37
|
+
key: "settings-test.repository_label",
|
|
38
|
+
scopes: ["instance", "repository"],
|
|
39
|
+
};
|
|
40
|
+
export const model: SettingDefinition<string | null> = {
|
|
41
|
+
key: "settings-test.model",
|
|
42
|
+
schemaVersion: 1,
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
scopes: ["instance", "repository"],
|
|
45
|
+
merge: "replace",
|
|
46
|
+
schema: {
|
|
47
|
+
parse(value) {
|
|
48
|
+
if (value === null || typeof value === "string") return value;
|
|
49
|
+
throw new Error("Expected a model profile");
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
form: { label: "Planning model", control: "model", group: "Planning" },
|
|
53
|
+
};
|
|
54
|
+
const process = createFixtureProcess({
|
|
55
|
+
id: "settings_process",
|
|
56
|
+
entry: "run",
|
|
57
|
+
turns: {
|
|
58
|
+
run: createFixtureLlmTurn("Plan", { executionPurpose: "settings-test.planning" }),
|
|
59
|
+
review: createFixtureHumanTurn({
|
|
60
|
+
actions: { proceed: { label: "Proceed", acceptanceState: "accepted", to: "run" } },
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
export const settingsExtension: LeitwerkExtensionModule = {
|
|
65
|
+
manifest: { id: "settings-test", version: "1" },
|
|
66
|
+
scopedSettings: {
|
|
67
|
+
scopes: [
|
|
68
|
+
{ id: "settings-test.issue-type", label: "Issue type" },
|
|
69
|
+
{ id: "settings-test.project", label: "Project" },
|
|
70
|
+
{ id: "settings-test.project-issue-type", label: "Project + issue type" },
|
|
71
|
+
],
|
|
72
|
+
settings: [reportLabel, repositoryLabel, model],
|
|
73
|
+
purposes: [
|
|
74
|
+
{
|
|
75
|
+
id: "settings-test.planning",
|
|
76
|
+
label: "Planning",
|
|
77
|
+
modelSettingKey: model.key,
|
|
78
|
+
settingKeys: [reportLabel.key, repositoryLabel.key],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
setupCatalog(api) {
|
|
83
|
+
api.registerProcess(process);
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export function createSettingsProcess(repos: ReturnType<typeof createAllRepos>, keys: string[]) {
|
|
88
|
+
const process = repos.processes.create({ processId: "settings_process", selectedTurnId: "run" });
|
|
89
|
+
for (const key of keys)
|
|
90
|
+
repos.projects.create({
|
|
91
|
+
instanceId: process.id,
|
|
92
|
+
key,
|
|
93
|
+
repoLocator: `/workspace/${key}`,
|
|
94
|
+
baseBranch: "main",
|
|
95
|
+
});
|
|
96
|
+
return process;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export async function createSettingsFixture(
|
|
100
|
+
repos = createAllRepos(createOwnedInMemoryDatabase()),
|
|
101
|
+
modules = [settingsExtension],
|
|
102
|
+
) {
|
|
103
|
+
const catalog: ExtensionCatalog = await buildExtensionCatalogFromModules(modules);
|
|
104
|
+
const config = getDefaultConfig();
|
|
105
|
+
config.pi.default_model_profile = "first";
|
|
106
|
+
config.pi.model_profiles = [
|
|
107
|
+
{ id: "first", provider: "test", model_id: "one" },
|
|
108
|
+
{ id: "second", provider: "test", model_id: "two" },
|
|
109
|
+
];
|
|
110
|
+
config.process_configs = modules.length
|
|
111
|
+
? {
|
|
112
|
+
settings_process: {
|
|
113
|
+
default_model_profile: "first",
|
|
114
|
+
turn_configs: { run: { model_profile: "first" } },
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
: {};
|
|
118
|
+
const settings = createScopedSettingsService({ repos, catalog, config });
|
|
119
|
+
const policy = createServerProcessModelPolicy({
|
|
120
|
+
config,
|
|
121
|
+
processGraphs: catalog.processes,
|
|
122
|
+
processActionRegistry: buildProcessActionRegistry(catalog),
|
|
123
|
+
scopedSettings: settings,
|
|
124
|
+
});
|
|
125
|
+
return { repos, catalog, config, settings, policy };
|
|
126
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createCanonicalPiResourceBundle } from "@leitwerk-dev/worker-protocol";
|
|
2
|
+
import type { RepositoryBundle } from "../db/repositories.js";
|
|
3
|
+
|
|
4
|
+
/** Installs a synthetic catalog skill using the operator registration path. @internal */
|
|
5
|
+
export function installTestSkill(
|
|
6
|
+
repos: Pick<RepositoryBundle, "skills">,
|
|
7
|
+
id: string,
|
|
8
|
+
content = "Synthetic skill instructions.",
|
|
9
|
+
) {
|
|
10
|
+
const repositoryId = `test-${id}`;
|
|
11
|
+
repos.skills.mergeCatalog(repositoryId, [
|
|
12
|
+
{
|
|
13
|
+
skillId: id,
|
|
14
|
+
label: id,
|
|
15
|
+
description: "Synthetic skill",
|
|
16
|
+
sourcePath: `skills/${id}`,
|
|
17
|
+
sourceRevision: null,
|
|
18
|
+
bundle: createCanonicalPiResourceBundle([
|
|
19
|
+
{
|
|
20
|
+
path: `skills/${id}/SKILL.md`,
|
|
21
|
+
content: Buffer.from(`---\nname: ${id}\ndescription: Synthetic skill\n---\n${content}\n`),
|
|
22
|
+
},
|
|
23
|
+
]),
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
26
|
+
repos.skills.registerCatalogEntry(repositoryId, id);
|
|
27
|
+
return repos.skills.resolveActive([id]);
|
|
28
|
+
}
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
} from "@leitwerk-dev/domain";
|
|
6
6
|
import type { RepositoryBundle } from "./db/repositories.js";
|
|
7
7
|
import type { ProcessOperationCoordinator } from "./process-operation-coordinator.js";
|
|
8
|
+
import type { Broadcaster } from "./ws/broadcast.js";
|
|
8
9
|
|
|
9
10
|
/** @internal */
|
|
10
11
|
export type ToolApprovalDecision =
|
|
@@ -62,8 +63,20 @@ export function createToolApprovalGate(input: {
|
|
|
62
63
|
repos: ToolApprovalRepos;
|
|
63
64
|
/** @internal */
|
|
64
65
|
processOperations: ProcessOperationCoordinator;
|
|
66
|
+
/** @internal */
|
|
67
|
+
broadcaster: Pick<Broadcaster, "sendDurable">;
|
|
65
68
|
}) {
|
|
66
69
|
const waiters = new Map<string, Set<(decision: ToolApprovalDecision) => void>>();
|
|
70
|
+
const notify = (instanceId: string) =>
|
|
71
|
+
input.broadcaster.sendDurable(
|
|
72
|
+
"process.event",
|
|
73
|
+
{
|
|
74
|
+
eventType: "tool_approval_updated",
|
|
75
|
+
level: "info",
|
|
76
|
+
message: "Issue approval updated",
|
|
77
|
+
},
|
|
78
|
+
instanceId,
|
|
79
|
+
);
|
|
67
80
|
/** @internal */
|
|
68
81
|
function reconcile(instanceId: string): void {
|
|
69
82
|
for (const request of input.repos.toolApprovalRequests.listByInstance(instanceId)) {
|
|
@@ -95,6 +108,7 @@ export function createToolApprovalGate(input: {
|
|
|
95
108
|
const result = input.repos.toolApprovalRequests.createIdempotent(requestInput);
|
|
96
109
|
const decision = resolvedDecision(result.request);
|
|
97
110
|
if (decision) return decision;
|
|
111
|
+
if (result.kind === "created") notify(requestInput.instanceId);
|
|
98
112
|
return await new Promise<ToolApprovalDecision>((resolve) => {
|
|
99
113
|
const pending = waiters.get(result.request.id) ?? new Set();
|
|
100
114
|
pending.add(resolve);
|
|
@@ -130,12 +144,14 @@ export function createToolApprovalGate(input: {
|
|
|
130
144
|
});
|
|
131
145
|
}),
|
|
132
146
|
);
|
|
147
|
+
if (resolved) notify(instanceId);
|
|
133
148
|
reconcile(instanceId);
|
|
134
149
|
return resolved;
|
|
135
150
|
},
|
|
136
151
|
/** @internal */
|
|
137
152
|
cancelTurn(instanceId: string, turnRecordId: string): number {
|
|
138
153
|
const changed = input.repos.toolApprovalRequests.cancelOpenByTurn(instanceId, turnRecordId);
|
|
154
|
+
if (changed) notify(instanceId);
|
|
139
155
|
reconcile(instanceId);
|
|
140
156
|
return changed;
|
|
141
157
|
},
|
package/src/turn-progress.ts
CHANGED
|
@@ -60,6 +60,7 @@ export function normalizeTurnProgressReport(value: unknown): TurnProgressReport
|
|
|
60
60
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
61
61
|
const raw = value as Record<string, unknown>;
|
|
62
62
|
const title = text(raw.title, 160);
|
|
63
|
+
const summary = text(raw.summary, 2000);
|
|
63
64
|
if (!title || !Array.isArray(raw.steps) || raw.steps.length > 50) return null;
|
|
64
65
|
const ids = new Set<string>();
|
|
65
66
|
const steps = raw.steps.flatMap((value) => {
|
|
@@ -81,13 +82,13 @@ export function normalizeTurnProgressReport(value: unknown): TurnProgressReport
|
|
|
81
82
|
},
|
|
82
83
|
];
|
|
83
84
|
});
|
|
84
|
-
if (steps.length !== raw.steps.length || steps.length === 0) return null;
|
|
85
|
+
if (steps.length !== raw.steps.length || (steps.length === 0 && !summary)) return null;
|
|
85
86
|
const links = normalizeTurnProgressLinks(raw.links);
|
|
86
87
|
if (!links) return null;
|
|
87
88
|
return {
|
|
88
89
|
title,
|
|
89
90
|
steps,
|
|
90
|
-
...(
|
|
91
|
+
...(summary ? { summary } : {}),
|
|
91
92
|
...(links.length > 0 ? { links } : {}),
|
|
92
93
|
};
|
|
93
94
|
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { assertRepoLocator } from "@leitwerk-dev/domain";
|
|
2
|
+
import {
|
|
3
|
+
type InitialProcessBinding,
|
|
4
|
+
RetryableWaitError,
|
|
5
|
+
type TurnWaitContext,
|
|
6
|
+
} from "@leitwerk-dev/process-sdk";
|
|
7
|
+
import type { CommitMessageConfig } from "./config/config-types.js";
|
|
8
|
+
import type { RepositoryBundle } from "./db/repositories.js";
|
|
9
|
+
import type { ProcessActionRegistry } from "./process-action-registry.js";
|
|
10
|
+
import { ArmTurnWait, ResolveTurnWait } from "./process-engine/ops/turn-wait.js";
|
|
11
|
+
import { pendingTurnWait, turnWaitPredicate } from "./process-engine/turn-wait-state.js";
|
|
12
|
+
import type { ProcessEngine } from "./process-engine/types.js";
|
|
13
|
+
import type { ProcessGraphRegistry } from "./process-graph.js";
|
|
14
|
+
import { normalizeProjectInputs } from "./process-launch-plan.js";
|
|
15
|
+
|
|
16
|
+
interface TurnWaitServiceDeps {
|
|
17
|
+
processes: RepositoryBundle["processes"];
|
|
18
|
+
projects: RepositoryBundle["projects"];
|
|
19
|
+
processGraphs: ProcessGraphRegistry;
|
|
20
|
+
registry: Pick<ProcessActionRegistry, "resolveContextData">;
|
|
21
|
+
commands: ProcessEngine;
|
|
22
|
+
require: TurnWaitContext["require"];
|
|
23
|
+
now?: () => number;
|
|
24
|
+
pollIntervalMs?: number;
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
commitMessages?: CommitMessageConfig;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Runs read-only predicates outside lifecycle locks. The engine fences every result. */
|
|
30
|
+
export function createTurnWaitService(deps: TurnWaitServiceDeps) {
|
|
31
|
+
const running = new Map<string, Promise<void>>();
|
|
32
|
+
const controllers = new Set<AbortController>();
|
|
33
|
+
const now = deps.now ?? Date.now;
|
|
34
|
+
const interval = deps.pollIntervalMs ?? 30_000;
|
|
35
|
+
let stopped = false;
|
|
36
|
+
let activeChecks = 0;
|
|
37
|
+
const queued: Array<() => void> = [];
|
|
38
|
+
function schedule(work: () => Promise<void>): Promise<void> {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const start = () => {
|
|
41
|
+
if (stopped) {
|
|
42
|
+
resolve();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
activeChecks++;
|
|
46
|
+
void work()
|
|
47
|
+
.then(resolve, reject)
|
|
48
|
+
.finally(() => {
|
|
49
|
+
activeChecks--;
|
|
50
|
+
queued.shift()?.();
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
if (activeChecks < 4) start();
|
|
54
|
+
else queued.push(start);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (!Number.isFinite(interval) || interval <= 0) throw new Error("Invalid wait polling interval");
|
|
58
|
+
|
|
59
|
+
async function evaluate(instanceId: string): Promise<void> {
|
|
60
|
+
let process = deps.processes.getById(instanceId);
|
|
61
|
+
if (!process || !turnWaitPredicate(deps.processGraphs, process)) return;
|
|
62
|
+
if (!pendingTurnWait(process)) {
|
|
63
|
+
if (process.currentExecution || process.lifecycleStatus !== "active") return;
|
|
64
|
+
await deps.commands.run(ArmTurnWait, { instanceId });
|
|
65
|
+
process = deps.processes.getById(instanceId);
|
|
66
|
+
}
|
|
67
|
+
if (!process || stopped) return;
|
|
68
|
+
const wait = pendingTurnWait(process);
|
|
69
|
+
if (
|
|
70
|
+
!wait ||
|
|
71
|
+
wait.status !== "waiting" ||
|
|
72
|
+
process.lifecycleStatus !== "waiting" ||
|
|
73
|
+
wait.nextCheckAt > now()
|
|
74
|
+
)
|
|
75
|
+
return;
|
|
76
|
+
const predicate = turnWaitPredicate(deps.processGraphs, process);
|
|
77
|
+
if (!predicate) return;
|
|
78
|
+
const projects = deps.projects.listByInstance(instanceId);
|
|
79
|
+
const controller = new AbortController();
|
|
80
|
+
controllers.add(controller);
|
|
81
|
+
let state: unknown;
|
|
82
|
+
let nextStateJson: string | undefined;
|
|
83
|
+
let result: "ready" | "waiting" | "complete" | "abort" | "bind" | "retry" | "error";
|
|
84
|
+
let initialBinding: InitialProcessBinding | undefined;
|
|
85
|
+
let message: string | undefined;
|
|
86
|
+
let timeout: ReturnType<typeof setTimeout> | undefined;
|
|
87
|
+
let onAbort: (() => void) | undefined;
|
|
88
|
+
try {
|
|
89
|
+
const data = deps.registry.resolveContextData(process.processId, process);
|
|
90
|
+
const context: TurnWaitContext = {
|
|
91
|
+
process: structuredClone(process),
|
|
92
|
+
projects: structuredClone(projects),
|
|
93
|
+
params: data.params,
|
|
94
|
+
state: data.state,
|
|
95
|
+
signal: controller.signal,
|
|
96
|
+
require: deps.require,
|
|
97
|
+
setState(value) {
|
|
98
|
+
if (!controller.signal.aborted) state = value;
|
|
99
|
+
},
|
|
100
|
+
complete: () => ({ kind: "complete" }),
|
|
101
|
+
waiting: (message) => ({ kind: "waiting", message }),
|
|
102
|
+
abort: (message) => ({ kind: "abort", message }),
|
|
103
|
+
bindInitialProjects: (binding) => ({ kind: "bind", binding }),
|
|
104
|
+
};
|
|
105
|
+
const timedOut = new Promise<never>((_, reject) => {
|
|
106
|
+
onAbort = () => reject(new RetryableWaitError("Waiting condition interrupted"));
|
|
107
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
108
|
+
timeout = setTimeout(() => {
|
|
109
|
+
reject(new RetryableWaitError("Waiting condition timed out"));
|
|
110
|
+
controller.abort();
|
|
111
|
+
}, deps.timeoutMs ?? 30_000);
|
|
112
|
+
});
|
|
113
|
+
const value = await Promise.race([
|
|
114
|
+
Promise.resolve().then(() => predicate(context)),
|
|
115
|
+
timedOut,
|
|
116
|
+
]);
|
|
117
|
+
if (typeof value === "boolean") result = value ? "ready" : "waiting";
|
|
118
|
+
else if (value && value.kind === "complete") result = "complete";
|
|
119
|
+
else if (value && (value.kind === "waiting" || value.kind === "abort")) {
|
|
120
|
+
if (typeof value.message !== "string" || !value.message.trim())
|
|
121
|
+
throw new Error("Readiness guidance must be nonempty text");
|
|
122
|
+
result = value.kind;
|
|
123
|
+
message = value.message.slice(0, 2000);
|
|
124
|
+
} else if (value?.kind === "bind") {
|
|
125
|
+
if (!wait.initialSelection || projects.length || !value.binding.projects.length)
|
|
126
|
+
throw new Error(
|
|
127
|
+
"Initial repository binding requires an unstarted process without projects",
|
|
128
|
+
);
|
|
129
|
+
const codec = deps.processGraphs.get(process.processId)?.paramsCodec;
|
|
130
|
+
if (!codec) throw new Error("Process params codec is unavailable");
|
|
131
|
+
const keys = new Set<string>();
|
|
132
|
+
for (const project of value.binding.projects) {
|
|
133
|
+
if (
|
|
134
|
+
!/^[a-zA-Z0-9_-]+$/.test(project.key) ||
|
|
135
|
+
keys.has(project.key) ||
|
|
136
|
+
!project.baseBranch?.trim()
|
|
137
|
+
)
|
|
138
|
+
throw new Error("Invalid initial repository binding");
|
|
139
|
+
assertRepoLocator(project.repoLocator);
|
|
140
|
+
keys.add(project.key);
|
|
141
|
+
}
|
|
142
|
+
// Extension metadata cannot overwrite lifecycle or launch metadata.
|
|
143
|
+
if (
|
|
144
|
+
Object.keys(value.binding.metadata ?? {}).some(
|
|
145
|
+
(key) => key === "turnWait" || Object.hasOwn(process.metadata ?? {}, key),
|
|
146
|
+
)
|
|
147
|
+
)
|
|
148
|
+
throw new Error("Initial repository binding cannot replace retained metadata");
|
|
149
|
+
initialBinding = structuredClone({
|
|
150
|
+
params: codec.serialize(codec.parse(value.binding.params)),
|
|
151
|
+
projects: normalizeProjectInputs(value.binding, deps.commitMessages),
|
|
152
|
+
metadata: value.binding.metadata,
|
|
153
|
+
settingsContext: value.binding.settingsContext,
|
|
154
|
+
});
|
|
155
|
+
result = "bind";
|
|
156
|
+
} else throw new Error("Invalid turn readiness decision");
|
|
157
|
+
if (state !== undefined) {
|
|
158
|
+
const codec = deps.processGraphs.get(process.processId)?.stateCodec;
|
|
159
|
+
if (!codec) throw new Error("Process state codec is unavailable");
|
|
160
|
+
nextStateJson = JSON.stringify(codec.serialize(codec.parse(state)));
|
|
161
|
+
}
|
|
162
|
+
} catch (error) {
|
|
163
|
+
result = error instanceof RetryableWaitError ? "retry" : "error";
|
|
164
|
+
message = error instanceof Error ? error.message.slice(0, 500) : "Waiting condition failed";
|
|
165
|
+
} finally {
|
|
166
|
+
if (timeout) clearTimeout(timeout);
|
|
167
|
+
if (onAbort) controller.signal.removeEventListener("abort", onAbort);
|
|
168
|
+
controllers.delete(controller);
|
|
169
|
+
}
|
|
170
|
+
if (stopped) return;
|
|
171
|
+
await deps.commands.run(ResolveTurnWait, {
|
|
172
|
+
instanceId,
|
|
173
|
+
waitId: wait.id,
|
|
174
|
+
revision: wait.revision,
|
|
175
|
+
paramsJson: process.paramsJson,
|
|
176
|
+
stateJson: process.stateJson,
|
|
177
|
+
projectsJson: JSON.stringify(projects),
|
|
178
|
+
nextStateJson,
|
|
179
|
+
initialBinding,
|
|
180
|
+
result,
|
|
181
|
+
message,
|
|
182
|
+
now: now(),
|
|
183
|
+
pollIntervalMs: interval,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function check(instanceId: string): Promise<void> {
|
|
188
|
+
if (stopped) return Promise.resolve();
|
|
189
|
+
const current = running.get(instanceId);
|
|
190
|
+
if (current) return current;
|
|
191
|
+
// Defer evaluation until its single-flight identity is installed. Engine hooks can reenter.
|
|
192
|
+
const promise = Promise.resolve()
|
|
193
|
+
.then(() => schedule(() => evaluate(instanceId)))
|
|
194
|
+
.finally(() => running.delete(instanceId));
|
|
195
|
+
running.set(instanceId, promise);
|
|
196
|
+
return promise;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
check,
|
|
201
|
+
async poll() {
|
|
202
|
+
const errors: string[] = [];
|
|
203
|
+
const candidates = deps.processes
|
|
204
|
+
.listAll()
|
|
205
|
+
.filter(
|
|
206
|
+
(process) =>
|
|
207
|
+
["waiting", "active"].includes(process.lifecycleStatus) &&
|
|
208
|
+
turnWaitPredicate(deps.processGraphs, process),
|
|
209
|
+
);
|
|
210
|
+
await Promise.all(
|
|
211
|
+
candidates.map(async (process) => {
|
|
212
|
+
try {
|
|
213
|
+
await check(process.id);
|
|
214
|
+
} catch {
|
|
215
|
+
errors.push(`${process.id}:waiting_check_failed`);
|
|
216
|
+
}
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
219
|
+
return { errors };
|
|
220
|
+
},
|
|
221
|
+
async stop() {
|
|
222
|
+
stopped = true;
|
|
223
|
+
for (const start of queued.splice(0)) start();
|
|
224
|
+
for (const controller of controllers) controller.abort();
|
|
225
|
+
await Promise.allSettled(running.values());
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
@@ -151,6 +151,8 @@ export function buildRuntimeProfileSelectionInput(args: {
|
|
|
151
151
|
processId: string;
|
|
152
152
|
/** @internal */
|
|
153
153
|
componentKeys: string[];
|
|
154
|
+
/** The registered process definition requires Docker. @internal */
|
|
155
|
+
docker?: boolean;
|
|
154
156
|
}): RuntimeProfileSelectionInput {
|
|
155
157
|
const { config, processId, componentKeys } = args;
|
|
156
158
|
const componentProfiles: ComponentRuntimeProfileSelection[] = componentKeys.map((component) => ({
|
|
@@ -161,7 +163,12 @@ export function buildRuntimeProfileSelectionInput(args: {
|
|
|
161
163
|
processId,
|
|
162
164
|
processOverride: config.process_configs?.[processId]?.worker_runtime_profile,
|
|
163
165
|
componentProfiles,
|
|
164
|
-
defaultProfile:
|
|
166
|
+
defaultProfile:
|
|
167
|
+
(config.workers.runner === "kubernetes" && args.docker
|
|
168
|
+
? config.kubernetes?.docker?.worker_runtime_profile
|
|
169
|
+
: undefined) ??
|
|
170
|
+
defaultWorkerRuntimeProfile(config) ??
|
|
171
|
+
undefined,
|
|
165
172
|
profiles: config.worker_runtime_profiles ?? {},
|
|
166
173
|
};
|
|
167
174
|
}
|