@leitwerk-dev/process-sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-I7U6HCLN.js → chunk-HT2AXXLH.js} +2 -1
- package/dist/chunk-HT2AXXLH.js.map +1 -0
- package/dist/core-capabilities.d.ts +57 -1
- package/dist/core-capabilities.d.ts.map +1 -1
- package/dist/define-process.d.ts +43 -26
- package/dist/define-process.d.ts.map +1 -1
- package/dist/{extension-api-3Vr3RE8S.d.ts → extension-api-Ljc4UTZ0.d.ts} +440 -49
- package/dist/extension-api.d.ts +66 -0
- package/dist/extension-api.d.ts.map +1 -1
- package/dist/external-source-poll.d.ts +1 -1
- package/dist/external-source-poll.d.ts.map +1 -1
- package/dist/file-external-source.d.ts +32 -0
- package/dist/file-external-source.d.ts.map +1 -0
- package/dist/flow-mapped.typecheck.d.ts +2 -0
- package/dist/flow-mapped.typecheck.d.ts.map +1 -0
- package/dist/flow.d.ts +234 -118
- package/dist/flow.d.ts.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4189 -3534
- package/dist/index.js.map +1 -1
- package/dist/mapped-turn.d.ts +169 -0
- package/dist/mapped-turn.d.ts.map +1 -0
- package/dist/outcome-contract.d.ts +19 -0
- package/dist/outcome-contract.d.ts.map +1 -0
- package/dist/outcome-schema.d.ts +23 -0
- package/dist/outcome-schema.d.ts.map +1 -0
- package/dist/pi-config-public.js +1 -1
- package/dist/pi-config.js +1 -1
- package/dist/process-flow-view.d.ts +3 -14
- package/dist/process-flow-view.d.ts.map +1 -1
- package/dist/process-graph.d.ts +10 -4
- package/dist/process-graph.d.ts.map +1 -1
- package/dist/scoped-settings.d.ts +87 -0
- package/dist/scoped-settings.d.ts.map +1 -0
- package/dist/ticket-creation.d.ts +24 -0
- package/dist/ticket-creation.d.ts.map +1 -0
- package/dist/turn-semantics.d.ts +3 -3
- package/dist/turn-semantics.d.ts.map +1 -1
- package/dist/turn-wait.d.ts +53 -0
- package/dist/turn-wait.d.ts.map +1 -0
- package/dist/types.d.ts +45 -24
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/core-capabilities.ts +76 -1
- package/src/define-process.ts +447 -540
- package/src/extension-api.ts +78 -0
- package/src/external-source-poll.ts +6 -24
- package/src/file-external-source.ts +135 -0
- package/src/flow-mapped.typecheck.ts +136 -0
- package/src/flow.ts +888 -532
- package/src/index.ts +77 -2
- package/src/mapped-turn.ts +437 -0
- package/src/outcome-contract.ts +126 -0
- package/src/outcome-schema.ts +314 -0
- package/src/process-flow-view.ts +84 -346
- package/src/process-graph.ts +95 -45
- package/src/scoped-settings.ts +113 -0
- package/src/ticket-creation.ts +113 -0
- package/src/turn-semantics.ts +102 -116
- package/src/turn-wait.ts +76 -0
- package/src/types.ts +44 -22
- package/dist/chunk-I7U6HCLN.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as _leitwerk_dev_domain from '@leitwerk-dev/domain';
|
|
2
|
-
import { ProcessInstance, ProcessProject, ProcessTurnRecord, WorkerErrorClass, ProcessLeafOutcomeSnapshot, ProcessQuestionRequest,
|
|
2
|
+
import { SettingsContext, ResolvedSetting, SettingsSubject, ProcessInstance, ProcessProject, TurnId, ProcessTurnTerminalLifecycleStatus, MappedItem, ProcessTurnRecord, WorkerErrorClass, ProcessLeafOutcomeSnapshot, ProcessQuestionRequest, ProcessTurnRecordPathType, TurnAcceptanceState as TurnAcceptanceState$1, ProcessSemanticEntryRefKey, TurnProgressReport, ProcessTurnStartSelection, ProcessLifecycleStatus, InputSource, InputKind, ProcessInputTarget, LaunchModelConfigInput, ProcessCustomizableFields, Actor } from '@leitwerk-dev/domain';
|
|
3
3
|
import { ExternalWrites } from '@leitwerk-dev/external-writes';
|
|
4
4
|
import { UsageTokenCounts, UsageCostSnapshot, WatcherPresentationField } from '@leitwerk-dev/protocol';
|
|
5
5
|
import { ActionFormDefinition } from '@leitwerk-dev/protocol/form-contract';
|
|
6
|
+
import { SettingsScopeOverview, SettingMetadata, SettingChoice } from '@leitwerk-dev/protocol/http-contracts';
|
|
6
7
|
import { LauncherCardMetadata, LauncherSchemaDefinition, LauncherFieldOptionDefinition, LauncherValidationError, UiLauncherSummaryBase } from '@leitwerk-dev/protocol/launcher-contract';
|
|
7
8
|
import { ToolCallRendererDefinition } from '@leitwerk-dev/protocol/tool-renderer-contract';
|
|
8
9
|
|
|
@@ -21,6 +22,245 @@ declare function createCapabilityToken<TValue>(id: string, options?: {
|
|
|
21
22
|
cardinality?: CapabilityCardinality;
|
|
22
23
|
}): CapabilityToken<TValue>;
|
|
23
24
|
|
|
25
|
+
/** Non-secret, JSON-compatible setting owned and validated by an extension. @public */
|
|
26
|
+
interface SettingDefinition<T = unknown> extends SettingMetadata {
|
|
27
|
+
/** Must reject invalid values without coercing missing overrides into empty values. @public */
|
|
28
|
+
schema: {
|
|
29
|
+
/** @public */
|
|
30
|
+
parse(value: unknown): T;
|
|
31
|
+
};
|
|
32
|
+
/** @public */
|
|
33
|
+
defaultValue: T;
|
|
34
|
+
/** Label retained selections synchronously, without remote discovery. @public */
|
|
35
|
+
choiceLabel?(value: string): string;
|
|
36
|
+
/** Dynamic non-secret choices for generic forms. @public */
|
|
37
|
+
choices?(context: SettingsContext, request?: {
|
|
38
|
+
/** Search text supplied by the operator. @public */
|
|
39
|
+
search?: string;
|
|
40
|
+
/** Saved selections that must remain discoverable while searching. @public */
|
|
41
|
+
values?: readonly string[];
|
|
42
|
+
}): readonly SettingChoice[] | Promise<readonly SettingChoice[]>;
|
|
43
|
+
}
|
|
44
|
+
/** @public */
|
|
45
|
+
interface SettingsScopeDefinition {
|
|
46
|
+
/** Namespaced; instance and repository are provided by core. @public */
|
|
47
|
+
id: string;
|
|
48
|
+
/** @public */
|
|
49
|
+
label: string;
|
|
50
|
+
/** Optional display names and label grouping for the generic scope overview. @public */
|
|
51
|
+
overview?: SettingsScopeOverview;
|
|
52
|
+
}
|
|
53
|
+
/** Trusted server-side discovery input. @public */
|
|
54
|
+
interface SettingsSubjectInput {
|
|
55
|
+
/** @public */
|
|
56
|
+
scopeType: string;
|
|
57
|
+
/** Stable identity, independent of the display name. @public */
|
|
58
|
+
identity: string;
|
|
59
|
+
/** @public */
|
|
60
|
+
label: string;
|
|
61
|
+
/** @public */
|
|
62
|
+
context?: SettingsContext;
|
|
63
|
+
/** Normalized locators known by the provider to identify this repository. @public */
|
|
64
|
+
aliases?: readonly string[];
|
|
65
|
+
}
|
|
66
|
+
/** Extension-owned purpose; separate from the internal title-generation model purpose. @public */
|
|
67
|
+
interface ExecutionPurposeDefinition {
|
|
68
|
+
/** @public */
|
|
69
|
+
id: string;
|
|
70
|
+
/** @public */
|
|
71
|
+
label: string;
|
|
72
|
+
/** A nullable model-profile setting. Null delegates to YAML/catalog defaults. @public */
|
|
73
|
+
modelSettingKey?: string;
|
|
74
|
+
/** Only these non-secret values are captured and sent to the worker. @public */
|
|
75
|
+
settingKeys?: readonly string[];
|
|
76
|
+
}
|
|
77
|
+
/** @public */
|
|
78
|
+
interface ScopedSettingsDeclaration {
|
|
79
|
+
/** @public */
|
|
80
|
+
scopes?: readonly SettingsScopeDefinition[];
|
|
81
|
+
/** @public */
|
|
82
|
+
settings: readonly SettingDefinition[];
|
|
83
|
+
/** @public */
|
|
84
|
+
purposes?: readonly ExecutionPurposeDefinition[];
|
|
85
|
+
}
|
|
86
|
+
/** Server-only capability. Workers receive immutable start snapshots. @public */
|
|
87
|
+
interface ScopedSettingsResolver {
|
|
88
|
+
/** @public */
|
|
89
|
+
resolve<T>(definition: SettingDefinition<T>, context: SettingsContext): ResolvedSetting<T>;
|
|
90
|
+
/** Read a retained subject by stable identity without discovery or remote requests. @public */
|
|
91
|
+
findSubject(scopeType: string, identity: string): SettingsSubject | null;
|
|
92
|
+
/** Read a retained subject by ID, including retained redirects. @public */
|
|
93
|
+
getSubject(id: string): SettingsSubject | null;
|
|
94
|
+
/** Initialize a field once. Existing overrides and explicit resets are preserved. @public */
|
|
95
|
+
seedOverride<T>(subjectId: string, definition: SettingDefinition<T>, value: T): boolean;
|
|
96
|
+
/** Retains stable subject identities and known aliases across rediscovery. @public */
|
|
97
|
+
discover(input: SettingsSubjectInput): SettingsSubject;
|
|
98
|
+
/** Called only by explicit discovery, never during step preparation. @public */
|
|
99
|
+
registerDiscovery(scopeType: string, discover: () => Promise<readonly SettingsSubjectInput[]>, options?: {
|
|
100
|
+
/** Limit navigation without deleting retained subjects or overrides. @public */
|
|
101
|
+
includesSubject?: (subject: SettingsSubject, context: Readonly<Record<string, SettingsSubject>>) => boolean;
|
|
102
|
+
}): void;
|
|
103
|
+
}
|
|
104
|
+
/** @public */
|
|
105
|
+
declare const scopedSettingsCapability: CapabilityToken<ScopedSettingsResolver>;
|
|
106
|
+
/** Provider origins and stable IDs define identity; clone URLs are aliases. @public */
|
|
107
|
+
declare function repositorySettingsIdentity(origin: string, repositoryId: string | number): string;
|
|
108
|
+
|
|
109
|
+
/** @public */
|
|
110
|
+
type MaybePromise$1<T> = T | Promise<T>;
|
|
111
|
+
/** Graph trigger used by a mapped turn's collection route. @internal */
|
|
112
|
+
declare const MAPPED_COLLECT_TRIGGER: "collect";
|
|
113
|
+
/** Durable snapshot of process data available to mapped-turn server callbacks. @public */
|
|
114
|
+
interface MappedTurnServerContext<TParams = unknown, TState = unknown> {
|
|
115
|
+
/** @public */
|
|
116
|
+
readonly process: ProcessInstance;
|
|
117
|
+
/** @internal */
|
|
118
|
+
readonly projects: readonly ProcessProject[];
|
|
119
|
+
/** @public */
|
|
120
|
+
readonly params: TParams;
|
|
121
|
+
/** @public */
|
|
122
|
+
readonly state: TState;
|
|
123
|
+
}
|
|
124
|
+
/** Active item of a mapped LLM turn, as delivered to one worker turn. @public */
|
|
125
|
+
interface MappedTurnItemContext<TItem = unknown> {
|
|
126
|
+
/** Frozen, codec-validated item value. @public */
|
|
127
|
+
readonly item: TItem;
|
|
128
|
+
/** Stable key unique within the run. @public */
|
|
129
|
+
readonly itemKey: string;
|
|
130
|
+
/** Short plain-text label shown to operators. @public */
|
|
131
|
+
readonly itemLabel: string;
|
|
132
|
+
/** Zero-based position in the frozen order. @public */
|
|
133
|
+
readonly itemIndex: number;
|
|
134
|
+
/** Number of frozen items in the run. @public */
|
|
135
|
+
readonly itemCount: number;
|
|
136
|
+
}
|
|
137
|
+
/** Serialized active item carried by worker payloads and turn records. @internal */
|
|
138
|
+
interface MappedTurnIteration extends MappedTurnItemContext<unknown> {
|
|
139
|
+
/** @internal */
|
|
140
|
+
readonly runId: string;
|
|
141
|
+
}
|
|
142
|
+
/** @public */
|
|
143
|
+
interface MappedItemInput<TItem = unknown> {
|
|
144
|
+
/** @public */
|
|
145
|
+
readonly item: TItem;
|
|
146
|
+
/** @public */
|
|
147
|
+
readonly index: number;
|
|
148
|
+
}
|
|
149
|
+
/** @public */
|
|
150
|
+
interface MappedSnapshotInput<TParams = unknown, TState = unknown, TItem = unknown> {
|
|
151
|
+
/** @public */
|
|
152
|
+
readonly params: TParams;
|
|
153
|
+
/** @public */
|
|
154
|
+
readonly state: TState;
|
|
155
|
+
/** @public */
|
|
156
|
+
readonly items: readonly TItem[];
|
|
157
|
+
}
|
|
158
|
+
/** Context passed to a mapped outcome's `yield` callback. @public */
|
|
159
|
+
interface MappedOutcomeContext<TParams = unknown, TState = unknown, TItem = unknown> extends MappedTurnServerContext<TParams, TState>, MappedTurnItemContext<TItem> {
|
|
160
|
+
}
|
|
161
|
+
/** @public */
|
|
162
|
+
interface MappedYieldInput<TParams = unknown, TState = unknown, TItem = unknown> {
|
|
163
|
+
/** @public */
|
|
164
|
+
readonly ctx: MappedOutcomeContext<TParams, TState, TItem>;
|
|
165
|
+
/** @public */
|
|
166
|
+
readonly event: ProcessTurnOutcomeEvent;
|
|
167
|
+
}
|
|
168
|
+
/** @public */
|
|
169
|
+
type MappedItemYield<TParams = unknown, TState = unknown, TItem = unknown, TResult = unknown> = (input: MappedYieldInput<TParams, TState, TItem>) => MaybePromise$1<TResult>;
|
|
170
|
+
/** @public */
|
|
171
|
+
type MappedCollect<TParams = unknown, TState = unknown, TResult = unknown> = (ctx: MappedTurnServerContext<TParams, TState>, orderedResults: readonly TResult[]) => MaybePromise$1<TState>;
|
|
172
|
+
/** Route applied once, after collection. @internal */
|
|
173
|
+
type MappedCollectRouting<TParams = unknown, TState = unknown> = {
|
|
174
|
+
/** @internal */
|
|
175
|
+
kind: "static";
|
|
176
|
+
/** @internal */
|
|
177
|
+
to?: TurnId;
|
|
178
|
+
/** @internal */
|
|
179
|
+
lifecycleStatus?: ProcessTurnTerminalLifecycleStatus;
|
|
180
|
+
} | {
|
|
181
|
+
/** @internal */
|
|
182
|
+
kind: "branches";
|
|
183
|
+
/** @internal */
|
|
184
|
+
branches: Readonly<Record<string, TurnId>>;
|
|
185
|
+
/** @internal */
|
|
186
|
+
choose(ctx: MappedTurnServerContext<TParams, TState>): MaybePromise$1<string>;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Durable sequential iteration of one LLM turn over frozen items. Items run one
|
|
190
|
+
* at a time; each item yields a typed result, and business state and routing
|
|
191
|
+
* change once, when all results are collected.
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
interface MappedLlmTurnSpec<TParams = unknown, TState = unknown, TItem = unknown, TResult = unknown> {
|
|
195
|
+
/** Evaluated once when the turn is entered. @public */
|
|
196
|
+
items(ctx: MappedTurnServerContext<TParams, TState>): readonly unknown[] | null | undefined;
|
|
197
|
+
/** @public */
|
|
198
|
+
itemCodec: Codec<TItem>;
|
|
199
|
+
/** @public */
|
|
200
|
+
resultCodec: Codec<TResult>;
|
|
201
|
+
/** @public */
|
|
202
|
+
key(input: MappedItemInput<TItem>): string;
|
|
203
|
+
/** Defaults to the item key. @public */
|
|
204
|
+
label?(input: MappedItemInput<TItem>): string;
|
|
205
|
+
/** Applied in the freezing transaction, before any item starts. @public */
|
|
206
|
+
stateAfterSnapshot?(input: MappedSnapshotInput<TParams, TState, TItem>): TState;
|
|
207
|
+
/** @internal */
|
|
208
|
+
yields: Readonly<Record<string, MappedItemYield<TParams, TState, TItem, TResult>>>;
|
|
209
|
+
/** @internal */
|
|
210
|
+
collect: MappedCollect<TParams, TState, TResult>;
|
|
211
|
+
/** @internal */
|
|
212
|
+
routing: MappedCollectRouting<TParams, TState>;
|
|
213
|
+
}
|
|
214
|
+
/** @internal */
|
|
215
|
+
type FrozenMappedItem = Pick<MappedItem, "itemIndex" | "itemKey" | "label" | "itemJson">;
|
|
216
|
+
/** @internal */
|
|
217
|
+
interface MappedFreezeResult<TState = unknown> {
|
|
218
|
+
/** @internal */
|
|
219
|
+
items: FrozenMappedItem[];
|
|
220
|
+
/** State to persist in the freezing transaction, when `stateAfterSnapshot` is declared. @internal */
|
|
221
|
+
state?: TState;
|
|
222
|
+
}
|
|
223
|
+
/** @internal */
|
|
224
|
+
interface MappedCollectResult<TState = unknown> {
|
|
225
|
+
/** @internal */
|
|
226
|
+
state: TState;
|
|
227
|
+
/** @internal */
|
|
228
|
+
route: {
|
|
229
|
+
/** @internal */
|
|
230
|
+
trigger: string;
|
|
231
|
+
/** @internal */
|
|
232
|
+
nextTurnId?: TurnId;
|
|
233
|
+
/** @internal */
|
|
234
|
+
lifecycleStatus?: ProcessTurnTerminalLifecycleStatus;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/** Evaluates, validates, and serializes the items of a mapped turn. @internal */
|
|
238
|
+
declare function freezeMappedItems<TParams, TState>(turnId: TurnId, spec: MappedLlmTurnSpec<TParams, TState>, ctx: MappedTurnServerContext<TParams, TState>): MappedFreezeResult<TState>;
|
|
239
|
+
/** Maps one item outcome to its serialized, codec-validated result. @internal */
|
|
240
|
+
declare function yieldMappedItemResult<TParams, TState>(input: {
|
|
241
|
+
/** @internal */
|
|
242
|
+
turnId: TurnId;
|
|
243
|
+
/** @internal */
|
|
244
|
+
spec: MappedLlmTurnSpec<TParams, TState>;
|
|
245
|
+
/** @internal */
|
|
246
|
+
ctx: MappedTurnServerContext<TParams, TState>;
|
|
247
|
+
/** @internal */
|
|
248
|
+
iteration: MappedTurnIteration;
|
|
249
|
+
/** @internal */
|
|
250
|
+
event: ProcessTurnOutcomeEvent;
|
|
251
|
+
}): Promise<string>;
|
|
252
|
+
/** Collects ordered results once and resolves the turn's single business route. @internal */
|
|
253
|
+
declare function collectMappedResults<TParams, TState>(input: {
|
|
254
|
+
/** @internal */
|
|
255
|
+
turnId: TurnId;
|
|
256
|
+
/** @internal */
|
|
257
|
+
spec: MappedLlmTurnSpec<TParams, TState>;
|
|
258
|
+
/** @internal */
|
|
259
|
+
ctx: MappedTurnServerContext<TParams, TState>;
|
|
260
|
+
/** Serialized results in frozen item order. @internal */
|
|
261
|
+
resultJsons: readonly string[];
|
|
262
|
+
}): Promise<MappedCollectResult<TState>>;
|
|
263
|
+
|
|
24
264
|
/** @internal */
|
|
25
265
|
interface ProcessCreatedEvent {
|
|
26
266
|
/** @internal */
|
|
@@ -171,6 +411,57 @@ type ServerExtensionEventPayloadInputMap = {
|
|
|
171
411
|
[K in keyof ServerExtensionEventMap]: Omit<ServerExtensionEventMap[K], "instanceId">;
|
|
172
412
|
};
|
|
173
413
|
|
|
414
|
+
/** Initial repository bindings resolved before the first execution. @public */
|
|
415
|
+
type InitialProcessBinding<TParams = unknown> = Pick<ProcessLaunchConfig<TParams>, "params" | "metadata" | "settingsContext"> & {
|
|
416
|
+
/** Complete, nonempty repository set. @public */
|
|
417
|
+
projects: readonly ProcessLaunchProjectConfig[];
|
|
418
|
+
};
|
|
419
|
+
/** A server-owned readiness decision, with no worker attempt. @public */
|
|
420
|
+
type TurnWaitDecision<TParams = unknown> = TurnWaitCompletion | TurnWaitNotice | TurnWaitBinding<TParams>;
|
|
421
|
+
/** A readiness condition or source cancellation with operator guidance. @public */
|
|
422
|
+
interface TurnWaitNotice {
|
|
423
|
+
/** @internal */
|
|
424
|
+
readonly kind: "waiting" | "abort";
|
|
425
|
+
/** Safe operator guidance. @public */
|
|
426
|
+
readonly message: string;
|
|
427
|
+
}
|
|
428
|
+
/** Initial bindings staged by a successful readiness check. @public */
|
|
429
|
+
interface TurnWaitBinding<TParams = unknown> {
|
|
430
|
+
/** @internal */
|
|
431
|
+
readonly kind: "bind";
|
|
432
|
+
/** @internal */
|
|
433
|
+
readonly binding: InitialProcessBinding<TParams>;
|
|
434
|
+
}
|
|
435
|
+
/** A terminal decision returned from a turn's server-side waiting condition. @public */
|
|
436
|
+
interface TurnWaitCompletion {
|
|
437
|
+
/** @internal */
|
|
438
|
+
readonly kind: "complete";
|
|
439
|
+
}
|
|
440
|
+
/** Server context for a repeatable condition. External operations must be read-only. @public */
|
|
441
|
+
interface TurnWaitContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
442
|
+
/** Cancelled on timeout or server shutdown. @public */
|
|
443
|
+
readonly signal: AbortSignal;
|
|
444
|
+
/** Resolve an extension-owned server adapter. Never perform external writes here. @public */
|
|
445
|
+
require<T>(token: CapabilityToken<T>): T | T[];
|
|
446
|
+
/** Stage process state with this check; stale and failed checks discard it. @public */
|
|
447
|
+
setState(state: TState): void;
|
|
448
|
+
/** Wait at the normal polling interval with safe operator guidance. Return this decision. @public */
|
|
449
|
+
waiting(message: string): TurnWaitDecision<TParams>;
|
|
450
|
+
/** Abort without a worker when the source is cancelled. Return this decision. @public */
|
|
451
|
+
abort(message: string): TurnWaitDecision<TParams>;
|
|
452
|
+
/** Bind initial params and projects atomically, then check again before starting a worker. Only available before any project or execution exists. @public */
|
|
453
|
+
bindInitialProjects(binding: InitialProcessBinding<TParams>): TurnWaitDecision<TParams>;
|
|
454
|
+
/** Finish the process without allocating a worker. Return this decision. @public */
|
|
455
|
+
complete(): TurnWaitCompletion;
|
|
456
|
+
}
|
|
457
|
+
/** False keeps this turn waiting; true permits execution; complete ends the process. @public */
|
|
458
|
+
type TurnWaitPredicate<TParams = unknown, TState = unknown> = (process: TurnWaitContext<TParams, TState>) => boolean | TurnWaitDecision<TParams> | Promise<boolean | TurnWaitDecision<TParams>>;
|
|
459
|
+
/** A temporary observation failure. Other predicate errors require an explicit retry. @public */
|
|
460
|
+
declare class RetryableWaitError extends Error {
|
|
461
|
+
/** The message must be safe to show to an operator. @public */
|
|
462
|
+
constructor(message: string, options?: ErrorOptions);
|
|
463
|
+
}
|
|
464
|
+
|
|
174
465
|
/** @internal */
|
|
175
466
|
interface TurnOptions {
|
|
176
467
|
/** @internal */
|
|
@@ -188,7 +479,7 @@ declare const PI_BUILT_IN_TOOL_NAMES: readonly ["read", "bash", "edit", "write",
|
|
|
188
479
|
/** @public */
|
|
189
480
|
type PiBuiltInToolName = (typeof PI_BUILT_IN_TOOL_NAMES)[number];
|
|
190
481
|
/** Names integration tools cannot use because Pi or the worker runtime owns them. @internal */
|
|
191
|
-
declare const RESERVED_INTEGRATION_TOOL_NAMES: readonly ["read", "bash", "edit", "write", "grep", "find", "ls", "ask_questions", "markdown_result", "upload_result_images"];
|
|
482
|
+
declare const RESERVED_INTEGRATION_TOOL_NAMES: readonly ["read", "bash", "edit", "write", "grep", "find", "ls", "abort_turn", "ask_questions", "markdown_result", "upload_result_images"];
|
|
192
483
|
/** @public */
|
|
193
484
|
interface ProcessPiConfig {
|
|
194
485
|
/**
|
|
@@ -222,21 +513,41 @@ interface ResolvedProcessPiConfig {
|
|
|
222
513
|
/** @internal */
|
|
223
514
|
availableToolNames: string[];
|
|
224
515
|
}
|
|
225
|
-
/** @
|
|
516
|
+
/** @public */
|
|
226
517
|
type OutcomeToolParameterType = "string" | "number" | "array" | "boolean" | "object";
|
|
227
|
-
/** @
|
|
228
|
-
type OutcomeToolArrayItemType = Exclude<OutcomeToolParameterType, "array">;
|
|
229
|
-
/** @internal */
|
|
518
|
+
/** JSON-schema-compatible value declaration nested below an outcome parameter. @public */
|
|
230
519
|
interface OutcomeToolArrayItemSpec {
|
|
231
|
-
/** @
|
|
232
|
-
type
|
|
233
|
-
/** @
|
|
520
|
+
/** @public */
|
|
521
|
+
type?: OutcomeToolParameterType;
|
|
522
|
+
/** Alternatives; declare either type or a nonempty anyOf. @public */
|
|
523
|
+
anyOf?: readonly OutcomeToolArrayItemSpec[];
|
|
524
|
+
/** @public */
|
|
234
525
|
description?: string;
|
|
526
|
+
/** @public */
|
|
527
|
+
minItems?: number;
|
|
528
|
+
/** @public */
|
|
529
|
+
items?: OutcomeToolArrayItemSpec;
|
|
530
|
+
/** @public */
|
|
531
|
+
properties?: Record<string, OutcomeToolArrayItemSpec>;
|
|
532
|
+
/** @public */
|
|
533
|
+
required?: readonly string[];
|
|
534
|
+
/** @public */
|
|
535
|
+
additionalProperties?: boolean;
|
|
536
|
+
/** @public */
|
|
537
|
+
enum?: readonly string[];
|
|
538
|
+
/** @public */
|
|
539
|
+
minLength?: number;
|
|
540
|
+
/** @public */
|
|
541
|
+
minimum?: number;
|
|
235
542
|
}
|
|
236
543
|
/** @public */
|
|
237
544
|
interface OutcomeToolParameterSpec {
|
|
238
545
|
/** @internal */
|
|
239
|
-
type
|
|
546
|
+
type?: OutcomeToolParameterType;
|
|
547
|
+
/** Alternatives for this parameter. @public */
|
|
548
|
+
anyOf?: readonly OutcomeToolArrayItemSpec[];
|
|
549
|
+
/** @public */
|
|
550
|
+
minLength?: number;
|
|
240
551
|
/** @internal */
|
|
241
552
|
description: string;
|
|
242
553
|
/** @internal */
|
|
@@ -257,9 +568,17 @@ interface OutcomeToolParameterSpec {
|
|
|
257
568
|
items?: OutcomeToolArrayItemSpec;
|
|
258
569
|
/** @internal */
|
|
259
570
|
enum?: readonly string[];
|
|
571
|
+
/** Properties of an object parameter. @public */
|
|
572
|
+
properties?: Record<string, OutcomeToolArrayItemSpec>;
|
|
573
|
+
/** Required keys inside an object; `required` marks the parameter itself. @public */
|
|
574
|
+
requiredProperties?: readonly string[];
|
|
575
|
+
/** Whether an object accepts undeclared keys. @public */
|
|
576
|
+
additionalProperties?: boolean;
|
|
260
577
|
}
|
|
261
578
|
/** @internal */
|
|
262
579
|
interface OutcomeToolSpec {
|
|
580
|
+
/** Opt in to provider enforcement of the complete schema. @internal */
|
|
581
|
+
strictSchema?: boolean;
|
|
263
582
|
/** @internal */
|
|
264
583
|
description: string;
|
|
265
584
|
/** @internal */
|
|
@@ -324,7 +643,7 @@ interface PiTurnExecutionResult {
|
|
|
324
643
|
assistantMarkdown?: string | null;
|
|
325
644
|
}
|
|
326
645
|
/** @internal */
|
|
327
|
-
type PiEventType = "turn.start" | "turn.end" | "stream.delta" | "tool.call" | "tool.update" | "tool.result" | "toolcall.start" | "toolcall.delta" | "toolcall.end" | "compaction.start" | "compaction.end" | "label.changed" | "error" | "retry.start" | "retry.end" | "usage";
|
|
646
|
+
type PiEventType = "inspection" | "turn.start" | "turn.end" | "stream.delta" | "tool.call" | "tool.update" | "tool.result" | "toolcall.start" | "toolcall.delta" | "toolcall.end" | "compaction.start" | "compaction.end" | "label.changed" | "error" | "retry.start" | "retry.end" | "usage";
|
|
328
647
|
/** @internal */
|
|
329
648
|
interface PiEvent {
|
|
330
649
|
/** @internal */
|
|
@@ -368,6 +687,10 @@ interface PiCustomToolExecutionContext {
|
|
|
368
687
|
}
|
|
369
688
|
/** @public */
|
|
370
689
|
interface PiCustomTool {
|
|
690
|
+
/** Opt in to provider schema enforcement. @internal */
|
|
691
|
+
strictSchema?: boolean;
|
|
692
|
+
/** Hidden tools remain callable by runtime callbacks. @internal */
|
|
693
|
+
modelVisible?: boolean;
|
|
371
694
|
/** @public */
|
|
372
695
|
name: string;
|
|
373
696
|
/** @internal */
|
|
@@ -437,6 +760,8 @@ interface PiPromptOptions {
|
|
|
437
760
|
activeTools?: readonly string[];
|
|
438
761
|
/** @internal Runtime-only hook used by the worker Pi adapter before a tool executes. */
|
|
439
762
|
shouldBlockToolCall?: (toolName: string) => string | null;
|
|
763
|
+
/** @internal Return control to the worker after a model response and its tool results. */
|
|
764
|
+
shouldStopAfterTurn?: (toolResults: readonly unknown[]) => boolean;
|
|
440
765
|
/** @internal Guard suspension used by durable interactive tools. */
|
|
441
766
|
suspendPromptGuards?: () => () => void;
|
|
442
767
|
/** @internal Runtime-only terminal outcome acknowledgement state. */
|
|
@@ -613,19 +938,6 @@ interface HumanTurnExternalTrigger {
|
|
|
613
938
|
description: string;
|
|
614
939
|
}
|
|
615
940
|
/** @internal */
|
|
616
|
-
interface HumanTurnExternalActionView {
|
|
617
|
-
/** Process-local arming id exposed to providers and UI. @internal */
|
|
618
|
-
id: string;
|
|
619
|
-
/** @internal */
|
|
620
|
-
externalActionId: string;
|
|
621
|
-
/** @internal */
|
|
622
|
-
sourceKind: string;
|
|
623
|
-
/** @internal */
|
|
624
|
-
label: string | null;
|
|
625
|
-
/** @internal */
|
|
626
|
-
description: string | null;
|
|
627
|
-
}
|
|
628
|
-
/** @internal */
|
|
629
941
|
interface EventBus<TEventMap extends object = Record<string, unknown>> {
|
|
630
942
|
/** @internal */
|
|
631
943
|
emit<K extends keyof TEventMap & string>(event: K, data: TEventMap[K]): void;
|
|
@@ -660,6 +972,13 @@ type StaticRouteTarget = {
|
|
|
660
972
|
/** @public */
|
|
661
973
|
interface ProcessRuntimeTurnContext<TParams = unknown, TState = unknown> extends WorkerProcessContext<TParams, TState> {
|
|
662
974
|
}
|
|
975
|
+
/** An outcome-tool submission awaiting acceptance. @public */
|
|
976
|
+
interface LlmOutcomeSubmission {
|
|
977
|
+
/** @public */
|
|
978
|
+
outcome: string;
|
|
979
|
+
/** @public */
|
|
980
|
+
params: Record<string, unknown>;
|
|
981
|
+
}
|
|
663
982
|
/** @internal */
|
|
664
983
|
interface LlmTurnPreparationContext<TParams = unknown, TState = unknown> extends ProcessRuntimeTurnContext<TParams, TState> {
|
|
665
984
|
/** @internal */
|
|
@@ -709,25 +1028,6 @@ interface ProcessEffectPlan<TState = unknown> extends ProcessLifecycleEffects {
|
|
|
709
1028
|
/** @public */
|
|
710
1029
|
queueInput?: readonly ProcessQueuedInput[];
|
|
711
1030
|
}
|
|
712
|
-
/** @internal */
|
|
713
|
-
interface SavePlanResultLifecycleIntent<TParams = unknown, TState = unknown> {
|
|
714
|
-
/** @internal */
|
|
715
|
-
kind: "save_plan_result";
|
|
716
|
-
/** @internal */
|
|
717
|
-
summaryParam: string;
|
|
718
|
-
/** @internal */
|
|
719
|
-
acceptanceCriteriaParam: string;
|
|
720
|
-
/** @internal */
|
|
721
|
-
planMarkdownParam: string;
|
|
722
|
-
/** @internal */
|
|
723
|
-
emitEventType: ProcessEventName;
|
|
724
|
-
/** @internal */
|
|
725
|
-
broadcastType: string;
|
|
726
|
-
/** @internal */
|
|
727
|
-
state?: ProcessOutcomeEffect<TParams, TState>;
|
|
728
|
-
}
|
|
729
|
-
/** @internal */
|
|
730
|
-
type ProcessOutcomeLifecycleIntent<TParams = unknown, TState = unknown> = SavePlanResultLifecycleIntent<TParams, TState>;
|
|
731
1031
|
/** @public */
|
|
732
1032
|
interface ProcessActionExecution<TParams = unknown, TState = unknown> {
|
|
733
1033
|
/** @public */
|
|
@@ -760,10 +1060,14 @@ type ProcessActionBranchSelector<TParams = unknown, TState = unknown> = (input:
|
|
|
760
1060
|
type ProcessOutcomeEffect<TParams = unknown, TState = unknown> = (input: ProcessOutcomeExecution<TParams, TState>) => MaybePromise<ProcessEffectPlan<TState> | undefined>;
|
|
761
1061
|
/** @internal */
|
|
762
1062
|
type ProcessOutcomeBranchSelector<TParams = unknown, TState = unknown> = (input: ProcessOutcomeExecution<TParams, TState>) => MaybePromise<string>;
|
|
763
|
-
/** @
|
|
1063
|
+
/** Branch route and display metadata for state-routed outcomes. @public */
|
|
764
1064
|
interface ProcessOutcomeBranchSpec extends StaticRouteTarget {
|
|
765
1065
|
/** @internal */
|
|
766
1066
|
trigger?: string;
|
|
1067
|
+
/** Display name for the branch condition in the workflow graph. @public */
|
|
1068
|
+
label?: string;
|
|
1069
|
+
/** Explains the condition without evaluating runtime state. @public */
|
|
1070
|
+
description?: string;
|
|
767
1071
|
}
|
|
768
1072
|
/** @internal */
|
|
769
1073
|
interface ProcessActionExternalTrigger {
|
|
@@ -837,8 +1141,19 @@ type ProcessHumanTurnActionSpec<TParams = unknown, TState = unknown> = BaseActio
|
|
|
837
1141
|
/** @internal */
|
|
838
1142
|
externalTriggers?: readonly ProcessActionExternalTrigger[];
|
|
839
1143
|
} & (StaticActionRouting | BranchingActionRouting<TParams, TState>);
|
|
1144
|
+
/** Pure inputs for resolving a tool contract before worker preparation. @public */
|
|
1145
|
+
interface OutcomeParameterContext<TParams = unknown, TState = unknown> {
|
|
1146
|
+
/** @public */
|
|
1147
|
+
readonly params: TParams;
|
|
1148
|
+
/** @public */
|
|
1149
|
+
readonly state: TState;
|
|
1150
|
+
}
|
|
840
1151
|
/** @public */
|
|
841
1152
|
interface ProcessToolOutcomeBaseSpec<TParams = unknown, TState = unknown> {
|
|
1153
|
+
/** Resolve parameters synchronously from captured process data. @public */
|
|
1154
|
+
resolveParameters?: (ctx: OutcomeParameterContext<TParams, TState>) => Record<string, OutcomeToolParameterSpec>;
|
|
1155
|
+
/** Opt in to provider schema enforcement. @public */
|
|
1156
|
+
strictSchema?: boolean;
|
|
842
1157
|
/** @internal */
|
|
843
1158
|
description: string;
|
|
844
1159
|
/** @internal */
|
|
@@ -851,8 +1166,6 @@ interface ProcessToolOutcomeBaseSpec<TParams = unknown, TState = unknown> {
|
|
|
851
1166
|
resultSummaryParameter?: string;
|
|
852
1167
|
/** @internal */
|
|
853
1168
|
effect?: ProcessOutcomeEffect<TParams, TState>;
|
|
854
|
-
/** @internal */
|
|
855
|
-
lifecycleIntent?: ProcessOutcomeLifecycleIntent<TParams, TState>;
|
|
856
1169
|
}
|
|
857
1170
|
/** @public */
|
|
858
1171
|
type ProcessToolOutcomeSpec<TParams = unknown, TState = unknown> = ProcessToolOutcomeBaseSpec<TParams, TState> & (StaticRouteTarget | {
|
|
@@ -908,8 +1221,14 @@ interface LlmTurnDefinition<TOutcome extends string = string, TParams = unknown,
|
|
|
908
1221
|
kind: "llm";
|
|
909
1222
|
/** @public */
|
|
910
1223
|
description: string;
|
|
1224
|
+
/** Server-side entry condition, evaluated before worker allocation. @public */
|
|
1225
|
+
waitFor?: TurnWaitPredicate<TParams, TState>;
|
|
1226
|
+
/** External events armed while this LLM turn is selected and waiting. @public */
|
|
1227
|
+
externalActions?: Record<string, ProcessHumanTurnExternalActionSpec<TParams, TState>>;
|
|
911
1228
|
/** Code-defined model policy purpose. Purpose selections cannot be overridden per launch/action. @internal */
|
|
912
1229
|
modelPurpose?: LlmModelPurpose;
|
|
1230
|
+
/** Extension-defined scoped settings consumed by this turn. @public */
|
|
1231
|
+
executionPurpose?: string;
|
|
913
1232
|
/** Built-in Pi tools active while this turn runs. @public */
|
|
914
1233
|
availableTools: readonly PiBuiltInToolName[];
|
|
915
1234
|
/** Server-owned integration tools proxied over authenticated worker IPC. @internal */
|
|
@@ -918,8 +1237,12 @@ interface LlmTurnDefinition<TOutcome extends string = string, TParams = unknown,
|
|
|
918
1237
|
resolveIntegrationTools?: (params: TParams, state: TState) => readonly string[];
|
|
919
1238
|
/** Opt in to the durable, operator-facing ask_questions custom tool. @internal */
|
|
920
1239
|
askQuestions?: boolean;
|
|
1240
|
+
/** Constrain questions using captured process data and completed preparation before prompting. @public */
|
|
1241
|
+
resolveAskQuestions?: (ctx: ProcessRuntimeTurnContext<TParams, TState>) => boolean;
|
|
921
1242
|
/** Deterministic worker preparation that must complete before Pi is prompted. @internal */
|
|
922
1243
|
prepare?(ctx: LlmTurnPreparationContext<TParams, TState>): MaybePromise<unknown>;
|
|
1244
|
+
/** Return actionable errors before an outcome is accepted; no durable effects. @internal */
|
|
1245
|
+
validateOutcome?(ctx: LlmTurnPreparationContext<TParams, TState>, outcome: LlmOutcomeSubmission): MaybePromise<readonly string[]>;
|
|
923
1246
|
/** @public */
|
|
924
1247
|
completionMode?: TurnCompletionMode;
|
|
925
1248
|
/** @public */
|
|
@@ -952,6 +1275,8 @@ interface LlmTurnDefinition<TOutcome extends string = string, TParams = unknown,
|
|
|
952
1275
|
requiredSemanticMarkdownRefs?: readonly ProcessSemanticEntryRefKey[];
|
|
953
1276
|
/** @internal */
|
|
954
1277
|
optionalSemanticMarkdownRefs?: readonly ProcessSemanticEntryRefKey[];
|
|
1278
|
+
/** Runs this turn once per frozen item, then collects and routes once. @public */
|
|
1279
|
+
forEach?: MappedLlmTurnSpec<TParams, TState>;
|
|
955
1280
|
}
|
|
956
1281
|
/** @public */
|
|
957
1282
|
interface AutomaticTurnDefinition<TOutcome extends string = string, TParams = unknown, TState = unknown> {
|
|
@@ -959,6 +1284,8 @@ interface AutomaticTurnDefinition<TOutcome extends string = string, TParams = un
|
|
|
959
1284
|
kind: "automatic";
|
|
960
1285
|
/** @public */
|
|
961
1286
|
description: string;
|
|
1287
|
+
/** Server-side entry condition, evaluated before worker allocation. @public */
|
|
1288
|
+
waitFor?: TurnWaitPredicate<TParams, TState>;
|
|
962
1289
|
/** Server-owned integration tools callable by this deterministic worker turn. @internal */
|
|
963
1290
|
integrationTools?: readonly string[];
|
|
964
1291
|
/** External events armed while this automatic turn is selected and waiting. @public */
|
|
@@ -1035,9 +1362,9 @@ declare function resolveHumanTurnView<TParams, TState>(input: {
|
|
|
1035
1362
|
actions: readonly HumanTurnActionView[];
|
|
1036
1363
|
/** @internal */
|
|
1037
1364
|
externalTriggers: readonly HumanTurnExternalTrigger[];
|
|
1038
|
-
/** @internal */
|
|
1039
|
-
externalActions: readonly HumanTurnExternalActionView[];
|
|
1040
1365
|
};
|
|
1366
|
+
/** Recheck declaration metadata and retained graph facts without executing author callbacks. @internal */
|
|
1367
|
+
declare function validateProcessDefinition<TParams, TState>(process: ExtensionProcessDefinition<TParams, TState>): readonly string[];
|
|
1041
1368
|
/** @public */
|
|
1042
1369
|
declare function defineProcess<TParams = unknown, TState = unknown>(input: DefinedProcessInput<TParams, TState>): ExtensionProcessDefinition<TParams, TState>;
|
|
1043
1370
|
/** @internal */
|
|
@@ -1435,6 +1762,15 @@ interface LauncherContext {
|
|
|
1435
1762
|
type LauncherVisibility = "ui";
|
|
1436
1763
|
/** @public */
|
|
1437
1764
|
interface ProcessLaunchProjectConfig {
|
|
1765
|
+
/** Provider-verified identity and clone aliases from launcher discovery. @public */
|
|
1766
|
+
settingsRepository?: {
|
|
1767
|
+
/** @public */
|
|
1768
|
+
origin: string;
|
|
1769
|
+
/** @public */
|
|
1770
|
+
repositoryId: string | number;
|
|
1771
|
+
/** @public */
|
|
1772
|
+
aliases?: readonly string[];
|
|
1773
|
+
};
|
|
1438
1774
|
/** @public */
|
|
1439
1775
|
key: string;
|
|
1440
1776
|
/** @public */
|
|
@@ -1459,6 +1795,10 @@ interface ProcessTitleSourceField {
|
|
|
1459
1795
|
}
|
|
1460
1796
|
/** @public */
|
|
1461
1797
|
interface ProcessLaunchConfig<TParams = unknown> {
|
|
1798
|
+
/** Repository key used for process-wide scoped model defaults. @public */
|
|
1799
|
+
primaryRepositoryKey?: string;
|
|
1800
|
+
/** Trusted integration scope bindings, retained with the process. @public */
|
|
1801
|
+
settingsContext?: _leitwerk_dev_domain.SettingsContext;
|
|
1462
1802
|
/** @public */
|
|
1463
1803
|
processId: string;
|
|
1464
1804
|
/** @public */
|
|
@@ -1549,6 +1889,13 @@ interface UiLauncherDefinition<TParams = unknown> {
|
|
|
1549
1889
|
resolveRelaunchInput?(previousInput: Record<string, unknown>, ctx: LauncherContext): Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
1550
1890
|
/** @public */
|
|
1551
1891
|
preparationChecks?(input: Record<string, unknown>, launchConfig: ProcessLaunchConfig<TParams>): readonly LaunchPreparationCheck<TParams>[];
|
|
1892
|
+
/**
|
|
1893
|
+
* Resolve form validation and model settings without preparing execution resources.
|
|
1894
|
+
* May omit projects that do not affect model/settings resolution. Params must pass
|
|
1895
|
+
* the process codec. Never used for submission; falls back to resolveLaunchConfig.
|
|
1896
|
+
* @public
|
|
1897
|
+
*/
|
|
1898
|
+
resolvePreviewConfig?(input: Record<string, unknown>, ctx: LauncherContext): UiLauncherConfigResolution<TParams> | Promise<UiLauncherConfigResolution<TParams>>;
|
|
1552
1899
|
/** @public */
|
|
1553
1900
|
resolveLaunchConfig(input: Record<string, unknown>, ctx: LauncherContext): UiLauncherConfigResolution<TParams> | Promise<UiLauncherConfigResolution<TParams>>;
|
|
1554
1901
|
}
|
|
@@ -1626,6 +1973,8 @@ interface ProcessLaunchPlanProcessInput extends ProcessCustomizableFields {
|
|
|
1626
1973
|
}
|
|
1627
1974
|
/** @internal */
|
|
1628
1975
|
interface ProcessLaunchPlan {
|
|
1976
|
+
/** A form/model preview; execution resources may be omitted and this plan must not be committed. @internal */
|
|
1977
|
+
preview?: true;
|
|
1629
1978
|
/** @internal */
|
|
1630
1979
|
launcherId: string;
|
|
1631
1980
|
/** @internal */
|
|
@@ -1685,6 +2034,8 @@ interface ProcessLauncherService {
|
|
|
1685
2034
|
resolvePreparationChecks?(launcherId: string, input: Record<string, unknown>, launchConfig: ProcessLaunchConfig): readonly LaunchPreparationCheck[];
|
|
1686
2035
|
/** @internal */
|
|
1687
2036
|
resolveUiLauncher(launcherId: string, input: Record<string, unknown>, ctx?: LauncherContext): Promise<UiLauncherResolutionResult>;
|
|
2037
|
+
/** Resolve only for form validation/defaults/model preview; never commit this result. @internal */
|
|
2038
|
+
resolveUiLauncherPreview(launcherId: string, input: Record<string, unknown>, ctx?: LauncherContext): Promise<UiLauncherResolutionResult>;
|
|
1688
2039
|
}
|
|
1689
2040
|
/** Resolve a UI launcher summary by id, returning `null` when it is unknown. @internal */
|
|
1690
2041
|
declare function findUiLauncherById(launcherService: Pick<ProcessLauncherService, "listUiLaunchers">, launcherId: string): UiLauncherSummary | null;
|
|
@@ -1700,6 +2051,17 @@ interface ProcessTurnOutcomeEvent {
|
|
|
1700
2051
|
params: Record<string, unknown>;
|
|
1701
2052
|
/** @internal */
|
|
1702
2053
|
turnResultMarkdown?: string | null;
|
|
2054
|
+
/** Durable output produced by this turn's preparation phase. @public */
|
|
2055
|
+
prepared?: unknown;
|
|
2056
|
+
}
|
|
2057
|
+
/** Expected outcome-planning rejection safe to persist and show to operators. @public */
|
|
2058
|
+
declare class SafeOutcomePlanningError extends Error {
|
|
2059
|
+
/** Stable machine-readable failure code. @public */
|
|
2060
|
+
readonly code: string;
|
|
2061
|
+
/** @public */
|
|
2062
|
+
constructor(
|
|
2063
|
+
/** Stable machine-readable failure code. @public */
|
|
2064
|
+
code: string, message: string);
|
|
1703
2065
|
}
|
|
1704
2066
|
/** @internal */
|
|
1705
2067
|
type ProcessCleanupReason = "abort";
|
|
@@ -1726,6 +2088,8 @@ interface LeafOutcomeCaptureContext<TParams = unknown, TState = unknown> extends
|
|
|
1726
2088
|
};
|
|
1727
2089
|
/** @internal */
|
|
1728
2090
|
readonly turnRecord: ProcessTurnRecord | null;
|
|
2091
|
+
/** Accepted result of this mapped item, when available. @internal */
|
|
2092
|
+
readonly mappedResult?: unknown;
|
|
1729
2093
|
/** @internal */
|
|
1730
2094
|
readTreeEntry(entryId: string): PiTreeEntry | null;
|
|
1731
2095
|
/** @internal */
|
|
@@ -1914,8 +2278,21 @@ interface ServerProcessContext<TParams = unknown, TState = unknown> extends Proc
|
|
|
1914
2278
|
/** @internal */
|
|
1915
2279
|
applyLifecycleEffects?(effects: ProcessLifecycleEffects): void;
|
|
1916
2280
|
}
|
|
2281
|
+
/** @internal */
|
|
2282
|
+
interface TurnDiagnosticReport {
|
|
2283
|
+
/** @internal */
|
|
2284
|
+
level: "debug" | "info" | "warn" | "error";
|
|
2285
|
+
/** @internal */
|
|
2286
|
+
code: string;
|
|
2287
|
+
/** @internal */
|
|
2288
|
+
message: string;
|
|
2289
|
+
/** Non-secret diagnostic metadata. @internal */
|
|
2290
|
+
details?: Record<string, unknown>;
|
|
2291
|
+
}
|
|
1917
2292
|
/** @public */
|
|
1918
2293
|
interface WorkerProcessContext<TParams = unknown, TState = unknown> extends ProcessSnapshotContext<TParams, TState> {
|
|
2294
|
+
/** Immutable non-secret values captured for this turn. @public */
|
|
2295
|
+
readonly scopedSettings?: _leitwerk_dev_domain.ScopedSettingsSnapshot;
|
|
1919
2296
|
/** @internal */
|
|
1920
2297
|
readonly turnResultMarkdownBySemanticRef?: Partial<Record<ProcessSemanticEntryRefKey, string>>;
|
|
1921
2298
|
/** @internal */
|
|
@@ -1924,10 +2301,14 @@ interface WorkerProcessContext<TParams = unknown, TState = unknown> extends Proc
|
|
|
1924
2301
|
readonly workspaceRoot?: string;
|
|
1925
2302
|
/** Durable output produced by this LLM turn's preparation phase, when declared. @internal */
|
|
1926
2303
|
readonly prepared?: unknown;
|
|
2304
|
+
/** Active frozen item of a mapped LLM turn. @internal */
|
|
2305
|
+
readonly iteration?: MappedTurnIteration;
|
|
1927
2306
|
/** Invoke a server-owned integration tool authorized for this automatic turn or LLM preparation. @internal */
|
|
1928
2307
|
callIntegrationTool?(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
1929
2308
|
/** Replace the durable operator-facing progress report for this turn attempt. @internal */
|
|
1930
2309
|
reportProgress?(report: TurnProgressReport): void;
|
|
2310
|
+
/** Append a non-secret worker diagnostic correlated with this turn attempt. @internal */
|
|
2311
|
+
reportDiagnostic?(report: TurnDiagnosticReport): void;
|
|
1931
2312
|
}
|
|
1932
2313
|
/** @public */
|
|
1933
2314
|
interface WorkerCompleteInput<TOutcome extends string = string> {
|
|
@@ -2051,6 +2432,8 @@ interface RepositoryCredentialRegistrar {
|
|
|
2051
2432
|
}
|
|
2052
2433
|
/** @public */
|
|
2053
2434
|
interface ProcessRuntimeCapabilities {
|
|
2435
|
+
/** Choose eager clones, on-demand checkout, or no local checkout. @public */
|
|
2436
|
+
readonly repositoryCheckout?: "eager" | "on_demand" | "none";
|
|
2054
2437
|
/** Install repository-declared development tools with mise before accepting work. @internal */
|
|
2055
2438
|
readonly developmentTools?: boolean;
|
|
2056
2439
|
/** Require a Docker CLI connected to a private or explicitly acknowledged daemon. @public */
|
|
@@ -2201,6 +2584,8 @@ interface TicketCreationCapability {
|
|
|
2201
2584
|
readonly titlePath?: string;
|
|
2202
2585
|
/** RFC 6901 JSON Pointer into the tool arguments. @public */
|
|
2203
2586
|
readonly descriptionPath?: string;
|
|
2587
|
+
/** Read-only issue preview format; defaults to plain text. @public */
|
|
2588
|
+
readonly descriptionFormat?: "plain" | "markdown";
|
|
2204
2589
|
/** @public */
|
|
2205
2590
|
readonly destinations?: TicketCreationDestinationProvider;
|
|
2206
2591
|
}
|
|
@@ -2215,6 +2600,8 @@ interface TicketCreationReceipt {
|
|
|
2215
2600
|
}
|
|
2216
2601
|
/** @public */
|
|
2217
2602
|
interface IntegrationToolExecutionContext {
|
|
2603
|
+
/** Replace the current running attempt's operator-facing progress. Late updates are ignored. @public */
|
|
2604
|
+
reportProgress(report: TurnProgressReport): void;
|
|
2218
2605
|
/** Process-bound coordination; storage remains server-owned. */
|
|
2219
2606
|
/** @public */
|
|
2220
2607
|
readonly externalWrites: ExternalWrites;
|
|
@@ -2235,6 +2622,8 @@ interface IntegrationToolExecutionContext {
|
|
|
2235
2622
|
}
|
|
2236
2623
|
/** @public */
|
|
2237
2624
|
interface IntegrationToolDefinition<TArgs = Record<string, unknown>> {
|
|
2625
|
+
/** Omit from model tools while retaining runtime authorization; defaults to true. @public */
|
|
2626
|
+
modelVisible?: boolean;
|
|
2238
2627
|
/** @public */
|
|
2239
2628
|
readonly name: string;
|
|
2240
2629
|
/** @public */
|
|
@@ -2278,6 +2667,8 @@ interface WorkerExtensionAPI {
|
|
|
2278
2667
|
}
|
|
2279
2668
|
/** @public */
|
|
2280
2669
|
interface LeitwerkExtensionModule {
|
|
2670
|
+
/** Non-secret scoped settings and execution purposes. @public */
|
|
2671
|
+
scopedSettings?: ScopedSettingsDeclaration;
|
|
2281
2672
|
/** @public */
|
|
2282
2673
|
manifest: {
|
|
2283
2674
|
/** @public */
|
|
@@ -2299,4 +2690,4 @@ interface LeitwerkExtensionModule {
|
|
|
2299
2690
|
setupWorker?(api: WorkerExtensionAPI, config: unknown): void | Promise<void>;
|
|
2300
2691
|
}
|
|
2301
2692
|
|
|
2302
|
-
export { type
|
|
2693
|
+
export { type ProcessActionExecution as $, type AutomaticTurnDefinition as A, type ProcessHumanTurnActionSpec as B, type Codec as C, type MappedCollectRouting as D, type ExternalActionSource as E, type MappedTurnServerContext as F, type TurnWaitPredicate as G, type HumanTurnDefinition as H, type ProcessRuntimeTurnContext as I, type LlmModelPurpose as J, type PiBuiltInToolName as K, type LauncherContext as L, type MappedLlmTurnSpec as M, type ProcessOutcomeBranchSpec as N, type OutcomeToolParameterSpec as O, type ProcessLauncherService as P, type LlmOutcomeSubmission as Q, type RepositoryCredentialRegistrar as R, type ServerProcessAPI as S, type TurnResultMarkdownBehavior as T, type UiProcessAPI as U, type MappedItemYield as V, type MappedCollect as W, type WorkerCompleteInput as X, type ExternalSourceEffectContext as Y, type ExtensionProcessDefinition as Z, type ProcessPiConfig as _, type ProcessLaunchPlan as a, type ProviderJsonObject as a$, type ProcessActionEffect as a0, type LeafOutcomeCaptureResult as a1, type OutcomeToolSpec as a2, type MappedTurnIteration as a3, type IntegrationToolExecutionContext as a4, type ProcessTurnOutcomeEvent as a5, type ServerProcessContext as a6, type ProcessCleanupHandler as a7, type TicketCreationDestinationSummary as a8, type TicketCreationDestinationList as a9, type ModelProviderSetEntry as aA, type ModelProviderWorker as aB, type PiCustomMessageInput as aC, type PiCustomTool as aD, type PiEvent as aE, type PiEventHandler as aF, type PiEventType as aG, type PiPromptOptions as aH, type PiRunDetails as aI, type PiServerAdapter as aJ, type PiSessionDiagnostic as aK, type PiSessionDiagnosticHandler as aL, type PiTerminalAcknowledgementControl as aM, type PiTerminalAcknowledgementState as aN, type PiTreeEntry as aO, type PiTreeHandle as aP, type PiTreeNode as aQ, type PiTurnExecutionResult as aR, type PiUsageData as aS, type ProcessActionPreviewDefinition as aT, type ProcessActionSchedulingDefinition as aU, type ProcessLaunchProjectConfig as aV, type ProcessLifecycleEffects as aW, type ProcessTitleSourceField as aX, type ProcessTurnBinding as aY, type ProviderAvailability as aZ, type ProviderCredentialStatus as a_, type TicketCreationDestinationProvider as aa, type IntegrationToolDefinition as ab, type ProcessLeafOutcomeDefinition as ac, type WorkerTurnHandler as ad, type WorkerProcessAPI as ae, type CatalogExtensionAPI as af, type ConfiguredProviderModel as ag, type ErasedModelProviderDefinition as ah, type ExecutionPurposeDefinition as ai, type ExternalEventDescription as aj, type ExternalSourceResolveContext as ak, type ExternalSourceTransition as al, type FrozenMappedItem as am, type GitSshCredentialMaterial as an, type InitialProcessBinding as ao, type LauncherModelProfileSummary as ap, type LeitwerkExtensionModule as aq, type LlmTurnPreparationContext as ar, MAPPED_COLLECT_TRIGGER as as, type MappedItemInput as at, type MappedOutcomeContext as au, type MappedSnapshotInput as av, type MappedYieldInput as aw, type ModelProviderDefinition as ax, type ModelProviderModelsContext as ay, type ModelProviderSet as az, type ProcessWatcherPresentation as b, repositorySettingsIdentity as b$, type ProviderModelStatus as b0, type ProviderOptionChoice as b1, type ProviderOptionValidationIssue as b2, type ProviderOptionsResolution as b3, RESERVED_INTEGRATION_TOOL_NAMES as b4, type RepositoryCredentialProject as b5, type RepositoryCredentialProvider as b6, type RepositoryCredentialRequirement as b7, type ResolvedProcessLauncher as b8, type ResolvedProcessPiConfig as b9, type UiLauncherSummary as bA, type WorkerExtensionAPI as bB, type WorkerProcessContext as bC, type WorkerRunHandle as bD, automaticTurn as bE, builtinPiProvider as bF, collectMappedResults as bG, configuredPiProvider as bH, createCapabilityToken as bI, credentialBasedModelStatuses as bJ, defineModelProvider as bK, defineModelProviders as bL, definePiServerAdapter as bM, definePiWorker as bN, defineProcess as bO, defineProviderOptions as bP, defineWorkerConfig as bQ, filterProviderOptionsForDefinition as bR, findUiLauncherById as bS, freezeMappedItems as bT, getExternalActionArmingId as bU, getExternalActionTransitionTrigger as bV, getExternalSourceTransitionId as bW, humanTurn as bX, llmTurn as bY, piServer as bZ, piWorker as b_, RetryableWaitError as ba, SafeLaunchPreparationError as bb, SafeOutcomePlanningError as bc, type ScopedSettingsDeclaration as bd, type ScopedSettingsResolver as be, type ServerExtensionAPI as bf, type ServerExtensionEventMap as bg, type ServerExtensionEventName as bh, type ServerExtensionEventPayloadInputMap as bi, type ServerExtensionLogger as bj, type ServerTransitionRequest as bk, type SettingDefinition as bl, type SettingsScopeDefinition as bm, type SettingsSubjectInput as bn, type TicketCreationCapability as bo, type TicketCreationDestinationSnapshot as bp, type TicketCreationReceipt as bq, type TurnAcceptanceState as br, type TurnOptions as bs, type TurnResult as bt, type TurnWaitBinding as bu, type TurnWaitCompletion as bv, type TurnWaitContext as bw, type TurnWaitDecision as bx, type TurnWaitNotice as by, type UiLauncherDefinition as bz, type ProcessLaunchConfig as c, resolveHumanTurnView as c0, resolveProviderOptions as c1, routeTurnOutcomes as c2, scopedSettingsCapability as c3, validateProcessDefinition as c4, yieldMappedItemResult as c5, type PlanSavedEvent as c6, type ReviewCompletedEvent as c7, type ReviewRequestedEvent as c8, type LaunchPreparationCheck as d, type ProcessWatcherSource as e, type CapabilityToken as f, type EventBus as g, type OutcomeParameterContext as h, type OutcomeToolArrayItemSpec as i, type ProcessToolOutcomeSpec as j, type ProcessOutcomeExecution as k, type ProcessEffectPlan as l, type ProcessTurnEndSpec as m, type TurnDiagnosticReport as n, type LlmTurnDefinition as o, type ExternalTurnDefinition as p, type TurnDefinition as q, type ProcessLauncherAPI as r, type ProcessWatcherAPI as s, type ProcessActionDefinition as t, type ProcessLauncherDefinition as u, type ProcessWatcherDefinition as v, type MappedTurnItemContext as w, type ProcessHumanTurnExternalActionSpec as x, type ExternalSourceEffect as y, type HumanTurnOperatorAttention as z };
|