@leitwerk-dev/protocol 0.2.0 → 0.3.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.
Files changed (128) hide show
  1. package/dist/api-token-contracts.d.ts +20 -0
  2. package/dist/api-token-contracts.d.ts.map +1 -1
  3. package/dist/{chunk-J4VMD5ST.js → chunk-4AKWRRFS.js} +98 -4
  4. package/dist/chunk-4AKWRRFS.js.map +1 -0
  5. package/dist/{chunk-Z4IU6KEN.js → chunk-LTIDCJFK.js} +146 -1
  6. package/dist/chunk-LTIDCJFK.js.map +1 -0
  7. package/dist/{chunk-IWVU76M5.js → chunk-RUPDB3WZ.js} +1 -1
  8. package/dist/chunk-RUPDB3WZ.js.map +1 -0
  9. package/dist/compact-turn-summary.d.ts +21 -3
  10. package/dist/compact-turn-summary.d.ts.map +1 -1
  11. package/dist/config-snapshot-public.d.ts +2 -0
  12. package/dist/config-snapshot-public.d.ts.map +1 -0
  13. package/dist/config-snapshot-public.js +1 -0
  14. package/dist/config-snapshot.d.ts +109 -16
  15. package/dist/config-snapshot.d.ts.map +1 -1
  16. package/dist/config-snapshot.js +0 -1
  17. package/dist/extension-ui-contracts.d.ts +22 -0
  18. package/dist/extension-ui-contracts.d.ts.map +1 -1
  19. package/dist/external-review.d.ts +5 -1
  20. package/dist/external-review.d.ts.map +1 -1
  21. package/dist/form-contract-public.d.ts +2 -0
  22. package/dist/form-contract-public.d.ts.map +1 -0
  23. package/dist/form-contract-public.js +1 -0
  24. package/dist/form-contract.d.ts +29 -5
  25. package/dist/form-contract.d.ts.map +1 -1
  26. package/dist/form-contract.js +0 -1
  27. package/dist/{http-contracts-ht8DDU4J.d.ts → http-contracts-public-rL4HFcxz.d.ts} +971 -45
  28. package/dist/http-contracts-public.d.ts +4 -0
  29. package/dist/http-contracts-public.d.ts.map +1 -0
  30. package/dist/http-contracts-public.js +10 -0
  31. package/dist/http-contracts.d.ts +819 -12
  32. package/dist/http-contracts.d.ts.map +1 -1
  33. package/dist/http-contracts.js +2 -2
  34. package/dist/index.d.ts +30 -25
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +25 -75
  37. package/dist/index.js.map +1 -1
  38. package/dist/initial-prompt.d.ts +6 -0
  39. package/dist/initial-prompt.d.ts.map +1 -1
  40. package/dist/launcher-contract-public.d.ts +2 -0
  41. package/dist/launcher-contract-public.d.ts.map +1 -0
  42. package/dist/launcher-contract-public.js +1 -0
  43. package/dist/launcher-contract-public.js.map +1 -0
  44. package/dist/launcher-contract.d.ts +26 -1
  45. package/dist/launcher-contract.d.ts.map +1 -1
  46. package/dist/launcher-contract.js +0 -1
  47. package/dist/live-turn-projection.d.ts +29 -0
  48. package/dist/live-turn-projection.d.ts.map +1 -1
  49. package/dist/pi-session-message.d.ts +16 -0
  50. package/dist/pi-session-message.d.ts.map +1 -1
  51. package/dist/primary-path-snapshot.d.ts +64 -0
  52. package/dist/primary-path-snapshot.d.ts.map +1 -1
  53. package/dist/protocol.d.ts +387 -1
  54. package/dist/protocol.d.ts.map +1 -1
  55. package/dist/protocol.js +1 -1
  56. package/dist/session-entry-tree.d.ts +12 -0
  57. package/dist/session-entry-tree.d.ts.map +1 -1
  58. package/dist/streamable-events.d.ts +3 -0
  59. package/dist/streamable-events.d.ts.map +1 -1
  60. package/dist/text-preview.d.ts +5 -0
  61. package/dist/text-preview.d.ts.map +1 -1
  62. package/dist/ticket-creation-contracts.d.ts +23 -1
  63. package/dist/ticket-creation-contracts.d.ts.map +1 -1
  64. package/dist/timeline-projection.d.ts +5 -0
  65. package/dist/timeline-projection.d.ts.map +1 -1
  66. package/dist/timestamp-ordering.d.ts +2 -0
  67. package/dist/timestamp-ordering.d.ts.map +1 -1
  68. package/dist/tool-renderer-contract-public.d.ts +3 -0
  69. package/dist/tool-renderer-contract-public.d.ts.map +1 -0
  70. package/dist/tool-renderer-contract-public.js +9 -0
  71. package/dist/tool-renderer-contract-public.js.map +1 -0
  72. package/dist/tool-renderer-contract.d.ts +15 -0
  73. package/dist/tool-renderer-contract.d.ts.map +1 -1
  74. package/dist/tool-renderer-contract.js +1 -1
  75. package/dist/tool-result-truncation.d.ts +4 -0
  76. package/dist/tool-result-truncation.d.ts.map +1 -1
  77. package/dist/turn-continuation.d.ts +28 -0
  78. package/dist/turn-continuation.d.ts.map +1 -1
  79. package/dist/turn-trace-projection.d.ts +1 -1
  80. package/dist/turn-trace-projection.d.ts.map +1 -1
  81. package/dist/usage-by-turn-record.d.ts +2 -0
  82. package/dist/usage-by-turn-record.d.ts.map +1 -1
  83. package/dist/usage-snapshot.d.ts +20 -3
  84. package/dist/usage-snapshot.d.ts.map +1 -1
  85. package/dist/ws-event-payloads.d.ts +14 -0
  86. package/dist/ws-event-payloads.d.ts.map +1 -1
  87. package/package.json +17 -17
  88. package/src/api-token-contracts.ts +20 -0
  89. package/src/compact-turn-summary.ts +26 -4
  90. package/src/config-snapshot-public.ts +12 -0
  91. package/src/config-snapshot.ts +109 -16
  92. package/src/extension-ui-contracts.ts +22 -0
  93. package/src/external-review.ts +5 -1
  94. package/src/form-contract-public.ts +6 -0
  95. package/src/form-contract.ts +29 -5
  96. package/src/http-contracts-public.ts +86 -0
  97. package/src/http-contracts.ts +926 -40
  98. package/src/index.ts +184 -25
  99. package/src/initial-prompt.ts +6 -0
  100. package/src/launcher-contract-public.ts +8 -0
  101. package/src/launcher-contract.ts +26 -1
  102. package/src/live-turn-projection.ts +29 -0
  103. package/src/pi-session-message.ts +21 -3
  104. package/src/primary-path-snapshot.ts +64 -0
  105. package/src/protocol.ts +412 -17
  106. package/src/session-entry-tree.ts +12 -0
  107. package/src/streamable-events.ts +3 -0
  108. package/src/text-preview.ts +5 -0
  109. package/src/ticket-creation-contracts.ts +31 -3
  110. package/src/timeline-projection.ts +5 -0
  111. package/src/timestamp-ordering.ts +2 -0
  112. package/src/tool-renderer-contract-public.ts +10 -0
  113. package/src/tool-renderer-contract.ts +15 -0
  114. package/src/tool-result-truncation.ts +4 -0
  115. package/src/turn-continuation.ts +28 -0
  116. package/src/turn-trace-projection.ts +1 -1
  117. package/src/usage-by-turn-record.ts +2 -0
  118. package/src/usage-snapshot.ts +20 -3
  119. package/src/ws-event-payloads.ts +14 -0
  120. package/dist/chunk-6L4W7WPV.js +0 -1
  121. package/dist/chunk-AAV3AAOF.js +0 -1
  122. package/dist/chunk-IEMT3JG4.js +0 -1
  123. package/dist/chunk-IWVU76M5.js.map +0 -1
  124. package/dist/chunk-J4VMD5ST.js.map +0 -1
  125. package/dist/chunk-Z4IU6KEN.js.map +0 -1
  126. /package/dist/{chunk-6L4W7WPV.js.map → config-snapshot-public.js.map} +0 -0
  127. /package/dist/{chunk-AAV3AAOF.js.map → form-contract-public.js.map} +0 -0
  128. /package/dist/{chunk-IEMT3JG4.js.map → http-contracts-public.js.map} +0 -0
