@leitwerk-dev/process-sdk 0.2.0 → 0.2.1

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 (186) hide show
  1. package/dist/browser-ui-extension.d.ts +20 -0
  2. package/dist/browser-ui-extension.d.ts.map +1 -1
  3. package/dist/capabilities.d.ts +6 -0
  4. package/dist/capabilities.d.ts.map +1 -1
  5. package/dist/{chunk-LIIP7FMU.js → chunk-5R6MVLHC.js} +1 -1
  6. package/dist/chunk-5R6MVLHC.js.map +1 -0
  7. package/dist/chunk-DVXW2ZUV.js +1 -0
  8. package/dist/chunk-DVXW2ZUV.js.map +1 -0
  9. package/dist/{chunk-TA4KO53Q.js → chunk-I7U6HCLN.js} +1 -7
  10. package/dist/chunk-I7U6HCLN.js.map +1 -0
  11. package/dist/{chunk-WFY2WWZE.js → chunk-TM2LTSW4.js} +1 -1
  12. package/dist/chunk-TM2LTSW4.js.map +1 -0
  13. package/dist/codecs.d.ts +1 -0
  14. package/dist/codecs.d.ts.map +1 -1
  15. package/dist/commit-message.d.ts +5 -0
  16. package/dist/commit-message.d.ts.map +1 -1
  17. package/dist/core-capabilities.d.ts +336 -20
  18. package/dist/core-capabilities.d.ts.map +1 -1
  19. package/dist/define-process.d.ts +195 -18
  20. package/dist/define-process.d.ts.map +1 -1
  21. package/dist/event-bus.d.ts +1 -0
  22. package/dist/event-bus.d.ts.map +1 -1
  23. package/dist/{extension-api-CcqZCYJx.d.ts → extension-api-B4gG5w1K.d.ts} +1000 -108
  24. package/dist/extension-api.d.ts +385 -50
  25. package/dist/extension-api.d.ts.map +1 -1
  26. package/dist/external-action-source.d.ts +3 -1
  27. package/dist/external-action-source.d.ts.map +1 -1
  28. package/dist/external-source-poll.d.ts +8 -1
  29. package/dist/external-source-poll.d.ts.map +1 -1
  30. package/dist/flow.d.ts +308 -11
  31. package/dist/flow.d.ts.map +1 -1
  32. package/dist/form-contract.d.ts +1 -1
  33. package/dist/form-contract.d.ts.map +1 -1
  34. package/dist/fs-utils.d.ts +4 -0
  35. package/dist/fs-utils.d.ts.map +1 -1
  36. package/dist/git-binary.d.ts +2 -1
  37. package/dist/git-binary.d.ts.map +1 -1
  38. package/dist/git-binary.js.map +1 -1
  39. package/dist/graph-fragments.d.ts +16 -0
  40. package/dist/graph-fragments.d.ts.map +1 -1
  41. package/dist/host-capabilities.d.ts +9 -3
  42. package/dist/host-capabilities.d.ts.map +1 -1
  43. package/dist/index.d.ts +24 -25
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +262 -80
  46. package/dist/index.js.map +1 -1
  47. package/dist/integration-http.d.ts +14 -3
  48. package/dist/integration-http.d.ts.map +1 -1
  49. package/dist/json-data.d.ts +1 -1
  50. package/dist/json-data.d.ts.map +1 -1
  51. package/dist/leaf-outcome-renderer.d.ts +35 -0
  52. package/dist/leaf-outcome-renderer.d.ts.map +1 -1
  53. package/dist/leaf-outcome-renderer.js +12 -0
  54. package/dist/leaf-outcome-renderer.js.map +1 -1
  55. package/dist/leaf-outcomes.d.ts +3 -0
  56. package/dist/leaf-outcomes.d.ts.map +1 -1
  57. package/dist/model-provider.d.ts +144 -12
  58. package/dist/model-provider.d.ts.map +1 -1
  59. package/dist/pi-config-public.d.ts +2 -0
  60. package/dist/pi-config-public.d.ts.map +1 -0
  61. package/dist/pi-config-public.js +15 -0
  62. package/dist/pi-config-public.js.map +1 -0
  63. package/dist/pi-config.d.ts +40 -0
  64. package/dist/pi-config.d.ts.map +1 -1
  65. package/dist/pi-config.js +1 -1
  66. package/dist/process-definition-internals.d.ts +4 -0
  67. package/dist/process-definition-internals.d.ts.map +1 -1
  68. package/dist/process-flow-view.d.ts +2 -0
  69. package/dist/process-flow-view.d.ts.map +1 -1
  70. package/dist/process-graph.d.ts +34 -0
  71. package/dist/process-graph.d.ts.map +1 -1
  72. package/dist/process-launcher-builder.d.ts +5 -0
  73. package/dist/process-launcher-builder.d.ts.map +1 -1
  74. package/dist/process-watcher-builder.d.ts +5 -0
  75. package/dist/process-watcher-builder.d.ts.map +1 -1
  76. package/dist/process-watcher-source.d.ts +3 -1
  77. package/dist/process-watcher-source.d.ts.map +1 -1
  78. package/dist/project-binding.d.ts +5 -1
  79. package/dist/project-binding.d.ts.map +1 -1
  80. package/dist/registry-utils.d.ts +6 -0
  81. package/dist/registry-utils.d.ts.map +1 -1
  82. package/dist/repository-feedback.d.ts +20 -2
  83. package/dist/repository-feedback.d.ts.map +1 -1
  84. package/dist/repository-git-env.d.ts +6 -2
  85. package/dist/repository-git-env.d.ts.map +1 -1
  86. package/dist/repository-http.d.ts +13 -1
  87. package/dist/repository-http.d.ts.map +1 -1
  88. package/dist/repository-https.d.ts +1 -1
  89. package/dist/repository-https.d.ts.map +1 -1
  90. package/dist/repository-issue-watcher.d.ts +21 -1
  91. package/dist/repository-issue-watcher.d.ts.map +1 -1
  92. package/dist/repository-reconciliation.d.ts +5 -0
  93. package/dist/repository-reconciliation.d.ts.map +1 -0
  94. package/dist/repository-source-config.d.ts +27 -1
  95. package/dist/repository-source-config.d.ts.map +1 -1
  96. package/dist/repository-types.d.ts +28 -1
  97. package/dist/repository-types.d.ts.map +1 -1
  98. package/dist/review-flow-public.d.ts +2 -0
  99. package/dist/review-flow-public.d.ts.map +1 -0
  100. package/dist/review-flow-public.js +11 -0
  101. package/dist/review-flow-public.js.map +1 -0
  102. package/dist/review-flow.d.ts +6 -0
  103. package/dist/review-flow.d.ts.map +1 -1
  104. package/dist/review-flow.js +1 -1
  105. package/dist/runtime-internals-public.d.ts +2 -0
  106. package/dist/runtime-internals-public.d.ts.map +1 -0
  107. package/dist/runtime-internals-public.js +16 -0
  108. package/dist/runtime-internals-public.js.map +1 -0
  109. package/dist/runtime-internals.js +2 -1
  110. package/dist/server-events.d.ts +67 -0
  111. package/dist/server-events.d.ts.map +1 -1
  112. package/dist/server-process-builder.d.ts +7 -0
  113. package/dist/server-process-builder.d.ts.map +1 -1
  114. package/dist/state-helpers.d.ts +6 -0
  115. package/dist/state-helpers.d.ts.map +1 -1
  116. package/dist/subprocess-env.d.ts +3 -0
  117. package/dist/subprocess-env.d.ts.map +1 -1
  118. package/dist/tool-arguments.d.ts +4 -2
  119. package/dist/tool-arguments.d.ts.map +1 -1
  120. package/dist/tool-renderers.d.ts +6 -0
  121. package/dist/tool-renderers.d.ts.map +1 -1
  122. package/dist/turn-semantics.d.ts +14 -1
  123. package/dist/turn-semantics.d.ts.map +1 -1
  124. package/dist/types.d.ts +205 -24
  125. package/dist/types.d.ts.map +1 -1
  126. package/dist/ui-process-builder.d.ts +5 -0
  127. package/dist/ui-process-builder.d.ts.map +1 -1
  128. package/dist/worker-process-builder.d.ts +5 -0
  129. package/dist/worker-process-builder.d.ts.map +1 -1
  130. package/package.json +16 -15
  131. package/src/browser-ui-extension.ts +20 -0
  132. package/src/capabilities.ts +9 -1
  133. package/src/codecs.ts +1 -0
  134. package/src/commit-message.ts +5 -0
  135. package/src/core-capabilities.ts +396 -35
  136. package/src/define-process.ts +198 -23
  137. package/src/event-bus.ts +1 -0
  138. package/src/extension-api.ts +399 -55
  139. package/src/external-action-source.ts +7 -2
  140. package/src/external-source-poll.ts +15 -3
  141. package/src/flow.ts +352 -23
  142. package/src/form-contract.ts +0 -4
  143. package/src/fs-utils.ts +4 -0
  144. package/src/git-binary.ts +2 -1
  145. package/src/graph-fragments.ts +16 -0
  146. package/src/host-capabilities.ts +9 -6
  147. package/src/index.ts +5 -201
  148. package/src/integration-http.ts +15 -3
  149. package/src/json-data.ts +1 -1
  150. package/src/leaf-outcome-renderer.ts +35 -0
  151. package/src/leaf-outcomes.ts +3 -0
  152. package/src/model-provider.ts +169 -20
  153. package/src/pi-config-public.ts +7 -0
  154. package/src/pi-config.ts +47 -2
  155. package/src/process-definition-internals.ts +4 -0
  156. package/src/process-flow-view.ts +2 -0
  157. package/src/process-graph.ts +34 -0
  158. package/src/process-launcher-builder.ts +5 -0
  159. package/src/process-watcher-builder.ts +5 -0
  160. package/src/process-watcher-source.ts +6 -4
  161. package/src/project-binding.ts +5 -1
  162. package/src/registry-utils.ts +6 -0
  163. package/src/repository-feedback.ts +30 -4
  164. package/src/repository-git-env.ts +6 -2
  165. package/src/repository-http.ts +19 -2
  166. package/src/repository-https.ts +1 -1
  167. package/src/repository-issue-watcher.ts +35 -5
  168. package/src/repository-reconciliation.ts +30 -0
  169. package/src/repository-source-config.ts +20 -1
  170. package/src/repository-types.ts +43 -5
  171. package/src/review-flow-public.ts +5 -0
  172. package/src/review-flow.ts +6 -0
  173. package/src/runtime-internals-public.ts +7 -0
  174. package/src/server-events.ts +67 -0
  175. package/src/server-process-builder.ts +10 -1
  176. package/src/state-helpers.ts +6 -0
  177. package/src/subprocess-env.ts +3 -0
  178. package/src/tool-arguments.ts +4 -2
  179. package/src/tool-renderers.ts +6 -0
  180. package/src/turn-semantics.ts +15 -2
  181. package/src/types.ts +212 -30
  182. package/src/ui-process-builder.ts +8 -1
  183. package/src/worker-process-builder.ts +8 -1
  184. package/dist/chunk-LIIP7FMU.js.map +0 -1
  185. package/dist/chunk-TA4KO53Q.js.map +0 -1
  186. package/dist/chunk-WFY2WWZE.js.map +0 -1
