@leitwerk-dev/process-sdk 0.1.0 → 0.1.2

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.
Files changed (153) hide show
  1. package/dist/git-binary.d.ts +4 -3
  2. package/dist/git-binary.js +25 -33
  3. package/dist/git-binary.js.map +1 -1
  4. package/dist/index.d.ts +1066 -35
  5. package/dist/index.js +4488 -28
  6. package/dist/index.js.map +1 -1
  7. package/dist/leaf-outcome-renderer.d.ts +7 -7
  8. package/dist/leaf-outcome-renderer.js +74 -64
  9. package/dist/leaf-outcome-renderer.js.map +1 -1
  10. package/dist/pi-config.d.ts +19 -15
  11. package/dist/pi-config.js +21 -180
  12. package/dist/pi-config.js.map +1 -1
  13. package/dist/review-flow.d.ts +13 -7
  14. package/dist/review-flow.js +12 -43
  15. package/dist/review-flow.js.map +1 -1
  16. package/dist/runtime-internals.d.ts +21 -3
  17. package/dist/runtime-internals.js +18 -2
  18. package/dist/runtime-internals.js.map +1 -1
  19. package/package.json +4 -4
  20. package/dist/browser-ui-extension.d.ts +0 -27
  21. package/dist/browser-ui-extension.d.ts.map +0 -1
  22. package/dist/browser-ui-extension.js +0 -2
  23. package/dist/browser-ui-extension.js.map +0 -1
  24. package/dist/capabilities.d.ts +0 -9
  25. package/dist/capabilities.d.ts.map +0 -1
  26. package/dist/capabilities.js +0 -7
  27. package/dist/capabilities.js.map +0 -1
  28. package/dist/codecs.d.ts +0 -3
  29. package/dist/codecs.d.ts.map +0 -1
  30. package/dist/codecs.js +0 -9
  31. package/dist/codecs.js.map +0 -1
  32. package/dist/commit-message.d.ts +0 -7
  33. package/dist/commit-message.d.ts.map +0 -1
  34. package/dist/commit-message.js +0 -3
  35. package/dist/commit-message.js.map +0 -1
  36. package/dist/core-capabilities.d.ts +0 -393
  37. package/dist/core-capabilities.d.ts.map +0 -1
  38. package/dist/core-capabilities.js +0 -6
  39. package/dist/core-capabilities.js.map +0 -1
  40. package/dist/define-process.d.ts +0 -269
  41. package/dist/define-process.d.ts.map +0 -1
  42. package/dist/define-process.js +0 -1040
  43. package/dist/define-process.js.map +0 -1
  44. package/dist/event-bus.d.ts +0 -3
  45. package/dist/event-bus.d.ts.map +0 -1
  46. package/dist/event-bus.js +0 -31
  47. package/dist/event-bus.js.map +0 -1
  48. package/dist/extension-api.d.ts +0 -425
  49. package/dist/extension-api.d.ts.map +0 -1
  50. package/dist/extension-api.js +0 -5
  51. package/dist/extension-api.js.map +0 -1
  52. package/dist/flow.d.ts +0 -456
  53. package/dist/flow.d.ts.map +0 -1
  54. package/dist/flow.js +0 -1557
  55. package/dist/flow.js.map +0 -1
  56. package/dist/form-contract.d.ts +0 -2
  57. package/dist/form-contract.d.ts.map +0 -1
  58. package/dist/form-contract.js +0 -2
  59. package/dist/form-contract.js.map +0 -1
  60. package/dist/fs-utils.d.ts +0 -3
  61. package/dist/fs-utils.d.ts.map +0 -1
  62. package/dist/fs-utils.js +0 -23
  63. package/dist/fs-utils.js.map +0 -1
  64. package/dist/git-binary.d.ts.map +0 -1
  65. package/dist/graph-fragments.d.ts +0 -23
  66. package/dist/graph-fragments.d.ts.map +0 -1
  67. package/dist/graph-fragments.js +0 -57
  68. package/dist/graph-fragments.js.map +0 -1
  69. package/dist/host-capabilities.d.ts +0 -12
  70. package/dist/host-capabilities.d.ts.map +0 -1
  71. package/dist/host-capabilities.js +0 -42
  72. package/dist/host-capabilities.js.map +0 -1
  73. package/dist/index.d.ts.map +0 -1
  74. package/dist/launcher-contract.d.ts +0 -2
  75. package/dist/launcher-contract.d.ts.map +0 -1
  76. package/dist/launcher-contract.js +0 -2
  77. package/dist/launcher-contract.js.map +0 -1
  78. package/dist/leaf-outcome-renderer.d.ts.map +0 -1
  79. package/dist/leaf-outcomes.d.ts +0 -5
  80. package/dist/leaf-outcomes.d.ts.map +0 -1
  81. package/dist/leaf-outcomes.js +0 -52
  82. package/dist/leaf-outcomes.js.map +0 -1
  83. package/dist/model-provider.d.ts +0 -210
  84. package/dist/model-provider.d.ts.map +0 -1
  85. package/dist/model-provider.js +0 -171
  86. package/dist/model-provider.js.map +0 -1
  87. package/dist/pi-config.d.ts.map +0 -1
  88. package/dist/process-definition-internals.d.ts +0 -7
  89. package/dist/process-definition-internals.d.ts.map +0 -1
  90. package/dist/process-definition-internals.js +0 -25
  91. package/dist/process-definition-internals.js.map +0 -1
  92. package/dist/process-flow-view.d.ts +0 -20
  93. package/dist/process-flow-view.d.ts.map +0 -1
  94. package/dist/process-flow-view.js +0 -418
  95. package/dist/process-flow-view.js.map +0 -1
  96. package/dist/process-graph.d.ts +0 -45
  97. package/dist/process-graph.d.ts.map +0 -1
  98. package/dist/process-graph.js +0 -213
  99. package/dist/process-graph.js.map +0 -1
  100. package/dist/process-launcher-builder.d.ts +0 -9
  101. package/dist/process-launcher-builder.d.ts.map +0 -1
  102. package/dist/process-launcher-builder.js +0 -43
  103. package/dist/process-launcher-builder.js.map +0 -1
  104. package/dist/process-watcher-builder.d.ts +0 -10
  105. package/dist/process-watcher-builder.d.ts.map +0 -1
  106. package/dist/process-watcher-builder.js +0 -40
  107. package/dist/process-watcher-builder.js.map +0 -1
  108. package/dist/registry-utils.d.ts +0 -8
  109. package/dist/registry-utils.d.ts.map +0 -1
  110. package/dist/registry-utils.js +0 -18
  111. package/dist/registry-utils.js.map +0 -1
  112. package/dist/repository-git-env.d.ts +0 -8
  113. package/dist/repository-git-env.d.ts.map +0 -1
  114. package/dist/repository-git-env.js +0 -26
  115. package/dist/repository-git-env.js.map +0 -1
  116. package/dist/review-flow.d.ts.map +0 -1
  117. package/dist/runtime-internals.d.ts.map +0 -1
  118. package/dist/server-events.d.ts +0 -84
  119. package/dist/server-events.d.ts.map +0 -1
  120. package/dist/server-events.js +0 -2
  121. package/dist/server-events.js.map +0 -1
  122. package/dist/server-process-builder.d.ts +0 -11
  123. package/dist/server-process-builder.d.ts.map +0 -1
  124. package/dist/server-process-builder.js +0 -52
  125. package/dist/server-process-builder.js.map +0 -1
  126. package/dist/state-helpers.d.ts +0 -9
  127. package/dist/state-helpers.d.ts.map +0 -1
  128. package/dist/state-helpers.js +0 -20
  129. package/dist/state-helpers.js.map +0 -1
  130. package/dist/subprocess-env.d.ts +0 -12
  131. package/dist/subprocess-env.d.ts.map +0 -1
  132. package/dist/subprocess-env.js +0 -34
  133. package/dist/subprocess-env.js.map +0 -1
  134. package/dist/tool-renderers.d.ts +0 -10
  135. package/dist/tool-renderers.d.ts.map +0 -1
  136. package/dist/tool-renderers.js +0 -63
  137. package/dist/tool-renderers.js.map +0 -1
  138. package/dist/turn-semantics.d.ts +0 -22
  139. package/dist/turn-semantics.d.ts.map +0 -1
  140. package/dist/turn-semantics.js +0 -339
  141. package/dist/turn-semantics.js.map +0 -1
  142. package/dist/types.d.ts +0 -295
  143. package/dist/types.d.ts.map +0 -1
  144. package/dist/types.js +0 -12
  145. package/dist/types.js.map +0 -1
  146. package/dist/ui-process-builder.d.ts +0 -9
  147. package/dist/ui-process-builder.d.ts.map +0 -1
  148. package/dist/ui-process-builder.js +0 -30
  149. package/dist/ui-process-builder.js.map +0 -1
  150. package/dist/worker-process-builder.d.ts +0 -10
  151. package/dist/worker-process-builder.d.ts.map +0 -1
  152. package/dist/worker-process-builder.js +0 -22
  153. package/dist/worker-process-builder.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,35 +1,1066 @@
