@leitwerk-dev/process-sdk 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.
- package/README.md +12 -0
- package/dist/browser-ui-extension.d.ts +20 -0
- package/dist/browser-ui-extension.d.ts.map +1 -1
- package/dist/capabilities.d.ts +6 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/{chunk-LIIP7FMU.js → chunk-5R6MVLHC.js} +1 -1
- package/dist/chunk-5R6MVLHC.js.map +1 -0
- package/dist/chunk-DVXW2ZUV.js +1 -0
- package/dist/chunk-DVXW2ZUV.js.map +1 -0
- package/dist/{chunk-TA4KO53Q.js → chunk-I7U6HCLN.js} +1 -7
- package/dist/chunk-I7U6HCLN.js.map +1 -0
- package/dist/{chunk-WFY2WWZE.js → chunk-TM2LTSW4.js} +1 -1
- package/dist/chunk-TM2LTSW4.js.map +1 -0
- package/dist/codecs.d.ts +1 -0
- package/dist/codecs.d.ts.map +1 -1
- package/dist/commit-message.d.ts +5 -0
- package/dist/commit-message.d.ts.map +1 -1
- package/dist/core-capabilities.d.ts +338 -20
- package/dist/core-capabilities.d.ts.map +1 -1
- package/dist/define-process.d.ts +195 -18
- package/dist/define-process.d.ts.map +1 -1
- package/dist/event-bus.d.ts +1 -0
- package/dist/event-bus.d.ts.map +1 -1
- package/dist/{extension-api-CcqZCYJx.d.ts → extension-api-3Vr3RE8S.d.ts} +1000 -108
- package/dist/extension-api.d.ts +385 -50
- package/dist/extension-api.d.ts.map +1 -1
- package/dist/external-action-source.d.ts +3 -1
- package/dist/external-action-source.d.ts.map +1 -1
- package/dist/external-source-poll.d.ts +18 -5
- package/dist/external-source-poll.d.ts.map +1 -1
- package/dist/flow.d.ts +308 -11
- package/dist/flow.d.ts.map +1 -1
- package/dist/form-contract.d.ts +1 -1
- package/dist/form-contract.d.ts.map +1 -1
- package/dist/fs-utils.d.ts +4 -0
- package/dist/fs-utils.d.ts.map +1 -1
- package/dist/git-binary.d.ts +2 -1
- package/dist/git-binary.d.ts.map +1 -1
- package/dist/git-binary.js.map +1 -1
- package/dist/graph-fragments.d.ts +16 -0
- package/dist/graph-fragments.d.ts.map +1 -1
- package/dist/host-capabilities.d.ts +9 -3
- package/dist/host-capabilities.d.ts.map +1 -1
- package/dist/index.d.ts +26 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +270 -81
- package/dist/index.js.map +1 -1
- package/dist/integration-http.d.ts +14 -3
- package/dist/integration-http.d.ts.map +1 -1
- package/dist/json-data.d.ts +1 -1
- package/dist/json-data.d.ts.map +1 -1
- package/dist/leaf-outcome-renderer.d.ts +35 -0
- package/dist/leaf-outcome-renderer.d.ts.map +1 -1
- package/dist/leaf-outcome-renderer.js +12 -0
- package/dist/leaf-outcome-renderer.js.map +1 -1
- package/dist/leaf-outcomes.d.ts +3 -0
- package/dist/leaf-outcomes.d.ts.map +1 -1
- package/dist/model-provider.d.ts +144 -12
- package/dist/model-provider.d.ts.map +1 -1
- package/dist/pi-config-public.d.ts +2 -0
- package/dist/pi-config-public.d.ts.map +1 -0
- package/dist/pi-config-public.js +15 -0
- package/dist/pi-config-public.js.map +1 -0
- package/dist/pi-config.d.ts +40 -0
- package/dist/pi-config.d.ts.map +1 -1
- package/dist/pi-config.js +1 -1
- package/dist/process-definition-internals.d.ts +4 -0
- package/dist/process-definition-internals.d.ts.map +1 -1
- package/dist/process-flow-view.d.ts +2 -0
- package/dist/process-flow-view.d.ts.map +1 -1
- package/dist/process-graph.d.ts +34 -0
- package/dist/process-graph.d.ts.map +1 -1
- package/dist/process-launcher-builder.d.ts +5 -0
- package/dist/process-launcher-builder.d.ts.map +1 -1
- package/dist/process-watcher-builder.d.ts +5 -0
- package/dist/process-watcher-builder.d.ts.map +1 -1
- package/dist/process-watcher-source.d.ts +3 -1
- package/dist/process-watcher-source.d.ts.map +1 -1
- package/dist/project-binding.d.ts +5 -1
- package/dist/project-binding.d.ts.map +1 -1
- package/dist/registry-utils.d.ts +6 -0
- package/dist/registry-utils.d.ts.map +1 -1
- package/dist/repository-feedback.d.ts +36 -12
- package/dist/repository-feedback.d.ts.map +1 -1
- package/dist/repository-git-env.d.ts +6 -2
- package/dist/repository-git-env.d.ts.map +1 -1
- package/dist/repository-http.d.ts +13 -1
- package/dist/repository-http.d.ts.map +1 -1
- package/dist/repository-https.d.ts +1 -1
- package/dist/repository-https.d.ts.map +1 -1
- package/dist/repository-issue-watcher.d.ts +31 -6
- package/dist/repository-issue-watcher.d.ts.map +1 -1
- package/dist/repository-reconciliation.d.ts +5 -0
- package/dist/repository-reconciliation.d.ts.map +1 -0
- package/dist/repository-source-config.d.ts +29 -18
- package/dist/repository-source-config.d.ts.map +1 -1
- package/dist/repository-types.d.ts +28 -1
- package/dist/repository-types.d.ts.map +1 -1
- package/dist/review-flow-public.d.ts +2 -0
- package/dist/review-flow-public.d.ts.map +1 -0
- package/dist/review-flow-public.js +11 -0
- package/dist/review-flow-public.js.map +1 -0
- package/dist/review-flow.d.ts +6 -0
- package/dist/review-flow.d.ts.map +1 -1
- package/dist/review-flow.js +1 -1
- package/dist/runtime-internals-public.d.ts +2 -0
- package/dist/runtime-internals-public.d.ts.map +1 -0
- package/dist/runtime-internals-public.js +16 -0
- package/dist/runtime-internals-public.js.map +1 -0
- package/dist/runtime-internals.js +2 -1
- package/dist/server-events.d.ts +67 -0
- package/dist/server-events.d.ts.map +1 -1
- package/dist/server-process-builder.d.ts +7 -0
- package/dist/server-process-builder.d.ts.map +1 -1
- package/dist/state-helpers.d.ts +6 -0
- package/dist/state-helpers.d.ts.map +1 -1
- package/dist/subprocess-env.d.ts +3 -0
- package/dist/subprocess-env.d.ts.map +1 -1
- package/dist/tool-arguments.d.ts +4 -2
- package/dist/tool-arguments.d.ts.map +1 -1
- package/dist/tool-renderers.d.ts +6 -0
- package/dist/tool-renderers.d.ts.map +1 -1
- package/dist/turn-semantics.d.ts +14 -1
- package/dist/turn-semantics.d.ts.map +1 -1
- package/dist/types.d.ts +205 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/ui-process-builder.d.ts +5 -0
- package/dist/ui-process-builder.d.ts.map +1 -1
- package/dist/worker-process-builder.d.ts +5 -0
- package/dist/worker-process-builder.d.ts.map +1 -1
- package/package.json +16 -15
- package/src/browser-ui-extension.ts +20 -0
- package/src/capabilities.ts +9 -1
- package/src/codecs.ts +1 -0
- package/src/commit-message.ts +5 -0
- package/src/core-capabilities.ts +398 -35
- package/src/define-process.ts +198 -23
- package/src/event-bus.ts +1 -0
- package/src/extension-api.ts +399 -55
- package/src/external-action-source.ts +7 -2
- package/src/external-source-poll.ts +72 -6
- package/src/flow.ts +352 -23
- package/src/form-contract.ts +0 -4
- package/src/fs-utils.ts +4 -0
- package/src/git-binary.ts +2 -1
- package/src/graph-fragments.ts +16 -0
- package/src/host-capabilities.ts +9 -6
- package/src/index.ts +14 -202
- package/src/integration-http.ts +15 -3
- package/src/json-data.ts +1 -1
- package/src/leaf-outcome-renderer.ts +35 -0
- package/src/leaf-outcomes.ts +3 -0
- package/src/model-provider.ts +169 -20
- package/src/pi-config-public.ts +7 -0
- package/src/pi-config.ts +47 -2
- package/src/process-definition-internals.ts +4 -0
- package/src/process-flow-view.ts +2 -0
- package/src/process-graph.ts +34 -0
- package/src/process-launcher-builder.ts +5 -0
- package/src/process-watcher-builder.ts +5 -0
- package/src/process-watcher-source.ts +6 -4
- package/src/project-binding.ts +5 -1
- package/src/registry-utils.ts +6 -0
- package/src/repository-feedback.ts +59 -5
- package/src/repository-git-env.ts +6 -2
- package/src/repository-http.ts +19 -2
- package/src/repository-https.ts +1 -1
- package/src/repository-issue-watcher.ts +64 -7
- package/src/repository-reconciliation.ts +30 -0
- package/src/repository-source-config.ts +66 -4
- package/src/repository-types.ts +43 -5
- package/src/review-flow-public.ts +5 -0
- package/src/review-flow.ts +6 -0
- package/src/runtime-internals-public.ts +7 -0
- package/src/server-events.ts +67 -0
- package/src/server-process-builder.ts +10 -1
- package/src/state-helpers.ts +6 -0
- package/src/subprocess-env.ts +3 -0
- package/src/tool-arguments.ts +4 -2
- package/src/tool-renderers.ts +6 -0
- package/src/turn-semantics.ts +15 -2
- package/src/types.ts +212 -30
- package/src/ui-process-builder.ts +8 -1
- package/src/worker-process-builder.ts +8 -1
- package/dist/chunk-LIIP7FMU.js.map +0 -1
- package/dist/chunk-TA4KO53Q.js.map +0 -1
- package/dist/chunk-WFY2WWZE.js.map +0 -1
package/dist/extension-api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Actor, InputKind, InputSource, LaunchModelConfigInput, ProcessCustomizableFields, ProcessInputTarget, ProcessInstance, ProcessLifecycleStatus, ProcessProject, ProcessSemanticEntryRefKey, ProcessTurnRecord, TurnId, TurnProgressReport } from "@leitwerk-dev/domain";
|
|
2
|
+
import type { ExternalWrites } from "@leitwerk-dev/external-writes";
|
|
2
3
|
import type { WatcherPresentationField } from "@leitwerk-dev/protocol";
|
|
3
4
|
import type { CapabilityToken } from "./capabilities.js";
|
|
4
5
|
import type { FormDefinition } from "./form-contract.js";
|
|
@@ -9,225 +10,376 @@ import type { ModelProviderSet } from "./model-provider.js";
|
|
|
9
10
|
import type { ServerExtensionEventMap, ServerExtensionEventPayloadInputMap } from "./server-events.js";
|
|
10
11
|
import type { ToolCallRendererDefinition } from "./tool-renderers.js";
|
|
11
12
|
import type { EventBus, PiTreeEntry, ProcessActionPreviewDefinition, ProcessActionSchedulingDefinition, ProcessPiConfig, TurnOptions } from "./types.js";
|
|
13
|
+
/** @public */
|
|
12
14
|
export interface Codec<T> {
|
|
15
|
+
/** @public */
|
|
13
16
|
parse(value: unknown): T;
|
|
17
|
+
/** @public */
|
|
14
18
|
serialize(value: T): unknown;
|
|
15
19
|
}
|
|
20
|
+
/** @internal */
|
|
16
21
|
export interface LauncherModelProfileSummary {
|
|
22
|
+
/** @internal */
|
|
17
23
|
readonly id: string;
|
|
24
|
+
/** @internal */
|
|
18
25
|
readonly provider: string;
|
|
26
|
+
/** @internal */
|
|
19
27
|
readonly modelId: string;
|
|
28
|
+
/** @internal */
|
|
20
29
|
readonly thinkingLevel: string;
|
|
21
30
|
}
|
|
31
|
+
/** @public */
|
|
22
32
|
export interface LauncherContext {
|
|
33
|
+
/** @internal */
|
|
23
34
|
readonly process?: ProcessInstance;
|
|
35
|
+
/** @internal */
|
|
24
36
|
readonly projects?: readonly ProcessProject[];
|
|
25
37
|
/**
|
|
26
38
|
* Effective model profiles available to this launch path.
|
|
27
39
|
* The server may filter this list per process (for example via process allowlists)
|
|
28
40
|
* before invoking UI launcher or process watcher code.
|
|
29
41
|
*/
|
|
42
|
+
/** @internal */
|
|
30
43
|
readonly modelProfiles?: readonly LauncherModelProfileSummary[];
|
|
31
44
|
}
|
|
45
|
+
/** @public */
|
|
32
46
|
export type LauncherVisibility = "ui";
|
|
47
|
+
/** @public */
|
|
33
48
|
export interface ProcessLaunchProjectConfig {
|
|
49
|
+
/** @public */
|
|
34
50
|
key: string;
|
|
51
|
+
/** @public */
|
|
35
52
|
repoLocator: string;
|
|
53
|
+
/** @public */
|
|
36
54
|
baseBranch: string;
|
|
55
|
+
/** @public */
|
|
37
56
|
workBranch?: string | null;
|
|
57
|
+
/** @public */
|
|
38
58
|
externalId?: string | null;
|
|
59
|
+
/** @public */
|
|
39
60
|
externalUrl?: string | null;
|
|
61
|
+
/** @public */
|
|
40
62
|
metadata?: Record<string, unknown> | null;
|
|
41
63
|
}
|
|
64
|
+
/** @public */
|
|
42
65
|
export interface ProcessTitleSourceField {
|
|
43
|
-
/** Short label shown to the title-generation model, e.g. "Prompt" or "Summary". */
|
|
66
|
+
/** Short label shown to the title-generation model, e.g. "Prompt" or "Summary". @public */
|
|
44
67
|
label: string;
|
|
45
|
-
/** Launcher-selected descriptive text to summarize into a short operator-facing title. */
|
|
68
|
+
/** Launcher-selected descriptive text to summarize into a short operator-facing title. @public */
|
|
46
69
|
value: string;
|
|
47
70
|
}
|
|
71
|
+
/** @public */
|
|
48
72
|
export interface ProcessLaunchConfig<TParams = unknown> {
|
|
73
|
+
/** @public */
|
|
49
74
|
processId: string;
|
|
75
|
+
/** @public */
|
|
50
76
|
params: TParams;
|
|
77
|
+
/** @public */
|
|
51
78
|
startTurnId?: TurnId | null;
|
|
52
|
-
/** Explicit operator-facing title. UI launches may override this with the built-in title input before persistence. */
|
|
79
|
+
/** Explicit operator-facing title. UI launches may override this with the built-in title input before persistence. @public */
|
|
53
80
|
title?: string | null;
|
|
54
|
-
/** Explicit launcher-selected fields for optional server-side title generation when title is blank. */
|
|
81
|
+
/** Explicit launcher-selected fields for optional server-side title generation when title is blank. @public */
|
|
55
82
|
titleSourceFields?: readonly ProcessTitleSourceField[];
|
|
83
|
+
/** @public */
|
|
56
84
|
externalId?: string | null;
|
|
85
|
+
/** @public */
|
|
57
86
|
externalUrl?: string | null;
|
|
87
|
+
/** @public */
|
|
58
88
|
metadata?: Record<string, unknown> | null;
|
|
89
|
+
/** @internal */
|
|
59
90
|
defaultModelProfileId?: string | null;
|
|
91
|
+
/** @internal */
|
|
60
92
|
turnConfigs?: Record<string, {
|
|
93
|
+
/** @internal */
|
|
61
94
|
modelProfileId?: string | null;
|
|
62
95
|
}>;
|
|
63
|
-
/** Skill ids resolved to active immutable revisions before process creation. */
|
|
96
|
+
/** Skill ids resolved to active immutable revisions before process creation. @internal */
|
|
64
97
|
skillIds?: readonly string[];
|
|
98
|
+
/** @public */
|
|
65
99
|
projects?: readonly ProcessLaunchProjectConfig[];
|
|
66
100
|
}
|
|
101
|
+
/** @public */
|
|
67
102
|
export type UiLauncherConfigResolution<TParams = unknown> = {
|
|
103
|
+
/** @public */
|
|
68
104
|
ok: true;
|
|
105
|
+
/** @public */
|
|
69
106
|
launchConfig: ProcessLaunchConfig<TParams>;
|
|
70
107
|
} | {
|
|
108
|
+
/** @public */
|
|
71
109
|
ok: false;
|
|
110
|
+
/** @public */
|
|
72
111
|
errors: readonly LauncherValidationError[];
|
|
73
112
|
};
|
|
113
|
+
/** @public */
|
|
74
114
|
export interface LaunchPreparationContext<TParams = unknown> {
|
|
115
|
+
/** @public */
|
|
75
116
|
readonly signal: AbortSignal;
|
|
117
|
+
/** @public */
|
|
76
118
|
readonly launchConfig: ProcessLaunchConfig<TParams>;
|
|
119
|
+
/** @public */
|
|
77
120
|
readonly logger: {
|
|
121
|
+
/** @internal */
|
|
78
122
|
info(message: string): void;
|
|
123
|
+
/** @public */
|
|
79
124
|
warn(message: string): void;
|
|
80
125
|
};
|
|
81
126
|
}
|
|
127
|
+
/** @public */
|
|
82
128
|
export interface LaunchPreparationCheck<TParams = unknown> {
|
|
129
|
+
/** @public */
|
|
83
130
|
readonly id: string;
|
|
131
|
+
/** @public */
|
|
84
132
|
readonly label: string;
|
|
133
|
+
/** @public */
|
|
85
134
|
run(ctx: LaunchPreparationContext<TParams>): Promise<void>;
|
|
86
135
|
}
|
|
87
|
-
/** A launcher check may throw this error to expose bounded operator-safe remediation. */
|
|
136
|
+
/** A launcher check may throw this error to expose bounded operator-safe remediation. @public */
|
|
88
137
|
export declare class SafeLaunchPreparationError extends Error {
|
|
138
|
+
/** @internal */
|
|
89
139
|
readonly safeSummary: string;
|
|
90
|
-
|
|
140
|
+
/** @public */
|
|
141
|
+
constructor(message: string,
|
|
142
|
+
/** @internal */
|
|
143
|
+
safeSummary: string);
|
|
91
144
|
}
|
|
145
|
+
/** @public */
|
|
92
146
|
export interface UiLauncherDefinition<TParams = unknown> {
|
|
147
|
+
/** @public */
|
|
93
148
|
card: LauncherCardMetadata;
|
|
149
|
+
/** @public */
|
|
94
150
|
launchConfigSchema: LauncherSchemaDefinition;
|
|
151
|
+
/** @public */
|
|
95
152
|
resolveDefaults?(ctx: LauncherContext): Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
153
|
+
/** @public */
|
|
96
154
|
resolveOptions?(input: Record<string, unknown>, ctx: LauncherContext): Record<string, readonly LauncherFieldOptionDefinition[]> | Promise<Record<string, readonly LauncherFieldOptionDefinition[]>>;
|
|
97
155
|
/**
|
|
98
156
|
* Convert persisted operator input into a new-launch draft. The default preserves
|
|
99
157
|
* the complete input. Launchers override this only for values that must be rebuilt.
|
|
100
158
|
*/
|
|
159
|
+
/** @public */
|
|
101
160
|
resolveRelaunchInput?(previousInput: Record<string, unknown>, ctx: LauncherContext): Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
161
|
+
/** @public */
|
|
102
162
|
preparationChecks?(input: Record<string, unknown>, launchConfig: ProcessLaunchConfig<TParams>): readonly LaunchPreparationCheck<TParams>[];
|
|
163
|
+
/** @public */
|
|
103
164
|
resolveLaunchConfig(input: Record<string, unknown>, ctx: LauncherContext): UiLauncherConfigResolution<TParams> | Promise<UiLauncherConfigResolution<TParams>>;
|
|
104
165
|
}
|
|
105
|
-
|
|
166
|
+
/** @public */
|
|
106
167
|
export interface ProcessWatcherPresentation {
|
|
168
|
+
/** @public */
|
|
107
169
|
readonly targetSummary: string;
|
|
170
|
+
/** @public */
|
|
108
171
|
readonly details?: readonly WatcherPresentationField[];
|
|
109
172
|
}
|
|
173
|
+
/** @public */
|
|
110
174
|
export interface ParsedProcessWatcherConfig<TConfig = unknown> {
|
|
175
|
+
/** @public */
|
|
111
176
|
readonly config: TConfig;
|
|
177
|
+
/** @public */
|
|
112
178
|
readonly enabled: boolean;
|
|
179
|
+
/** @public */
|
|
113
180
|
readonly launchModelConfig?: LaunchModelConfigInput;
|
|
114
181
|
}
|
|
115
|
-
/** A watcher source is defined and owned by the extension that implements it. */
|
|
182
|
+
/** A watcher source is defined and owned by the extension that implements it. @public */
|
|
116
183
|
export interface ProcessWatcherSource<TConfig = unknown, TEvent = unknown> {
|
|
184
|
+
/** @public */
|
|
117
185
|
readonly id: string;
|
|
186
|
+
/** @public */
|
|
118
187
|
readonly label: string;
|
|
119
|
-
/** Type-only marker used to carry the provider event type across the source seam. */
|
|
188
|
+
/** Type-only marker used to carry the provider event type across the source seam. @internal */
|
|
120
189
|
readonly eventType?: TEvent;
|
|
190
|
+
/** @public */
|
|
121
191
|
parseConfig(raw: unknown): ParsedProcessWatcherConfig<TConfig>;
|
|
192
|
+
/** @public */
|
|
122
193
|
presentConfig(config: TConfig): ProcessWatcherPresentation;
|
|
123
194
|
}
|
|
195
|
+
/** @public */
|
|
124
196
|
export interface ProcessWatcherDefinition<TParams = unknown, TEvent = unknown, TConfig = unknown> {
|
|
197
|
+
/** @public */
|
|
125
198
|
id: string;
|
|
199
|
+
/** @public */
|
|
126
200
|
label: string;
|
|
201
|
+
/** @public */
|
|
127
202
|
description: string;
|
|
203
|
+
/** @public */
|
|
128
204
|
source: ProcessWatcherSource<TConfig, TEvent>;
|
|
205
|
+
/** @internal */
|
|
129
206
|
matches?(event: TEvent, ctx: LauncherContext): boolean | Promise<boolean>;
|
|
207
|
+
/** @public */
|
|
130
208
|
preparationChecks?(event: TEvent, launchConfig: ProcessLaunchConfig<TParams>): readonly LaunchPreparationCheck<TParams>[];
|
|
209
|
+
/** @public */
|
|
131
210
|
resolveLaunchConfig(event: TEvent, ctx: LauncherContext): ProcessLaunchConfig<TParams> | Promise<ProcessLaunchConfig<TParams>>;
|
|
132
211
|
}
|
|
212
|
+
/** @public */
|
|
133
213
|
export interface ProcessLauncherDefinition<TParams = unknown> {
|
|
214
|
+
/** @public */
|
|
134
215
|
id: string;
|
|
216
|
+
/** @public */
|
|
135
217
|
label: string;
|
|
218
|
+
/** @public */
|
|
136
219
|
description: string;
|
|
220
|
+
/** @public */
|
|
137
221
|
visibility: LauncherVisibility;
|
|
222
|
+
/** @public */
|
|
138
223
|
ui: UiLauncherDefinition<TParams>;
|
|
139
224
|
}
|
|
225
|
+
/** @internal */
|
|
140
226
|
export interface ProcessLaunchPlanProcessInput extends ProcessCustomizableFields {
|
|
227
|
+
/** @internal */
|
|
141
228
|
processId: string;
|
|
229
|
+
/** @internal */
|
|
142
230
|
selectedTurnId: string | null;
|
|
231
|
+
/** @internal */
|
|
143
232
|
lifecycleStatus: ProcessLifecycleStatus;
|
|
233
|
+
/** @internal */
|
|
144
234
|
paramsJson: string | null;
|
|
235
|
+
/** @internal */
|
|
145
236
|
stateJson: string | null;
|
|
146
237
|
}
|
|
238
|
+
/** @internal */
|
|
147
239
|
export interface ProcessLaunchPlan {
|
|
240
|
+
/** @internal */
|
|
148
241
|
launcherId: string;
|
|
242
|
+
/** @internal */
|
|
149
243
|
processId: string;
|
|
244
|
+
/** @internal */
|
|
150
245
|
processInput: ProcessLaunchPlanProcessInput;
|
|
151
|
-
/** Optional server-owned idempotency key for cross-process handoffs. */
|
|
246
|
+
/** Optional server-owned idempotency key for cross-process handoffs. @internal */
|
|
152
247
|
handoffDedupKey?: string | null;
|
|
153
|
-
/** Carry-forward launcher-selected fields for optional server-side title generation. */
|
|
248
|
+
/** Carry-forward launcher-selected fields for optional server-side title generation. @internal */
|
|
154
249
|
titleSourceFields?: readonly ProcessTitleSourceField[];
|
|
250
|
+
/** @internal */
|
|
155
251
|
projectInputs: readonly ProcessLaunchProjectConfig[];
|
|
252
|
+
/** @internal */
|
|
156
253
|
startTurnId: TurnId | null;
|
|
254
|
+
/** @internal */
|
|
157
255
|
skillIds?: readonly string[];
|
|
158
256
|
}
|
|
257
|
+
/** @internal */
|
|
159
258
|
export interface ResolvedProcessLauncher<TParams = unknown> {
|
|
259
|
+
/** @internal */
|
|
160
260
|
launcherId: string;
|
|
261
|
+
/** @internal */
|
|
161
262
|
processId: string;
|
|
263
|
+
/** @internal */
|
|
162
264
|
displayName: string;
|
|
265
|
+
/** @internal */
|
|
163
266
|
launchConfig: ProcessLaunchConfig<TParams>;
|
|
267
|
+
/** @internal */
|
|
164
268
|
launchPlan: ProcessLaunchPlan;
|
|
165
269
|
}
|
|
270
|
+
/** @internal */
|
|
166
271
|
export type UiLauncherResolutionResult<TParams = unknown> = {
|
|
272
|
+
/** @internal */
|
|
167
273
|
ok: true;
|
|
274
|
+
/** @internal */
|
|
168
275
|
launcher: ResolvedProcessLauncher<TParams>;
|
|
169
276
|
} | {
|
|
277
|
+
/** @internal */
|
|
170
278
|
ok: false;
|
|
279
|
+
/** @internal */
|
|
171
280
|
errors: readonly LauncherValidationError[];
|
|
172
281
|
};
|
|
282
|
+
/** @internal */
|
|
173
283
|
export interface UiLauncherSummary extends UiLauncherSummaryBase {
|
|
174
284
|
}
|
|
285
|
+
/** @internal */
|
|
175
286
|
export interface ProcessLauncherService {
|
|
287
|
+
/** @internal */
|
|
176
288
|
listUiLaunchers(): readonly UiLauncherSummary[];
|
|
289
|
+
/** @internal */
|
|
177
290
|
resolveUiDefaults(launcherId: string, ctx?: LauncherContext): Promise<Record<string, unknown>>;
|
|
291
|
+
/** @internal */
|
|
178
292
|
resolveUiOptions(launcherId: string, input: Record<string, unknown>, ctx?: LauncherContext): Promise<Record<string, readonly LauncherFieldOptionDefinition[]>>;
|
|
293
|
+
/** @internal */
|
|
179
294
|
resolveUiRelaunchInput(launcherId: string, previousInput: Record<string, unknown>, ctx?: LauncherContext): Promise<Record<string, unknown>>;
|
|
295
|
+
/** @internal */
|
|
180
296
|
resolvePreparationChecks?(launcherId: string, input: Record<string, unknown>, launchConfig: ProcessLaunchConfig): readonly LaunchPreparationCheck[];
|
|
297
|
+
/** @internal */
|
|
181
298
|
resolveUiLauncher(launcherId: string, input: Record<string, unknown>, ctx?: LauncherContext): Promise<UiLauncherResolutionResult>;
|
|
182
299
|
}
|
|
183
|
-
/** Resolve a UI launcher summary by id, returning `null` when it is unknown. */
|
|
300
|
+
/** Resolve a UI launcher summary by id, returning `null` when it is unknown. @internal */
|
|
184
301
|
export declare function findUiLauncherById(launcherService: Pick<ProcessLauncherService, "listUiLaunchers">, launcherId: string): UiLauncherSummary | null;
|
|
302
|
+
/** @public */
|
|
185
303
|
export interface ProcessTurnOutcomeEvent {
|
|
304
|
+
/** @internal */
|
|
186
305
|
turnRecordId: string;
|
|
306
|
+
/** @internal */
|
|
187
307
|
turnId: string;
|
|
308
|
+
/** @internal */
|
|
188
309
|
outcome: string;
|
|
310
|
+
/** @public */
|
|
189
311
|
params: Record<string, unknown>;
|
|
312
|
+
/** @internal */
|
|
190
313
|
turnResultMarkdown?: string | null;
|
|
191
314
|
}
|
|
315
|
+
/** @internal */
|
|
192
316
|
export type ProcessCleanupReason = "abort";
|
|
317
|
+
/** @internal */
|
|
193
318
|
export interface ProcessCleanupResult<TState = unknown> extends ProcessLifecycleEffects {
|
|
319
|
+
/** @internal */
|
|
194
320
|
state?: TState;
|
|
195
321
|
}
|
|
322
|
+
/** @internal */
|
|
196
323
|
export interface ProcessCleanupContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
324
|
+
/** @internal */
|
|
197
325
|
readonly reason: ProcessCleanupReason;
|
|
198
326
|
}
|
|
327
|
+
/** @internal */
|
|
199
328
|
export type ProcessCleanupHandler<TParams = unknown, TState = unknown> = (ctx: ProcessCleanupContext<TParams, TState>) => undefined | ProcessCleanupResult<TState> | Promise<ProcessCleanupResult<TState> | undefined>;
|
|
329
|
+
/** @internal */
|
|
200
330
|
export interface LeafOutcomeCaptureContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
331
|
+
/** @internal */
|
|
201
332
|
readonly leaf: {
|
|
333
|
+
/** @internal */
|
|
202
334
|
entryId: string;
|
|
335
|
+
/** @internal */
|
|
203
336
|
turnRecordId: string | null;
|
|
204
337
|
};
|
|
338
|
+
/** @internal */
|
|
205
339
|
readonly turnRecord: ProcessTurnRecord | null;
|
|
340
|
+
/** @internal */
|
|
206
341
|
readTreeEntry(entryId: string): PiTreeEntry | null;
|
|
342
|
+
/** @internal */
|
|
207
343
|
readLeafEntry(): PiTreeEntry | null;
|
|
344
|
+
/** @internal */
|
|
208
345
|
readTurnRecord(turnRecordId: string): ProcessTurnRecord | null;
|
|
209
346
|
}
|
|
347
|
+
/** @internal */
|
|
210
348
|
export interface LeafOutcomeCaptureResult {
|
|
349
|
+
/** @internal */
|
|
211
350
|
rendererId: string;
|
|
351
|
+
/** @internal */
|
|
212
352
|
schemaVersion?: number;
|
|
353
|
+
/** @internal */
|
|
213
354
|
props: Record<string, unknown>;
|
|
355
|
+
/** @internal */
|
|
214
356
|
fallbackMarkdown?: string | null;
|
|
215
357
|
}
|
|
358
|
+
/** @internal */
|
|
216
359
|
export interface ProcessLeafOutcomeDefinition<TParams = unknown, TState = unknown> {
|
|
360
|
+
/** @internal */
|
|
217
361
|
rendererId: string;
|
|
362
|
+
/** @internal */
|
|
218
363
|
capture(ctx: LeafOutcomeCaptureContext<TParams, TState>): Promise<LeafOutcomeCaptureResult | null> | LeafOutcomeCaptureResult | null;
|
|
219
364
|
}
|
|
365
|
+
/** @internal */
|
|
220
366
|
export interface ProcessActionDefinition<TParams = unknown, TState = unknown> {
|
|
367
|
+
/** @internal */
|
|
221
368
|
id: string;
|
|
369
|
+
/** @internal */
|
|
222
370
|
label: string;
|
|
371
|
+
/** @internal */
|
|
223
372
|
form?: FormDefinition;
|
|
373
|
+
/** @internal */
|
|
224
374
|
preview?: ProcessActionPreviewDefinition;
|
|
375
|
+
/** @internal */
|
|
225
376
|
scheduling?: ProcessActionSchedulingDefinition;
|
|
226
377
|
/**
|
|
227
378
|
* Explicitly marks an action as an immediate-only side-effect command. Such
|
|
228
379
|
* actions must declare execute(...), cannot participate in pure preview or
|
|
229
380
|
* scheduling flows, and are run only by immediate action execution.
|
|
230
381
|
*/
|
|
382
|
+
/** @internal */
|
|
231
383
|
executionMode?: "side_effect";
|
|
232
384
|
/**
|
|
233
385
|
* Optional pure planner used for side-effect-free previews, scheduling validation,
|
|
@@ -235,66 +387,99 @@ export interface ProcessActionDefinition<TParams = unknown, TState = unknown> {
|
|
|
235
387
|
* transition/input/event plan from this hook without committing side effects
|
|
236
388
|
* while the hook runs.
|
|
237
389
|
*/
|
|
390
|
+
/** @internal */
|
|
238
391
|
plan?(input: Record<string, unknown>, ctx: ServerProcessContext<TParams, TState>): Promise<void>;
|
|
239
392
|
/**
|
|
240
393
|
* Imperative hook for actions with executionMode: "side_effect". Use only for
|
|
241
394
|
* immediate side effects that cannot be represented as a pure plan(...).
|
|
242
395
|
*/
|
|
396
|
+
/** @internal */
|
|
243
397
|
execute?(input: Record<string, unknown>, ctx: ServerProcessContext<TParams, TState>): Promise<void>;
|
|
244
398
|
}
|
|
399
|
+
/** @internal */
|
|
245
400
|
export type ServerTransitionRuntime = "reconcile" | "restart_worker";
|
|
401
|
+
/** @internal */
|
|
246
402
|
export interface ServerTransitionEffect {
|
|
247
403
|
/**
|
|
248
404
|
* Declares how the server runtime should handle the worker context after the
|
|
249
405
|
* durable transition is committed.
|
|
250
406
|
*/
|
|
407
|
+
/** @internal */
|
|
251
408
|
runtime?: ServerTransitionRuntime;
|
|
252
409
|
}
|
|
410
|
+
/** @internal */
|
|
253
411
|
export interface ServerTransitionRequest<TState = unknown> {
|
|
412
|
+
/** @internal */
|
|
254
413
|
lifecycleStatus?: ProcessLifecycleStatus;
|
|
414
|
+
/** @internal */
|
|
255
415
|
turnId?: TurnId | null;
|
|
416
|
+
/** @internal */
|
|
256
417
|
state?: TState;
|
|
257
|
-
/** State machine trigger for the selected-turn graph. */
|
|
418
|
+
/** State machine trigger for the selected-turn graph. @internal */
|
|
258
419
|
trigger?: string;
|
|
420
|
+
/** @internal */
|
|
259
421
|
effect?: ServerTransitionEffect;
|
|
260
422
|
}
|
|
423
|
+
/** @public */
|
|
261
424
|
export interface ProcessSnapshotContext<TParams = unknown, TState = unknown> {
|
|
425
|
+
/** @public */
|
|
262
426
|
readonly process: ProcessInstance;
|
|
427
|
+
/** @public */
|
|
263
428
|
readonly projects: readonly ProcessProject[];
|
|
429
|
+
/** @public */
|
|
264
430
|
readonly params: TParams;
|
|
431
|
+
/** @public */
|
|
265
432
|
readonly state: TState;
|
|
266
433
|
}
|
|
434
|
+
/** @public */
|
|
267
435
|
export type ExternalSourceInputMode = "none" | "input" | "instruction";
|
|
436
|
+
/** @public */
|
|
268
437
|
export interface ExternalSourceResolveContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
269
438
|
}
|
|
439
|
+
/** @public */
|
|
270
440
|
export interface ExternalSourceEffectContext<TParams = unknown, TState = unknown, TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>> extends ProcessSnapshotContext<TParams, TState> {
|
|
441
|
+
/** @public */
|
|
271
442
|
readonly event: TEvent;
|
|
443
|
+
/** @internal */
|
|
272
444
|
readonly input: TInput;
|
|
273
445
|
}
|
|
446
|
+
/** @public */
|
|
274
447
|
export type ExternalSourceEffect<TParams = unknown, TState = unknown, TEvent = unknown, TInput extends Record<string, unknown> = Record<string, unknown>> = (ctx: ExternalSourceEffectContext<TParams, TState, TEvent, TInput>) => ProcessEffectPlan<TState> | Promise<ProcessEffectPlan<TState> | undefined> | undefined;
|
|
448
|
+
/** @public */
|
|
275
449
|
export interface ExternalEventDescription {
|
|
450
|
+
/** @public */
|
|
276
451
|
summary: string;
|
|
452
|
+
/** @internal */
|
|
277
453
|
markdown?: string;
|
|
454
|
+
/** @public */
|
|
278
455
|
links?: import("@leitwerk-dev/domain").TurnProgressLink[];
|
|
279
456
|
}
|
|
457
|
+
/** @public */
|
|
280
458
|
export interface ExternalActionSource<TParams = unknown, TState = unknown, _TEvent = unknown, _TInput extends Record<string, unknown> = Record<string, unknown>> {
|
|
459
|
+
/** @public */
|
|
281
460
|
kind: string;
|
|
461
|
+
/** @public */
|
|
282
462
|
label?: string;
|
|
463
|
+
/** @public */
|
|
283
464
|
description?: string;
|
|
284
|
-
/** Pure description captured when the event is consumed. */
|
|
465
|
+
/** Pure description captured when the event is consumed. @public */
|
|
285
466
|
describeEvent?(event: _TEvent): ExternalEventDescription;
|
|
286
467
|
/**
|
|
287
468
|
* Extension-owned opaque config. Core may persist, hash, and display it, but must not
|
|
288
469
|
* interpret provider-specific fields.
|
|
289
470
|
*/
|
|
471
|
+
/** @public */
|
|
290
472
|
config: unknown;
|
|
291
|
-
/** Source-provided input behavior. Provider input is only published when the external action declares publishInput. */
|
|
473
|
+
/** Source-provided input behavior. Provider input is only published when the external action declares publishInput. @public */
|
|
292
474
|
inputMode?: ExternalSourceInputMode;
|
|
293
|
-
/** Optional extension-owned resolver for process-instance-specific matching. */
|
|
475
|
+
/** Optional extension-owned resolver for process-instance-specific matching. @public */
|
|
294
476
|
resolve?(ctx: ExternalSourceResolveContext<TParams, TState>): unknown;
|
|
295
477
|
}
|
|
478
|
+
/** @public */
|
|
296
479
|
export interface ServerProcessContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
480
|
+
/** @internal */
|
|
297
481
|
transition(next: ServerTransitionRequest<TState>): Promise<void>;
|
|
482
|
+
/** @internal */
|
|
298
483
|
emitEvent<K extends keyof ServerExtensionEventMap & string>(eventType: K, data: ServerExtensionEventPayloadInputMap[K]): void;
|
|
299
484
|
/**
|
|
300
485
|
* Resolves non-empty turn-result markdown for the current semantic ref.
|
|
@@ -302,6 +487,7 @@ export interface ServerProcessContext<TParams = unknown, TState = unknown> exten
|
|
|
302
487
|
* carry operator-facing markdown. Throws when persisted semantic-ref state is
|
|
303
488
|
* malformed.
|
|
304
489
|
*/
|
|
490
|
+
/** @internal */
|
|
305
491
|
readSemanticTurnResultMarkdown(ref: ProcessSemanticEntryRefKey): string | null;
|
|
306
492
|
/**
|
|
307
493
|
* Resolves non-empty turn-result markdown for a process-defined published product.
|
|
@@ -309,6 +495,7 @@ export interface ServerProcessContext<TParams = unknown, TState = unknown> exten
|
|
|
309
495
|
* not carry operator-facing markdown. Throws when persisted product-ref state is
|
|
310
496
|
* malformed.
|
|
311
497
|
*/
|
|
498
|
+
/** @internal */
|
|
312
499
|
readProductTurnResultMarkdown(productName: string): string | null;
|
|
313
500
|
/**
|
|
314
501
|
* Queue durable process input for worker delivery.
|
|
@@ -319,10 +506,15 @@ export interface ServerProcessContext<TParams = unknown, TState = unknown> exten
|
|
|
319
506
|
* input is the only new instruction: the worker does not replay the original
|
|
320
507
|
* kickoff prompt.
|
|
321
508
|
*/
|
|
509
|
+
/** @public */
|
|
322
510
|
queueInput(input: {
|
|
511
|
+
/** @public */
|
|
323
512
|
source: InputSource;
|
|
513
|
+
/** @public */
|
|
324
514
|
kind: InputKind;
|
|
515
|
+
/** @public */
|
|
325
516
|
bodyMarkdown: string;
|
|
517
|
+
/** @public */
|
|
326
518
|
target?: ProcessInputTarget;
|
|
327
519
|
}): void;
|
|
328
520
|
/**
|
|
@@ -330,104 +522,160 @@ export interface ServerProcessContext<TParams = unknown, TState = unknown> exten
|
|
|
330
522
|
* helpers. Raw process definitions should prefer intent helpers instead of
|
|
331
523
|
* constructing these effects directly.
|
|
332
524
|
*/
|
|
525
|
+
/** @internal */
|
|
333
526
|
applyLifecycleEffects?(effects: ProcessLifecycleEffects): void;
|
|
334
527
|
}
|
|
528
|
+
/** @public */
|
|
335
529
|
export interface WorkerProcessContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
530
|
+
/** @internal */
|
|
336
531
|
readonly turnResultMarkdownBySemanticRef?: Partial<Record<ProcessSemanticEntryRefKey, string>>;
|
|
532
|
+
/** @internal */
|
|
337
533
|
readonly turnResultMarkdownByProduct?: Readonly<Record<string, string>>;
|
|
338
|
-
/** Absolute workspace root for the current process instance, when available. */
|
|
534
|
+
/** Absolute workspace root for the current process instance, when available. @internal */
|
|
339
535
|
readonly workspaceRoot?: string;
|
|
340
|
-
/** Durable output produced by this LLM turn's preparation phase, when declared. */
|
|
536
|
+
/** Durable output produced by this LLM turn's preparation phase, when declared. @internal */
|
|
341
537
|
readonly prepared?: unknown;
|
|
342
|
-
/** Invoke a server-owned integration tool authorized for this automatic turn or LLM preparation. */
|
|
538
|
+
/** Invoke a server-owned integration tool authorized for this automatic turn or LLM preparation. @internal */
|
|
343
539
|
callIntegrationTool?(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
344
|
-
/** Replace the durable operator-facing progress report for this turn attempt. */
|
|
540
|
+
/** Replace the durable operator-facing progress report for this turn attempt. @internal */
|
|
345
541
|
reportProgress?(report: TurnProgressReport): void;
|
|
346
542
|
}
|
|
543
|
+
/** @public */
|
|
347
544
|
export interface WorkerCompleteInput<TOutcome extends string = string> {
|
|
545
|
+
/** @internal */
|
|
348
546
|
outcome: TOutcome;
|
|
547
|
+
/** @internal */
|
|
349
548
|
params?: Record<string, unknown>;
|
|
549
|
+
/** @internal */
|
|
350
550
|
markdown?: string | null;
|
|
551
|
+
/** @internal */
|
|
351
552
|
resultSummary?: string;
|
|
352
553
|
}
|
|
554
|
+
/** @internal */
|
|
353
555
|
export interface WorkerRunHandle<TParams = unknown, TState = unknown> {
|
|
556
|
+
/** @internal */
|
|
354
557
|
readonly ctx: WorkerProcessContext<TParams, TState>;
|
|
558
|
+
/** @internal */
|
|
355
559
|
turn<TOutcome extends string>(def: LlmTurnDefinition<TOutcome, TParams, TState>, options?: TurnOptions): Promise<{
|
|
560
|
+
/** @internal */
|
|
356
561
|
outcome: TOutcome;
|
|
562
|
+
/** @internal */
|
|
357
563
|
params: Record<string, unknown>;
|
|
358
564
|
}>;
|
|
565
|
+
/** @internal */
|
|
359
566
|
complete<TOutcome extends string>(input: WorkerCompleteInput<TOutcome>): Promise<void>;
|
|
567
|
+
/** @internal */
|
|
360
568
|
park(reason?: string): void;
|
|
361
569
|
}
|
|
570
|
+
/** @internal */
|
|
362
571
|
export type WorkerTurnHandler<TParams = unknown, TState = unknown> = (run: WorkerRunHandle<TParams, TState>) => Promise<void>;
|
|
572
|
+
/** @internal */
|
|
363
573
|
export interface ServerProcessAPI<TParams = unknown, TState = unknown> {
|
|
574
|
+
/** @internal */
|
|
364
575
|
action(def: ProcessActionDefinition<TParams, TState>): void;
|
|
576
|
+
/** @internal */
|
|
365
577
|
onTurnOutcome(turnId: string, handler: (event: ProcessTurnOutcomeEvent, ctx: ServerProcessContext<TParams, TState>) => void | Promise<void>): void;
|
|
578
|
+
/** @internal */
|
|
366
579
|
onCleanup(handler: ProcessCleanupHandler<TParams, TState>): void;
|
|
367
580
|
}
|
|
581
|
+
/** @internal */
|
|
368
582
|
export interface WorkerProcessAPI<TParams = unknown, TState = unknown> {
|
|
583
|
+
/** @internal */
|
|
369
584
|
start(turnId: TurnId): void;
|
|
585
|
+
/** @internal */
|
|
370
586
|
turn(turnId: TurnId, handler: WorkerTurnHandler<TParams, TState>): void;
|
|
371
587
|
}
|
|
588
|
+
/** @public */
|
|
372
589
|
export interface UiProcessAPI<TParams = unknown, TState = unknown> {
|
|
590
|
+
/** @internal */
|
|
373
591
|
leafOutcome(def: ProcessLeafOutcomeDefinition<TParams, TState>): void;
|
|
374
592
|
}
|
|
593
|
+
/** @public */
|
|
375
594
|
export interface ProcessLauncherAPI<TParams = unknown> {
|
|
595
|
+
/** @public */
|
|
376
596
|
launcher(def: ProcessLauncherDefinition<TParams>): void;
|
|
377
597
|
}
|
|
598
|
+
/** @public */
|
|
378
599
|
export interface ProcessWatcherAPI<TParams = unknown> {
|
|
600
|
+
/** @public */
|
|
379
601
|
watcher<TEvent = unknown, TConfig = unknown>(def: ProcessWatcherDefinition<TParams, TEvent, TConfig>): void;
|
|
380
602
|
}
|
|
603
|
+
/** @public */
|
|
381
604
|
export interface ProcessTurnBinding<TTurn = TurnDefinition> {
|
|
605
|
+
/** @public */
|
|
382
606
|
definition: TTurn;
|
|
383
607
|
}
|
|
608
|
+
/** @public */
|
|
384
609
|
export type RepositoryCredentialKind = "git_ssh" | "git_https";
|
|
385
|
-
/** Non-secret, code-defined repository authentication request. */
|
|
610
|
+
/** Non-secret, code-defined repository authentication request. @public */
|
|
386
611
|
export interface RepositoryCredentialRequirement {
|
|
612
|
+
/** @public */
|
|
387
613
|
readonly projectKey: string;
|
|
614
|
+
/** @public */
|
|
388
615
|
readonly kind: RepositoryCredentialKind;
|
|
616
|
+
/** @public */
|
|
389
617
|
readonly credentialRef: string;
|
|
390
618
|
}
|
|
391
|
-
/** Project fields available while deriving repository credential requirements. */
|
|
619
|
+
/** Project fields available while deriving repository credential requirements. @public */
|
|
392
620
|
export interface RepositoryCredentialProject {
|
|
621
|
+
/** @internal */
|
|
393
622
|
readonly key: string;
|
|
623
|
+
/** @internal */
|
|
394
624
|
readonly repoLocator: string;
|
|
625
|
+
/** @internal */
|
|
395
626
|
readonly baseBranch: string;
|
|
627
|
+
/** @internal */
|
|
396
628
|
readonly workBranch: string | null;
|
|
397
629
|
}
|
|
398
|
-
/** Secret material is intentionally restricted to server registration and worker.start. */
|
|
630
|
+
/** Secret material is intentionally restricted to server registration and worker.start. @internal */
|
|
399
631
|
export interface GitSshCredentialMaterial {
|
|
632
|
+
/** @internal */
|
|
400
633
|
readonly privateKey: string;
|
|
634
|
+
/** @internal */
|
|
401
635
|
readonly knownHosts: string;
|
|
402
636
|
}
|
|
637
|
+
/** @internal */
|
|
403
638
|
export interface GitHttpsCredentialMaterial {
|
|
404
|
-
/** HTTPS origin authorized by the credential-owning extension. */
|
|
639
|
+
/** HTTPS origin authorized by the credential-owning extension. @internal */
|
|
405
640
|
readonly origin: string;
|
|
641
|
+
/** @internal */
|
|
406
642
|
readonly username: string;
|
|
643
|
+
/** @internal */
|
|
407
644
|
readonly password: string;
|
|
408
645
|
}
|
|
646
|
+
/** @internal */
|
|
409
647
|
export type RepositoryCredentialProvider = {
|
|
648
|
+
/** @internal */
|
|
410
649
|
readonly kind: "git_ssh";
|
|
650
|
+
/** @internal */
|
|
411
651
|
resolve(credentialRef: string): GitSshCredentialMaterial | null;
|
|
412
652
|
} | {
|
|
653
|
+
/** @internal */
|
|
413
654
|
readonly kind: "git_https";
|
|
655
|
+
/** @internal */
|
|
414
656
|
resolve(credentialRef: string): GitHttpsCredentialMaterial | null;
|
|
415
657
|
};
|
|
658
|
+
/** @internal */
|
|
416
659
|
export interface RepositoryCredentialRegistrar {
|
|
660
|
+
/** @internal */
|
|
417
661
|
register(provider: RepositoryCredentialProvider): void;
|
|
418
662
|
}
|
|
663
|
+
/** @public */
|
|
419
664
|
export interface ProcessRuntimeCapabilities {
|
|
420
|
-
/** Install repository-declared development tools with mise before accepting work. */
|
|
665
|
+
/** Install repository-declared development tools with mise before accepting work. @internal */
|
|
421
666
|
readonly developmentTools?: boolean;
|
|
422
|
-
/** Require a Docker CLI connected to a private or explicitly acknowledged daemon. */
|
|
667
|
+
/** Require a Docker CLI connected to a private or explicitly acknowledged daemon. @public */
|
|
423
668
|
readonly docker?: boolean;
|
|
424
669
|
}
|
|
670
|
+
/** @public */
|
|
425
671
|
export interface ExtensionProcessDefinition<TParams = unknown, TState = unknown> {
|
|
672
|
+
/** @public */
|
|
426
673
|
id: string;
|
|
674
|
+
/** @public */
|
|
427
675
|
displayName: string;
|
|
428
|
-
/** Primary entry used when a launch does not select a start turn explicitly. */
|
|
676
|
+
/** Primary entry used when a launch does not select a start turn explicitly. @public */
|
|
429
677
|
entryTurnId: TurnId;
|
|
430
|
-
/** Additional entry turns that launchers may select explicitly. */
|
|
678
|
+
/** Additional entry turns that launchers may select explicitly. @public */
|
|
431
679
|
alternateEntryTurnIds?: readonly TurnId[];
|
|
432
680
|
/**
|
|
433
681
|
* Optional author-declared happy path: the ordered spine of turns a successful
|
|
@@ -435,12 +683,17 @@ export interface ExtensionProcessDefinition<TParams = unknown, TState = unknown>
|
|
|
435
683
|
* other turn off it as a branch. When omitted, consumers fall back to a derived
|
|
436
684
|
* best-effort spine.
|
|
437
685
|
*/
|
|
686
|
+
/** @public */
|
|
438
687
|
happyPath?: readonly TurnId[];
|
|
688
|
+
/** @public */
|
|
439
689
|
turns: ReadonlyMap<TurnId, ProcessTurnBinding<TurnDefinition<TParams, TState>>>;
|
|
690
|
+
/** @public */
|
|
440
691
|
paramsCodec: Codec<TParams>;
|
|
692
|
+
/** @public */
|
|
441
693
|
stateCodec: Codec<TState>;
|
|
694
|
+
/** @public */
|
|
442
695
|
initialState(params: TParams): TState;
|
|
443
|
-
/** Process-owned runtime capabilities. All capabilities default to disabled. */
|
|
696
|
+
/** Process-owned runtime capabilities. All capabilities default to disabled. @public */
|
|
444
697
|
runtime?: ProcessRuntimeCapabilities;
|
|
445
698
|
/**
|
|
446
699
|
* Server-only Kubernetes process-volume size, derived from extension configuration.
|
|
@@ -448,130 +701,212 @@ export interface ExtensionProcessDefinition<TParams = unknown, TState = unknown>
|
|
|
448
701
|
* Called before provisioning on worker starts. Must be synchronous and side-effect free;
|
|
449
702
|
* repeated calls never resize or replace an existing volume.
|
|
450
703
|
*/
|
|
704
|
+
/** @internal */
|
|
451
705
|
resolveStorageSize?(input: {
|
|
706
|
+
/** @internal */
|
|
452
707
|
params: TParams;
|
|
708
|
+
/** @internal */
|
|
453
709
|
projects: readonly ProcessProject[];
|
|
454
710
|
}): string | undefined;
|
|
455
|
-
/** Runtime-only requirements; references are non-secret and remain in opaque params JSON. */
|
|
711
|
+
/** Runtime-only requirements; references are non-secret and remain in opaque params JSON. @public */
|
|
456
712
|
repositoryCredentials?(input: {
|
|
713
|
+
/** @public */
|
|
457
714
|
params: TParams;
|
|
715
|
+
/** @public */
|
|
458
716
|
projects: readonly RepositoryCredentialProject[];
|
|
459
717
|
}): readonly RepositoryCredentialRequirement[];
|
|
718
|
+
/** @public */
|
|
460
719
|
piConfig?: ProcessPiConfig;
|
|
720
|
+
/** @internal */
|
|
461
721
|
server?: (api: ServerProcessAPI<TParams, TState>) => void;
|
|
722
|
+
/** @internal */
|
|
462
723
|
worker?: (api: WorkerProcessAPI<TParams, TState>) => void;
|
|
724
|
+
/** @public */
|
|
463
725
|
ui?: (api: UiProcessAPI<TParams, TState>) => void;
|
|
726
|
+
/** @public */
|
|
464
727
|
launchers?: (api: ProcessLauncherAPI<TParams>) => void;
|
|
728
|
+
/** @public */
|
|
465
729
|
watchers?: (api: ProcessWatcherAPI<TParams>) => void;
|
|
466
730
|
}
|
|
731
|
+
/** @public */
|
|
467
732
|
export interface CatalogExtensionAPI {
|
|
733
|
+
/** @internal */
|
|
468
734
|
readonly events: EventBus;
|
|
735
|
+
/** @public */
|
|
469
736
|
registerProcess<TParams = unknown, TState = unknown>(def: ExtensionProcessDefinition<TParams, TState>): void;
|
|
737
|
+
/** @internal */
|
|
470
738
|
registerToolRenderer(def: ToolCallRendererDefinition): void;
|
|
739
|
+
/** @internal */
|
|
471
740
|
provide<T>(token: CapabilityToken<T>, value: T): void;
|
|
741
|
+
/** @internal */
|
|
472
742
|
get<T>(token: CapabilityToken<T>): T | T[] | undefined;
|
|
743
|
+
/** @internal */
|
|
473
744
|
require<T>(token: CapabilityToken<T>): T | T[];
|
|
474
745
|
}
|
|
746
|
+
/** @public */
|
|
475
747
|
export type ExtensionLifecycleHook = () => void | Promise<void>;
|
|
748
|
+
/** @public */
|
|
476
749
|
export interface ServerExtensionLogger {
|
|
750
|
+
/** @public */
|
|
477
751
|
info?(payload: Record<string, unknown>, message?: string): void;
|
|
752
|
+
/** @public */
|
|
478
753
|
warn?(payload: Record<string, unknown>, message?: string): void;
|
|
754
|
+
/** @public */
|
|
479
755
|
error?(payload: Record<string, unknown>, message?: string): void;
|
|
480
756
|
}
|
|
757
|
+
/** @public */
|
|
481
758
|
export interface TicketCreationDestinationSummary {
|
|
482
|
-
/** Adapter-owned opaque identifier. Browsers must not construct or interpret it. */
|
|
759
|
+
/** Adapter-owned opaque identifier. Browsers must not construct or interpret it. @public */
|
|
483
760
|
readonly id: string;
|
|
761
|
+
/** @public */
|
|
484
762
|
readonly displayName: string;
|
|
763
|
+
/** @public */
|
|
485
764
|
readonly group?: string;
|
|
765
|
+
/** @public */
|
|
486
766
|
readonly description?: string;
|
|
487
767
|
}
|
|
768
|
+
/** @public */
|
|
488
769
|
export interface TicketCreationDestinationList {
|
|
770
|
+
/** @public */
|
|
489
771
|
readonly destinations: readonly TicketCreationDestinationSummary[];
|
|
772
|
+
/** @public */
|
|
490
773
|
readonly warnings?: readonly string[];
|
|
491
774
|
}
|
|
775
|
+
/** @public */
|
|
492
776
|
export interface TicketCreationDestinationSnapshot {
|
|
777
|
+
/** @public */
|
|
493
778
|
readonly summary: TicketCreationDestinationSummary;
|
|
494
|
-
/** Adapter-owned, JSON-serializable immutable destination state. */
|
|
779
|
+
/** Adapter-owned, JSON-serializable immutable destination state. @public */
|
|
495
780
|
readonly data: unknown;
|
|
496
|
-
/** Untrusted destination context included in the ticket agent prompt. */
|
|
781
|
+
/** Untrusted destination context included in the ticket agent prompt. @public */
|
|
497
782
|
readonly agentContext?: string;
|
|
498
783
|
}
|
|
784
|
+
/** @public */
|
|
499
785
|
export interface TicketCreationDestinationContext {
|
|
786
|
+
/** @public */
|
|
500
787
|
readonly actor: Actor;
|
|
501
788
|
}
|
|
789
|
+
/** @public */
|
|
502
790
|
export interface TicketCreationDestinationProvider {
|
|
791
|
+
/** @public */
|
|
503
792
|
list(ctx: TicketCreationDestinationContext): Promise<TicketCreationDestinationList>;
|
|
793
|
+
/** @public */
|
|
504
794
|
resolve(ctx: TicketCreationDestinationContext & {
|
|
795
|
+
/** @public */
|
|
505
796
|
destinationId: string;
|
|
506
797
|
}): Promise<TicketCreationDestinationSnapshot>;
|
|
507
|
-
/** Rejects stale, renamed, transferred, or otherwise invalid snapshots. */
|
|
798
|
+
/** Rejects stale, renamed, transferred, or otherwise invalid snapshots. @public */
|
|
508
799
|
validate(snapshot: TicketCreationDestinationSnapshot): Promise<void>;
|
|
509
800
|
}
|
|
801
|
+
/** @public */
|
|
510
802
|
export interface TicketCreationCapability {
|
|
803
|
+
/** @public */
|
|
511
804
|
readonly kind: "ticket_creation";
|
|
805
|
+
/** @public */
|
|
512
806
|
readonly displayName: string;
|
|
513
|
-
/** Extension-owned process launched by the generic derived-ticket route. */
|
|
807
|
+
/** Extension-owned process launched by the generic derived-ticket route. @public */
|
|
514
808
|
readonly processId: string;
|
|
515
|
-
/** Entry turn selected when the derived process starts. */
|
|
809
|
+
/** Entry turn selected when the derived process starts. @public */
|
|
516
810
|
readonly startTurnId: TurnId;
|
|
517
|
-
/** RFC 6901 JSON Pointer into the tool arguments. */
|
|
811
|
+
/** RFC 6901 JSON Pointer into the tool arguments. @public */
|
|
518
812
|
readonly titlePath?: string;
|
|
519
|
-
/** RFC 6901 JSON Pointer into the tool arguments. */
|
|
813
|
+
/** RFC 6901 JSON Pointer into the tool arguments. @public */
|
|
520
814
|
readonly descriptionPath?: string;
|
|
815
|
+
/** @public */
|
|
521
816
|
readonly destinations?: TicketCreationDestinationProvider;
|
|
522
817
|
}
|
|
818
|
+
/** @internal */
|
|
523
819
|
export interface TicketCreationReceipt {
|
|
820
|
+
/** @internal */
|
|
524
821
|
readonly externalId: string;
|
|
822
|
+
/** @internal */
|
|
525
823
|
readonly url: string;
|
|
824
|
+
/** @internal */
|
|
526
825
|
readonly result?: unknown;
|
|
527
826
|
}
|
|
827
|
+
/** @public */
|
|
528
828
|
export interface IntegrationToolExecutionContext {
|
|
829
|
+
/** Process-bound coordination; storage remains server-owned. */
|
|
830
|
+
/** @public */
|
|
831
|
+
readonly externalWrites: ExternalWrites;
|
|
832
|
+
/** @public */
|
|
529
833
|
readonly process: ProcessInstance;
|
|
834
|
+
/** @public */
|
|
530
835
|
readonly projects: readonly ProcessProject[];
|
|
836
|
+
/** @public */
|
|
531
837
|
readonly turn: ProcessTurnRecord;
|
|
838
|
+
/** @public */
|
|
532
839
|
readonly project: ProcessProject | null;
|
|
840
|
+
/** @public */
|
|
533
841
|
readonly ticketDestination?: TicketCreationDestinationSnapshot;
|
|
534
|
-
/** Stable for a single Pi tool call, including reconnect/replay. */
|
|
842
|
+
/** Stable for a single Pi tool call, including reconnect/replay. @public */
|
|
535
843
|
readonly idempotencyKey: string;
|
|
536
|
-
/** Aborted when the worker stops waiting for this tool call. */
|
|
844
|
+
/** Aborted when the worker stops waiting for this tool call. @public */
|
|
537
845
|
readonly signal: AbortSignal;
|
|
538
846
|
}
|
|
847
|
+
/** @public */
|
|
539
848
|
export interface IntegrationToolDefinition<TArgs = Record<string, unknown>> {
|
|
849
|
+
/** @public */
|
|
540
850
|
readonly name: string;
|
|
851
|
+
/** @public */
|
|
541
852
|
readonly description: string;
|
|
853
|
+
/** @public */
|
|
542
854
|
readonly parameters: Record<string, unknown>;
|
|
543
|
-
/** Sanitized discovery metadata; credentials and adapter configuration never belong here. */
|
|
855
|
+
/** Sanitized discovery metadata; credentials and adapter configuration never belong here. @public */
|
|
544
856
|
readonly capability?: TicketCreationCapability;
|
|
857
|
+
/** @internal */
|
|
545
858
|
parse?(value: unknown): TArgs;
|
|
859
|
+
/** @public */
|
|
546
860
|
execute(ctx: IntegrationToolExecutionContext, args: TArgs): Promise<unknown>;
|
|
547
861
|
}
|
|
862
|
+
/** @public */
|
|
548
863
|
export interface ServerExtensionAPI {
|
|
864
|
+
/** @internal */
|
|
549
865
|
readonly events: EventBus<ServerExtensionEventMap>;
|
|
866
|
+
/** @public */
|
|
550
867
|
readonly logger?: ServerExtensionLogger;
|
|
868
|
+
/** @public */
|
|
551
869
|
provide<T>(token: CapabilityToken<T>, value: T): void;
|
|
870
|
+
/** @public */
|
|
552
871
|
get<T>(token: CapabilityToken<T>): T | T[] | undefined;
|
|
872
|
+
/** @public */
|
|
553
873
|
require<T>(token: CapabilityToken<T>): T | T[];
|
|
874
|
+
/** @public */
|
|
554
875
|
tool<TArgs>(definition: IntegrationToolDefinition<TArgs>): void;
|
|
876
|
+
/** @internal */
|
|
555
877
|
onStart(handler: ExtensionLifecycleHook): void;
|
|
878
|
+
/** @public */
|
|
556
879
|
onStop(handler: ExtensionLifecycleHook): void;
|
|
557
880
|
}
|
|
881
|
+
/** @internal */
|
|
558
882
|
export interface WorkerExtensionAPI {
|
|
883
|
+
/** @internal */
|
|
559
884
|
readonly events: EventBus;
|
|
885
|
+
/** @internal */
|
|
560
886
|
get<T>(token: CapabilityToken<T>): T | T[] | undefined;
|
|
887
|
+
/** @internal */
|
|
561
888
|
require<T>(token: CapabilityToken<T>): T | T[];
|
|
562
889
|
}
|
|
563
|
-
|
|
564
|
-
id: string;
|
|
565
|
-
version: string;
|
|
566
|
-
requires?: readonly string[];
|
|
567
|
-
optional?: readonly string[];
|
|
568
|
-
}
|
|
890
|
+
/** @public */
|
|
569
891
|
export interface LeitwerkExtensionModule {
|
|
570
|
-
|
|
571
|
-
|
|
892
|
+
/** @public */
|
|
893
|
+
manifest: {
|
|
894
|
+
/** @public */
|
|
895
|
+
id: string;
|
|
896
|
+
/** @public */
|
|
897
|
+
version: string;
|
|
898
|
+
/** @public */
|
|
899
|
+
requires?: readonly string[];
|
|
900
|
+
/** @internal */
|
|
901
|
+
optional?: readonly string[];
|
|
902
|
+
};
|
|
903
|
+
/** Resolves every provider owned by this extension before setupServer. @public */
|
|
572
904
|
modelProviders?: ModelProviderSet;
|
|
905
|
+
/** @public */
|
|
573
906
|
setupCatalog?(api: CatalogExtensionAPI): void | Promise<void>;
|
|
907
|
+
/** @public */
|
|
574
908
|
setupServer?(api: ServerExtensionAPI, config: unknown): void | Promise<void>;
|
|
909
|
+
/** @internal */
|
|
575
910
|
setupWorker?(api: WorkerExtensionAPI, config: unknown): void | Promise<void>;
|
|
576
911
|
}
|
|
577
912
|
//# sourceMappingURL=extension-api.d.ts.map
|