@@ -1,428 +1,744 @@
1
1
  import type { Actor, InputKind, InputSource, LaunchModelConfigInput, ProcessEvent, ProcessInputTarget, ProcessInstance, ProcessLifecycleStatus, ProcessProject, TurnId, WorkerErrorClass } from "@leitwerk-dev/domain";
2
2
  import type { KnownDurableWsFrameType, KnownEphemeralWsFrameType, LauncherModelConfigPreview, LauncherModelConfigSchema, ProcessActionModelPreview, WsPayloadByType } from "@leitwerk-dev/protocol";
3
3
  import type { ExternalActionSource, FormDefinition, LauncherContext, LaunchPreparationCheck, ProcessLaunchConfig, ProcessLauncherService, ProcessLaunchPlan, ProcessWatcherPresentation, ProcessWatcherSource, RepositoryCredentialRegistrar } from "./extension-api.js";
4
+ /** @internal */
4
5
  export interface ProcessCreateInputLike {
6
+ /** @internal */
5
7
  processId?: ProcessInstance["processId"];
8
+ /** @internal */
6
9
  selectedTurnId?: ProcessInstance["selectedTurnId"];
10
+ /** @internal */
7
11
  lifecycleStatus?: ProcessInstance["lifecycleStatus"];
12
+ /** @internal */
8
13
  title?: string | null;
14
+ /** @internal */
9
15
  externalId?: string | null;
16
+ /** @internal */
10
17
  externalUrl?: string | null;
18
+ /** @internal */
11
19
  metadata?: Record<string, unknown> | null;
20
+ /** @internal */
12
21
  defaultModelProfileId?: string | null;
22
+ /** @internal */
13
23
  turnConfigsJson?: string | null;
24
+ /** @internal */
14
25
  selectedTurnModelProfileId?: string | null;
26
+ /** @internal */
15
27
  paramsJson?: string | null;
28
+ /** @internal */
16
29
  stateJson?: string | null;
17
30
  }