@@ -54,141 +54,237 @@ import {
54
54
  import type { ToolCallRendererDefinition } from "./tool-renderer-contract.js";
55
55
  import type { UsageCostSnapshot, UsageTokenCounts } from "./usage-snapshot.js";
56
56
 
57
+ /** @internal */
57
58
  export interface StartLaunchRunResponseBody {
59
+ /** @internal */
58
60
  launchRunId: string;
61
+ /** @internal */
59
62
  instanceId: string | null;
60
63
  }
61
64
 
65
+ /** @internal */
62
66
  export interface LaunchRunResponseBody {
67
+ /** @internal */
63
68
  launchRun: LaunchRun;
64
69
  }
65
70
 
71
+ /** @internal */
66
72
  export interface ProcessLaunchRunsResponseBody {
73
+ /** @internal */
67
74
  launchRuns: LaunchRun[];
68
75
  }
69
76
 
77
+ /** @internal */
70
78
  export interface AuthMeResponseBody {
79
+ /** @internal */
71
80
  authEnabled: boolean;
81
+ /** @internal */
72
82
  actor: Actor | null;
73
83
  }
74
84
 
85
+ /** @internal */
75
86
  export interface SessionTransferOperationView {
87
+ /** @internal */
76
88
  attemptId: string;
89
+ /** @internal */
77
90
  phase: string;
91
+ /** @internal */
78
92
  blocksManualTurns: boolean;
79
93
  }
80
94
 
95
+ /** @internal */
81
96
  export interface ProcessListItem {
97
+ /** @internal */
82
98
  process: ProcessInstance;
99
+ /** @internal */
83
100
  projects: ProcessProject[];
101
+ /** @internal */
84
102
  workerLease: WorkerLease | null;
103
+ /** @internal */
85
104
  processDisplayName: string | null;
86
105
  }
87
106
 
107
+ /** @internal */
88
108
  export type ScheduleMode = "now" | "once" | "cron";
89
109
 
110
+ /** @internal */
90
111
  export type ScheduleConfigInput = {
112
+ /** @internal */
91
113
  mode: ScheduleMode;
114
+ /** @internal */
92
115
  runAt?: string | null;
116
+ /** @internal */
93
117
  cronExpression?: string | null;
94
118
  };
95
119
 
120
+ /** @internal */
96
121
  export interface FutureExecutionBaseSummary {
122
+ /** @internal */
97
123
  id: string;
124
+ /** @internal */
98
125
  kind: "launch" | "action";
126
+ /** @internal */
99
127
  scheduleKind: "once" | "cron";
128
+ /** @internal */
100
129
  processId: string;
130
+ /** @internal */
101
131
  nextRunAt: string;
132
+ /** @internal */
102
133
  cronExpression: string | null;
134
+ /** @internal */
103
135
  title: string;
136
+ /** @internal */
104
137
  subtitle: string;
138
+ /** @internal */
105
139
  status?: "scheduled" | "blocked";
140
+ /** @internal */
106
141
  modelSelection?: DurableModelSelection | null;
142
+ /** @internal */
107
143
  blockedReason?: FutureExecutionBlockReason | null;
108
144
  }
109
145
 
146
+ /** @internal */
110
147
  export type LauncherModelConfigDefaults = LaunchModelConfigInput;
111
148
 
149
+ /** @internal */
112
150
  export interface FutureLaunchSummary extends FutureExecutionBaseSummary {
151
+ /** @internal */
113
152
  kind: "launch";
153
+ /** @internal */
114
154
  launcherId: string;
155
+ /** @internal */
115
156
  launcherLabel: string;
157
+ /** @internal */
116
158
  launchTitle: string | null;
159
+ /** @internal */
117
160
  launcherInput: Record<string, unknown>;
161
+ /** @internal */
118
162
  skillIds: string[];
163
+ /** @internal */
119
164
  modelConfig: LauncherModelConfigDefaults;
120
165
  }
121
166
 
167
+ /** @internal */
122
168
  export interface FutureActionSummary extends FutureExecutionBaseSummary {
169
+ /** @internal */
123
170
  kind: "action";
171
+ /** @internal */
124
172
  instanceId: string;
173
+ /** @internal */
125
174
  actionId: string;
175
+ /** @internal */
126
176
  actionLabel: string;
177
+ /** @internal */
127
178
  nextTurnModelProfileId: string | null;
128
179
  }
129
180
 
181
+ /** @internal */
130
182
  export type FutureExecutionSummary = FutureLaunchSummary | FutureActionSummary;
131
183
 
184
+ /** @internal */
132
185
  export type ProcessActionFieldDefinition = ActionFormFieldDefinition;
186
+ /** @internal */
133
187
  export type ProcessActionFormDefinition = ActionFormDefinition;
134
188
 
189
+ /** @internal */
135
190
  export type ProcessActionPreviewSummary = {
191
+ /** @internal */
136
192
  kind: "turn" | "terminal";
193
+ /** @internal */
137
194
  turnId: string | null;
195
+ /** @internal */
138
196
  turnKind: ProcessTurnType | null;
197
+ /** @internal */
139
198
  description: string;
140
199
  };
141
200
 
201
+ /** @internal */
142
202
  export interface ProcessActionSummary {
203
+ /** @internal */
143
204
  id: string;
205
+ /** @internal */
144
206
  label: string;
207
+ /** @internal */
145
208
  description: string | null;
209
+ /** @internal */
146
210
  preview: ProcessActionPreviewSummary | null;
211
+ /** @internal */
147
212
  supportsScheduling: boolean;
213
+ /** @internal */
148
214
  supportsNextTurnModelOverride: boolean;
215
+ /** @internal */
149
216
  form?: ProcessActionFormDefinition;
150
217
  }
151
218
 
219
+ /** @internal */
152
220
  export interface ScheduledActionDetail {
221
+ /** @internal */
153
222
  id: string;
223
+ /** @internal */
154
224
  nextRunAt: string;
225
+ /** @internal */
155
226
  actionId: string;
227
+ /** @internal */
156
228
  actionLabel: string;
229
+ /** @internal */
157
230
  input: Record<string, unknown>;
231
+ /** @internal */
158
232
  nextTurnModelProfileId: string | null;
233
+ /** @internal */
159
234
  status?: "scheduled" | "blocked";
235
+ /** @internal */
160
236
  modelSelection?: DurableModelSelection | null;
237
+ /** @internal */
161
238
  blockedReason?: FutureExecutionBlockReason | null;
239
+ /** @internal */
162
240
  action: ProcessActionSummary;
163
241
  }
164
242
 
243
+ /** @internal */
165
244
  export type ProcessActionModelResolutionSource =
166
245
  | ProcessSelectedTurnModelSource
167
246
  | "persisted_selection"
168
247
  | "none";
169
248
 
249
+ /** @internal */
170
250
  export interface ProcessActionModelResolutionPreview {
251
+ /** @internal */
171
252
  status: "resolved" | "none" | "error";
253
+ /** @internal */
172
254
  modelProfileId: string | null;
255
+ /** @internal */
173
256
  source: ProcessActionModelResolutionSource | null;
257
+ /** @internal */
174
258
  error: string | null;
175
259
  }
176
260
 
261
+ /** @internal */
177
262
  export interface ProcessActionWarmPromptCacheContext {
263
+ /** @internal */
178
264
  previousModelProfileId: string;
265
+ /** @internal */
179
266
  compatibleModelProfileIds: readonly string[];
267
+ /** @internal */
180
268
  expiresAt: string;
181
269
  }
182
270
 
271
+ /** @internal */
183
272
  export interface PromptCacheSwitchResolution {
273
+ /** @internal */
184
274
  switchingModelMayBypassPromptCache: boolean;
275
+ /** @internal */
185
276
  recommendedModelProfileId: string | null;
186
277
  }
187
278
 
279
+ /** @internal */
188
280
  export function resolvePromptCacheSwitch(input: {
281
+ /** @internal */
189
282
  context: ProcessActionWarmPromptCacheContext | null | undefined;
283
+ /** @internal */
190
284
  effectiveModelProfileId: string;
285
+ /** @internal */
191
286
  selectableModelProfileIds?: readonly string[];
287
+ /** @internal */
192
288
  now?: number;
193
289
  }): PromptCacheSwitchResolution {
194
290
  const expiresAtMs = input.context ? Date.parse(input.context.expiresAt) : Number.NaN;
@@ -214,645 +310,1153 @@ export function resolvePromptCacheSwitch(input: {
214
310
  };
215
311
  }
216
312
 
313
+ /** @internal */
217
314
  export interface ProcessActionModelPreview {
315
+ /** @internal */
218
316
  kind: "llm_turn" | "not_applicable" | "unavailable";
317
+ /** @internal */
219
318
  turnId: string | null;
319
+ /** @internal */
220
320
  description: string | null;
321
+ /** @internal */
221
322
  resolvedModel?: ProcessActionModelResolutionPreview;
323
+ /** @internal */
222
324
  warmPromptCache?: ProcessActionWarmPromptCacheContext;
325
+ /** @internal */
223
326
  unavailableReason?:
224
327
  | "action_not_found"
225
328
  | "action_not_visible"
226
329
  | "invalid_action_input"
227
330
  | "action_failed";
331
+ /** @internal */
228
332
  unavailableMessage?: string | null;
229
333
  }
230
334
 
335
+ /** @internal */
231
336
  export type ProcessExternalSourceSummary = {
337
+ /** @internal */
232
338
  id: string;
339
+ /** @internal */
233
340
  kind: string;
341
+ /** @internal */
234
342
  externalActionId?: string;
343
+ /** @internal */
235
344
  sourceKind?: string;
345
+ /** @internal */
236
346
  label: string | null;
347
+ /** @internal */
237
348
  description: string | null;
238
349
  };
239
350
 
351
+ /** @internal */
240
352
  export type ProcessExternalTriggerSummary = ProcessExternalSourceSummary;
241
353
 
354
+ /** @internal */
242
355
  export interface ProcessSelectedTurnSummary {
356
+ /** @internal */
243
357
  turnId: string;
358
+ /** @internal */
244
359
  kind: ProcessTurnType;
360
+ /** @internal */
245
361
  description: string;
362
+ /** @internal */
246
363
  commentary: string | null;
364
+ /** @internal */
247
365
  externalTriggers: ProcessExternalSourceSummary[];
248
366
  }
249
367
 
368
+ /** @internal */
250
369
  export type ModelProfileAvailability = "available" | "unavailable" | "stale";
251
370
 
371
+ /** @internal */
252
372
  export type ModelProfileOptionSummary = {
373
+ /** @internal */
253
374
  id: string;
375
+ /** @internal */
254
376
  label: string;
377
+ /** @internal */
255
378
  description: string;
379
+ /** @internal */
256
380
  availability: ModelProfileAvailability;
381
+ /** @internal */
257
382
  safeReason?: string | null;
383
+ /** @internal */
258
384
  checkedAt?: string | null;
259
385
  };
260
386
 
387
+ /** @internal */
261
388
  export interface ProviderOptionChoiceSummary {
389
+ /** @internal */
262
390
  value: string;
391
+ /** @internal */
263
392
  label: string;
264
393
  }
265
394
 
395
+ /** @internal */
266
396
  export interface ProviderOptionFieldSummary {
397
+ /** @internal */
267
398
  id: string;
399
+ /** @internal */
268
400
  label: string;
401
+ /** @internal */
269
402
  required: boolean;
403
+ /** @internal */
270
404
  minLength: number | null;
405
+ /** @internal */
271
406
  maxLength: number | null;
407
+ /** @internal */
272
408
  defaultValue: string | null;
273
- /** Advisory values. Values outside this list can still be valid. */
409
+ /** Advisory values. Values outside this list can still be valid. @internal */
274
410
  choices: readonly ProviderOptionChoiceSummary[];
275
411
  }
276
412
 
413
+ /** @internal */
277
414
  export interface ModelProviderOptionsResponseBody {
415
+ /** @internal */
278
416
  modelProfileId: string;
417
+ /** @internal */
279
418
  providerId: string;
419
+ /** @internal */
280
420
  fields: readonly ProviderOptionFieldSummary[];
421
+ /** @internal */
281
422
  choicesStatus: "available" | "unavailable";
423
+ /** @internal */
282
424
  choicesUnavailableReason: string | null;
283
425
  }
284
426
 
427
+ /** @internal */
285
428
  export interface ProcessTurnModelConfigurationView {
429
+ /** @internal */
286
430
  turnId: string;
431
+ /** @internal */
287
432
  description: string;
433
+ /** @internal */
288
434
  pathType: string;
435
+ /** @internal */
289
436
  processConfigModelProfileId: string | null;
437
+ /** @internal */
290
438
  instanceModelProfileId: string | null;
439
+ /** @internal */
291
440
  effectiveConfiguredModelProfileId: string | null;
441
+ /** @internal */
292
442
  source: "instance" | "process_config" | "default";
293
443
  }
294
444
 
445
+ /** @internal */
295
446
  export type ProcessModelConfigurationIssueView = {
447
+ /** @internal */
296
448
  code: "invalid_turn_configs_json";
449
+ /** @internal */
297
450
  reason: "invalid_json" | "not_object" | "turn_config_not_object";
451
+ /** @internal */
298
452
  turnId?: string;
299
453
  };
300
454
 
455
+ /** @internal */
301
456
  export interface ProcessModelConfigurationView {
457
+ /** @internal */
302
458
  state:
303
- | { kind: "ready" }
304
- | { kind: "blocked"; issues: readonly ProcessModelConfigurationIssueView[] };
459
+ | {
460
+ /** @internal */
461
+ kind: "ready";
462
+ }
463
+ | {
464
+ /** @internal */
465
+ kind: "blocked";
466
+ /** @internal */
467
+ issues: readonly ProcessModelConfigurationIssueView[];
468
+ };
469
+ /** @internal */
305
470
  availableProfiles: readonly ModelProfileOptionSummary[];
471
+ /** @internal */
306
472
  effectiveSelectedTurn: {
473
+ /** @internal */
307
474
  turnId: string;
475
+ /** @internal */
308
476
  description: string;
477
+ /** @internal */
309
478
  modelProfileId: string;
479
+ /** @internal */
310
480
  source: ProcessActionModelResolutionSource;
311
481
  } | null;
482
+ /** @internal */
312
483
  defaultModel: {
484
+ /** @internal */
313
485
  processConfigModelProfileId: string | null;
486
+ /** @internal */
314
487
  instanceModelProfileId: string | null;
488
+ /** @internal */
315
489
  effectiveModelProfileId: string | null;
490
+ /** @internal */
316
491
  source: "instance" | "process_config" | "catalog_default" | "none";
317
492
  };
493
+ /** @internal */
318
494
  turns: readonly ProcessTurnModelConfigurationView[];
319
495
  }
320
496
 
497
+ /** @internal */
321
498
  export type ProcessRunToolParameterView = {
499
+ /** @internal */
322
500
  name: string;
501
+ /** @internal */
323
502
  type: string;
503
+ /** @internal */
324
504
  description: string;
505
+ /** @internal */
325
506
  required: boolean;
326
507
  };
327
508
 
509
+ /** @internal */
328
510
  export type ProcessRunToolView = {
511
+ /** @internal */
329
512
  name: string;
513
+ /** @internal */
330
514
  description: string;
515
+ /** @internal */
331
516
  parameters: readonly ProcessRunToolParameterView[];
332
517
  };
333
518
 
519
+ /** @internal */
334
520
  export type ProcessRunTurnView = {
521
+ /** @internal */
335
522
  turnId: string;
523
+ /** @internal */
336
524
  description: string;
525
+ /** @internal */
337
526
  pathType: string;
527
+ /** @internal */
338
528
  consumedProducts: readonly string[];
529
+ /** @internal */
339
530
  publishedProducts: readonly string[];
531
+ /** @internal */
340
532
  activePiToolNames: readonly string[];
533
+ /** @internal */
341
534
  outcomeActions: readonly ProcessRunToolView[];
342
535
  };
343
536
 
537
+ /** @internal */
344
538
  export type ProcessRunDetailsView = {
539
+ /** @internal */
345
540
  systemPrompt: string | null;
541
+ /** @internal */
346
542
  appendSystemPrompt: string | null;
543
+ /** @internal */
347
544
  availablePiToolNames: readonly string[];
545
+ /** @internal */
348
546
  turns: readonly ProcessRunTurnView[];
349
547
  };
350
548
 
549
+ /** @internal */
351
550
  export interface ProcessLaunchConfigurationParameterView {
551
+ /** @internal */
352
552
  fieldId: string;
553
+ /** @internal */
353
554
  label: string;
555
+ /** @internal */
354
556
  value: string | null;
355
557
  }
356
558
 
559
+ /** @internal */
357
560
  export interface ProcessLaunchConfigurationProjectView {
561
+ /** @internal */
358
562
  key: string;
563
+ /** @internal */
359
564
  repoLocator: string;
565
+ /** @internal */
360
566
  repoLocatorKind: ProcessProject["repoLocatorKind"];
567
+ /** @internal */
361
568
  baseBranch: string;
569
+ /** @internal */
362
570
  workBranch: string | null;
571
+ /** @internal */
363
572
  externalId: string | null;
573
+ /** @internal */
364
574
  externalUrl: string | null;
575
+ /** @internal */
365
576
  pipelineStatus: string | null;
366
577
  }
367
578
 
579
+ /** @internal */
368
580
  export interface ProcessLaunchConfigurationView {
581
+ /** @internal */
369
582
  launcherId: string | null;
583
+ /** @internal */
370
584
  launcherLabel: string | null;
585
+ /** @internal */
371
586
  launcherSchemaTitle: string | null;
587
+ /** @internal */
372
588
  paramsParseError: string | null;
589
+ /** @internal */
373
590
  parameters: readonly ProcessLaunchConfigurationParameterView[];
591
+ /** @internal */
374
592
  projects: readonly ProcessLaunchConfigurationProjectView[];
375
593
  }
376
594
 
595
+ /** @internal */
377
596
  export interface PiSessionUsageSnapshot extends UsageTokenCounts {
597
+ /** @internal */
378
598
  cost?: UsageCostSnapshot;
379
599
  }
380
600
 
381
- export type PiSessionTextContentBlock = { type: "text"; text: string };
601
+ /** @internal */
602
+ export type PiSessionTextContentBlock = {
603
+ /** @internal */
604
+ type: "text";
605
+ /** @internal */
606
+ text: string;
607
+ };
382
608
 
609
+ /** @internal */
383
610
  export type PiSessionThinkingContentBlock = {
611
+ /** @internal */
384
612
  type: "thinking";
613
+ /** @internal */
385
614
  thinking: string;
615
+ /** @internal */
386
616
  redacted?: boolean;
387
617
  };
388
618
 
619
+ /** @internal */
389
620
  export type PiSessionToolCallContentBlock = {
621
+ /** @internal */
390
622
  type: "toolCall";
623
+ /** @internal */
391
624
  id: string;
625
+ /** @internal */
392
626
  name: string;
627
+ /** @internal */
393
628
  arguments: Record<string, unknown>;
394
629
  };
395
630
 
631
+ /** @internal */
396
632
  export type PiSessionImageContentBlock = {
633
+ /** @internal */
397
634
  type: "image";
635
+ /** @internal */
398
636
  data: string;
637
+ /** @internal */
399
638
  mimeType: string;
400
639
  };
401
640
 
641
+ /** @internal */
402
642
  export type PiSessionContentBlock =
403
643
  | PiSessionTextContentBlock
404
644
  | PiSessionThinkingContentBlock
405
645
  | PiSessionToolCallContentBlock
406
646
  | PiSessionImageContentBlock;
407
647
 
648
+ /** @internal */
408
649
  export interface PiSessionMessageRecord {
650
+ /** @internal */
409
651
  role?: string;
652
+ /** @internal */
410
653
  content?: string | PiSessionContentBlock[];
654
+ /** @internal */
411
655
  toolCallId?: string;
656
+ /** @internal */
412
657
  toolName?: string;
658
+ /** @internal */
413
659
  details?: unknown;
660
+ /** @internal */
414
661
  isError?: boolean;
662
+ /** @internal */
415
663
  usage?: PiSessionUsageSnapshot;
664
+ /** @internal */
416
665
  stopReason?: string;
666
+ /** @internal */
417
667
  errorMessage?: string;
668
+ /** @internal */
418
669
  provider?: string;
670
+ /** @internal */
419
671
  model?: string;
672
+ /** @internal */
420
673
  timestamp?: number;
421
674
  }
422
675
 
676
+ /** @internal */
423
677
  export interface PiSessionEntry {
678
+ /** @internal */
424
679
  type: string;
680
+ /** @internal */
425
681
  id: string;
682
+ /** @internal */
426
683
  parentId: string | null;
684
+ /** @internal */
427
685
  timestamp: string;
686
+ /** @internal */
428
687
  message?: PiSessionMessageRecord;
688
+ /** @internal */
429
689
  targetId?: string;
690
+ /** @internal */
430
691
  label?: string;
431
692
  }
432
693
 
694
+ /** @internal */
433
695
  export interface ProcessDiagnosticsData {
696
+ /** @internal */
434
697
  process: ProcessInstance;
698
+ /** @internal */
435
699
  projects: ProcessProject[];
700
+ /** @internal */
436
701
  inputs: ProcessInput[];
702
+ /** @internal */
437
703
  events: ProcessEvent[];
704
+ /** @internal */
438
705
  leafOutcomeSnapshots: ProcessLeafOutcomeSnapshot[];
706
+ /** @internal */
439
707
  turnRecords: ProcessTurnRecord[];
708
+ /** @internal */
440
709
  turnAnnotations: ProcessTurnAnnotation[];
710
+ /** @internal */
441
711
  workerLease: WorkerLease | null;
712
+ /** @internal */
442
713
  processDisplayName: string | null;
714
+ /** @internal */
443
715
  processGraph: SerializedProcessGraph;
716
+ /** @internal */
444
717
  processFlow: ProcessFlowView;
718
+ /** @internal */
445
719
  piSessionEntries: PiSessionEntry[];
720
+ /** @internal */
446
721
  definesLeafOutcome: boolean;
722
+ /** @internal */
447
723
  selectedTurn?: ProcessSelectedTurnSummary | null;
724
+ /** @internal */
448
725
  scheduledAction?: ScheduledActionDetail | null;
726
+ /** @internal */
449
727
  modelConfiguration: ProcessModelConfigurationView;
728
+ /** @internal */
450
729
  runDetails: ProcessRunDetailsView;
730
+ /** @internal */
451
731
  launchConfiguration: ProcessLaunchConfigurationView;
732
+ /** @internal */
452
733
  actions: ProcessActionSummary[];
734
+ /** @internal */
453
735
  toolRenderers: ToolCallRendererDefinition[];
454
736
  }
455
737
 
738
+ /** @internal */
456
739
  export interface ProcessDetailData extends ProcessDiagnosticsData {
740
+ /** @internal */
457
741
  primaryPath: PrimaryPathSnapshot;
458
742
  }
459
743
 
744
+ /** @internal */
460
745
  export interface LauncherModelConfigSchema {
746
+ /** @internal */
461
747
  availableProfiles: readonly ModelProfileOptionSummary[];
748
+ /** @internal */
462
749
  llmTurns: ReadonlyArray<{
750
+ /** @internal */
463
751
  turnId: string;
752
+ /** @internal */
464
753
  description: string;
465
754
  }>;
466
755
  }
467
756
 
757
+ /** @internal */
468
758
  export type LauncherDefaultModelPreview = {
759
+ /** @internal */
469
760
  source: "instance_default" | "process_config_default" | "catalog_default" | "none";
761
+ /** @internal */
470
762
  profile: ModelProfileOptionSummary | null;
471
763
  };
472
764
 
765
+ /** @internal */
473
766
  export interface LauncherTurnModelConfigPreview {
767
+ /** @internal */
474
768
  turnId: string;
769
+ /** @internal */
475
770
  description: string;
771
+ /** @internal */
476
772
  effective: {
773
+ /** @internal */
477
774
  source: ProcessActionModelResolutionSource;
775
+ /** @internal */
478
776
  profile: ModelProfileOptionSummary | null;
479
777
  };
480
778
  }
481
779
 
780
+ /** @internal */
482
781
  export type LauncherModelConfigPreview = {
782
+ /** @internal */
483
783
  defaultModel: LauncherDefaultModelPreview;
784
+ /** @internal */
484
785
  turns: readonly LauncherTurnModelConfigPreview[];
485
786
  };
486
787
 
788
+ /** @internal */
487
789
  export type UiLauncherSummary = UiLauncherSummaryBase & {
790
+ /** @internal */
488
791
  modelConfigSchema?: LauncherModelConfigSchema;
792
+ /** @internal */
489
793
  processFlow?: ProcessFlowView;
490
794
  };
491
795
 
796
+ /** @internal */
492
797
  export type ProcessRetryConfig = {
798
+ /** @internal */
493
799
  launcherId: string;
800
+ /** @internal */
494
801
  title: string | null;
802
+ /** @internal */
495
803
  launcherInput: Record<string, unknown>;
804
+ /** @internal */
496
805
  skillIds: string[];
806
+ /** @internal */
497
807
  modelConfig: LauncherModelConfigDefaults;
498
808
  };
499
809
 
810
+ /** @internal */
500
811
  export type WatcherLaunchModelSummary = {
812
+ /** @internal */
501
813
  defaultModelProfileId: string | null;
502
- turnConfigs: Array<{ turnId: string; modelProfileId: string | null }>;
814
+ /** @internal */
815
+ turnConfigs: Array<{
816
+ /** @internal */
817
+ turnId: string;
818
+ /** @internal */
819
+ modelProfileId: string | null;
820
+ }>;
503
821
  };
504
822
 
823
+ /** @public */
505
824
  export interface WatcherPresentationField {
825
+ /** @public */
506
826
  label: string;
827
+ /** @public */
507
828
  value: string;
829
+ /** @internal */
508
830
  format?: "text" | "code";
509
831
  }
510
832
 
833
+ /** @internal */
511
834
  export interface WatcherSummary {
835
+ /** @internal */
512
836
  processId: string;
837
+ /** @internal */
513
838
  processDisplayName: string;
839
+ /** @internal */
514
840
  watcherId: string;
841
+ /** @internal */
515
842
  label: string;
843
+ /** @internal */
516
844
  description: string;
845
+ /** @internal */
517
846
  sourceId: string;
847
+ /** @internal */
518
848
  sourceLabel: string;
849
+ /** @internal */
519
850
  enabled: boolean;
851
+ /** @internal */
520
852
  configPath: string;
853
+ /** @internal */
521
854
  targetSummary: string;
855
+ /** @internal */
522
856
  details: WatcherPresentationField[];
857
+ /** @internal */
523
858
  launchModel: WatcherLaunchModelSummary;
524
859
  }
525
860
 
861
+ /** @internal */
526
862
  export interface SkillUsageSummary {
863
+ /** @internal */
527
864
  attachedAllTime: number;
865
+ /** @internal */
528
866
  attachedLast30Days: number;
867
+ /** @internal */
529
868
  invokedAllTime: number;
869
+ /** @internal */
530
870
  invokedLast30Days: number;
531
871
  }
532
872
 
873
+ /** @internal */
533
874
  export interface SkillRepositorySummary {
875
+ /** @internal */
534
876
  id: string;
877
+ /** @internal */
535
878
  label: string;
879
+ /** @internal */
536
880
  url: string;
881
+ /** @internal */
537
882
  ref: string;
883
+ /** @internal */
538
884
  path: string;
885
+ /** @internal */
539
886
  lastRefreshedAt: string | null;
887
+ /** @internal */
540
888
  error: string | null;
541
889
  }
542
890
 
891
+ /** @internal */
543
892
  export interface SkillCatalogItem {
893
+ /** @internal */
544
894
  repositoryId: string;
895
+ /** @internal */
545
896
  id: string;
897
+ /** @internal */
546
898
  label: string;
899
+ /** @internal */
547
900
  description: string | null;
901
+ /** @internal */
548
902
  sourcePath: string;
903
+ /** @internal */
549
904
  sourceRevision: string;
905
+ /** @internal */
550
906
  registered: boolean;
907
+ /** @internal */
551
908
  updateAvailable: boolean;
909
+ /** @internal */
552
910
  conflict: boolean;
911
+ /** @internal */
553
912
  stale: boolean;
913
+ /** @internal */
554
914
  modelInvocable: boolean;
915
+ /** @internal */
555
916
  usage: SkillUsageSummary;
556
917
  }
557
918
 
919
+ /** @internal */
558
920
  export type SkillRegistrationKind = "configuration" | "catalog";
559
921
 
922
+ /** @internal */
560
923
  export interface InstalledSkillCatalogItem {
924
+ /** @internal */
561
925
  id: string;
926
+ /** @internal */
562
927
  label: string;
928
+ /** @internal */
563
929
  description: string | null;
930
+ /** @internal */
564
931
  activeRevisionId: string;
932
+ /** @internal */
565
933
  activeSourceRevision: string | null;
934
+ /** @internal */
566
935
  registrationKind: SkillRegistrationKind;
936
+ /** @internal */
567
937
  sourceRepositoryId: string | null;
938
+ /** @internal */
568
939
  updateAvailable: boolean;
940
+ /** @internal */
569
941
  modelInvocable: boolean;
942
+ /** @internal */
570
943
  usage: SkillUsageSummary;
571
944
  }
572
945
 
946
+ /** @internal */
573
947
  export interface SkillRevisionSummary {
948
+ /** @internal */
574
949
  id: string;
950
+ /** @internal */
575
951
  sourceRevision: string | null;
952
+ /** @internal */
576
953
  importedAt: string;
954
+ /** @internal */
577
955
  active: boolean;
578
956
  }
579
957
 
958
+ /** @internal */
580
959
  export interface SkillUsageProcessSummary {
960
+ /** @internal */
581
961
  instanceId: string;
962
+ /** @internal */
582
963
  title: string;
964
+ /** @internal */
583
965
  attachedAt: string;
966
+ /** @internal */
584
967
  invocationCount: number;
968
+ /** @internal */
585
969
  lastInvokedAt: string | null;
586
970
  }
587
971
 
972
+ /** @internal */
588
973
  export interface SkillCatalogDetail extends SkillCatalogItem {
974
+ /** @internal */
589
975
  skillMarkdown: string;
976
+ /** @internal */
590
977
  processes: SkillUsageProcessSummary[];
591
978
  }
592
979
 
980
+ /** @internal */
593
981
  export interface InstalledSkillCatalogDetail extends InstalledSkillCatalogItem {
982
+ /** @internal */
594
983
  skillMarkdown: string;
984
+ /** @internal */
595
985
  processes: SkillUsageProcessSummary[];
986
+ /** @internal */
596
987
  revisions: SkillRevisionSummary[];
597
988
  }
598
989
 
599
- export type ErrorResponseBody = { error?: string | null; code?: string | null };
990
+ /** @internal */
991
+ export type ErrorResponseBody = {
992
+ /** @internal */
993
+ error?: string | null;
994
+ /** @internal */
995
+ code?: string | null;
996
+ };
600
997
 
998
+ /** @internal */
601
999
  export type ProcessesListResponseBody = {
1000
+ /** @internal */
602
1001
  processes: ProcessListItem[];
1002
+ /** @internal */
603
1003
  futureExecutions: FutureExecutionSummary[];
604
1004
  };
605
1005
 
1006
+ /** @internal */
606
1007
  export interface ProcessOverviewItem extends ProcessRowSlot {
1008
+ /** @internal */
607
1009
  processDisplayName: string | null;
608
- /** Nullable durable title before external-id/instance-id display fallback. */
1010
+ /** Nullable durable title before external-id/instance-id display fallback. @internal */
609
1011
  processTitle: string | null;
1012
+ /** @internal */
610
1013
  initialPromptPreview: string | null;
1014
+ /** @internal */
611
1015
  createdAt: string;
1016
+ /** @internal */
612
1017
  updatedAt: string;
1018
+ /** @internal */
613
1019
  closedAt: string | null;
614
1020
  }
615
1021
 
1022
+ /** @internal */
616
1023
  interface FutureExecutionOverviewItemBase
617
1024
  extends Omit<FutureExecutionBaseSummary, "kind" | "subtitle" | "modelSelection"> {
1025
+ /** @internal */
618
1026
  initialPromptPreview: string | null;
619
1027
  }
620
1028
 
1029
+ /** @internal */
621
1030
  export interface FutureLaunchOverviewItem extends FutureExecutionOverviewItemBase {
1031
+ /** @internal */
622
1032
  kind: "launch";
1033
+ /** @internal */
623
1034
  instanceId: null;
1035
+ /** @internal */
624
1036
  launcherId: string;
1037
+ /** @internal */
625
1038
  launcherLabel: string;
626
1039
  }
627
1040
 
1041
+ /** @internal */
628
1042
  export interface FutureActionOverviewItem extends FutureExecutionOverviewItemBase {
1043
+ /** @internal */
629
1044
  kind: "action";
1045
+ /** @internal */
630
1046
  instanceId: string;
1047
+ /** @internal */
631
1048
  actionId: string;
1049
+ /** @internal */
632
1050
  actionLabel: string;
633
1051
  }
634
1052
 
1053
+ /** @internal */
635
1054
  export type FutureExecutionOverviewItem = FutureLaunchOverviewItem | FutureActionOverviewItem;
636
1055
 
1056
+ /** @internal */
637
1057
  export interface ProcessesOverviewResponseBody {
1058
+ /** @internal */
638
1059
  processes: ProcessOverviewItem[];
1060
+ /** @internal */
639
1061
  futureExecutions: FutureExecutionOverviewItem[];
640
- /** True when the bounded sidebar response omitted less-recent rows. */
1062
+ /** True when the bounded sidebar response omitted less-recent rows. @internal */
641
1063
  truncated: boolean;
642
1064
  }
643
1065
 
1066
+ /** @internal */
644
1067
  export interface ProcessBrowsePagination {
1068
+ /** @internal */
645
1069
  limit: number;
1070
+ /** @internal */
646
1071
  offset: number;
1072
+ /** @internal */
647
1073
  total: number;
1074
+ /** @internal */
648
1075
  processTotal: number;
1076
+ /** @internal */
649
1077
  futureExecutionTotal: number;
1078
+ /** @internal */
650
1079
  hasMore: boolean;
651
1080
  }
652
1081
 
1082
+ /** @internal */
653
1083
  export interface ProcessBrowseFacets {
1084
+ /** @internal */
654
1085
  statusCounts: Record<
655
1086
  "all" | "running" | "scheduled" | "needs_attention" | "completed" | "aborted",
656
1087
  number
657
1088
  >;
658
- processTypes: Array<{ value: string; label: string; count: number }>;
1089
+ /** @internal */
1090
+ processTypes: Array<{
1091
+ /** @internal */
1092
+ value: string;
1093
+ /** @internal */
1094
+ label: string;
1095
+ /** @internal */
1096
+ count: number;
1097
+ }>;
659
1098
  }
660
1099
 
1100
+ /** @internal */
661
1101
  export type ProcessBrowseItem =
662
- | { kind: "process"; item: ProcessOverviewItem }
663
- | { kind: "future"; item: FutureExecutionOverviewItem };
664
-
1102
+ | {
1103
+ /** @internal */
1104
+ kind: "process";
1105
+ /** @internal */
1106
+ item: ProcessOverviewItem;
1107
+ }
1108
+ | {
1109
+ /** @internal */
1110
+ kind: "future";
1111
+ /** @internal */
1112
+ item: FutureExecutionOverviewItem;
1113
+ };
1114
+
1115
+ /** @internal */
665
1116
  export interface ProcessBrowseResponseBody {
666
- /** Globally sorted page. The browser must preserve this server-owned order. */
1117
+ /** Globally sorted page. The browser must preserve this server-owned order. @internal */
667
1118
  items: ProcessBrowseItem[];
1119
+ /** @internal */
668
1120
  pagination: ProcessBrowsePagination;
1121
+ /** @internal */
669
1122
  facets: ProcessBrowseFacets;
670
1123
  }
671
1124
 
1125
+ /** @internal */
672
1126
  export type TurnTraceToolCallSnapshot = Omit<PrimaryPathToolCallSnapshot, "result"> & {
1127
+ /** @internal */
673
1128
  resultText: string | null;
1129
+ /** @internal */
674
1130
  truncated: boolean;
675
1131
  };
676
1132
 
1133
+ /** @internal */
677
1134
  export type TurnPiInputPartRole = "user" | "system" | "unknown";
678
1135
 
1136
+ /** @internal */
679
1137
  export interface TurnPiInputPart {
1138
+ /** @internal */
680
1139
  role: TurnPiInputPartRole;
1140
+ /** @internal */
681
1141
  text: string;
1142
+ /** @internal */
682
1143
  createdAt: string;
683
1144
  }
684
1145
 
1146
+ /** @internal */
685
1147
  export interface TurnPiInputSnapshot {
1148
+ /** @internal */
686
1149
  parts: TurnPiInputPart[];
1150
+ /** @internal */
687
1151
  fullPrompt: string;
1152
+ /** @internal */
688
1153
  createdAt: string;
1154
+ /** @internal */
689
1155
  userInput?: string | null;
690
1156
  }
691
1157
 
1158
+ /** @internal */
692
1159
  export interface TurnTraceSnapshot {
1160
+ /** @internal */
693
1161
  assistant: PrimaryPathStreamingAssistantSnapshot;
1162
+ /** @internal */
694
1163
  toolCalls: TurnTraceToolCallSnapshot[];
1164
+ /** @internal */
695
1165
  traceItems: PrimaryPathTraceItemSnapshot[];
1166
+ /** @internal */
696
1167
  usage: TurnUsageSnapshot | null;
1168
+ /** @internal */
697
1169
  piInput: TurnPiInputSnapshot | null;
698
1170
  }
699
1171
 
1172
+ /** @internal */
700
1173
  export interface TurnTracePreview {
1174
+ /** @internal */
701
1175
  turnRecordId: string;
1176
+ /** @internal */
702
1177
  assistantTextPreview: string;
1178
+ /** @internal */
703
1179
  assistantTextTruncated: boolean;
1180
+ /** @internal */
704
1181
  thinkingPreview: string;
1182
+ /** @internal */
705
1183
  thinkingPreviewTruncated: boolean;
1184
+ /** @internal */
706
1185
  toolCallCount: number;
1186
+ /** @internal */
707
1187
  traceItemCount: number;
1188
+ /** @internal */
708
1189
  hasReasoningDetails: boolean;
1190
+ /** @internal */
709
1191
  usage: TurnUsageSnapshot | null;
710
- piInput: { createdAt: string | null; partCount: number; userInputPreview: string | null } | null;
1192
+ /** @internal */
1193
+ piInput: {
1194
+ /** @internal */
1195
+ createdAt: string | null;
1196
+ /** @internal */
1197
+ partCount: number;
1198
+ /** @internal */
1199
+ userInputPreview: string | null;
1200
+ } | null;
711
1201
  }
712
1202
 
1203
+ /** @internal */
713
1204
  export type ProcessTimelineTurnPresentation =
714
1205
  | "llm_turn"
715
1206
  | "automatic_turn"
716
1207
  | "operator_decision"
717
1208
  | "external_trigger";
718
1209
 
1210
+ /** @internal */
719
1211
  export interface ProcessTimelineTurnSummary {
1212
+ /** @internal */
720
1213
  id: string;
1214
+ /** @internal */
721
1215
  turnId: string;
1216
+ /** @internal */
722
1217
  turnType: ProcessTurnType;
1218
+ /** @internal */
723
1219
  displayTurn: string;
1220
+ /** @internal */
724
1221
  outcome: string;
1222
+ /** @internal */
725
1223
  summary: string;
1224
+ /** @internal */
726
1225
  output: string;
1226
+ /** @internal */
727
1227
  turnResultMarkdown: string;
1228
+ /** @internal */
728
1229
  resultSummary?: string;
1230
+ /** @internal */
729
1231
  reviewedTurnRecordId?: string;
1232
+ /** @internal */
730
1233
  resources?: import("@leitwerk-dev/domain").TurnProgressLink[];
731
- transition?: { selectedTurnId: string; targetTurnRecordId?: string; accepted: boolean };
1234
+ /** @internal */
1235
+ transition?: {
1236
+ /** @internal */
1237
+ selectedTurnId: string;
1238
+ /** @internal */
1239
+ targetTurnRecordId?: string;
1240
+ /** @internal */
1241
+ accepted: boolean;
1242
+ };
1243
+ /** @internal */
732
1244
  pathType: ProcessTurnRecord["pathType"];
1245
+ /** @internal */
733
1246
  createdAt: string;
1247
+ /** @internal */
734
1248
  presentation: ProcessTimelineTurnPresentation;
1249
+ /** @internal */
735
1250
  status: "completed" | "in_progress";
1251
+ /** @internal */
736
1252
  modelProfileId: string | null;
737
- /** Durable lineage needed by the chronicle rail and input correlation. */
1253
+ /** Durable lineage needed by the chronicle rail and input correlation. @internal */
738
1254
  attemptNumber: number;
1255
+ /** @internal */
739
1256
  parentTurnRecordId: string | null;
1257
+ /** @internal */
740
1258
  startedAt: string;
1259
+ /** @internal */
741
1260
  endedAt: string | null;
1261
+ /** @internal */
742
1262
  actionSource: "ui" | "external" | "scheduled" | null;
1263
+ /** @internal */
743
1264
  progress?: TurnProgressReport | null;
1265
+ /** @internal */
744
1266
  progressRecordedAt?: string;
745
1267
  }
746
1268
 
1269
+ /** @internal */
747
1270
  export type ProcessTimelineInputSummary = Pick<
748
1271
  ProcessInput,
749
1272
  "id" | "sequence" | "source" | "kind" | "bodyMarkdown" | "receivedAt" | "consumedAt"
750
1273
  >;
751
1274
 
1275
+ /** @internal */
752
1276
  export interface ProcessExternalObservation {
1277
+ /** @internal */
753
1278
  summary: string;
1279
+ /** @internal */
754
1280
  links?: import("@leitwerk-dev/domain").TurnProgressLink[];
1281
+ /** @internal */
755
1282
  observedAt: string;
1283
+ /** @internal */
756
1284
  subject: string;
1285
+ /** @internal */
757
1286
  revision: string;
758
1287
  }
759
1288
 
1289
+ /** @internal */
760
1290
  export interface ProcessExternalTriggerSignal {
1291
+ /** @internal */
761
1292
  observation?: ProcessExternalObservation;
1293
+ /** @internal */
762
1294
  refreshError?: string | null;
1295
+ /** @internal */
763
1296
  refreshedAt?: string;
1297
+ /** @internal */
764
1298
  triggerId: string;
1299
+ /** @internal */
765
1300
  state: "error" | "armed" | "triggered" | "waiting";
1301
+ /** @internal */
766
1302
  occurredAt: string | null;
1303
+ /** @internal */
767
1304
  secondaryDetail: string | null;
768
1305
  }
769
1306
 
1307
+ /** @internal */
770
1308
  export interface ProcessTimelineSnapshot {
771
- prompt: { text: string | null; createdAt: string | null };
1309
+ /** @internal */
1310
+ prompt: {
1311
+ /** @internal */
1312
+ text: string | null;
1313
+ /** @internal */
1314
+ createdAt: string | null;
1315
+ };
1316
+ /** @internal */
772
1317
  turns: ProcessTimelineTurnSummary[];
1318
+ /** @internal */
773
1319
  tracePreviewsByTurnRecordId: Record<string, TurnTracePreview>;
1320
+ /** @internal */
774
1321
  inputs: ProcessTimelineInputSummary[];
1322
+ /** @internal */
775
1323
  externalTriggerSignals: ProcessExternalTriggerSignal[];
776
1324
  }
777
1325
 
1326
+ /** @internal */
778
1327
  export interface CurrentErrorSummary {
1328
+ /** @internal */
779
1329
  title: string;
1330
+ /** @internal */
780
1331
  summary: string;
1332
+ /** @internal */
781
1333
  guidance?: string;
1334
+ /** @internal */
782
1335
  technicalDetail?: string | null;
783
1336
  }
784
1337
 
1338
+ /** @internal */
785
1339
  export interface CurrentTurnRecoverySummary extends CurrentErrorSummary {
1340
+ /** @internal */
786
1341
  turnRecordId: string;
1342
+ /** @internal */
787
1343
  defaultContinuePrompt: string;
1344
+ /** @internal */
788
1345
  canContinue: boolean;
1346
+ /** @internal */
789
1347
  supportsModelOverride: boolean;
1348
+ /** @internal */
790
1349
  defaultModelProfileId: string | null;
1350
+ /** @internal */
791
1351
  providerOptions: Record<string, string>;
792
1352
  }
793
1353
 
1354
+ /** @internal */
794
1355
  export interface StartupRecoverySummary extends CurrentErrorSummary {
1356
+ /** @internal */
795
1357
  startRecordId: string;
1358
+ /** @internal */
796
1359
  kind: "preparation_failed" | "bootstrap_failed";
1360
+ /** @internal */
797
1361
  action: "choose_model" | "retry_startup";
1362
+ /** @internal */
798
1363
  defaultModelProfileId: string | null;
1364
+ /** @internal */
799
1365
  providerOptions: Record<string, string>;
800
1366
  }
801
1367
 
1368
+ /** @internal */
802
1369
  export type StartupAttemptStatus = "starting" | "failed" | "succeeded" | "recovered" | "superseded";
803
1370
 
1371
+ /** @internal */
804
1372
  export interface StartupAttemptStepSummary {
805
- /** Observed phase interval; absent for older servers or unavailable evidence. */
1373
+ /** Observed phase interval; absent for older servers or unavailable evidence. @internal */
806
1374
  startedAt?: string | null;
1375
+ /** @internal */
807
1376
  endedAt?: string | null;
1377
+ /** @internal */
808
1378
  detail?: string;
1379
+ /** @internal */
809
1380
  id: "start_worker" | "connect_worker" | "prepare_workspace" | "start_first_turn";
1381
+ /** @internal */
810
1382
  label: string;
1383
+ /** @internal */
811
1384
  status: "pending" | "in_progress" | "completed" | "failed" | "superseded";
1385
+ /** @internal */
812
1386
  occurredAt: string | null;
813
1387
  }
814
1388
 
815
- /** Worker-start history derived from correlated start, lease, readiness, and turn records. */
1389
+ /** Worker-start history derived from correlated start, lease, readiness, and turn records. @internal */
816
1390
  export interface StartupAttemptSummary {
1391
+ /** @internal */
817
1392
  startRecordId: string;
1393
+ /** @internal */
818
1394
  workerLeaseId: string | null;
1395
+ /** @internal */
819
1396
  status: StartupAttemptStatus;
1397
+ /** @internal */
820
1398
  startedAt: string;
1399
+ /** @internal */
821
1400
  readyAt: string | null;
1401
+ /** @internal */
822
1402
  durationMs: number | null;
1403
+ /** @internal */
823
1404
  summary: string | null;
1405
+ /** @internal */
824
1406
  recoveredByStartRecordId: string | null;
1407
+ /** @internal */
825
1408
  steps: StartupAttemptStepSummary[];
826
1409
  }
827
1410
 
1411
+ /** @internal */
828
1412
  export interface ProcessStartupSummary {
1413
+ /** @internal */
829
1414
  workerStarts?: import("@leitwerk-dev/domain").PhysicalWorkerStart[];
1415
+ /** @internal */
830
1416
  authoritativeAttemptId: string | null;
1417
+ /** @internal */
831
1418
  attempts: StartupAttemptSummary[];
1419
+ /** @internal */
832
1420
  recovery: StartupRecoverySummary | null;
833
1421
  }
834
1422
 
1423
+ /** @internal */
835
1424
  export type CurrentProcessErrorSummary = CurrentErrorSummary;
836
1425
 
1426
+ /** @internal */
837
1427
  export interface ProcessUsageEstimateSnapshot {
1428
+ /** @internal */
838
1429
  usage: TurnUsageSnapshot;
1430
+ /** @internal */
839
1431
  includesLiveTurn: boolean;
1432
+ /** @internal */
840
1433
  totalLlmTurnCount: number;
1434
+ /** @internal */
841
1435
  coveredTurnCount: number;
1436
+ /** @internal */
842
1437
  missingUsageTurnCount: number;
1438
+ /** @internal */
843
1439
  missingCostTurnCount: number;
1440
+ /** @internal */
844
1441
  isPartial: boolean;
845
1442
  }
846
1443
 
1444
+ /** @internal */
847
1445
  export interface PrimaryPathUiSnapshot extends Omit<PrimaryPathSnapshot, "turnState"> {
1446
+ /** @internal */
848
1447
  throughEventSequence: number;
1448
+ /** @internal */
849
1449
  turnState: Omit<PrimaryPathSnapshot["turnState"], "activeTurn"> & {
1450
+ /** @internal */
850
1451
  activeTurn: CompactActiveTurnSnapshot | null;
851
1452
  };
1453
+ /** @internal */
852
1454
  entryCount: number;
1455
+ /** @internal */
853
1456
  entriesOmitted: true;
854
1457
  }
855
1458
 
1459
+ /** @internal */
856
1460
  export type ProcessUiSnapshotProcess = Pick<
857
1461
  ProcessInstance,
858
1462
  | "id"
@@ -875,163 +1479,296 @@ export type ProcessUiSnapshotProcess = Pick<
875
1479
  * session entries, projects, and full durable records belong to diagnostics;
876
1480
  * this DTO carries only browser-facing projections.
877
1481
  */
1482
+ /** @internal */
878
1483
  export interface ProcessDetailUiSnapshotResponseBody {
1484
+ /** @internal */
879
1485
  process: ProcessUiSnapshotProcess;
880
- /** Next turn on the declared happy path, including human decisions. */
1486
+ /** Next turn on the declared happy path, including human decisions. @internal */
881
1487
  plannedNextTurn?: Pick<ProcessSelectedTurnSummary, "turnId" | "description"> | null;
882
- /** Durable requests in Chronicle order; at most one is open for the current turn. */
1488
+ /** Durable requests in Chronicle order; at most one is open for the current turn. @internal */
883
1489
  questionRequests: ProcessQuestionRequest[];
1490
+ /** @internal */
884
1491
  toolApprovalRequests: ProcessToolApprovalRequest[];
1492
+ /** @internal */
885
1493
  leafOutcomeSnapshots: ProcessLeafOutcomeSnapshot[];
1494
+ /** @internal */
886
1495
  processDisplayName: string | null;
1496
+ /** @internal */
887
1497
  processFlow: ProcessFlowView;
1498
+ /** @internal */
888
1499
  definesLeafOutcome: boolean;
1500
+ /** @internal */
889
1501
  selectedTurn: ProcessSelectedTurnSummary | null;
1502
+ /** @internal */
890
1503
  scheduledAction: ScheduledActionDetail | null;
1504
+ /** @internal */
891
1505
  modelConfiguration: ProcessModelConfigurationView;
1506
+ /** @internal */
892
1507
  runDetails: ProcessRunDetailsView;
1508
+ /** @internal */
893
1509
  launchConfiguration: ProcessLaunchConfigurationView;
1510
+ /** @internal */
894
1511
  actions: ProcessActionSummary[];
1512
+ /** @internal */
895
1513
  toolRenderers: ToolCallRendererDefinition[];
1514
+ /** @internal */
896
1515
  primaryPath: PrimaryPathUiSnapshot;
1516
+ /** @internal */
897
1517
  timeline: ProcessTimelineSnapshot;
1518
+ /** @internal */
898
1519
  instanceTree: ProcessInstanceTreeResponseBody;
1520
+ /** @internal */
899
1521
  recovery: CurrentTurnRecoverySummary | null;
900
- /** Authoritative startup history and current remediation. */
1522
+ /** Authoritative startup history and current remediation. @internal */
901
1523
  startup: ProcessStartupSummary;
902
- /** Compatibility alias for startup.recovery. */
1524
+ /** Compatibility alias for startup.recovery. @internal */
903
1525
  startupRecovery: StartupRecoverySummary | null;
1526
+ /** @internal */
904
1527
  processError: CurrentProcessErrorSummary | null;
1528
+ /** @internal */
905
1529
  usageEstimate: ProcessUsageEstimateSnapshot | null;
1530
+ /** @internal */
906
1531
  persistedModelSelectionWarning: string | null;
907
- session: { signature: string | null };
1532
+ /** @internal */
1533
+ session: {
1534
+ /** @internal */
1535
+ signature: string | null;
1536
+ };
1537
+ /** @internal */
908
1538
  sessionTransfer: SessionTransferOperationView | null;
909
1539
  }
910
1540
 
1541
+ /** @internal */
911
1542
  export type InstanceTreeTurnResultState = "succeeded" | "failed" | "aborted" | "pending";
912
1543
 
913
- /** Redacted, semantic process history. Pi message/activity categories are never exposed. */
1544
+ /** Redacted, semantic process history. Pi message/activity categories are never exposed. @internal */
914
1545
  export interface InstanceTreeNodeSummary {
1546
+ /** @internal */
915
1547
  id: string;
1548
+ /** @internal */
916
1549
  parentId: string | null;
1550
+ /** @internal */
917
1551
  label: string;
1552
+ /** @internal */
918
1553
  pathType: "primary" | "root_branch" | "leaf_branch";
1554
+ /** @internal */
919
1555
  resultState: InstanceTreeTurnResultState;
1556
+ /** @internal */
920
1557
  timestamp: string;
921
1558
  }
922
1559
 
1560
+ /** @internal */
923
1561
  export interface InstanceTreeEdgeSummary {
1562
+ /** @internal */
924
1563
  id: string;
1564
+ /** @internal */
925
1565
  sourceNodeId: string;
1566
+ /** @internal */
926
1567
  targetNodeId: string | null;
1568
+ /** @internal */
927
1569
  hasContext: boolean;
1570
+ /** @internal */
928
1571
  productLabels: readonly string[];
1572
+ /** @internal */
929
1573
  actionLabel: string | null;
1574
+ /** @internal */
930
1575
  endState: "not_applied" | "completed" | null;
931
1576
  }
932
1577
 
1578
+ /** @internal */
933
1579
  export interface ProcessInstanceTreeResponseBody {
1580
+ /** @internal */
934
1581
  currentLeafId: string | null;
1582
+ /** @internal */
935
1583
  nodes: InstanceTreeNodeSummary[];
1584
+ /** @internal */
936
1585
  edges: InstanceTreeEdgeSummary[];
937
1586
  }
938
1587
 
1588
+ /** @internal */
939
1589
  export interface TurnReasoningDetailResponseBody {
1590
+ /** @internal */
940
1591
  state: "live" | "committed";
1592
+ /** @internal */
941
1593
  throughEventSequence: number;
1594
+ /** @internal */
942
1595
  instanceId: string;
1596
+ /** @internal */
943
1597
  turnRecordId: string;
1598
+ /** @internal */
944
1599
  sessionSignature: string | null;
1600
+ /** @internal */
945
1601
  reasoning: TurnTraceSnapshot;
946
1602
  }
947
1603
 
1604
+ /** @internal */
948
1605
  export interface SubmitQuestionAnswersRequestBody {
1606
+ /** @internal */
949
1607
  draft: QuestionAnswerDraft[];
950
1608
  }
951
1609
 
1610
+ /** @internal */
952
1611
  export type QuestionRequestMutationResponseBody = {
1612
+ /** @internal */
953
1613
  request: ProcessQuestionRequest;
954
1614
  };
955
1615
 
1616
+ /** @internal */
956
1617
  export type FutureExecutionDetailResponseBody = FutureExecutionSummary;
957
1618
 
958
- export type LaunchersResponseBody = { launchers: UiLauncherSummary[] };
1619
+ /** @internal */
1620
+ export type LaunchersResponseBody = {
1621
+ /** @internal */
1622
+ launchers: UiLauncherSummary[];
1623
+ };
959
1624
 
960
- export type WatchersResponseBody = { watchers: WatcherSummary[] };
961
- export type SkillCatalogDetailResponseBody = { skill: SkillCatalogDetail };
962
- export type InstalledSkillCatalogDetailResponseBody = { skill: InstalledSkillCatalogDetail };
1625
+ /** @internal */
1626
+ export type WatchersResponseBody = {
1627
+ /** @internal */
1628
+ watchers: WatcherSummary[];
1629
+ };
1630
+ /** @internal */
1631
+ export type SkillCatalogDetailResponseBody = {
1632
+ /** @internal */
1633
+ skill: SkillCatalogDetail;
1634
+ };
1635
+ /** @internal */
1636
+ export type InstalledSkillCatalogDetailResponseBody = {
1637
+ /** @internal */
1638
+ skill: InstalledSkillCatalogDetail;
1639
+ };
1640
+ /** @internal */
963
1641
  export type SkillsCatalogResponseBody = {
1642
+ /** @internal */
964
1643
  repositories: SkillRepositorySummary[];
1644
+ /** @internal */
965
1645
  availableSkills: SkillCatalogItem[];
1646
+ /** @internal */
966
1647
  installedSkills: InstalledSkillCatalogItem[];
967
1648
  };
968
1649
 
1650
+ /** @internal */
969
1651
  export interface LauncherDefaultsResponseBody {
1652
+ /** @internal */
970
1653
  defaults: Record<string, unknown>;
1654
+ /** @internal */
971
1655
  title: string | null;
1656
+ /** @internal */
972
1657
  modelConfig: LauncherModelConfigDefaults;
1658
+ /** @internal */
973
1659
  warnings?: LauncherValidationError[];
974
1660
  }
975
1661
 
1662
+ /** @internal */
976
1663
  export type LauncherOptionsResponseBody = {
1664
+ /** @internal */
977
1665
  options: Record<string, readonly FormFieldOptionDefinition[]>;
978
1666
  };
979
1667
 
1668
+ /** @internal */
980
1669
  export type LauncherRecentValuesResponseBody = {
1670
+ /** @internal */
981
1671
  values: Record<string, readonly string[]>;
982
1672
  };
983
1673
 
984
- export type LauncherModelConfigPreviewResponseBody = { preview: LauncherModelConfigPreview };
1674
+ /** @internal */
1675
+ export type LauncherModelConfigPreviewResponseBody = {
1676
+ /** @internal */
1677
+ preview: LauncherModelConfigPreview;
1678
+ };
985
1679
 
1680
+ /** @internal */
986
1681
  export interface LauncherMutationResponseBody {
1682
+ /** @internal */
987
1683
  kind?: "scheduled";
1684
+ /** @internal */
988
1685
  process?: ProcessInstance | null;
1686
+ /** @internal */
989
1687
  futureExecution?: FutureLaunchSummary | null;
1688
+ /** @internal */
990
1689
  projects?: ProcessProject[];
1690
+ /** @internal */
991
1691
  errors?: LauncherValidationError[];
1692
+ /** @internal */
992
1693
  error?: string | null;
993
1694
  }
994
1695
 
1696
+ /** @internal */
995
1697
  export interface FutureLaunchMutationResponseBody {
1698
+ /** @internal */
996
1699
  kind: "scheduled";
1700
+ /** @internal */
997
1701
  futureExecution: FutureLaunchSummary | null;
1702
+ /** @internal */
998
1703
  error?: string | null;
999
1704
  }
1000
1705
 
1706
+ /** @internal */
1001
1707
  export type ScheduledActionMutationResponseBody = {
1708
+ /** @internal */
1002
1709
  kind?: "scheduled";
1710
+ /** @internal */
1003
1711
  scheduledAction?: ScheduledActionDetail | null;
1712
+ /** @internal */
1004
1713
  error?: string | null;
1005
1714
  };
1006
1715
 
1716
+ /** @internal */
1007
1717
  export type ProcessRetryConfigResponseBody = ProcessRetryConfig;
1008
1718
 
1009
- export type ProcessActionModelPreviewResponseBody = { preview: ProcessActionModelPreview };
1719
+ /** @internal */
1720
+ export type ProcessActionModelPreviewResponseBody = {
1721
+ /** @internal */
1722
+ preview: ProcessActionModelPreview;
1723
+ };
1010
1724
 
1725
+ /** @internal */
1011
1726
  export type ProcessDiagnosticsResponseBody = ProcessDiagnosticsData;
1012
1727
 
1728
+ /** @internal */
1013
1729
  export type PrimaryPathSnapshotResponseBody = PrimaryPathSnapshot;
1014
1730
 
1015
- export type CronPreviewResponseBody = { nextRunAt: string };
1731
+ /** @internal */
1732
+ export type CronPreviewResponseBody = {
1733
+ /** @internal */
1734
+ nextRunAt: string;
1735
+ };
1016
1736
 
1737
+ /** @internal */
1017
1738
  export type ParsedLauncherRequestBody = {
1739
+ /** @internal */
1018
1740
  title: string | null;
1741
+ /** @internal */
1019
1742
  titleProvided: boolean;
1743
+ /** @internal */
1020
1744
  launcherInput: Record<string, unknown>;
1745
+ /** @internal */
1021
1746
  launcherInputProvided: boolean;
1747
+ /** @internal */
1022
1748
  skillIds?: string[];
1749
+ /** @internal */
1023
1750
  modelConfig: LauncherModelConfigDefaults;
1751
+ /** @internal */
1024
1752
  modelConfigProvided: boolean;
1753
+ /** @internal */
1025
1754
  schedule: ParsedScheduleRequest;
1755
+ /** @internal */
1026
1756
  scheduleProvided: boolean;
1027
1757
  };
1028
1758
 
1759
+ /** @internal */
1029
1760
  export type ParsedActionRequestBody = {
1761
+ /** @internal */
1030
1762
  input: Record<string, unknown>;
1763
+ /** @internal */
1031
1764
  inputProvided: boolean;
1765
+ /** @internal */
1032
1766
  nextTurnModelProfileId?: string | null;
1767
+ /** @internal */
1033
1768
  nextTurnModelProfileIdProvided: boolean;
1769
+ /** @internal */
1034
1770
  schedule: ParsedScheduleRequest;
1771
+ /** @internal */
1035
1772
  scheduleProvided: boolean;
1036
1773
  };
1037
1774
 
@@ -1057,25 +1794,45 @@ const actionStructuredBodySchema = v.strictObject({
1057
1794
  schedule: v.optional(v.unknown()),
1058
1795
  });
1059
1796
  const futureLaunchPayloadInputSchema = v.object({
1797
+ /** @internal */
1060
1798
  launcherInput: v.optional(v.nullable(unknownRecordSchema)),
1799
+ /** @internal */
1061
1800
  modelConfig: v.optional(v.unknown()),
1801
+ /** @internal */
1062
1802
  actor: v.optional(v.nullable(unknownRecordSchema)),
1803
+ /** @internal */
1063
1804
  launchPlan: v.object({
1805
+ /** @internal */
1064
1806
  launcherId: v.string(),
1807
+ /** @internal */
1065
1808
  processId: v.string(),
1809
+ /** @internal */
1066
1810
  handoffDedupKey: optionalNullableStringSchema,
1811
+ /** @internal */
1067
1812
  processInput: v.object({
1813
+ /** @internal */
1068
1814
  processId: v.string(),
1815
+ /** @internal */
1069
1816
  selectedTurnId: optionalNullableStringSchema,
1817
+ /** @internal */
1070
1818
  lifecycleStatus: v.picklist(PROCESS_LIFECYCLE_STATUSES),
1819
+ /** @internal */
1071
1820
  title: optionalNullableStringSchema,
1821
+ /** @internal */
1072
1822
  externalId: optionalNullableStringSchema,
1823
+ /** @internal */
1073
1824
  externalUrl: optionalNullableStringSchema,
1825
+ /** @internal */
1074
1826
  metadata: v.optional(v.nullable(unknownRecordSchema)),
1827
+ /** @internal */
1075
1828
  defaultModelProfileId: optionalNullableStringSchema,
1829
+ /** @internal */
1076
1830
  turnConfigsJson: optionalNullableStringSchema,
1831
+ /** @internal */
1077
1832
  selectedTurnModelProfileId: optionalNullableStringSchema,
1833
+ /** @internal */
1078
1834
  selectedTurnModelKind: v.optional(v.nullable(v.picklist(["explicit", "inherited"]))),
1835
+ /** @internal */
1079
1836
  selectedTurnModelSource: v.optional(
1080
1837
  v.nullable(
1081
1838
  v.picklist([
@@ -1090,116 +1847,230 @@ const futureLaunchPayloadInputSchema = v.object({
1090
1847
  ]),
1091
1848
  ),
1092
1849
  ),
1850
+ /** @internal */
1093
1851
  paramsJson: optionalNullableStringSchema,
1852
+ /** @internal */
1094
1853
  stateJson: optionalNullableStringSchema,
1095
1854
  }),
1855
+ /** @internal */
1096
1856
  titleSourceFields: v.optional(
1097
- v.nullable(v.array(v.object({ label: v.string(), value: v.string() }))),
1857
+ v.nullable(
1858
+ v.array(
1859
+ v.object({
1860
+ /** @internal */
1861
+ label: v.string(),
1862
+ /** @internal */
1863
+ value: v.string(),
1864
+ }),
1865
+ ),
1866
+ ),
1098
1867
  ),
1868
+ /** @internal */
1099
1869
  projectInputs: v.optional(
1100
1870
  v.nullable(
1101
1871
  v.array(
1102
1872
  v.object({
1873
+ /** @internal */
1103
1874
  key: v.string(),
1875
+ /** @internal */
1104
1876
  repoLocator: v.string(),
1877
+ /** @internal */
1105
1878
  baseBranch: v.string(),
1879
+ /** @internal */
1106
1880
  workBranch: optionalNullableStringSchema,
1881
+ /** @internal */
1107
1882
  externalId: optionalNullableStringSchema,
1883
+ /** @internal */
1108
1884
  externalUrl: optionalNullableStringSchema,
1885
+ /** @internal */
1109
1886
  metadata: v.optional(v.nullable(unknownRecordSchema)),
1110
1887
  }),
1111
1888
  ),
1112
1889
  ),
1113
1890
  ),
1891
+ /** @internal */
1114
1892
  startTurnId: optionalNullableStringSchema,
1115
1893
  }),
1894
+ /** @internal */
1116
1895
  selectedSkillIds: v.optional(v.array(v.string())),
1896
+ /** @internal */
1117
1897
  resourceSelections: v.optional(
1118
- v.array(v.object({ skillId: v.string(), revisionId: v.string() })),
1898
+ v.array(
1899
+ v.object({
1900
+ /** @internal */
1901
+ skillId: v.string(),
1902
+ /** @internal */
1903
+ revisionId: v.string(),
1904
+ }),
1905
+ ),
1119
1906
  ),
1120
1907
  });
1121
1908
  const futureActionPayloadInputSchema = v.object({
1909
+ /** @internal */
1122
1910
  input: v.optional(v.nullable(unknownRecordSchema)),
1911
+ /** @internal */
1123
1912
  nextTurnModelProfileId: optionalNullableStringSchema,
1913
+ /** @internal */
1124
1914
  actionLabel: optionalNullableStringSchema,
1915
+ /** @internal */
1125
1916
  actor: v.optional(v.nullable(unknownRecordSchema)),
1126
1917
  });
1127
1918
 
1919
+ /** @internal */
1128
1920
  export type ParsedScheduleRequest =
1129
- | { mode: "now" }
1130
- | { mode: "once"; runAt: string }
1131
- | { mode: "cron"; cronExpression: string };
1921
+ | {
1922
+ /** @internal */
1923
+ mode: "now";
1924
+ }
1925
+ | {
1926
+ /** @internal */
1927
+ mode: "once";
1928
+ /** @internal */
1929
+ runAt: string;
1930
+ }
1931
+ | {
1932
+ /** @internal */
1933
+ mode: "cron";
1934
+ /** @internal */
1935
+ cronExpression: string;
1936
+ };
1937
+ /** @internal */
1132
1938
  type ValidatedScheduleRequest =
1133
- | { mode: "now"; nextRunAt: null; cronExpression: null }
1134
- | { mode: "once"; nextRunAt: string; cronExpression: null }
1135
- | { mode: "cron"; nextRunAt: string; cronExpression: string };
1939
+ | {
1940
+ /** @internal */
1941
+ mode: "now";
1942
+ /** @internal */
1943
+ nextRunAt: null;
1944
+ /** @internal */
1945
+ cronExpression: null;
1946
+ }
1947
+ | {
1948
+ /** @internal */
1949
+ mode: "once";
1950
+ /** @internal */
1951
+ nextRunAt: string;
1952
+ /** @internal */
1953
+ cronExpression: null;
1954
+ }
1955
+ | {
1956
+ /** @internal */
1957
+ mode: "cron";
1958
+ /** @internal */
1959
+ nextRunAt: string;
1960
+ /** @internal */
1961
+ cronExpression: string;
1962
+ };
1136
1963
 
1137
1964
  type FutureLaunchPayloadBase = v.InferOutput<typeof futureLaunchPayloadInputSchema>;
1138
1965
  type FutureActionPayloadBase = v.InferOutput<typeof futureActionPayloadInputSchema>;
1139
1966
  const cloneUnknownRecord = (value?: Record<string, unknown> | null) =>
1140
1967
  value ? { ...value } : null;
1968
+ /** @internal */
1141
1969
  const normalizeFutureLaunchPayload = (payload: FutureLaunchPayloadBase) => {
1142
1970
  const modelConfig = normalizeLaunchModelConfigInput(
1143
1971
  (payload.modelConfig ?? {}) as LaunchModelConfigInput,
1144
1972
  );
1145
1973
  return {
1974
+ /** @internal */
1146
1975
  launcherInput: cloneUnknownRecord(payload.launcherInput) ?? {},
1976
+ /** @internal */
1147
1977
  modelConfig: {
1978
+ /** @internal */
1148
1979
  defaultModelProfileId: modelConfig.defaultModelProfileId ?? null,
1980
+ /** @internal */
1149
1981
  turnConfigs: { ...modelConfig.turnConfigs },
1150
1982
  },
1983
+ /** @internal */
1151
1984
  actor: normalizeActor(payload.actor),
1985
+ /** @internal */
1152
1986
  selectedSkillIds: [
1153
1987
  ...(payload.selectedSkillIds ??
1154
1988
  payload.resourceSelections?.map(({ skillId }) => skillId) ??
1155
1989
  []),
1156
1990
  ],
1991
+ /** @internal */
1157
1992
  resourceSelections: (payload.resourceSelections ?? []).map((selection) => ({ ...selection })),
1993
+ /** @internal */
1158
1994
  launchPlan: {
1995
+ /** @internal */
1159
1996
  launcherId: payload.launchPlan.launcherId,
1997
+ /** @internal */
1160
1998
  processId: payload.launchPlan.processId,
1999
+ /** @internal */
1161
2000
  handoffDedupKey: trimToNull(payload.launchPlan.handoffDedupKey) ?? null,
2001
+ /** @internal */
1162
2002
  processInput: {
2003
+ /** @internal */
1163
2004
  processId: payload.launchPlan.processInput.processId,
2005
+ /** @internal */
1164
2006
  selectedTurnId: payload.launchPlan.processInput.selectedTurnId ?? null,
2007
+ /** @internal */
1165
2008
  lifecycleStatus: payload.launchPlan.processInput.lifecycleStatus,
2009
+ /** @internal */
1166
2010
  title: payload.launchPlan.processInput.title ?? null,
2011
+ /** @internal */
1167
2012
  externalId: payload.launchPlan.processInput.externalId ?? null,
2013
+ /** @internal */
1168
2014
  externalUrl: payload.launchPlan.processInput.externalUrl ?? null,
2015
+ /** @internal */
1169
2016
  metadata: cloneUnknownRecord(payload.launchPlan.processInput.metadata),
2017
+ /** @internal */
1170
2018
  defaultModelProfileId: payload.launchPlan.processInput.defaultModelProfileId ?? null,
2019
+ /** @internal */
1171
2020
  turnConfigsJson: payload.launchPlan.processInput.turnConfigsJson ?? null,
2021
+ /** @internal */
1172
2022
  selectedTurnModelProfileId:
1173
2023
  payload.launchPlan.processInput.selectedTurnModelProfileId ?? null,
2024
+ /** @internal */
1174
2025
  selectedTurnModelKind: payload.launchPlan.processInput.selectedTurnModelKind ?? null,
2026
+ /** @internal */
1175
2027
  selectedTurnModelSource: payload.launchPlan.processInput.selectedTurnModelSource ?? null,
2028
+ /** @internal */
1176
2029
  paramsJson: payload.launchPlan.processInput.paramsJson ?? null,
2030
+ /** @internal */
1177
2031
  stateJson: payload.launchPlan.processInput.stateJson ?? null,
1178
2032
  },
2033
+ /** @internal */
1179
2034
  titleSourceFields: (payload.launchPlan.titleSourceFields ?? []).map((field) => ({
1180
2035
  ...field,
1181
2036
  })),
2037
+ /** @internal */
1182
2038
  projectInputs: (payload.launchPlan.projectInputs ?? []).map((project) => ({
2039
+ /** @internal */
1183
2040
  key: project.key,
2041
+ /** @internal */
1184
2042
  repoLocator: project.repoLocator,
2043
+ /** @internal */
1185
2044
  baseBranch: project.baseBranch,
2045
+ /** @internal */
1186
2046
  workBranch: project.workBranch ?? null,
2047
+ /** @internal */
1187
2048
  externalId: project.externalId ?? null,
2049
+ /** @internal */
1188
2050
  externalUrl: project.externalUrl ?? null,
2051
+ /** @internal */
1189
2052
  metadata: cloneUnknownRecord(project.metadata),
1190
2053
  })),
2054
+ /** @internal */
1191
2055
  startTurnId: payload.launchPlan.startTurnId ?? null,
1192
2056
  },
1193
2057
  };
1194
2058
  };
2059
+ /** @internal */
1195
2060
  const normalizeFutureActionPayload = (payload: FutureActionPayloadBase) => ({
2061
+ /** @internal */
1196
2062
  input: cloneUnknownRecord(payload.input) ?? {},
2063
+ /** @internal */
1197
2064
  nextTurnModelProfileId: trimToNull(payload.nextTurnModelProfileId) ?? null,
2065
+ /** @internal */
1198
2066
  actionLabel: trimToNull(payload.actionLabel) ?? null,
2067
+ /** @internal */
1199
2068
  actor: normalizeActor(payload.actor),
1200
2069
  });
1201
2070
 
2071
+ /** @internal */
1202
2072
  export type FutureLaunchPayload = ReturnType<typeof normalizeFutureLaunchPayload>;
2073
+ /** @internal */
1203
2074
  export type FutureActionPayload = ReturnType<typeof normalizeFutureActionPayload>;
1204
2075
 
1205
2076
  function parseJsonPayload(payloadJson: string, context: string): ParseResult<unknown> {
@@ -1235,6 +2106,7 @@ function parseLauncherTurnConfigMap(
1235
2106
  return ok(turnConfigs);
1236
2107
  }
1237
2108
 
2109
+ /** @internal */
1238
2110
  export function parseScheduleRequestInput(value: unknown): ParseResult<ParsedScheduleRequest> {
1239
2111
  if (value === undefined || value === null) {
1240
2112
  return ok({ mode: "now" });
@@ -1259,11 +2131,14 @@ export function parseScheduleRequestInput(value: unknown): ParseResult<ParsedSch
1259
2131
  : err("cronExpression is required for cron schedules");
1260
2132
  }
1261
2133
 
2134
+ /** @internal */
1262
2135
  export function validateScheduleRequestInput(
1263
2136
  schedule: ParsedScheduleRequest,
1264
2137
  allowedModes: readonly ScheduleMode[],
1265
2138
  options: {
2139
+ /** @internal */
1266
2140
  now?: () => Date;
2141
+ /** @internal */
1267
2142
  resolveCronNextRunAt?: (expression: string, now: Date) => string;
1268
2143
  } = {},
1269
2144
  ): ParseResult<ValidatedScheduleRequest> {
@@ -1296,6 +2171,7 @@ export function validateScheduleRequestInput(
1296
2171
  }
1297
2172
  }
1298
2173
 
2174
+ /** @internal */
1299
2175
  export function parseLauncherTurnConfigsJson(
1300
2176
  turnConfigsJson: string | null | undefined,
1301
2177
  ): ParseResult<InstanceTurnConfigMap> {
@@ -1306,6 +2182,7 @@ export function parseLauncherTurnConfigsJson(
1306
2182
  return parsed.ok ? parseLauncherTurnConfigMap(parsed.value, "turnConfigsJson") : parsed;
1307
2183
  }
1308
2184
 
2185
+ /** @internal */
1309
2186
  export function parseLauncherInputJson(
1310
2187
  launcherInputJson: string | null | undefined,
1311
2188
  context = "launcherInputJson",
@@ -1317,6 +2194,7 @@ export function parseLauncherInputJson(
1317
2194
  return parsed.ok ? parseRecord(parsed.value, context) : parsed;
1318
2195
  }
1319
2196
 
2197
+ /** @internal */
1320
2198
  export function parseLauncherModelConfigInput(
1321
2199
  value: unknown,
1322
2200
  context = "modelConfig",
@@ -1358,6 +2236,7 @@ function hasInlineScheduleFields(object: Record<string, unknown>): boolean {
1358
2236
  );
1359
2237
  }
1360
2238
 
2239
+ /** @internal */
1361
2240
  export function parseLauncherRequestBody(value: unknown): ParseResult<ParsedLauncherRequestBody> {
1362
2241
  if (value === undefined || value === null) {
1363
2242
  return ok({
@@ -1439,6 +2318,7 @@ export function parseLauncherRequestBody(value: unknown): ParseResult<ParsedLaun
1439
2318
  });
1440
2319
  }
1441
2320
 
2321
+ /** @internal */
1442
2322
  export function parseActionRequestBody(value: unknown): ParseResult<ParsedActionRequestBody> {
1443
2323
  if (value === undefined || value === null) {
1444
2324
  return ok({
@@ -1498,10 +2378,12 @@ export function parseActionRequestBody(value: unknown): ParseResult<ParsedAction
1498
2378
  });
1499
2379
  }
1500
2380
 
2381
+ /** @internal */
1501
2382
  export function serializeFutureLaunchPayload(payload: unknown): string {
1502
2383
  return JSON.stringify(normalizeFutureLaunchPayload(payload as FutureLaunchPayloadBase));
1503
2384
  }
1504
2385
 
2386
+ /** @internal */
1505
2387
  export function parseFutureLaunchPayloadObject(
1506
2388
  value: unknown,
1507
2389
  context = "Scheduled launch payload",
@@ -1510,6 +2392,7 @@ export function parseFutureLaunchPayloadObject(
1510
2392
  return parsed.ok ? ok(normalizeFutureLaunchPayload(parsed.value)) : parsed;
1511
2393
  }
1512
2394
 
2395
+ /** @internal */
1513
2396
  export function parseFutureLaunchPayloadJson(
1514
2397
  payloadJson: string,
1515
2398
  ): ParseResult<FutureLaunchPayload> {
@@ -1517,10 +2400,12 @@ export function parseFutureLaunchPayloadJson(
1517
2400
  return parsed.ok ? parseFutureLaunchPayloadObject(parsed.value) : parsed;
1518
2401
  }
1519
2402
 
2403
+ /** @internal */
1520
2404
  export function serializeFutureActionPayload(payload: unknown): string {
1521
2405
  return JSON.stringify(normalizeFutureActionPayload(payload as FutureActionPayloadBase));
1522
2406
  }
1523
2407
 
2408
+ /** @internal */
1524
2409
  export function parseFutureActionPayloadObject(
1525
2410
  value: unknown,
1526
2411
  context = "Scheduled action payload",
@@ -1529,6 +2414,7 @@ export function parseFutureActionPayloadObject(
1529
2414
  return parsed.ok ? ok(normalizeFutureActionPayload(parsed.value)) : parsed;
1530
2415
  }
1531
2416
 
2417
+ /** @internal */
1532
2418
  export function parseFutureActionPayloadJson(
1533
2419
  payloadJson: string,
1534
2420
  ): ParseResult<FutureActionPayload> {