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