31
+ /** @public */
18
32
  export interface ProcessRepoLike {
33
+ /** @internal */
19
34
  create(input: ProcessCreateInputLike): ProcessInstance;
35
+ /** @internal */
20
36
  getById(id: string): ProcessInstance | null;
37
+ /** @public */
21
38
  listAll(): ProcessInstance[];
22
- /** Startup-only compatibility migrations may rewrite persisted process position and state. */
39
+ /** Startup-only compatibility migrations may rewrite persisted process position and state. @public */
23
40
  update(id: string, input: {
41
+ /** @public */
24
42
  selectedTurnId?: TurnId | null;
43
+ /** @public */
25
44
  currentExecution?: ProcessInstance["currentExecution"];
45
+ /** @public */
26
46
  stateJson?: string | null;
27
47
  }): ProcessInstance | null;
28
48
  }
49
+ /** @public */
29
50
  export interface ProcessProjectRepoLike {
30
- /** Server-provided project mutation service. Implementations should emit project.updated after committed writes. */
51
+ /** Server-provided project mutation service. Implementations should emit project.updated after committed writes. @internal */
31
52
  create(input: {
53
+ /** @internal */
32
54
  instanceId: string;
55
+ /** @internal */
33
56
  key: string;
57
+ /** @internal */
34
58
  repoLocator: string;
59
+ /** @internal */
35
60
  baseBranch: string;
61
+ /** @internal */
36
62
  workBranch?: string | null;
63
+ /** @internal */
37
64
  externalId?: string | null;
65
+ /** @internal */
38
66
  externalUrl?: string | null;
67
+ /** @internal */
39
68
  metadata?: Record<string, unknown> | null;
69
+ /** @internal */
40
70
  pipelineStatus?: string | null;
41
71
  }): ProcessProject;
72
+ /** @internal */
42
73
  getByInstanceAndKey(instanceId: string, key: string): ProcessProject | null;
74
+ /** @public */
43
75
  update(id: string, input: {
76
+ /** @internal */
44
77
  baseBranch?: string;
78
+ /** @internal */
45
79
  workBranch?: string | null;
80
+ /** @internal */
46
81
  externalId?: string | null;
82
+ /** @internal */
47
83
  externalUrl?: string | null;
84
+ /** @public */
48
85
  metadata?: Record<string, unknown> | null;
86
+ /** @internal */
49
87
  pipelineStatus?: string | null;
50
88
  }): ProcessProject | null;
89
+ /** @internal */
51
90
  listByInstance(instanceId: string): ProcessProject[];
52
91
  }
92
+ /** @public */
53
93
  export interface ProcessEventRepoLike {
94
+ /** @public */
54
95
  create(input: {
96
+ /** @public */
55
97
  instanceId: string;
98
+ /** @public */
56
99
  eventType: string;
100
+ /** @public */
57
101
  data?: Record<string, unknown>;
58
102
  }): unknown;
103
+ /** @internal */
59
104
  listByInstance(instanceId: string, limit?: number): ProcessEvent[];
60
105
  }
106
+ /** @internal */
61
107
  export interface BroadcasterLike {
108
+ /** @internal */
62
109
  sendDurable<T extends KnownDurableWsFrameType>(type: T, payload: WsPayloadByType[T], instanceId?: string): void;
110
+ /** @internal */
63
111
  sendEphemeral?<T extends KnownEphemeralWsFrameType>(type: T, payload: WsPayloadByType[T], instanceId?: string): void;
64
112
  }
