@leitwerk-dev/protocol 0.1.6 → 0.1.8
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,287 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
err,
|
|
3
|
+
nullableStringSchema,
|
|
4
|
+
ok,
|
|
5
|
+
optionalNullableStringSchema,
|
|
6
|
+
parseLiteral,
|
|
7
|
+
parseSchema,
|
|
8
|
+
unknownRecordSchema
|
|
9
|
+
} from "./chunk-J7LXDQAN.js";
|
|
10
|
+
|
|
1
11
|
// src/http-contracts.ts
|
|
2
12
|
import {
|
|
3
13
|
normalizeActor,
|
|
4
14
|
normalizeLaunchModelConfigInput,
|
|
5
15
|
trimToNull
|
|
6
16
|
} from "@leitwerk-dev/domain";
|
|
7
|
-
import * as v2 from "valibot";
|
|
8
|
-
|
|
9
|
-
// src/protocol.ts
|
|
10
|
-
import {
|
|
11
|
-
PROCESS_SEMANTIC_ENTRY_REF_KEYS,
|
|
12
|
-
PROCESS_TURN_RECORD_PATH_TYPES,
|
|
13
|
-
PROCESS_TURN_TYPES
|
|
14
|
-
} from "@leitwerk-dev/domain";
|
|
15
17
|
import * as v from "valibot";
|
|
16
|
-
var ok = (value) => ({ ok: true, value });
|
|
17
|
-
var err = (error) => ({ ok: false, error });
|
|
18
|
-
var unknownRecordSchema = v.custom(
|
|
19
|
-
(value) => typeof value === "object" && value !== null && !Array.isArray(value),
|
|
20
|
-
"must be an object"
|
|
21
|
-
);
|
|
22
|
-
var nullableStringSchema = v.nullable(v.string());
|
|
23
|
-
var optionalNullableStringSchema = v.optional(nullableStringSchema);
|
|
24
|
-
function parseSchema(schema, value, context) {
|
|
25
|
-
const parsed = v.safeParse(schema, value);
|
|
26
|
-
if (parsed.success) {
|
|
27
|
-
return ok(parsed.output);
|
|
28
|
-
}
|
|
29
|
-
const issue = parsed.issues?.[0];
|
|
30
|
-
const target = issue ? [context, v.getDotPath(issue)].filter(Boolean).join(".") : context;
|
|
31
|
-
return err(
|
|
32
|
-
issue?.message === "must be an object" ? `${target} must be an object` : `${target} ${issue?.message ?? "is invalid"}`
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
function parseLiteral(value, allowed, context) {
|
|
36
|
-
return v.is(v.picklist(allowed), value) ? ok(value) : err(`${context} must be one of: ${allowed.join(", ")}`);
|
|
37
|
-
}
|
|
38
|
-
var WS_PROTOCOL_VERSION = "leitwerk/ws/v1";
|
|
39
|
-
var WS_PROCESS_TYPES = {
|
|
40
|
-
TOAST: "process.toast",
|
|
41
|
-
FUTURE_UPDATED: "future.updated"
|
|
42
|
-
};
|
|
43
|
-
var WS_PRIMARY_PATH_TYPES = {
|
|
44
|
-
TURN_STARTED: "primary_path.turn_started",
|
|
45
|
-
ASSISTANT_PARTIAL: "primary_path.assistant_partial",
|
|
46
|
-
USAGE_UPDATED: "primary_path.usage_updated",
|
|
47
|
-
ASSISTANT_COMMITTED: "primary_path.assistant_committed",
|
|
48
|
-
TOOL_CALL_STARTED: "primary_path.tool_call_started",
|
|
49
|
-
TOOL_CALL_COMPLETED: "primary_path.tool_call_completed",
|
|
50
|
-
TURN_ANNOTATION_CHANGED: "primary_path.turn_annotation_changed",
|
|
51
|
-
LABEL_CHANGED: "primary_path.label_changed",
|
|
52
|
-
CHANGED: "primary_path.changed"
|
|
53
|
-
};
|
|
54
|
-
var WS_PI_STREAM_TYPES = {
|
|
55
|
-
STARTED: "pi.stream.started",
|
|
56
|
-
DELTA: "pi.stream.delta",
|
|
57
|
-
COMPLETED: "pi.stream.completed",
|
|
58
|
-
TOOL_STARTED: "pi.tool.started",
|
|
59
|
-
TOOL_COMPLETED: "pi.tool.completed",
|
|
60
|
-
LABEL_CHANGED: "pi.label.changed",
|
|
61
|
-
ERROR: "pi.error",
|
|
62
|
-
RETRY_START: "pi.retry.start",
|
|
63
|
-
RETRY_END: "pi.retry.end",
|
|
64
|
-
USAGE: "pi.usage"
|
|
65
|
-
};
|
|
66
|
-
var finiteNumberSchema = v.pipe(v.number(), v.finite());
|
|
67
|
-
var semanticEntryRefSchema = v.object({
|
|
68
|
-
entryId: v.string(),
|
|
69
|
-
turnRecordId: nullableStringSchema
|
|
70
|
-
});
|
|
71
|
-
var primaryPathBasePayloadEntries = {
|
|
72
|
-
turnRecordId: nullableStringSchema,
|
|
73
|
-
piTurnId: nullableStringSchema,
|
|
74
|
-
timestamp: v.string()
|
|
75
|
-
};
|
|
76
|
-
var primaryPathTreeEntries = {
|
|
77
|
-
rootEntry: v.nullable(semanticEntryRefSchema),
|
|
78
|
-
currentLeaf: v.nullable(semanticEntryRefSchema)
|
|
79
|
-
};
|
|
80
|
-
var primaryPathTreeSchema = v.object(primaryPathTreeEntries);
|
|
81
|
-
var processTurnRecordSummarySchema = v.object({
|
|
82
|
-
id: v.string(),
|
|
83
|
-
turnId: v.string(),
|
|
84
|
-
turnType: v.picklist(PROCESS_TURN_TYPES),
|
|
85
|
-
pathType: v.picklist(PROCESS_TURN_RECORD_PATH_TYPES),
|
|
86
|
-
startedAt: v.string()
|
|
87
|
-
});
|
|
88
|
-
var usageCostSnapshotSchema = v.object({
|
|
89
|
-
input: finiteNumberSchema,
|
|
90
|
-
output: finiteNumberSchema,
|
|
91
|
-
reasoning: v.optional(finiteNumberSchema),
|
|
92
|
-
cacheRead: finiteNumberSchema,
|
|
93
|
-
cacheWrite: finiteNumberSchema,
|
|
94
|
-
total: finiteNumberSchema
|
|
95
|
-
});
|
|
96
|
-
var usageSnapshotSchema = v.object({
|
|
97
|
-
input: finiteNumberSchema,
|
|
98
|
-
output: finiteNumberSchema,
|
|
99
|
-
cacheRead: finiteNumberSchema,
|
|
100
|
-
cacheWrite: finiteNumberSchema,
|
|
101
|
-
totalTokens: finiteNumberSchema,
|
|
102
|
-
cost: v.nullable(usageCostSnapshotSchema)
|
|
103
|
-
});
|
|
104
|
-
var turnAnnotationReferenceSchema = v.variant("kind", [
|
|
105
|
-
v.object({
|
|
106
|
-
kind: v.literal("turn_record"),
|
|
107
|
-
turnRecordId: v.string(),
|
|
108
|
-
role: nullableStringSchema
|
|
109
|
-
}),
|
|
110
|
-
v.object({
|
|
111
|
-
kind: v.literal("entry"),
|
|
112
|
-
entryId: v.string(),
|
|
113
|
-
role: nullableStringSchema
|
|
114
|
-
}),
|
|
115
|
-
v.object({
|
|
116
|
-
kind: v.literal("semantic_entry_ref"),
|
|
117
|
-
ref: v.picklist(PROCESS_SEMANTIC_ENTRY_REF_KEYS),
|
|
118
|
-
role: nullableStringSchema
|
|
119
|
-
})
|
|
120
|
-
]);
|
|
121
|
-
var processTurnAnnotationSchema = v.object({
|
|
122
|
-
id: v.string(),
|
|
123
|
-
instanceId: v.string(),
|
|
124
|
-
annotationType: v.string(),
|
|
125
|
-
annotationKey: nullableStringSchema,
|
|
126
|
-
references: v.array(turnAnnotationReferenceSchema),
|
|
127
|
-
payload: unknownRecordSchema,
|
|
128
|
-
createdAt: v.string(),
|
|
129
|
-
updatedAt: v.string()
|
|
130
|
-
});
|
|
131
|
-
var PRIMARY_PATH_PAYLOAD_SCHEMAS = {
|
|
132
|
-
[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: v.object({
|
|
133
|
-
turnRecord: processTurnRecordSummarySchema
|
|
134
|
-
}),
|
|
135
|
-
[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: v.object({
|
|
136
|
-
...primaryPathBasePayloadEntries,
|
|
137
|
-
text: v.string(),
|
|
138
|
-
streamType: v.string()
|
|
139
|
-
}),
|
|
140
|
-
[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: v.object({
|
|
141
|
-
...primaryPathBasePayloadEntries,
|
|
142
|
-
usage: usageSnapshotSchema
|
|
143
|
-
}),
|
|
144
|
-
[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: v.object({
|
|
145
|
-
turnRecord: processTurnRecordSummarySchema,
|
|
146
|
-
...primaryPathTreeEntries
|
|
147
|
-
}),
|
|
148
|
-
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: v.object({
|
|
149
|
-
...primaryPathBasePayloadEntries,
|
|
150
|
-
toolCallId: v.string(),
|
|
151
|
-
toolName: v.string(),
|
|
152
|
-
arguments: v.nullable(unknownRecordSchema)
|
|
153
|
-
}),
|
|
154
|
-
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: v.object({
|
|
155
|
-
...primaryPathBasePayloadEntries,
|
|
156
|
-
toolCallId: v.string(),
|
|
157
|
-
toolName: v.string(),
|
|
158
|
-
result: v.unknown(),
|
|
159
|
-
isError: v.boolean()
|
|
160
|
-
}),
|
|
161
|
-
[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: v.object({
|
|
162
|
-
change: v.picklist(["created", "updated"]),
|
|
163
|
-
annotation: processTurnAnnotationSchema
|
|
164
|
-
}),
|
|
165
|
-
[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: v.object({
|
|
166
|
-
...primaryPathBasePayloadEntries,
|
|
167
|
-
targetId: nullableStringSchema,
|
|
168
|
-
label: nullableStringSchema
|
|
169
|
-
}),
|
|
170
|
-
[WS_PRIMARY_PATH_TYPES.CHANGED]: primaryPathTreeSchema
|
|
171
|
-
};
|
|
172
|
-
var WS_FRAME_DURABILITY = {
|
|
173
|
-
hello: "ephemeral",
|
|
174
|
-
pong: "ephemeral",
|
|
175
|
-
"process.created": "durable",
|
|
176
|
-
"process.updated": "durable",
|
|
177
|
-
"process.deleted": "durable",
|
|
178
|
-
"project.updated": "durable",
|
|
179
|
-
"worker.state": "durable",
|
|
180
|
-
"process.input.queued": "durable",
|
|
181
|
-
"process.input.acknowledged": "durable",
|
|
182
|
-
"process.event": "durable",
|
|
183
|
-
[WS_PROCESS_TYPES.TOAST]: "ephemeral",
|
|
184
|
-
[WS_PROCESS_TYPES.FUTURE_UPDATED]: "durable",
|
|
185
|
-
"plan.updated": "durable",
|
|
186
|
-
"review.updated": "durable",
|
|
187
|
-
[WS_PI_STREAM_TYPES.STARTED]: "ephemeral",
|
|
188
|
-
[WS_PI_STREAM_TYPES.DELTA]: "ephemeral",
|
|
189
|
-
[WS_PI_STREAM_TYPES.COMPLETED]: "ephemeral",
|
|
190
|
-
[WS_PI_STREAM_TYPES.TOOL_STARTED]: "ephemeral",
|
|
191
|
-
[WS_PI_STREAM_TYPES.TOOL_COMPLETED]: "ephemeral",
|
|
192
|
-
[WS_PI_STREAM_TYPES.LABEL_CHANGED]: "ephemeral",
|
|
193
|
-
[WS_PI_STREAM_TYPES.ERROR]: "ephemeral",
|
|
194
|
-
[WS_PI_STREAM_TYPES.RETRY_START]: "ephemeral",
|
|
195
|
-
[WS_PI_STREAM_TYPES.RETRY_END]: "ephemeral",
|
|
196
|
-
[WS_PI_STREAM_TYPES.USAGE]: "ephemeral",
|
|
197
|
-
[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: "durable",
|
|
198
|
-
[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: "ephemeral",
|
|
199
|
-
[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: "ephemeral",
|
|
200
|
-
[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: "durable",
|
|
201
|
-
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: "ephemeral",
|
|
202
|
-
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: "ephemeral",
|
|
203
|
-
[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: "durable",
|
|
204
|
-
[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: "durable",
|
|
205
|
-
[WS_PRIMARY_PATH_TYPES.CHANGED]: "durable"
|
|
206
|
-
};
|
|
207
|
-
var KNOWN_WS_FRAME_TYPES = Object.keys(WS_FRAME_DURABILITY);
|
|
208
|
-
var PRIMARY_PATH_WS_FRAME_TYPES = Object.values(
|
|
209
|
-
WS_PRIMARY_PATH_TYPES
|
|
210
|
-
);
|
|
211
|
-
var WS_FRAME_SCHEMA = v.looseObject({
|
|
212
|
-
protocol: v.literal(WS_PROTOCOL_VERSION),
|
|
213
|
-
type: v.picklist(KNOWN_WS_FRAME_TYPES),
|
|
214
|
-
durability: v.picklist(["durable", "ephemeral"]),
|
|
215
|
-
sentAt: v.string(),
|
|
216
|
-
instanceId: v.optional(v.string()),
|
|
217
|
-
payload: unknownRecordSchema
|
|
218
|
-
});
|
|
219
|
-
function parsePrimaryPathWsFrameInput(value) {
|
|
220
|
-
const frame = parseWsFrame(value);
|
|
221
|
-
if (!frame.ok) {
|
|
222
|
-
return frame;
|
|
223
|
-
}
|
|
224
|
-
const type = parseLiteral(
|
|
225
|
-
frame.value.type,
|
|
226
|
-
PRIMARY_PATH_WS_FRAME_TYPES,
|
|
227
|
-
"primary_path ws frame.type"
|
|
228
|
-
);
|
|
229
|
-
if (!type.ok) {
|
|
230
|
-
return type;
|
|
231
|
-
}
|
|
232
|
-
const payload = parseSchema(
|
|
233
|
-
PRIMARY_PATH_PAYLOAD_SCHEMAS[type.value],
|
|
234
|
-
frame.value.payload,
|
|
235
|
-
`primary_path ws frame.payload (${type.value})`
|
|
236
|
-
);
|
|
237
|
-
return payload.ok ? ok({ ...frame.value, type: type.value, payload: payload.value }) : payload;
|
|
238
|
-
}
|
|
239
|
-
function parseWsFrame(value) {
|
|
240
|
-
const frame = parseSchema(WS_FRAME_SCHEMA, value, "ws frame");
|
|
241
|
-
if (!frame.ok) {
|
|
242
|
-
return frame;
|
|
243
|
-
}
|
|
244
|
-
return frame.value.durability !== WS_FRAME_DURABILITY[frame.value.type] ? err(
|
|
245
|
-
`ws frame.durability must be '${WS_FRAME_DURABILITY[frame.value.type]}' for type '${frame.value.type}'`
|
|
246
|
-
) : ok(frame.value);
|
|
247
|
-
}
|
|
248
|
-
function createDurableWsFrame(input) {
|
|
249
|
-
return {
|
|
250
|
-
protocol: WS_PROTOCOL_VERSION,
|
|
251
|
-
type: input.type,
|
|
252
|
-
durability: "durable",
|
|
253
|
-
sentAt: input.sentAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
254
|
-
...input.instanceId ? { instanceId: input.instanceId } : {},
|
|
255
|
-
payload: input.payload
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
function createEphemeralWsFrame(input) {
|
|
259
|
-
return {
|
|
260
|
-
protocol: WS_PROTOCOL_VERSION,
|
|
261
|
-
type: input.type,
|
|
262
|
-
durability: "ephemeral",
|
|
263
|
-
sentAt: input.sentAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
264
|
-
...input.instanceId ? { instanceId: input.instanceId } : {},
|
|
265
|
-
payload: input.payload
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
var WORKER_TO_WS_TYPE = {
|
|
269
|
-
"pi.stream.delta": WS_PI_STREAM_TYPES.DELTA,
|
|
270
|
-
"pi.turn.start": WS_PI_STREAM_TYPES.STARTED,
|
|
271
|
-
"pi.turn.end": WS_PI_STREAM_TYPES.COMPLETED,
|
|
272
|
-
"pi.tool.call": WS_PI_STREAM_TYPES.TOOL_STARTED,
|
|
273
|
-
"pi.tool.result": WS_PI_STREAM_TYPES.TOOL_COMPLETED,
|
|
274
|
-
"pi.label.changed": WS_PI_STREAM_TYPES.LABEL_CHANGED,
|
|
275
|
-
"pi.error": WS_PI_STREAM_TYPES.ERROR,
|
|
276
|
-
"pi.retry.start": WS_PI_STREAM_TYPES.RETRY_START,
|
|
277
|
-
"pi.retry.end": WS_PI_STREAM_TYPES.RETRY_END,
|
|
278
|
-
"pi.usage": WS_PI_STREAM_TYPES.USAGE
|
|
279
|
-
};
|
|
280
|
-
function mapWorkerEventToWsType(workerEventType) {
|
|
281
|
-
return WORKER_TO_WS_TYPE[workerEventType] ?? null;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// src/http-contracts.ts
|
|
285
18
|
function resolvePromptCacheSwitch(input) {
|
|
286
19
|
const expiresAtMs = input.context ? Date.parse(input.context.expiresAt) : Number.NaN;
|
|
287
20
|
if (!input.context || !Number.isFinite(expiresAtMs) || (input.now ?? Date.now()) > expiresAtMs || input.context.compatibleModelProfileIds.includes(input.effectiveModelProfileId)) {
|
|
@@ -305,41 +38,41 @@ var PROCESS_LIFECYCLE_STATUSES = [
|
|
|
305
38
|
"completed",
|
|
306
39
|
"aborted"
|
|
307
40
|
];
|
|
308
|
-
var launcherStructuredBodySchema =
|
|
309
|
-
title:
|
|
310
|
-
launcherInput:
|
|
311
|
-
skillIds:
|
|
312
|
-
modelConfig:
|
|
313
|
-
schedule:
|
|
41
|
+
var launcherStructuredBodySchema = v.strictObject({
|
|
42
|
+
title: v.optional(nullableStringSchema),
|
|
43
|
+
launcherInput: v.optional(unknownRecordSchema),
|
|
44
|
+
skillIds: v.optional(v.array(v.string())),
|
|
45
|
+
modelConfig: v.optional(v.unknown()),
|
|
46
|
+
schedule: v.optional(v.unknown())
|
|
314
47
|
});
|
|
315
|
-
var actionStructuredBodySchema =
|
|
316
|
-
input:
|
|
48
|
+
var actionStructuredBodySchema = v.strictObject({
|
|
49
|
+
input: v.optional(unknownRecordSchema),
|
|
317
50
|
nextTurnModelProfileId: optionalNullableStringSchema,
|
|
318
|
-
schedule:
|
|
51
|
+
schedule: v.optional(v.unknown())
|
|
319
52
|
});
|
|
320
|
-
var futureLaunchPayloadInputSchema =
|
|
321
|
-
launcherInput:
|
|
322
|
-
modelConfig:
|
|
323
|
-
actor:
|
|
324
|
-
launchPlan:
|
|
325
|
-
launcherId:
|
|
326
|
-
processId:
|
|
53
|
+
var futureLaunchPayloadInputSchema = v.object({
|
|
54
|
+
launcherInput: v.optional(v.nullable(unknownRecordSchema)),
|
|
55
|
+
modelConfig: v.optional(v.unknown()),
|
|
56
|
+
actor: v.optional(v.nullable(unknownRecordSchema)),
|
|
57
|
+
launchPlan: v.object({
|
|
58
|
+
launcherId: v.string(),
|
|
59
|
+
processId: v.string(),
|
|
327
60
|
handoffDedupKey: optionalNullableStringSchema,
|
|
328
|
-
processInput:
|
|
329
|
-
processId:
|
|
61
|
+
processInput: v.object({
|
|
62
|
+
processId: v.string(),
|
|
330
63
|
selectedTurnId: optionalNullableStringSchema,
|
|
331
|
-
lifecycleStatus:
|
|
64
|
+
lifecycleStatus: v.picklist(PROCESS_LIFECYCLE_STATUSES),
|
|
332
65
|
title: optionalNullableStringSchema,
|
|
333
66
|
externalId: optionalNullableStringSchema,
|
|
334
67
|
externalUrl: optionalNullableStringSchema,
|
|
335
|
-
metadata:
|
|
68
|
+
metadata: v.optional(v.nullable(unknownRecordSchema)),
|
|
336
69
|
defaultModelProfileId: optionalNullableStringSchema,
|
|
337
70
|
turnConfigsJson: optionalNullableStringSchema,
|
|
338
71
|
selectedTurnModelProfileId: optionalNullableStringSchema,
|
|
339
|
-
selectedTurnModelKind:
|
|
340
|
-
selectedTurnModelSource:
|
|
341
|
-
|
|
342
|
-
|
|
72
|
+
selectedTurnModelKind: v.optional(v.nullable(v.picklist(["explicit", "inherited"]))),
|
|
73
|
+
selectedTurnModelSource: v.optional(
|
|
74
|
+
v.nullable(
|
|
75
|
+
v.picklist([
|
|
343
76
|
"action_override",
|
|
344
77
|
"launch_override",
|
|
345
78
|
"instance_turn_config",
|
|
@@ -354,36 +87,36 @@ var futureLaunchPayloadInputSchema = v2.object({
|
|
|
354
87
|
paramsJson: optionalNullableStringSchema,
|
|
355
88
|
stateJson: optionalNullableStringSchema
|
|
356
89
|
}),
|
|
357
|
-
titleSourceFields:
|
|
358
|
-
|
|
90
|
+
titleSourceFields: v.optional(
|
|
91
|
+
v.nullable(v.array(v.object({ label: v.string(), value: v.string() })))
|
|
359
92
|
),
|
|
360
|
-
projectInputs:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
key:
|
|
365
|
-
repoLocator:
|
|
366
|
-
baseBranch:
|
|
93
|
+
projectInputs: v.optional(
|
|
94
|
+
v.nullable(
|
|
95
|
+
v.array(
|
|
96
|
+
v.object({
|
|
97
|
+
key: v.string(),
|
|
98
|
+
repoLocator: v.string(),
|
|
99
|
+
baseBranch: v.string(),
|
|
367
100
|
workBranch: optionalNullableStringSchema,
|
|
368
101
|
externalId: optionalNullableStringSchema,
|
|
369
102
|
externalUrl: optionalNullableStringSchema,
|
|
370
|
-
metadata:
|
|
103
|
+
metadata: v.optional(v.nullable(unknownRecordSchema))
|
|
371
104
|
})
|
|
372
105
|
)
|
|
373
106
|
)
|
|
374
107
|
),
|
|
375
108
|
startTurnId: optionalNullableStringSchema
|
|
376
109
|
}),
|
|
377
|
-
selectedSkillIds:
|
|
378
|
-
resourceSelections:
|
|
379
|
-
|
|
110
|
+
selectedSkillIds: v.optional(v.array(v.string())),
|
|
111
|
+
resourceSelections: v.optional(
|
|
112
|
+
v.array(v.object({ skillId: v.string(), revisionId: v.string() }))
|
|
380
113
|
)
|
|
381
114
|
});
|
|
382
|
-
var futureActionPayloadInputSchema =
|
|
383
|
-
input:
|
|
115
|
+
var futureActionPayloadInputSchema = v.object({
|
|
116
|
+
input: v.optional(v.nullable(unknownRecordSchema)),
|
|
384
117
|
nextTurnModelProfileId: optionalNullableStringSchema,
|
|
385
118
|
actionLabel: optionalNullableStringSchema,
|
|
386
|
-
actor:
|
|
119
|
+
actor: v.optional(v.nullable(unknownRecordSchema))
|
|
387
120
|
});
|
|
388
121
|
var cloneUnknownRecord = (value) => value ? { ...value } : null;
|
|
389
122
|
var cloneTurnConfigMap = (turnConfigs = {}) => Object.fromEntries(
|
|
@@ -448,8 +181,8 @@ var normalizeFutureActionPayload = (payload) => ({
|
|
|
448
181
|
actionLabel: trimToNull(payload.actionLabel) ?? null,
|
|
449
182
|
actor: normalizeActor(payload.actor)
|
|
450
183
|
});
|
|
451
|
-
function hasOwn(
|
|
452
|
-
return Object.hasOwn(
|
|
184
|
+
function hasOwn(object2, key) {
|
|
185
|
+
return Object.hasOwn(object2, key);
|
|
453
186
|
}
|
|
454
187
|
function parseJsonPayload(payloadJson, context) {
|
|
455
188
|
try {
|
|
@@ -555,8 +288,8 @@ function parseLauncherModelConfigInput(value, context = "modelConfig") {
|
|
|
555
288
|
})
|
|
556
289
|
) : turnConfigs;
|
|
557
290
|
}
|
|
558
|
-
function hasInlineScheduleFields(
|
|
559
|
-
return hasOwn(
|
|
291
|
+
function hasInlineScheduleFields(object2) {
|
|
292
|
+
return hasOwn(object2, "mode") || hasOwn(object2, "runAt") || hasOwn(object2, "cronExpression");
|
|
560
293
|
}
|
|
561
294
|
function parseLauncherRequestBody(value) {
|
|
562
295
|
if (value === void 0 || value === null) {
|
|
@@ -705,23 +438,6 @@ function parseFutureActionPayloadJson(payloadJson) {
|
|
|
705
438
|
}
|
|
706
439
|
|
|
707
440
|
export {
|
|
708
|
-
ok,
|
|
709
|
-
err,
|
|
710
|
-
unknownRecordSchema,
|
|
711
|
-
nullableStringSchema,
|
|
712
|
-
optionalNullableStringSchema,
|
|
713
|
-
parseSchema,
|
|
714
|
-
parseLiteral,
|
|
715
|
-
WS_PROTOCOL_VERSION,
|
|
716
|
-
WS_PROCESS_TYPES,
|
|
717
|
-
WS_PRIMARY_PATH_TYPES,
|
|
718
|
-
WS_PI_STREAM_TYPES,
|
|
719
|
-
WS_FRAME_DURABILITY,
|
|
720
|
-
parsePrimaryPathWsFrameInput,
|
|
721
|
-
parseWsFrame,
|
|
722
|
-
createDurableWsFrame,
|
|
723
|
-
createEphemeralWsFrame,
|
|
724
|
-
mapWorkerEventToWsType,
|
|
725
441
|
resolvePromptCacheSwitch,
|
|
726
442
|
parseScheduleRequestInput,
|
|
727
443
|
validateScheduleRequestInput,
|
|
@@ -737,4 +453,4 @@ export {
|
|
|
737
453
|
parseFutureActionPayloadObject,
|
|
738
454
|
parseFutureActionPayloadJson
|
|
739
455
|
};
|
|
740
|
-
//# sourceMappingURL=chunk-
|
|
456
|
+
//# sourceMappingURL=chunk-ABLI5SG5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/http-contracts.ts"],"sourcesContent":["import {\n\ttype Actor,\n\ttype DurableModelSelection,\n\ttype FutureExecutionBlockReason,\n\ttype InstanceTurnConfigMap,\n\ttype LaunchModelConfigInput,\n\tnormalizeActor,\n\tnormalizeLaunchModelConfigInput,\n\ttype ProcessEvent,\n\ttype ProcessFlowView,\n\ttype ProcessInput,\n\ttype ProcessInstance,\n\ttype ProcessLeafOutcomeSnapshot,\n\ttype ProcessProject,\n\ttype ProcessQuestionRequest,\n\ttype ProcessRowSlot,\n\ttype ProcessSelectedTurnModelSource,\n\ttype ProcessTurnAnnotation,\n\ttype ProcessTurnRecord,\n\ttype ProcessTurnType,\n\ttype QuestionAnswerDraft,\n\ttype SerializedProcessGraph,\n\ttrimToNull,\n\ttype WorkerLease,\n} from \"@leitwerk-dev/domain\";\nimport * as v from \"valibot\";\nimport type {\n\tActionFormDefinition,\n\tActionFormFieldDefinition,\n\tFormFieldOptionDefinition,\n} from \"./form-contract.js\";\nimport type { LauncherValidationError, UiLauncherSummaryBase } from \"./launcher-contract.js\";\nimport type {\n\tPrimaryPathSnapshot,\n\tPrimaryPathStreamingAssistantSnapshot,\n\tPrimaryPathToolCallSnapshot,\n\tPrimaryPathTraceItemSnapshot,\n\tTurnUsageSnapshot,\n} from \"./primary-path-snapshot.js\";\nimport {\n\terr,\n\tnullableStringSchema,\n\tok,\n\toptionalNullableStringSchema,\n\ttype ParseResult,\n\tparseLiteral,\n\tparseSchema,\n\tunknownRecordSchema,\n} from \"./protocol.js\";\nimport type { ToolCallRendererDefinition } from \"./tool-renderer-contract.js\";\n\nexport interface AuthMeResponseBody {\n\tauthEnabled: boolean;\n\tactor: Actor | null;\n}\n\nexport interface ProcessListItem {\n\tprocess: ProcessInstance;\n\tprojects: ProcessProject[];\n\tworkerLease: WorkerLease | null;\n\tprocessDisplayName: string | null;\n}\n\nexport type ScheduleMode = \"now\" | \"once\" | \"cron\";\n\nexport type ScheduleConfigInput = {\n\tmode: ScheduleMode;\n\trunAt?: string | null;\n\tcronExpression?: string | null;\n};\n\nexport interface FutureExecutionBaseSummary {\n\tid: string;\n\tkind: \"launch\" | \"action\";\n\tscheduleKind: \"once\" | \"cron\";\n\tprocessId: string;\n\tnextRunAt: string;\n\tcronExpression: string | null;\n\ttitle: string;\n\tsubtitle: string;\n\tstatus?: \"scheduled\" | \"blocked\";\n\tmodelSelection?: DurableModelSelection | null;\n\tblockedReason?: FutureExecutionBlockReason | null;\n}\n\nexport type LauncherModelConfigDefaults = LaunchModelConfigInput;\n\nexport interface FutureLaunchSummary extends FutureExecutionBaseSummary {\n\tkind: \"launch\";\n\tlauncherId: string;\n\tlauncherLabel: string;\n\tlaunchTitle: string | null;\n\tlauncherInput: Record<string, unknown>;\n\tskillIds: string[];\n\tmodelConfig: LauncherModelConfigDefaults;\n}\n\nexport interface FutureActionSummary extends FutureExecutionBaseSummary {\n\tkind: \"action\";\n\tinstanceId: string;\n\tactionId: string;\n\tactionLabel: string;\n\tnextTurnModelProfileId: string | null;\n}\n\nexport type FutureExecutionSummary = FutureLaunchSummary | FutureActionSummary;\n\nexport type ProcessActionFieldDefinition = ActionFormFieldDefinition;\nexport type ProcessActionFormDefinition = ActionFormDefinition;\n\nexport type ProcessActionPreviewSummary = {\n\tkind: \"turn\" | \"terminal\";\n\tturnId: string | null;\n\tturnKind: ProcessTurnType | null;\n\tdescription: string;\n};\n\nexport interface ProcessActionSummary {\n\tid: string;\n\tlabel: string;\n\tdescription: string | null;\n\tpreview: ProcessActionPreviewSummary | null;\n\tsupportsScheduling: boolean;\n\tsupportsNextTurnModelOverride: boolean;\n\tform?: ProcessActionFormDefinition;\n}\n\nexport interface ScheduledActionDetail {\n\tid: string;\n\tnextRunAt: string;\n\tactionId: string;\n\tactionLabel: string;\n\tinput: Record<string, unknown>;\n\tnextTurnModelProfileId: string | null;\n\tstatus?: \"scheduled\" | \"blocked\";\n\tmodelSelection?: DurableModelSelection | null;\n\tblockedReason?: FutureExecutionBlockReason | null;\n\taction: ProcessActionSummary;\n}\n\nexport type ProcessActionModelResolutionSource =\n\t| ProcessSelectedTurnModelSource\n\t| \"persisted_selection\"\n\t| \"none\";\n\nexport interface ProcessActionModelResolutionPreview {\n\tstatus: \"resolved\" | \"none\" | \"error\";\n\tmodelProfileId: string | null;\n\tsource: ProcessActionModelResolutionSource | null;\n\terror: string | null;\n}\n\nexport interface ProcessActionWarmPromptCacheContext {\n\tpreviousModelProfileId: string;\n\tcompatibleModelProfileIds: readonly string[];\n\texpiresAt: string;\n}\n\nexport interface PromptCacheSwitchResolution {\n\tswitchingModelMayBypassPromptCache: boolean;\n\trecommendedModelProfileId: string | null;\n}\n\nexport function resolvePromptCacheSwitch(input: {\n\tcontext: ProcessActionWarmPromptCacheContext | null | undefined;\n\teffectiveModelProfileId: string;\n\tselectableModelProfileIds?: readonly string[];\n\tnow?: number;\n}): PromptCacheSwitchResolution {\n\tconst expiresAtMs = input.context ? Date.parse(input.context.expiresAt) : Number.NaN;\n\tif (\n\t\t!input.context ||\n\t\t!Number.isFinite(expiresAtMs) ||\n\t\t(input.now ?? Date.now()) > expiresAtMs ||\n\t\tinput.context.compatibleModelProfileIds.includes(input.effectiveModelProfileId)\n\t) {\n\t\treturn { switchingModelMayBypassPromptCache: false, recommendedModelProfileId: null };\n\t}\n\tconst selectableIds = input.selectableModelProfileIds\n\t\t? new Set(input.selectableModelProfileIds)\n\t\t: null;\n\tconst recommendations = input.context.compatibleModelProfileIds.filter(\n\t\t(profileId) => !selectableIds || selectableIds.has(profileId),\n\t);\n\treturn {\n\t\tswitchingModelMayBypassPromptCache: true,\n\t\trecommendedModelProfileId: recommendations.includes(input.context.previousModelProfileId)\n\t\t\t? input.context.previousModelProfileId\n\t\t\t: (recommendations[0] ?? null),\n\t};\n}\n\nexport interface ProcessActionModelPreview {\n\tkind: \"llm_turn\" | \"not_applicable\" | \"unavailable\";\n\tturnId: string | null;\n\tdescription: string | null;\n\tresolvedModel?: ProcessActionModelResolutionPreview;\n\twarmPromptCache?: ProcessActionWarmPromptCacheContext;\n\tunavailableReason?:\n\t\t| \"action_not_found\"\n\t\t| \"action_not_visible\"\n\t\t| \"invalid_action_input\"\n\t\t| \"action_failed\";\n\tunavailableMessage?: string | null;\n}\n\nexport type ProcessExternalSourceSummary = {\n\tid: string;\n\tkind: string;\n\texternalActionId?: string;\n\tsourceKind?: string;\n\tlabel: string | null;\n\tdescription: string | null;\n};\n\nexport type ProcessExternalTriggerSummary = ProcessExternalSourceSummary;\n\nexport interface ProcessSelectedTurnSummary {\n\tturnId: string;\n\tkind: ProcessTurnType;\n\tdescription: string;\n\tcommentary: string | null;\n\texternalTriggers: ProcessExternalSourceSummary[];\n}\n\nexport type ModelProfileAvailability = \"available\" | \"unavailable\" | \"stale\";\n\nexport type ModelProfileOptionSummary = {\n\tid: string;\n\tlabel: string;\n\tdescription: string;\n\tavailability: ModelProfileAvailability;\n\tsafeReason?: string | null;\n\tcheckedAt?: string | null;\n};\n\nexport interface ProviderOptionChoiceSummary {\n\tvalue: string;\n\tlabel: string;\n}\n\nexport interface ProviderOptionFieldSummary {\n\tid: string;\n\tlabel: string;\n\trequired: boolean;\n\tminLength: number | null;\n\tmaxLength: number | null;\n\tdefaultValue: string | null;\n\t/** Advisory values. Values outside this list can still be valid. */\n\tchoices: readonly ProviderOptionChoiceSummary[];\n}\n\nexport interface ModelProviderOptionsResponseBody {\n\tmodelProfileId: string;\n\tproviderId: string;\n\tfields: readonly ProviderOptionFieldSummary[];\n\tchoicesStatus: \"available\" | \"unavailable\";\n\tchoicesUnavailableReason: string | null;\n}\n\nexport interface ProcessTurnModelConfigurationView {\n\tturnId: string;\n\tdescription: string;\n\tpathType: string;\n\tprocessConfigModelProfileId: string | null;\n\tinstanceModelProfileId: string | null;\n\teffectiveConfiguredModelProfileId: string | null;\n\tsource: \"instance\" | \"process_config\" | \"default\";\n}\n\nexport type ProcessModelConfigurationIssueView = {\n\tcode: \"invalid_turn_configs_json\";\n\treason: \"invalid_json\" | \"not_object\" | \"turn_config_not_object\";\n\tturnId?: string;\n};\n\nexport interface ProcessModelConfigurationView {\n\tstate:\n\t\t| { kind: \"ready\" }\n\t\t| { kind: \"blocked\"; issues: readonly ProcessModelConfigurationIssueView[] };\n\tavailableProfiles: readonly ModelProfileOptionSummary[];\n\teffectiveSelectedTurn: {\n\t\tturnId: string;\n\t\tdescription: string;\n\t\tmodelProfileId: string;\n\t\tsource: ProcessActionModelResolutionSource;\n\t} | null;\n\tdefaultModel: {\n\t\tprocessConfigModelProfileId: string | null;\n\t\tinstanceModelProfileId: string | null;\n\t\teffectiveModelProfileId: string | null;\n\t\tsource: \"instance\" | \"process_config\" | \"catalog_default\" | \"none\";\n\t};\n\tturns: readonly ProcessTurnModelConfigurationView[];\n}\n\nexport type ProcessRunToolParameterView = {\n\tname: string;\n\ttype: string;\n\tdescription: string;\n\trequired: boolean;\n};\n\nexport type ProcessRunToolView = {\n\tname: string;\n\tdescription: string;\n\tparameters: readonly ProcessRunToolParameterView[];\n};\n\nexport type ProcessRunTurnView = {\n\tturnId: string;\n\tdescription: string;\n\tpathType: string;\n\tconsumedProducts: readonly string[];\n\tpublishedProducts: readonly string[];\n\tactivePiToolNames: readonly string[];\n\toutcomeActions: readonly ProcessRunToolView[];\n};\n\nexport type ProcessRunDetailsView = {\n\tsystemPrompt: string | null;\n\tappendSystemPrompt: string | null;\n\tavailablePiToolNames: readonly string[];\n\tturns: readonly ProcessRunTurnView[];\n};\n\nexport interface ProcessLaunchConfigurationParameterView {\n\tfieldId: string;\n\tlabel: string;\n\tvalue: string | null;\n}\n\nexport interface ProcessLaunchConfigurationProjectView {\n\tkey: string;\n\trepoLocator: string;\n\trepoLocatorKind: ProcessProject[\"repoLocatorKind\"];\n\tbaseBranch: string;\n\tworkBranch: string | null;\n\texternalId: string | null;\n\texternalUrl: string | null;\n\tpipelineStatus: string | null;\n}\n\nexport interface ProcessLaunchConfigurationView {\n\tlauncherId: string | null;\n\tlauncherLabel: string | null;\n\tlauncherSchemaTitle: string | null;\n\tparamsParseError: string | null;\n\tparameters: readonly ProcessLaunchConfigurationParameterView[];\n\tprojects: readonly ProcessLaunchConfigurationProjectView[];\n}\n\nexport interface PiSessionUsageSnapshot {\n\tinput: number;\n\toutput: number;\n\t/** Provider-reported reasoning/thinking tokens. This is a subset of output tokens. */\n\treasoning?: number;\n\tcacheRead: number;\n\tcacheWrite: number;\n\ttotalTokens: number;\n\tcost?: {\n\t\tinput: number;\n\t\toutput: number;\n\t\tcacheRead: number;\n\t\tcacheWrite: number;\n\t\ttotal: number;\n\t};\n}\n\nexport type PiSessionTextContentBlock = { type: \"text\"; text: string };\n\nexport type PiSessionThinkingContentBlock = {\n\ttype: \"thinking\";\n\tthinking: string;\n\tredacted?: boolean;\n};\n\nexport type PiSessionToolCallContentBlock = {\n\ttype: \"toolCall\";\n\tid: string;\n\tname: string;\n\targuments: Record<string, unknown>;\n};\n\nexport type PiSessionImageContentBlock = {\n\ttype: \"image\";\n\tdata: string;\n\tmimeType: string;\n};\n\nexport type PiSessionContentBlock =\n\t| PiSessionTextContentBlock\n\t| PiSessionThinkingContentBlock\n\t| PiSessionToolCallContentBlock\n\t| PiSessionImageContentBlock;\n\nexport interface PiSessionMessageRecord {\n\trole?: string;\n\tcontent?: string | PiSessionContentBlock[];\n\ttoolCallId?: string;\n\ttoolName?: string;\n\tdetails?: unknown;\n\tisError?: boolean;\n\tusage?: PiSessionUsageSnapshot;\n\tstopReason?: string;\n\terrorMessage?: string;\n\tprovider?: string;\n\tmodel?: string;\n\ttimestamp?: number;\n}\n\nexport interface PiSessionEntry {\n\ttype: string;\n\tid: string;\n\tparentId: string | null;\n\ttimestamp: string;\n\tmessage?: PiSessionMessageRecord;\n\ttargetId?: string;\n\tlabel?: string;\n}\n\nexport interface ProcessDiagnosticsData {\n\tprocess: ProcessInstance;\n\tprojects: ProcessProject[];\n\tinputs: ProcessInput[];\n\tevents: ProcessEvent[];\n\tleafOutcomeSnapshots: ProcessLeafOutcomeSnapshot[];\n\tturnRecords: ProcessTurnRecord[];\n\tturnAnnotations: ProcessTurnAnnotation[];\n\tworkerLease: WorkerLease | null;\n\tprocessDisplayName: string | null;\n\tprocessGraph: SerializedProcessGraph;\n\tprocessFlow: ProcessFlowView;\n\tpiSessionEntries: PiSessionEntry[];\n\tdefinesLeafOutcome: boolean;\n\tselectedTurn?: ProcessSelectedTurnSummary | null;\n\tscheduledAction?: ScheduledActionDetail | null;\n\tmodelConfiguration: ProcessModelConfigurationView;\n\trunDetails: ProcessRunDetailsView;\n\tlaunchConfiguration: ProcessLaunchConfigurationView;\n\tactions: ProcessActionSummary[];\n\ttoolRenderers: ToolCallRendererDefinition[];\n}\n\nexport interface ProcessDetailData extends ProcessDiagnosticsData {\n\tprimaryPath: PrimaryPathSnapshot;\n}\n\nexport interface LauncherModelConfigSchema {\n\tavailableProfiles: readonly ModelProfileOptionSummary[];\n\tllmTurns: ReadonlyArray<{\n\t\tturnId: string;\n\t\tdescription: string;\n\t}>;\n}\n\nexport type LauncherDefaultModelPreview = {\n\tsource: \"instance_default\" | \"process_config_default\" | \"catalog_default\" | \"none\";\n\tprofile: ModelProfileOptionSummary | null;\n};\n\nexport interface LauncherTurnModelConfigPreview {\n\tturnId: string;\n\tdescription: string;\n\teffective: {\n\t\tsource: ProcessActionModelResolutionSource;\n\t\tprofile: ModelProfileOptionSummary | null;\n\t};\n}\n\nexport type LauncherModelConfigPreview = {\n\tdefaultModel: LauncherDefaultModelPreview;\n\tturns: readonly LauncherTurnModelConfigPreview[];\n};\n\nexport type UiLauncherSummary = UiLauncherSummaryBase & {\n\tmodelConfigSchema?: LauncherModelConfigSchema;\n\tprocessFlow?: ProcessFlowView;\n};\n\nexport type ProcessRetryConfig = {\n\tlauncherId: string;\n\ttitle: string | null;\n\tlauncherInput: Record<string, unknown>;\n\tskillIds: string[];\n\tmodelConfig: LauncherModelConfigDefaults;\n};\n\nexport type WatcherLaunchModelSummary = {\n\tdefaultModelProfileId: string | null;\n\tturnConfigs: Array<{ turnId: string; modelProfileId: string | null }>;\n};\n\nexport interface WatcherPresentationField {\n\tlabel: string;\n\tvalue: string;\n\tformat?: \"text\" | \"code\";\n}\n\nexport interface WatcherSummary {\n\tprocessId: string;\n\tprocessDisplayName: string;\n\twatcherId: string;\n\tlabel: string;\n\tdescription: string;\n\tsourceId: string;\n\tsourceLabel: string;\n\tenabled: boolean;\n\tconfigPath: string;\n\ttargetSummary: string;\n\tdetails: WatcherPresentationField[];\n\tlaunchModel: WatcherLaunchModelSummary;\n}\n\nexport interface SkillUsageSummary {\n\tattachedAllTime: number;\n\tattachedLast30Days: number;\n\tinvokedAllTime: number;\n\tinvokedLast30Days: number;\n}\n\nexport interface SkillRepositorySummary {\n\tid: string;\n\tlabel: string;\n\turl: string;\n\tref: string;\n\tpath: string;\n\tlastRefreshedAt: string | null;\n\terror: string | null;\n}\n\nexport interface SkillCatalogItem {\n\trepositoryId: string;\n\tid: string;\n\tlabel: string;\n\tdescription: string | null;\n\tsourcePath: string;\n\tsourceRevision: string;\n\tregistered: boolean;\n\tupdateAvailable: boolean;\n\tconflict: boolean;\n\tstale: boolean;\n\tusage: SkillUsageSummary;\n}\n\nexport type SkillRegistrationKind = \"configuration\" | \"catalog\";\n\nexport interface InstalledSkillCatalogItem {\n\tid: string;\n\tlabel: string;\n\tdescription: string | null;\n\tactiveRevisionId: string;\n\tactiveSourceRevision: string | null;\n\tregistrationKind: SkillRegistrationKind;\n\tsourceRepositoryId: string | null;\n\tupdateAvailable: boolean;\n\tusage: SkillUsageSummary;\n}\n\nexport interface SkillRevisionSummary {\n\tid: string;\n\tsourceRevision: string | null;\n\timportedAt: string;\n\tactive: boolean;\n}\n\nexport interface SkillUsageProcessSummary {\n\tinstanceId: string;\n\ttitle: string;\n\tattachedAt: string;\n\tinvocationCount: number;\n\tlastInvokedAt: string | null;\n}\n\nexport interface SkillCatalogDetail extends SkillCatalogItem {\n\tskillMarkdown: string;\n\tprocesses: SkillUsageProcessSummary[];\n}\n\nexport interface InstalledSkillCatalogDetail extends InstalledSkillCatalogItem {\n\tskillMarkdown: string;\n\tprocesses: SkillUsageProcessSummary[];\n\trevisions: SkillRevisionSummary[];\n}\n\nexport type ErrorResponseBody = { error?: string | null; code?: string | null };\n\nexport type ProcessesListResponseBody = {\n\tprocesses: ProcessListItem[];\n\tfutureExecutions: FutureExecutionSummary[];\n};\n\nexport interface ProcessOverviewItem extends ProcessRowSlot {\n\tprocessDisplayName: string | null;\n\t/** Nullable durable title before external-id/instance-id display fallback. */\n\tprocessTitle: string | null;\n\tinitialPromptPreview: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tclosedAt: string | null;\n}\n\ninterface FutureExecutionOverviewItemBase {\n\tid: string;\n\tscheduleKind: \"once\" | \"cron\";\n\tprocessId: string;\n\tnextRunAt: string;\n\tcronExpression: string | null;\n\ttitle: string;\n\tinitialPromptPreview: string | null;\n\tstatus?: \"scheduled\" | \"blocked\";\n\tblockedReason?: FutureExecutionBlockReason | null;\n}\n\nexport interface FutureLaunchOverviewItem extends FutureExecutionOverviewItemBase {\n\tkind: \"launch\";\n\tinstanceId: null;\n\tlauncherId: string;\n\tlauncherLabel: string;\n}\n\nexport interface FutureActionOverviewItem extends FutureExecutionOverviewItemBase {\n\tkind: \"action\";\n\tinstanceId: string;\n\tactionId: string;\n\tactionLabel: string;\n}\n\nexport type FutureExecutionOverviewItem = FutureLaunchOverviewItem | FutureActionOverviewItem;\n\nexport interface ProcessesOverviewResponseBody {\n\tprocesses: ProcessOverviewItem[];\n\tfutureExecutions: FutureExecutionOverviewItem[];\n\t/** True when the bounded sidebar response omitted less-recent rows. */\n\ttruncated: boolean;\n}\n\nexport interface ProcessBrowsePagination {\n\tlimit: number;\n\toffset: number;\n\ttotal: number;\n\tprocessTotal: number;\n\tfutureExecutionTotal: number;\n\thasMore: boolean;\n}\n\nexport interface ProcessBrowseFacets {\n\tstatusCounts: Record<\n\t\t\"all\" | \"running\" | \"scheduled\" | \"needs_attention\" | \"completed\" | \"aborted\",\n\t\tnumber\n\t>;\n\tprocessTypes: Array<{ value: string; label: string; count: number }>;\n}\n\nexport type ProcessBrowseItem =\n\t| { kind: \"process\"; item: ProcessOverviewItem }\n\t| { kind: \"future\"; item: FutureExecutionOverviewItem };\n\nexport interface ProcessBrowseResponseBody {\n\t/** Globally sorted page. The browser must preserve this server-owned order. */\n\titems: ProcessBrowseItem[];\n\tpagination: ProcessBrowsePagination;\n\tfacets: ProcessBrowseFacets;\n}\n\nexport type TurnTraceToolCallSnapshot = Omit<PrimaryPathToolCallSnapshot, \"result\"> & {\n\tresultText: string | null;\n\ttruncated: boolean;\n};\n\nexport type TurnPiInputPartRole = \"user\" | \"system\" | \"unknown\";\n\nexport interface TurnPiInputPart {\n\trole: TurnPiInputPartRole;\n\ttext: string;\n\tcreatedAt: string;\n}\n\nexport interface TurnPiInputSnapshot {\n\tparts: TurnPiInputPart[];\n\tfullPrompt: string;\n\tcreatedAt: string;\n\tuserInput?: string | null;\n}\n\nexport interface TurnTraceSnapshot {\n\tassistant: PrimaryPathStreamingAssistantSnapshot;\n\ttoolCalls: TurnTraceToolCallSnapshot[];\n\ttraceItems: PrimaryPathTraceItemSnapshot[];\n\tusage: TurnUsageSnapshot | null;\n\tpiInput: TurnPiInputSnapshot | null;\n}\n\nexport interface TurnTracePreview {\n\tturnRecordId: string;\n\tassistantTextPreview: string;\n\tassistantTextTruncated: boolean;\n\tthinkingPreview: string;\n\tthinkingPreviewTruncated: boolean;\n\ttoolCallCount: number;\n\ttraceItemCount: number;\n\thasReasoningDetails: boolean;\n\tusage: TurnUsageSnapshot | null;\n\tpiInput: { createdAt: string | null; partCount: number; userInputPreview: string | null } | null;\n}\n\nexport type ProcessTimelineTurnPresentation =\n\t| \"llm_turn\"\n\t| \"automatic_turn\"\n\t| \"operator_decision\"\n\t| \"external_trigger\";\n\nexport interface ProcessTimelineTurnSummary {\n\tid: string;\n\tturnId: string;\n\tturnType: ProcessTurnType;\n\tdisplayTurn: string;\n\toutcome: string;\n\tsummary: string;\n\toutput: string;\n\tturnResultMarkdown: string;\n\tpathType: ProcessTurnRecord[\"pathType\"];\n\tcreatedAt: string;\n\tpresentation: ProcessTimelineTurnPresentation;\n\tstatus: \"completed\" | \"in_progress\";\n\tmodelProfileId: string | null;\n\t/** Durable lineage needed by the chronicle rail and input correlation. */\n\tattemptNumber: number;\n\tparentTurnRecordId: string | null;\n\tstartedAt: string;\n\tendedAt: string | null;\n\tactionSource: \"ui\" | \"external\" | \"scheduled\" | null;\n}\n\nexport type ProcessTimelineInputSummary = Pick<\n\tProcessInput,\n\t\"id\" | \"sequence\" | \"source\" | \"kind\" | \"bodyMarkdown\" | \"receivedAt\" | \"consumedAt\"\n>;\n\nexport interface ProcessExternalTriggerSignal {\n\ttriggerId: string;\n\tstate: \"error\" | \"armed\" | \"triggered\" | \"waiting\";\n\toccurredAt: string | null;\n\tsecondaryDetail: string | null;\n}\n\nexport interface ProcessTimelineSnapshot {\n\tprompt: { text: string | null; createdAt: string | null };\n\tturns: ProcessTimelineTurnSummary[];\n\ttracePreviewsByTurnRecordId: Record<string, TurnTracePreview>;\n\tinputs: ProcessTimelineInputSummary[];\n\texternalTriggerSignals: ProcessExternalTriggerSignal[];\n}\n\nexport interface CurrentErrorSummary {\n\ttitle: string;\n\tsummary: string;\n\tguidance?: string;\n\ttechnicalDetail?: string | null;\n}\n\nexport interface CurrentTurnRecoverySummary extends CurrentErrorSummary {\n\tturnRecordId: string;\n\tdefaultContinuePrompt: string;\n\tcanContinue: boolean;\n\tdefaultModelProfileId: string | null;\n\tproviderOptions: Record<string, string>;\n}\n\nexport interface StartupRecoverySummary extends CurrentErrorSummary {\n\tstartRecordId: string;\n\tkind: \"preparation_failed\" | \"bootstrap_failed\";\n\taction: \"choose_model\" | \"retry_startup\";\n\tdefaultModelProfileId: string | null;\n\tproviderOptions: Record<string, string>;\n}\n\nexport type CurrentProcessErrorSummary = CurrentErrorSummary;\n\nexport interface ProcessUsageEstimateSnapshot {\n\tusage: TurnUsageSnapshot;\n\tincludesLiveTurn: boolean;\n\ttotalLlmTurnCount: number;\n\tcoveredTurnCount: number;\n\tmissingUsageTurnCount: number;\n\tmissingCostTurnCount: number;\n\tisPartial: boolean;\n}\n\nexport interface PrimaryPathUiSnapshot extends PrimaryPathSnapshot {\n\tentryCount: number;\n\tentriesOmitted: true;\n}\n\nexport type ProcessUiSnapshotProcess = Pick<\n\tProcessInstance,\n\t| \"id\"\n\t| \"processId\"\n\t| \"selectedTurnId\"\n\t| \"lifecycleStatus\"\n\t| \"currentExecution\"\n\t| \"planRevision\"\n\t| \"title\"\n\t| \"externalId\"\n\t| \"externalUrl\"\n\t| \"initialDefaultModelProfileId\"\n\t| \"createdAt\"\n\t| \"updatedAt\"\n\t| \"closedAt\"\n>;\n\n/**\n * Initial render contract for process detail. Raw process events, inputs,\n * session entries, projects, and full durable records belong to diagnostics;\n * this DTO carries only browser-facing projections.\n */\nexport interface ProcessDetailUiSnapshotResponseBody {\n\tprocess: ProcessUiSnapshotProcess;\n\t/** Durable requests in Chronicle order; at most one is open for the current turn. */\n\tquestionRequests: ProcessQuestionRequest[];\n\tleafOutcomeSnapshots: ProcessLeafOutcomeSnapshot[];\n\tprocessDisplayName: string | null;\n\tprocessFlow: ProcessFlowView;\n\tdefinesLeafOutcome: boolean;\n\tselectedTurn: ProcessSelectedTurnSummary | null;\n\tscheduledAction: ScheduledActionDetail | null;\n\tmodelConfiguration: ProcessModelConfigurationView;\n\trunDetails: ProcessRunDetailsView;\n\tlaunchConfiguration: ProcessLaunchConfigurationView;\n\tactions: ProcessActionSummary[];\n\ttoolRenderers: ToolCallRendererDefinition[];\n\tprimaryPath: PrimaryPathUiSnapshot;\n\ttimeline: ProcessTimelineSnapshot;\n\tinstanceTree: ProcessInstanceTreeResponseBody;\n\trecovery: CurrentTurnRecoverySummary | null;\n\tstartupRecovery: StartupRecoverySummary | null;\n\tprocessError: CurrentProcessErrorSummary | null;\n\tusageEstimate: ProcessUsageEstimateSnapshot | null;\n\tpersistedModelSelectionWarning: string | null;\n\tsession: { signature: string | null };\n}\n\nexport type InstanceTreeTurnResultState = \"succeeded\" | \"failed\" | \"aborted\" | \"pending\";\n\n/** Redacted, semantic process history. Pi message/activity categories are never exposed. */\nexport interface InstanceTreeNodeSummary {\n\tid: string;\n\tparentId: string | null;\n\tlabel: string;\n\tpathType: \"primary\" | \"root_branch\" | \"leaf_branch\";\n\tresultState: InstanceTreeTurnResultState;\n\ttimestamp: string;\n}\n\nexport interface InstanceTreeEdgeSummary {\n\tid: string;\n\tsourceNodeId: string;\n\ttargetNodeId: string | null;\n\thasContext: boolean;\n\tproductLabels: readonly string[];\n\tactionLabel: string | null;\n\tendState: \"not_applied\" | \"completed\" | null;\n}\n\nexport interface ProcessInstanceTreeResponseBody {\n\tcurrentLeafId: string | null;\n\tnodes: InstanceTreeNodeSummary[];\n\tedges: InstanceTreeEdgeSummary[];\n}\n\nexport interface TurnReasoningDetailResponseBody {\n\tinstanceId: string;\n\tturnRecordId: string;\n\tsessionSignature: string | null;\n\treasoning: TurnTraceSnapshot;\n}\n\nexport interface SubmitQuestionAnswersRequestBody {\n\tdraft: QuestionAnswerDraft[];\n}\n\nexport type QuestionRequestMutationResponseBody = {\n\trequest: ProcessQuestionRequest;\n};\n\nexport type FutureExecutionDetailResponseBody = FutureExecutionSummary;\n\nexport type LaunchersResponseBody = { launchers: UiLauncherSummary[] };\n\nexport type WatchersResponseBody = { watchers: WatcherSummary[] };\nexport type SkillCatalogDetailResponseBody = { skill: SkillCatalogDetail };\nexport type InstalledSkillCatalogDetailResponseBody = { skill: InstalledSkillCatalogDetail };\nexport type SkillsCatalogResponseBody = {\n\trepositories: SkillRepositorySummary[];\n\tavailableSkills: SkillCatalogItem[];\n\tinstalledSkills: InstalledSkillCatalogItem[];\n};\n\nexport interface LauncherDefaultsResponseBody {\n\tdefaults: Record<string, unknown>;\n\ttitle: string | null;\n\tmodelConfig: LauncherModelConfigDefaults;\n\twarnings?: LauncherValidationError[];\n}\n\nexport type LauncherOptionsResponseBody = {\n\toptions: Record<string, readonly FormFieldOptionDefinition[]>;\n};\n\nexport type LauncherRecentValuesResponseBody = {\n\tvalues: Record<string, readonly string[]>;\n};\n\nexport type LauncherModelConfigPreviewResponseBody = { preview: LauncherModelConfigPreview };\n\nexport interface LauncherMutationResponseBody {\n\tkind?: \"scheduled\";\n\tprocess?: ProcessInstance | null;\n\tfutureExecution?: FutureLaunchSummary | null;\n\tprojects?: ProcessProject[];\n\terrors?: LauncherValidationError[];\n\terror?: string | null;\n}\n\nexport type ScheduledActionMutationResponseBody = {\n\tkind?: \"scheduled\";\n\tscheduledAction?: ScheduledActionDetail | null;\n\terror?: string | null;\n};\n\nexport type ProcessRetryConfigResponseBody = ProcessRetryConfig;\n\nexport type ProcessActionModelPreviewResponseBody = { preview: ProcessActionModelPreview };\n\nexport type ProcessDiagnosticsResponseBody = ProcessDiagnosticsData;\n\nexport type PrimaryPathSnapshotResponseBody = PrimaryPathSnapshot;\n\nexport type CronPreviewResponseBody = { nextRunAt: string };\n\ntype ParsedLauncherRequestBody = {\n\ttitle: string | null;\n\ttitleProvided: boolean;\n\tlauncherInput: Record<string, unknown>;\n\tlauncherInputProvided: boolean;\n\tskillIds?: string[];\n\tmodelConfig: LauncherModelConfigDefaults;\n\tmodelConfigProvided: boolean;\n\tschedule: ParsedScheduleRequest;\n\tscheduleProvided: boolean;\n};\n\ntype ParsedActionRequestBody = {\n\tinput: Record<string, unknown>;\n\tinputProvided: boolean;\n\tnextTurnModelProfileId?: string | null;\n\tnextTurnModelProfileIdProvided: boolean;\n\tschedule: ParsedScheduleRequest;\n\tscheduleProvided: boolean;\n};\n\nconst SCHEDULE_MODES = [\"now\", \"once\", \"cron\"] as const;\nconst PROCESS_LIFECYCLE_STATUSES = [\n\t\"discovered\",\n\t\"active\",\n\t\"waiting\",\n\t\"error\",\n\t\"completed\",\n\t\"aborted\",\n] as const;\nconst launcherStructuredBodySchema = v.strictObject({\n\ttitle: v.optional(nullableStringSchema),\n\tlauncherInput: v.optional(unknownRecordSchema),\n\tskillIds: v.optional(v.array(v.string())),\n\tmodelConfig: v.optional(v.unknown()),\n\tschedule: v.optional(v.unknown()),\n});\nconst actionStructuredBodySchema = v.strictObject({\n\tinput: v.optional(unknownRecordSchema),\n\tnextTurnModelProfileId: optionalNullableStringSchema,\n\tschedule: v.optional(v.unknown()),\n});\nconst futureLaunchPayloadInputSchema = v.object({\n\tlauncherInput: v.optional(v.nullable(unknownRecordSchema)),\n\tmodelConfig: v.optional(v.unknown()),\n\tactor: v.optional(v.nullable(unknownRecordSchema)),\n\tlaunchPlan: v.object({\n\t\tlauncherId: v.string(),\n\t\tprocessId: v.string(),\n\t\thandoffDedupKey: optionalNullableStringSchema,\n\t\tprocessInput: v.object({\n\t\t\tprocessId: v.string(),\n\t\t\tselectedTurnId: optionalNullableStringSchema,\n\t\t\tlifecycleStatus: v.picklist(PROCESS_LIFECYCLE_STATUSES),\n\t\t\ttitle: optionalNullableStringSchema,\n\t\t\texternalId: optionalNullableStringSchema,\n\t\t\texternalUrl: optionalNullableStringSchema,\n\t\t\tmetadata: v.optional(v.nullable(unknownRecordSchema)),\n\t\t\tdefaultModelProfileId: optionalNullableStringSchema,\n\t\t\tturnConfigsJson: optionalNullableStringSchema,\n\t\t\tselectedTurnModelProfileId: optionalNullableStringSchema,\n\t\t\tselectedTurnModelKind: v.optional(v.nullable(v.picklist([\"explicit\", \"inherited\"]))),\n\t\t\tselectedTurnModelSource: v.optional(\n\t\t\t\tv.nullable(\n\t\t\t\t\tv.picklist([\n\t\t\t\t\t\t\"action_override\",\n\t\t\t\t\t\t\"launch_override\",\n\t\t\t\t\t\t\"instance_turn_config\",\n\t\t\t\t\t\t\"process_config_turn\",\n\t\t\t\t\t\t\"instance_default\",\n\t\t\t\t\t\t\"process_config_default\",\n\t\t\t\t\t\t\"catalog_default\",\n\t\t\t\t\t\t\"legacy_persisted\",\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t),\n\t\t\tparamsJson: optionalNullableStringSchema,\n\t\t\tstateJson: optionalNullableStringSchema,\n\t\t}),\n\t\ttitleSourceFields: v.optional(\n\t\t\tv.nullable(v.array(v.object({ label: v.string(), value: v.string() }))),\n\t\t),\n\t\tprojectInputs: v.optional(\n\t\t\tv.nullable(\n\t\t\t\tv.array(\n\t\t\t\t\tv.object({\n\t\t\t\t\t\tkey: v.string(),\n\t\t\t\t\t\trepoLocator: v.string(),\n\t\t\t\t\t\tbaseBranch: v.string(),\n\t\t\t\t\t\tworkBranch: optionalNullableStringSchema,\n\t\t\t\t\t\texternalId: optionalNullableStringSchema,\n\t\t\t\t\t\texternalUrl: optionalNullableStringSchema,\n\t\t\t\t\t\tmetadata: v.optional(v.nullable(unknownRecordSchema)),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\tstartTurnId: optionalNullableStringSchema,\n\t}),\n\tselectedSkillIds: v.optional(v.array(v.string())),\n\tresourceSelections: v.optional(\n\t\tv.array(v.object({ skillId: v.string(), revisionId: v.string() })),\n\t),\n});\nconst futureActionPayloadInputSchema = v.object({\n\tinput: v.optional(v.nullable(unknownRecordSchema)),\n\tnextTurnModelProfileId: optionalNullableStringSchema,\n\tactionLabel: optionalNullableStringSchema,\n\tactor: v.optional(v.nullable(unknownRecordSchema)),\n});\n\nexport type ParsedScheduleRequest =\n\t| { mode: \"now\" }\n\t| { mode: \"once\"; runAt: string }\n\t| { mode: \"cron\"; cronExpression: string };\ntype ValidatedScheduleRequest =\n\t| { mode: \"now\"; nextRunAt: null; cronExpression: null }\n\t| { mode: \"once\"; nextRunAt: string; cronExpression: null }\n\t| { mode: \"cron\"; nextRunAt: string; cronExpression: string };\n\ntype FutureLaunchPayloadBase = v.InferOutput<typeof futureLaunchPayloadInputSchema>;\ntype FutureActionPayloadBase = v.InferOutput<typeof futureActionPayloadInputSchema>;\nconst cloneUnknownRecord = (value?: Record<string, unknown> | null) =>\n\tvalue ? { ...value } : null;\nconst cloneTurnConfigMap = (turnConfigs: InstanceTurnConfigMap = {}) =>\n\tObject.fromEntries(\n\t\tObject.entries(turnConfigs as Record<string, InstanceTurnConfigMap[string]>).map(\n\t\t\t([turnId, turnConfig]) => [turnId, { ...turnConfig }],\n\t\t),\n\t) as InstanceTurnConfigMap;\nconst normalizeFutureLaunchPayload = (payload: FutureLaunchPayloadBase) => {\n\tconst modelConfig = normalizeLaunchModelConfigInput(\n\t\t(payload.modelConfig ?? {}) as LaunchModelConfigInput,\n\t);\n\treturn {\n\t\tlauncherInput: cloneUnknownRecord(payload.launcherInput) ?? {},\n\t\tmodelConfig: {\n\t\t\tdefaultModelProfileId: modelConfig.defaultModelProfileId ?? null,\n\t\t\tturnConfigs: cloneTurnConfigMap(modelConfig.turnConfigs),\n\t\t},\n\t\tactor: normalizeActor(payload.actor),\n\t\tselectedSkillIds: [\n\t\t\t...(payload.selectedSkillIds ??\n\t\t\t\tpayload.resourceSelections?.map(({ skillId }) => skillId) ??\n\t\t\t\t[]),\n\t\t],\n\t\tresourceSelections: (payload.resourceSelections ?? []).map((selection) => ({ ...selection })),\n\t\tlaunchPlan: {\n\t\t\tlauncherId: payload.launchPlan.launcherId,\n\t\t\tprocessId: payload.launchPlan.processId,\n\t\t\thandoffDedupKey: trimToNull(payload.launchPlan.handoffDedupKey) ?? null,\n\t\t\tprocessInput: {\n\t\t\t\tprocessId: payload.launchPlan.processInput.processId,\n\t\t\t\tselectedTurnId: payload.launchPlan.processInput.selectedTurnId ?? null,\n\t\t\t\tlifecycleStatus: payload.launchPlan.processInput.lifecycleStatus,\n\t\t\t\ttitle: payload.launchPlan.processInput.title ?? null,\n\t\t\t\texternalId: payload.launchPlan.processInput.externalId ?? null,\n\t\t\t\texternalUrl: payload.launchPlan.processInput.externalUrl ?? null,\n\t\t\t\tmetadata: cloneUnknownRecord(payload.launchPlan.processInput.metadata),\n\t\t\t\tdefaultModelProfileId: payload.launchPlan.processInput.defaultModelProfileId ?? null,\n\t\t\t\tturnConfigsJson: payload.launchPlan.processInput.turnConfigsJson ?? null,\n\t\t\t\tselectedTurnModelProfileId:\n\t\t\t\t\tpayload.launchPlan.processInput.selectedTurnModelProfileId ?? null,\n\t\t\t\tselectedTurnModelKind: payload.launchPlan.processInput.selectedTurnModelKind ?? null,\n\t\t\t\tselectedTurnModelSource: payload.launchPlan.processInput.selectedTurnModelSource ?? null,\n\t\t\t\tparamsJson: payload.launchPlan.processInput.paramsJson ?? null,\n\t\t\t\tstateJson: payload.launchPlan.processInput.stateJson ?? null,\n\t\t\t},\n\t\t\ttitleSourceFields: (payload.launchPlan.titleSourceFields ?? []).map((field) => ({\n\t\t\t\t...field,\n\t\t\t})),\n\t\t\tprojectInputs: (payload.launchPlan.projectInputs ?? []).map((project) => ({\n\t\t\t\tkey: project.key,\n\t\t\t\trepoLocator: project.repoLocator,\n\t\t\t\tbaseBranch: project.baseBranch,\n\t\t\t\tworkBranch: project.workBranch ?? null,\n\t\t\t\texternalId: project.externalId ?? null,\n\t\t\t\texternalUrl: project.externalUrl ?? null,\n\t\t\t\tmetadata: cloneUnknownRecord(project.metadata),\n\t\t\t})),\n\t\t\tstartTurnId: payload.launchPlan.startTurnId ?? null,\n\t\t},\n\t};\n};\nconst normalizeFutureActionPayload = (payload: FutureActionPayloadBase) => ({\n\tinput: cloneUnknownRecord(payload.input) ?? {},\n\tnextTurnModelProfileId: trimToNull(payload.nextTurnModelProfileId) ?? null,\n\tactionLabel: trimToNull(payload.actionLabel) ?? null,\n\tactor: normalizeActor(payload.actor),\n});\n\nexport type FutureLaunchPayload = ReturnType<typeof normalizeFutureLaunchPayload>;\nexport type FutureActionPayload = ReturnType<typeof normalizeFutureActionPayload>;\n\nfunction hasOwn(object: Record<string, unknown>, key: string): boolean {\n\treturn Object.hasOwn(object, key);\n}\n\nfunction parseJsonPayload(payloadJson: string, context: string): ParseResult<unknown> {\n\ttry {\n\t\treturn ok(JSON.parse(payloadJson));\n\t} catch {\n\t\treturn err(`${context} must be valid JSON`);\n\t}\n}\n\nfunction parseRecord(value: unknown, context: string): ParseResult<Record<string, unknown>> {\n\treturn parseSchema(unknownRecordSchema, value, context);\n}\n\nfunction parseLauncherTurnConfigMap(\n\tvalue: unknown,\n\tcontext: string,\n): ParseResult<InstanceTurnConfigMap> {\n\tconst record = parseRecord(value, context);\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst turnConfigs: InstanceTurnConfigMap = {};\n\tfor (const [turnId, turnConfigValue] of Object.entries(record.value)) {\n\t\tconst turnConfig = parseRecord(turnConfigValue, `${context}.${turnId}`);\n\t\tif (!turnConfig.ok) {\n\t\t\treturn turnConfig;\n\t\t}\n\t\tconst modelProfileId =\n\t\t\ttrimToNull(turnConfig.value.modelProfileId) ?? trimToNull(turnConfig.value.model_profile);\n\t\tturnConfigs[turnId] = modelProfileId ? { modelProfileId } : {};\n\t}\n\treturn ok(turnConfigs);\n}\n\nexport function parseScheduleRequestInput(value: unknown): ParseResult<ParsedScheduleRequest> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({ mode: \"now\" });\n\t}\n\tconst record = parseRecord(value, \"schedule\");\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst mode = parseLiteral(record.value.mode ?? \"now\", SCHEDULE_MODES, \"schedule.mode\");\n\tif (!mode.ok || mode.value === \"now\") {\n\t\treturn mode.ok ? ok({ mode: \"now\" }) : mode;\n\t}\n\tif (mode.value === \"once\") {\n\t\tconst runAt = typeof record.value.runAt === \"string\" ? record.value.runAt : null;\n\t\treturn runAt && !Number.isNaN(Date.parse(runAt))\n\t\t\t? ok({ mode: \"once\", runAt: new Date(runAt).toISOString() })\n\t\t\t: err(\"runAt must be a valid ISO datetime\");\n\t}\n\tconst cronExpression = trimToNull(record.value.cronExpression);\n\treturn cronExpression\n\t\t? ok({ mode: \"cron\", cronExpression })\n\t\t: err(\"cronExpression is required for cron schedules\");\n}\n\nexport function validateScheduleRequestInput(\n\tschedule: ParsedScheduleRequest,\n\tallowedModes: readonly ScheduleMode[],\n\toptions: {\n\t\tnow?: () => Date;\n\t\tresolveCronNextRunAt?: (expression: string, now: Date) => string;\n\t} = {},\n): ParseResult<ValidatedScheduleRequest> {\n\tif (!allowedModes.includes(schedule.mode)) {\n\t\treturn err(`Unsupported schedule mode '${schedule.mode}'`);\n\t}\n\tif (schedule.mode === \"now\") {\n\t\treturn ok({ mode: \"now\", nextRunAt: null, cronExpression: null });\n\t}\n\tconst now = options.now ?? (() => new Date());\n\tif (schedule.mode === \"once\") {\n\t\tconst runAt = new Date(schedule.runAt);\n\t\treturn Number.isNaN(runAt.getTime())\n\t\t\t? err(\"runAt must be a valid ISO datetime\")\n\t\t\t: runAt.getTime() <= now().getTime()\n\t\t\t\t? err(\"Scheduled time must be in the future\")\n\t\t\t\t: ok({ mode: \"once\", nextRunAt: runAt.toISOString(), cronExpression: null });\n\t}\n\tif (!options.resolveCronNextRunAt) {\n\t\treturn err(\"resolveCronNextRunAt is required for cron schedules\");\n\t}\n\ttry {\n\t\treturn ok({\n\t\t\tmode: \"cron\",\n\t\t\tnextRunAt: options.resolveCronNextRunAt(schedule.cronExpression, now()),\n\t\t\tcronExpression: schedule.cronExpression,\n\t\t});\n\t} catch (error) {\n\t\treturn err(error instanceof Error ? error.message : \"Invalid cron expression\");\n\t}\n}\n\nexport function parseLauncherTurnConfigsJson(\n\tturnConfigsJson: string | null | undefined,\n): ParseResult<InstanceTurnConfigMap> {\n\tif (!turnConfigsJson) {\n\t\treturn ok({});\n\t}\n\tconst parsed = parseJsonPayload(turnConfigsJson, \"turnConfigsJson\");\n\treturn parsed.ok ? parseLauncherTurnConfigMap(parsed.value, \"turnConfigsJson\") : parsed;\n}\n\nexport function parseLauncherInputJson(\n\tlauncherInputJson: string | null | undefined,\n\tcontext = \"launcherInputJson\",\n): ParseResult<Record<string, unknown>> {\n\tif (launcherInputJson === undefined || launcherInputJson === null) {\n\t\treturn ok({});\n\t}\n\tconst parsed = parseJsonPayload(launcherInputJson, context);\n\treturn parsed.ok ? parseRecord(parsed.value, context) : parsed;\n}\n\nexport function parseLauncherModelConfigInput(\n\tvalue: unknown,\n\tcontext = \"modelConfig\",\n): ParseResult<LaunchModelConfigInput> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({});\n\t}\n\tconst record = parseRecord(value, context);\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst defaultModelProfileId = trimToNull(record.value.defaultModelProfileId);\n\tif (\n\t\thasOwn(record.value, \"defaultModelProfileId\") &&\n\t\trecord.value.defaultModelProfileId !== null &&\n\t\ttypeof record.value.defaultModelProfileId !== \"string\"\n\t) {\n\t\treturn err(`${context}.defaultModelProfileId must be a string or null`);\n\t}\n\tconst turnConfigs =\n\t\trecord.value.turnConfigs === undefined\n\t\t\t? ok(undefined)\n\t\t\t: parseLauncherTurnConfigMap(record.value.turnConfigs, `${context}.turnConfigs`);\n\treturn turnConfigs.ok\n\t\t? ok(\n\t\t\t\tnormalizeLaunchModelConfigInput({\n\t\t\t\t\t...(defaultModelProfileId ? { defaultModelProfileId } : {}),\n\t\t\t\t\t...(turnConfigs.value ? { turnConfigs: turnConfigs.value } : {}),\n\t\t\t\t}),\n\t\t\t)\n\t\t: turnConfigs;\n}\n\nfunction hasInlineScheduleFields(object: Record<string, unknown>): boolean {\n\treturn hasOwn(object, \"mode\") || hasOwn(object, \"runAt\") || hasOwn(object, \"cronExpression\");\n}\n\nexport function parseLauncherRequestBody(value: unknown): ParseResult<ParsedLauncherRequestBody> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({\n\t\t\ttitle: null,\n\t\t\ttitleProvided: false,\n\t\t\tlauncherInput: {},\n\t\t\tlauncherInputProvided: false,\n\t\t\tmodelConfig: {},\n\t\t\tmodelConfigProvided: false,\n\t\t\tschedule: { mode: \"now\" },\n\t\t\tscheduleProvided: false,\n\t\t});\n\t}\n\tconst record = parseRecord(value, \"launcher request body\");\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tif (\n\t\thasOwn(record.value, \"title\") ||\n\t\trecord.value.launcherInput !== undefined ||\n\t\trecord.value.skillIds !== undefined ||\n\t\trecord.value.modelConfig !== undefined ||\n\t\trecord.value.schedule !== undefined\n\t) {\n\t\tif (\n\t\t\tObject.keys(record.value).some(\n\t\t\t\t(key) =>\n\t\t\t\t\tkey !== \"title\" &&\n\t\t\t\t\tkey !== \"launcherInput\" &&\n\t\t\t\t\tkey !== \"skillIds\" &&\n\t\t\t\t\tkey !== \"modelConfig\" &&\n\t\t\t\t\tkey !== \"schedule\",\n\t\t\t)\n\t\t) {\n\t\t\treturn err(\n\t\t\t\t\"launcher request body must use { title, launcherInput, skillIds, modelConfig, schedule }\",\n\t\t\t);\n\t\t}\n\t\tconst parsed = parseSchema(launcherStructuredBodySchema, value, \"launcher request body\");\n\t\tif (!parsed.ok) {\n\t\t\treturn parsed;\n\t\t}\n\t\tconst modelConfig = parseLauncherModelConfigInput(parsed.value.modelConfig);\n\t\tif (!modelConfig.ok) {\n\t\t\treturn modelConfig;\n\t\t}\n\t\tconst schedule = parseScheduleRequestInput(parsed.value.schedule);\n\t\tif (!schedule.ok) {\n\t\t\treturn schedule;\n\t\t}\n\t\tconst skillIds = parsed.value.skillIds ?? [];\n\t\tif (new Set(skillIds).size !== skillIds.length) {\n\t\t\treturn err(\"skillIds must not contain duplicates\");\n\t\t}\n\t\treturn ok({\n\t\t\ttitle: parsed.value.title ?? null,\n\t\t\ttitleProvided: hasOwn(record.value, \"title\"),\n\t\t\tlauncherInput: parsed.value.launcherInput ?? {},\n\t\t\tlauncherInputProvided: hasOwn(record.value, \"launcherInput\"),\n\t\t\t...(hasOwn(record.value, \"skillIds\") ? { skillIds: [...skillIds] } : {}),\n\t\t\tmodelConfig: modelConfig.value,\n\t\t\tmodelConfigProvided: hasOwn(record.value, \"modelConfig\"),\n\t\t\tschedule: schedule.value,\n\t\t\tscheduleProvided: hasOwn(record.value, \"schedule\"),\n\t\t});\n\t}\n\tconst modelConfig = parseLauncherModelConfigInput(record.value, \"modelConfig\");\n\tif (!modelConfig.ok) {\n\t\treturn modelConfig;\n\t}\n\tconst schedule = parseScheduleRequestInput(record.value);\n\tif (!schedule.ok) {\n\t\treturn schedule;\n\t}\n\treturn ok({\n\t\ttitle: null,\n\t\ttitleProvided: false,\n\t\tlauncherInput: record.value,\n\t\tlauncherInputProvided: true,\n\t\tmodelConfig: modelConfig.value,\n\t\tmodelConfigProvided: true,\n\t\tschedule: schedule.value,\n\t\tscheduleProvided: hasInlineScheduleFields(record.value),\n\t});\n}\n\nexport function parseActionRequestBody(value: unknown): ParseResult<ParsedActionRequestBody> {\n\tif (value === undefined || value === null) {\n\t\treturn ok({\n\t\t\tinput: {},\n\t\t\tinputProvided: false,\n\t\t\tnextTurnModelProfileIdProvided: false,\n\t\t\tschedule: { mode: \"now\" },\n\t\t\tscheduleProvided: false,\n\t\t});\n\t}\n\tconst record = parseRecord(value, \"action request body\");\n\tif (!record.ok) {\n\t\treturn record;\n\t}\n\tconst nextTurnModelProfileIdProvided = hasOwn(record.value, \"nextTurnModelProfileId\");\n\tif (\n\t\trecord.value.input !== undefined ||\n\t\tnextTurnModelProfileIdProvided ||\n\t\trecord.value.schedule !== undefined\n\t) {\n\t\tif (\n\t\t\tObject.keys(record.value).some(\n\t\t\t\t(key) => key !== \"input\" && key !== \"nextTurnModelProfileId\" && key !== \"schedule\",\n\t\t\t)\n\t\t) {\n\t\t\treturn err(\"action request body must use { input, nextTurnModelProfileId }\");\n\t\t}\n\t\tconst parsed = parseSchema(actionStructuredBodySchema, value, \"action request body\");\n\t\tif (!parsed.ok) {\n\t\t\treturn parsed;\n\t\t}\n\t\tconst schedule = parseScheduleRequestInput(parsed.value.schedule);\n\t\tif (!schedule.ok) {\n\t\t\treturn schedule;\n\t\t}\n\t\treturn ok({\n\t\t\tinput: parsed.value.input ?? {},\n\t\t\tinputProvided: hasOwn(record.value, \"input\"),\n\t\t\tnextTurnModelProfileIdProvided,\n\t\t\tschedule: schedule.value,\n\t\t\tscheduleProvided: hasOwn(record.value, \"schedule\"),\n\t\t\t...(nextTurnModelProfileIdProvided\n\t\t\t\t? { nextTurnModelProfileId: parsed.value.nextTurnModelProfileId ?? null }\n\t\t\t\t: {}),\n\t\t});\n\t}\n\tconst schedule = parseScheduleRequestInput(record.value);\n\tif (!schedule.ok) {\n\t\treturn schedule;\n\t}\n\treturn ok({\n\t\tinput: record.value,\n\t\tinputProvided: true,\n\t\tnextTurnModelProfileIdProvided,\n\t\tschedule: schedule.value,\n\t\tscheduleProvided: hasInlineScheduleFields(record.value),\n\t\t...(nextTurnModelProfileIdProvided\n\t\t\t? { nextTurnModelProfileId: trimToNull(record.value.nextTurnModelProfileId) }\n\t\t\t: {}),\n\t});\n}\n\nexport function serializeFutureLaunchPayload(payload: unknown): string {\n\treturn JSON.stringify(normalizeFutureLaunchPayload(payload as FutureLaunchPayloadBase));\n}\n\nexport function parseFutureLaunchPayloadObject(\n\tvalue: unknown,\n\tcontext = \"Scheduled launch payload\",\n): ParseResult<FutureLaunchPayload> {\n\tconst parsed = parseSchema(futureLaunchPayloadInputSchema, value, context);\n\treturn parsed.ok ? ok(normalizeFutureLaunchPayload(parsed.value)) : parsed;\n}\n\nexport function parseFutureLaunchPayloadJson(\n\tpayloadJson: string,\n): ParseResult<FutureLaunchPayload> {\n\tconst parsed = parseJsonPayload(payloadJson, \"Scheduled launch payload\");\n\treturn parsed.ok ? parseFutureLaunchPayloadObject(parsed.value) : parsed;\n}\n\nexport function serializeFutureActionPayload(payload: unknown): string {\n\treturn JSON.stringify(normalizeFutureActionPayload(payload as FutureActionPayloadBase));\n}\n\nexport function parseFutureActionPayloadObject(\n\tvalue: unknown,\n\tcontext = \"Scheduled action payload\",\n): ParseResult<FutureActionPayload> {\n\tconst parsed = parseSchema(futureActionPayloadInputSchema, value, context);\n\treturn parsed.ok ? ok(normalizeFutureActionPayload(parsed.value)) : parsed;\n}\n\nexport function parseFutureActionPayloadJson(\n\tpayloadJson: string,\n): ParseResult<FutureActionPayload> {\n\tconst parsed = parseJsonPayload(payloadJson, \"Scheduled action payload\");\n\treturn parsed.ok ? parseFutureActionPayloadObject(parsed.value) : parsed;\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EAMC;AAAA,EACA;AAAA,EAeA;AAAA,OAEM;AACP,YAAY,OAAO;AA0IZ,SAAS,yBAAyB,OAKT;AAC/B,QAAM,cAAc,MAAM,UAAU,KAAK,MAAM,MAAM,QAAQ,SAAS,IAAI,OAAO;AACjF,MACC,CAAC,MAAM,WACP,CAAC,OAAO,SAAS,WAAW,MAC3B,MAAM,OAAO,KAAK,IAAI,KAAK,eAC5B,MAAM,QAAQ,0BAA0B,SAAS,MAAM,uBAAuB,GAC7E;AACD,WAAO,EAAE,oCAAoC,OAAO,2BAA2B,KAAK;AAAA,EACrF;AACA,QAAM,gBAAgB,MAAM,4BACzB,IAAI,IAAI,MAAM,yBAAyB,IACvC;AACH,QAAM,kBAAkB,MAAM,QAAQ,0BAA0B;AAAA,IAC/D,CAAC,cAAc,CAAC,iBAAiB,cAAc,IAAI,SAAS;AAAA,EAC7D;AACA,SAAO;AAAA,IACN,oCAAoC;AAAA,IACpC,2BAA2B,gBAAgB,SAAS,MAAM,QAAQ,sBAAsB,IACrF,MAAM,QAAQ,yBACb,gBAAgB,CAAC,KAAK;AAAA,EAC3B;AACD;AAmwBA,IAAM,iBAAiB,CAAC,OAAO,QAAQ,MAAM;AAC7C,IAAM,6BAA6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