@leitwerk-dev/protocol 0.1.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/LICENSE +13 -0
- package/dist/chunk-6L4W7WPV.js +1 -0
- package/dist/chunk-6L4W7WPV.js.map +1 -0
- package/dist/chunk-7PCFBAV4.js +740 -0
- package/dist/chunk-7PCFBAV4.js.map +1 -0
- package/dist/chunk-AAV3AAOF.js +1 -0
- package/dist/chunk-AAV3AAOF.js.map +1 -0
- package/dist/chunk-IEMT3JG4.js +1 -0
- package/dist/chunk-IEMT3JG4.js.map +1 -0
- package/dist/chunk-IWVU76M5.js +26 -0
- package/dist/chunk-IWVU76M5.js.map +1 -0
- package/dist/config-snapshot.d.ts +211 -0
- package/dist/config-snapshot.d.ts.map +1 -0
- package/dist/config-snapshot.js +2 -0
- package/dist/config-snapshot.js.map +1 -0
- package/dist/external-review.d.ts +8 -0
- package/dist/external-review.d.ts.map +1 -0
- package/dist/external-review.js +2 -0
- package/dist/external-review.js.map +1 -0
- package/dist/form-contract.d.ts +41 -0
- package/dist/form-contract.d.ts.map +1 -0
- package/dist/form-contract.js +2 -0
- package/dist/form-contract.js.map +1 -0
- package/dist/http-contracts-C8IXe8MU.d.ts +1483 -0
- package/dist/http-contracts.d.ts +959 -0
- package/dist/http-contracts.d.ts.map +1 -0
- package/dist/http-contracts.js +434 -0
- package/dist/http-contracts.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/initial-prompt.d.ts +8 -0
- package/dist/initial-prompt.d.ts.map +1 -0
- package/dist/initial-prompt.js +103 -0
- package/dist/initial-prompt.js.map +1 -0
- package/dist/launcher-contract.d.ts +34 -0
- package/dist/launcher-contract.d.ts.map +1 -0
- package/dist/launcher-contract.js +2 -0
- package/dist/launcher-contract.js.map +1 -0
- package/dist/live-turn-projection.d.ts +39 -0
- package/dist/live-turn-projection.d.ts.map +1 -0
- package/dist/live-turn-projection.js +395 -0
- package/dist/live-turn-projection.js.map +1 -0
- package/dist/pi-session-message.d.ts +25 -0
- package/dist/pi-session-message.d.ts.map +1 -0
- package/dist/pi-session-message.js +27 -0
- package/dist/pi-session-message.js.map +1 -0
- package/dist/primary-path-snapshot.d.ts +77 -0
- package/dist/primary-path-snapshot.d.ts.map +1 -0
- package/dist/primary-path-snapshot.js +2 -0
- package/dist/primary-path-snapshot.js.map +1 -0
- package/dist/protocol.d.ts +428 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +261 -0
- package/dist/protocol.js.map +1 -0
- package/dist/session-entry-tree.d.ts +15 -0
- package/dist/session-entry-tree.d.ts.map +1 -0
- package/dist/session-entry-tree.js +42 -0
- package/dist/session-entry-tree.js.map +1 -0
- package/dist/streamable-events.d.ts +4 -0
- package/dist/streamable-events.d.ts.map +1 -0
- package/dist/streamable-events.js +17 -0
- package/dist/streamable-events.js.map +1 -0
- package/dist/text-preview.d.ts +7 -0
- package/dist/text-preview.d.ts.map +1 -0
- package/dist/text-preview.js +23 -0
- package/dist/text-preview.js.map +1 -0
- package/dist/timeline-projection.d.ts +9 -0
- package/dist/timeline-projection.d.ts.map +1 -0
- package/dist/timeline-projection.js +30 -0
- package/dist/timeline-projection.js.map +1 -0
- package/dist/timestamp-ordering.d.ts +3 -0
- package/dist/timestamp-ordering.d.ts.map +1 -0
- package/dist/timestamp-ordering.js +15 -0
- package/dist/timestamp-ordering.js.map +1 -0
- package/dist/tool-renderer-contract.d.ts +18 -0
- package/dist/tool-renderer-contract.d.ts.map +1 -0
- package/dist/tool-renderer-contract.js +22 -0
- package/dist/tool-renderer-contract.js.map +1 -0
- package/dist/turn-continuation.d.ts +36 -0
- package/dist/turn-continuation.d.ts.map +1 -0
- package/dist/turn-continuation.js +179 -0
- package/dist/turn-continuation.js.map +1 -0
- package/dist/usage-by-turn-record.d.ts +5 -0
- package/dist/usage-by-turn-record.d.ts.map +1 -0
- package/dist/usage-by-turn-record.js +25 -0
- package/dist/usage-by-turn-record.js.map +1 -0
- package/dist/usage-snapshot.d.ts +25 -0
- package/dist/usage-snapshot.d.ts.map +1 -0
- package/dist/usage-snapshot.js +120 -0
- package/dist/usage-snapshot.js.map +1 -0
- package/dist/ws-event-payloads.d.ts +18 -0
- package/dist/ws-event-payloads.d.ts.map +1 -0
- package/dist/ws-event-payloads.js +47 -0
- package/dist/ws-event-payloads.js.map +1 -0
- package/package.json +65 -0
- package/src/config-snapshot.ts +244 -0
- package/src/external-review.ts +7 -0
- package/src/form-contract.ts +50 -0
- package/src/http-contracts.ts +1497 -0
- package/src/index.ts +20 -0
- package/src/initial-prompt.ts +127 -0
- package/src/launcher-contract.ts +43 -0
- package/src/live-turn-projection.ts +501 -0
- package/src/pi-session-message.ts +48 -0
- package/src/primary-path-snapshot.ts +98 -0
- package/src/protocol.ts +503 -0
- package/src/session-entry-tree.ts +63 -0
- package/src/streamable-events.ts +20 -0
- package/src/text-preview.ts +32 -0
- package/src/timeline-projection.ts +43 -0
- package/src/timestamp-ordering.ts +15 -0
- package/src/tool-renderer-contract.ts +41 -0
- package/src/turn-continuation.ts +298 -0
- package/src/usage-by-turn-record.ts +34 -0
- package/src/usage-snapshot.ts +174 -0
- package/src/ws-event-payloads.ts +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/http-contracts.ts","../src/protocol.ts"],"sourcesContent":["import {\n\ttype Actor,\n\ttype DurableModelSelection,\n\ttype FutureExecutionBlockReason,\n\ttype InstanceTurnConfigMap,\n\ttype LaunchModelConfigInput,\n\tnormalizeActor,\n\tnormalizeLaunchModelConfigInput,\n\ttype ProcessEvent,\n\ttype ProcessFlowView,\n\ttype ProcessInput,\n\ttype ProcessInstance,\n\ttype ProcessLeafOutcomeSnapshot,\n\ttype ProcessProject,\n\ttype ProcessQuestionRequest,\n\ttype ProcessRowSlot,\n\ttype ProcessSelectedTurnModelSource,\n\ttype ProcessTurnAnnotation,\n\ttype ProcessTurnRecord,\n\ttype ProcessTurnType,\n\ttype QuestionAnswerDraft,\n\ttype SerializedProcessGraph,\n\ttrimToNull,\n\ttype WorkerLease,\n} from \"@leitwerk-dev/domain\";\nimport * as v from \"valibot\";\nimport type { ProcessWatcherType } from \"./config-snapshot.js\";\nimport type {\n\tActionFormDefinition,\n\tActionFormFieldDefinition,\n\tFormFieldOptionDefinition,\n} from \"./form-contract.js\";\nimport type { LauncherValidationError, UiLauncherSummaryBase } from \"./launcher-contract.js\";\nimport type {\n\tPrimaryPathSnapshot,\n\tPrimaryPathStreamingAssistantSnapshot,\n\tPrimaryPathToolCallSnapshot,\n\tPrimaryPathTraceItemSnapshot,\n\tTurnUsageSnapshot,\n} from \"./primary-path-snapshot.js\";\nimport {\n\terr,\n\tnullableStringSchema,\n\tok,\n\toptionalNullableStringSchema,\n\ttype ParseResult,\n\tparseLiteral,\n\tparseSchema,\n\tunknownRecordSchema,\n} from \"./protocol.js\";\nimport type { ToolCallRendererDefinition } from \"./tool-renderer-contract.js\";\n\nexport interface AuthMeResponseBody {\n\tauthEnabled: boolean;\n\tactor: Actor | null;\n}\n\nexport interface ProcessListItem {\n\tprocess: ProcessInstance;\n\tprojects: ProcessProject[];\n\tworkerLease: WorkerLease | null;\n\tprocessDisplayName: string | null;\n}\n\nexport type ScheduleMode = \"now\" | \"once\" | \"cron\";\n\nexport type ScheduleConfigInput = {\n\tmode: ScheduleMode;\n\trunAt?: string | null;\n\tcronExpression?: string | null;\n};\n\nexport interface FutureExecutionBaseSummary {\n\tid: string;\n\tkind: \"launch\" | \"action\";\n\tscheduleKind: \"once\" | \"cron\";\n\tprocessId: string;\n\tnextRunAt: string;\n\tcronExpression: string | null;\n\ttitle: string;\n\tsubtitle: string;\n\tstatus?: \"scheduled\" | \"blocked\";\n\tmodelSelection?: DurableModelSelection | null;\n\tblockedReason?: FutureExecutionBlockReason | null;\n}\n\nexport type LauncherModelConfigDefaults = LaunchModelConfigInput;\n\nexport interface FutureLaunchSummary extends FutureExecutionBaseSummary {\n\tkind: \"launch\";\n\tlauncherId: string;\n\tlauncherLabel: string;\n\tlaunchTitle: string | null;\n\tlauncherInput: Record<string, unknown>;\n\tskillIds: string[];\n\tmodelConfig: LauncherModelConfigDefaults;\n}\n\nexport interface FutureActionSummary extends FutureExecutionBaseSummary {\n\tkind: \"action\";\n\tinstanceId: string;\n\tactionId: string;\n\tactionLabel: string;\n\tnextTurnModelProfileId: string | null;\n}\n\nexport type FutureExecutionSummary = FutureLaunchSummary | FutureActionSummary;\n\nexport type ProcessActionFieldDefinition = ActionFormFieldDefinition;\nexport type ProcessActionFormDefinition = ActionFormDefinition;\n\nexport type ProcessActionPreviewSummary = {\n\tkind: \"turn\" | \"terminal\";\n\tturnId: string | null;\n\tturnKind: ProcessTurnType | null;\n\tdescription: string;\n};\n\nexport interface ProcessActionSummary {\n\tid: string;\n\tlabel: string;\n\tdescription: string | null;\n\tpreview: ProcessActionPreviewSummary | null;\n\tsupportsScheduling: boolean;\n\tsupportsNextTurnModelOverride: boolean;\n\tform?: ProcessActionFormDefinition;\n}\n\nexport interface ScheduledActionDetail {\n\tid: string;\n\tnextRunAt: string;\n\tactionId: string;\n\tactionLabel: string;\n\tinput: Record<string, unknown>;\n\tnextTurnModelProfileId: string | null;\n\tstatus?: \"scheduled\" | \"blocked\";\n\tmodelSelection?: DurableModelSelection | null;\n\tblockedReason?: FutureExecutionBlockReason | null;\n\taction: ProcessActionSummary;\n}\n\nexport type ProcessActionModelResolutionSource =\n\t| ProcessSelectedTurnModelSource\n\t| \"persisted_selection\"\n\t| \"none\";\n\nexport interface ProcessActionModelResolutionPreview {\n\tstatus: \"resolved\" | \"none\" | \"error\";\n\tmodelProfileId: string | null;\n\tsource: ProcessActionModelResolutionSource | null;\n\terror: string | null;\n}\n\nexport interface ProcessActionWarmPromptCacheContext {\n\tpreviousModelProfileId: string;\n\tcompatibleModelProfileIds: readonly string[];\n\texpiresAt: string;\n}\n\nexport interface PromptCacheSwitchResolution {\n\tswitchingModelMayBypassPromptCache: boolean;\n\trecommendedModelProfileId: string | null;\n}\n\nexport function resolvePromptCacheSwitch(input: {\n\tcontext: ProcessActionWarmPromptCacheContext | null | undefined;\n\teffectiveModelProfileId: string;\n\tselectableModelProfileIds?: readonly string[];\n\tnow?: number;\n}): PromptCacheSwitchResolution {\n\tconst expiresAtMs = input.context ? Date.parse(input.context.expiresAt) : Number.NaN;\n\tif (\n\t\t!input.context ||\n\t\t!Number.isFinite(expiresAtMs) ||\n\t\t(input.now ?? Date.now()) > expiresAtMs ||\n\t\tinput.context.compatibleModelProfileIds.includes(input.effectiveModelProfileId)\n\t) {\n\t\treturn { switchingModelMayBypassPromptCache: false, recommendedModelProfileId: null };\n\t}\n\tconst selectableIds = input.selectableModelProfileIds\n\t\t? new Set(input.selectableModelProfileIds)\n\t\t: null;\n\tconst recommendations = input.context.compatibleModelProfileIds.filter(\n\t\t(profileId) => !selectableIds || selectableIds.has(profileId),\n\t);\n\treturn {\n\t\tswitchingModelMayBypassPromptCache: true,\n\t\trecommendedModelProfileId: recommendations.includes(input.context.previousModelProfileId)\n\t\t\t? input.context.previousModelProfileId\n\t\t\t: (recommendations[0] ?? null),\n\t};\n}\n\nexport interface ProcessActionModelPreview {\n\tkind: \"llm_turn\" | \"not_applicable\" | \"unavailable\";\n\tturnId: string | null;\n\tdescription: string | null;\n\tresolvedModel?: ProcessActionModelResolutionPreview;\n\twarmPromptCache?: ProcessActionWarmPromptCacheContext;\n\tunavailableReason?:\n\t\t| \"action_not_found\"\n\t\t| \"action_not_visible\"\n\t\t| \"invalid_action_input\"\n\t\t| \"action_failed\";\n\tunavailableMessage?: string | null;\n}\n\nexport type ProcessExternalSourceSummary = {\n\tid: string;\n\tkind: string;\n\texternalActionId?: string;\n\tsourceKind?: string;\n\tlabel: string | null;\n\tdescription: string | null;\n};\n\nexport type ProcessExternalTriggerSummary = ProcessExternalSourceSummary;\n\nexport interface ProcessSelectedTurnSummary {\n\tturnId: string;\n\tkind: ProcessTurnType;\n\tdescription: string;\n\tcommentary: string | null;\n\texternalTriggers: ProcessExternalSourceSummary[];\n}\n\nexport type ModelProfileAvailability = \"available\" | \"unavailable\" | \"stale\";\n\nexport type ModelProfileOptionSummary = {\n\tid: string;\n\tlabel: string;\n\tdescription: string;\n\tavailability: ModelProfileAvailability;\n\tsafeReason?: string | null;\n\tcheckedAt?: string | null;\n};\n\nexport interface ProviderOptionChoiceSummary {\n\tvalue: string;\n\tlabel: string;\n}\n\nexport interface ProviderOptionFieldSummary {\n\tid: string;\n\tlabel: string;\n\trequired: boolean;\n\tminLength: number | null;\n\tmaxLength: number | null;\n\tdefaultValue: string | null;\n\t/** Advisory values. Values outside this list can still be valid. */\n\tchoices: readonly ProviderOptionChoiceSummary[];\n}\n\nexport interface ModelProviderOptionsResponseBody {\n\tmodelProfileId: string;\n\tproviderId: string;\n\tfields: readonly ProviderOptionFieldSummary[];\n\tchoicesStatus: \"available\" | \"unavailable\";\n\tchoicesUnavailableReason: string | null;\n}\n\nexport interface ProcessTurnModelConfigurationView {\n\tturnId: string;\n\tdescription: string;\n\tpathType: string;\n\tprocessConfigModelProfileId: string | null;\n\tinstanceModelProfileId: string | null;\n\teffectiveConfiguredModelProfileId: string | null;\n\tsource: \"instance\" | \"process_config\" | \"default\";\n}\n\nexport type ProcessModelConfigurationIssueView = {\n\tcode: \"invalid_turn_configs_json\";\n\treason: \"invalid_json\" | \"not_object\" | \"turn_config_not_object\";\n\tturnId?: string;\n};\n\nexport interface ProcessModelConfigurationView {\n\tstate:\n\t\t| { kind: \"ready\" }\n\t\t| { kind: \"blocked\"; issues: readonly ProcessModelConfigurationIssueView[] };\n\tavailableProfiles: readonly ModelProfileOptionSummary[];\n\teffectiveSelectedTurn: {\n\t\tturnId: string;\n\t\tdescription: string;\n\t\tmodelProfileId: string;\n\t\tsource: ProcessActionModelResolutionSource;\n\t} | null;\n\tdefaultModel: {\n\t\tprocessConfigModelProfileId: string | null;\n\t\tinstanceModelProfileId: string | null;\n\t\teffectiveModelProfileId: string | null;\n\t\tsource: \"instance\" | \"process_config\" | \"catalog_default\" | \"none\";\n\t};\n\tturns: readonly ProcessTurnModelConfigurationView[];\n}\n\nexport type ProcessRunToolParameterView = {\n\tname: string;\n\ttype: string;\n\tdescription: string;\n\trequired: boolean;\n};\n\nexport type ProcessRunToolView = {\n\tname: string;\n\tdescription: string;\n\tparameters: readonly ProcessRunToolParameterView[];\n};\n\nexport type ProcessRunTurnView = {\n\tturnId: string;\n\tdescription: string;\n\tpathType: string;\n\tconsumedProducts: readonly string[];\n\tpublishedProducts: readonly string[];\n\tactivePiToolNames: readonly string[];\n\toutcomeActions: readonly ProcessRunToolView[];\n};\n\nexport type ProcessRunDetailsView = {\n\tsystemPrompt: string | null;\n\tappendSystemPrompt: string | null;\n\tavailablePiToolNames: readonly string[];\n\tturns: readonly ProcessRunTurnView[];\n};\n\nexport interface ProcessLaunchConfigurationParameterView {\n\tfieldId: string;\n\tlabel: string;\n\tvalue: string | null;\n}\n\nexport interface ProcessLaunchConfigurationProjectView {\n\tkey: string;\n\trepoLocator: string;\n\trepoLocatorKind: ProcessProject[\"repoLocatorKind\"];\n\tbaseBranch: string;\n\tworkBranch: string | null;\n\texternalId: string | null;\n\texternalUrl: string | null;\n\tpipelineStatus: string | null;\n}\n\nexport interface ProcessLaunchConfigurationView {\n\tlauncherId: string | null;\n\tlauncherLabel: string | null;\n\tlauncherSchemaTitle: string | null;\n\tparamsParseError: string | null;\n\tparameters: readonly ProcessLaunchConfigurationParameterView[];\n\tprojects: readonly ProcessLaunchConfigurationProjectView[];\n}\n\nexport interface PiSessionUsageSnapshot {\n\tinput: number;\n\toutput: number;\n\t/** Provider-reported reasoning/thinking tokens. This is a subset of output tokens. */\n\treasoning?: number;\n\tcacheRead: number;\n\tcacheWrite: number;\n\ttotalTokens: number;\n\tcost?: {\n\t\tinput: number;\n\t\toutput: number;\n\t\tcacheRead: number;\n\t\tcacheWrite: number;\n\t\ttotal: number;\n\t};\n}\n\nexport type PiSessionTextContentBlock = { type: \"text\"; text: string };\n\nexport type PiSessionThinkingContentBlock = {\n\ttype: \"thinking\";\n\tthinking: string;\n\tredacted?: boolean;\n};\n\nexport type PiSessionToolCallContentBlock = {\n\ttype: \"toolCall\";\n\tid: string;\n\tname: string;\n\targuments: Record<string, unknown>;\n};\n\nexport type PiSessionImageContentBlock = {\n\ttype: \"image\";\n\tdata: string;\n\tmimeType: string;\n};\n\nexport type PiSessionContentBlock =\n\t| PiSessionTextContentBlock\n\t| PiSessionThinkingContentBlock\n\t| PiSessionToolCallContentBlock\n\t| PiSessionImageContentBlock;\n\nexport interface PiSessionMessageRecord {\n\trole?: string;\n\tcontent?: string | PiSessionContentBlock[];\n\ttoolCallId?: string;\n\ttoolName?: string;\n\tdetails?: unknown;\n\tisError?: boolean;\n\tusage?: PiSessionUsageSnapshot;\n\tstopReason?: string;\n\terrorMessage?: string;\n\tprovider?: string;\n\tmodel?: string;\n\ttimestamp?: number;\n}\n\nexport interface PiSessionEntry {\n\ttype: string;\n\tid: string;\n\tparentId: string | null;\n\ttimestamp: string;\n\tmessage?: PiSessionMessageRecord;\n\ttargetId?: string;\n\tlabel?: string;\n}\n\nexport interface ProcessDiagnosticsData {\n\tprocess: ProcessInstance;\n\tprojects: ProcessProject[];\n\tinputs: ProcessInput[];\n\tevents: ProcessEvent[];\n\tleafOutcomeSnapshots: ProcessLeafOutcomeSnapshot[];\n\tturnRecords: ProcessTurnRecord[];\n\tturnAnnotations: ProcessTurnAnnotation[];\n\tworkerLease: WorkerLease | null;\n\tprocessDisplayName: string | null;\n\tprocessGraph: SerializedProcessGraph;\n\tprocessFlow: ProcessFlowView;\n\tpiSessionEntries: PiSessionEntry[];\n\tdefinesLeafOutcome: boolean;\n\tselectedTurn?: ProcessSelectedTurnSummary | null;\n\tscheduledAction?: ScheduledActionDetail | null;\n\tmodelConfiguration: ProcessModelConfigurationView;\n\trunDetails: ProcessRunDetailsView;\n\tlaunchConfiguration: ProcessLaunchConfigurationView;\n\tactions: ProcessActionSummary[];\n\ttoolRenderers: ToolCallRendererDefinition[];\n}\n\nexport interface ProcessDetailData extends ProcessDiagnosticsData {\n\tprimaryPath: PrimaryPathSnapshot;\n}\n\nexport interface LauncherModelConfigSchema {\n\tavailableProfiles: readonly ModelProfileOptionSummary[];\n\tllmTurns: ReadonlyArray<{\n\t\tturnId: string;\n\t\tdescription: string;\n\t}>;\n}\n\nexport type LauncherDefaultModelPreview = {\n\tsource: \"instance_default\" | \"process_config_default\" | \"catalog_default\" | \"none\";\n\tprofile: ModelProfileOptionSummary | null;\n};\n\nexport interface LauncherTurnModelConfigPreview {\n\tturnId: string;\n\tdescription: string;\n\teffective: {\n\t\tsource: ProcessActionModelResolutionSource;\n\t\tprofile: ModelProfileOptionSummary | null;\n\t};\n}\n\nexport type LauncherModelConfigPreview = {\n\tdefaultModel: LauncherDefaultModelPreview;\n\tturns: readonly LauncherTurnModelConfigPreview[];\n};\n\nexport type UiLauncherSummary = UiLauncherSummaryBase & {\n\tmodelConfigSchema?: LauncherModelConfigSchema;\n\tprocessFlow?: ProcessFlowView;\n};\n\nexport type ProcessRetryConfig = {\n\tlauncherId: string;\n\ttitle: string | null;\n\tlauncherInput: Record<string, unknown>;\n\tskillIds: string[];\n\tmodelConfig: LauncherModelConfigDefaults;\n};\n\nexport type WatcherLaunchModelSummary = {\n\tdefaultModelProfileId: string | null;\n\tturnConfigs: Array<{ turnId: string; modelProfileId: string | null }>;\n};\n\nexport interface WatcherSummaryBase {\n\tprocessId: string;\n\tprocessDisplayName: string;\n\twatcherId: string;\n\tlabel: string;\n\tdescription: string;\n\ttype: ProcessWatcherType;\n\tenabled: boolean;\n\tpollInterval: string;\n\tconfigPath: string;\n\ttargetSummary: string;\n\tlaunchModel: WatcherLaunchModelSummary;\n}\n\nexport interface JiraWatcherSummary extends WatcherSummaryBase {\n\ttype: \"jira\";\n\tproject: string;\n\tlabels: {\n\t\ttrigger: string;\n\t\tdone: string;\n\t\trequired?: string[];\n\t\tforbidden?: string[];\n\t};\n\ttargetBranchLabelPrefix: string;\n}\n\nexport interface GitLabMrWatcherSummary extends WatcherSummaryBase {\n\ttype: \"gitlab_mr\";\n\tgroup: string;\n\tlabels: {\n\t\ttrigger: string;\n\t\tdone: string;\n\t};\n}\n\nexport type FilesystemWatcherSummary = WatcherSummaryBase & {\n\ttype: \"filesystem\";\n\tfilePath: string;\n};\n\nexport type WatcherSummary = JiraWatcherSummary | GitLabMrWatcherSummary | FilesystemWatcherSummary;\n\nexport interface SkillUsageSummary {\n\tattachedAllTime: number;\n\tattachedLast30Days: number;\n\tinvokedAllTime: number;\n\tinvokedLast30Days: number;\n}\n\nexport interface SkillRepositorySummary {\n\tid: string;\n\tlabel: string;\n\turl: string;\n\tref: string;\n\tpath: string;\n\tlastRefreshedAt: string | null;\n\terror: string | null;\n}\n\nexport interface SkillCatalogItem {\n\trepositoryId: string;\n\tid: string;\n\tlabel: string;\n\tdescription: string | null;\n\tsourcePath: string;\n\tsourceRevision: string;\n\tregistered: boolean;\n\tupdateAvailable: boolean;\n\tconflict: boolean;\n\tstale: boolean;\n\tusage: SkillUsageSummary;\n}\n\nexport type SkillRegistrationKind = \"configuration\" | \"catalog\";\n\nexport interface InstalledSkillCatalogItem {\n\tid: string;\n\tlabel: string;\n\tdescription: string | null;\n\tactiveRevisionId: string;\n\tactiveSourceRevision: string | null;\n\tregistrationKind: SkillRegistrationKind;\n\tsourceRepositoryId: string | null;\n\tupdateAvailable: boolean;\n\tusage: SkillUsageSummary;\n}\n\nexport interface SkillRevisionSummary {\n\tid: string;\n\tsourceRevision: string | null;\n\timportedAt: string;\n\tactive: boolean;\n}\n\nexport interface SkillUsageProcessSummary {\n\tinstanceId: string;\n\ttitle: string;\n\tattachedAt: string;\n\tinvocationCount: number;\n\tlastInvokedAt: string | null;\n}\n\nexport interface SkillCatalogDetail extends SkillCatalogItem {\n\tskillMarkdown: string;\n\tprocesses: SkillUsageProcessSummary[];\n}\n\nexport interface InstalledSkillCatalogDetail extends InstalledSkillCatalogItem {\n\tskillMarkdown: string;\n\tprocesses: SkillUsageProcessSummary[];\n\trevisions: SkillRevisionSummary[];\n}\n\nexport type ErrorResponseBody = { error?: string | null; code?: string | null };\n\nexport type ProcessesListResponseBody = {\n\tprocesses: ProcessListItem[];\n\tfutureExecutions: FutureExecutionSummary[];\n};\n\nexport interface ProcessOverviewItem extends ProcessRowSlot {\n\tprocessDisplayName: string | null;\n\t/** Nullable durable title before external-id/instance-id display fallback. */\n\tprocessTitle: string | null;\n\tinitialPromptPreview: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tclosedAt: string | null;\n}\n\ninterface FutureExecutionOverviewItemBase {\n\tid: string;\n\tscheduleKind: \"once\" | \"cron\";\n\tprocessId: string;\n\tnextRunAt: string;\n\tcronExpression: string | null;\n\ttitle: string;\n\tinitialPromptPreview: string | null;\n\tstatus?: \"scheduled\" | \"blocked\";\n\tblockedReason?: FutureExecutionBlockReason | null;\n}\n\nexport interface FutureLaunchOverviewItem extends FutureExecutionOverviewItemBase {\n\tkind: \"launch\";\n\tinstanceId: null;\n\tlauncherId: string;\n\tlauncherLabel: string;\n}\n\nexport interface FutureActionOverviewItem extends FutureExecutionOverviewItemBase {\n\tkind: \"action\";\n\tinstanceId: string;\n\tactionId: string;\n\tactionLabel: string;\n}\n\nexport type FutureExecutionOverviewItem = FutureLaunchOverviewItem | FutureActionOverviewItem;\n\nexport interface ProcessesOverviewResponseBody {\n\tprocesses: ProcessOverviewItem[];\n\tfutureExecutions: FutureExecutionOverviewItem[];\n\t/** True when the bounded sidebar response omitted less-recent rows. */\n\ttruncated: boolean;\n}\n\nexport interface ProcessBrowsePagination {\n\tlimit: number;\n\toffset: number;\n\ttotal: number;\n\tprocessTotal: number;\n\tfutureExecutionTotal: number;\n\thasMore: boolean;\n}\n\nexport interface ProcessBrowseFacets {\n\tstatusCounts: Record<\n\t\t\"all\" | \"running\" | \"scheduled\" | \"needs_attention\" | \"completed\" | \"aborted\",\n\t\tnumber\n\t>;\n\tprocessTypes: Array<{ value: string; label: string; count: number }>;\n}\n\nexport type ProcessBrowseItem =\n\t| { kind: \"process\"; item: ProcessOverviewItem }\n\t| { kind: \"future\"; item: FutureExecutionOverviewItem };\n\nexport interface ProcessBrowseResponseBody {\n\t/** Globally sorted page. The browser must preserve this server-owned order. */\n\titems: ProcessBrowseItem[];\n\tpagination: ProcessBrowsePagination;\n\tfacets: ProcessBrowseFacets;\n}\n\nexport type TurnTraceToolCallSnapshot = Omit<PrimaryPathToolCallSnapshot, \"result\"> & {\n\tresultText: string | null;\n\ttruncated: boolean;\n};\n\nexport type TurnPiInputPartRole = \"user\" | \"system\" | \"unknown\";\n\nexport interface TurnPiInputPart {\n\trole: TurnPiInputPartRole;\n\ttext: string;\n\tcreatedAt: string;\n}\n\nexport interface TurnPiInputSnapshot {\n\tparts: TurnPiInputPart[];\n\tfullPrompt: string;\n\tcreatedAt: string;\n\tuserInput?: string | null;\n}\n\nexport interface TurnTraceSnapshot {\n\tassistant: PrimaryPathStreamingAssistantSnapshot;\n\ttoolCalls: TurnTraceToolCallSnapshot[];\n\ttraceItems: PrimaryPathTraceItemSnapshot[];\n\tusage: TurnUsageSnapshot | null;\n\tpiInput: TurnPiInputSnapshot | null;\n}\n\nexport interface TurnTracePreview {\n\tturnRecordId: string;\n\tassistantTextPreview: string;\n\tassistantTextTruncated: boolean;\n\tthinkingPreview: string;\n\tthinkingPreviewTruncated: boolean;\n\ttoolCallCount: number;\n\ttraceItemCount: number;\n\thasReasoningDetails: boolean;\n\tusage: TurnUsageSnapshot | null;\n\tpiInput: { createdAt: string | null; partCount: number; userInputPreview: string | null } | null;\n}\n\nexport type ProcessTimelineTurnPresentation =\n\t| \"llm_turn\"\n\t| \"automatic_turn\"\n\t| \"operator_decision\"\n\t| \"external_trigger\";\n\nexport interface ProcessTimelineTurnSummary {\n\tid: string;\n\tturnId: string;\n\tturnType: ProcessTurnType;\n\tdisplayTurn: string;\n\toutcome: string;\n\tsummary: string;\n\toutput: string;\n\tturnResultMarkdown: string;\n\tpathType: ProcessTurnRecord[\"pathType\"];\n\tcreatedAt: string;\n\tpresentation: ProcessTimelineTurnPresentation;\n\tstatus: \"completed\" | \"in_progress\";\n\tmodelProfileId: string | null;\n\t/** Durable lineage needed by the chronicle rail and input correlation. */\n\tattemptNumber: number;\n\tparentTurnRecordId: string | null;\n\tstartedAt: string;\n\tendedAt: string | null;\n\tactionSource: \"ui\" | \"external\" | \"scheduled\" | null;\n}\n\nexport type ProcessTimelineInputSummary = Pick<\n\tProcessInput,\n\t\"id\" | \"sequence\" | \"source\" | \"kind\" | \"bodyMarkdown\" | \"receivedAt\" | \"consumedAt\"\n>;\n\nexport interface ProcessExternalTriggerSignal {\n\ttriggerId: string;\n\tstate: \"error\" | \"armed\" | \"triggered\" | \"waiting\";\n\toccurredAt: string | null;\n\tsecondaryDetail: string | null;\n}\n\nexport interface ProcessTimelineSnapshot {\n\tprompt: { text: string | null; createdAt: string | null };\n\tturns: ProcessTimelineTurnSummary[];\n\ttracePreviewsByTurnRecordId: Record<string, TurnTracePreview>;\n\tinputs: ProcessTimelineInputSummary[];\n\texternalTriggerSignals: ProcessExternalTriggerSignal[];\n}\n\nexport interface CurrentErrorSummary {\n\ttitle: string;\n\tsummary: string;\n\tguidance?: string;\n\ttechnicalDetail?: string | null;\n}\n\nexport interface CurrentTurnRecoverySummary extends CurrentErrorSummary {\n\tturnRecordId: string;\n\tdefaultContinuePrompt: string;\n\tcanContinue: boolean;\n\tdefaultModelProfileId: string | null;\n\tproviderOptions: Record<string, string>;\n}\n\nexport interface StartupRecoverySummary extends CurrentErrorSummary {\n\tstartRecordId: string;\n\tkind: \"preparation_failed\" | \"bootstrap_failed\";\n\taction: \"choose_model\" | \"retry_startup\";\n\tdefaultModelProfileId: string | null;\n\tproviderOptions: Record<string, string>;\n}\n\nexport type CurrentProcessErrorSummary = CurrentErrorSummary;\n\nexport interface ProcessUsageEstimateSnapshot {\n\tusage: TurnUsageSnapshot;\n\tincludesLiveTurn: boolean;\n\ttotalLlmTurnCount: number;\n\tcoveredTurnCount: number;\n\tmissingUsageTurnCount: number;\n\tmissingCostTurnCount: number;\n\tisPartial: boolean;\n}\n\nexport interface PrimaryPathUiSnapshot extends PrimaryPathSnapshot {\n\tentryCount: number;\n\tentriesOmitted: true;\n}\n\nexport type ProcessUiSnapshotProcess = Pick<\n\tProcessInstance,\n\t| \"id\"\n\t| \"processId\"\n\t| \"selectedTurnId\"\n\t| \"lifecycleStatus\"\n\t| \"currentExecution\"\n\t| \"planRevision\"\n\t| \"title\"\n\t| \"externalId\"\n\t| \"externalUrl\"\n\t| \"initialDefaultModelProfileId\"\n\t| \"createdAt\"\n\t| \"updatedAt\"\n\t| \"closedAt\"\n>;\n\n/**\n * Initial render contract for process detail. Raw process events, inputs,\n * session entries, projects, and full durable records belong to diagnostics;\n * this DTO carries only browser-facing projections.\n */\nexport interface ProcessDetailUiSnapshotResponseBody {\n\tprocess: ProcessUiSnapshotProcess;\n\t/** Durable requests in Chronicle order; at most one is open for the current turn. */\n\tquestionRequests: ProcessQuestionRequest[];\n\tleafOutcomeSnapshots: ProcessLeafOutcomeSnapshot[];\n\tprocessDisplayName: string | null;\n\tprocessFlow: ProcessFlowView;\n\tdefinesLeafOutcome: boolean;\n\tselectedTurn: ProcessSelectedTurnSummary | null;\n\tscheduledAction: ScheduledActionDetail | null;\n\tmodelConfiguration: ProcessModelConfigurationView;\n\trunDetails: ProcessRunDetailsView;\n\tlaunchConfiguration: ProcessLaunchConfigurationView;\n\tactions: ProcessActionSummary[];\n\ttoolRenderers: ToolCallRendererDefinition[];\n\tprimaryPath: PrimaryPathUiSnapshot;\n\ttimeline: ProcessTimelineSnapshot;\n\tinstanceTree: ProcessInstanceTreeResponseBody;\n\trecovery: CurrentTurnRecoverySummary | null;\n\tstartupRecovery: StartupRecoverySummary | null;\n\tprocessError: CurrentProcessErrorSummary | null;\n\tusageEstimate: ProcessUsageEstimateSnapshot | null;\n\tpersistedModelSelectionWarning: string | null;\n\tsession: { signature: string | null };\n}\n\nexport type InstanceTreeTurnResultState = \"succeeded\" | \"failed\" | \"aborted\" | \"pending\";\n\n/** Redacted, semantic process history. Pi message/activity categories are never exposed. */\nexport interface InstanceTreeNodeSummary {\n\tid: string;\n\tparentId: string | null;\n\tlabel: string;\n\tpathType: \"primary\" | \"root_branch\" | \"leaf_branch\";\n\tresultState: InstanceTreeTurnResultState;\n\ttimestamp: string;\n}\n\nexport interface InstanceTreeEdgeSummary {\n\tid: string;\n\tsourceNodeId: string;\n\ttargetNodeId: string | null;\n\thasContext: boolean;\n\tproductLabels: readonly string[];\n\tactionLabel: string | null;\n\tendState: \"not_applied\" | \"completed\" | null;\n}\n\nexport interface ProcessInstanceTreeResponseBody {\n\tcurrentLeafId: string | null;\n\tnodes: InstanceTreeNodeSummary[];\n\tedges: InstanceTreeEdgeSummary[];\n}\n\nexport interface TurnReasoningDetailResponseBody {\n\tinstanceId: string;\n\tturnRecordId: string;\n\tsessionSignature: string | null;\n\treasoning: TurnTraceSnapshot;\n}\n\nexport interface SubmitQuestionAnswersRequestBody {\n\tdraft: QuestionAnswerDraft[];\n}\n\nexport type QuestionRequestMutationResponseBody = {\n\trequest: ProcessQuestionRequest;\n};\n\nexport type FutureExecutionDetailResponseBody = FutureExecutionSummary;\n\nexport type LaunchersResponseBody = { launchers: UiLauncherSummary[] };\n\nexport type WatchersResponseBody = { watchers: WatcherSummary[] };\nexport type SkillCatalogDetailResponseBody = { skill: SkillCatalogDetail };\nexport type InstalledSkillCatalogDetailResponseBody = { skill: InstalledSkillCatalogDetail };\nexport type SkillsCatalogResponseBody = {\n\trepositories: SkillRepositorySummary[];\n\tavailableSkills: SkillCatalogItem[];\n\tinstalledSkills: InstalledSkillCatalogItem[];\n};\n\nexport interface LauncherDefaultsResponseBody {\n\tdefaults: Record<string, unknown>;\n\ttitle: string | null;\n\tmodelConfig: LauncherModelConfigDefaults;\n\twarnings?: LauncherValidationError[];\n}\n\nexport type LauncherOptionsResponseBody = {\n\toptions: Record<string, readonly FormFieldOptionDefinition[]>;\n};\n\nexport type LauncherRecentValuesResponseBody = {\n\tvalues: Record<string, readonly string[]>;\n};\n\nexport type LauncherModelConfigPreviewResponseBody = { preview: LauncherModelConfigPreview };\n\nexport interface LauncherMutationResponseBody {\n\tkind?: \"scheduled\";\n\tprocess?: ProcessInstance | null;\n\tfutureExecution?: FutureLaunchSummary | null;\n\tprojects?: ProcessProject[];\n\terrors?: LauncherValidationError[];\n\terror?: string | null;\n}\n\nexport type ScheduledActionMutationResponseBody = {\n\tkind?: \"scheduled\";\n\tscheduledAction?: ScheduledActionDetail | null;\n\terror?: string | null;\n};\n\nexport type ProcessRetryConfigResponseBody = ProcessRetryConfig;\n\nexport type ProcessActionModelPreviewResponseBody = { preview: ProcessActionModelPreview };\n\nexport type ProcessDiagnosticsResponseBody = ProcessDiagnosticsData;\n\nexport type PrimaryPathSnapshotResponseBody = PrimaryPathSnapshot;\n\nexport type CronPreviewResponseBody = { nextRunAt: string };\n\ntype ParsedLauncherRequestBody = {\n\ttitle: string | null;\n\ttitleProvided: boolean;\n\tlauncherInput: Record<string, unknown>;\n\tlauncherInputProvided: boolean;\n\tskillIds?: string[];\n\tmodelConfig: LauncherModelConfigDefaults;\n\tmodelConfigProvided: boolean;\n\tschedule: ParsedScheduleRequest;\n\tscheduleProvided: boolean;\n};\n\ntype ParsedActionRequestBody = {\n\tinput: Record<string, unknown>;\n\tinputProvided: boolean;\n\tnextTurnModelProfileId?: string | null;\n\tnextTurnModelProfileIdProvided: boolean;\n\tschedule: ParsedScheduleRequest;\n\tscheduleProvided: boolean;\n};\n\nconst SCHEDULE_MODES = [\"now\", \"once\", \"cron\"] as const;\nconst PROCESS_LIFECYCLE_STATUSES = [\n\t\"discovered\",\n\t\"active\",\n\t\"waiting\",\n\t\"error\",\n\t\"completed\",\n\t\"aborted\",\n] as const;\nconst launcherStructuredBodySchema = v.strictObject({\n\ttitle: v.optional(nullableStringSchema),\n\tlauncherInput: v.optional(unknownRecordSchema),\n\tskillIds: v.optional(v.array(v.string())),\n\tmodelConfig: v.optional(v.unknown()),\n\tschedule: v.optional(v.unknown()),\n});\nconst actionStructuredBodySchema = v.strictObject({\n\tinput: v.optional(unknownRecordSchema),\n\tnextTurnModelProfileId: optionalNullableStringSchema,\n\tschedule: v.optional(v.unknown()),\n});\nconst futureLaunchPayloadInputSchema = v.object({\n\tlauncherInput: v.optional(v.nullable(unknownRecordSchema)),\n\tmodelConfig: v.optional(v.unknown()),\n\tactor: v.optional(v.nullable(unknownRecordSchema)),\n\tlaunchPlan: v.object({\n\t\tlauncherId: v.string(),\n\t\tprocessId: v.string(),\n\t\thandoffDedupKey: optionalNullableStringSchema,\n\t\tprocessInput: v.object({\n\t\t\tprocessId: v.string(),\n\t\t\tselectedTurnId: optionalNullableStringSchema,\n\t\t\tlifecycleStatus: v.picklist(PROCESS_LIFECYCLE_STATUSES),\n\t\t\ttitle: optionalNullableStringSchema,\n\t\t\texternalId: optionalNullableStringSchema,\n\t\t\texternalUrl: optionalNullableStringSchema,\n\t\t\tmetadata: v.optional(v.nullable(unknownRecordSchema)),\n\t\t\tdefaultModelProfileId: optionalNullableStringSchema,\n\t\t\tturnConfigsJson: optionalNullableStringSchema,\n\t\t\tselectedTurnModelProfileId: optionalNullableStringSchema,\n\t\t\tselectedTurnModelKind: v.optional(v.nullable(v.picklist([\"explicit\", \"inherited\"]))),\n\t\t\tselectedTurnModelSource: v.optional(\n\t\t\t\tv.nullable(\n\t\t\t\t\tv.picklist([\n\t\t\t\t\t\t\"action_override\",\n\t\t\t\t\t\t\"launch_override\",\n\t\t\t\t\t\t\"instance_turn_config\",\n\t\t\t\t\t\t\"process_config_turn\",\n\t\t\t\t\t\t\"instance_default\",\n\t\t\t\t\t\t\"process_config_default\",\n\t\t\t\t\t\t\"catalog_default\",\n\t\t\t\t\t\t\"legacy_persisted\",\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t),\n\t\t\tparamsJson: optionalNullableStringSchema,\n\t\t\tstateJson: optionalNullableStringSchema,\n\t\t}),\n\t\ttitleSourceFields: v.optional(\n\t\t\tv.nullable(v.array(v.object({ label: v.string(), value: v.string() }))),\n\t\t),\n\t\tprojectInputs: v.optional(\n\t\t\tv.nullable(\n\t\t\t\tv.array(\n\t\t\t\t\tv.object({\n\t\t\t\t\t\tkey: v.string(),\n\t\t\t\t\t\trepoLocator: v.string(),\n\t\t\t\t\t\tbaseBranch: v.string(),\n\t\t\t\t\t\tworkBranch: optionalNullableStringSchema,\n\t\t\t\t\t\texternalId: optionalNullableStringSchema,\n\t\t\t\t\t\texternalUrl: optionalNullableStringSchema,\n\t\t\t\t\t\tmetadata: v.optional(v.nullable(unknownRecordSchema)),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\tstartTurnId: optionalNullableStringSchema,\n\t}),\n\tselectedSkillIds: v.optional(v.array(v.string())),\n\tresourceSelections: v.optional(\n\t\tv.array(v.object({ skillId: v.string(), revisionId: v.string() })),\n\t),\n});\nconst futureActionPayloadInputSchema = v.object({\n\tinput: v.optional(v.nullable(unknownRecordSchema)),\n\tnextTurnModelProfileId: optionalNullableStringSchema,\n\tactionLabel: optionalNullableStringSchema,\n\tactor: v.optional(v.nullable(unknownRecordSchema)),\n});\n\nexport type ParsedScheduleRequest =\n\t| { mode: \"now\" }\n\t| { mode: \"once\"; runAt: string }\n\t| { mode: \"cron\"; cronExpression: string };\ntype ValidatedScheduleRequest =\n\t| { mode: \"now\"; nextRunAt: null; cronExpression: null }\n\t| { mode: \"once\"; nextRunAt: string; cronExpression: null }\n\t| { mode: \"cron\"; nextRunAt: string; cronExpression: string };\n\ntype FutureLaunchPayloadBase = v.InferOutput<typeof futureLaunchPayloadInputSchema>;\ntype FutureActionPayloadBase = v.InferOutput<typeof futureActionPayloadInputSchema>;\nconst cloneUnknownRecord = (value?: Record<string, unknown> | null) =>\n\tvalue ? { ...value } : null;\nconst cloneTurnConfigMap = (turnConfigs: InstanceTurnConfigMap = {}) =>\n\tObject.fromEntries(\n\t\tObject.entries(turnConfigs as Record<string, InstanceTurnConfigMap[string]>).map(\n\t\t\t([turnId, turnConfig]) => [turnId, { ...turnConfig }],\n\t\t),\n\t) as InstanceTurnConfigMap;\nconst normalizeFutureLaunchPayload = (payload: FutureLaunchPayloadBase) => {\n\tconst modelConfig = normalizeLaunchModelConfigInput(\n\t\t(payload.modelConfig ?? {}) as LaunchModelConfigInput,\n\t);\n\treturn {\n\t\tlauncherInput: cloneUnknownRecord(payload.launcherInput) ?? {},\n\t\tmodelConfig: {\n\t\t\tdefaultModelProfileId: modelConfig.defaultModelProfileId ?? null,\n\t\t\tturnConfigs: cloneTurnConfigMap(modelConfig.turnConfigs),\n\t\t},\n\t\tactor: normalizeActor(payload.actor),\n\t\tselectedSkillIds: [\n\t\t\t...(payload.selectedSkillIds ??\n\t\t\t\tpayload.resourceSelections?.map(({ skillId }) => skillId) ??\n\t\t\t\t[]),\n\t\t],\n\t\tresourceSelections: (payload.resourceSelections ?? []).map((selection) => ({ ...selection })),\n\t\tlaunchPlan: {\n\t\t\tlauncherId: payload.launchPlan.launcherId,\n\t\t\tprocessId: payload.launchPlan.processId,\n\t\t\thandoffDedupKey: trimToNull(payload.launchPlan.handoffDedupKey) ?? null,\n\t\t\tprocessInput: {\n\t\t\t\tprocessId: payload.launchPlan.processInput.processId,\n\t\t\t\tselectedTurnId: payload.launchPlan.processInput.selectedTurnId ?? null,\n\t\t\t\tlifecycleStatus: payload.launchPlan.processInput.lifecycleStatus,\n\t\t\t\ttitle: payload.launchPlan.processInput.title ?? null,\n\t\t\t\texternalId: payload.launchPlan.processInput.externalId ?? null,\n\t\t\t\texternalUrl: payload.launchPlan.processInput.externalUrl ?? null,\n\t\t\t\tmetadata: cloneUnknownRecord(payload.launchPlan.processInput.metadata),\n\t\t\t\tdefaultModelProfileId: payload.launchPlan.processInput.defaultModelProfileId ?? null,\n\t\t\t\tturnConfigsJson: payload.launchPlan.processInput.turnConfigsJson ?? null,\n\t\t\t\tselectedTurnModelProfileId:\n\t\t\t\t\tpayload.launchPlan.processInput.selectedTurnModelProfileId ?? null,\n\t\t\t\tselectedTurnModelKind: payload.launchPlan.processInput.selectedTurnModelKind ?? null,\n\t\t\t\tselectedTurnModelSource: payload.launchPlan.processInput.selectedTurnModelSource ?? null,\n\t\t\t\tparamsJson: payload.launchPlan.processInput.paramsJson ?? null,\n\t\t\t\tstateJson: payload.launchPlan.processInput.stateJson ?? null,\n\t\t\t},\n\t\t\ttitleSourceFields: (payload.launchPlan.titleSourceFields ?? []).map((field) => ({\n\t\t\t\t...field,\n\t\t\t})),\n\t\t\tprojectInputs: (payload.launchPlan.projectInputs ?? []).map((project) => ({\n\t\t\t\tkey: project.key,\n\t\t\t\trepoLocator: project.repoLocator,\n\t\t\t\tbaseBranch: project.baseBranch,\n\t\t\t\tworkBranch: project.workBranch ?? null,\n\t\t\t\texternalId: project.externalId ?? null,\n\t\t\t\texternalUrl: project.externalUrl ?? null,\n\t\t\t\tmetadata: cloneUnknownRecord(project.metadata),\n\t\t\t})),\n\t\t\tstartTurnId: payload.launchPlan.startTurnId ?? null,\n\t\t},\n\t};\n};\nconst normalizeFutureActionPayload = (payload: FutureActionPayloadBase) => ({\n\tinput: cloneUnknownRecord(payload.input) ?? {},\n\tnextTurnModelProfileId: trimToNull(payload.nextTurnModelProfileId) ?? null,\n\tactionLabel: trimToNull(payload.actionLabel) ?? null,\n\tactor: normalizeActor(payload.actor),\n});\n\nexport type FutureLaunchPayload = ReturnType<typeof normalizeFutureLaunchPayload>;\nexport type FutureActionPayload = ReturnType<typeof normalizeFutureActionPayload>;\n\nfunction hasOwn(object: Record<string, unknown>, key: string): boolean {\n\treturn Object.hasOwn(object, key);\n}\n\nfunction parseJsonPayload(payloadJson: string, context: string): ParseResult<unknown> {\n\ttry {\n\t\treturn ok(JSON.parse(payloadJson));\n\t} catch {\n\t\treturn err(`${context} must be valid JSON`);\n\t}\n}\n\nfunction parseRecord(value: unknown, context: string): ParseResult<Record<string, unknown>> {\n\treturn parseSchema(unknownRecordSchema, value, context);\n}\n\nfunction parseLauncherTurnConfigMap(\n\tvalue: unknown,\n\tcontext: string,\n): ParseResult<InstanceTurnConfigMap> {\n\tconst record = parseRecord(value, context);\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst turnConfigs: InstanceTurnConfigMap = {};\n\tfor (const [turnId, turnConfigValue] of Object.entries(record.value)) {\n\t\tconst turnConfig = parseRecord(turnConfigValue, `${context}.${turnId}`);\n\t\tif (!turnConfig.ok) {\n\t\t\treturn turnConfig;\n\t\t}\n\t\tconst modelProfileId =\n\t\t\ttrimToNull(turnConfig.value.modelProfileId) ?? trimToNull(turnConfig.value.model_profile);\n\t\tturnConfigs[turnId] = modelProfileId ? { modelProfileId } : {};\n\t}\n\treturn ok(turnConfigs);\n}\n\nexport function parseScheduleRequestInput(value: unknown): ParseResult<ParsedScheduleRequest> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({ mode: \"now\" });\n\t}\n\tconst record = parseRecord(value, \"schedule\");\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst mode = parseLiteral(record.value.mode ?? \"now\", SCHEDULE_MODES, \"schedule.mode\");\n\tif (!mode.ok || mode.value === \"now\") {\n\t\treturn mode.ok ? ok({ mode: \"now\" }) : mode;\n\t}\n\tif (mode.value === \"once\") {\n\t\tconst runAt = typeof record.value.runAt === \"string\" ? record.value.runAt : null;\n\t\treturn runAt && !Number.isNaN(Date.parse(runAt))\n\t\t\t? ok({ mode: \"once\", runAt: new Date(runAt).toISOString() })\n\t\t\t: err(\"runAt must be a valid ISO datetime\");\n\t}\n\tconst cronExpression = trimToNull(record.value.cronExpression);\n\treturn cronExpression\n\t\t? ok({ mode: \"cron\", cronExpression })\n\t\t: err(\"cronExpression is required for cron schedules\");\n}\n\nexport function validateScheduleRequestInput(\n\tschedule: ParsedScheduleRequest,\n\tallowedModes: readonly ScheduleMode[],\n\toptions: {\n\t\tnow?: () => Date;\n\t\tresolveCronNextRunAt?: (expression: string, now: Date) => string;\n\t} = {},\n): ParseResult<ValidatedScheduleRequest> {\n\tif (!allowedModes.includes(schedule.mode)) {\n\t\treturn err(`Unsupported schedule mode '${schedule.mode}'`);\n\t}\n\tif (schedule.mode === \"now\") {\n\t\treturn ok({ mode: \"now\", nextRunAt: null, cronExpression: null });\n\t}\n\tconst now = options.now ?? (() => new Date());\n\tif (schedule.mode === \"once\") {\n\t\tconst runAt = new Date(schedule.runAt);\n\t\treturn Number.isNaN(runAt.getTime())\n\t\t\t? err(\"runAt must be a valid ISO datetime\")\n\t\t\t: runAt.getTime() <= now().getTime()\n\t\t\t\t? err(\"Scheduled time must be in the future\")\n\t\t\t\t: ok({ mode: \"once\", nextRunAt: runAt.toISOString(), cronExpression: null });\n\t}\n\tif (!options.resolveCronNextRunAt) {\n\t\treturn err(\"resolveCronNextRunAt is required for cron schedules\");\n\t}\n\ttry {\n\t\treturn ok({\n\t\t\tmode: \"cron\",\n\t\t\tnextRunAt: options.resolveCronNextRunAt(schedule.cronExpression, now()),\n\t\t\tcronExpression: schedule.cronExpression,\n\t\t});\n\t} catch (error) {\n\t\treturn err(error instanceof Error ? error.message : \"Invalid cron expression\");\n\t}\n}\n\nexport function parseLauncherTurnConfigsJson(\n\tturnConfigsJson: string | null | undefined,\n): ParseResult<InstanceTurnConfigMap> {\n\tif (!turnConfigsJson) {\n\t\treturn ok({});\n\t}\n\tconst parsed = parseJsonPayload(turnConfigsJson, \"turnConfigsJson\");\n\treturn parsed.ok ? parseLauncherTurnConfigMap(parsed.value, \"turnConfigsJson\") : parsed;\n}\n\nexport function parseLauncherInputJson(\n\tlauncherInputJson: string | null | undefined,\n\tcontext = \"launcherInputJson\",\n): ParseResult<Record<string, unknown>> {\n\tif (launcherInputJson === undefined || launcherInputJson === null) {\n\t\treturn ok({});\n\t}\n\tconst parsed = parseJsonPayload(launcherInputJson, context);\n\treturn parsed.ok ? parseRecord(parsed.value, context) : parsed;\n}\n\nexport function parseLauncherModelConfigInput(\n\tvalue: unknown,\n\tcontext = \"modelConfig\",\n): ParseResult<LaunchModelConfigInput> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({});\n\t}\n\tconst record = parseRecord(value, context);\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst defaultModelProfileId = trimToNull(record.value.defaultModelProfileId);\n\tif (\n\t\thasOwn(record.value, \"defaultModelProfileId\") &&\n\t\trecord.value.defaultModelProfileId !== null &&\n\t\ttypeof record.value.defaultModelProfileId !== \"string\"\n\t) {\n\t\treturn err(`${context}.defaultModelProfileId must be a string or null`);\n\t}\n\tconst turnConfigs =\n\t\trecord.value.turnConfigs === undefined\n\t\t\t? ok(undefined)\n\t\t\t: parseLauncherTurnConfigMap(record.value.turnConfigs, `${context}.turnConfigs`);\n\treturn turnConfigs.ok\n\t\t? ok(\n\t\t\t\tnormalizeLaunchModelConfigInput({\n\t\t\t\t\t...(defaultModelProfileId ? { defaultModelProfileId } : {}),\n\t\t\t\t\t...(turnConfigs.value ? { turnConfigs: turnConfigs.value } : {}),\n\t\t\t\t}),\n\t\t\t)\n\t\t: turnConfigs;\n}\n\nfunction hasInlineScheduleFields(object: Record<string, unknown>): boolean {\n\treturn hasOwn(object, \"mode\") || hasOwn(object, \"runAt\") || hasOwn(object, \"cronExpression\");\n}\n\nexport function parseLauncherRequestBody(value: unknown): ParseResult<ParsedLauncherRequestBody> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({\n\t\t\ttitle: null,\n\t\t\ttitleProvided: false,\n\t\t\tlauncherInput: {},\n\t\t\tlauncherInputProvided: false,\n\t\t\tmodelConfig: {},\n\t\t\tmodelConfigProvided: false,\n\t\t\tschedule: { mode: \"now\" },\n\t\t\tscheduleProvided: false,\n\t\t});\n\t}\n\tconst record = parseRecord(value, \"launcher request body\");\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tif (\n\t\thasOwn(record.value, \"title\") ||\n\t\trecord.value.launcherInput !== undefined ||\n\t\trecord.value.skillIds !== undefined ||\n\t\trecord.value.modelConfig !== undefined ||\n\t\trecord.value.schedule !== undefined\n\t) {\n\t\tif (\n\t\t\tObject.keys(record.value).some(\n\t\t\t\t(key) =>\n\t\t\t\t\tkey !== \"title\" &&\n\t\t\t\t\tkey !== \"launcherInput\" &&\n\t\t\t\t\tkey !== \"skillIds\" &&\n\t\t\t\t\tkey !== \"modelConfig\" &&\n\t\t\t\t\tkey !== \"schedule\",\n\t\t\t)\n\t\t) {\n\t\t\treturn err(\n\t\t\t\t\"launcher request body must use { title, launcherInput, skillIds, modelConfig, schedule }\",\n\t\t\t);\n\t\t}\n\t\tconst parsed = parseSchema(launcherStructuredBodySchema, value, \"launcher request body\");\n\t\tif (!parsed.ok) {\n\t\t\treturn parsed;\n\t\t}\n\t\tconst modelConfig = parseLauncherModelConfigInput(parsed.value.modelConfig);\n\t\tif (!modelConfig.ok) {\n\t\t\treturn modelConfig;\n\t\t}\n\t\tconst schedule = parseScheduleRequestInput(parsed.value.schedule);\n\t\tif (!schedule.ok) {\n\t\t\treturn schedule;\n\t\t}\n\t\tconst skillIds = parsed.value.skillIds ?? [];\n\t\tif (new Set(skillIds).size !== skillIds.length) {\n\t\t\treturn err(\"skillIds must not contain duplicates\");\n\t\t}\n\t\treturn ok({\n\t\t\ttitle: parsed.value.title ?? null,\n\t\t\ttitleProvided: hasOwn(record.value, \"title\"),\n\t\t\tlauncherInput: parsed.value.launcherInput ?? {},\n\t\t\tlauncherInputProvided: hasOwn(record.value, \"launcherInput\"),\n\t\t\t...(hasOwn(record.value, \"skillIds\") ? { skillIds: [...skillIds] } : {}),\n\t\t\tmodelConfig: modelConfig.value,\n\t\t\tmodelConfigProvided: hasOwn(record.value, \"modelConfig\"),\n\t\t\tschedule: schedule.value,\n\t\t\tscheduleProvided: hasOwn(record.value, \"schedule\"),\n\t\t});\n\t}\n\tconst modelConfig = parseLauncherModelConfigInput(record.value, \"modelConfig\");\n\tif (!modelConfig.ok) {\n\t\treturn modelConfig;\n\t}\n\tconst schedule = parseScheduleRequestInput(record.value);\n\tif (!schedule.ok) {\n\t\treturn schedule;\n\t}\n\treturn ok({\n\t\ttitle: null,\n\t\ttitleProvided: false,\n\t\tlauncherInput: record.value,\n\t\tlauncherInputProvided: true,\n\t\tmodelConfig: modelConfig.value,\n\t\tmodelConfigProvided: true,\n\t\tschedule: schedule.value,\n\t\tscheduleProvided: hasInlineScheduleFields(record.value),\n\t});\n}\n\nexport function parseActionRequestBody(value: unknown): ParseResult<ParsedActionRequestBody> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({\n\t\t\tinput: {},\n\t\t\tinputProvided: false,\n\t\t\tnextTurnModelProfileIdProvided: false,\n\t\t\tschedule: { mode: \"now\" },\n\t\t\tscheduleProvided: false,\n\t\t});\n\t}\n\tconst record = parseRecord(value, \"action request body\");\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst nextTurnModelProfileIdProvided = hasOwn(record.value, \"nextTurnModelProfileId\");\n\tif (\n\t\trecord.value.input !== undefined ||\n\t\tnextTurnModelProfileIdProvided ||\n\t\trecord.value.schedule !== undefined\n\t) {\n\t\tif (\n\t\t\tObject.keys(record.value).some(\n\t\t\t\t(key) => key !== \"input\" && key !== \"nextTurnModelProfileId\" && key !== \"schedule\",\n\t\t\t)\n\t\t) {\n\t\t\treturn err(\"action request body must use { input, nextTurnModelProfileId }\");\n\t\t}\n\t\tconst parsed = parseSchema(actionStructuredBodySchema, value, \"action request body\");\n\t\tif (!parsed.ok) {\n\t\t\treturn parsed;\n\t\t}\n\t\tconst schedule = parseScheduleRequestInput(parsed.value.schedule);\n\t\tif (!schedule.ok) {\n\t\t\treturn schedule;\n\t\t}\n\t\treturn ok({\n\t\t\tinput: parsed.value.input ?? {},\n\t\t\tinputProvided: hasOwn(record.value, \"input\"),\n\t\t\tnextTurnModelProfileIdProvided,\n\t\t\tschedule: schedule.value,\n\t\t\tscheduleProvided: hasOwn(record.value, \"schedule\"),\n\t\t\t...(nextTurnModelProfileIdProvided\n\t\t\t\t? { nextTurnModelProfileId: parsed.value.nextTurnModelProfileId ?? null }\n\t\t\t\t: {}),\n\t\t});\n\t}\n\tconst schedule = parseScheduleRequestInput(record.value);\n\tif (!schedule.ok) {\n\t\treturn schedule;\n\t}\n\treturn ok({\n\t\tinput: record.value,\n\t\tinputProvided: true,\n\t\tnextTurnModelProfileIdProvided,\n\t\tschedule: schedule.value,\n\t\tscheduleProvided: hasInlineScheduleFields(record.value),\n\t\t...(nextTurnModelProfileIdProvided\n\t\t\t? { nextTurnModelProfileId: trimToNull(record.value.nextTurnModelProfileId) }\n\t\t\t: {}),\n\t});\n}\n\nexport function serializeFutureLaunchPayload(payload: unknown): string {\n\treturn JSON.stringify(normalizeFutureLaunchPayload(payload as FutureLaunchPayloadBase));\n}\n\nexport function parseFutureLaunchPayloadObject(\n\tvalue: unknown,\n\tcontext = \"Scheduled launch payload\",\n): ParseResult<FutureLaunchPayload> {\n\tconst parsed = parseSchema(futureLaunchPayloadInputSchema, value, context);\n\treturn parsed.ok ? ok(normalizeFutureLaunchPayload(parsed.value)) : parsed;\n}\n\nexport function parseFutureLaunchPayloadJson(\n\tpayloadJson: string,\n): ParseResult<FutureLaunchPayload> {\n\tconst parsed = parseJsonPayload(payloadJson, \"Scheduled launch payload\");\n\treturn parsed.ok ? parseFutureLaunchPayloadObject(parsed.value) : parsed;\n}\n\nexport function serializeFutureActionPayload(payload: unknown): string {\n\treturn JSON.stringify(normalizeFutureActionPayload(payload as FutureActionPayloadBase));\n}\n\nexport function parseFutureActionPayloadObject(\n\tvalue: unknown,\n\tcontext = \"Scheduled action payload\",\n): ParseResult<FutureActionPayload> {\n\tconst parsed = parseSchema(futureActionPayloadInputSchema, value, context);\n\treturn parsed.ok ? ok(normalizeFutureActionPayload(parsed.value)) : parsed;\n}\n\nexport function parseFutureActionPayloadJson(\n\tpayloadJson: string,\n): ParseResult<FutureActionPayload> {\n\tconst parsed = parseJsonPayload(payloadJson, \"Scheduled action payload\");\n\treturn parsed.ok ? parseFutureActionPayloadObject(parsed.value) : parsed;\n}\n","import {\n\ttype FutureExecutionKind,\n\tPROCESS_SEMANTIC_ENTRY_REF_KEYS,\n\tPROCESS_TURN_RECORD_PATH_TYPES,\n\tPROCESS_TURN_TYPES,\n\ttype ProcessInput,\n\ttype ProcessInstance,\n\ttype ProcessProject,\n\ttype WorkerLease,\n} from \"@leitwerk-dev/domain\";\nimport * as v from \"valibot\";\nimport type { StreamableWorkerEventType } from \"./streamable-events.js\";\n\nexport type ParseResult<T> = { ok: true; value: T } | { ok: false; error: string };\n\nexport const ok = <T>(value: T): ParseResult<T> => ({ ok: true, value });\nexport const err = (error: string): ParseResult<never> => ({ ok: false, error });\nexport const unknownRecordSchema = v.custom<Record<string, unknown>>(\n\t(value): value is Record<string, unknown> =>\n\t\ttypeof value === \"object\" && value !== null && !Array.isArray(value),\n\t\"must be an object\",\n);\nexport const nullableStringSchema = v.nullable(v.string());\nexport const optionalNullableStringSchema = v.optional(nullableStringSchema);\n\nexport function parseSchema<TSchema extends v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>>(\n\tschema: TSchema,\n\tvalue: unknown,\n\tcontext: string,\n): ParseResult<v.InferOutput<TSchema>> {\n\tconst parsed = v.safeParse(schema, value);\n\tif (parsed.success) {\n\t\treturn ok(parsed.output);\n\t}\n\tconst issue = parsed.issues?.[0];\n\tconst target = issue ? [context, v.getDotPath(issue)].filter(Boolean).join(\".\") : context;\n\treturn err(\n\t\tissue?.message === \"must be an object\"\n\t\t\t? `${target} must be an object`\n\t\t\t: `${target} ${issue?.message ?? \"is invalid\"}`,\n\t);\n}\n\nexport function parseLiteral<T extends string>(\n\tvalue: unknown,\n\tallowed: readonly T[],\n\tcontext: string,\n): ParseResult<T> {\n\treturn v.is(v.picklist(allowed), value)\n\t\t? ok(value as T)\n\t\t: err(`${context} must be one of: ${allowed.join(\", \")}`);\n}\n\nexport const WS_PROTOCOL_VERSION = \"leitwerk/ws/v1\";\n\nexport const WS_PROCESS_TYPES = {\n\tTOAST: \"process.toast\",\n\tFUTURE_UPDATED: \"future.updated\",\n} as const;\n\nexport const WS_PRIMARY_PATH_TYPES = {\n\tTURN_STARTED: \"primary_path.turn_started\",\n\tASSISTANT_PARTIAL: \"primary_path.assistant_partial\",\n\tUSAGE_UPDATED: \"primary_path.usage_updated\",\n\tASSISTANT_COMMITTED: \"primary_path.assistant_committed\",\n\tTOOL_CALL_STARTED: \"primary_path.tool_call_started\",\n\tTOOL_CALL_COMPLETED: \"primary_path.tool_call_completed\",\n\tTURN_ANNOTATION_CHANGED: \"primary_path.turn_annotation_changed\",\n\tLABEL_CHANGED: \"primary_path.label_changed\",\n\tCHANGED: \"primary_path.changed\",\n} as const;\n\nexport const WS_PI_STREAM_TYPES = {\n\tSTARTED: \"pi.stream.started\",\n\tDELTA: \"pi.stream.delta\",\n\tCOMPLETED: \"pi.stream.completed\",\n\tTOOL_STARTED: \"pi.tool.started\",\n\tTOOL_COMPLETED: \"pi.tool.completed\",\n\tLABEL_CHANGED: \"pi.label.changed\",\n\tERROR: \"pi.error\",\n\tRETRY_START: \"pi.retry.start\",\n\tRETRY_END: \"pi.retry.end\",\n\tUSAGE: \"pi.usage\",\n} as const;\n\ntype PiPayload<T = Record<string, never>> = {\n\tturnId?: string | null;\n\tturnRecordId?: string | null;\n\ttimestamp?: string;\n} & T;\n\nconst finiteNumberSchema = v.pipe(v.number(), v.finite());\nconst semanticEntryRefSchema = v.object({\n\tentryId: v.string(),\n\tturnRecordId: nullableStringSchema,\n});\nconst primaryPathBasePayloadEntries = {\n\tturnRecordId: nullableStringSchema,\n\tpiTurnId: nullableStringSchema,\n\ttimestamp: v.string(),\n};\nconst primaryPathTreeEntries = {\n\trootEntry: v.nullable(semanticEntryRefSchema),\n\tcurrentLeaf: v.nullable(semanticEntryRefSchema),\n};\nconst primaryPathTreeSchema = v.object(primaryPathTreeEntries);\nconst processTurnRecordSummarySchema = v.object({\n\tid: v.string(),\n\tturnId: v.string(),\n\tturnType: v.picklist(PROCESS_TURN_TYPES),\n\tpathType: v.picklist(PROCESS_TURN_RECORD_PATH_TYPES),\n\tstartedAt: v.string(),\n});\nconst usageCostSnapshotSchema = v.object({\n\tinput: finiteNumberSchema,\n\toutput: finiteNumberSchema,\n\treasoning: v.optional(finiteNumberSchema),\n\tcacheRead: finiteNumberSchema,\n\tcacheWrite: finiteNumberSchema,\n\ttotal: finiteNumberSchema,\n});\nconst usageSnapshotSchema = v.object({\n\tinput: finiteNumberSchema,\n\toutput: finiteNumberSchema,\n\tcacheRead: finiteNumberSchema,\n\tcacheWrite: finiteNumberSchema,\n\ttotalTokens: finiteNumberSchema,\n\tcost: v.nullable(usageCostSnapshotSchema),\n});\nconst turnAnnotationReferenceSchema = v.variant(\"kind\", [\n\tv.object({\n\t\tkind: v.literal(\"turn_record\"),\n\t\tturnRecordId: v.string(),\n\t\trole: nullableStringSchema,\n\t}),\n\tv.object({\n\t\tkind: v.literal(\"entry\"),\n\t\tentryId: v.string(),\n\t\trole: nullableStringSchema,\n\t}),\n\tv.object({\n\t\tkind: v.literal(\"semantic_entry_ref\"),\n\t\tref: v.picklist(PROCESS_SEMANTIC_ENTRY_REF_KEYS),\n\t\trole: nullableStringSchema,\n\t}),\n]);\nconst processTurnAnnotationSchema = v.object({\n\tid: v.string(),\n\tinstanceId: v.string(),\n\tannotationType: v.string(),\n\tannotationKey: nullableStringSchema,\n\treferences: v.array(turnAnnotationReferenceSchema),\n\tpayload: unknownRecordSchema,\n\tcreatedAt: v.string(),\n\tupdatedAt: v.string(),\n});\nconst PRIMARY_PATH_PAYLOAD_SCHEMAS = {\n\t[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: v.object({\n\t\tturnRecord: processTurnRecordSummarySchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttext: v.string(),\n\t\tstreamType: v.string(),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\tusage: usageSnapshotSchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: v.object({\n\t\tturnRecord: processTurnRecordSummarySchema,\n\t\t...primaryPathTreeEntries,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttoolCallId: v.string(),\n\t\ttoolName: v.string(),\n\t\targuments: v.nullable(unknownRecordSchema),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttoolCallId: v.string(),\n\t\ttoolName: v.string(),\n\t\tresult: v.unknown(),\n\t\tisError: v.boolean(),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: v.object({\n\t\tchange: v.picklist([\"created\", \"updated\"] as const),\n\t\tannotation: processTurnAnnotationSchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttargetId: nullableStringSchema,\n\t\tlabel: nullableStringSchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.CHANGED]: primaryPathTreeSchema,\n} as const satisfies Record<\n\t(typeof WS_PRIMARY_PATH_TYPES)[keyof typeof WS_PRIMARY_PATH_TYPES],\n\tv.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>\n>;\ntype PrimaryPathPayloadByType = {\n\t[K in keyof typeof PRIMARY_PATH_PAYLOAD_SCHEMAS]: v.InferOutput<\n\t\t(typeof PRIMARY_PATH_PAYLOAD_SCHEMAS)[K]\n\t>;\n};\ntype PrimaryPathTree = v.InferOutput<typeof primaryPathTreeSchema>;\ntype PiUsagePayload = PiPayload<{\n\tinput?: number;\n\toutput?: number;\n\tcacheRead?: number;\n\tcacheWrite?: number;\n\ttotalTokens?: number;\n\tcost?: {\n\t\tinput?: number;\n\t\toutput?: number;\n\t\tcacheRead?: number;\n\t\tcacheWrite?: number;\n\t\ttotal?: number;\n\t};\n\tcacheHitRate?: number;\n}>;\n\nexport type WsDurability = \"durable\" | \"ephemeral\";\n\nexport type ProcessAttentionTarget =\n\t| { kind: \"action_required\" }\n\t| { kind: \"turn_failed\" }\n\t| { kind: \"worker_failed\" }\n\t| { kind: \"question_request\"; requestId: string };\n\nexport type WsPayloadByType = {\n\thello: { serverVersion: string };\n\tpong: Record<string, never>;\n\t\"process.created\": { process: ProcessInstance; processId: string; launcherId?: string };\n\t\"process.updated\": { process: Partial<ProcessInstance>; changedFields?: readonly string[] };\n\t\"process.deleted\": { instanceId: string };\n\t\"project.updated\": {\n\t\tprojectId: string;\n\t\tproject: {\n\t\t\tkey: string;\n\t\t\trepoLocator: string;\n\t\t\trepoLocatorKind: ProcessProject[\"repoLocatorKind\"];\n\t\t\tbranch: string;\n\t\t\tbaseBranch: string;\n\t\t\tworkBranch: string | null;\n\t\t\texternalId: string | null;\n\t\t\texternalUrl: string | null;\n\t\t\tpipelineStatus: string | null;\n\t\t};\n\t};\n\t\"worker.state\": {\n\t\tworker: WorkerLease;\n\t\tworkerId: string;\n\t\tstate: WorkerLease[\"state\"];\n\t\tpreviousState: WorkerLease[\"state\"];\n\t\treason: string;\n\t};\n\t\"process.input.queued\": { instanceId: string; input: ProcessInput };\n\t\"process.input.acknowledged\": { instanceId: string; inputId: string; sequence: number };\n\t\"process.event\": { eventType: string; level: string; message: string };\n\t[WS_PROCESS_TYPES.TOAST]: {\n\t\tinstanceId: string;\n\t\tlevel: \"warn\" | \"error\";\n\t\tmessage: string;\n\t\teventType: string;\n\t\tdedupeKey: string;\n\t\tttlMs: number;\n\t\t/** Optional typed Chronicle target applied only when the operator opens the toast. */\n\t\tfocusTarget?: ProcessAttentionTarget;\n\t};\n\t[WS_PROCESS_TYPES.FUTURE_UPDATED]: {\n\t\tfutureExecutionId: string;\n\t\toperation: \"created\" | \"updated\" | \"deleted\";\n\t\tkind: FutureExecutionKind;\n\t};\n\t\"plan.updated\": { planRevision: number; reviewState: string; approved: boolean; summary: string };\n\t\"review.updated\": {\n\t\thasIssues: boolean;\n\t\tissueCount: number;\n\t\treviewMarkdown?: string;\n\t\tnextTurnId: string | null;\n\t};\n\t[WS_PI_STREAM_TYPES.STARTED]: PiPayload;\n\t[WS_PI_STREAM_TYPES.DELTA]: PiPayload<{\n\t\ttext?: string;\n\t\tdelta?: string;\n\t\tchunk?: string;\n\t\tstreamType?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.COMPLETED]: PiPayload;\n\t[WS_PI_STREAM_TYPES.TOOL_STARTED]: PiPayload<{\n\t\ttoolCallId?: string;\n\t\ttoolName?: string;\n\t\tname?: string;\n\t\targuments?: Record<string, unknown>;\n\t\targs?: Record<string, unknown>;\n\t}>;\n\t[WS_PI_STREAM_TYPES.TOOL_COMPLETED]: PiPayload<{\n\t\ttoolCallId?: string;\n\t\ttoolName?: string;\n\t\tname?: string;\n\t\tresult?: unknown;\n\t\tisError?: boolean;\n\t}>;\n\t[WS_PI_STREAM_TYPES.LABEL_CHANGED]: PiPayload<{\n\t\ttargetId?: string | null;\n\t\tlabel?: string | null;\n\t}>;\n\t[WS_PI_STREAM_TYPES.ERROR]: PiPayload<{\n\t\tmessage?: string;\n\t\terrorMessage?: string;\n\t\tsource?: string;\n\t\ttoolName?: string;\n\t\tstopReason?: string;\n\t\tprovider?: string;\n\t\tmodel?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.RETRY_START]: PiPayload<{\n\t\tattempt?: number;\n\t\tmaxAttempts?: number;\n\t\tdelayMs?: number;\n\t\terrorMessage?: string;\n\t\tmessage?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.RETRY_END]: PiPayload<{\n\t\tsuccess?: boolean;\n\t\tattempt?: number;\n\t\tfinalError?: string;\n\t\tmessage?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.USAGE]: PiUsagePayload;\n\t[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TURN_STARTED];\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL];\n\t[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.USAGE_UPDATED];\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED];\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED];\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED];\n\t[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED];\n\t[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.LABEL_CHANGED];\n\t[WS_PRIMARY_PATH_TYPES.CHANGED]: PrimaryPathTree;\n};\n\nexport const WS_FRAME_DURABILITY = {\n\thello: \"ephemeral\",\n\tpong: \"ephemeral\",\n\t\"process.created\": \"durable\",\n\t\"process.updated\": \"durable\",\n\t\"process.deleted\": \"durable\",\n\t\"project.updated\": \"durable\",\n\t\"worker.state\": \"durable\",\n\t\"process.input.queued\": \"durable\",\n\t\"process.input.acknowledged\": \"durable\",\n\t\"process.event\": \"durable\",\n\t[WS_PROCESS_TYPES.TOAST]: \"ephemeral\",\n\t[WS_PROCESS_TYPES.FUTURE_UPDATED]: \"durable\",\n\t\"plan.updated\": \"durable\",\n\t\"review.updated\": \"durable\",\n\t[WS_PI_STREAM_TYPES.STARTED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.DELTA]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.COMPLETED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.TOOL_STARTED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.TOOL_COMPLETED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.LABEL_CHANGED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.ERROR]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.RETRY_START]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.RETRY_END]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.USAGE]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.CHANGED]: \"durable\",\n} as const satisfies Record<keyof WsPayloadByType, WsDurability>;\n\nexport type WsDurabilityByType = typeof WS_FRAME_DURABILITY;\nexport type KnownWsFrameType = keyof WsPayloadByType;\nexport type KnownDurableWsFrameType = {\n\t[K in KnownWsFrameType]: WsDurabilityByType[K] extends \"durable\" ? K : never;\n}[KnownWsFrameType];\nexport type KnownEphemeralWsFrameType = {\n\t[K in KnownWsFrameType]: WsDurabilityByType[K] extends \"ephemeral\" ? K : never;\n}[KnownWsFrameType];\nexport type WsFrameOfType<T extends KnownWsFrameType> = {\n\tprotocol: typeof WS_PROTOCOL_VERSION;\n\ttype: T;\n\tdurability: WsDurabilityByType[T];\n\tsentAt: string;\n\tinstanceId?: string;\n\tpayload: WsPayloadByType[T];\n};\nexport type DurableWsFrameInput = {\n\t[K in KnownDurableWsFrameType]: { type: K; instanceId?: string; payload: WsPayloadByType[K] };\n}[KnownDurableWsFrameType];\nexport type EphemeralWsFrameInput = {\n\t[K in KnownEphemeralWsFrameType]: { type: K; instanceId?: string; payload: WsPayloadByType[K] };\n}[KnownEphemeralWsFrameType];\nexport type WsFrame = { [K in KnownWsFrameType]: WsFrameOfType<K> }[KnownWsFrameType];\nexport type PrimaryPathWsFrameType =\n\t(typeof WS_PRIMARY_PATH_TYPES)[keyof typeof WS_PRIMARY_PATH_TYPES];\nexport type PrimaryPathWsFrame = Extract<WsFrame, { type: PrimaryPathWsFrameType }>;\n\nconst KNOWN_WS_FRAME_TYPES = Object.keys(WS_FRAME_DURABILITY) as KnownWsFrameType[];\nconst PRIMARY_PATH_WS_FRAME_TYPES = Object.values(\n\tWS_PRIMARY_PATH_TYPES,\n) as PrimaryPathWsFrameType[];\nconst WS_FRAME_SCHEMA = v.looseObject({\n\tprotocol: v.literal(WS_PROTOCOL_VERSION),\n\ttype: v.picklist(KNOWN_WS_FRAME_TYPES),\n\tdurability: v.picklist([\"durable\", \"ephemeral\"] as const),\n\tsentAt: v.string(),\n\tinstanceId: v.optional(v.string()),\n\tpayload: unknownRecordSchema,\n});\n\nexport function parsePrimaryPathWsFrameInput(value: unknown): ParseResult<PrimaryPathWsFrame> {\n\tconst frame = parseWsFrame(value);\n\tif (!frame.ok) {\n\t\treturn frame;\n\t}\n\tconst type = parseLiteral(\n\t\tframe.value.type,\n\t\tPRIMARY_PATH_WS_FRAME_TYPES,\n\t\t\"primary_path ws frame.type\",\n\t);\n\tif (!type.ok) {\n\t\treturn type;\n\t}\n\tconst payload = parseSchema(\n\t\tPRIMARY_PATH_PAYLOAD_SCHEMAS[type.value],\n\t\tframe.value.payload,\n\t\t`primary_path ws frame.payload (${type.value})`,\n\t);\n\treturn payload.ok\n\t\t? ok({ ...frame.value, type: type.value, payload: payload.value } as PrimaryPathWsFrame)\n\t\t: payload;\n}\n\nexport function parseWsFrame(value: unknown): ParseResult<WsFrame> {\n\tconst frame = parseSchema(WS_FRAME_SCHEMA, value, \"ws frame\");\n\tif (!frame.ok) {\n\t\treturn frame;\n\t}\n\treturn frame.value.durability !== WS_FRAME_DURABILITY[frame.value.type]\n\t\t? err(\n\t\t\t\t`ws frame.durability must be '${WS_FRAME_DURABILITY[frame.value.type]}' for type '${frame.value.type}'`,\n\t\t\t)\n\t\t: ok(frame.value as WsFrame);\n}\n\nexport function createDurableWsFrame(input: DurableWsFrameInput & { sentAt?: string }): WsFrame {\n\treturn {\n\t\tprotocol: WS_PROTOCOL_VERSION,\n\t\ttype: input.type,\n\t\tdurability: \"durable\",\n\t\tsentAt: input.sentAt ?? new Date().toISOString(),\n\t\t...(input.instanceId ? { instanceId: input.instanceId } : {}),\n\t\tpayload: input.payload,\n\t} as WsFrame;\n}\n\nexport function createEphemeralWsFrame(input: {\n\ttype: KnownEphemeralWsFrameType;\n\tinstanceId?: string;\n\tpayload: WsPayloadByType[KnownEphemeralWsFrameType];\n\tsentAt?: string;\n}): WsFrame {\n\treturn {\n\t\tprotocol: WS_PROTOCOL_VERSION,\n\t\ttype: input.type,\n\t\tdurability: \"ephemeral\",\n\t\tsentAt: input.sentAt ?? new Date().toISOString(),\n\t\t...(input.instanceId ? { instanceId: input.instanceId } : {}),\n\t\tpayload: input.payload,\n\t} as WsFrame;\n}\n\nconst WORKER_TO_WS_TYPE: Record<StreamableWorkerEventType, string> = {\n\t\"pi.stream.delta\": WS_PI_STREAM_TYPES.DELTA,\n\t\"pi.turn.start\": WS_PI_STREAM_TYPES.STARTED,\n\t\"pi.turn.end\": WS_PI_STREAM_TYPES.COMPLETED,\n\t\"pi.tool.call\": WS_PI_STREAM_TYPES.TOOL_STARTED,\n\t\"pi.tool.result\": WS_PI_STREAM_TYPES.TOOL_COMPLETED,\n\t\"pi.label.changed\": WS_PI_STREAM_TYPES.LABEL_CHANGED,\n\t\"pi.error\": WS_PI_STREAM_TYPES.ERROR,\n\t\"pi.retry.start\": WS_PI_STREAM_TYPES.RETRY_START,\n\t\"pi.retry.end\": WS_PI_STREAM_TYPES.RETRY_END,\n\t\"pi.usage\": WS_PI_STREAM_TYPES.USAGE,\n};\n\nexport type RawPiDiagnosticWsFrameType =\n\t(typeof WS_PI_STREAM_TYPES)[keyof typeof WS_PI_STREAM_TYPES];\n\nexport function mapWorkerEventToWsType(workerEventType: string): RawPiDiagnosticWsFrameType | null {\n\treturn (\n\t\t((WORKER_TO_WS_TYPE as Partial<Record<string, string>>)[workerEventType] as\n\t\t\t| RawPiDiagnosticWsFrameType\n\t\t\t| undefined) ?? null\n\t);\n}\n"],"mappings":";AAAA;AAAA,EAMC;AAAA,EACA;AAAA,EAeA;AAAA,OAEM;AACP,YAAYA,QAAO;;;ACzBnB;AAAA,EAEC;AAAA,EACA;AAAA,EACA;AAAA,OAKM;AACP,YAAY,OAAO;AAKZ,IAAM,KAAK,CAAI,WAA8B,EAAE,IAAI,MAAM,MAAM;AAC/D,IAAM,MAAM,CAAC,WAAuC,EAAE,IAAI,OAAO,MAAM;AACvE,IAAM,sBAAwB;AAAA,EACpC,CAAC,UACA,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAAA,EACpE;AACD;AACO,IAAM,uBAAyB,WAAW,SAAO,CAAC;AAClD,IAAM,+BAAiC,WAAS,oBAAoB;AAEpE,SAAS,YACf,QACA,OACA,SACsC;AACtC,QAAM,SAAW,YAAU,QAAQ,KAAK;AACxC,MAAI,OAAO,SAAS;AACnB,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AO,OAAO;AAAA,IACd,eAAe;AAAA,IACf;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,kBAAkB,wBAAwB,OAAO,KAAK;AAAA,IACtD,GAAI,iCACD,EAAE,wBAAwB,WAAW,OAAO,MAAM,sBAAsB,EAAE,IAC1E,CAAC;AAAA,EACL,CAAC;AACF;AAEO,SAAS,6BAA6B,SAA0B;AACtE,SAAO,KAAK,UAAU,6BAA6B,OAAkC,CAAC;AACvF;AAEO,SAAS,+BACf,OACA,UAAU,4BACyB;AACnC,QAAM,SAAS,YAAY,gCAAgC,OAAO,OAAO;AACzE,SAAO,OAAO,KAAK,GAAG,6BAA6B,OAAO,KAAK,CAAC,IAAI;AACrE;AAEO,SAAS,6BACf,aACmC;AACnC,QAAM,SAAS,iBAAiB,aAAa,0BAA0B;AACvE,SAAO,OAAO,KAAK,+BAA+B,OAAO,KAAK,IAAI;AACnE;AAEO,SAAS,6BAA6B,SAA0B;AACtE,SAAO,KAAK,UAAU,6BAA6B,OAAkC,CAAC;AACvF;AAEO,SAAS,+BACf,OACA,UAAU,4BACyB;AACnC,QAAM,SAAS,YAAY,gCAAgC,OAAO,OAAO;AACzE,SAAO,OAAO,KAAK,GAAG,6BAA6B,OAAO,KAAK,CAAC,IAAI;AACrE;AAEO,SAAS,6BACf,aACmC;AACnC,QAAM,SAAS,iBAAiB,aAAa,0BAA0B;AACvE,SAAO,OAAO,KAAK,+BAA+B,OAAO,KAAK,IAAI;AACnE;","names":["v","object","modelConfig","schedule"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-AAV3AAOF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-IEMT3JG4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/tool-renderer-contract.ts
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
var TOOL_CALL_RENDERER_VALUE_KINDS = ["markdown", "plaintext", "json"];
|
|
4
|
+
var TOOL_CALL_RENDERER_VALUE_SOURCES = ["arguments", "result"];
|
|
5
|
+
var unknownRecordSchema = v.record(v.string(), v.unknown());
|
|
6
|
+
function readValueAtPath(value, path) {
|
|
7
|
+
if (!path || path.trim() === "") {
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
let current = value;
|
|
11
|
+
for (const segment of path.split(".").map((part) => part.trim()).filter(Boolean)) {
|
|
12
|
+
const parsedCurrent = v.safeParse(unknownRecordSchema, current);
|
|
13
|
+
if (!parsedCurrent.success || !(segment in parsedCurrent.output)) {
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
current = parsedCurrent.output[segment];
|
|
17
|
+
}
|
|
18
|
+
return current;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
TOOL_CALL_RENDERER_VALUE_KINDS,
|
|
23
|
+
TOOL_CALL_RENDERER_VALUE_SOURCES,
|
|
24
|
+
readValueAtPath
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-IWVU76M5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tool-renderer-contract.ts"],"sourcesContent":["export const TOOL_CALL_RENDERER_VALUE_KINDS = [\"markdown\", \"plaintext\", \"json\"] as const;\nexport type ToolCallRendererValueKind = (typeof TOOL_CALL_RENDERER_VALUE_KINDS)[number];\n\nexport const TOOL_CALL_RENDERER_VALUE_SOURCES = [\"arguments\", \"result\"] as const;\nexport type ToolCallRendererValueSource = (typeof TOOL_CALL_RENDERER_VALUE_SOURCES)[number];\n\nexport interface ToolCallRendererFieldDefinition {\n\tid: string;\n\tlabel: string;\n\tkind: ToolCallRendererValueKind;\n\tsource: ToolCallRendererValueSource;\n\tpath?: string;\n}\n\nexport interface ToolCallRendererDefinition {\n\ttoolName: string;\n\ttitle?: string;\n\tfields: readonly ToolCallRendererFieldDefinition[];\n}\n\nimport * as v from \"valibot\";\n\nconst unknownRecordSchema = v.record(v.string(), v.unknown());\n\nexport function readValueAtPath(value: unknown, path: string | undefined): unknown {\n\tif (!path || path.trim() === \"\") {\n\t\treturn value;\n\t}\n\tlet current: unknown = value;\n\tfor (const segment of path\n\t\t.split(\".\")\n\t\t.map((part) => part.trim())\n\t\t.filter(Boolean)) {\n\t\tconst parsedCurrent = v.safeParse(unknownRecordSchema, current);\n\t\tif (!parsedCurrent.success || !(segment in parsedCurrent.output)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tcurrent = parsedCurrent.output[segment];\n\t}\n\treturn current;\n}\n"],"mappings":";AAoBA,YAAY,OAAO;AApBZ,IAAM,iCAAiC,CAAC,YAAY,aAAa,MAAM;AAGvE,IAAM,mCAAmC,CAAC,aAAa,QAAQ;AAmBtE,IAAM,sBAAwB,SAAS,SAAO,GAAK,UAAQ,CAAC;AAErD,SAAS,gBAAgB,OAAgB,MAAmC;AAClF,MAAI,CAAC,QAAQ,KAAK,KAAK,MAAM,IAAI;AAChC,WAAO;AAAA,EACR;AACA,MAAI,UAAmB;AACvB,aAAW,WAAW,KACpB,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO,GAAG;AAClB,UAAM,gBAAkB,YAAU,qBAAqB,OAAO;AAC9D,QAAI,CAAC,cAAc,WAAW,EAAE,WAAW,cAAc,SAAS;AACjE,aAAO;AAAA,IACR;AACA,cAAU,cAAc,OAAO,OAAO;AAAA,EACvC;AACA,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export interface ExtensionLoadingConfigSnapshot {
|
|
2
|
+
sources: string[];
|
|
3
|
+
}
|
|
4
|
+
export interface ServerWebsocketConfigSnapshot {
|
|
5
|
+
heartbeat_interval: string;
|
|
6
|
+
client_timeout: string;
|
|
7
|
+
toast_ttl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ServerConfigSnapshot {
|
|
10
|
+
host: string;
|
|
11
|
+
port: number;
|
|
12
|
+
base_url: string;
|
|
13
|
+
websocket: ServerWebsocketConfigSnapshot;
|
|
14
|
+
}
|
|
15
|
+
export interface StorageConfigSnapshot {
|
|
16
|
+
sqlite_path: string;
|
|
17
|
+
process_workspaces_dir: string;
|
|
18
|
+
tree_files_dir: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ComponentConfigSnapshot {
|
|
21
|
+
repo: string;
|
|
22
|
+
default_branch: string;
|
|
23
|
+
/**
|
|
24
|
+
* Worker runtime profile this component requires. Selection precedence is
|
|
25
|
+
* process override → component → default; conflicting component profiles on
|
|
26
|
+
* a single process are rejected before the worker starts.
|
|
27
|
+
*/
|
|
28
|
+
worker_runtime_profile?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkersCleanupConfigSnapshot {
|
|
31
|
+
transient_ttl: string;
|
|
32
|
+
completed_process_retention: string;
|
|
33
|
+
error_process_retention: string;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkersConfigSnapshot {
|
|
36
|
+
/** Worker execution run mode. Docker/Kubernetes are production; local is test/development only. */
|
|
37
|
+
runner: "docker" | "kubernetes" | "local";
|
|
38
|
+
/**
|
|
39
|
+
* Fallback worker runtime profile id used when neither the process nor any
|
|
40
|
+
* component selects one. Must reference a configured `worker_runtime_profiles`
|
|
41
|
+
* entry when set.
|
|
42
|
+
*/
|
|
43
|
+
default_runtime_profile?: string;
|
|
44
|
+
max_parallel_processes: number;
|
|
45
|
+
startup_timeout: string;
|
|
46
|
+
shutdown_grace_period: string;
|
|
47
|
+
heartbeat_interval: string;
|
|
48
|
+
turn_max_duration: string;
|
|
49
|
+
turn_inactivity_timeout: string;
|
|
50
|
+
turn_abort_grace_period: string;
|
|
51
|
+
stale_heartbeat_timeout: string;
|
|
52
|
+
resume_on_boot: boolean;
|
|
53
|
+
idle_worker_ttl: string;
|
|
54
|
+
/** Server-enforced maximum HTTP session snapshot upload size in bytes. */
|
|
55
|
+
session_snapshot_max_size_bytes: number;
|
|
56
|
+
/** Server-owned debug mirror for raw worker.event payloads. Workers ignore this switch. */
|
|
57
|
+
log_worker_events_to_stdout: boolean;
|
|
58
|
+
cleanup: WorkersCleanupConfigSnapshot;
|
|
59
|
+
}
|
|
60
|
+
export interface WorkerRuntimeConfigSnapshot {
|
|
61
|
+
heartbeat_interval: string;
|
|
62
|
+
turn_max_duration: string;
|
|
63
|
+
turn_inactivity_timeout: string;
|
|
64
|
+
turn_abort_grace_period: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ModelProfileSnapshot {
|
|
67
|
+
id: string;
|
|
68
|
+
provider: string;
|
|
69
|
+
model_id: string;
|
|
70
|
+
thinking_level?: string;
|
|
71
|
+
/** Non-secret provider-owned defaults applied to each new LLM start. */
|
|
72
|
+
provider_options?: Record<string, string>;
|
|
73
|
+
}
|
|
74
|
+
export interface PiProviderRetryConfigSnapshot {
|
|
75
|
+
/** Optional provider/SDK request timeout. Null defers to the provider SDK default. */
|
|
76
|
+
timeout: string | null;
|
|
77
|
+
/** Optional provider/SDK retry attempts. Null defers to the provider SDK default. */
|
|
78
|
+
max_retries: number | null;
|
|
79
|
+
/** Maximum provider-requested retry delay before failing fast. */
|
|
80
|
+
max_retry_delay: string;
|
|
81
|
+
}
|
|
82
|
+
export interface PiRetryConfigSnapshot {
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
max_retries: number;
|
|
85
|
+
base_delay: string;
|
|
86
|
+
provider: PiProviderRetryConfigSnapshot;
|
|
87
|
+
}
|
|
88
|
+
export interface PiProcessTitleGenerationRetryConfigSnapshot {
|
|
89
|
+
/** Total title-generation attempts including the first immediate try. */
|
|
90
|
+
max_attempts: number;
|
|
91
|
+
/** Base outer retry delay after a failed server-side title request. */
|
|
92
|
+
base_delay: string;
|
|
93
|
+
/** Maximum outer retry delay for failed title-generation jobs. */
|
|
94
|
+
max_delay: string;
|
|
95
|
+
}
|
|
96
|
+
export interface PiProcessTitleGenerationConfigSnapshot {
|
|
97
|
+
model_profile: string | null;
|
|
98
|
+
retry: PiProcessTitleGenerationRetryConfigSnapshot;
|
|
99
|
+
}
|
|
100
|
+
export interface PiConfigSnapshot {
|
|
101
|
+
/** Leitwerk-managed Pi agent directory. Local workers use it as PI_CODING_AGENT_DIR. */
|
|
102
|
+
agent_dir: string;
|
|
103
|
+
model_profiles: ModelProfileSnapshot[];
|
|
104
|
+
/** Global default system prompt template for all processes. Rendered with Mustache against runtime context. When omitted, the worker uses its built-in default. */
|
|
105
|
+
system_prompt_template?: string;
|
|
106
|
+
/** Server-side pre-start process title generation settings. */
|
|
107
|
+
process_title_generation: PiProcessTitleGenerationConfigSnapshot;
|
|
108
|
+
/** Leitwerk-managed Pi retry/runtime settings for newly created worker sessions. */
|
|
109
|
+
retry: PiRetryConfigSnapshot;
|
|
110
|
+
}
|
|
111
|
+
export interface ProcessPiConfigSnapshot {
|
|
112
|
+
system_prompt_template?: string;
|
|
113
|
+
append_system_prompt_template?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ProcessTurnConfigSnapshot {
|
|
116
|
+
model_profile?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface WatcherLaunchConfigSnapshot {
|
|
119
|
+
default_model_profile?: string;
|
|
120
|
+
turn_configs?: Record<string, ProcessTurnConfigSnapshot>;
|
|
121
|
+
}
|
|
122
|
+
export interface JiraWatcherLabelsConfigSnapshot {
|
|
123
|
+
trigger: string;
|
|
124
|
+
done: string;
|
|
125
|
+
required?: string[];
|
|
126
|
+
forbidden?: string[];
|
|
127
|
+
}
|
|
128
|
+
export interface JiraProcessWatcherConfigSnapshot {
|
|
129
|
+
type: "jira";
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
project: string;
|
|
132
|
+
poll_interval: string;
|
|
133
|
+
labels: JiraWatcherLabelsConfigSnapshot;
|
|
134
|
+
target_branch_label_prefix: string;
|
|
135
|
+
launch?: WatcherLaunchConfigSnapshot;
|
|
136
|
+
}
|
|
137
|
+
export interface GitLabMrWatcherLabelsConfigSnapshot {
|
|
138
|
+
trigger: string;
|
|
139
|
+
done: string;
|
|
140
|
+
}
|
|
141
|
+
export interface GitLabMrProcessWatcherConfigSnapshot {
|
|
142
|
+
type: "gitlab_mr";
|
|
143
|
+
enabled: boolean;
|
|
144
|
+
group: string;
|
|
145
|
+
poll_interval: string;
|
|
146
|
+
labels: GitLabMrWatcherLabelsConfigSnapshot;
|
|
147
|
+
launch?: WatcherLaunchConfigSnapshot;
|
|
148
|
+
}
|
|
149
|
+
export interface FilesystemProcessWatcherConfigSnapshot {
|
|
150
|
+
type: "filesystem";
|
|
151
|
+
enabled: boolean;
|
|
152
|
+
poll_interval: string;
|
|
153
|
+
file_path: string;
|
|
154
|
+
launch?: WatcherLaunchConfigSnapshot;
|
|
155
|
+
}
|
|
156
|
+
export type ProcessWatcherConfigSnapshot = JiraProcessWatcherConfigSnapshot | GitLabMrProcessWatcherConfigSnapshot | FilesystemProcessWatcherConfigSnapshot;
|
|
157
|
+
export type ProcessWatcherType = ProcessWatcherConfigSnapshot["type"];
|
|
158
|
+
export interface ProcessConfigSnapshot {
|
|
159
|
+
default_model_profile?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Restricts which model profiles this process may use.
|
|
162
|
+
* When set, only listed profile IDs are valid for default, turn, and override selections.
|
|
163
|
+
* When omitted, all configured model profiles are allowed.
|
|
164
|
+
*/
|
|
165
|
+
allowed_model_profiles?: string[];
|
|
166
|
+
/**
|
|
167
|
+
* Process-level worker runtime profile override. Wins over per-component
|
|
168
|
+
* selection. Must reference a configured `worker_runtime_profiles` entry.
|
|
169
|
+
*/
|
|
170
|
+
worker_runtime_profile?: string;
|
|
171
|
+
pi?: ProcessPiConfigSnapshot;
|
|
172
|
+
turn_configs: Record<string, ProcessTurnConfigSnapshot>;
|
|
173
|
+
watchers?: Record<string, ProcessWatcherConfigSnapshot>;
|
|
174
|
+
}
|
|
175
|
+
export interface WorkerProcessConfigSnapshot {
|
|
176
|
+
pi?: ProcessPiConfigSnapshot;
|
|
177
|
+
}
|
|
178
|
+
export interface NotificationChannelConfigSnapshot {
|
|
179
|
+
enabled: boolean;
|
|
180
|
+
type: string;
|
|
181
|
+
url: string;
|
|
182
|
+
}
|
|
183
|
+
export interface SquadNotificationRouteSnapshot {
|
|
184
|
+
url: string;
|
|
185
|
+
}
|
|
186
|
+
export interface SquadNotificationConfigSnapshot {
|
|
187
|
+
enabled: boolean;
|
|
188
|
+
type: string;
|
|
189
|
+
routing_field: string;
|
|
190
|
+
routes: Record<string, SquadNotificationRouteSnapshot>;
|
|
191
|
+
}
|
|
192
|
+
export interface NotificationsConfigSnapshot {
|
|
193
|
+
all: NotificationChannelConfigSnapshot;
|
|
194
|
+
debug: NotificationChannelConfigSnapshot;
|
|
195
|
+
squad: SquadNotificationConfigSnapshot;
|
|
196
|
+
}
|
|
197
|
+
export interface SandboxConfigSnapshot {
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
profile: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Worker-safe config object snapshot sent from server to worker at bootstrap
|
|
203
|
+
* time. Server-only wiring and unused operator/server config are intentionally
|
|
204
|
+
* excluded.
|
|
205
|
+
*/
|
|
206
|
+
export interface ConfigSnapshot {
|
|
207
|
+
workers: WorkerRuntimeConfigSnapshot;
|
|
208
|
+
pi: PiConfigSnapshot;
|
|
209
|
+
process_configs?: Record<string, WorkerProcessConfigSnapshot>;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=config-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-snapshot.d.ts","sourceRoot":"","sources":["../src/config-snapshot.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,6BAA6B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OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,2BAA2B,CAAC;IACrC,EAAE,EAAE,gBAAgB,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;CAC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-snapshot.js","sourceRoot":"","sources":["../src/config-snapshot.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Repository review created by a worker-side handoff and persisted by the server. */
|
|
2
|
+
export interface CreatedExternalReview {
|
|
3
|
+
projectKey: string;
|
|
4
|
+
externalId: string;
|
|
5
|
+
externalUrl: string;
|
|
6
|
+
baseBranch: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=external-review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-review.d.ts","sourceRoot":"","sources":["../src/external-review.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,WAAW,qBAAqB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-review.js","sourceRoot":"","sources":["../src/external-review.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type FormFieldKind = "text" | "textarea" | "number" | "boolean" | "select";
|
|
2
|
+
export interface FormFieldOptionDefinition {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FormFieldPublishDefinition {
|
|
8
|
+
/** Product name to publish. Defaults to the field id. */
|
|
9
|
+
product?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FormFieldStateDefinition {
|
|
12
|
+
/** Dot-separated path in process state to write the submitted field value to. */
|
|
13
|
+
path: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FormFieldDefinition<TKind extends FormFieldKind = FormFieldKind> {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
kind: TKind;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
options?: readonly FormFieldOptionDefinition[];
|
|
23
|
+
rememberRecentValues?: boolean;
|
|
24
|
+
/** Publish this field as transition-scoped product/input data. */
|
|
25
|
+
publish?: true | FormFieldPublishDefinition;
|
|
26
|
+
/** Persist this field value into process state. */
|
|
27
|
+
state?: FormFieldStateDefinition;
|
|
28
|
+
}
|
|
29
|
+
export type ActionFormFieldKind = Exclude<FormFieldKind, "select">;
|
|
30
|
+
export type ActionFormFieldDefinition = Omit<FormFieldDefinition<ActionFormFieldKind>, "options" | "rememberRecentValues"> & {
|
|
31
|
+
/** Share this textual value across compatible action forms as their primary prompt. */
|
|
32
|
+
primaryPrompt?: true;
|
|
33
|
+
};
|
|
34
|
+
export interface FormDefinition<TField extends FormFieldDefinition = FormFieldDefinition> {
|
|
35
|
+
id: string;
|
|
36
|
+
title: string;
|
|
37
|
+
fields: readonly TField[];
|
|
38
|
+
submitLabel?: string;
|
|
39
|
+
}
|
|
40
|
+
export type ActionFormDefinition = FormDefinition<ActionFormFieldDefinition>;
|
|
41
|
+
//# sourceMappingURL=form-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-contract.d.ts","sourceRoot":"","sources":["../src/form-contract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElF,MAAM,WAAW,yBAAyB;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW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