113
+ /** @internal */
65
114
  export type LaunchModelConfigInputLike = LaunchModelConfigInput;
115
+ /** @internal */
66
116
  export type LauncherModelConfigSchemaLike = LauncherModelConfigSchema;
117
+ /** @internal */
67
118
  export type LauncherModelConfigPreviewLike = LauncherModelConfigPreview;
119
+ /** @internal */
68
120
  export interface LauncherModelConfigServiceLike {
121
+ /** @internal */
69
122
  getSchema(launcherId: string): Promise<LauncherModelConfigSchemaLike | null>;
123
+ /** @internal */
70
124
  preview(launcherId: string, launcherInput: Record<string, unknown>, opts?: {
125
+ /** @internal */
71
126
  modelConfig?: LaunchModelConfigInputLike;
72
127
  }): Promise<LauncherModelConfigPreviewLike | null>;
73
128
  }
74
- /** Stable, machine-readable codes returned while preparing a launch. */
129
+ /** Stable, machine-readable codes returned while preparing a launch. @internal */
75
130
  export type LaunchPlanPreparationIssueCode = "process_id_mismatch" | "invalid_turn_configs_json" | "unknown_model_profile" | "model_profile_not_allowed" | "unknown_llm_turn" | "selected_turn_model_requires_selected_turn" | "selected_turn_model_requires_llm_turn" | "model_required";
76
- /** Complete, presentation-safe diagnostic returned while preparing a launch. */
131
+ /** Complete, presentation-safe diagnostic returned while preparing a launch. @internal */
77
132
  export interface LaunchPlanPreparationIssue {
133
+ /** @internal */
78
134
  readonly code: LaunchPlanPreparationIssueCode;
135
+ /** @internal */
79
136
  readonly message: string;
80
137
  }
138
+ /** @internal */
81
139
  export type LaunchPlanPreparationResultLike = {
140
+ /** @internal */
82
141
  ok: true;
142
+ /** @internal */
83
143
  launchPlan: ProcessLaunchPlan;
144
+ /** @internal */
84
145
  modelConfig: LaunchModelConfigInputLike;
146
+ /** @internal */
85
147
  warnings: readonly LaunchPlanPreparationIssue[];
86
148
  } | {
149
+ /** @internal */
87
150
  ok: false;
88
- /** Normalized durable plan retained when a scheduled launch is blocked. */
151
+ /** Normalized durable plan retained when a scheduled launch is blocked. @internal */
89
152
  launchPlan: ProcessLaunchPlan;
153
+ /** @internal */
90
154
  modelConfig: LaunchModelConfigInputLike;
155
+ /** @internal */
91
156
  errors: readonly LaunchPlanPreparationIssue[];
92
157
  };
158
+ /** @internal */
93
159
  export interface ProcessLaunchPlanServiceLike {
160
+ /** @internal */
94
161
  prepare(launchPlan: ProcessLaunchPlan, opts?: {
162
+ /** @internal */
95
163
  modelConfig?: LaunchModelConfigInputLike;
164
+ /** @internal */
96
165
  replaceModelConfig?: boolean;
166
+ /** @internal */
97
167
  invalidModelConfig?: "reject" | "omit";
98
168
  }): Promise<LaunchPlanPreparationResultLike>;
99
169
  }
170
+ /** @internal */
100
171
  export interface HandoffDedupKeyRecordLike {
172
+ /** @internal */
101
173
  key: string;
174
+ /** @internal */
102
175
  instanceId: string;
176
+ /** @internal */
103
177
  createdAt: string;
178
+ /** @internal */
104
179
  metadata: Record<string, unknown>;
105
180
  }
181
+ /** @internal */
106
182
  export interface HandoffDedupKeyServiceLike {
183
+ /** @internal */
107
184
  getByKey(key: string): HandoffDedupKeyRecordLike | null;
108
185
  }
186
+ /** @internal */
109
187
  export interface WorkerSupervisorLike {
188
+ /** @internal */
110
189
  spawnWorker(instanceId: string): Promise<unknown>;
190
+ /** @internal */
111
191
  getWorker(instanceId: string): unknown | undefined;
112
192
  }
193
+ /** @public */
113
194
  export interface ProcessEngineResultLike {
195
+ /** @public */
114
196
  ok: boolean;
197
+ /** @internal */
115
198
  code?: string;
199
+ /** @internal */
116
200
  message?: string;
201
+ /** @internal */
117
202
  process?: ProcessInstance | null;
203
+ /** @internal */
118
204
  stage?: "pre_commit" | "post_commit";
205
+ /** @internal */
119
206
  data?: unknown;
120
207
  }
208
+ /** @internal */
121
209
  export interface DeferredProcessActivationExpected {
210
+ /** @internal */
122
211
  processId: string;
212
+ /** @internal */
123
213
  lifecycleStatus: ProcessLifecycleStatus;
214
+ /** @internal */
124
215
  selectedTurnId: TurnId | null;
216
+ /** @internal */
125
217
  title: string | null;
218
+ /** @internal */
126
219
  paramsJson: string | null;
220
+ /** @internal */
127
221
  projectId: string;
222
+ /** @internal */
128
223
  projectKey: string;
224
+ /** @internal */
129
225
  repoLocator: string;
226
+ /** @internal */
130
227
  baseBranch: string;
228
+ /** @internal */
131
229
  workBranch: string | null;
132
230
  }
