@leitwerk-dev/protocol 0.1.5 → 0.1.7
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-7PCFBAV4.js → chunk-ABLI5SG5.js} +55 -339
- package/dist/chunk-ABLI5SG5.js.map +1 -0
- package/dist/chunk-J7LXDQAN.js +295 -0
- package/dist/chunk-J7LXDQAN.js.map +1 -0
- package/dist/config-snapshot.d.ts +2 -41
- package/dist/config-snapshot.d.ts.map +1 -1
- package/dist/{http-contracts-C8IXe8MU.d.ts → http-contracts-ClFoqwI3.d.ts} +12 -455
- package/dist/http-contracts.d.ts +9 -28
- package/dist/http-contracts.d.ts.map +1 -1
- package/dist/http-contracts.js.map +1 -1
- package/package.json +2 -2
- package/src/config-snapshot.ts +2 -52
- package/src/http-contracts.ts +10 -32
- package/dist/chunk-7PCFBAV4.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SemanticEntryRef, ProcessSemanticEntryRefs, ProcessTurnAnnotation, WorkerLease, ProcessTurnRecord,
|
|
1
|
+
import { SemanticEntryRef, ProcessSemanticEntryRefs, ProcessTurnAnnotation, WorkerLease, ProcessTurnRecord, Actor, FutureExecutionBlockReason, DurableModelSelection, LaunchModelConfigInput, InstanceTurnConfigMap, ProcessSelectedTurnModelSource, ProcessInstance, ProcessProject, ProcessFlowView, ProcessTurnType, ProcessRowSlot, ProcessInput, ProcessEvent, ProcessLeafOutcomeSnapshot, SerializedProcessGraph, ProcessQuestionRequest, QuestionAnswerDraft } from '@leitwerk-dev/domain';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
|
-
import { ProcessWatcherType } from './config-snapshot.js';
|
|
4
3
|
import { FormFieldOptionDefinition, ActionFormFieldDefinition, ActionFormDefinition } from './form-contract.js';
|
|
5
4
|
import { LauncherValidationError, UiLauncherSummaryBase } from './launcher-contract.js';
|
|
5
|
+
import { ParseResult } from './protocol.js';
|
|
6
6
|
import { ToolCallRendererDefinition } from './tool-renderer-contract.js';
|
|
7
7
|
|
|
8
8
|
interface UsageCostSnapshot {
|
|
@@ -105,431 +105,6 @@ interface PrimaryPathSnapshot {
|
|
|
105
105
|
turnState: PrimaryPathTurnStateSnapshot;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
type ParseResult<T> = {
|
|
109
|
-
ok: true;
|
|
110
|
-
value: T;
|
|
111
|
-
} | {
|
|
112
|
-
ok: false;
|
|
113
|
-
error: string;
|
|
114
|
-
};
|
|
115
|
-
declare const ok: <T>(value: T) => ParseResult<T>;
|
|
116
|
-
declare const err: (error: string) => ParseResult<never>;
|
|
117
|
-
declare const unknownRecordSchema: v.CustomSchema<Record<string, unknown>, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
118
|
-
declare const nullableStringSchema: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
119
|
-
declare const optionalNullableStringSchema: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
120
|
-
declare function parseSchema<TSchema extends v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>>(schema: TSchema, value: unknown, context: string): ParseResult<v.InferOutput<TSchema>>;
|
|
121
|
-
declare function parseLiteral<T extends string>(value: unknown, allowed: readonly T[], context: string): ParseResult<T>;
|
|
122
|
-
declare const WS_PROTOCOL_VERSION = "leitwerk/ws/v1";
|
|
123
|
-
declare const WS_PROCESS_TYPES: {
|
|
124
|
-
readonly TOAST: "process.toast";
|
|
125
|
-
readonly FUTURE_UPDATED: "future.updated";
|
|
126
|
-
};
|
|
127
|
-
declare const WS_PRIMARY_PATH_TYPES: {
|
|
128
|
-
readonly TURN_STARTED: "primary_path.turn_started";
|
|
129
|
-
readonly ASSISTANT_PARTIAL: "primary_path.assistant_partial";
|
|
130
|
-
readonly USAGE_UPDATED: "primary_path.usage_updated";
|
|
131
|
-
readonly ASSISTANT_COMMITTED: "primary_path.assistant_committed";
|
|
132
|
-
readonly TOOL_CALL_STARTED: "primary_path.tool_call_started";
|
|
133
|
-
readonly TOOL_CALL_COMPLETED: "primary_path.tool_call_completed";
|
|
134
|
-
readonly TURN_ANNOTATION_CHANGED: "primary_path.turn_annotation_changed";
|
|
135
|
-
readonly LABEL_CHANGED: "primary_path.label_changed";
|
|
136
|
-
readonly CHANGED: "primary_path.changed";
|
|
137
|
-
};
|
|
138
|
-
declare const WS_PI_STREAM_TYPES: {
|
|
139
|
-
readonly STARTED: "pi.stream.started";
|
|
140
|
-
readonly DELTA: "pi.stream.delta";
|
|
141
|
-
readonly COMPLETED: "pi.stream.completed";
|
|
142
|
-
readonly TOOL_STARTED: "pi.tool.started";
|
|
143
|
-
readonly TOOL_COMPLETED: "pi.tool.completed";
|
|
144
|
-
readonly LABEL_CHANGED: "pi.label.changed";
|
|
145
|
-
readonly ERROR: "pi.error";
|
|
146
|
-
readonly RETRY_START: "pi.retry.start";
|
|
147
|
-
readonly RETRY_END: "pi.retry.end";
|
|
148
|
-
readonly USAGE: "pi.usage";
|
|
149
|
-
};
|
|
150
|
-
type PiPayload<T = Record<string, never>> = {
|
|
151
|
-
turnId?: string | null;
|
|
152
|
-
turnRecordId?: string | null;
|
|
153
|
-
timestamp?: string;
|
|
154
|
-
} & T;
|
|
155
|
-
declare const primaryPathTreeSchema: v.ObjectSchema<{
|
|
156
|
-
rootEntry: v.NullableSchema<v.ObjectSchema<{
|
|
157
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
158
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
159
|
-
}, undefined>, undefined>;
|
|
160
|
-
currentLeaf: v.NullableSchema<v.ObjectSchema<{
|
|
161
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
162
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
163
|
-
}, undefined>, undefined>;
|
|
164
|
-
}, undefined>;
|
|
165
|
-
declare const PRIMARY_PATH_PAYLOAD_SCHEMAS: {
|
|
166
|
-
readonly "primary_path.turn_started": v.ObjectSchema<{
|
|
167
|
-
readonly turnRecord: v.ObjectSchema<{
|
|
168
|
-
readonly id: v.StringSchema<undefined>;
|
|
169
|
-
readonly turnId: v.StringSchema<undefined>;
|
|
170
|
-
readonly turnType: v.PicklistSchema<readonly ["llm", "human", "external", "automatic", "server_automatic"], undefined>;
|
|
171
|
-
readonly pathType: v.PicklistSchema<readonly ["primary", "root_branch", "leaf_branch"], undefined>;
|
|
172
|
-
readonly startedAt: v.StringSchema<undefined>;
|
|
173
|
-
}, undefined>;
|
|
174
|
-
}, undefined>;
|
|
175
|
-
readonly "primary_path.assistant_partial": v.ObjectSchema<{
|
|
176
|
-
readonly text: v.StringSchema<undefined>;
|
|
177
|
-
readonly streamType: v.StringSchema<undefined>;
|
|
178
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
179
|
-
readonly piTurnId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
180
|
-
readonly timestamp: v.StringSchema<undefined>;
|
|
181
|
-
}, undefined>;
|
|
182
|
-
readonly "primary_path.usage_updated": v.ObjectSchema<{
|
|
183
|
-
readonly usage: v.ObjectSchema<{
|
|
184
|
-
readonly input: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
185
|
-
readonly output: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
186
|
-
readonly cacheRead: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
187
|
-
readonly cacheWrite: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
188
|
-
readonly totalTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
189
|
-
readonly cost: v.NullableSchema<v.ObjectSchema<{
|
|
190
|
-
readonly input: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
191
|
-
readonly output: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
192
|
-
readonly reasoning: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, undefined>;
|
|
193
|
-
readonly cacheRead: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
194
|
-
readonly cacheWrite: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
195
|
-
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
196
|
-
}, undefined>, undefined>;
|
|
197
|
-
}, undefined>;
|
|
198
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
199
|
-
readonly piTurnId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
200
|
-
readonly timestamp: v.StringSchema<undefined>;
|
|
201
|
-
}, undefined>;
|
|
202
|
-
readonly "primary_path.assistant_committed": v.ObjectSchema<{
|
|
203
|
-
readonly rootEntry: v.NullableSchema<v.ObjectSchema<{
|
|
204
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
205
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
206
|
-
}, undefined>, undefined>;
|
|
207
|
-
readonly currentLeaf: v.NullableSchema<v.ObjectSchema<{
|
|
208
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
209
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
210
|
-
}, undefined>, undefined>;
|
|
211
|
-
readonly turnRecord: v.ObjectSchema<{
|
|
212
|
-
readonly id: v.StringSchema<undefined>;
|
|
213
|
-
readonly turnId: v.StringSchema<undefined>;
|
|
214
|
-
readonly turnType: v.PicklistSchema<readonly ["llm", "human", "external", "automatic", "server_automatic"], undefined>;
|
|
215
|
-
readonly pathType: v.PicklistSchema<readonly ["primary", "root_branch", "leaf_branch"], undefined>;
|
|
216
|
-
readonly startedAt: v.StringSchema<undefined>;
|
|
217
|
-
}, undefined>;
|
|
218
|
-
}, undefined>;
|
|
219
|
-
readonly "primary_path.tool_call_started": v.ObjectSchema<{
|
|
220
|
-
readonly toolCallId: v.StringSchema<undefined>;
|
|
221
|
-
readonly toolName: v.StringSchema<undefined>;
|
|
222
|
-
readonly arguments: v.NullableSchema<v.CustomSchema<Record<string, unknown>, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
223
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
224
|
-
readonly piTurnId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
225
|
-
readonly timestamp: v.StringSchema<undefined>;
|
|
226
|
-
}, undefined>;
|
|
227
|
-
readonly "primary_path.tool_call_completed": v.ObjectSchema<{
|
|
228
|
-
readonly toolCallId: v.StringSchema<undefined>;
|
|
229
|
-
readonly toolName: v.StringSchema<undefined>;
|
|
230
|
-
readonly result: v.UnknownSchema;
|
|
231
|
-
readonly isError: v.BooleanSchema<undefined>;
|
|
232
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
233
|
-
readonly piTurnId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
234
|
-
readonly timestamp: v.StringSchema<undefined>;
|
|
235
|
-
}, undefined>;
|
|
236
|
-
readonly "primary_path.turn_annotation_changed": v.ObjectSchema<{
|
|
237
|
-
readonly change: v.PicklistSchema<["created", "updated"], undefined>;
|
|
238
|
-
readonly annotation: v.ObjectSchema<{
|
|
239
|
-
readonly id: v.StringSchema<undefined>;
|
|
240
|
-
readonly instanceId: v.StringSchema<undefined>;
|
|
241
|
-
readonly annotationType: v.StringSchema<undefined>;
|
|
242
|
-
readonly annotationKey: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
243
|
-
readonly references: v.ArraySchema<v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
244
|
-
readonly kind: v.LiteralSchema<"turn_record", undefined>;
|
|
245
|
-
readonly turnRecordId: v.StringSchema<undefined>;
|
|
246
|
-
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
247
|
-
}, undefined>, v.ObjectSchema<{
|
|
248
|
-
readonly kind: v.LiteralSchema<"entry", undefined>;
|
|
249
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
250
|
-
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
251
|
-
}, undefined>, v.ObjectSchema<{
|
|
252
|
-
readonly kind: v.LiteralSchema<"semantic_entry_ref", undefined>;
|
|
253
|
-
readonly ref: v.PicklistSchema<readonly ["plan", "review", "currentPrimaryPathLeaf", "rootEntry"], undefined>;
|
|
254
|
-
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
255
|
-
}, undefined>], undefined>, undefined>;
|
|
256
|
-
readonly payload: v.CustomSchema<Record<string, unknown>, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
257
|
-
readonly createdAt: v.StringSchema<undefined>;
|
|
258
|
-
readonly updatedAt: v.StringSchema<undefined>;
|
|
259
|
-
}, undefined>;
|
|
260
|
-
}, undefined>;
|
|
261
|
-
readonly "primary_path.label_changed": v.ObjectSchema<{
|
|
262
|
-
readonly targetId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
263
|
-
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
264
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
265
|
-
readonly piTurnId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
266
|
-
readonly timestamp: v.StringSchema<undefined>;
|
|
267
|
-
}, undefined>;
|
|
268
|
-
readonly "primary_path.changed": v.ObjectSchema<{
|
|
269
|
-
rootEntry: v.NullableSchema<v.ObjectSchema<{
|
|
270
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
271
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
272
|
-
}, undefined>, undefined>;
|
|
273
|
-
currentLeaf: v.NullableSchema<v.ObjectSchema<{
|
|
274
|
-
readonly entryId: v.StringSchema<undefined>;
|
|
275
|
-
readonly turnRecordId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
276
|
-
}, undefined>, undefined>;
|
|
277
|
-
}, undefined>;
|
|
278
|
-
};
|
|
279
|
-
type PrimaryPathPayloadByType = {
|
|
280
|
-
[K in keyof typeof PRIMARY_PATH_PAYLOAD_SCHEMAS]: v.InferOutput<(typeof PRIMARY_PATH_PAYLOAD_SCHEMAS)[K]>;
|
|
281
|
-
};
|
|
282
|
-
type PrimaryPathTree = v.InferOutput<typeof primaryPathTreeSchema>;
|
|
283
|
-
type PiUsagePayload = PiPayload<{
|
|
284
|
-
input?: number;
|
|
285
|
-
output?: number;
|
|
286
|
-
cacheRead?: number;
|
|
287
|
-
cacheWrite?: number;
|
|
288
|
-
totalTokens?: number;
|
|
289
|
-
cost?: {
|
|
290
|
-
input?: number;
|
|
291
|
-
output?: number;
|
|
292
|
-
cacheRead?: number;
|
|
293
|
-
cacheWrite?: number;
|
|
294
|
-
total?: number;
|
|
295
|
-
};
|
|
296
|
-
cacheHitRate?: number;
|
|
297
|
-
}>;
|
|
298
|
-
type WsDurability = "durable" | "ephemeral";
|
|
299
|
-
type ProcessAttentionTarget = {
|
|
300
|
-
kind: "action_required";
|
|
301
|
-
} | {
|
|
302
|
-
kind: "turn_failed";
|
|
303
|
-
} | {
|
|
304
|
-
kind: "worker_failed";
|
|
305
|
-
} | {
|
|
306
|
-
kind: "question_request";
|
|
307
|
-
requestId: string;
|
|
308
|
-
};
|
|
309
|
-
type WsPayloadByType = {
|
|
310
|
-
hello: {
|
|
311
|
-
serverVersion: string;
|
|
312
|
-
};
|
|
313
|
-
pong: Record<string, never>;
|
|
314
|
-
"process.created": {
|
|
315
|
-
process: ProcessInstance;
|
|
316
|
-
processId: string;
|
|
317
|
-
launcherId?: string;
|
|
318
|
-
};
|
|
319
|
-
"process.updated": {
|
|
320
|
-
process: Partial<ProcessInstance>;
|
|
321
|
-
changedFields?: readonly string[];
|
|
322
|
-
};
|
|
323
|
-
"process.deleted": {
|
|
324
|
-
instanceId: string;
|
|
325
|
-
};
|
|
326
|
-
"project.updated": {
|
|
327
|
-
projectId: string;
|
|
328
|
-
project: {
|
|
329
|
-
key: string;
|
|
330
|
-
repoLocator: string;
|
|
331
|
-
repoLocatorKind: ProcessProject["repoLocatorKind"];
|
|
332
|
-
branch: string;
|
|
333
|
-
baseBranch: string;
|
|
334
|
-
workBranch: string | null;
|
|
335
|
-
externalId: string | null;
|
|
336
|
-
externalUrl: string | null;
|
|
337
|
-
pipelineStatus: string | null;
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
"worker.state": {
|
|
341
|
-
worker: WorkerLease;
|
|
342
|
-
workerId: string;
|
|
343
|
-
state: WorkerLease["state"];
|
|
344
|
-
previousState: WorkerLease["state"];
|
|
345
|
-
reason: string;
|
|
346
|
-
};
|
|
347
|
-
"process.input.queued": {
|
|
348
|
-
instanceId: string;
|
|
349
|
-
input: ProcessInput;
|
|
350
|
-
};
|
|
351
|
-
"process.input.acknowledged": {
|
|
352
|
-
instanceId: string;
|
|
353
|
-
inputId: string;
|
|
354
|
-
sequence: number;
|
|
355
|
-
};
|
|
356
|
-
"process.event": {
|
|
357
|
-
eventType: string;
|
|
358
|
-
level: string;
|
|
359
|
-
message: string;
|
|
360
|
-
};
|
|
361
|
-
[WS_PROCESS_TYPES.TOAST]: {
|
|
362
|
-
instanceId: string;
|
|
363
|
-
level: "warn" | "error";
|
|
364
|
-
message: string;
|
|
365
|
-
eventType: string;
|
|
366
|
-
dedupeKey: string;
|
|
367
|
-
ttlMs: number;
|
|
368
|
-
/** Optional typed Chronicle target applied only when the operator opens the toast. */
|
|
369
|
-
focusTarget?: ProcessAttentionTarget;
|
|
370
|
-
};
|
|
371
|
-
[WS_PROCESS_TYPES.FUTURE_UPDATED]: {
|
|
372
|
-
futureExecutionId: string;
|
|
373
|
-
operation: "created" | "updated" | "deleted";
|
|
374
|
-
kind: FutureExecutionKind;
|
|
375
|
-
};
|
|
376
|
-
"plan.updated": {
|
|
377
|
-
planRevision: number;
|
|
378
|
-
reviewState: string;
|
|
379
|
-
approved: boolean;
|
|
380
|
-
summary: string;
|
|
381
|
-
};
|
|
382
|
-
"review.updated": {
|
|
383
|
-
hasIssues: boolean;
|
|
384
|
-
issueCount: number;
|
|
385
|
-
reviewMarkdown?: string;
|
|
386
|
-
nextTurnId: string | null;
|
|
387
|
-
};
|
|
388
|
-
[WS_PI_STREAM_TYPES.STARTED]: PiPayload;
|
|
389
|
-
[WS_PI_STREAM_TYPES.DELTA]: PiPayload<{
|
|
390
|
-
text?: string;
|
|
391
|
-
delta?: string;
|
|
392
|
-
chunk?: string;
|
|
393
|
-
streamType?: string;
|
|
394
|
-
}>;
|
|
395
|
-
[WS_PI_STREAM_TYPES.COMPLETED]: PiPayload;
|
|
396
|
-
[WS_PI_STREAM_TYPES.TOOL_STARTED]: PiPayload<{
|
|
397
|
-
toolCallId?: string;
|
|
398
|
-
toolName?: string;
|
|
399
|
-
name?: string;
|
|
400
|
-
arguments?: Record<string, unknown>;
|
|
401
|
-
args?: Record<string, unknown>;
|
|
402
|
-
}>;
|
|
403
|
-
[WS_PI_STREAM_TYPES.TOOL_COMPLETED]: PiPayload<{
|
|
404
|
-
toolCallId?: string;
|
|
405
|
-
toolName?: string;
|
|
406
|
-
name?: string;
|
|
407
|
-
result?: unknown;
|
|
408
|
-
isError?: boolean;
|
|
409
|
-
}>;
|
|
410
|
-
[WS_PI_STREAM_TYPES.LABEL_CHANGED]: PiPayload<{
|
|
411
|
-
targetId?: string | null;
|
|
412
|
-
label?: string | null;
|
|
413
|
-
}>;
|
|
414
|
-
[WS_PI_STREAM_TYPES.ERROR]: PiPayload<{
|
|
415
|
-
message?: string;
|
|
416
|
-
errorMessage?: string;
|
|
417
|
-
source?: string;
|
|
418
|
-
toolName?: string;
|
|
419
|
-
stopReason?: string;
|
|
420
|
-
provider?: string;
|
|
421
|
-
model?: string;
|
|
422
|
-
}>;
|
|
423
|
-
[WS_PI_STREAM_TYPES.RETRY_START]: PiPayload<{
|
|
424
|
-
attempt?: number;
|
|
425
|
-
maxAttempts?: number;
|
|
426
|
-
delayMs?: number;
|
|
427
|
-
errorMessage?: string;
|
|
428
|
-
message?: string;
|
|
429
|
-
}>;
|
|
430
|
-
[WS_PI_STREAM_TYPES.RETRY_END]: PiPayload<{
|
|
431
|
-
success?: boolean;
|
|
432
|
-
attempt?: number;
|
|
433
|
-
finalError?: string;
|
|
434
|
-
message?: string;
|
|
435
|
-
}>;
|
|
436
|
-
[WS_PI_STREAM_TYPES.USAGE]: PiUsagePayload;
|
|
437
|
-
[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TURN_STARTED];
|
|
438
|
-
[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL];
|
|
439
|
-
[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.USAGE_UPDATED];
|
|
440
|
-
[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED];
|
|
441
|
-
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED];
|
|
442
|
-
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED];
|
|
443
|
-
[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED];
|
|
444
|
-
[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.LABEL_CHANGED];
|
|
445
|
-
[WS_PRIMARY_PATH_TYPES.CHANGED]: PrimaryPathTree;
|
|
446
|
-
};
|
|
447
|
-
declare const WS_FRAME_DURABILITY: {
|
|
448
|
-
readonly hello: "ephemeral";
|
|
449
|
-
readonly pong: "ephemeral";
|
|
450
|
-
readonly "process.created": "durable";
|
|
451
|
-
readonly "process.updated": "durable";
|
|
452
|
-
readonly "process.deleted": "durable";
|
|
453
|
-
readonly "project.updated": "durable";
|
|
454
|
-
readonly "worker.state": "durable";
|
|
455
|
-
readonly "process.input.queued": "durable";
|
|
456
|
-
readonly "process.input.acknowledged": "durable";
|
|
457
|
-
readonly "process.event": "durable";
|
|
458
|
-
readonly "process.toast": "ephemeral";
|
|
459
|
-
readonly "future.updated": "durable";
|
|
460
|
-
readonly "plan.updated": "durable";
|
|
461
|
-
readonly "review.updated": "durable";
|
|
462
|
-
readonly "pi.stream.started": "ephemeral";
|
|
463
|
-
readonly "pi.stream.delta": "ephemeral";
|
|
464
|
-
readonly "pi.stream.completed": "ephemeral";
|
|
465
|
-
readonly "pi.tool.started": "ephemeral";
|
|
466
|
-
readonly "pi.tool.completed": "ephemeral";
|
|
467
|
-
readonly "pi.label.changed": "ephemeral";
|
|
468
|
-
readonly "pi.error": "ephemeral";
|
|
469
|
-
readonly "pi.retry.start": "ephemeral";
|
|
470
|
-
readonly "pi.retry.end": "ephemeral";
|
|
471
|
-
readonly "pi.usage": "ephemeral";
|
|
472
|
-
readonly "primary_path.turn_started": "durable";
|
|
473
|
-
readonly "primary_path.assistant_partial": "ephemeral";
|
|
474
|
-
readonly "primary_path.usage_updated": "ephemeral";
|
|
475
|
-
readonly "primary_path.assistant_committed": "durable";
|
|
476
|
-
readonly "primary_path.tool_call_started": "ephemeral";
|
|
477
|
-
readonly "primary_path.tool_call_completed": "ephemeral";
|
|
478
|
-
readonly "primary_path.turn_annotation_changed": "durable";
|
|
479
|
-
readonly "primary_path.label_changed": "durable";
|
|
480
|
-
readonly "primary_path.changed": "durable";
|
|
481
|
-
};
|
|
482
|
-
type WsDurabilityByType = typeof WS_FRAME_DURABILITY;
|
|
483
|
-
type KnownWsFrameType = keyof WsPayloadByType;
|
|
484
|
-
type KnownDurableWsFrameType = {
|
|
485
|
-
[K in KnownWsFrameType]: WsDurabilityByType[K] extends "durable" ? K : never;
|
|
486
|
-
}[KnownWsFrameType];
|
|
487
|
-
type KnownEphemeralWsFrameType = {
|
|
488
|
-
[K in KnownWsFrameType]: WsDurabilityByType[K] extends "ephemeral" ? K : never;
|
|
489
|
-
}[KnownWsFrameType];
|
|
490
|
-
type WsFrameOfType<T extends KnownWsFrameType> = {
|
|
491
|
-
protocol: typeof WS_PROTOCOL_VERSION;
|
|
492
|
-
type: T;
|
|
493
|
-
durability: WsDurabilityByType[T];
|
|
494
|
-
sentAt: string;
|
|
495
|
-
instanceId?: string;
|
|
496
|
-
payload: WsPayloadByType[T];
|
|
497
|
-
};
|
|
498
|
-
type DurableWsFrameInput = {
|
|
499
|
-
[K in KnownDurableWsFrameType]: {
|
|
500
|
-
type: K;
|
|
501
|
-
instanceId?: string;
|
|
502
|
-
payload: WsPayloadByType[K];
|
|
503
|
-
};
|
|
504
|
-
}[KnownDurableWsFrameType];
|
|
505
|
-
type EphemeralWsFrameInput = {
|
|
506
|
-
[K in KnownEphemeralWsFrameType]: {
|
|
507
|
-
type: K;
|
|
508
|
-
instanceId?: string;
|
|
509
|
-
payload: WsPayloadByType[K];
|
|
510
|
-
};
|
|
511
|
-
}[KnownEphemeralWsFrameType];
|
|
512
|
-
type WsFrame = {
|
|
513
|
-
[K in KnownWsFrameType]: WsFrameOfType<K>;
|
|
514
|
-
}[KnownWsFrameType];
|
|
515
|
-
type PrimaryPathWsFrameType = (typeof WS_PRIMARY_PATH_TYPES)[keyof typeof WS_PRIMARY_PATH_TYPES];
|
|
516
|
-
type PrimaryPathWsFrame = Extract<WsFrame, {
|
|
517
|
-
type: PrimaryPathWsFrameType;
|
|
518
|
-
}>;
|
|
519
|
-
declare function parsePrimaryPathWsFrameInput(value: unknown): ParseResult<PrimaryPathWsFrame>;
|
|
520
|
-
declare function parseWsFrame(value: unknown): ParseResult<WsFrame>;
|
|
521
|
-
declare function createDurableWsFrame(input: DurableWsFrameInput & {
|
|
522
|
-
sentAt?: string;
|
|
523
|
-
}): WsFrame;
|
|
524
|
-
declare function createEphemeralWsFrame(input: {
|
|
525
|
-
type: KnownEphemeralWsFrameType;
|
|
526
|
-
instanceId?: string;
|
|
527
|
-
payload: WsPayloadByType[KnownEphemeralWsFrameType];
|
|
528
|
-
sentAt?: string;
|
|
529
|
-
}): WsFrame;
|
|
530
|
-
type RawPiDiagnosticWsFrameType = (typeof WS_PI_STREAM_TYPES)[keyof typeof WS_PI_STREAM_TYPES];
|
|
531
|
-
declare function mapWorkerEventToWsType(workerEventType: string): RawPiDiagnosticWsFrameType | null;
|
|
532
|
-
|
|
533
108
|
interface AuthMeResponseBody {
|
|
534
109
|
authEnabled: boolean;
|
|
535
110
|
actor: Actor | null;
|
|
@@ -894,43 +469,25 @@ type WatcherLaunchModelSummary = {
|
|
|
894
469
|
modelProfileId: string | null;
|
|
895
470
|
}>;
|
|
896
471
|
};
|
|
897
|
-
interface
|
|
472
|
+
interface WatcherPresentationField {
|
|
473
|
+
label: string;
|
|
474
|
+
value: string;
|
|
475
|
+
format?: "text" | "code";
|
|
476
|
+
}
|
|
477
|
+
interface WatcherSummary {
|
|
898
478
|
processId: string;
|
|
899
479
|
processDisplayName: string;
|
|
900
480
|
watcherId: string;
|
|
901
481
|
label: string;
|
|
902
482
|
description: string;
|
|
903
|
-
|
|
483
|
+
sourceId: string;
|
|
484
|
+
sourceLabel: string;
|
|
904
485
|
enabled: boolean;
|
|
905
|
-
pollInterval: string;
|
|
906
486
|
configPath: string;
|
|
907
487
|
targetSummary: string;
|
|
488
|
+
details: WatcherPresentationField[];
|
|
908
489
|
launchModel: WatcherLaunchModelSummary;
|
|
909
490
|
}
|
|
910
|
-
interface JiraWatcherSummary extends WatcherSummaryBase {
|
|
911
|
-
type: "jira";
|
|
912
|
-
project: string;
|
|
913
|
-
labels: {
|
|
914
|
-
trigger: string;
|
|
915
|
-
done: string;
|
|
916
|
-
required?: string[];
|
|
917
|
-
forbidden?: string[];
|
|
918
|
-
};
|
|
919
|
-
targetBranchLabelPrefix: string;
|
|
920
|
-
}
|
|
921
|
-
interface GitLabMrWatcherSummary extends WatcherSummaryBase {
|
|
922
|
-
type: "gitlab_mr";
|
|
923
|
-
group: string;
|
|
924
|
-
labels: {
|
|
925
|
-
trigger: string;
|
|
926
|
-
done: string;
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
|
-
type FilesystemWatcherSummary = WatcherSummaryBase & {
|
|
930
|
-
type: "filesystem";
|
|
931
|
-
filePath: string;
|
|
932
|
-
};
|
|
933
|
-
type WatcherSummary = JiraWatcherSummary | GitLabMrWatcherSummary | FilesystemWatcherSummary;
|
|
934
491
|
interface SkillUsageSummary {
|
|
935
492
|
attachedAllTime: number;
|
|
936
493
|
attachedLast30Days: number;
|
|
@@ -1480,4 +1037,4 @@ declare function serializeFutureActionPayload(payload: unknown): string;
|
|
|
1480
1037
|
declare function parseFutureActionPayloadObject(value: unknown, context?: string): ParseResult<FutureActionPayload>;
|
|
1481
1038
|
declare function parseFutureActionPayloadJson(payloadJson: string): ParseResult<FutureActionPayload>;
|
|
1482
1039
|
|
|
1483
|
-
export { type
|
|
1040
|
+
export { type PrimaryPathDetailRailSnapshot as $, type AuthMeResponseBody as A, type LauncherModelConfigPreviewResponseBody as B, type CronPreviewResponseBody as C, type LauncherModelConfigSchema as D, type ErrorResponseBody as E, type FutureExecutionSummary as F, type LauncherMutationResponseBody as G, type LauncherOptionsResponseBody as H, type InstalledSkillCatalogDetail as I, type LauncherRecentValuesResponseBody as J, type LauncherTurnModelConfigPreview as K, type LauncherDefaultModelPreview as L, type LaunchersResponseBody as M, type ModelProfileAvailability as N, type ModelProfileOptionSummary as O, type PrimaryPathStreamingAssistantSnapshot as P, type ModelProviderOptionsResponseBody as Q, type ParsedScheduleRequest as R, type PiSessionContentBlock as S, type PiSessionEntry as T, type UsageSnapshot as U, type PiSessionImageContentBlock as V, type PiSessionMessageRecord as W, type PiSessionTextContentBlock as X, type PiSessionThinkingContentBlock as Y, type PiSessionToolCallContentBlock as Z, type PiSessionUsageSnapshot as _, type FutureExecutionOverviewItem as a, type SkillRevisionSummary as a$, type PrimaryPathEntrySnapshot as a0, type PrimaryPathOperationalTraceSeverity as a1, type PrimaryPathSnapshot as a2, type PrimaryPathSnapshotResponseBody as a3, type PrimaryPathThinkingTraceItemSnapshot as a4, type PrimaryPathToolCallTraceItemSnapshot as a5, type PrimaryPathTurnStateSnapshot as a6, type PrimaryPathUiSnapshot as a7, type ProcessActionFieldDefinition as a8, type ProcessActionFormDefinition as a9, type ProcessRetryConfig as aA, type ProcessRetryConfigResponseBody as aB, type ProcessRunDetailsView as aC, type ProcessRunToolParameterView as aD, type ProcessRunToolView as aE, type ProcessRunTurnView as aF, type ProcessSelectedTurnSummary as aG, type ProcessTimelineInputSummary as aH, type ProcessTimelineSnapshot as aI, type ProcessTurnModelConfigurationView as aJ, type ProcessUiSnapshotProcess as aK, type ProcessUsageEstimateSnapshot as aL, type ProcessesListResponseBody as aM, type ProcessesOverviewResponseBody as aN, type PromptCacheSwitchResolution as aO, type ProviderOptionChoiceSummary as aP, type ProviderOptionFieldSummary as aQ, type QuestionRequestMutationResponseBody as aR, type ScheduleConfigInput as aS, type ScheduleMode as aT, type ScheduledActionDetail as aU, type ScheduledActionMutationResponseBody as aV, type SkillCatalogDetail as aW, type SkillCatalogDetailResponseBody as aX, type SkillCatalogItem as aY, type SkillRegistrationKind as aZ, type SkillRepositorySummary as a_, type ProcessActionModelPreview as aa, type ProcessActionModelPreviewResponseBody as ab, type ProcessActionModelResolutionPreview as ac, type ProcessActionModelResolutionSource as ad, type ProcessActionPreviewSummary as ae, type ProcessActionSummary as af, type ProcessActionWarmPromptCacheContext as ag, type ProcessBrowseFacets as ah, type ProcessBrowseItem as ai, type ProcessBrowsePagination as aj, type ProcessBrowseResponseBody as ak, type ProcessDetailData as al, type ProcessDetailUiSnapshotResponseBody as am, type ProcessDiagnosticsData as an, type ProcessDiagnosticsResponseBody as ao, type ProcessExternalSourceSummary as ap, type ProcessExternalTriggerSignal as aq, type ProcessExternalTriggerSummary as ar, type ProcessInstanceTreeResponseBody as as, type ProcessLaunchConfigurationParameterView as at, type ProcessLaunchConfigurationProjectView as au, type ProcessLaunchConfigurationView as av, type ProcessListItem as aw, type ProcessModelConfigurationIssueView as ax, type ProcessModelConfigurationView as ay, type ProcessOverviewItem as az, type PrimaryPathToolCallSnapshot as b, type SkillUsageProcessSummary as b0, type SkillUsageSummary as b1, type SkillsCatalogResponseBody as b2, type StartupRecoverySummary as b3, type SubmitQuestionAnswersRequestBody as b4, type TurnPiInputPart as b5, type TurnPiInputPartRole as b6, type TurnPiInputSnapshot as b7, type TurnReasoningDetailResponseBody as b8, type TurnTracePreview as b9, type TurnTraceSnapshot as ba, type TurnTraceToolCallSnapshot as bb, type TurnUsageSnapshot as bc, type UiLauncherSummary as bd, type UsageCostSnapshot as be, type WatcherLaunchModelSummary as bf, type WatcherPresentationField as bg, type WatcherSummary as bh, type WatchersResponseBody as bi, cloneUsageSnapshot as bj, mergeUsageSnapshots as bk, normalizeUsageSnapshot as bl, parseActionRequestBody as bm, parseFutureActionPayloadJson as bn, parseFutureActionPayloadObject as bo, parseFutureLaunchPayloadJson as bp, parseFutureLaunchPayloadObject as bq, parseLauncherInputJson as br, parseLauncherModelConfigInput as bs, parseLauncherRequestBody as bt, parseLauncherTurnConfigsJson as bu, parseScheduleRequestInput as bv, resolvePromptCacheSwitch as bw, serializeFutureActionPayload as bx, serializeFutureLaunchPayload as by, validateScheduleRequestInput as bz, type PrimaryPathTraceItemSnapshot as c, type PrimaryPathOperationalTraceItemSnapshot as d, type PrimaryPathActiveTurnSnapshot as e, type ProcessTimelineTurnSummary as f, type ProcessTimelineTurnPresentation as g, type CurrentErrorSummary as h, type CurrentProcessErrorSummary as i, type CurrentTurnRecoverySummary as j, type FutureActionOverviewItem as k, type FutureActionPayload as l, type FutureActionSummary as m, type FutureExecutionBaseSummary as n, type FutureExecutionDetailResponseBody as o, type FutureLaunchOverviewItem as p, type FutureLaunchPayload as q, type FutureLaunchSummary as r, type InstalledSkillCatalogDetailResponseBody as s, type InstalledSkillCatalogItem as t, type InstanceTreeEdgeSummary as u, type InstanceTreeNodeSummary as v, type InstanceTreeTurnResultState as w, type LauncherDefaultsResponseBody as x, type LauncherModelConfigDefaults as y, type LauncherModelConfigPreview as z };
|
package/dist/http-contracts.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type Actor, type DurableModelSelection, type FutureExecutionBlockReason, type InstanceTurnConfigMap, type LaunchModelConfigInput, type ProcessEvent, type ProcessFlowView, type ProcessInput, type ProcessInstance, type ProcessLeafOutcomeSnapshot, type ProcessProject, type ProcessQuestionRequest, type ProcessRowSlot, type ProcessSelectedTurnModelSource, type ProcessTurnAnnotation, type ProcessTurnRecord, type ProcessTurnType, type QuestionAnswerDraft, type SerializedProcessGraph, type WorkerLease } from "@leitwerk-dev/domain";
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
-
import type { ProcessWatcherType } from "./config-snapshot.js";
|
|
4
3
|
import type { ActionFormDefinition, ActionFormFieldDefinition, FormFieldOptionDefinition } from "./form-contract.js";
|
|
5
4
|
import type { LauncherValidationError, UiLauncherSummaryBase } from "./launcher-contract.js";
|
|
6
5
|
import type { PrimaryPathSnapshot, PrimaryPathStreamingAssistantSnapshot, PrimaryPathToolCallSnapshot, PrimaryPathTraceItemSnapshot, TurnUsageSnapshot } from "./primary-path-snapshot.js";
|
|
@@ -370,43 +369,25 @@ export type WatcherLaunchModelSummary = {
|
|
|
370
369
|
modelProfileId: string | null;
|
|
371
370
|
}>;
|
|
372
371
|
};
|
|
373
|
-
export interface
|
|
372
|
+
export interface WatcherPresentationField {
|
|
373
|
+
label: string;
|
|
374
|
+
value: string;
|
|
375
|
+
format?: "text" | "code";
|
|
376
|
+
}
|
|
377
|
+
export interface WatcherSummary {
|
|
374
378
|
processId: string;
|
|
375
379
|
processDisplayName: string;
|
|
376
380
|
watcherId: string;
|
|
377
381
|
label: string;
|
|
378
382
|
description: string;
|
|
379
|
-
|
|
383
|
+
sourceId: string;
|
|
384
|
+
sourceLabel: string;
|
|
380
385
|
enabled: boolean;
|
|
381
|
-
pollInterval: string;
|
|
382
386
|
configPath: string;
|
|
383
387
|
targetSummary: string;
|
|
388
|
+
details: WatcherPresentationField[];
|
|
384
389
|
launchModel: WatcherLaunchModelSummary;
|
|
385
390
|
}
|
|
386
|
-
export interface JiraWatcherSummary extends WatcherSummaryBase {
|
|
387
|
-
type: "jira";
|
|
388
|
-
project: string;
|
|
389
|
-
labels: {
|
|
390
|
-
trigger: string;
|
|
391
|
-
done: string;
|
|
392
|
-
required?: string[];
|
|
393
|
-
forbidden?: string[];
|
|
394
|
-
};
|
|
395
|
-
targetBranchLabelPrefix: string;
|
|
396
|
-
}
|
|
397
|
-
export interface GitLabMrWatcherSummary extends WatcherSummaryBase {
|
|
398
|
-
type: "gitlab_mr";
|
|
399
|
-
group: string;
|
|
400
|
-
labels: {
|
|
401
|
-
trigger: string;
|
|
402
|
-
done: string;
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
export type FilesystemWatcherSummary = WatcherSummaryBase & {
|
|
406
|
-
type: "filesystem";
|
|
407
|
-
filePath: string;
|
|
408
|
-
};
|
|
409
|
-
export type WatcherSummary = JiraWatcherSummary | GitLabMrWatcherSummary | FilesystemWatcherSummary;
|
|
410
391
|
export interface SkillUsageSummary {
|
|
411
392
|
attachedAllTime: number;
|
|
412
393
|
attachedLast30Days: number;
|