1
- export type { BrowserUiExtensionAPI, BrowserUiExtensionContext, BrowserUiExtensionModule, BrowserUiShellIndicatorRegistration, BrowserUiShortcutRegistration, BrowserUiWsFrameHandler, } from "./browser-ui-extension.js";
2
- export { type CapabilityCardinality, type CapabilityToken, createCapabilityToken, } from "./capabilities.js";
3
- export { emptyParamsCodec } from "./codecs.js";
4
- export { BUILT_IN_COMMIT_MESSAGE_RULES, COMMIT_MESSAGE_PROJECT_METADATA_KEY, type CommitMessageProjectMetadata, } from "./commit-message.js";
5
- export { type ActionExecutionFailureStageLike, type ActionExecutionResultLike, type BroadcasterLike, type ComponentConfigLike, type CoreServerSetupDeps, coreHostCapabilities, type DeferredProcessActivationEvent, type DeferredProcessActivationExpected, type DeferredProcessActivationFailure, type DeferredProcessActivationOutcome, type DeferredProcessActivationSnapshot, type DeferredProcessActivationSnapshotQuery, type DeferredProcessActivationSnapshotResult, type ExternalSourceArmingLike, type ExternalSourceFireInput, type ExternalSourceServiceLike, type HandoffDedupKeyRecordLike, type HandoffDedupKeyServiceLike, type LauncherModelConfigPreviewLike, type LauncherModelConfigSchemaLike, type LauncherModelConfigServiceLike, type LauncherRecentValuesServiceLike, type LaunchModelConfigInputLike, type LaunchPlanPreparationIssue, type LaunchPlanPreparationIssueCode, type LaunchPlanPreparationResultLike, type ModelProfileOptionSummaryLike, type PreparedDeferredProcessActivation, type ProcessActionExecutionOrigin, type ProcessActionExecutionSource, type ProcessActionModelPreviewLike, type ProcessActionServiceLike, type ProcessActionSummaryLike, type ProcessCreateInputLike, type ProcessEngineLike, type ProcessEngineResultLike, type ProcessEventRepoLike, type ProcessLaunchConfigExecutionInput, type ProcessLaunchExecutionResultLike, type ProcessLaunchExecutorLike, type ProcessLaunchFailureStageLike, type ProcessLaunchPlanServiceLike, type ProcessModelSelectionPreviewFailureCode, type ProcessModelSelectionPreviewResultLike, type ProcessModelSelectionServiceLike, type ProcessProjectRepoLike, type ProcessQuestionServiceLike, type ProcessRepoLike, type ProcessWatcherConfigLike, type ProcessWatcherServiceLike, type QueuedProcessInputLike, type RegisteredProcessWatcherLike, type ResolvedProcessWatcherStartLike, type WorkerSupervisorLike, } from "./core-capabilities.js";
6
- export { type AutomaticTurnDefinition, automaticTurn, type DefinedProcessInput, defineProcess, type ExternalSourceTransition, type ExternalTurnDefinition, externalTurn, getExternalActionArmingId, getExternalActionTransitionTrigger, getExternalSourceTransitionId, type HumanTurnDefinition, type HumanTurnOperatorAttention, humanTurn, type LlmModelPurpose, type LlmTurnDefinition, llmTurn, type OutcomeRouteOptions, type OutcomeRouteSpec, type ProcessActionBranchSelector, type ProcessActionBranchSpec, type ProcessActionEffect, type ProcessActionExecution, type ProcessActionExternalTrigger, type ProcessBroadcastEffect, type ProcessDefinition, type ProcessEffectPlan, type ProcessHumanTurnActionSpec, type ProcessHumanTurnExternalActionSpec, type ProcessLifecycleEffects, type ProcessOutcomeEffect, type ProcessOutcomeExecution, type ProcessPatchEffect, type ProcessRuntimeTurnContext, type ProcessServerRuntimeContext, type ProcessToolOutcomeSpec, type ProcessTurnEndSpec, resolveHumanTurnView, routeTurnOutcomes, type ServerAutomaticTurnDefinition, type ServerAutomaticTurnRestartBehavior, type ServerAutomaticTurnRunResult, serverAutomaticTurn, type TurnDefinition, type TurnDefinitionRecord, } from "./define-process.js";
7
- export { createEventBus } from "./event-bus.js";
8
- export type { CatalogExtensionAPI, Codec, ExtensionLifecycleHook, ExtensionProcessDefinition, ExternalActionSource, ExternalSourceEffect, ExternalSourceEffectContext, ExternalSourceInputMode, ExternalSourceResolveContext, FormDefinition, FormFieldDefinition, GitSshCredentialMaterial, LauncherContext, LauncherModelProfileSummary, LauncherVisibility, LeafOutcomeCaptureContext, LeafOutcomeCaptureResult, LeitwerkExtensionManifest, LeitwerkExtensionModule, ProcessActionDefinition, ProcessLaunchConfig, ProcessLauncherAPI, ProcessLauncherDefinition, ProcessLauncherService, ProcessLaunchPlan, ProcessLaunchPlanProcessInput, ProcessLaunchProjectConfig, ProcessLeafOutcomeDefinition, ProcessSnapshotContext, ProcessTitleSourceField, ProcessTurnBinding, ProcessTurnOutcomeEvent, ProcessWatcherAPI, ProcessWatcherDefinition, RepositoryCredentialKind, RepositoryCredentialProject, RepositoryCredentialProvider, RepositoryCredentialRegistrar, RepositoryCredentialRequirement, ResolvedProcessLauncher, ServerExtensionAPI, ServerExtensionLogger, ServerProcessAPI, ServerProcessContext, ServerTransitionEffect, ServerTransitionRequest, ServerTransitionRuntime, UiLauncherConfigResolution, UiLauncherDefinition, UiLauncherResolutionResult, UiLauncherSummary, UiProcessAPI, WorkerCompleteInput, WorkerExtensionAPI, WorkerProcessAPI, WorkerProcessContext, WorkerRunHandle, WorkerTurnHandler, } from "./extension-api.js";
9
- export { findUiLauncherById } from "./extension-api.js";
10
- export { AutomaticFlowBuilder, AutomaticOutcomeBuilder, createFlowAutomaticRunContext, createFlowPromptContext, DEFAULT_FLOW_PRODUCT_NAME, DEFAULT_PLAN_RESULT_OUTCOME_ID, ExternalActionBuilder, ExternalFlowBuilder, ExternalRouteBuilder, type FlowAutomaticOutcomeEffectContext, type FlowAutomaticRunContext, type FlowAutomaticTurn, type FlowExternalTurn, FlowFragmentBuilder, type FlowHumanTurn, type FlowLlmOutcomeEffectContext, type FlowLlmTurn, FlowProcessBuilder, type FlowPromptContext, type FlowRepoContext, type FlowRepoLookup, type FlowServerAutomaticTurn, type FlowTurn, flow, HumanActionBuilder, HumanFlowBuilder, LlmFlowBuilder, LlmTurnEndBuilder, OutcomeToolBuilder, type PlanAcceptanceCriteriaOptions, type PlanFieldOptions, PlanResultBuilder, PublishedResultBuilder, ServerAutomaticFlowBuilder, } from "./flow.js";
11
- export { atomicWriteUtf8, isEnoent } from "./fs-utils.js";
12
- export { type AcceptedReviewHandoffActionSpec, acceptedReviewHandoffAction, type QueuedInstructionActionSpec, queuedInstructionAction, type RevisionActionSpec, revisionAction, } from "./graph-fragments.js";
13
- export { type CapabilityAccessor, createCapabilityAccessor, type ProvidedCapability, } from "./host-capabilities.js";
14
- export type { LauncherCardMetadata, LauncherFieldDefinition, LauncherFieldOptionDefinition, LauncherSchemaDefinition, LauncherValidationError, UiLauncherSummaryBase, } from "./launcher-contract.js";
15
- export { normalizeLeafOutcomeCaptureResult, validateLeafOutcomeCaptureResult, validateProcessLeafOutcomeDefinition, } from "./leaf-outcomes.js";
16
- export { type BuiltinPiProviderReference, builtinPiProvider, type ConfiguredPiProviderReference, type ConfiguredProviderModel, configuredPiProvider, credentialBasedModelStatuses, defineModelProvider, defineModelProviders, definePiServerAdapter, definePiWorker, defineProviderOptions, defineWorkerConfig, type ErasedModelProviderDefinition, filterProviderOptionsForDefinition, type ModelProviderCredentialDefinition, type ModelProviderDefinition, type ModelProviderModelsContext, type ModelProviderSecretsContext, type ModelProviderServer, type ModelProviderSet, type ModelProviderSetEntry, type ModelProviderWorker, type ParsedModelProviderConfig, type PiServerAdapter, type PiServerGenerateTextInput, type PiServerReference, type PiWorkerContribution, type PiWorkerContributionContext, type PiWorkerReference, type PiWorkerSecretBag, type ProviderAvailability, type ProviderCredentialStatus, type ProviderJsonObject, type ProviderJsonPrimitive, type ProviderJsonValue, type ProviderModelStatus, type ProviderOptionChoice, type ProviderOptionChoicesContext, type ProviderOptionDefaultContext, type ProviderOptionField, type ProviderOptionsDefinition, type ProviderOptionsResolution, type ProviderOptionsResolutionInput, type ProviderOptionValidationIssue, type ProviderWorkerConfigContext, type ProviderWorkerConfigDefinition, type ProviderWorkerConfigSchema, piServer, piWorker, resolveProviderOptions, } from "./model-provider.js";
17
- export { collectProcessAvailableToolNames, resolveTurnActiveToolNames, resolveTurnAvailableToolNames, validatePiBuiltInToolArray, } from "./pi-config.js";
18
- export { buildProcessFlowView, collapseRoutingTurns } from "./process-flow-view.js";
19
- export { getAllProcessGraphs, getProcessGraph, getProcessTurnGraph, getReachableTurnIdsForProcessGraph, getTurnTransitionsForProcessGraph, hasProcessGraph, isTurnAvailableForProcessGraph, listLlmTurnIdsForProcessGraph, type ProcessGraphRegistry, type ProcessGraphSource, type ProcessGraphTurnView, type ProcessGraphView, serializeProcessGraph, toProcessGraphView, validateProcessGraphEntryTurns, validateProcessGraphProducts, validateProcessGraphTurnTransitions, } from "./process-graph.js";
20
- export { type BuiltProcessLauncherDefinition, buildProcessLaunchers, createProcessLauncherBuilder, } from "./process-launcher-builder.js";
21
- export { type BuiltProcessWatcherDefinition, buildProcessWatchers, createProcessWatcherBuilder, } from "./process-watcher-builder.js";
22
- export { clearRepositoryGitSshWrappers, repositoryGitArgs, repositoryGitSubprocessEnv, setRepositoryGitSshWrapper, } from "./repository-git-env.js";
23
- export { buildPlanSavedEventPayload, buildReviewCompletedEventPayload, buildReviewRequestedEventPayload, filterStringArray, } from "./review-flow.js";
24
- export type { LeafOutcomeCapturedEvent, PlanApprovedEvent, PlanRevisionRequestedEvent, ProcessCreatedEvent, ProcessUpdatedEvent, QuestionRequestedEvent, ReviewCompletedEvent, ReviewRequestedEvent, ServerExtensionEventMap, ServerExtensionEventName, ServerExtensionEventPayloadInputMap, TurnFailedEvent, TurnOutcomeEvent, TurnStartedEvent, } from "./server-events.js";
25
- export { type BuiltServerProcessDefinition, createServerProcessBuilder, type ServerTurnOutcomeHandler, } from "./server-process-builder.js";
26
- export { createEmptyStructuralProcessState, parseStructuralProcessState, type StructuralProcessState, } from "./state-helpers.js";
27
- export { type SubprocessEnvInput, sanitizeWorkerSubprocessEnv, WORKER_SUBPROCESS_SENSITIVE_ENV_KEYS, } from "./subprocess-env.js";
28
- export type { ToolCallRendererDefinition, ToolCallRendererFieldDefinition, ToolCallRendererValueKind, ToolCallRendererValueSource, } from "./tool-renderers.js";
29
- export { CORE_TOOL_CALL_RENDERERS, MARKDOWN_RESULT_TOOL_MARKDOWN_PATH, MARKDOWN_RESULT_TOOL_NAME, MARKDOWN_RESULT_TOOL_RENDERER, REQUIRED_MARKDOWN_RESULT_TURN_RESULT, TOOL_CALL_RENDERER_VALUE_KINDS, TOOL_CALL_RENDERER_VALUE_SOURCES, validateToolCallRendererDefinition, } from "./tool-renderers.js";
30
- export { assertValidLlmTurnDefinition, createRootBranchReviewTurn, defaultTurnStartSelection, isAutomaticTurnDefinition, isExternalTurnDefinition, isHumanTurnDefinition, isLlmTurnDefinition, isServerAutomaticTurnDefinition, resolveLlmTurnRestorePrimaryLeafAfterTurn, resolveLlmTurnStartSelection, validateAutomaticTurnDefinition, validateExternalTurnDefinition, validateHumanTurnDefinition, validateLlmTurnDefinition, validateTurnDefinition, } from "./turn-semantics.js";
31
- export type { EventBus, HumanTurnActionView, HumanTurnExternalTrigger, HumanTurnNotesField, OutcomeToolArrayItemSpec, OutcomeToolArrayItemType, OutcomeToolParameterSpec, OutcomeToolParameterType, OutcomeToolSpec, PiBuiltInToolName, PiCustomMessageInput, PiCustomTool, PiCustomToolExecutionContext, PiEvent, PiEventHandler, PiEventType, PiPromptOptions, PiRunDetails, PiSessionDiagnostic, PiSessionDiagnosticHandler, PiSessionDiagnosticLevel, PiTerminalAcknowledgementControl, PiTerminalAcknowledgementState, PiTreeEntry, PiTreeHandle, PiTreeNode, PiTurnExecutionResult, PiUsageData, ProcessActionPreviewDefinition, ProcessActionSchedulingDefinition, ProcessActionSchedulingFixedTurnPreview, ProcessActionSchedulingPreview, ProcessActionSchedulingTriggerPreview, ProcessContext, ProcessCustomTool, ProcessPiConfig, ProcessToolResult, ResolvedProcessPiConfig, TurnAcceptanceState, TurnBranchType, TurnCompletionMode, TurnContextMode, TurnOptions, TurnResult, TurnResultMarkdownBehavior, TurnSemanticEntryRefKey, } from "./types.js";
32
- export { PI_BUILT_IN_TOOL_NAMES, TURN_COMPLETION_MODES, TURN_CONTEXT_MODES } from "./types.js";
33
- export { type BuiltUiProcessDefinition, buildUiProcessDefinition, createUiProcessBuilder, } from "./ui-process-builder.js";
34
- export { type BuiltWorkerProcessDefinition, createWorkerProcessBuilder, } from "./worker-process-builder.js";
35
- //# sourceMappingURL=index.d.ts.map
1
+ import { WsFrame, KnownDurableWsFrameType, WsPayloadByType, KnownEphemeralWsFrameType, LauncherModelConfigSchema, LauncherModelConfigPreview, ProcessWatcherType, ProcessActionModelPreview } from '@leitwerk-dev/protocol';
2
+ import { T as TurnResultMarkdownBehavior, C as Codec, E as ExternalActionSource, P as ProcessLauncherService, a as ProcessLaunchPlan, b as ProcessLaunchConfig, L as LauncherContext, R as RepositoryCredentialRegistrar, c as CapabilityToken, d as EventBus, A as AutomaticTurnDefinition, W as WorkerCompleteInput, e as ProcessOutcomeExecution, f as ProcessEffectPlan, O as OutcomeToolParameterSpec, g as ProcessToolOutcomeSpec, h as ProcessHumanTurnExternalActionSpec, i as ExternalTurnDefinition, j as ExternalSourceEffectContext, k as ExternalSourceEffect, l as LlmTurnDefinition, S as ServerAutomaticTurnDefinition, H as HumanTurnDefinition, m as TurnDefinition, n as ServerProcessAPI, U as UiProcessAPI, o as ProcessLauncherAPI, p as ProcessWatcherAPI, q as ProcessActionDefinition, r as ProcessLauncherDefinition, s as ProcessWatcherDefinition, t as RepositoryCredentialProject, u as RepositoryCredentialRequirement, v as ProcessPiConfig, w as ProcessDefinition, x as ProcessHumanTurnActionSpec, y as HumanTurnOperatorAttention, z as LlmModelPurpose, B as PiBuiltInToolName, D as ProcessTurnEndSpec, F as ProcessRuntimeTurnContext, G as ServerAutomaticTurnRestartBehavior, I as ProcessActionExecution, J as ProcessActionEffect, K as LeafOutcomeCaptureResult, M as ProcessLeafOutcomeDefinition, N as ExtensionProcessDefinition, Q as ProcessTurnOutcomeEvent, V as ServerProcessContext, X as ProcessCleanupHandler, Y as TurnBranchType, Z as WorkerTurnHandler, _ as WorkerProcessAPI } from './extension-api-CnlL69Tu.js';
3
+ export { $ as BuiltinPiProviderReference, a0 as CapabilityCardinality, a1 as CatalogExtensionAPI, a2 as ConfiguredPiProviderReference, a3 as ConfiguredProviderModel, a4 as DefinedProcessInput, a5 as ErasedModelProviderDefinition, a6 as ExtensionLifecycleHook, a7 as ExternalSourceInputMode, a8 as ExternalSourceResolveContext, a9 as ExternalSourceTransition, aa as GitSshCredentialMaterial, ab as HumanTurnActionView, ac as HumanTurnExternalTrigger, ad as HumanTurnNotesField, ae as LauncherModelProfileSummary, af as LauncherVisibility, ag as LeafOutcomeCaptureContext, ah as LeafOutcomeCapturedEvent, ai as LeitwerkExtensionManifest, aj as LeitwerkExtensionModule, ak as ModelProviderCredentialDefinition, al as ModelProviderDefinition, am as ModelProviderModelsContext, an as ModelProviderSecretsContext, ao as ModelProviderServer, ap as ModelProviderSet, aq as ModelProviderSetEntry, ar as ModelProviderWorker, as as OutcomeRouteOptions, at as OutcomeRouteSpec, au as OutcomeToolArrayItemSpec, av as OutcomeToolArrayItemType, aw as OutcomeToolParameterType, ax as OutcomeToolSpec, ay as PI_BUILT_IN_TOOL_NAMES, az as ParsedModelProviderConfig, aA as PiCustomMessageInput, aB as PiCustomTool, aC as PiCustomToolExecutionContext, aD as PiEvent, aE as PiEventHandler, aF as PiEventType, aG as PiPromptOptions, aH as PiRunDetails, aI as PiServerAdapter, aJ as PiServerGenerateTextInput, aK as PiServerReference, aL as PiSessionDiagnostic, aM as PiSessionDiagnosticHandler, aN as PiSessionDiagnosticLevel, aO as PiTerminalAcknowledgementControl, aP as PiTerminalAcknowledgementState, aQ as PiTreeEntry, aR as PiTreeHandle, aS as PiTreeNode, aT as PiTurnExecutionResult, aU as PiUsageData, aV as PiWorkerContribution, aW as PiWorkerContributionContext, aX as PiWorkerReference, aY as PiWorkerSecretBag, aZ as PlanApprovedEvent, a_ as PlanRevisionRequestedEvent, a$ as ProcessActionBranchSelector, b0 as ProcessActionBranchSpec, b1 as ProcessActionExternalTrigger, b2 as ProcessActionPreviewDefinition, b3 as ProcessActionSchedulingDefinition, b4 as ProcessActionSchedulingFixedTurnPreview, b5 as ProcessActionSchedulingPreview, b6 as ProcessActionSchedulingTriggerPreview, b7 as ProcessBroadcastEffect, b8 as ProcessContext, b9 as ProcessCreatedEvent, ba as ProcessCustomTool, bb as ProcessLaunchPlanProcessInput, bc as ProcessLaunchProjectConfig, bd as ProcessLifecycleEffects, be as ProcessOutcomeEffect, bf as ProcessPatchEffect, bg as ProcessServerRuntimeContext, bh as ProcessSnapshotContext, bi as ProcessTitleSourceField, bj as ProcessToolResult, bk as ProcessTurnBinding, bl as ProcessUpdatedEvent, bm as ProviderAvailability, bn as ProviderCredentialStatus, bo as ProviderJsonObject, bp as ProviderJsonPrimitive, bq as ProviderJsonValue, br as ProviderModelStatus, bs as ProviderOptionChoice, bt as ProviderOptionChoicesContext, bu as ProviderOptionDefaultContext, bv as ProviderOptionField, bw as ProviderOptionValidationIssue, bx as ProviderOptionsDefinition, by as ProviderOptionsResolution, bz as ProviderOptionsResolutionInput, bA as ProviderWorkerConfigContext, bB as ProviderWorkerConfigDefinition, bC as ProviderWorkerConfigSchema, bD as QuestionRequestedEvent, bE as RepositoryCredentialKind, bF as RepositoryCredentialProvider, bG as ResolvedProcessLauncher, bH as ResolvedProcessPiConfig, bI as ReviewCompletedEvent, bJ as ReviewRequestedEvent, bK as ServerAutomaticTurnRunResult, bL as ServerExtensionAPI, bM as ServerExtensionEventMap, bN as ServerExtensionEventName, bO as ServerExtensionEventPayloadInputMap, bP as ServerExtensionLogger, bQ as ServerTransitionEffect, bR as ServerTransitionRequest, bS as ServerTransitionRuntime, bT as TURN_COMPLETION_MODES, bU as TURN_CONTEXT_MODES, bV as TurnAcceptanceState, bW as TurnCompletionMode, bX as TurnContextMode, bY as TurnDefinitionRecord, bZ as TurnFailedEvent, b_ as TurnOptions, b$ as TurnOutcomeEvent, c0 as TurnResult, c1 as TurnSemanticEntryRefKey, c2 as TurnStartedEvent, c3 as UiLauncherConfigResolution, c4 as UiLauncherDefinition, c5 as UiLauncherResolutionResult, c6 as UiLauncherSummary, c7 as WorkerExtensionAPI, c8 as WorkerProcessContext, c9 as WorkerRunHandle, ca as automaticTurn, cb as builtinPiProvider, cc as configuredPiProvider, cd as createCapabilityToken, ce as credentialBasedModelStatuses, cf as defineModelProvider, cg as defineModelProviders, ch as definePiServerAdapter, ci as definePiWorker, cj as defineProcess, ck as defineProviderOptions, cl as defineWorkerConfig, cm as externalTurn, cn as filterProviderOptionsForDefinition, co as findUiLauncherById, cp as getExternalActionArmingId, cq as getExternalActionTransitionTrigger, cr as getExternalSourceTransitionId, cs as humanTurn, ct as llmTurn, cu as piServer, cv as piWorker, cw as resolveHumanTurnView, cx as resolveProviderOptions, cy as routeTurnOutcomes, cz as serverAutomaticTurn } from './extension-api-CnlL69Tu.js';
4
+ import * as _leitwerk_dev_domain from '@leitwerk-dev/domain';
5
+ import { ProcessInstance, ProcessProject, ProcessEvent, ProcessLifecycleStatus, TurnId, Actor, WorkerErrorClass, InputSource, InputKind, ProcessInputTarget, LaunchModelConfigInput, ProcessTurnTerminalLifecycleStatus, ReviewSubject, ProcessTurnStartSelection, ProcessTurnType, ProcessTurnTransition, ProcessSemanticEntryRefKey, SerializedProcessGraph, ProcessFlowView, ProcessSemanticEntryRefs, ProcessProductRefs, ProcessTurnStartFallback } from '@leitwerk-dev/domain';
6
+ import { ActionFormDefinition } from '@leitwerk-dev/protocol/form-contract';
7
+ export { ActionFormDefinition as FormDefinition, ActionFormFieldDefinition as FormFieldDefinition } from '@leitwerk-dev/protocol/form-contract';
8
+ export { LauncherCardMetadata, LauncherFieldDefinition, LauncherFieldOptionDefinition, LauncherSchemaDefinition, LauncherValidationError, UiLauncherSummaryBase } from '@leitwerk-dev/protocol/launcher-contract';
9
+ export { collectProcessAvailableToolNames, resolveTurnActiveToolNames, resolveTurnAvailableToolNames, validatePiBuiltInToolArray } from './pi-config.js';
10
+ export { buildPlanSavedEventPayload, buildReviewCompletedEventPayload, buildReviewRequestedEventPayload, filterStringArray } from './review-flow.js';
11
+ import { ToolCallRendererDefinition } from '@leitwerk-dev/protocol/tool-renderer-contract';
12
+ export { TOOL_CALL_RENDERER_VALUE_KINDS, TOOL_CALL_RENDERER_VALUE_SOURCES, ToolCallRendererDefinition, ToolCallRendererFieldDefinition, ToolCallRendererValueKind, ToolCallRendererValueSource } from '@leitwerk-dev/protocol/tool-renderer-contract';
13
+
14
+ interface BrowserUiExtensionContext {
15
+ readonly extensionManifestId: string;
16
+ readonly moduleUrl: string;
17
+ resolveAssetUrl(relativePath: string): string;
18
+ }
19
+ interface BrowserUiShortcutRegistration {
20
+ readonly id: string;
21
+ readonly keys: readonly string[];
22
+ readonly label: string;
23
+ handle(event: KeyboardEvent): boolean | undefined;
24
+ }
25
+ interface BrowserUiShellIndicatorRegistration {
26
+ readonly id: string;
27
+ readonly label: string;
28
+ mount(host: HTMLElement): undefined | (() => void);
29
+ }
30
+ type BrowserUiWsFrameHandler = (frame: WsFrame) => boolean | undefined;
31
+ interface BrowserUiExtensionAPI {
32
+ registerShortcut(registration: BrowserUiShortcutRegistration): () => void;
33
+ registerShellIndicator(registration: BrowserUiShellIndicatorRegistration): () => void;
34
+ onWsFrame(handler: BrowserUiWsFrameHandler): () => void;
35
+ }
36
+ interface BrowserUiExtensionModule {
37
+ setup(api: BrowserUiExtensionAPI, context: BrowserUiExtensionContext): void | Promise<void>;
38
+ }
39
+
40
+ declare const MARKDOWN_RESULT_TOOL_NAME = "markdown_result";
41
+ declare const MARKDOWN_RESULT_TOOL_MARKDOWN_PATH = "markdown";
42
+ declare const MARKDOWN_RESULT_TOOL_RENDERER: ToolCallRendererDefinition;
43
+ declare const CORE_TOOL_CALL_RENDERERS: readonly ToolCallRendererDefinition[];
44
+ declare const REQUIRED_MARKDOWN_RESULT_TURN_RESULT: TurnResultMarkdownBehavior;
45
+ declare function validateToolCallRendererDefinition(def: ToolCallRendererDefinition): string[];
46
+
47
+ declare const emptyParamsCodec: Codec<Record<string, never>>;
48
+
49
+ declare const COMMIT_MESSAGE_PROJECT_METADATA_KEY = "leitwerk.commitMessage";
50
+ declare const BUILT_IN_COMMIT_MESSAGE_RULES = "Write a concise imperative subject that summarizes the accepted plan. Add a body only when it provides useful context.";
51
+ interface CommitMessageProjectMetadata {
52
+ templateId: string | null;
53
+ rules: string;
54
+ }
55
+
56
+ interface ProcessCreateInputLike {
57
+ processId?: ProcessInstance["processId"];
58
+ selectedTurnId?: ProcessInstance["selectedTurnId"];
59
+ lifecycleStatus?: ProcessInstance["lifecycleStatus"];
60
+ title?: string | null;
61
+ externalId?: string | null;
62
+ externalUrl?: string | null;
63
+ metadata?: Record<string, unknown> | null;
64
+ defaultModelProfileId?: string | null;
65
+ turnConfigsJson?: string | null;
66
+ selectedTurnModelProfileId?: string | null;
67
+ paramsJson?: string | null;
68
+ stateJson?: string | null;
69
+ }
70
+ interface ProcessRepoLike {
71
+ create(input: ProcessCreateInputLike): ProcessInstance;
72
+ getById(id: string): ProcessInstance | null;
73
+ listAll(): ProcessInstance[];
74
+ }
75
+ interface ProcessProjectRepoLike {
76
+ /** Server-provided project mutation service. Implementations should emit project.updated after committed writes. */
77
+ create(input: {
78
+ instanceId: string;
79
+ key: string;
80
+ repoLocator: string;
81
+ baseBranch: string;
82
+ workBranch?: string | null;
83
+ externalId?: string | null;
84
+ externalUrl?: string | null;
85
+ metadata?: Record<string, unknown> | null;
86
+ pipelineStatus?: string | null;
87
+ }): ProcessProject;
88
+ getByInstanceAndKey(instanceId: string, key: string): ProcessProject | null;
89
+ update(id: string, input: {
90
+ baseBranch?: string;
91
+ workBranch?: string | null;
92
+ externalId?: string | null;
93
+ externalUrl?: string | null;
94
+ metadata?: Record<string, unknown> | null;
95
+ pipelineStatus?: string | null;
96
+ }): ProcessProject | null;
97
+ listByInstance(instanceId: string): ProcessProject[];
98
+ }
99
+ interface ProcessEventRepoLike {
100
+ create(input: {
101
+ instanceId: string;
102
+ eventType: string;
103
+ data?: Record<string, unknown>;
104
+ }): unknown;
105
+ listByInstance(instanceId: string, limit?: number): ProcessEvent[];
106
+ }
107
+ interface BroadcasterLike {
108
+ sendDurable<T extends KnownDurableWsFrameType>(type: T, payload: WsPayloadByType[T], instanceId?: string): void;
109
+ sendEphemeral?<T extends KnownEphemeralWsFrameType>(type: T, payload: WsPayloadByType[T], instanceId?: string): void;
110
+ }
111
+ type LaunchModelConfigInputLike = LaunchModelConfigInput;
112
+ type LauncherModelConfigSchemaLike = LauncherModelConfigSchema;
113
+ type LauncherModelConfigPreviewLike = LauncherModelConfigPreview;
114
+ interface LauncherModelConfigServiceLike {
115
+ getSchema(launcherId: string): Promise<LauncherModelConfigSchemaLike | null>;
116
+ preview(launcherId: string, launcherInput: Record<string, unknown>, opts?: {
117
+ modelConfig?: LaunchModelConfigInputLike;
118
+ }): Promise<LauncherModelConfigPreviewLike | null>;
119
+ }
120
+ /** Stable, machine-readable codes returned while preparing a launch. */
121
+ type LaunchPlanPreparationIssueCode = "process_id_mismatch" | "invalid_turn_configs_json" | "unknown_model_profile" | "model_profile_not_allowed" | "unknown_llm_turn" | "selected_turn_model_requires_selected_turn" | "selected_turn_model_requires_llm_turn" | "model_required";
122
+ /** Complete, presentation-safe diagnostic returned while preparing a launch. */
123
+ interface LaunchPlanPreparationIssue {
124
+ readonly code: LaunchPlanPreparationIssueCode;
125
+ readonly message: string;
126
+ }
127
+ type LaunchPlanPreparationResultLike = {
128
+ ok: true;
129
+ launchPlan: ProcessLaunchPlan;
130
+ modelConfig: LaunchModelConfigInputLike;
131
+ warnings: readonly LaunchPlanPreparationIssue[];
132
+ } | {
133
+ ok: false;
134
+ /** Normalized durable plan retained when a scheduled launch is blocked. */
135
+ launchPlan: ProcessLaunchPlan;
136
+ modelConfig: LaunchModelConfigInputLike;
137
+ errors: readonly LaunchPlanPreparationIssue[];
138
+ };
139
+ interface ProcessLaunchPlanServiceLike {
140
+ prepare(launchPlan: ProcessLaunchPlan, opts?: {
141
+ modelConfig?: LaunchModelConfigInputLike;
142
+ replaceModelConfig?: boolean;
143
+ invalidModelConfig?: "reject" | "omit";
144
+ }): Promise<LaunchPlanPreparationResultLike>;
145
+ }
146
+ interface HandoffDedupKeyRecordLike {
147
+ key: string;
148
+ instanceId: string;
149
+ createdAt: string;
150
+ metadata: Record<string, unknown>;
151
+ }
152
+ interface HandoffDedupKeyServiceLike {
153
+ getByKey(key: string): HandoffDedupKeyRecordLike | null;
154
+ }
155
+ interface WorkerSupervisorLike {
156
+ spawnWorker(instanceId: string): Promise<unknown>;
157
+ getWorker(instanceId: string): unknown | undefined;
158
+ }
159
+ interface ProcessEngineResultLike {
160
+ ok: boolean;
161
+ code?: string;
162
+ message?: string;
163
+ process?: ProcessInstance | null;
164
+ stage?: "pre_commit" | "post_commit";
165
+ data?: unknown;
166
+ }
167
+ interface DeferredProcessActivationExpected {
168
+ processId: string;
169
+ lifecycleStatus: ProcessLifecycleStatus;
170
+ selectedTurnId: TurnId | null;
171
+ title: string | null;
172
+ paramsJson: string | null;
173
+ projectId: string;
174
+ projectKey: string;
175
+ repoLocator: string;
176
+ baseBranch: string;
177
+ workBranch: string | null;
178
+ }
179
+ interface DeferredProcessActivationSnapshot extends DeferredProcessActivationExpected {
180
+ instanceId: string;
181
+ processMetadata: Record<string, unknown> | null;
182
+ projectMetadata: Record<string, unknown> | null;
183
+ }
184
+ interface DeferredProcessActivationSnapshotQuery {
185
+ projectKey: string;
186
+ instanceId?: string;
187
+ processId?: string;
188
+ }
189
+ type DeferredProcessActivationSnapshotResult = {
190
+ outcome: "ready";
191
+ snapshots: DeferredProcessActivationSnapshot[];
192
+ } | {
193
+ outcome: "process_not_found";
194
+ } | {
195
+ outcome: "project_not_found";
196
+ };
197
+ interface DeferredProcessActivationEvent {
198
+ eventType: string;
199
+ data?: Record<string, unknown>;
200
+ level: "info" | "warn" | "error";
201
+ message: string;
202
+ }
203
+ interface PreparedDeferredProcessActivation {
204
+ expected: DeferredProcessActivationExpected;
205
+ workBranch: string;
206
+ paramsJson: string;
207
+ projectMetadata: Record<string, unknown> | null;
208
+ selectedTurnId: TurnId;
209
+ event: DeferredProcessActivationEvent;
210
+ actor?: Actor;
211
+ }
212
+ type DeferredProcessActivationOutcome = "activated" | "already_activated" | "stale" | "not_applicable" | "project_not_found" | "invalid_selected_turn";
213
+ interface DeferredProcessActivationFailure {
214
+ expected: DeferredProcessActivationExpected;
215
+ errorClass: WorkerErrorClass;
216
+ event: DeferredProcessActivationEvent;
217
+ }
218
+ type ProcessActionExecutionSource = "ui" | "external" | "scheduled";
219
+ type ProcessActionExecutionOrigin = "web_ui" | "external_interface" | "scheduled";
220
+ interface ProcessActionSummaryLike {
221
+ id: string;
222
+ label: string;
223
+ description?: string | null;
224
+ form?: ActionFormDefinition;
225
+ }
226
+ type ActionExecutionFailureStageLike = "pre_commit" | "post_commit";
227
+ type ActionExecutionResultLike = {
228
+ ok: true;
229
+ process: ProcessInstance | null;
230
+ data?: Record<string, unknown>;
231
+ error?: undefined;
232
+ code?: undefined;
233
+ stage?: undefined;
234
+ } | {
235
+ ok: false;
236
+ stage: "pre_commit";
237
+ error: string;
238
+ code?: string;
239
+ process?: undefined;
240
+ data?: undefined;
241
+ } | {
242
+ ok: false;
243
+ stage: "post_commit";
244
+ process: ProcessInstance;
245
+ error: string;
246
+ code?: string;
247
+ data?: Record<string, unknown>;
248
+ };
249
+ interface ProcessActionServiceLike {
250
+ listVisibleActions(instanceId: string): readonly ProcessActionSummaryLike[];
251
+ executeAction(instanceId: string, actionId: string, input: Record<string, unknown>, opts?: {
252
+ source?: ProcessActionExecutionSource;
253
+ origin?: ProcessActionExecutionOrigin;
254
+ nextTurnModelProfileId?: string | null;
255
+ actor?: Actor;
256
+ }): Promise<ActionExecutionResultLike>;
257
+ }
258
+ interface ExternalSourceArmingLike {
259
+ /** Process-local arming id. Durable arming identity is { instanceId, id }. */
260
+ id: string;
261
+ instanceId: string;
262
+ processId: string;
263
+ turnId: string;
264
+ externalActionId: string;
265
+ source: ExternalActionSource;
266
+ resolved: unknown;
267
+ }
268
+ interface ExternalSourceFireInput {
269
+ instanceId: string;
270
+ armingId: string;
271
+ input?: Record<string, unknown>;
272
+ event?: Record<string, unknown>;
273
+ mergeKey?: string | null;
274
+ }
275
+ interface ExternalSourceServiceLike {
276
+ listArmed(kind: string): readonly ExternalSourceArmingLike[];
277
+ fire(input: ExternalSourceFireInput): Promise<ActionExecutionResultLike>;
278
+ }
279
+ type ProcessLaunchFailureStageLike = "pre_commit" | "post_commit";
280
+ type ProcessLaunchExecutionResultLike = {
281
+ ok: true;
282
+ process: ProcessInstance;
283
+ projects: ProcessProject[];
284
+ reused: boolean;
285
+ } | {
286
+ ok: false;
287
+ stage: "pre_commit";
288
+ status: number;
289
+ body: Record<string, unknown>;
290
+ } | {
291
+ ok: false;
292
+ stage: "post_commit";
293
+ status: number;
294
+ body: Record<string, unknown>;
295
+ process: ProcessInstance;
296
+ projects: ProcessProject[];
297
+ };
298
+ interface ProcessLaunchConfigExecutionInput {
299
+ launcherId: string;
300
+ launchConfig: ProcessLaunchConfig;
301
+ handoffDedupKey?: string | null;
302
+ }
303
+ interface ProcessLaunchExecutorLike {
304
+ createProcessFromLaunchConfig(input: ProcessLaunchConfigExecutionInput, opts?: {
305
+ actor?: Actor;
306
+ }): Promise<ProcessLaunchExecutionResultLike>;
307
+ createProcessFromLaunchPlan(launchPlan: ProcessLaunchPlan, opts?: {
308
+ actor?: Actor;
309
+ }): Promise<ProcessLaunchExecutionResultLike>;
310
+ }
311
+ interface LauncherRecentValuesServiceLike {
312
+ list(launcherId: string): Record<string, readonly string[]>;
313
+ record(launcherId: string, launcherInput: Record<string, unknown>): void;
314
+ }
315
+ interface QueuedProcessInputLike {
316
+ source: InputSource;
317
+ kind: InputKind;
318
+ bodyMarkdown: string;
319
+ target?: ProcessInputTarget | null;
320
+ actor?: Actor;
321
+ }
322
+ interface ProcessEngineLike {
323
+ getDeferredProcessActivationSnapshots(query: DeferredProcessActivationSnapshotQuery): DeferredProcessActivationSnapshotResult;
324
+ activateDeferredProcess(instanceId: string, prepared: PreparedDeferredProcessActivation): Promise<ProcessEngineResultLike & {
325
+ data?: {
326
+ outcome: DeferredProcessActivationOutcome;
327
+ };
328
+ }>;
329
+ parkDeferredProcessActivationFailure(instanceId: string, failure: DeferredProcessActivationFailure): Promise<ProcessEngineResultLike & {
330
+ data?: {
331
+ outcome: "parked" | "stale" | "not_applicable" | "project_not_found";
332
+ };
333
+ }>;
334
+ startProcess(instanceId: string, startTurnId: TurnId): Promise<ProcessEngineResultLike>;
335
+ abortProcess(instanceId: string, opts?: {
336
+ actor?: Actor;
337
+ }): Promise<ProcessEngineResultLike>;
338
+ retryProcess(instanceId: string, opts?: {
339
+ nextTurnModelProfileId?: string | null;
340
+ actor?: Actor;
341
+ }): Promise<ProcessEngineResultLike>;
342
+ continueFailedTurn(instanceId: string, turnRecordId: string, options?: {
343
+ prompt?: string | null;
344
+ nextTurnModelProfileId?: string | null;
345
+ actor?: Actor;
346
+ }): Promise<ProcessEngineResultLike>;
347
+ queueInputs(instanceId: string, inputs: readonly QueuedProcessInputLike[], opts?: {
348
+ dispatchErrorMessage?: string;
349
+ actor?: Actor;
350
+ }): Promise<ProcessEngineResultLike>;
351
+ }
352
+ interface ComponentConfigLike {
353
+ repo: string;
354
+ default_branch: string;
355
+ }
356
+ interface ProcessWatcherConfigLike {
357
+ type: ProcessWatcherType;
358
+ [key: string]: unknown;
359
+ }
360
+ interface RegisteredProcessWatcherLike {
361
+ processId: string;
362
+ processDisplayName: string;
363
+ watcherId: string;
364
+ watcherLabel: string;
365
+ watcherDescription: string;
366
+ type: ProcessWatcherType;
367
+ enabled: boolean;
368
+ pollInterval: string;
369
+ configPath: string;
370
+ config: ProcessWatcherConfigLike;
371
+ launchModelConfig: LaunchModelConfigInputLike;
372
+ }
373
+ interface ResolvedProcessWatcherStartLike {
374
+ watcher: RegisteredProcessWatcherLike;
375
+ launchPlan: ProcessLaunchPlan;
376
+ }
377
+ interface ProcessWatcherServiceLike {
378
+ listAll(): readonly RegisteredProcessWatcherLike[];
379
+ listByType(type: ProcessWatcherType): readonly RegisteredProcessWatcherLike[];
380
+ resolveLaunch(processId: string, watcherId: string, payload: unknown, ctx?: LauncherContext): Promise<ResolvedProcessWatcherStartLike | null>;
381
+ }
382
+ interface ProcessQuestionServiceLike {
383
+ listOpen(instanceId?: string): readonly _leitwerk_dev_domain.ProcessQuestionRequest[];
384
+ submitAnswers(instanceId: string, requestId: string, draft: readonly _leitwerk_dev_domain.QuestionAnswerDraft[], actor: Actor): Promise<{
385
+ ok: true;
386
+ request: _leitwerk_dev_domain.ProcessQuestionRequest;
387
+ } | {
388
+ ok: false;
389
+ code: "not_found" | "not_current" | "invalid";
390
+ message: string;
391
+ request?: _leitwerk_dev_domain.ProcessQuestionRequest;
392
+ }>;
393
+ }
394
+ interface CoreServerSetupDeps {
395
+ serverBaseUrl: string;
396
+ processWorkspacesDir?: string;
397
+ components: Record<string, ComponentConfigLike>;
398
+ /** Typed by consuming extensions via watcher-utils ExternalWriteLogRepoLike. */
399
+ externalWrites: unknown;
400
+ processes: ProcessRepoLike;
401
+ projects: ProcessProjectRepoLike;
402
+ events: ProcessEventRepoLike;
403
+ broadcaster: BroadcasterLike;
404
+ commands: ProcessEngineLike;
405
+ processActions: ProcessActionServiceLike;
406
+ externalSources: ExternalSourceServiceLike;
407
+ getSupervisor: () => WorkerSupervisorLike | undefined;
408
+ launcherService: ProcessLauncherService;
409
+ launcherRecentValues: LauncherRecentValuesServiceLike;
410
+ launcherModelConfigs: LauncherModelConfigServiceLike;
411
+ launchPlans: ProcessLaunchPlanServiceLike;
412
+ processLaunches: ProcessLaunchExecutorLike;
413
+ handoffDedupKeys?: HandoffDedupKeyServiceLike;
414
+ processWatchers?: ProcessWatcherServiceLike;
415
+ processModelSelection?: ProcessModelSelectionServiceLike;
416
+ /** Durable active-turn questions for trusted operator-channel extensions. */
417
+ processQuestions?: ProcessQuestionServiceLike;
418
+ /** Registration boundary for secret-backed repository credential extensions. */
419
+ repositoryCredentials: RepositoryCredentialRegistrar;
420
+ /** Server-owned managed result images, available to trusted delivery extensions. */
421
+ resultImages?: {
422
+ get(instanceId: string, turnRecordId: string, imageId: string): Promise<Uint8Array | null>;
423
+ };
424
+ }
425
+ type ProcessActionModelPreviewLike = ProcessActionModelPreview;
426
+ type ProcessModelSelectionPreviewFailureCode = "process_not_found" | "instance_tree_unavailable";
427
+ type ProcessModelSelectionPreviewResultLike = ProcessActionModelPreviewLike | {
428
+ kind: "operational_failure";
429
+ code: ProcessModelSelectionPreviewFailureCode;
430
+ };
431
+ interface ModelProfileOptionSummaryLike {
432
+ id: string;
433
+ label: string;
434
+ description: string;
435
+ availability: "available" | "unavailable" | "stale";
436
+ }
437
+ interface ProcessModelSelectionServiceLike {
438
+ listAvailableProfiles(instanceId: string): readonly ModelProfileOptionSummaryLike[] | null;
439
+ preview(instanceId: string, actionId: string, input: Record<string, unknown>): Promise<ProcessModelSelectionPreviewResultLike>;
440
+ }
441
+ declare const coreHostCapabilities: {
442
+ readonly serverSetup: CapabilityToken<CoreServerSetupDeps>;
443
+ readonly processModelSelection: CapabilityToken<ProcessModelSelectionServiceLike>;
444
+ };
445
+
446
+ declare function createEventBus<TEventMap extends object = Record<string, unknown>>(): EventBus<TEventMap>;
447
+
448
+ type MaybePromise$1<T> = T | Promise<T>;
449
+ declare const DEFAULT_PLAN_RESULT_OUTCOME_ID: "plan_saved";
450
+ declare const DEFAULT_FLOW_PRODUCT_NAME: "default";
451
+ interface FlowLlmTurn<TParams = unknown, TState = unknown, TOutcome extends string = string> {
452
+ id: TurnId;
453
+ definition: LlmTurnDefinition<TOutcome, TParams, TState>;
454
+ }
455
+ interface FlowAutomaticTurn<TParams = unknown, TState = unknown, TOutcome extends string = string> {
456
+ id: TurnId;
457
+ definition: AutomaticTurnDefinition<TOutcome, TParams, TState>;
458
+ }
459
+ interface FlowServerAutomaticTurn<TParams = unknown, TState = unknown, TOutcome extends string = string> {
460
+ id: TurnId;
461
+ definition: ServerAutomaticTurnDefinition<TOutcome, TParams, TState>;
462
+ }
463
+ interface FlowHumanTurn<TParams = unknown, TState = unknown> {
464
+ id: TurnId;
465
+ definition: HumanTurnDefinition<TParams, TState>;
466
+ }
467
+ interface FlowExternalTurn<TParams = unknown, TState = unknown> {
468
+ id: TurnId;
469
+ definition: ExternalTurnDefinition<TParams, TState>;
470
+ }
471
+ type FlowTurn<TParams = unknown, TState = unknown> = FlowLlmTurn<TParams, TState, string> | FlowAutomaticTurn<TParams, TState, string> | FlowServerAutomaticTurn<TParams, TState, string> | FlowHumanTurn<TParams, TState> | FlowExternalTurn<TParams, TState> | {
472
+ id: TurnId;
473
+ definition: TurnDefinition<TParams, TState>;
474
+ };
475
+ interface PlanFieldOptions {
476
+ description?: string;
477
+ requiredErrorCode?: string;
478
+ }
479
+ interface PlanAcceptanceCriteriaOptions extends PlanFieldOptions {
480
+ minItems?: number;
481
+ minItemsErrorCode?: string;
482
+ }
483
+ interface FlowRepoContext {
484
+ key: string;
485
+ fsPath: string;
486
+ workspaceClonePath: string;
487
+ baseBranch: string;
488
+ workBranch: string;
489
+ locator: string;
490
+ }
491
+ interface FlowRepoLookup {
492
+ get(key: string): FlowRepoContext;
493
+ optional(key: string): FlowRepoContext | undefined;
494
+ all(): FlowRepoContext[];
495
+ }
496
+ interface FlowPromptContext<TParams = unknown, TState = unknown, TConsumedProducts extends string = string> {
497
+ process: ProcessInstance;
498
+ projects: readonly ProcessProject[];
499
+ params: TParams;
500
+ state: TState;
501
+ workspaceRoot?: string;
502
+ prompts: {
503
+ initial: string;
504
+ };
505
+ input: Readonly<Partial<Record<TConsumedProducts, string>>>;
506
+ repo: FlowRepoLookup;
507
+ }
508
+ interface FlowAutomaticRunContext<TParams = unknown, TState = unknown> {
509
+ process: ProcessInstance;
510
+ projects: readonly ProcessProject[];
511
+ params: TParams;
512
+ state: TState;
513
+ workspaceRoot?: string;
514
+ repo: FlowRepoLookup;
515
+ }
516
+ interface FlowLlmOutcomeEffectContext<TParams = unknown, TState = unknown> {
517
+ process: ProcessInstance;
518
+ projects: readonly ProcessProject[];
519
+ params: TParams;
520
+ state: TState;
521
+ output: {
522
+ content: string | null;
523
+ } | null;
524
+ }
525
+ interface FlowAutomaticOutcomeEffectContext<TParams = unknown, TState = unknown> {
526
+ process: ProcessInstance;
527
+ projects: readonly ProcessProject[];
528
+ params: TParams;
529
+ state: TState;
530
+ output: {
531
+ content: string | null;
532
+ } | null;
533
+ }
534
+ interface FlowExternalSourceContext<TParams = unknown, TState = unknown, TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>> extends ExternalSourceEffectContext<TParams, TState, TEvent, TInput> {
535
+ }
536
+ type FlowOutcomeEffectInput<TParams, TState, TContext> = {
537
+ ctx: TContext;
538
+ event: ProcessOutcomeExecution<TParams, TState>["event"];
539
+ turnId: TurnId;
540
+ outcome: string;
541
+ };
542
+ type FlowOutcomeEffect<TParams, TState, TContext> = (input: FlowOutcomeEffectInput<TParams, TState, TContext>) => MaybePromise$1<ProcessEffectPlan<TState> | undefined>;
543
+ type FlowOutcomeStateEffect<TParams, TState, TContext> = (input: FlowOutcomeEffectInput<TParams, TState, TContext>) => MaybePromise$1<TState>;
544
+ declare function createFlowPromptContext<TParams, TState, TConsumedProducts extends string = string>(ctx: ProcessRuntimeTurnContext<TParams, TState>, consumedProducts: readonly TConsumedProducts[], optionalConsumedProducts?: readonly string[]): FlowPromptContext<TParams, TState, TConsumedProducts>;
545
+ declare function createFlowAutomaticRunContext<TParams, TState>(ctx: ProcessRuntimeTurnContext<TParams, TState>): FlowAutomaticRunContext<TParams, TState>;
546
+ declare class RouteAndEffectBuilder<TParams, TState, TContext> {
547
+ protected target: {
548
+ kind: "to";
549
+ turnId: TurnId;
550
+ } | {
551
+ kind: "complete";
552
+ } | {
553
+ kind: "lifecycleStatus";
554
+ status: ProcessTurnTerminalLifecycleStatus;
555
+ } | null;
556
+ protected flowEffect: FlowOutcomeEffect<TParams, TState, TContext> | undefined;
557
+ protected setTarget(next: {
558
+ kind: "to";
559
+ turnId: TurnId;
560
+ } | {
561
+ kind: "complete";
562
+ } | {
563
+ kind: "lifecycleStatus";
564
+ status: ProcessTurnTerminalLifecycleStatus;
565
+ } | null): this;
566
+ to(turnId: TurnId): this;
567
+ complete(): this;
568
+ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this;
569
+ stay(): this;
570
+ state(fn: FlowOutcomeStateEffect<TParams, TState, TContext>): this;
571
+ effect(fn: FlowOutcomeEffect<TParams, TState, TContext>): this;
572
+ hasRoute(): boolean;
573
+ protected buildRouteTarget(): {
574
+ to?: TurnId;
575
+ complete?: boolean;
576
+ lifecycleStatus?: ProcessTurnTerminalLifecycleStatus;
577
+ };
578
+ }
579
+ interface ParameterOptions extends Partial<Omit<OutcomeToolParameterSpec, "type" | "description">> {
580
+ description?: string;
581
+ requiredErrorCode?: string;
582
+ }
583
+ interface ArrayParameterOptions extends ParameterOptions {
584
+ items?: OutcomeToolParameterSpec["items"];
585
+ }
586
+ interface EnumParameterOptions extends ParameterOptions {
587
+ values?: readonly string[];
588
+ }
589
+ interface MarkdownParameterOptions extends ParameterOptions {
590
+ publish?: true;
591
+ }
592
+ declare class ParameterizedOutcomeBuilder<TParams, TState, TContext> extends RouteAndEffectBuilder<TParams, TState, TContext> {
593
+ protected outcomeDescription: string | null;
594
+ protected parameters: Record<string, OutcomeToolParameterSpec>;
595
+ protected publishedMarkdownParameter: string | null;
596
+ description(text: string): this;
597
+ parameter(name: string, spec: OutcomeToolParameterSpec): this;
598
+ private withRequired;
599
+ string(name: string, options?: string | ParameterOptions): this;
600
+ markdown(name: string, options?: string | MarkdownParameterOptions): this;
601
+ requiredString(name: string, options?: string | ParameterOptions): this;
602
+ number(name: string, options?: string | ParameterOptions): this;
603
+ requiredNumber(name: string, options?: string | ParameterOptions): this;
604
+ boolean(name: string, options?: string | ParameterOptions): this;
605
+ requiredBoolean(name: string, options?: string | ParameterOptions): this;
606
+ stringArray(name: string, options?: string | ArrayParameterOptions): this;
607
+ requiredStringArray(name: string, options?: string | ArrayParameterOptions): this;
608
+ enum(name: string, valuesOrOptions: readonly string[] | EnumParameterOptions): this;
609
+ object(name: string, options?: string | ParameterOptions): this;
610
+ array(name: string, options?: string | ArrayParameterOptions): this;
611
+ }
612
+ declare class OutcomeToolBuilder<TParams = unknown, TState = unknown> extends ParameterizedOutcomeBuilder<TParams, TState, FlowLlmOutcomeEffectContext<TParams, TState>> {
613
+ build(): ProcessToolOutcomeSpec<TParams, TState>;
614
+ }
615
+ declare class AutomaticOutcomeBuilder<TParams = unknown, TState = unknown> extends ParameterizedOutcomeBuilder<TParams, TState, FlowAutomaticOutcomeEffectContext<TParams, TState>> {
616
+ build(): ProcessToolOutcomeSpec<TParams, TState>;
617
+ }
618
+ declare class PlanResultBuilder<TParams = unknown, TState = unknown> extends RouteAndEffectBuilder<TParams, TState, FlowLlmOutcomeEffectContext<TParams, TState>> {
619
+ private resultDescription;
620
+ private summarySpec;
621
+ private acceptanceCriteriaSpec;
622
+ private reviewTurnId;
623
+ description(text: string): this;
624
+ summary(options?: string | PlanFieldOptions): this;
625
+ acceptanceCriteria(options?: string | PlanAcceptanceCriteriaOptions): this;
626
+ review(turnId: TurnId): this;
627
+ buildOutcome(): ProcessToolOutcomeSpec<TParams, TState>;
628
+ }
629
+ declare class PublishedResultBuilder<TParams = unknown, TState = unknown> extends RouteAndEffectBuilder<TParams, TState, FlowLlmOutcomeEffectContext<TParams, TState>> implements FlowLlmTurn<TParams, TState, string> {
630
+ private readonly productName;
631
+ private readonly parent?;
632
+ constructor(productName: string, parent?: FlowLlmTurn<TParams, TState, string> | undefined);
633
+ get id(): TurnId;
634
+ get definition(): LlmTurnDefinition<string, TParams, TState>;
635
+ buildTurnEnd(): ProcessTurnEndSpec<TParams, TState, string>;
636
+ }
637
+ declare class LlmTurnEndBuilder<TParams = unknown, TState = unknown> extends RouteAndEffectBuilder<TParams, TState, FlowLlmOutcomeEffectContext<TParams, TState>> implements FlowLlmTurn<TParams, TState, string> {
638
+ private readonly outcomeId;
639
+ private readonly parent?;
640
+ constructor(outcomeId: string, parent?: FlowLlmTurn<TParams, TState, string> | undefined);
641
+ get id(): TurnId;
642
+ get definition(): LlmTurnDefinition<string, TParams, TState>;
643
+ build(): ProcessTurnEndSpec<TParams, TState, string>;
644
+ }
645
+ type LlmPromptBuilder<TParams, TState, TConsumedProducts extends string> = (ctx: FlowPromptContext<TParams, TState, TConsumedProducts>) => MaybePromise$1<string>;
646
+ declare class LlmFlowBuilder<TParams = unknown, TState = unknown, TConsumedProducts extends string = never> implements FlowLlmTurn<TParams, TState, string> {
647
+ private readonly turnId;
648
+ private turnDescription;
649
+ private modelPurposeValue;
650
+ private availableTools;
651
+ private promptBuilder;
652
+ private branchType;
653
+ private context;
654
+ private completionMode;
655
+ private questionsEnabled;
656
+ private startFrom;
657
+ private restorePrimaryLeafAfterTurn;
658
+ private reviewSubject;
659
+ private consumedProductNames;
660
+ private optionalConsumedProductNames;
661
+ private publishedResult;
662
+ private endResult;
663
+ private outcomeToolBuilders;
664
+ constructor(turnId: TurnId);
665
+ get id(): TurnId;
666
+ get definition(): LlmTurnDefinition<string, TParams, TState>;
667
+ description(description: string): this;
668
+ modelPurpose(purpose: LlmModelPurpose): this;
669
+ tools(...tools: readonly PiBuiltInToolName[]): this;
670
+ /** Enable durable operator questions for this LLM turn. */
671
+ askQuestions(): this;
672
+ freshPrimary(): this;
673
+ freshSeededPrimary(): this;
674
+ fullPrimary(): this;
675
+ rootBranchReview(): this;
676
+ continueFromPrimaryLeaf(): this;
677
+ continueFromReviewBranch(): this;
678
+ continueFromProductBranch(productName: string, fallback?: ProcessTurnStartSelection): this;
679
+ startFromReviewBranch(): this;
680
+ startFromProductBranch(productName: string, fallback?: ProcessTurnStartSelection): this;
681
+ startFromRoot(): this;
682
+ reviews(subject: ReviewSubject): this;
683
+ consume<TProductName extends string>(productName: TProductName): LlmFlowBuilder<TParams, TState, TConsumedProducts | TProductName>;
684
+ optionalConsume<TProductName extends string>(productName: TProductName): LlmFlowBuilder<TParams, TState, TConsumedProducts | TProductName>;
685
+ publish(productName: string): PublishedResultBuilder<TParams, TState>;
686
+ end(outcomeId: string): LlmTurnEndBuilder<TParams, TState>;
687
+ buildPrompt(fn: LlmPromptBuilder<TParams, TState, TConsumedProducts>): this;
688
+ prompt(prompt: (ctx: ProcessRuntimeTurnContext<TParams, TState>) => MaybePromise$1<string>): this;
689
+ outcomeTool(id: string, configure: (tool: OutcomeToolBuilder<TParams, TState>) => OutcomeToolBuilder<TParams, TState> | undefined): this;
690
+ private buildBaseDefinition;
691
+ producesPlan(configure: (plan: PlanResultBuilder<TParams, TState>) => PlanResultBuilder<TParams, TState>): FlowLlmTurn<TParams, TState, typeof DEFAULT_PLAN_RESULT_OUTCOME_ID>;
692
+ private buildDefinition;
693
+ }
694
+ declare class AutomaticFlowBuilder<TParams = unknown, TState = unknown> implements FlowAutomaticTurn<TParams, TState, string> {
695
+ private readonly turnId;
696
+ private turnDescription;
697
+ private runFn;
698
+ private outcomeBuilders;
699
+ constructor(turnId: TurnId);
700
+ get id(): TurnId;
701
+ get definition(): AutomaticTurnDefinition<string, TParams, TState>;
702
+ description(description: string): this;
703
+ run(fn: (ctx: FlowAutomaticRunContext<TParams, TState>) => MaybePromise$1<WorkerCompleteInput<string>>): this;
704
+ outcome(id: string, configure: (outcome: AutomaticOutcomeBuilder<TParams, TState>) => AutomaticOutcomeBuilder<TParams, TState> | undefined): this;
705
+ private buildDefinition;
706
+ }
707
+ declare class ServerAutomaticFlowBuilder<TParams = unknown, TState = unknown> implements FlowServerAutomaticTurn<TParams, TState, string> {
708
+ private readonly turnId;
709
+ private turnDescription;
710
+ private restartBehaviorValue;
711
+ private runFn;
712
+ private outcomeBuilders;
713
+ constructor(turnId: TurnId);
714
+ get id(): TurnId;
715
+ get definition(): ServerAutomaticTurnDefinition<string, TParams, TState>;
716
+ description(description: string): this;
717
+ run(fn: (ctx: FlowAutomaticRunContext<TParams, TState>) => MaybePromise$1<WorkerCompleteInput<string> & {
718
+ state?: TState;
719
+ }>): this;
720
+ restartBehavior(behavior: ServerAutomaticTurnRestartBehavior): this;
721
+ outcome(id: string, configure: (outcome: AutomaticOutcomeBuilder<TParams, TState>) => AutomaticOutcomeBuilder<TParams, TState> | undefined): this;
722
+ private buildDefinition;
723
+ }
724
+ declare class HumanActionBuilder<TParams = unknown, TState = unknown> {
725
+ private readonly actionId;
726
+ private spec;
727
+ constructor(actionId: string);
728
+ label(label: string): this;
729
+ description(description: string): this;
730
+ acceptanceState(state: ProcessHumanTurnActionSpec<TParams, TState>["acceptanceState"]): this;
731
+ form(form: ActionFormDefinition): this;
732
+ to(turnId: TurnId): this;
733
+ complete(): this;
734
+ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this;
735
+ trigger(trigger: string): this;
736
+ schedulable(value?: boolean): this;
737
+ effect(effect: ProcessHumanTurnActionSpec<TParams, TState>["effect"]): this;
738
+ build(): ProcessHumanTurnActionSpec<TParams, TState>;
739
+ }
740
+ declare class ExternalActionBuilder<TParams = unknown, TState = unknown, TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>> {
741
+ private spec;
742
+ constructor(actionId: string, source: ExternalActionSource<TParams, TState, TEvent, TInput>);
743
+ label(label: string): this;
744
+ description(description: string): this;
745
+ to(turnId: TurnId): this;
746
+ complete(): this;
747
+ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this;
748
+ publishInput(productName: string, options: {
749
+ inputField: string;
750
+ }): this;
751
+ build(): ProcessHumanTurnExternalActionSpec<TParams, TState, TEvent, TInput>;
752
+ }
753
+ declare class HumanFlowBuilder<TParams = unknown, TState = unknown> implements FlowHumanTurn<TParams, TState> {
754
+ private readonly turnId;
755
+ private turnDescription;
756
+ private reviewSubject;
757
+ private reviewProductName;
758
+ private reviewSemanticRef;
759
+ private operatorAttentionValue;
760
+ private turnCommentary;
761
+ private notes;
762
+ private actions;
763
+ private externalActionBuilders;
764
+ constructor(turnId: TurnId);
765
+ get id(): TurnId;
766
+ get definition(): HumanTurnDefinition<TParams, TState>;
767
+ description(description: string): this;
768
+ review(subject: ReviewSubject | "plan" | "implementation"): this;
769
+ reviewProduct(productName: string, options: {
770
+ subject: ReviewSubject | "plan" | "implementation";
771
+ }): this;
772
+ operatorAttention(attention: HumanTurnOperatorAttention): this;
773
+ commentary(commentary: string): this;
774
+ notesFields(notes: HumanTurnDefinition<TParams, TState>["notesFields"]): this;
775
+ action(actionId: string, configure: (action: HumanActionBuilder<TParams, TState>) => HumanActionBuilder<TParams, TState> | undefined): this;
776
+ externalAction<TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>>(externalActionId: string, source: ExternalActionSource<TParams, TState, TEvent, TInput>, configure: (external: ExternalActionBuilder<TParams, TState, TEvent, TInput>) => ExternalActionBuilder<TParams, TState, TEvent, TInput> | undefined): this;
777
+ }
778
+ declare class ExternalRouteBuilder<TParams = unknown, TState = unknown, TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>> implements FlowExternalTurn<TParams, TState> {
779
+ private readonly parent;
780
+ private readonly source;
781
+ private externalEffect;
782
+ private target;
783
+ constructor(parent: ExternalFlowBuilder<TParams, TState>, source: ExternalActionSource<TParams, TState, TEvent, TInput>);
784
+ get id(): TurnId;
785
+ get definition(): ExternalTurnDefinition<TParams, TState>;
786
+ private setTarget;
787
+ to(turnId: TurnId): this;
788
+ complete(): this;
789
+ lifecycleStatus(status: ProcessTurnTerminalLifecycleStatus): this;
790
+ state(fn: (input: {
791
+ ctx: FlowExternalSourceContext<TParams, TState, TEvent, TInput>;
792
+ event: TEvent;
793
+ input: TInput;
794
+ }) => MaybePromise$1<TState>): this;
795
+ effect(fn: (input: {
796
+ ctx: FlowExternalSourceContext<TParams, TState, TEvent, TInput>;
797
+ event: TEvent;
798
+ input: TInput;
799
+ }) => MaybePromise$1<ProcessEffectPlan<TState> | undefined>): this;
800
+ private buildRouteTarget;
801
+ build(): {
802
+ effect?: ExternalSourceEffect<TParams, TState, TEvent, TInput> | undefined;
803
+ to?: TurnId;
804
+ complete?: boolean;
805
+ lifecycleStatus?: ProcessTurnTerminalLifecycleStatus;
806
+ source: ExternalActionSource<TParams, TState, TEvent, TInput>;
807
+ };
808
+ }
809
+ declare class ExternalFlowBuilder<TParams = unknown, TState = unknown> implements FlowExternalTurn<TParams, TState> {
810
+ private readonly turnId;
811
+ private turnDescription;
812
+ private routeBuilders;
813
+ constructor(turnId: TurnId);
814
+ get id(): TurnId;
815
+ get definition(): ExternalTurnDefinition<TParams, TState>;
816
+ description(description: string): this;
817
+ from<TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>>(source: ExternalActionSource<TParams, TState, TEvent, TInput>): ExternalRouteBuilder<TParams, TState, TEvent, TInput>;
818
+ }
819
+ type Hook<TApi> = (api: TApi) => void;
820
+ declare abstract class FlowComponentBuilder<TParams = unknown, TState = unknown> {
821
+ readonly turns: FlowTurn<TParams, TState>[];
822
+ readonly serverHooks: Hook<ServerProcessAPI<TParams, TState>>[];
823
+ readonly uiHooks: Hook<UiProcessAPI<TParams, TState>>[];
824
+ readonly launcherHooks: Hook<ProcessLauncherAPI<TParams>>[];
825
+ readonly watcherHooks: Hook<ProcessWatcherAPI<TParams>>[];
826
+ turn(turn: FlowTurn<TParams, TState>): this;
827
+ server(hook: Hook<ServerProcessAPI<TParams, TState>>): this;
828
+ action(definition: ProcessActionDefinition<TParams, TState>): this;
829
+ ui(hook: Hook<UiProcessAPI<TParams, TState>>): this;
830
+ launcher(definitionOrHook: ProcessLauncherDefinition<TParams> | Hook<ProcessLauncherAPI<TParams>>): this;
831
+ watcher<TEvent = unknown>(definitionOrHook: ProcessWatcherDefinition<TParams, TEvent> | Hook<ProcessWatcherAPI<TParams>>): this;
832
+ }
833
+ declare class FlowFragmentBuilder<TParams = unknown, TState = unknown> extends FlowComponentBuilder<TParams, TState> {
834
+ readonly name: string;
835
+ constructor(name: string);
836
+ }
837
+ declare class FlowProcessBuilder<TParams = unknown, TState = unknown> extends FlowComponentBuilder<TParams, TState> {
838
+ private readonly processId;
839
+ private processDisplayName;
840
+ private entryTurnId;
841
+ private readonly alternateEntryTurnIds;
842
+ private happyPathTurnIds;
843
+ private paramsCodec;
844
+ private stateCodec;
845
+ private initialStateFn;
846
+ private repositoryCredentialsFn;
847
+ private processPiConfig;
848
+ constructor(processId: string);
849
+ displayName(displayName: string): this;
850
+ entry(turnId: TurnId): this;
851
+ /** Declare an additional turn that launchers may select as the first turn. */
852
+ alternateEntry(turnId: TurnId): this;
853
+ /**
854
+ * Declare the happy path: the ordered spine of turns a successful run walks
855
+ * through. Flow diagrams render this as the main line. Must start at the entry
856
+ * turn and reference only declared turns without repeats.
857
+ */
858
+ happyPath(...turnIds: readonly TurnId[]): this;
859
+ codecs(input: {
860
+ params: Codec<TParams>;
861
+ state: Codec<TState>;
862
+ }): this;
863
+ initialState(fn: (params: TParams) => TState): this;
864
+ repositoryCredentials(fn: (input: {
865
+ params: TParams;
866
+ projects: readonly RepositoryCredentialProject[];
867
+ }) => readonly RepositoryCredentialRequirement[]): this;
868
+ piConfig(config: ProcessPiConfig): this;
869
+ use(fragment: FlowFragmentBuilder<TParams, TState>): this;
870
+ define(): ProcessDefinition<TParams, TState>;
871
+ }
872
+ declare const flow: {
873
+ llm<TParams = unknown, TState = unknown>(turnId: TurnId): LlmFlowBuilder<TParams, TState>;
874
+ automatic<TParams = unknown, TState = unknown>(turnId: TurnId): AutomaticFlowBuilder<TParams, TState>;
875
+ serverAutomatic<TParams = unknown, TState = unknown>(turnId: TurnId): ServerAutomaticFlowBuilder<TParams, TState>;
876
+ human<TParams = unknown, TState = unknown>(turnId: TurnId): HumanFlowBuilder<TParams, TState>;
877
+ external<TParams = unknown, TState = unknown>(turnId: TurnId): ExternalFlowBuilder<TParams, TState>;
878
+ fragment<TParams = unknown, TState = unknown>(name: string): FlowFragmentBuilder<TParams, TState>;
879
+ process<TParams = unknown, TState = unknown>(processId: string): FlowProcessBuilder<TParams, TState>;
880
+ };
881
+
882
+ declare function atomicWriteUtf8(filePath: string, content: string): Promise<void>;
883
+ declare function isEnoent(error: unknown): boolean;
884
+
885
+ type MaybePromise<T> = T | Promise<T>;
886
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
887
+ type QueuedInstructionActionSpec<TParams = unknown, TState = unknown> = DistributiveOmit<ProcessHumanTurnActionSpec<TParams, TState>, "effect"> & {
888
+ queueTarget?: ProcessInputTarget;
889
+ queueSource?: InputSource;
890
+ queueKind?: InputKind;
891
+ resolveBodyMarkdown(input: ProcessActionExecution<TParams, TState>): MaybePromise<string | null | undefined>;
892
+ effect?: ProcessActionEffect<TParams, TState>;
893
+ };
894
+ declare function queuedInstructionAction<TParams = unknown, TState = unknown>(spec: QueuedInstructionActionSpec<TParams, TState>): ProcessHumanTurnActionSpec<TParams, TState>;
895
+ type RevisionActionSpec<TParams = unknown, TState = unknown> = DistributiveOmit<QueuedInstructionActionSpec<TParams, TState>, "resolveBodyMarkdown"> & {
896
+ messageFieldId?: string;
897
+ missingMessageError?: string;
898
+ };
899
+ declare function revisionAction<TParams = unknown, TState = unknown>(spec: RevisionActionSpec<TParams, TState>): ProcessHumanTurnActionSpec<TParams, TState>;
900
+ type AcceptedReviewHandoffActionSpec<TParams = unknown, TState = unknown> = DistributiveOmit<QueuedInstructionActionSpec<TParams, TState>, "queueTarget"> & {
901
+ queueTarget?: ProcessInputTarget;
902
+ };
903
+ declare function acceptedReviewHandoffAction<TParams = unknown, TState = unknown>(spec: AcceptedReviewHandoffActionSpec<TParams, TState>): ProcessHumanTurnActionSpec<TParams, TState>;
904
+
905
+ interface ProvidedCapability<T = unknown> {
906
+ token: CapabilityToken<T>;
907
+ value: T;
908
+ }
909
+ interface CapabilityAccessor {
910
+ provide<T>(token: CapabilityToken<T>, value: T): void;
911
+ get<T>(token: CapabilityToken<T>): T | T[] | undefined;
912
+ require<T>(token: CapabilityToken<T>): T | T[];
913
+ }
914
+ declare function createCapabilityAccessor(provided?: readonly ProvidedCapability[]): CapabilityAccessor;
915
+
916
+ declare function validateProcessLeafOutcomeDefinition(def: ProcessLeafOutcomeDefinition): string[];
917
+ declare function validateLeafOutcomeCaptureResult(result: unknown, expectedRendererId?: string): string[];
918
+ declare function normalizeLeafOutcomeCaptureResult(result: LeafOutcomeCaptureResult): LeafOutcomeCaptureResult;
919
+
920
+ type ProcessGraphSource = ExtensionProcessDefinition<unknown, unknown>;
921
+ type ProcessGraphRegistry = ReadonlyMap<string, ProcessGraphSource>;
922
+ interface ProcessGraphTurnView {
923
+ turnType: ProcessTurnType;
924
+ description: string;
925
+ transitions: readonly ProcessTurnTransition[];
926
+ reviewSubject?: ReviewSubject;
927
+ reviewProduct?: string;
928
+ resultSemanticRef?: ProcessSemanticEntryRefKey;
929
+ publishedProduct?: string;
930
+ publishedProducts?: readonly string[];
931
+ consumedProducts?: readonly string[];
932
+ optionalConsumedProducts?: readonly string[];
933
+ requiredSemanticMarkdownRefs?: readonly ProcessSemanticEntryRefKey[];
934
+ optionalSemanticMarkdownRefs?: readonly ProcessSemanticEntryRefKey[];
935
+ turnResultMarkdownRequired?: boolean;
936
+ }
937
+ interface ProcessGraphView {
938
+ id: string;
939
+ primaryEntryTurnId: TurnId;
940
+ entryTurnIds: ReadonlySet<TurnId>;
941
+ happyPath: readonly TurnId[] | null;
942
+ turns: ReadonlyMap<TurnId, ProcessGraphTurnView>;
943
+ }
944
+ /**
945
+ * Runtime adapter from an extension process definition to the internal graph view.
946
+ * All server lifecycle, validation, model-selection and serialization code should use this view
947
+ * instead of maintaining a second graph representation.
948
+ */
949
+ declare function toProcessGraphView(definition: ProcessGraphSource): ProcessGraphView;
950
+ declare function hasProcessGraph(registry: ProcessGraphRegistry, processId: string): boolean;
951
+ declare function getProcessGraph(registry: ProcessGraphRegistry, processId: string): ProcessGraphView;
952
+ declare function getAllProcessGraphs(registry: ProcessGraphRegistry): readonly ProcessGraphView[];
953
+ declare function getProcessTurnGraph(registry: ProcessGraphRegistry, processId: string, turnId: TurnId): ProcessGraphTurnView | undefined;
954
+ declare function getTurnTransitionsForProcessGraph(registry: ProcessGraphRegistry, processId: string, turnId: TurnId): readonly ProcessTurnTransition[];
955
+ declare function getReachableTurnIdsForProcessGraph(registry: ProcessGraphRegistry, processId: string): readonly TurnId[];
956
+ declare function isTurnAvailableForProcessGraph(registry: ProcessGraphRegistry, processId: string, turnId: TurnId): boolean;
957
+ declare function serializeProcessGraph(registry: ProcessGraphRegistry, processId: string): SerializedProcessGraph;
958
+ declare function listLlmTurnIdsForProcessGraph(registry: ProcessGraphRegistry, processId: string): readonly TurnId[];
959
+ declare function validateProcessGraphEntryTurns(graph: ProcessGraphView): readonly string[];
960
+ declare function validateProcessGraphProducts(graph: ProcessGraphView): readonly string[];
961
+ declare function validateProcessGraphTurnTransitions(graph: ProcessGraphView): readonly string[];
962
+
963
+ /**
964
+ * Removes routing (human) turns from a process graph by merging each one into a
965
+ * single anchor work node (see {@link computeRoutingAnchors}). Edges into a
966
+ * decision are redirected to its anchor, and the decision's action edges are
967
+ * re-emitted from that anchor. Self-loops produced by the merge are left in place
968
+ * here and dropped later during edge construction. Entry turns and the declared
969
+ * happy path are remapped/filtered to stay consistent.
970
+ */
971
+ declare function collapseRoutingTurns(graph: ProcessGraphView): ProcessGraphView;
972
+ /**
973
+ * Projects a process graph into a spine-first flow view for operator-facing
974
+ * diagrams. The spine is the declared happy path (or a derived best-effort path
975
+ * when none is declared); every other turn hangs off the spine as a branch.
976
+ * The `aborted` end state is always present because abort is reachable from any
977
+ * active turn, even when no explicit transition targets it.
978
+ */
979
+ declare function buildProcessFlowView(rawGraph: ProcessGraphView): ProcessFlowView;
980
+
981
+ interface BuiltProcessLauncherDefinition<TParams = unknown> {
982
+ launchers: ReadonlyMap<string, ProcessLauncherDefinition<TParams>>;
983
+ }
984
+ declare function createProcessLauncherBuilder<TParams = unknown>(): ProcessLauncherAPI<TParams> & {
985
+ getDefinition(): BuiltProcessLauncherDefinition<TParams>;
986
+ };
987
+ declare function buildProcessLaunchers<TParams = unknown, TState = unknown>(process: ExtensionProcessDefinition<TParams, TState>): BuiltProcessLauncherDefinition<TParams> | undefined;
988
+
989
+ interface BuiltProcessWatcherDefinition<TParams = unknown, TType extends ProcessWatcherType = ProcessWatcherType> {
990
+ watchers: ReadonlyMap<string, ProcessWatcherDefinition<TParams, unknown, TType>>;
991
+ }
992
+ declare function createProcessWatcherBuilder<TParams = unknown, TType extends ProcessWatcherType = ProcessWatcherType>(): ProcessWatcherAPI<TParams> & {
993
+ getDefinition(): BuiltProcessWatcherDefinition<TParams, TType>;
994
+ };
995
+ declare function buildProcessWatchers<TParams = unknown, TState = unknown>(process: ExtensionProcessDefinition<TParams, TState>): BuiltProcessWatcherDefinition<TParams> | undefined;
996
+
997
+ type SubprocessEnvInput = Record<string, string | undefined>;
998
+ declare const WORKER_SUBPROCESS_SENSITIVE_ENV_KEYS: readonly ["LEITWERK_WORKER_CONNECT_TOKEN", "LEITWERK_WORKER_RECONNECT", "LEITWERK_WORKER_SNAPSHOT_TOKEN"];
999
+ /**
1000
+ * Builds an environment for worker-executed repository shell/tool commands.
1001
+ *
1002
+ * Worker IPC and session-snapshot credentials are valid only for the worker
1003
+ * process itself. Repository scripts, git hooks, package managers, and other
1004
+ * tool subprocesses must not receive them.
1005
+ */
1006
+ declare function sanitizeWorkerSubprocessEnv(baseEnv?: SubprocessEnvInput, overrides?: SubprocessEnvInput): NodeJS.ProcessEnv;
1007
+
1008
+ /** Worker-internal registration; the wrapper path is never copied to ordinary subprocesses. */
1009
+ declare function setRepositoryGitSshWrapper(projectKey: string, wrapperPath: string): void;
1010
+ declare function clearRepositoryGitSshWrappers(): void;
1011
+ /** Safe environment for a trusted Git invocation for one process project. */
1012
+ declare function repositoryGitSubprocessEnv(projectKey: string, overrides?: SubprocessEnvInput): NodeJS.ProcessEnv;
1013
+ declare function repositoryGitArgs(args: readonly string[]): string[];
1014
+
1015
+ type ServerTurnOutcomeHandler<TParams = unknown, TState = unknown> = (event: ProcessTurnOutcomeEvent, ctx: ServerProcessContext<TParams, TState>) => void | Promise<void>;
1016
+ interface BuiltServerProcessDefinition<TParams = unknown, TState = unknown> {
1017
+ actions: ReadonlyMap<string, ProcessActionDefinition<TParams, TState>>;
1018
+ turnOutcomeHandlers: ReadonlyMap<string, readonly ServerTurnOutcomeHandler<TParams, TState>[]>;
1019
+ cleanupHandlers: readonly ProcessCleanupHandler<TParams, TState>[];
1020
+ }
1021
+ declare function createServerProcessBuilder<TParams = unknown, TState = unknown>(): ServerProcessAPI<TParams, TState> & {
1022
+ getDefinition(): BuiltServerProcessDefinition<TParams, TState>;
1023
+ };
1024
+
1025
+ interface StructuralProcessState {
1026
+ semanticEntryRefs: ProcessSemanticEntryRefs;
1027
+ productRefs: ProcessProductRefs;
1028
+ reviewSubject: ReviewSubject | null;
1029
+ }
1030
+ declare function createEmptyStructuralProcessState(): StructuralProcessState;
1031
+ declare function parseStructuralProcessState(value: unknown): StructuralProcessState;
1032
+
1033
+ declare function isLlmTurnDefinition<TParams = unknown, TState = unknown>(turnDef: TurnDefinition<TParams, TState>): turnDef is LlmTurnDefinition<string, TParams, TState>;
1034
+ declare function isAutomaticTurnDefinition<TParams = unknown, TState = unknown>(turnDef: TurnDefinition<TParams, TState>): turnDef is AutomaticTurnDefinition<string, TParams, TState>;
1035
+ declare function isServerAutomaticTurnDefinition<TParams = unknown, TState = unknown>(turnDef: TurnDefinition<TParams, TState>): turnDef is ServerAutomaticTurnDefinition<string, TParams, TState>;
1036
+ declare function isHumanTurnDefinition<TParams = unknown, TState = unknown>(turnDef: TurnDefinition<TParams, TState>): turnDef is HumanTurnDefinition<TParams, TState>;
1037
+ declare function isExternalTurnDefinition<TParams = unknown, TState = unknown>(turnDef: TurnDefinition<TParams, TState>): turnDef is ExternalTurnDefinition<TParams, TState>;
1038
+ declare function defaultTurnStartSelection(branchType: TurnBranchType): ProcessTurnStartFallback;
1039
+ declare function resolveLlmTurnStartSelection<TOutcome extends string = string>(turnDef: Pick<LlmTurnDefinition<TOutcome>, "branchType" | "startFrom">): ProcessTurnStartSelection;
1040
+ declare function resolveLlmTurnRestorePrimaryLeafAfterTurn<TOutcome extends string = string>(turnDef: Pick<LlmTurnDefinition<TOutcome>, "branchType" | "restorePrimaryLeafAfterTurn">): boolean;
1041
+ declare function validateLlmTurnDefinition<TOutcome extends string = string, TParams = unknown, TState = unknown>(turnId: string, turnDef: LlmTurnDefinition<TOutcome, TParams, TState>): string[];
1042
+ declare function validateAutomaticTurnDefinition<TOutcome extends string = string, TParams = unknown, TState = unknown>(turnId: string, turnDef: AutomaticTurnDefinition<TOutcome, TParams, TState> | ServerAutomaticTurnDefinition<TOutcome, TParams, TState>): string[];
1043
+ declare function validateHumanTurnDefinition<TParams = unknown, TState = unknown>(turnId: string, turnDef: HumanTurnDefinition<TParams, TState>): string[];
1044
+ declare function validateExternalTurnDefinition<TParams = unknown, TState = unknown>(turnId: string, turnDef: ExternalTurnDefinition<TParams, TState>): string[];
1045
+ declare function validateTurnDefinition<TParams = unknown, TState = unknown>(turnId: string, turnDef: TurnDefinition<TParams, TState>): string[];
1046
+ declare function validateTurnDefinition<TParams = unknown, TState = unknown>(turnDef: TurnDefinition<TParams, TState>): string[];
1047
+ declare function assertValidLlmTurnDefinition<TOutcome extends string = string, TParams = unknown, TState = unknown>(turnId: string, turnDef: LlmTurnDefinition<TOutcome, TParams, TState>): void;
1048
+ declare function createRootBranchReviewTurn<TOutcome extends string, TParams = unknown, TState = unknown>(def: Omit<LlmTurnDefinition<TOutcome, TParams, TState>, "kind" | "branchType" | "completionMode" | "startFrom" | "restorePrimaryLeafAfterTurn"> & Partial<Pick<LlmTurnDefinition<TOutcome, TParams, TState>, "completionMode" | "startFrom" | "restorePrimaryLeafAfterTurn">>): LlmTurnDefinition<TOutcome, TParams, TState>;
1049
+
1050
+ interface BuiltUiProcessDefinition<TParams = unknown, TState = unknown> {
1051
+ leafOutcome: ProcessLeafOutcomeDefinition<TParams, TState> | null;
1052
+ }
1053
+ declare function createUiProcessBuilder<TParams = unknown, TState = unknown>(): UiProcessAPI<TParams, TState> & {
1054
+ getDefinition(): BuiltUiProcessDefinition<TParams, TState>;
1055
+ };
1056
+ declare function buildUiProcessDefinition<TParams = unknown, TState = unknown>(process: ExtensionProcessDefinition<TParams, TState>): BuiltUiProcessDefinition<TParams, TState> | undefined;
1057
+
1058
+ interface BuiltWorkerProcessDefinition<TParams = unknown, TState = unknown> {
1059
+ startTurnId: TurnId | null;
1060
+ turns: ReadonlyMap<TurnId, WorkerTurnHandler<TParams, TState>>;
1061
+ }
1062
+ declare function createWorkerProcessBuilder<TParams = unknown, TState = unknown>(): WorkerProcessAPI<TParams, TState> & {
1063
+ getDefinition(): BuiltWorkerProcessDefinition<TParams, TState>;
1064
+ };
1065
+
1066
+ export { type AcceptedReviewHandoffActionSpec, type ActionExecutionFailureStageLike, type ActionExecutionResultLike, AutomaticFlowBuilder, AutomaticOutcomeBuilder, AutomaticTurnDefinition, BUILT_IN_COMMIT_MESSAGE_RULES, type BroadcasterLike, type BrowserUiExtensionAPI, type BrowserUiExtensionContext, type BrowserUiExtensionModule, type BrowserUiShellIndicatorRegistration, type BrowserUiShortcutRegistration, type BrowserUiWsFrameHandler, type BuiltProcessLauncherDefinition, type BuiltProcessWatcherDefinition, type BuiltServerProcessDefinition, type BuiltUiProcessDefinition, type BuiltWorkerProcessDefinition, COMMIT_MESSAGE_PROJECT_METADATA_KEY, CORE_TOOL_CALL_RENDERERS, type CapabilityAccessor, CapabilityToken, Codec, type CommitMessageProjectMetadata, type ComponentConfigLike, type CoreServerSetupDeps, DEFAULT_FLOW_PRODUCT_NAME, DEFAULT_PLAN_RESULT_OUTCOME_ID, type DeferredProcessActivationEvent, type DeferredProcessActivationExpected, type DeferredProcessActivationFailure, type DeferredProcessActivationOutcome, type DeferredProcessActivationSnapshot, type DeferredProcessActivationSnapshotQuery, type DeferredProcessActivationSnapshotResult, EventBus, ExtensionProcessDefinition, ExternalActionBuilder, ExternalActionSource, ExternalFlowBuilder, ExternalRouteBuilder, type ExternalSourceArmingLike, ExternalSourceEffect, ExternalSourceEffectContext, type ExternalSourceFireInput, type ExternalSourceServiceLike, ExternalTurnDefinition, type FlowAutomaticOutcomeEffectContext, type FlowAutomaticRunContext, type FlowAutomaticTurn, type FlowExternalTurn, FlowFragmentBuilder, type FlowHumanTurn, type FlowLlmOutcomeEffectContext, type FlowLlmTurn, FlowProcessBuilder, type FlowPromptContext, type FlowRepoContext, type FlowRepoLookup, type FlowServerAutomaticTurn, type FlowTurn, type HandoffDedupKeyRecordLike, type HandoffDedupKeyServiceLike, HumanActionBuilder, HumanFlowBuilder, HumanTurnDefinition, HumanTurnOperatorAttention, type LaunchModelConfigInputLike, type LaunchPlanPreparationIssue, type LaunchPlanPreparationIssueCode, type LaunchPlanPreparationResultLike, LauncherContext, type LauncherModelConfigPreviewLike, type LauncherModelConfigSchemaLike, type LauncherModelConfigServiceLike, type LauncherRecentValuesServiceLike, LeafOutcomeCaptureResult, LlmFlowBuilder, LlmModelPurpose, LlmTurnDefinition, LlmTurnEndBuilder, MARKDOWN_RESULT_TOOL_MARKDOWN_PATH, MARKDOWN_RESULT_TOOL_NAME, MARKDOWN_RESULT_TOOL_RENDERER, type ModelProfileOptionSummaryLike, OutcomeToolBuilder, OutcomeToolParameterSpec, PiBuiltInToolName, type PlanAcceptanceCriteriaOptions, type PlanFieldOptions, PlanResultBuilder, type PreparedDeferredProcessActivation, ProcessActionDefinition, ProcessActionEffect, ProcessActionExecution, type ProcessActionExecutionOrigin, type ProcessActionExecutionSource, type ProcessActionModelPreviewLike, type ProcessActionServiceLike, type ProcessActionSummaryLike, type ProcessCreateInputLike, ProcessDefinition, ProcessEffectPlan, type ProcessEngineLike, type ProcessEngineResultLike, type ProcessEventRepoLike, type ProcessGraphRegistry, type ProcessGraphSource, type ProcessGraphTurnView, type ProcessGraphView, ProcessHumanTurnActionSpec, ProcessHumanTurnExternalActionSpec, ProcessLaunchConfig, type ProcessLaunchConfigExecutionInput, type ProcessLaunchExecutionResultLike, type ProcessLaunchExecutorLike, type ProcessLaunchFailureStageLike, ProcessLaunchPlan, type ProcessLaunchPlanServiceLike, ProcessLauncherAPI, ProcessLauncherDefinition, ProcessLauncherService, ProcessLeafOutcomeDefinition, type ProcessModelSelectionPreviewFailureCode, type ProcessModelSelectionPreviewResultLike, type ProcessModelSelectionServiceLike, ProcessOutcomeExecution, ProcessPiConfig, type ProcessProjectRepoLike, type ProcessQuestionServiceLike, type ProcessRepoLike, ProcessRuntimeTurnContext, ProcessToolOutcomeSpec, ProcessTurnEndSpec, ProcessTurnOutcomeEvent, ProcessWatcherAPI, type ProcessWatcherConfigLike, ProcessWatcherDefinition, type ProcessWatcherServiceLike, type ProvidedCapability, PublishedResultBuilder, type QueuedInstructionActionSpec, type QueuedProcessInputLike, REQUIRED_MARKDOWN_RESULT_TURN_RESULT, type RegisteredProcessWatcherLike, RepositoryCredentialProject, RepositoryCredentialRegistrar, RepositoryCredentialRequirement, type ResolvedProcessWatcherStartLike, type RevisionActionSpec, ServerAutomaticFlowBuilder, ServerAutomaticTurnDefinition, ServerAutomaticTurnRestartBehavior, ServerProcessAPI, ServerProcessContext, type ServerTurnOutcomeHandler, type StructuralProcessState, type SubprocessEnvInput, TurnBranchType, TurnDefinition, TurnResultMarkdownBehavior, UiProcessAPI, WORKER_SUBPROCESS_SENSITIVE_ENV_KEYS, WorkerCompleteInput, WorkerProcessAPI, type WorkerSupervisorLike, WorkerTurnHandler, acceptedReviewHandoffAction, assertValidLlmTurnDefinition, atomicWriteUtf8, buildProcessFlowView, buildProcessLaunchers, buildProcessWatchers, buildUiProcessDefinition, clearRepositoryGitSshWrappers, collapseRoutingTurns, coreHostCapabilities, createCapabilityAccessor, createEmptyStructuralProcessState, createEventBus, createFlowAutomaticRunContext, createFlowPromptContext, createProcessLauncherBuilder, createProcessWatcherBuilder, createRootBranchReviewTurn, createServerProcessBuilder, createUiProcessBuilder, createWorkerProcessBuilder, defaultTurnStartSelection, emptyParamsCodec, flow, getAllProcessGraphs, getProcessGraph, getProcessTurnGraph, getReachableTurnIdsForProcessGraph, getTurnTransitionsForProcessGraph, hasProcessGraph, isAutomaticTurnDefinition, isEnoent, isExternalTurnDefinition, isHumanTurnDefinition, isLlmTurnDefinition, isServerAutomaticTurnDefinition, isTurnAvailableForProcessGraph, listLlmTurnIdsForProcessGraph, normalizeLeafOutcomeCaptureResult, parseStructuralProcessState, queuedInstructionAction, repositoryGitArgs, repositoryGitSubprocessEnv, resolveLlmTurnRestorePrimaryLeafAfterTurn, resolveLlmTurnStartSelection, revisionAction, sanitizeWorkerSubprocessEnv, serializeProcessGraph, setRepositoryGitSshWrapper, toProcessGraphView, validateAutomaticTurnDefinition, validateExternalTurnDefinition, validateHumanTurnDefinition, validateLeafOutcomeCaptureResult, validateLlmTurnDefinition, validateProcessGraphEntryTurns, validateProcessGraphProducts, validateProcessGraphTurnTransitions, validateProcessLeafOutcomeDefinition, validateToolCallRendererDefinition, validateTurnDefinition };