231
+ /** @internal */
133
232
  export interface DeferredProcessActivationSnapshot extends DeferredProcessActivationExpected {
233
+ /** @internal */
134
234
  instanceId: string;
235
+ /** @internal */
135
236
  processMetadata: Record<string, unknown> | null;
237
+ /** @internal */
136
238
  projectMetadata: Record<string, unknown> | null;
137
239
  }
240
+ /** @internal */
138
241
  export interface DeferredProcessActivationSnapshotQuery {
242
+ /** @internal */
139
243
  projectKey: string;
244
+ /** @internal */
140
245
  instanceId?: string;
246
+ /** @internal */
141
247
  processId?: string;
142
248
  }
249
+ /** @internal */
143
250
  export type DeferredProcessActivationSnapshotResult = {
251
+ /** @internal */
144
252
  outcome: "ready";
253
+ /** @internal */
145
254
  snapshots: DeferredProcessActivationSnapshot[];
146
255
  } | {
256
+ /** @internal */
147
257
  outcome: "process_not_found";
148
258
  } | {
259
+ /** @internal */
149
260
  outcome: "project_not_found";
150
261
  };
262
+ /** @internal */
151
263
  export interface DeferredProcessActivationEvent {
264
+ /** @internal */
152
265
  eventType: string;
266
+ /** @internal */
153
267
  data?: Record<string, unknown>;
268
+ /** @internal */
154
269
  level: "info" | "warn" | "error";
270
+ /** @internal */
155
271
  message: string;
156
272
  }
273
+ /** @internal */
157
274
  export interface PreparedDeferredProcessActivation {
275
+ /** @internal */
158
276
  expected: DeferredProcessActivationExpected;
277
+ /** @internal */
159
278
  workBranch: string;
279
+ /** @internal */
160
280
  paramsJson: string;
281
+ /** @internal */
161
282
  projectMetadata: Record<string, unknown> | null;
283
+ /** @internal */
162
284
  selectedTurnId: TurnId;
285
+ /** @internal */
163
286
  event: DeferredProcessActivationEvent;
287
+ /** @internal */
164
288
  actor?: Actor;
165
289
  }
290
+ /** @internal */
166
291
  export type DeferredProcessActivationOutcome = "activated" | "already_activated" | "stale" | "not_applicable" | "project_not_found" | "invalid_selected_turn";
292
+ /** @internal */
167
293
  export interface DeferredProcessActivationFailure {
294
+ /** @internal */
168
295
  expected: DeferredProcessActivationExpected;
296
+ /** @internal */
169
297
  errorClass: WorkerErrorClass;
298
+ /** @internal */
170
299
  event: DeferredProcessActivationEvent;
171
300
  }
301
+ /** @internal */
172
302
  export type ProcessActionExecutionSource = "ui" | "external" | "scheduled";
303
+ /** @internal */
173
304
  export type ProcessActionExecutionOrigin = "web_ui" | "external_interface" | "scheduled";
305
+ /** @internal */
174
306
  export interface ProcessActionSummaryLike {
307
+ /** @internal */
175
308
  id: string;
309
+ /** @internal */
176
310
  label: string;
311
+ /** @internal */
177
312
  description?: string | null;
313
+ /** @internal */
178
314
  form?: FormDefinition;
179
315
  }
316
+ /** @internal */
180
317
  export type ActionExecutionFailureStageLike = "pre_commit" | "post_commit";
318
+ /** @public */
181
319
  export type ActionExecutionResultLike = {
320
+ /** @public */
182
321
  ok: true;
322
+ /** @internal */
183
323
  process: ProcessInstance | null;
324
+ /** @internal */
184
325
  data?: Record<string, unknown>;
326
+ /** @internal */
185
327
  error?: undefined;
328
+ /** @internal */
186
329
  code?: undefined;
330
+ /** @internal */
187
331
  stage?: undefined;
188
332
  } | {
333
+ /** @public */
189
334
  ok: false;
335
+ /** @internal */
190
336
  stage: "pre_commit";
337
+ /** @internal */
191
338
  error: string;
339
+ /** @internal */
192
340
  code?: string;
341
+ /** @internal */
193
342
  process?: undefined;
343
+ /** @internal */
194
344
  data?: undefined;
195
345
  } | {
346
+ /** @public */
196
347
  ok: false;
348
+ /** @internal */
197
349
  stage: "post_commit";
350
+ /** @internal */
198
351
  process: ProcessInstance;
352
+ /** @internal */
199
353
  error: string;
354
+ /** @internal */
200
355
  code?: string;
356
+ /** @internal */
201
357
  data?: Record<string, unknown>;
202
358
  };
359
+ /** @internal */
203
360
  export interface ProcessActionServiceLike {
361
+ /** @internal */
204
362
  listVisibleActions(instanceId: string): readonly ProcessActionSummaryLike[];
363
+ /** @internal */
205
364
  executeAction(instanceId: string, actionId: string, input: Record<string, unknown>, opts?: {
365
+ /** @internal */
206
366
  source?: ProcessActionExecutionSource;
367
+ /** @internal */
207
368
  origin?: ProcessActionExecutionOrigin;
369
+ /** @internal */
208
370
  nextTurnModelProfileId?: string | null;
371
+ /** @internal */
209
372
  actor?: Actor;
210
373
  }): Promise<ActionExecutionResultLike>;
211
374
  }
