@leitwerk-dev/protocol 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-token-contracts.d.ts +25 -0
- package/dist/api-token-contracts.d.ts.map +1 -0
- package/dist/{chunk-SKQG5SE3.js → chunk-J4VMD5ST.js} +17 -26
- package/dist/chunk-J4VMD5ST.js.map +1 -0
- package/dist/{chunk-J7LXDQAN.js → chunk-Z4IU6KEN.js} +40 -6
- package/dist/chunk-Z4IU6KEN.js.map +1 -0
- package/dist/compact-turn-summary.d.ts +31 -0
- package/dist/compact-turn-summary.d.ts.map +1 -0
- package/dist/config-snapshot.d.ts +2 -0
- package/dist/config-snapshot.d.ts.map +1 -1
- package/dist/config-snapshot.js +1 -1
- package/dist/config-snapshot.js.map +1 -1
- package/dist/extension-ui-contracts.d.ts +27 -0
- package/dist/extension-ui-contracts.d.ts.map +1 -0
- package/dist/form-contract.js +1 -1
- package/dist/form-contract.js.map +1 -1
- package/dist/{http-contracts-DP9P_2YM.d.ts → http-contracts-ht8DDU4J.d.ts} +163 -37
- package/dist/http-contracts.d.ts +109 -38
- package/dist/http-contracts.d.ts.map +1 -1
- package/dist/http-contracts.js +32 -432
- package/dist/http-contracts.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1196 -20
- package/dist/index.js.map +1 -1
- package/dist/initial-prompt.d.ts.map +1 -1
- package/dist/launcher-contract.js +1 -1
- package/dist/launcher-contract.js.map +1 -1
- package/dist/live-turn-projection.d.ts +1 -1
- package/dist/live-turn-projection.d.ts.map +1 -1
- package/dist/protocol.d.ts +63 -16
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +37 -259
- package/dist/protocol.js.map +1 -1
- package/dist/streamable-events.d.ts +1 -1
- package/dist/streamable-events.d.ts.map +1 -1
- package/dist/ticket-creation-contracts.d.ts +33 -0
- package/dist/ticket-creation-contracts.d.ts.map +1 -0
- package/dist/timeline-projection.d.ts +1 -1
- package/dist/timeline-projection.d.ts.map +1 -1
- package/dist/tool-renderer-contract.js +10 -21
- package/dist/tool-renderer-contract.js.map +1 -1
- package/dist/tool-result-truncation.d.ts +6 -0
- package/dist/tool-result-truncation.d.ts.map +1 -0
- package/dist/turn-continuation.d.ts +1 -1
- package/dist/turn-continuation.d.ts.map +1 -1
- package/dist/turn-trace-projection.d.ts +5 -0
- package/dist/turn-trace-projection.d.ts.map +1 -0
- package/dist/usage-snapshot.d.ts +3 -1
- package/dist/usage-snapshot.d.ts.map +1 -1
- package/dist/ws-event-payloads.d.ts +2 -1
- package/dist/ws-event-payloads.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api-token-contracts.ts +24 -0
- package/src/compact-turn-summary.ts +119 -0
- package/src/config-snapshot.ts +2 -0
- package/src/extension-ui-contracts.ts +45 -0
- package/src/http-contracts.ts +139 -68
- package/src/index.ts +5 -0
- package/src/initial-prompt.ts +3 -6
- package/src/live-turn-projection.ts +41 -113
- package/src/protocol.ts +52 -12
- package/src/streamable-events.ts +2 -0
- package/src/ticket-creation-contracts.ts +34 -0
- package/src/timeline-projection.ts +5 -4
- package/src/tool-result-truncation.ts +94 -0
- package/src/turn-continuation.ts +22 -46
- package/src/turn-trace-projection.ts +42 -0
- package/src/usage-snapshot.ts +25 -59
- package/src/ws-event-payloads.ts +5 -14
- package/dist/chunk-J7LXDQAN.js.map +0 -1
- package/dist/chunk-SKQG5SE3.js.map +0 -1
- package/dist/external-review.js +0 -2
- package/dist/external-review.js.map +0 -1
- package/dist/initial-prompt.js +0 -103
- package/dist/initial-prompt.js.map +0 -1
- package/dist/live-turn-projection.js +0 -395
- package/dist/live-turn-projection.js.map +0 -1
- package/dist/pi-session-message.js +0 -27
- package/dist/pi-session-message.js.map +0 -1
- package/dist/primary-path-snapshot.js +0 -2
- package/dist/primary-path-snapshot.js.map +0 -1
- package/dist/session-entry-tree.js +0 -42
- package/dist/session-entry-tree.js.map +0 -1
- package/dist/streamable-events.js +0 -17
- package/dist/streamable-events.js.map +0 -1
- package/dist/text-preview.js +0 -23
- package/dist/text-preview.js.map +0 -1
- package/dist/timeline-projection.js +0 -33
- package/dist/timeline-projection.js.map +0 -1
- package/dist/timestamp-ordering.js +0 -15
- package/dist/timestamp-ordering.js.map +0 -1
- package/dist/turn-continuation.js +0 -179
- package/dist/turn-continuation.js.map +0 -1
- package/dist/usage-by-turn-record.js +0 -25
- package/dist/usage-by-turn-record.js.map +0 -1
- package/dist/usage-snapshot.js +0 -120
- package/dist/usage-snapshot.js.map +0 -1
- package/dist/ws-event-payloads.js +0 -47
- package/dist/ws-event-payloads.js.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ApiTokenMetadata {
|
|
2
|
+
id: string;
|
|
3
|
+
prefix: string;
|
|
4
|
+
name: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
expiresAt: string | null;
|
|
7
|
+
revokedAt: string | null;
|
|
8
|
+
lastUsedAt: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiTokenPolicy {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
defaultTtlMs: number;
|
|
13
|
+
maxTtlMs: number;
|
|
14
|
+
allowNoExpiry: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ApiTokensResponseBody {
|
|
17
|
+
tokens: ApiTokenMetadata[];
|
|
18
|
+
policy: ApiTokenPolicy;
|
|
19
|
+
csrfToken: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateApiTokenResponseBody {
|
|
22
|
+
token: ApiTokenMetadata;
|
|
23
|
+
secret: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=api-token-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-token-contracts.d.ts","sourceRoot":"","sources":["../src/api-token-contracts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AACD,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACvB;AACD,MAAM,WAAW,qBAAqB;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,0BAA0B;IAC1C,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
parseLiteral,
|
|
7
7
|
parseSchema,
|
|
8
8
|
unknownRecordSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z4IU6KEN.js";
|
|
10
10
|
|
|
11
11
|
// src/http-contracts.ts
|
|
12
12
|
import {
|
|
@@ -119,11 +119,6 @@ var futureActionPayloadInputSchema = v.object({
|
|
|
119
119
|
actor: v.optional(v.nullable(unknownRecordSchema))
|
|
120
120
|
});
|
|
121
121
|
var cloneUnknownRecord = (value) => value ? { ...value } : null;
|
|
122
|
-
var cloneTurnConfigMap = (turnConfigs = {}) => Object.fromEntries(
|
|
123
|
-
Object.entries(turnConfigs).map(
|
|
124
|
-
([turnId, turnConfig]) => [turnId, { ...turnConfig }]
|
|
125
|
-
)
|
|
126
|
-
);
|
|
127
122
|
var normalizeFutureLaunchPayload = (payload) => {
|
|
128
123
|
const modelConfig = normalizeLaunchModelConfigInput(
|
|
129
124
|
payload.modelConfig ?? {}
|
|
@@ -132,7 +127,7 @@ var normalizeFutureLaunchPayload = (payload) => {
|
|
|
132
127
|
launcherInput: cloneUnknownRecord(payload.launcherInput) ?? {},
|
|
133
128
|
modelConfig: {
|
|
134
129
|
defaultModelProfileId: modelConfig.defaultModelProfileId ?? null,
|
|
135
|
-
turnConfigs:
|
|
130
|
+
turnConfigs: { ...modelConfig.turnConfigs }
|
|
136
131
|
},
|
|
137
132
|
actor: normalizeActor(payload.actor),
|
|
138
133
|
selectedSkillIds: [
|
|
@@ -181,9 +176,6 @@ var normalizeFutureActionPayload = (payload) => ({
|
|
|
181
176
|
actionLabel: trimToNull(payload.actionLabel) ?? null,
|
|
182
177
|
actor: normalizeActor(payload.actor)
|
|
183
178
|
});
|
|
184
|
-
function hasOwn(object2, key) {
|
|
185
|
-
return Object.hasOwn(object2, key);
|
|
186
|
-
}
|
|
187
179
|
function parseJsonPayload(payloadJson, context) {
|
|
188
180
|
try {
|
|
189
181
|
return ok(JSON.parse(payloadJson));
|
|
@@ -277,7 +269,7 @@ function parseLauncherModelConfigInput(value, context = "modelConfig") {
|
|
|
277
269
|
return record;
|
|
278
270
|
}
|
|
279
271
|
const defaultModelProfileId = trimToNull(record.value.defaultModelProfileId);
|
|
280
|
-
if (hasOwn(record.value, "defaultModelProfileId") && record.value.defaultModelProfileId !== null && typeof record.value.defaultModelProfileId !== "string") {
|
|
272
|
+
if (Object.hasOwn(record.value, "defaultModelProfileId") && record.value.defaultModelProfileId !== null && typeof record.value.defaultModelProfileId !== "string") {
|
|
281
273
|
return err(`${context}.defaultModelProfileId must be a string or null`);
|
|
282
274
|
}
|
|
283
275
|
const turnConfigs = record.value.turnConfigs === void 0 ? ok(void 0) : parseLauncherTurnConfigMap(record.value.turnConfigs, `${context}.turnConfigs`);
|
|
@@ -289,7 +281,7 @@ function parseLauncherModelConfigInput(value, context = "modelConfig") {
|
|
|
289
281
|
) : turnConfigs;
|
|
290
282
|
}
|
|
291
283
|
function hasInlineScheduleFields(object2) {
|
|
292
|
-
return hasOwn(object2, "mode") || hasOwn(object2, "runAt") || hasOwn(object2, "cronExpression");
|
|
284
|
+
return Object.hasOwn(object2, "mode") || Object.hasOwn(object2, "runAt") || Object.hasOwn(object2, "cronExpression");
|
|
293
285
|
}
|
|
294
286
|
function parseLauncherRequestBody(value) {
|
|
295
287
|
if (value === void 0 || value === null) {
|
|
@@ -308,9 +300,9 @@ function parseLauncherRequestBody(value) {
|
|
|
308
300
|
if (!record.ok) {
|
|
309
301
|
return record;
|
|
310
302
|
}
|
|
311
|
-
if (hasOwn(record.value, "title") || record.value.launcherInput !== void 0 || record.value.skillIds !== void 0 || record.value.modelConfig !== void 0 || record.value.schedule !== void 0) {
|
|
303
|
+
if (Object.hasOwn(record.value, "title") || record.value.launcherInput !== void 0 || record.value.skillIds !== void 0 || record.value.modelConfig !== void 0 || record.value.schedule !== void 0) {
|
|
312
304
|
if (Object.keys(record.value).some(
|
|
313
|
-
(key) =>
|
|
305
|
+
(key) => !Object.hasOwn(launcherStructuredBodySchema.entries, key)
|
|
314
306
|
)) {
|
|
315
307
|
return err(
|
|
316
308
|
"launcher request body must use { title, launcherInput, skillIds, modelConfig, schedule }"
|
|
@@ -334,14 +326,14 @@ function parseLauncherRequestBody(value) {
|
|
|
334
326
|
}
|
|
335
327
|
return ok({
|
|
336
328
|
title: parsed.value.title ?? null,
|
|
337
|
-
titleProvided: hasOwn(record.value, "title"),
|
|
329
|
+
titleProvided: Object.hasOwn(record.value, "title"),
|
|
338
330
|
launcherInput: parsed.value.launcherInput ?? {},
|
|
339
|
-
launcherInputProvided: hasOwn(record.value, "launcherInput"),
|
|
340
|
-
...hasOwn(record.value, "skillIds") ? { skillIds: [...skillIds] } : {},
|
|
331
|
+
launcherInputProvided: Object.hasOwn(record.value, "launcherInput"),
|
|
332
|
+
...Object.hasOwn(record.value, "skillIds") ? { skillIds: [...skillIds] } : {},
|
|
341
333
|
modelConfig: modelConfig2.value,
|
|
342
|
-
modelConfigProvided: hasOwn(record.value, "modelConfig"),
|
|
334
|
+
modelConfigProvided: Object.hasOwn(record.value, "modelConfig"),
|
|
343
335
|
schedule: schedule2.value,
|
|
344
|
-
scheduleProvided: hasOwn(record.value, "schedule")
|
|
336
|
+
scheduleProvided: Object.hasOwn(record.value, "schedule")
|
|
345
337
|
});
|
|
346
338
|
}
|
|
347
339
|
const modelConfig = parseLauncherModelConfigInput(record.value, "modelConfig");
|
|
@@ -377,10 +369,10 @@ function parseActionRequestBody(value) {
|
|
|
377
369
|
if (!record.ok) {
|
|
378
370
|
return record;
|
|
379
371
|
}
|
|
380
|
-
const nextTurnModelProfileIdProvided = hasOwn(record.value, "nextTurnModelProfileId");
|
|
372
|
+
const nextTurnModelProfileIdProvided = Object.hasOwn(record.value, "nextTurnModelProfileId");
|
|
381
373
|
if (record.value.input !== void 0 || nextTurnModelProfileIdProvided || record.value.schedule !== void 0) {
|
|
382
374
|
if (Object.keys(record.value).some(
|
|
383
|
-
(key) =>
|
|
375
|
+
(key) => !Object.hasOwn(actionStructuredBodySchema.entries, key)
|
|
384
376
|
)) {
|
|
385
377
|
return err("action request body must use { input, nextTurnModelProfileId }");
|
|
386
378
|
}
|
|
@@ -394,10 +386,10 @@ function parseActionRequestBody(value) {
|
|
|
394
386
|
}
|
|
395
387
|
return ok({
|
|
396
388
|
input: parsed.value.input ?? {},
|
|
397
|
-
inputProvided: hasOwn(record.value, "input"),
|
|
389
|
+
inputProvided: Object.hasOwn(record.value, "input"),
|
|
398
390
|
nextTurnModelProfileIdProvided,
|
|
399
391
|
schedule: schedule2.value,
|
|
400
|
-
scheduleProvided: hasOwn(record.value, "schedule"),
|
|
392
|
+
scheduleProvided: Object.hasOwn(record.value, "schedule"),
|
|
401
393
|
...nextTurnModelProfileIdProvided ? { nextTurnModelProfileId: parsed.value.nextTurnModelProfileId ?? null } : {}
|
|
402
394
|
});
|
|
403
395
|
}
|
|
@@ -410,8 +402,7 @@ function parseActionRequestBody(value) {
|
|
|
410
402
|
inputProvided: true,
|
|
411
403
|
nextTurnModelProfileIdProvided,
|
|
412
404
|
schedule: schedule.value,
|
|
413
|
-
scheduleProvided: hasInlineScheduleFields(record.value)
|
|
414
|
-
...nextTurnModelProfileIdProvided ? { nextTurnModelProfileId: trimToNull(record.value.nextTurnModelProfileId) } : {}
|
|
405
|
+
scheduleProvided: hasInlineScheduleFields(record.value)
|
|
415
406
|
});
|
|
416
407
|
}
|
|
417
408
|
function serializeFutureLaunchPayload(payload) {
|
|
@@ -453,4 +444,4 @@ export {
|
|
|
453
444
|
parseFutureActionPayloadObject,
|
|
454
445
|
parseFutureActionPayloadJson
|
|
455
446
|
};
|
|
456
|
-
//# sourceMappingURL=chunk-
|
|
447
|
+
//# sourceMappingURL=chunk-J4VMD5ST.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\ttype LaunchRun,\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 ProcessToolApprovalRequest,\n\ttype ProcessTurnAnnotation,\n\ttype ProcessTurnRecord,\n\ttype ProcessTurnType,\n\ttype QuestionAnswerDraft,\n\ttype SerializedProcessGraph,\n\ttype TurnProgressReport,\n\ttrimToNull,\n\ttype WorkerLease,\n} from \"@leitwerk-dev/domain\";\nimport * as v from \"valibot\";\nimport type { CompactActiveTurnSnapshot } from \"./compact-turn-summary.js\";\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\";\nimport type { UsageCostSnapshot, UsageTokenCounts } from \"./usage-snapshot.js\";\n\nexport interface StartLaunchRunResponseBody {\n\tlaunchRunId: string;\n\tinstanceId: string | null;\n}\n\nexport interface LaunchRunResponseBody {\n\tlaunchRun: LaunchRun;\n}\n\nexport interface ProcessLaunchRunsResponseBody {\n\tlaunchRuns: LaunchRun[];\n}\n\nexport interface AuthMeResponseBody {\n\tauthEnabled: boolean;\n\tactor: Actor | null;\n}\n\nexport interface SessionTransferOperationView {\n\tattemptId: string;\n\tphase: string;\n\tblocksManualTurns: boolean;\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 extends UsageTokenCounts {\n\tcost?: UsageCostSnapshot;\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\tmodelInvocable: 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\tmodelInvocable: 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\textends Omit<FutureExecutionBaseSummary, \"kind\" | \"subtitle\" | \"modelSelection\"> {\n\tinitialPromptPreview: string | 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\tresultSummary?: string;\n\treviewedTurnRecordId?: string;\n\tresources?: import(\"@leitwerk-dev/domain\").TurnProgressLink[];\n\ttransition?: { selectedTurnId: string; targetTurnRecordId?: string; accepted: boolean };\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\tprogress?: TurnProgressReport | null;\n\tprogressRecordedAt?: string;\n}\n\nexport type ProcessTimelineInputSummary = Pick<\n\tProcessInput,\n\t\"id\" | \"sequence\" | \"source\" | \"kind\" | \"bodyMarkdown\" | \"receivedAt\" | \"consumedAt\"\n>;\n\nexport interface ProcessExternalObservation {\n\tsummary: string;\n\tlinks?: import(\"@leitwerk-dev/domain\").TurnProgressLink[];\n\tobservedAt: string;\n\tsubject: string;\n\trevision: string;\n}\n\nexport interface ProcessExternalTriggerSignal {\n\tobservation?: ProcessExternalObservation;\n\trefreshError?: string | null;\n\trefreshedAt?: string;\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\tsupportsModelOverride: 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 StartupAttemptStatus = \"starting\" | \"failed\" | \"succeeded\" | \"recovered\" | \"superseded\";\n\nexport interface StartupAttemptStepSummary {\n\t/** Observed phase interval; absent for older servers or unavailable evidence. */\n\tstartedAt?: string | null;\n\tendedAt?: string | null;\n\tdetail?: string;\n\tid: \"start_worker\" | \"connect_worker\" | \"prepare_workspace\" | \"start_first_turn\";\n\tlabel: string;\n\tstatus: \"pending\" | \"in_progress\" | \"completed\" | \"failed\" | \"superseded\";\n\toccurredAt: string | null;\n}\n\n/** Worker-start history derived from correlated start, lease, readiness, and turn records. */\nexport interface StartupAttemptSummary {\n\tstartRecordId: string;\n\tworkerLeaseId: string | null;\n\tstatus: StartupAttemptStatus;\n\tstartedAt: string;\n\treadyAt: string | null;\n\tdurationMs: number | null;\n\tsummary: string | null;\n\trecoveredByStartRecordId: string | null;\n\tsteps: StartupAttemptStepSummary[];\n}\n\nexport interface ProcessStartupSummary {\n\tworkerStarts?: import(\"@leitwerk-dev/domain\").PhysicalWorkerStart[];\n\tauthoritativeAttemptId: string | null;\n\tattempts: StartupAttemptSummary[];\n\trecovery: StartupRecoverySummary | null;\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 Omit<PrimaryPathSnapshot, \"turnState\"> {\n\tthroughEventSequence: number;\n\tturnState: Omit<PrimaryPathSnapshot[\"turnState\"], \"activeTurn\"> & {\n\t\tactiveTurn: CompactActiveTurnSnapshot | null;\n\t};\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/** Next turn on the declared happy path, including human decisions. */\n\tplannedNextTurn?: Pick<ProcessSelectedTurnSummary, \"turnId\" | \"description\"> | null;\n\t/** Durable requests in Chronicle order; at most one is open for the current turn. */\n\tquestionRequests: ProcessQuestionRequest[];\n\ttoolApprovalRequests: ProcessToolApprovalRequest[];\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\t/** Authoritative startup history and current remediation. */\n\tstartup: ProcessStartupSummary;\n\t/** Compatibility alias for startup.recovery. */\n\tstartupRecovery: StartupRecoverySummary | null;\n\tprocessError: CurrentProcessErrorSummary | null;\n\tusageEstimate: ProcessUsageEstimateSnapshot | null;\n\tpersistedModelSelectionWarning: string | null;\n\tsession: { signature: string | null };\n\tsessionTransfer: SessionTransferOperationView | 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\tstate: \"live\" | \"committed\";\n\tthroughEventSequence: number;\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 interface FutureLaunchMutationResponseBody {\n\tkind: \"scheduled\";\n\tfutureExecution: FutureLaunchSummary | null;\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\nexport type 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\nexport type 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 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: { ...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 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\tObject.hasOwn(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 (\n\t\tObject.hasOwn(object, \"mode\") ||\n\t\tObject.hasOwn(object, \"runAt\") ||\n\t\tObject.hasOwn(object, \"cronExpression\")\n\t);\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\tObject.hasOwn(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) => !Object.hasOwn(launcherStructuredBodySchema.entries, key),\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: Object.hasOwn(record.value, \"title\"),\n\t\t\tlauncherInput: parsed.value.launcherInput ?? {},\n\t\t\tlauncherInputProvided: Object.hasOwn(record.value, \"launcherInput\"),\n\t\t\t...(Object.hasOwn(record.value, \"skillIds\") ? { skillIds: [...skillIds] } : {}),\n\t\t\tmodelConfig: modelConfig.value,\n\t\t\tmodelConfigProvided: Object.hasOwn(record.value, \"modelConfig\"),\n\t\t\tschedule: schedule.value,\n\t\t\tscheduleProvided: Object.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 = Object.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) => !Object.hasOwn(actionStructuredBodySchema.entries, key),\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: Object.hasOwn(record.value, \"input\"),\n\t\t\tnextTurnModelProfileIdProvided,\n\t\t\tschedule: schedule.value,\n\t\t\tscheduleProvided: Object.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});\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\nexport type {\n\tApiTokenMetadata,\n\tApiTokenPolicy,\n\tApiTokensResponseBody,\n\tCreateApiTokenResponseBody,\n} from \"./api-token-contracts.js\";\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EAOC;AAAA,EACA;AAAA,EAiBA;AAAA,OAEM;AACP,YAAY,OAAO;AA+JZ,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,QA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D;AAAA,MACA,UAAUA,UAAS;AAAA,MACnB,kBAAkB,OAAO,OAAO,OAAO,OAAO,UAAU;AAAA,MACxD,GAAI,iCACD,EAAE,wBAAwB,OAAO,MAAM,0BAA0B,KAAK,IACtE,CAAC;AAAA,IACL,CAAC;AAAA,EACF;AACA,QAAM,WAAW,0BAA0B,OAAO,KAAK;AACvD,MAAI,CAAC,SAAS,IAAI;AACjB,WAAO;AAAA,EACR;AACA,SAAO,GAAG;AAAA,IACT,OAAO,OAAO;AAAA,IACd,eAAe;AAAA,IACf;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,kBAAkB,wBAAwB,OAAO,KAAK;AAAA,EACvD,CAAC;AACF;AAEO,SAAS,6BAA6B,SAA0B;AACtE,SAAO,KAAK,UAAU,6BAA6B,OAAkC,CAAC;AACvF;AAEO,SAAS,+BACf,OACA,UAAU,4BACyB;AACnC,QAAM,SAAS,YAAY,gCAAgC,OAAO,OAAO;AACzE,SAAO,OAAO,KAAK,GAAG,6BAA6B,OAAO,KAAK,CAAC,IAAI;AACrE;AAEO,SAAS,6BACf,aACmC;AACnC,QAAM,SAAS,iBAAiB,aAAa,0BAA0B;AACvE,SAAO,OAAO,KAAK,+BAA+B,OAAO,KAAK,IAAI;AACnE;AAEO,SAAS,6BAA6B,SAA0B;AACtE,SAAO,KAAK,UAAU,6BAA6B,OAAkC,CAAC;AACvF;AAEO,SAAS,+BACf,OACA,UAAU,4BACyB;AACnC,QAAM,SAAS,YAAY,gCAAgC,OAAO,OAAO;AACzE,SAAO,OAAO,KAAK,GAAG,6BAA6B,OAAO,KAAK,CAAC,IAAI;AACrE;AAEO,SAAS,6BACf,aACmC;AACnC,QAAM,SAAS,iBAAiB,aAAa,0BAA0B;AACvE,SAAO,OAAO,KAAK,+BAA+B,OAAO,KAAK,IAAI;AACnE;","names":["object","modelConfig","schedule"]}
|
|
@@ -20,9 +20,7 @@ function parseSchema(schema, value, context) {
|
|
|
20
20
|
}
|
|
21
21
|
const issue = parsed.issues?.[0];
|
|
22
22
|
const target = issue ? [context, v.getDotPath(issue)].filter(Boolean).join(".") : context;
|
|
23
|
-
return err(
|
|
24
|
-
issue?.message === "must be an object" ? `${target} must be an object` : `${target} ${issue?.message ?? "is invalid"}`
|
|
25
|
-
);
|
|
23
|
+
return err(`${target} ${issue?.message ?? "is invalid"}`);
|
|
26
24
|
}
|
|
27
25
|
function parseLiteral(value, allowed, context) {
|
|
28
26
|
return v.is(v.picklist(allowed), value) ? ok(value) : err(`${context} must be one of: ${allowed.join(", ")}`);
|
|
@@ -35,6 +33,7 @@ var WS_PROCESS_TYPES = {
|
|
|
35
33
|
var WS_PRIMARY_PATH_TYPES = {
|
|
36
34
|
TURN_STARTED: "primary_path.turn_started",
|
|
37
35
|
ASSISTANT_PARTIAL: "primary_path.assistant_partial",
|
|
36
|
+
SUMMARY_UPDATED: "primary_path.summary_updated",
|
|
38
37
|
USAGE_UPDATED: "primary_path.usage_updated",
|
|
39
38
|
ASSISTANT_COMMITTED: "primary_path.assistant_committed",
|
|
40
39
|
TOOL_CALL_STARTED: "primary_path.tool_call_started",
|
|
@@ -53,7 +52,9 @@ var WS_PI_STREAM_TYPES = {
|
|
|
53
52
|
ERROR: "pi.error",
|
|
54
53
|
RETRY_START: "pi.retry.start",
|
|
55
54
|
RETRY_END: "pi.retry.end",
|
|
56
|
-
USAGE: "pi.usage"
|
|
55
|
+
USAGE: "pi.usage",
|
|
56
|
+
COMPACTION_START: "pi.compaction.start",
|
|
57
|
+
COMPACTION_END: "pi.compaction.end"
|
|
57
58
|
};
|
|
58
59
|
var finiteNumberSchema = v.pipe(v.number(), v.finite());
|
|
59
60
|
var semanticEntryRefSchema = v.object({
|
|
@@ -121,6 +122,29 @@ var processTurnAnnotationSchema = v.object({
|
|
|
121
122
|
updatedAt: v.string()
|
|
122
123
|
});
|
|
123
124
|
var PRIMARY_PATH_PAYLOAD_SCHEMAS = {
|
|
125
|
+
[WS_PRIMARY_PATH_TYPES.SUMMARY_UPDATED]: v.object({
|
|
126
|
+
turnRecordId: v.string(),
|
|
127
|
+
summary: v.object({
|
|
128
|
+
assistant: v.object({
|
|
129
|
+
text: v.pipe(v.string(), v.maxLength(1024)),
|
|
130
|
+
thinking: v.pipe(v.string(), v.maxLength(1024)),
|
|
131
|
+
lastUpdatedAt: nullableStringSchema
|
|
132
|
+
}),
|
|
133
|
+
currentTool: v.nullable(
|
|
134
|
+
v.object({
|
|
135
|
+
toolCallId: v.pipe(v.string(), v.maxLength(256)),
|
|
136
|
+
toolName: v.pipe(v.string(), v.maxLength(256)),
|
|
137
|
+
status: v.picklist(["running", "completed"]),
|
|
138
|
+
isError: v.boolean()
|
|
139
|
+
})
|
|
140
|
+
),
|
|
141
|
+
usage: v.nullable(usageSnapshotSchema),
|
|
142
|
+
toolCallCount: v.pipe(v.number(), v.integer(), v.minValue(0)),
|
|
143
|
+
traceItemCount: v.pipe(v.number(), v.integer(), v.minValue(0)),
|
|
144
|
+
throughEventSequence: v.pipe(v.number(), v.integer(), v.minValue(0)),
|
|
145
|
+
lastTraceKind: v.nullable(v.picklist(["thinking", "tool_call", "operational_event"]))
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
124
148
|
[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: v.object({
|
|
125
149
|
turnRecord: processTurnRecordSummarySchema
|
|
126
150
|
}),
|
|
@@ -165,8 +189,10 @@ var WS_FRAME_DURABILITY = {
|
|
|
165
189
|
hello: "ephemeral",
|
|
166
190
|
pong: "ephemeral",
|
|
167
191
|
"process.created": "durable",
|
|
192
|
+
"launch.updated": "durable",
|
|
168
193
|
"process.updated": "durable",
|
|
169
194
|
"process.deleted": "durable",
|
|
195
|
+
"session_transfer.updated": "durable",
|
|
170
196
|
"project.updated": "durable",
|
|
171
197
|
"worker.state": "durable",
|
|
172
198
|
"process.input.queued": "durable",
|
|
@@ -186,8 +212,11 @@ var WS_FRAME_DURABILITY = {
|
|
|
186
212
|
[WS_PI_STREAM_TYPES.RETRY_START]: "ephemeral",
|
|
187
213
|
[WS_PI_STREAM_TYPES.RETRY_END]: "ephemeral",
|
|
188
214
|
[WS_PI_STREAM_TYPES.USAGE]: "ephemeral",
|
|
215
|
+
[WS_PI_STREAM_TYPES.COMPACTION_START]: "ephemeral",
|
|
216
|
+
[WS_PI_STREAM_TYPES.COMPACTION_END]: "ephemeral",
|
|
189
217
|
[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: "durable",
|
|
190
218
|
[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: "ephemeral",
|
|
219
|
+
[WS_PRIMARY_PATH_TYPES.SUMMARY_UPDATED]: "ephemeral",
|
|
191
220
|
[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: "ephemeral",
|
|
192
221
|
[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: "durable",
|
|
193
222
|
[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: "ephemeral",
|
|
@@ -205,6 +234,7 @@ var WS_FRAME_SCHEMA = v.looseObject({
|
|
|
205
234
|
type: v.picklist(KNOWN_WS_FRAME_TYPES),
|
|
206
235
|
durability: v.picklist(["durable", "ephemeral"]),
|
|
207
236
|
sentAt: v.string(),
|
|
237
|
+
eventSequence: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))),
|
|
208
238
|
instanceId: v.optional(v.string()),
|
|
209
239
|
payload: unknownRecordSchema
|
|
210
240
|
});
|
|
@@ -243,6 +273,7 @@ function createDurableWsFrame(input) {
|
|
|
243
273
|
type: input.type,
|
|
244
274
|
durability: "durable",
|
|
245
275
|
sentAt: input.sentAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
276
|
+
...input.eventSequence !== void 0 ? { eventSequence: input.eventSequence } : {},
|
|
246
277
|
...input.instanceId ? { instanceId: input.instanceId } : {},
|
|
247
278
|
payload: input.payload
|
|
248
279
|
};
|
|
@@ -253,6 +284,7 @@ function createEphemeralWsFrame(input) {
|
|
|
253
284
|
type: input.type,
|
|
254
285
|
durability: "ephemeral",
|
|
255
286
|
sentAt: input.sentAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
287
|
+
...input.eventSequence !== void 0 ? { eventSequence: input.eventSequence } : {},
|
|
256
288
|
...input.instanceId ? { instanceId: input.instanceId } : {},
|
|
257
289
|
payload: input.payload
|
|
258
290
|
};
|
|
@@ -267,7 +299,9 @@ var WORKER_TO_WS_TYPE = {
|
|
|
267
299
|
"pi.error": WS_PI_STREAM_TYPES.ERROR,
|
|
268
300
|
"pi.retry.start": WS_PI_STREAM_TYPES.RETRY_START,
|
|
269
301
|
"pi.retry.end": WS_PI_STREAM_TYPES.RETRY_END,
|
|
270
|
-
"pi.usage": WS_PI_STREAM_TYPES.USAGE
|
|
302
|
+
"pi.usage": WS_PI_STREAM_TYPES.USAGE,
|
|
303
|
+
"pi.compaction.start": WS_PI_STREAM_TYPES.COMPACTION_START,
|
|
304
|
+
"pi.compaction.end": WS_PI_STREAM_TYPES.COMPACTION_END
|
|
271
305
|
};
|
|
272
306
|
function mapWorkerEventToWsType(workerEventType) {
|
|
273
307
|
return WORKER_TO_WS_TYPE[workerEventType] ?? null;
|
|
@@ -292,4 +326,4 @@ export {
|
|
|
292
326
|
createEphemeralWsFrame,
|
|
293
327
|
mapWorkerEventToWsType
|
|
294
328
|
};
|
|
295
|
-
//# sourceMappingURL=chunk-
|
|
329
|
+
//# sourceMappingURL=chunk-Z4IU6KEN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/protocol.ts"],"sourcesContent":["import {\n\ttype FutureExecutionKind,\n\tPROCESS_SEMANTIC_ENTRY_REF_KEYS,\n\tPROCESS_TURN_RECORD_PATH_TYPES,\n\tPROCESS_TURN_TYPES,\n\ttype ProcessInput,\n\ttype ProcessInstance,\n\ttype ProcessProject,\n\ttype WorkerLease,\n} from \"@leitwerk-dev/domain\";\nimport * as v from \"valibot\";\nimport type { StreamableWorkerEventType } from \"./streamable-events.js\";\n\nexport type ParseResult<T> = { ok: true; value: T } | { ok: false; error: string };\n\nexport const ok = <T>(value: T): ParseResult<T> => ({ ok: true, value });\nexport const err = (error: string): ParseResult<never> => ({ ok: false, error });\nexport const unknownRecordSchema = v.custom<Record<string, unknown>>(\n\t(value): value is Record<string, unknown> =>\n\t\ttypeof value === \"object\" && value !== null && !Array.isArray(value),\n\t\"must be an object\",\n);\nexport const nullableStringSchema = v.nullable(v.string());\nexport const optionalNullableStringSchema = v.optional(nullableStringSchema);\n\nexport function parseSchema<TSchema extends v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>>(\n\tschema: TSchema,\n\tvalue: unknown,\n\tcontext: string,\n): ParseResult<v.InferOutput<TSchema>> {\n\tconst parsed = v.safeParse(schema, value);\n\tif (parsed.success) {\n\t\treturn ok(parsed.output);\n\t}\n\tconst issue = parsed.issues?.[0];\n\tconst target = issue ? [context, v.getDotPath(issue)].filter(Boolean).join(\".\") : context;\n\treturn err(`${target} ${issue?.message ?? \"is invalid\"}`);\n}\n\nexport function parseLiteral<T extends string>(\n\tvalue: unknown,\n\tallowed: readonly T[],\n\tcontext: string,\n): ParseResult<T> {\n\treturn v.is(v.picklist(allowed), value)\n\t\t? ok(value as T)\n\t\t: err(`${context} must be one of: ${allowed.join(\", \")}`);\n}\n\nexport const WS_PROTOCOL_VERSION = \"leitwerk/ws/v1\";\n\nexport const WS_PROCESS_TYPES = {\n\tTOAST: \"process.toast\",\n\tFUTURE_UPDATED: \"future.updated\",\n} as const;\n\nexport const WS_PRIMARY_PATH_TYPES = {\n\tTURN_STARTED: \"primary_path.turn_started\",\n\tASSISTANT_PARTIAL: \"primary_path.assistant_partial\",\n\tSUMMARY_UPDATED: \"primary_path.summary_updated\",\n\tUSAGE_UPDATED: \"primary_path.usage_updated\",\n\tASSISTANT_COMMITTED: \"primary_path.assistant_committed\",\n\tTOOL_CALL_STARTED: \"primary_path.tool_call_started\",\n\tTOOL_CALL_COMPLETED: \"primary_path.tool_call_completed\",\n\tTURN_ANNOTATION_CHANGED: \"primary_path.turn_annotation_changed\",\n\tLABEL_CHANGED: \"primary_path.label_changed\",\n\tCHANGED: \"primary_path.changed\",\n} as const;\n\nexport const WS_PI_STREAM_TYPES = {\n\tSTARTED: \"pi.stream.started\",\n\tDELTA: \"pi.stream.delta\",\n\tCOMPLETED: \"pi.stream.completed\",\n\tTOOL_STARTED: \"pi.tool.started\",\n\tTOOL_COMPLETED: \"pi.tool.completed\",\n\tLABEL_CHANGED: \"pi.label.changed\",\n\tERROR: \"pi.error\",\n\tRETRY_START: \"pi.retry.start\",\n\tRETRY_END: \"pi.retry.end\",\n\tUSAGE: \"pi.usage\",\n\tCOMPACTION_START: \"pi.compaction.start\",\n\tCOMPACTION_END: \"pi.compaction.end\",\n} as const;\n\ntype PiPayload<T = Record<string, never>> = {\n\tturnId?: string | null;\n\tturnRecordId?: string | null;\n\ttimestamp?: string;\n} & T;\n\nconst finiteNumberSchema = v.pipe(v.number(), v.finite());\nconst semanticEntryRefSchema = v.object({\n\tentryId: v.string(),\n\tturnRecordId: nullableStringSchema,\n});\nconst primaryPathBasePayloadEntries = {\n\tturnRecordId: nullableStringSchema,\n\tpiTurnId: nullableStringSchema,\n\ttimestamp: v.string(),\n};\nconst primaryPathTreeEntries = {\n\trootEntry: v.nullable(semanticEntryRefSchema),\n\tcurrentLeaf: v.nullable(semanticEntryRefSchema),\n};\nconst primaryPathTreeSchema = v.object(primaryPathTreeEntries);\nconst processTurnRecordSummarySchema = v.object({\n\tid: v.string(),\n\tturnId: v.string(),\n\tturnType: v.picklist(PROCESS_TURN_TYPES),\n\tpathType: v.picklist(PROCESS_TURN_RECORD_PATH_TYPES),\n\tstartedAt: v.string(),\n});\nconst usageCostSnapshotSchema = v.object({\n\tinput: finiteNumberSchema,\n\toutput: finiteNumberSchema,\n\treasoning: v.optional(finiteNumberSchema),\n\tcacheRead: finiteNumberSchema,\n\tcacheWrite: finiteNumberSchema,\n\ttotal: finiteNumberSchema,\n});\nconst usageSnapshotSchema = v.object({\n\tinput: finiteNumberSchema,\n\toutput: finiteNumberSchema,\n\tcacheRead: finiteNumberSchema,\n\tcacheWrite: finiteNumberSchema,\n\ttotalTokens: finiteNumberSchema,\n\tcost: v.nullable(usageCostSnapshotSchema),\n});\nconst turnAnnotationReferenceSchema = v.variant(\"kind\", [\n\tv.object({\n\t\tkind: v.literal(\"turn_record\"),\n\t\tturnRecordId: v.string(),\n\t\trole: nullableStringSchema,\n\t}),\n\tv.object({\n\t\tkind: v.literal(\"entry\"),\n\t\tentryId: v.string(),\n\t\trole: nullableStringSchema,\n\t}),\n\tv.object({\n\t\tkind: v.literal(\"semantic_entry_ref\"),\n\t\tref: v.picklist(PROCESS_SEMANTIC_ENTRY_REF_KEYS),\n\t\trole: nullableStringSchema,\n\t}),\n]);\nconst processTurnAnnotationSchema = v.object({\n\tid: v.string(),\n\tinstanceId: v.string(),\n\tannotationType: v.string(),\n\tannotationKey: nullableStringSchema,\n\treferences: v.array(turnAnnotationReferenceSchema),\n\tpayload: unknownRecordSchema,\n\tcreatedAt: v.string(),\n\tupdatedAt: v.string(),\n});\nconst PRIMARY_PATH_PAYLOAD_SCHEMAS = {\n\t[WS_PRIMARY_PATH_TYPES.SUMMARY_UPDATED]: v.object({\n\t\tturnRecordId: v.string(),\n\t\tsummary: v.object({\n\t\t\tassistant: v.object({\n\t\t\t\ttext: v.pipe(v.string(), v.maxLength(1024)),\n\t\t\t\tthinking: v.pipe(v.string(), v.maxLength(1024)),\n\t\t\t\tlastUpdatedAt: nullableStringSchema,\n\t\t\t}),\n\t\t\tcurrentTool: v.nullable(\n\t\t\t\tv.object({\n\t\t\t\t\ttoolCallId: v.pipe(v.string(), v.maxLength(256)),\n\t\t\t\t\ttoolName: v.pipe(v.string(), v.maxLength(256)),\n\t\t\t\t\tstatus: v.picklist([\"running\", \"completed\"]),\n\t\t\t\t\tisError: v.boolean(),\n\t\t\t\t}),\n\t\t\t),\n\t\t\tusage: v.nullable(usageSnapshotSchema),\n\t\t\ttoolCallCount: v.pipe(v.number(), v.integer(), v.minValue(0)),\n\t\t\ttraceItemCount: v.pipe(v.number(), v.integer(), v.minValue(0)),\n\t\t\tthroughEventSequence: v.pipe(v.number(), v.integer(), v.minValue(0)),\n\t\t\tlastTraceKind: v.nullable(v.picklist([\"thinking\", \"tool_call\", \"operational_event\"])),\n\t\t}),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: v.object({\n\t\tturnRecord: processTurnRecordSummarySchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttext: v.string(),\n\t\tstreamType: v.string(),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\tusage: usageSnapshotSchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: v.object({\n\t\tturnRecord: processTurnRecordSummarySchema,\n\t\t...primaryPathTreeEntries,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttoolCallId: v.string(),\n\t\ttoolName: v.string(),\n\t\targuments: v.nullable(unknownRecordSchema),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttoolCallId: v.string(),\n\t\ttoolName: v.string(),\n\t\tresult: v.unknown(),\n\t\tisError: v.boolean(),\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: v.object({\n\t\tchange: v.picklist([\"created\", \"updated\"] as const),\n\t\tannotation: processTurnAnnotationSchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: v.object({\n\t\t...primaryPathBasePayloadEntries,\n\t\ttargetId: nullableStringSchema,\n\t\tlabel: nullableStringSchema,\n\t}),\n\t[WS_PRIMARY_PATH_TYPES.CHANGED]: primaryPathTreeSchema,\n} as const satisfies Record<\n\t(typeof WS_PRIMARY_PATH_TYPES)[keyof typeof WS_PRIMARY_PATH_TYPES],\n\tv.BaseSchema<unknown, unknown, v.BaseIssue<unknown>>\n>;\ntype PrimaryPathPayloadByType = {\n\t[K in keyof typeof PRIMARY_PATH_PAYLOAD_SCHEMAS]: v.InferOutput<\n\t\t(typeof PRIMARY_PATH_PAYLOAD_SCHEMAS)[K]\n\t>;\n};\ntype PrimaryPathTree = v.InferOutput<typeof primaryPathTreeSchema>;\ntype PiUsagePayload = PiPayload<{\n\tinput?: number;\n\toutput?: 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\tcacheHitRate?: number;\n}>;\n\nexport type WsDurability = \"durable\" | \"ephemeral\";\n\nexport type ProcessAttentionTarget =\n\t| { kind: \"action_required\" }\n\t| { kind: \"turn_failed\" }\n\t| { kind: \"worker_failed\" }\n\t| { kind: \"question_request\"; requestId: string };\n\nexport type WsPayloadByType = {\n\thello: { serverVersion: string };\n\tpong: Record<string, never>;\n\t\"process.created\": { process: ProcessInstance; processId: string; launcherId?: string };\n\t\"launch.updated\": { launchRunId: string; instanceId: string | null };\n\t\"process.updated\": { process: Partial<ProcessInstance>; changedFields?: readonly string[] };\n\t\"process.deleted\": { instanceId: string };\n\t\"session_transfer.updated\": { attemptId: string };\n\t\"project.updated\": {\n\t\tprojectId: string;\n\t\tproject: {\n\t\t\tkey: string;\n\t\t\trepoLocator: string;\n\t\t\trepoLocatorKind: ProcessProject[\"repoLocatorKind\"];\n\t\t\tbranch: string;\n\t\t\tbaseBranch: string;\n\t\t\tworkBranch: string | null;\n\t\t\texternalId: string | null;\n\t\t\texternalUrl: string | null;\n\t\t\tpipelineStatus: string | null;\n\t\t};\n\t};\n\t\"worker.state\": {\n\t\tworker: WorkerLease;\n\t\tworkerId: string;\n\t\tstate: WorkerLease[\"state\"];\n\t\tpreviousState: WorkerLease[\"state\"];\n\t\treason: string;\n\t};\n\t\"process.input.queued\": { instanceId: string; input: ProcessInput };\n\t\"process.input.acknowledged\": { instanceId: string; inputId: string; sequence: number };\n\t\"process.event\": { eventType: string; level: string; message: string };\n\t[WS_PROCESS_TYPES.TOAST]: {\n\t\tinstanceId: string;\n\t\tlevel: \"warn\" | \"error\";\n\t\tmessage: string;\n\t\teventType: string;\n\t\tdedupeKey: string;\n\t\tttlMs: number;\n\t\t/** Optional typed Chronicle target applied only when the operator opens the toast. */\n\t\tfocusTarget?: ProcessAttentionTarget;\n\t};\n\t[WS_PROCESS_TYPES.FUTURE_UPDATED]: {\n\t\tfutureExecutionId: string;\n\t\toperation: \"created\" | \"updated\" | \"deleted\";\n\t\tkind: FutureExecutionKind;\n\t};\n\t\"plan.updated\": { planRevision: number; reviewState: string; approved: boolean; summary: string };\n\t\"review.updated\": {\n\t\thasIssues: boolean;\n\t\tissueCount: number;\n\t\treviewMarkdown?: string;\n\t\tnextTurnId: string | null;\n\t};\n\t[WS_PI_STREAM_TYPES.STARTED]: PiPayload;\n\t[WS_PI_STREAM_TYPES.DELTA]: PiPayload<{\n\t\ttext?: string;\n\t\tdelta?: string;\n\t\tchunk?: string;\n\t\tstreamType?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.COMPLETED]: PiPayload;\n\t[WS_PI_STREAM_TYPES.TOOL_STARTED]: PiPayload<{\n\t\ttoolCallId?: string;\n\t\ttoolName?: string;\n\t\tname?: string;\n\t\targuments?: Record<string, unknown>;\n\t\targs?: Record<string, unknown>;\n\t}>;\n\t[WS_PI_STREAM_TYPES.TOOL_COMPLETED]: PiPayload<{\n\t\ttoolCallId?: string;\n\t\ttoolName?: string;\n\t\tname?: string;\n\t\tresult?: unknown;\n\t\tisError?: boolean;\n\t}>;\n\t[WS_PI_STREAM_TYPES.LABEL_CHANGED]: PiPayload<{\n\t\ttargetId?: string | null;\n\t\tlabel?: string | null;\n\t}>;\n\t[WS_PI_STREAM_TYPES.ERROR]: PiPayload<{\n\t\tmessage?: string;\n\t\terrorMessage?: string;\n\t\tsource?: string;\n\t\ttoolName?: string;\n\t\tstopReason?: string;\n\t\tprovider?: string;\n\t\tmodel?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.RETRY_START]: PiPayload<{\n\t\tattempt?: number;\n\t\tmaxAttempts?: number;\n\t\tdelayMs?: number;\n\t\terrorMessage?: string;\n\t\tmessage?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.RETRY_END]: PiPayload<{\n\t\tsuccess?: boolean;\n\t\tattempt?: number;\n\t\tfinalError?: string;\n\t\tmessage?: string;\n\t}>;\n\t[WS_PI_STREAM_TYPES.USAGE]: PiUsagePayload;\n\t[WS_PI_STREAM_TYPES.COMPACTION_START]: PiPayload<Record<string, unknown>>;\n\t[WS_PI_STREAM_TYPES.COMPACTION_END]: PiPayload<Record<string, unknown>>;\n\t[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TURN_STARTED];\n\t[WS_PRIMARY_PATH_TYPES.SUMMARY_UPDATED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.SUMMARY_UPDATED];\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL];\n\t[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.USAGE_UPDATED];\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED];\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED];\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED];\n\t[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED];\n\t[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: PrimaryPathPayloadByType[typeof WS_PRIMARY_PATH_TYPES.LABEL_CHANGED];\n\t[WS_PRIMARY_PATH_TYPES.CHANGED]: PrimaryPathTree;\n};\n\nexport const WS_FRAME_DURABILITY = {\n\thello: \"ephemeral\",\n\tpong: \"ephemeral\",\n\t\"process.created\": \"durable\",\n\t\"launch.updated\": \"durable\",\n\t\"process.updated\": \"durable\",\n\t\"process.deleted\": \"durable\",\n\t\"session_transfer.updated\": \"durable\",\n\t\"project.updated\": \"durable\",\n\t\"worker.state\": \"durable\",\n\t\"process.input.queued\": \"durable\",\n\t\"process.input.acknowledged\": \"durable\",\n\t\"process.event\": \"durable\",\n\t[WS_PROCESS_TYPES.TOAST]: \"ephemeral\",\n\t[WS_PROCESS_TYPES.FUTURE_UPDATED]: \"durable\",\n\t\"plan.updated\": \"durable\",\n\t\"review.updated\": \"durable\",\n\t[WS_PI_STREAM_TYPES.STARTED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.DELTA]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.COMPLETED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.TOOL_STARTED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.TOOL_COMPLETED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.LABEL_CHANGED]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.ERROR]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.RETRY_START]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.RETRY_END]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.USAGE]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.COMPACTION_START]: \"ephemeral\",\n\t[WS_PI_STREAM_TYPES.COMPACTION_END]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.TURN_STARTED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_PARTIAL]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.SUMMARY_UPDATED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.USAGE_UPDATED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.ASSISTANT_COMMITTED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_STARTED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.TOOL_CALL_COMPLETED]: \"ephemeral\",\n\t[WS_PRIMARY_PATH_TYPES.TURN_ANNOTATION_CHANGED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.LABEL_CHANGED]: \"durable\",\n\t[WS_PRIMARY_PATH_TYPES.CHANGED]: \"durable\",\n} as const satisfies Record<keyof WsPayloadByType, WsDurability>;\n\nexport type WsDurabilityByType = typeof WS_FRAME_DURABILITY;\nexport type KnownWsFrameType = keyof WsPayloadByType;\nexport type KnownDurableWsFrameType = {\n\t[K in KnownWsFrameType]: WsDurabilityByType[K] extends \"durable\" ? K : never;\n}[KnownWsFrameType];\nexport type KnownEphemeralWsFrameType = {\n\t[K in KnownWsFrameType]: WsDurabilityByType[K] extends \"ephemeral\" ? K : never;\n}[KnownWsFrameType];\nexport type WsFrameOfType<T extends KnownWsFrameType> = {\n\tprotocol: typeof WS_PROTOCOL_VERSION;\n\ttype: T;\n\tdurability: WsDurabilityByType[T];\n\tsentAt: string;\n\teventSequence?: number;\n\tinstanceId?: string;\n\tpayload: WsPayloadByType[T];\n};\ntype WsFrameInput<T extends KnownWsFrameType> = {\n\t[K in T]: Pick<WsFrameOfType<K>, \"type\" | \"instanceId\" | \"eventSequence\" | \"payload\">;\n}[T];\nexport type DurableWsFrameInput = WsFrameInput<KnownDurableWsFrameType>;\nexport type EphemeralWsFrameInput = WsFrameInput<KnownEphemeralWsFrameType>;\nexport type WsFrame = { [K in KnownWsFrameType]: WsFrameOfType<K> }[KnownWsFrameType];\nexport type PrimaryPathWsFrameType =\n\t(typeof WS_PRIMARY_PATH_TYPES)[keyof typeof WS_PRIMARY_PATH_TYPES];\nexport type PrimaryPathWsFrame = Extract<WsFrame, { type: PrimaryPathWsFrameType }>;\n\nconst KNOWN_WS_FRAME_TYPES = Object.keys(WS_FRAME_DURABILITY) as KnownWsFrameType[];\nconst PRIMARY_PATH_WS_FRAME_TYPES = Object.values(\n\tWS_PRIMARY_PATH_TYPES,\n) as PrimaryPathWsFrameType[];\nconst WS_FRAME_SCHEMA = v.looseObject({\n\tprotocol: v.literal(WS_PROTOCOL_VERSION),\n\ttype: v.picklist(KNOWN_WS_FRAME_TYPES),\n\tdurability: v.picklist([\"durable\", \"ephemeral\"] as const),\n\tsentAt: v.string(),\n\teventSequence: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))),\n\tinstanceId: v.optional(v.string()),\n\tpayload: unknownRecordSchema,\n});\n\nexport function parsePrimaryPathWsFrameInput(value: unknown): ParseResult<PrimaryPathWsFrame> {\n\tconst frame = parseWsFrame(value);\n\tif (!frame.ok) {\n\t\treturn frame;\n\t}\n\tconst type = parseLiteral(\n\t\tframe.value.type,\n\t\tPRIMARY_PATH_WS_FRAME_TYPES,\n\t\t\"primary_path ws frame.type\",\n\t);\n\tif (!type.ok) {\n\t\treturn type;\n\t}\n\tconst payload = parseSchema(\n\t\tPRIMARY_PATH_PAYLOAD_SCHEMAS[type.value],\n\t\tframe.value.payload,\n\t\t`primary_path ws frame.payload (${type.value})`,\n\t);\n\treturn payload.ok\n\t\t? ok({ ...frame.value, type: type.value, payload: payload.value } as PrimaryPathWsFrame)\n\t\t: payload;\n}\n\nexport function parseWsFrame(value: unknown): ParseResult<WsFrame> {\n\tconst frame = parseSchema(WS_FRAME_SCHEMA, value, \"ws frame\");\n\tif (!frame.ok) {\n\t\treturn frame;\n\t}\n\treturn frame.value.durability !== WS_FRAME_DURABILITY[frame.value.type]\n\t\t? err(\n\t\t\t\t`ws frame.durability must be '${WS_FRAME_DURABILITY[frame.value.type]}' for type '${frame.value.type}'`,\n\t\t\t)\n\t\t: ok(frame.value as WsFrame);\n}\n\nexport function createDurableWsFrame(\n\tinput: DurableWsFrameInput & { sentAt?: string; eventSequence?: number },\n): WsFrame {\n\treturn {\n\t\tprotocol: WS_PROTOCOL_VERSION,\n\t\ttype: input.type,\n\t\tdurability: \"durable\",\n\t\tsentAt: input.sentAt ?? new Date().toISOString(),\n\t\t...(input.eventSequence !== undefined ? { eventSequence: input.eventSequence } : {}),\n\t\t...(input.instanceId ? { instanceId: input.instanceId } : {}),\n\t\tpayload: input.payload,\n\t} as WsFrame;\n}\n\nexport function createEphemeralWsFrame(input: {\n\ttype: KnownEphemeralWsFrameType;\n\tinstanceId?: string;\n\tpayload: WsPayloadByType[KnownEphemeralWsFrameType];\n\tsentAt?: string;\n\teventSequence?: number;\n}): WsFrame {\n\treturn {\n\t\tprotocol: WS_PROTOCOL_VERSION,\n\t\ttype: input.type,\n\t\tdurability: \"ephemeral\",\n\t\tsentAt: input.sentAt ?? new Date().toISOString(),\n\t\t...(input.eventSequence !== undefined ? { eventSequence: input.eventSequence } : {}),\n\t\t...(input.instanceId ? { instanceId: input.instanceId } : {}),\n\t\tpayload: input.payload,\n\t} as WsFrame;\n}\n\nconst WORKER_TO_WS_TYPE: Record<StreamableWorkerEventType, string> = {\n\t\"pi.stream.delta\": WS_PI_STREAM_TYPES.DELTA,\n\t\"pi.turn.start\": WS_PI_STREAM_TYPES.STARTED,\n\t\"pi.turn.end\": WS_PI_STREAM_TYPES.COMPLETED,\n\t\"pi.tool.call\": WS_PI_STREAM_TYPES.TOOL_STARTED,\n\t\"pi.tool.result\": WS_PI_STREAM_TYPES.TOOL_COMPLETED,\n\t\"pi.label.changed\": WS_PI_STREAM_TYPES.LABEL_CHANGED,\n\t\"pi.error\": WS_PI_STREAM_TYPES.ERROR,\n\t\"pi.retry.start\": WS_PI_STREAM_TYPES.RETRY_START,\n\t\"pi.retry.end\": WS_PI_STREAM_TYPES.RETRY_END,\n\t\"pi.usage\": WS_PI_STREAM_TYPES.USAGE,\n\t\"pi.compaction.start\": WS_PI_STREAM_TYPES.COMPACTION_START,\n\t\"pi.compaction.end\": WS_PI_STREAM_TYPES.COMPACTION_END,\n};\n\nexport type RawPiDiagnosticWsFrameType =\n\t(typeof WS_PI_STREAM_TYPES)[keyof typeof WS_PI_STREAM_TYPES];\n\nexport function mapWorkerEventToWsType(workerEventType: string): RawPiDiagnosticWsFrameType | null {\n\treturn (\n\t\t((WORKER_TO_WS_TYPE as Partial<Record<string, string>>)[workerEventType] as\n\t\t\t| RawPiDiagnosticWsFrameType\n\t\t\t| undefined) ?? null\n\t);\n}\n"],"mappings":";AAAA;AAAA,EAEC;AAAA,EACA;AAAA,EACA;AAAA,OAKM;AACP,YAAY,OAAO;AAKZ,IAAM,KAAK,CAAI,WAA8B,EAAE,IAAI,MAAM,MAAM;AAC/D,IAAM,MAAM,CAAC,WAAuC,EAAE,IAAI,OAAO,MAAM;AACvE,IAAM,sBAAwB;AAAA,EACpC,CAAC,UACA,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAAA,EACpE;AACD;AACO,IAAM,uBAAyB,WAAW,SAAO,CAAC;AAClD,IAAM,+BAAiC,WAAS,oBAAoB;AAEpE,SAAS,YACf,QACA,OACA,SACsC;AACtC,QAAM,SAAW,YAAU,QAAQ,KAAK;AACxC,MAAI,OAAO,SAAS;AACnB,WAAO,GAAG,OAAO,MAAM;AAAA,EACxB;AACA,QAAM,QAAQ,OAAO,SAAS,CAAC;AAC/B,QAAM,SAAS,QAAQ,CAAC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A,EAClC,gBAAgB,mBAAmB;AAAA,EACnC,kBAAkB,mBAAmB;AAAA,EACrC,oBAAoB,mBAAmB;AAAA,EACvC,YAAY,mBAAmB;AAAA,EAC/B,kBAAkB,mBAAmB;AAAA,EACrC,gBAAgB,mBAAmB;AAAA,EACnC,YAAY,mBAAmB;AAAA,EAC/B,uBAAuB,mBAAmB;AAAA,EAC1C,qBAAqB,mBAAmB;AACzC;AAKO,SAAS,uBAAuB,iBAA4D;AAClG,SACG,kBAAsD,eAAe,KAEtD;AAEnB;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PrimaryPathActiveTurnSnapshot, PrimaryPathToolCallSnapshot } from "./primary-path-snapshot.js";
|
|
2
|
+
import { type UsageSnapshot } from "./usage-snapshot.js";
|
|
3
|
+
export declare const REASONING_PREVIEW_MAX_CHARS = 1024;
|
|
4
|
+
export interface CompactTurnSummary {
|
|
5
|
+
assistant: {
|
|
6
|
+
text: string;
|
|
7
|
+
thinking: string;
|
|
8
|
+
lastUpdatedAt: string | null;
|
|
9
|
+
};
|
|
10
|
+
currentTool: Pick<PrimaryPathToolCallSnapshot, "toolCallId" | "toolName" | "status" | "isError"> | null;
|
|
11
|
+
usage: UsageSnapshot | null;
|
|
12
|
+
toolCallCount: number;
|
|
13
|
+
traceItemCount: number;
|
|
14
|
+
/** The last persisted event incorporated into this projection. */
|
|
15
|
+
throughEventSequence: number;
|
|
16
|
+
lastTraceKind: "thinking" | "tool_call" | "operational_event" | null;
|
|
17
|
+
}
|
|
18
|
+
/** Initial-page state. It never contains trace items, tool arguments or results. */
|
|
19
|
+
export interface CompactActiveTurnSnapshot extends CompactTurnSummary, Pick<PrimaryPathActiveTurnSnapshot, "turnRecordId" | "turnId" | "turnType" | "pathType" | "startedAt"> {
|
|
20
|
+
summaryPending: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function emptyCompactTurnSummary(): CompactTurnSummary;
|
|
23
|
+
/** Retain paragraph context; wrapping and blank-line removal belong to the preview viewport. */
|
|
24
|
+
export declare function reasoningPreviewTail(text: string): string;
|
|
25
|
+
export declare function applyEventToCompactTurnSummary(previous: CompactTurnSummary, event: {
|
|
26
|
+
eventType: string;
|
|
27
|
+
data: Record<string, unknown>;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
eventSequence: number;
|
|
30
|
+
}): CompactTurnSummary;
|
|
31
|
+
//# sourceMappingURL=compact-turn-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact-turn-summary.d.ts","sourceRoot":"","sources":["../src/compact-turn-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGN,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5E,WAAW,EAAE,IAAI,CAChB,2BAA2B,EAC3B,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAChD,GAAG,IAAI,CAAC;IACT,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,UAAU,GAAG,WAAW,GAAG,mBAAmB,GAAG,IAAI,CAAC;CACrE;AAED,oFAAoF;AACpF,MAAM,WAAW,yBAChB,SAAQ,kBAAkB,EACzB,IAAI,CACH,6BAA6B,EAC7B,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CACjE;IACF,cAAc,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,uBAAuB,IAAI,kBAAkB,CAU5D;AAED,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE;IACN,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACtB,GACC,kBAAkB,CAgDpB"}
|
|
@@ -128,6 +128,8 @@ export interface ProcessConfigSnapshot {
|
|
|
128
128
|
* selection. Must reference a configured `worker_runtime_profiles` entry.
|
|
129
129
|
*/
|
|
130
130
|
worker_runtime_profile?: string;
|
|
131
|
+
/** Server-only process-volume capacity override, for example 128Mi or 1Gi. */
|
|
132
|
+
storage_size?: string;
|
|
131
133
|
pi?: ProcessPiConfigSnapshot;
|
|
132
134
|
turn_configs: Record<string, ProcessTurnConfigSnapshot>;
|
|
133
135
|
/** Extension-owned watcher configuration, keyed by code-defined watcher id. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-snapshot.d.ts","sourceRoot":"","sources":["../src/config-snapshot.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,6BAA6B;IAC7C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,6BAA6B,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACrC,WAAW,EAAE,MAAM,CAAC;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MAAM,WAAW,2BAA2B;IAC3C,GAAG,EAAE,iCAAiC,CAAC;IACvC,KAAK,EAAE,iCAAiC,CAAC;IACzC,KAAK,EAAE,+BAA+B,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,2BAA2B,CAAC;IACrC,EAAE,EAAE,gBAAgB,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;CAC9D"}
|
package/dist/config-snapshot.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import "./chunk-6L4W7WPV.js";
|
|
2
2
|
//# sourceMappingURL=config-snapshot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const leafOutcomeRendererDescriptorSchema: v.SchemaWithPipe<readonly [v.CustomSchema<Record<string, unknown>, undefined>, v.ObjectSchema<{
|
|
3
|
+
readonly ok: v.LiteralSchema<true, undefined>;
|
|
4
|
+
readonly rendererId: v.StringSchema<undefined>;
|
|
5
|
+
readonly kind: v.LiteralSchema<"custom_element", undefined>;
|
|
6
|
+
readonly tagName: v.StringSchema<undefined>;
|
|
7
|
+
readonly modulePath: v.StringSchema<undefined>;
|
|
8
|
+
readonly rendererApiVersion: v.CustomSchema<number, undefined>;
|
|
9
|
+
readonly extensionManifestId: v.StringSchema<undefined>;
|
|
10
|
+
readonly moduleUrl: v.StringSchema<undefined>;
|
|
11
|
+
}, undefined>]>;
|
|
12
|
+
export type LeafOutcomeRendererDescriptor = v.InferOutput<typeof leafOutcomeRendererDescriptorSchema>;
|
|
13
|
+
export declare const leafOutcomeRendererFailureSchema: v.SchemaWithPipe<readonly [v.CustomSchema<Record<string, unknown>, undefined>, v.ObjectSchema<{
|
|
14
|
+
readonly ok: v.LiteralSchema<false, undefined>;
|
|
15
|
+
readonly rendererId: v.StringSchema<undefined>;
|
|
16
|
+
readonly code: v.StringSchema<undefined>;
|
|
17
|
+
readonly message: v.StringSchema<undefined>;
|
|
18
|
+
}, undefined>]>;
|
|
19
|
+
export type LeafOutcomeRendererFailure = v.InferOutput<typeof leafOutcomeRendererFailureSchema>;
|
|
20
|
+
export declare const browserUiExtensionDescriptorSchema: v.SchemaWithPipe<readonly [v.CustomSchema<Record<string, unknown>, undefined>, v.ObjectSchema<{
|
|
21
|
+
readonly extensionManifestId: v.StringSchema<undefined>;
|
|
22
|
+
readonly modulePath: v.StringSchema<undefined>;
|
|
23
|
+
readonly moduleUrl: v.StringSchema<undefined>;
|
|
24
|
+
readonly browserApiVersion: v.CustomSchema<number, undefined>;
|
|
25
|
+
}, undefined>]>;
|
|
26
|
+
export type BrowserUiExtensionDescriptor = v.InferOutput<typeof browserUiExtensionDescriptorSchema>;
|
|
27
|
+
//# sourceMappingURL=extension-ui-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-ui-contracts.d.ts","sourceRoot":"","sources":["../src/extension-ui-contracts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAM7B,eAAO,MAAM,mCAAmC;;;;;;;;;eAY/C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,WAAW,CACxD,OAAO,mCAAmC,CAC1C,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;eAQ5C,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAEhG,eAAO,MAAM,kCAAkC;;;;;eAQ9C,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
|
package/dist/form-contract.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import "./chunk-AAV3AAOF.js";
|
|
2
2
|
//# sourceMappingURL=form-contract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|