375
+ /** @public */
212
376
  export interface ExternalObservationInput {
377
+ /** @public */
213
378
  instanceId: string;
379
+ /** @public */
214
380
  armingId: string;
381
+ /** @public */
215
382
  generation: string;
383
+ /** @public */
216
384
  observation?: {
385
+ /** @public */
217
386
  summary: string;
387
+ /** @internal */
218
388
  links?: import("@leitwerk-dev/domain").TurnProgressLink[];
389
+ /** @public */
219
390
  observedAt: string;
391
+ /** @public */
220
392
  subject: string;
393
+ /** @public */
221
394
  revision: string;
222
395
  };
396
+ /** @public */
223
397
  refreshError?: string;
224
398
  }
399
+ /** @public */
225
400
  export interface ExternalSourceArmingLike {
226
- /** Process-local arming id. Durable arming identity is { instanceId, id }. */
401
+ /** Process-local arming id. Durable arming identity is { instanceId, id }. @public */
227
402
  id: string;
403
+ /** @public */
228
404
  instanceId: string;
405
+ /** @internal */
229
406
  processId: string;
407
+ /** @internal */
230
408
  turnId: string;
409
+ /** @internal */
231
410
  externalActionId: string;
411
+ /** @internal */
232
412
  source: ExternalActionSource;
413
+ /** @public */
233
414
  resolved: unknown;
234
- /** Opaque identity of this resolved subscription. */
415
+ /** Opaque identity of this resolved subscription. @public */
235
416
  generation?: string;
236
417
  }
418
+ /** @public */
237
419
  export interface ExternalSourceFireInput {
420
+ /** @public */
238
421
  instanceId: string;
422
+ /** @public */
239
423
  armingId: string;
240
- /** Reject a superseded subscription instead of queuing its event for a later turn. */
424
+ /** Reject a superseded subscription instead of queuing its event for a later turn. @internal */
241
425
  generation?: string;
426
+ /** @internal */
242
427
  input?: Record<string, unknown>;
428
+ /** @public */
243
429
  event?: Record<string, unknown>;
430
+ /** @public */
244
431
  mergeKey?: string | null;
245
432
  }
433
+ /** @public */
246
434
  export interface ExternalSourceServiceLike {
435
+ /** @public */
247
436
  listArmed(kind: string): readonly ExternalSourceArmingLike[];
437
+ /** @public */
248
438
  fire(input: ExternalSourceFireInput): Promise<ActionExecutionResultLike>;
249
- /** Records facts without firing an action or changing lifecycle state. */
439
+ /** Records facts without firing an action or changing lifecycle state. @public */
250
440
  observe?(input: ExternalObservationInput): Promise<ActionExecutionResultLike>;
251
441
  }
442
+ /** @internal */
252
443
  export interface LauncherRecentValuesServiceLike {
444
+ /** @internal */
253
445
  list(launcherId: string): Record<string, readonly string[]>;
446
+ /** @internal */
254
447
  record(launcherId: string, launcherInput: Record<string, unknown>): void;
255
448
  }
449
+ /** @internal */
256
450
  export interface QueuedProcessInputLike {
451
+ /** @internal */
257
452
  source: InputSource;
453
+ /** @internal */
258
454
  kind: InputKind;
455
+ /** @internal */
259
456
  bodyMarkdown: string;
457
+ /** @internal */
260
458
  target?: ProcessInputTarget | null;
261
- /** Stable principal that queued this input. Defaults to SYSTEM_ACTOR at persist time. */
459
+ /** Stable principal that queued this input. Defaults to SYSTEM_ACTOR at persist time. @internal */
262
460
  actor?: Actor;
263
461
  }
462
+ /** @public */
264
463
  export interface ProcessEngineLike {
464
+ /** @internal */
265
465
  getDeferredProcessActivationSnapshots(query: DeferredProcessActivationSnapshotQuery): DeferredProcessActivationSnapshotResult;
466
+ /** @internal */
266
467
  activateDeferredProcess(instanceId: string, prepared: PreparedDeferredProcessActivation): Promise<ProcessEngineResultLike & {
468
+ /** @internal */
267
469
  data?: {
470
+ /** @internal */
268
471
  outcome: DeferredProcessActivationOutcome;
269
472
  };
270
473
  }>;
474
+ /** @internal */
271
475
  parkDeferredProcessActivationFailure(instanceId: string, failure: DeferredProcessActivationFailure): Promise<ProcessEngineResultLike & {
476
+ /** @internal */
272
477
  data?: {
478
+ /** @internal */
273
479
  outcome: "parked" | "stale" | "not_applicable" | "project_not_found";
274
480
  };
275
481
  }>;
482
+ /** @internal */
276
483
  startProcess(instanceId: string, startTurnId: TurnId): Promise<ProcessEngineResultLike>;
484
+ /** @public */
277
485
  abortProcess(instanceId: string, opts?: {
486
+ /** @internal */
278
487
  actor?: Actor;
279
488
  }): Promise<ProcessEngineResultLike>;
280
- /** Retries the current failed startup or accepted turn; startup retries consume no attempt. */
489
+ /** Retries the current failed startup or accepted turn; startup retries consume no attempt. @public */
281
490
  retryProcess(instanceId: string, opts?: {
491
+ /** @internal */
282
492
  nextTurnModelProfileId?: string | null;
493
+ /** @internal */
283
494
  actor?: Actor;
284
495
  }): Promise<ProcessEngineResultLike>;
496
+ /** @internal */
285
497
  continueFailedTurn(instanceId: string, turnRecordId: string, options?: {
498
+ /** @internal */
286
499
  prompt?: string | null;
500
+ /** @internal */
287
501
  nextTurnModelProfileId?: string | null;
502
+ /** @internal */
288
503
  actor?: Actor;
289
504
  }): Promise<ProcessEngineResultLike>;
505
+ /** @internal */
290
506
  queueInputs(instanceId: string, inputs: readonly QueuedProcessInputLike[], opts?: {
507
+ /** @internal */
291
508
  dispatchErrorMessage?: string;
509
+ /** @internal */
292
510
  actor?: Actor;
293
511
  }): Promise<ProcessEngineResultLike>;
294
512
  }
513
+ /** @internal */
295
514
  export interface ComponentConfigLike {
515
+ /** @internal */
296
516
  repo: string;
517
+ /** @internal */
297
518
  default_branch: string;
298
519
  }
520
+ /** @public */
299
521
  export interface RegisteredProcessWatcherLike<TConfig = unknown, TEvent = unknown> {
522
+ /** @public */
300
523
  readonly processId: string;
524
+ /** @internal */
301
525
  readonly processDisplayName: string;
526
+ /** @public */
302
527
  readonly watcherId: string;
528
+ /** @internal */
303
529
  readonly watcherLabel: string;
530
+ /** @internal */
304
531
  readonly watcherDescription: string;
532
+ /** @internal */
305
533
  readonly sourceId: string;
534
+ /** @internal */
306
535
  readonly sourceLabel: string;
536
+ /** @public */
307
537
  readonly enabled: boolean;
538
+ /** @internal */
308
539
  readonly configPath: string;
540
+ /** @public */
309
541
  readonly config: TConfig;
542
+ /** @internal */
310
543
  readonly presentation: ProcessWatcherPresentation;
544
+ /** @internal */
311
545
  readonly launchModelConfig: LaunchModelConfigInputLike;
546
+ /** @internal */
312
547
  resolveLaunch(event: TEvent, ctx?: LauncherContext): Promise<ProcessLaunchPlan | null>;
548
+ /** @internal */
313
549
  resolveLaunchAttempt(event: TEvent, ctx?: LauncherContext): Promise<{
550
+ /** @internal */
314
551
  launchConfig: ProcessLaunchConfig;
552
+ /** @internal */
315
553
  launchPlan: ProcessLaunchPlan;
554
+ /** @internal */
316
555
  preparationChecks: readonly LaunchPreparationCheck[];
317
556
  } | null>;
318
557
  }
558
+ /** @public */
319
559
  export interface WatcherLaunchResultLike extends ProgrammaticLaunchResultLike {
320
560
  }
561
+ /** @internal */
321
562
  export interface ProgrammaticLaunchRequestLike {
563
+ /** @internal */
322
564
  launcherId: string;
565
+ /** @internal */
323
566
  launcherInput: Record<string, unknown>;
567
+ /** @internal */
324
568
  title?: string | null;
569
+ /** @internal */
325
570
  modelConfig?: LaunchModelConfigInputLike;
571
+ /** @internal */
326
572
  skillIds?: readonly string[];
327
- /** Trusted, non-secret process metadata merged after launcher resolution. */
573
+ /** Trusted, non-secret process metadata merged after launcher resolution. @internal */
328
574
  processMetadata?: Record<string, unknown>;
329
575
  }
576
+ /** @public */
330
577
  export interface ProgrammaticLaunchResultLike {
578
+ /** @public */
331
579
  launchRunId: string;
580
+ /** @public */
332
581
  process: ProcessInstance | null;
582
+ /** @public */
333
583
  error: string | null;
334
584
  }
585
+ /** @public */
335
586
  export interface LaunchRunServiceLike {
587
+ /** @internal */
336
588
  startProgrammatic(request: ProgrammaticLaunchRequestLike, opts: {
589
+ /** @internal */
337
590
  idempotencyKey: string;
591
+ /** @internal */
338
592
  actor?: Actor;
339
593
  }): Promise<ProgrammaticLaunchResultLike>;
594
+ /** @public */
340
595
  startWatcher<TConfig, TEvent>(watcher: RegisteredProcessWatcherLike<TConfig, TEvent>, event: TEvent, opts: {
596
+ /** @public */
341
597
  idempotencyKey: string;
598
+ /** @internal */
342
599
  actor?: Actor;
343
600
  }): Promise<WatcherLaunchResultLike>;
344
601
  }
602
+ /** @public */
345
603
  export interface ProcessWatcherServiceLike {
604
+ /** @internal */
346
605
  listAll(): readonly RegisteredProcessWatcherLike[];
606
+ /** @public */
347
607
  listBySource<TConfig, TEvent>(source: ProcessWatcherSource<TConfig, TEvent>): readonly RegisteredProcessWatcherLike<TConfig, TEvent>[];
348
608
  }
609
+ /** @public */
349
610
  export interface PollResultLike {
611
+ /** @internal */
350
612
  readonly errors: readonly string[];
351
613
  }
352
- export interface PollingHandleLike<T extends PollResultLike = PollResultLike> {
353
- poll(): Promise<T>;
354
- }
614
+ /** @public */
355
615
  export interface PollingServiceLike {
616
+ /** @public */
356
617
  create<T extends PollResultLike>(options: {
618
+ /** @public */
357
619
  id: string;
620
+ /** @public */
358
621
  pollOnce(): Promise<T>;
622
+ /** @public */
359
623
  isEnabled(): boolean;
624
+ /** @public */
360
625
  pollInterval(): string;
626
+ /** @public */
361
627
  defaultIntervalMs?: number;
362
- }): PollingHandleLike<T>;
628
+ }): {
629
+ /** @public */
630
+ poll(): Promise<T>;
631
+ };
363
632
  }
633
+ /** @internal */
364
634
  export interface ProcessQuestionServiceLike {
635
+ /** @internal */
365
636
  listOpen(instanceId?: string): readonly import("@leitwerk-dev/domain").ProcessQuestionRequest[];
637
+ /** @internal */
366
638
  submitAnswers(instanceId: string, requestId: string, draft: readonly import("@leitwerk-dev/domain").QuestionAnswerDraft[], actor: Actor): Promise<{
639
+ /** @internal */
367
640
  ok: true;
641
+ /** @internal */
368
642
  request: import("@leitwerk-dev/domain").ProcessQuestionRequest;
369
643
  } | {
644
+ /** @internal */
370
645
  ok: false;
646
+ /** @internal */
371
647
  code: "not_found" | "not_current" | "invalid";
648
+ /** @internal */
372
649
  message: string;
650
+ /** @internal */
373
651
  request?: import("@leitwerk-dev/domain").ProcessQuestionRequest;
374
652
  }>;
375
653
  }
654
+ /** @public */
376
655
  export interface CoreServerSetupDeps {
656
+ /** @internal */
377
657
  serverBaseUrl: string;
658
+ /** @internal */
378
659
  processWorkspacesDir?: string;
660
+ /** @internal */
379
661
  components: Record<string, ComponentConfigLike>;
380
- /** Typed by consuming extensions via watcher-utils ExternalWriteLogRepoLike. */
662
+ /** Typed by consuming extensions via watcher-utils ExternalWriteLogRepoLike. @public */
381
663
  externalWrites: unknown;
664
+ /** @public */
382
665
  processes: ProcessRepoLike;
666
+ /** @public */
383
667
  projects: ProcessProjectRepoLike;
668
+ /** @public */
384
669
  events: ProcessEventRepoLike;
670
+ /** @internal */
385
671
  broadcaster: BroadcasterLike;
672
+ /** @public */
386
673
  commands: ProcessEngineLike;
674
+ /** @internal */
387
675
  processActions: ProcessActionServiceLike;
676
+ /** @public */
388
677
  externalSources: ExternalSourceServiceLike;
678
+ /** @internal */
389
679
  getSupervisor: () => WorkerSupervisorLike | undefined;
680
+ /** @internal */
390
681
  launcherService: ProcessLauncherService;
682
+ /** @internal */
391
683
  launcherRecentValues: LauncherRecentValuesServiceLike;
684
+ /** @internal */
392
685
  launcherModelConfigs: LauncherModelConfigServiceLike;
686
+ /** @internal */
393
687
  launchPlans: ProcessLaunchPlanServiceLike;
688
+ /** @internal */
394
689
  handoffDedupKeys?: HandoffDedupKeyServiceLike;
690
+ /** @public */
395
691
  processWatchers?: ProcessWatcherServiceLike;
692
+ /** @public */
396
693
  launchRuns: LaunchRunServiceLike;
694
+ /** @public */
397
695
  polling: PollingServiceLike;
696
+ /** @internal */
398
697
  processModelSelection?: ProcessModelSelectionServiceLike;
399
- /** Durable active-turn questions for trusted operator-channel extensions. */
698
+ /** Durable active-turn questions for trusted operator-channel extensions. @internal */
400
699
  processQuestions?: ProcessQuestionServiceLike;
401
- /** Registration boundary for secret-backed repository credential extensions. */
700
+ /** Registration boundary for secret-backed repository credential extensions. @internal */
402
701
  repositoryCredentials: RepositoryCredentialRegistrar;
403
- /** Server-owned managed result images, available to trusted delivery extensions. */
702
+ /** Server-owned managed result images, available to trusted delivery extensions. @internal */
404
703
  resultImages?: {
704
+ /** @internal */
405
705
  get(instanceId: string, turnRecordId: string, imageId: string): Promise<Uint8Array | null>;
406
706
  };
407
707
  }
708
+ /** @internal */
408
709
  export type ProcessActionModelPreviewLike = ProcessActionModelPreview;
710
+ /** @internal */
409
711
  export type ProcessModelSelectionPreviewFailureCode = "process_not_found" | "instance_tree_unavailable";
712
+ /** @internal */
410
713
  export type ProcessModelSelectionPreviewResultLike = ProcessActionModelPreviewLike | {
714
+ /** @internal */
411
715
  kind: "operational_failure";
716
+ /** @internal */
412
717
  code: ProcessModelSelectionPreviewFailureCode;
413
718
  };
719
+ /** @internal */
414
720
  export interface ModelProfileOptionSummaryLike {
721
+ /** @internal */
415
722
  id: string;
723
+ /** @internal */
416
724
  label: string;
725
+ /** @internal */
417
726
  description: string;
727
+ /** @internal */
418
728
  availability: "available" | "unavailable" | "stale";
419
729
  }
730
+ /** @internal */
420
731
  export interface ProcessModelSelectionServiceLike {
732
+ /** @internal */
421
733
  listAvailableProfiles(instanceId: string): readonly ModelProfileOptionSummaryLike[] | null;
734
+ /** @internal */
422
735
  preview(instanceId: string, actionId: string, input: Record<string, unknown>): Promise<ProcessModelSelectionPreviewResultLike>;
423
736
  }
737
+ /** @public */
424
738
  export declare const coreHostCapabilities: {
739
+ /** @public */
425
740
  readonly serverSetup: import("./capabilities.js").CapabilityToken<CoreServerSetupDeps>;
741
+ /** @internal */
426
742
  readonly processModelSelection: import("./capabilities.js").CapabilityToken<ProcessModelSelectionServiceLike>;
427
743
  };
428
744
  //# sourceMappingURL=core-capabilities.d.ts.map