effect-durable-agent-cloudflare 0.1.0-alpha.17 → 0.1.0-alpha.18

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.
@@ -1,68 +1,34 @@
1
- import { i as EDASessionControllerOptions, l as EDAWebSocketProjection } from "./session-controller-DC56lVYg.js";
2
- import { DurableObject } from "cloudflare:workers";
3
- import { DurableEventEnvelope } from "effect-durable-agent/types/events";
4
- import { CommittedCommandTerminalEvent, EDARuntimeConfig } from "effect-durable-agent/services/runtime";
1
+ import { a as SessionOutcomeInput, i as SessionGrantRunInput, n as SessionBlockInput, o as SessionScopedInput, r as SessionCommandInput, s as edaSessionRpc, t as SessionBatchInput } from "./rpc-spec-DZjBBd0T.js";
2
+ import { i as EDASessionControllerOptions, l as EDAWebSocketProjection } from "./session-controller-xdQPy0NX.js";
3
+ import * as Schema from "effect/Schema";
5
4
  import { CommittedDurableEvent } from "effect-durable-agent/services/session-store";
6
- import { DurableTranscriptMessage } from "effect-durable-agent/domain/message-transcript";
7
- import { EDASessionSnapshot } from "effect-durable-agent/services/session-query";
8
- import { RunGrantResult, RunRequestOutcome } from "effect-durable-agent/domain/run-scheduling";
5
+ import { EDARuntimeConfig } from "effect-durable-agent/services/runtime";
6
+ import { DurableObject } from "cloudflare:workers";
9
7
 
10
8
  //#region src/durable-object.d.ts
11
- /** Committed event envelope crossing the structured-clone RPC boundary. */
12
- type CommittedDurableEventValue = CommittedDurableEvent<DurableEventEnvelope>;
13
9
  /** Internal Worker-to-object header selecting an app-owned WebSocket projection. */
14
10
  declare const EDA_WEB_SOCKET_PROJECTION_HEADER = "x-eda-websocket-projection";
15
- /** Raw RPC shape decoded before admitting one session command. */
16
- interface EDASessionCommandRpcInput {
17
- readonly command: unknown;
18
- readonly sessionId: string;
19
- readonly trace: unknown;
20
- }
21
- /** Trusted Worker-to-object scheduler callback; never exposed as ordinary user ingress. */
22
- interface EDASessionGrantRunRpcInput {
23
- readonly command: unknown;
24
- readonly sessionId: string;
25
- readonly trace: unknown;
26
- }
27
- /** Raw RPC shape decoded before admitting a durable command/app-event batch. */
28
- interface EDASessionSubmitBatchRpcInput {
29
- readonly items: ReadonlyArray<unknown>;
30
- readonly sessionId: string;
31
- readonly trace: unknown;
32
- }
33
- /** Raw RPC shape for read/destroy operations that only need a session id. */
34
- interface EDASessionScopedRpcInput {
35
- readonly sessionId: string;
36
- readonly trace: unknown;
37
- }
38
- /** Raw RPC shape for WebSocket event-stream upgrades with a resume cursor. */
39
- interface EDASessionEventsRpcInput {
40
- readonly afterSeq?: number;
41
- readonly sessionId: string;
42
- readonly trace: unknown;
43
- }
44
- /** Raw RPC shape decoded before blocking on one command terminal event. */
45
- interface EDASessionBlockOnCommandRpcInput {
11
+ /** Encoded session RPC inputs, decoded before invoking the controller. */
12
+ type EDASessionCommandRpcInput = typeof SessionCommandInput.Encoded;
13
+ type EDASessionGrantRunRpcInput = typeof SessionGrantRunInput.Encoded;
14
+ type EDASessionSubmitBatchRpcInput = typeof SessionBatchInput.Encoded;
15
+ type EDASessionScopedRpcInput = typeof SessionScopedInput.Encoded;
16
+ type EDASessionEventsRpcInput = EDASessionScopedRpcInput & {
46
17
  readonly afterSeq?: number;
47
- readonly commandId: string;
48
- readonly sessionId: string;
49
- readonly trace: unknown;
50
- }
51
- /** Raw identity decoded at the trusted reconciliation RPC boundary. */
52
- interface EDASessionRunRequestOutcomeRpcInput extends EDASessionScopedRpcInput {
53
- readonly requestId: string;
54
- }
18
+ };
19
+ type EDASessionBlockOnCommandRpcInput = typeof SessionBlockInput.Encoded;
20
+ type EDASessionRunRequestOutcomeRpcInput = typeof SessionOutcomeInput.Encoded;
55
21
  /** EDA RPC methods required by the session namespace helper. */
56
22
  interface EDASessionRpcSurface {
57
- readonly runRequestOutcome: (input: EDASessionRunRequestOutcomeRpcInput) => Promise<RunRequestOutcome>;
58
- readonly grantRun: (input: EDASessionGrantRunRpcInput) => Promise<RunGrantResult>;
59
- readonly submit: (input: EDASessionCommandRpcInput) => Promise<CommittedDurableEventValue>;
60
- readonly submitBatch: (input: EDASessionSubmitBatchRpcInput) => Promise<ReadonlyArray<CommittedDurableEventValue>>;
61
- readonly submitAndBlock: (input: EDASessionCommandRpcInput) => Promise<CommittedCommandTerminalEvent>;
62
- readonly blockOnCommand: (input: EDASessionBlockOnCommandRpcInput) => Promise<CommittedCommandTerminalEvent>;
63
- readonly snapshot: (input: EDASessionScopedRpcInput) => Promise<EDASessionSnapshot>;
64
- readonly messages: (input: EDASessionScopedRpcInput) => Promise<ReadonlyArray<DurableTranscriptMessage>>;
65
- readonly destroySession: (input: EDASessionScopedRpcInput) => Promise<void>;
23
+ readonly runRequestOutcome: (input: EDASessionRunRequestOutcomeRpcInput) => Promise<typeof edaSessionRpc.runRequestOutcome.output.Encoded>;
24
+ readonly grantRun: (input: EDASessionGrantRunRpcInput) => Promise<typeof edaSessionRpc.grantRun.output.Encoded>;
25
+ readonly submit: (input: EDASessionCommandRpcInput) => Promise<typeof edaSessionRpc.submit.output.Encoded>;
26
+ readonly submitBatch: (input: EDASessionSubmitBatchRpcInput) => Promise<typeof edaSessionRpc.submitBatch.output.Encoded>;
27
+ readonly submitAndBlock: (input: EDASessionCommandRpcInput) => Promise<typeof edaSessionRpc.submitAndBlock.output.Encoded>;
28
+ readonly blockOnCommand: (input: EDASessionBlockOnCommandRpcInput) => Promise<typeof edaSessionRpc.blockOnCommand.output.Encoded>;
29
+ readonly snapshot: (input: EDASessionScopedRpcInput) => Promise<typeof edaSessionRpc.snapshot.output.Encoded>;
30
+ readonly messages: (input: EDASessionScopedRpcInput) => Promise<typeof edaSessionRpc.messages.output.Encoded>;
31
+ readonly destroySession: (input: EDASessionScopedRpcInput) => Promise<typeof edaSessionRpc.destroySession.output.Encoded>;
66
32
  }
67
33
  /** Constructor options for concrete app subclasses of the EDA Durable Object base. */
68
34
  type EDASessionDurableObjectOptions<ProjectionState extends object = never> = Omit<EDASessionControllerOptions<ProjectionState>, "background" | "getWebSockets" | "storage">;
@@ -80,20 +46,20 @@ declare abstract class EDASessionDurableObject<EnvType extends object = object,
80
46
  #private;
81
47
  protected constructor(ctx: DurableObjectState, env: EnvType, options: EDASessionDurableObjectOptions<ProjectionState>);
82
48
  fetch(request: Request): Promise<Response>;
83
- submit(input: EDASessionCommandRpcInput): Promise<CommittedDurableEventValue>;
49
+ submit(raw: typeof SessionCommandInput.Encoded): Promise<typeof edaSessionRpc.submit.output.Encoded>;
84
50
  /** Reconcile lost grant replies from durable request and run facts. */
85
- runRequestOutcome(input: EDASessionRunRequestOutcomeRpcInput): Promise<RunRequestOutcome>;
51
+ runRequestOutcome(raw: typeof SessionOutcomeInput.Encoded): Promise<typeof edaSessionRpc.runRequestOutcome.output.Encoded>;
86
52
  /** Trusted RPC only: the calling Worker owns scheduler authentication and authorization. */
87
- grantRun(input: EDASessionGrantRunRpcInput): Promise<RunGrantResult>;
88
- submitBatch(input: EDASessionSubmitBatchRpcInput): Promise<ReadonlyArray<CommittedDurableEventValue>>;
89
- submitAndBlock(input: EDASessionCommandRpcInput): Promise<CommittedCommandTerminalEvent>;
90
- blockOnCommand(input: EDASessionBlockOnCommandRpcInput): Promise<CommittedCommandTerminalEvent>;
91
- snapshot(input: EDASessionScopedRpcInput): Promise<EDASessionSnapshot>;
92
- messages(input: EDASessionScopedRpcInput): Promise<ReadonlyArray<DurableTranscriptMessage>>;
53
+ grantRun(raw: typeof SessionGrantRunInput.Encoded): Promise<typeof edaSessionRpc.grantRun.output.Encoded>;
54
+ submitBatch(raw: typeof SessionBatchInput.Encoded): Promise<typeof edaSessionRpc.submitBatch.output.Encoded>;
55
+ submitAndBlock(raw: typeof SessionCommandInput.Encoded): Promise<typeof edaSessionRpc.submitAndBlock.output.Encoded>;
56
+ blockOnCommand(raw: typeof SessionBlockInput.Encoded): Promise<typeof edaSessionRpc.blockOnCommand.output.Encoded>;
57
+ snapshot(raw: typeof SessionScopedInput.Encoded): Promise<typeof edaSessionRpc.snapshot.output.Encoded>;
58
+ messages(raw: typeof SessionScopedInput.Encoded): Promise<typeof edaSessionRpc.messages.output.Encoded>;
93
59
  webSocketMessage(webSocket: WebSocket, message: string | ArrayBuffer): Promise<void>;
94
60
  webSocketClose(webSocket: WebSocket, _code: number, _reason: string, _wasClean: boolean): Promise<void>;
95
61
  webSocketError(webSocket: WebSocket, _error: unknown): Promise<void>;
96
- destroySession(input: EDASessionScopedRpcInput): Promise<void>;
62
+ destroySession(raw: typeof SessionScopedInput.Encoded): Promise<typeof edaSessionRpc.destroySession.output.Encoded>;
97
63
  alarm(): Promise<void>;
98
64
  private parseSessionId;
99
65
  private sessionIdFromObjectName;
@@ -105,10 +71,2516 @@ declare const edaRuntimeConfig: (input: {
105
71
  readonly provider: string;
106
72
  readonly systemPrompt?: string;
107
73
  }) => EDARuntimeConfig;
108
- /** Encode committed events into structured-clone-safe Durable Object RPC payloads. */
109
- declare const encodeEdaRpcCommittedDurableEvent: (event: CommittedDurableEvent) => CommittedDurableEventValue;
110
- /** Encode runtime snapshots into structured-clone-safe Durable Object RPC payloads. */
111
- declare const encodeEdaRpcSessionSnapshot: (snapshot: EDASessionSnapshot) => EDASessionSnapshot;
74
+ /** Encode committed events into the existing structured-clone envelope. */
75
+ declare const encodeEdaRpcCommittedDurableEvent: (entry: CommittedDurableEvent) => typeof edaSessionRpc.submit.output.Encoded;
76
+ /** Encode query snapshots without asserting that encoded command values are decoded classes. */
77
+ declare const encodeEdaRpcSessionSnapshot: (input: {
78
+ readonly state: {
79
+ readonly messages: ReadonlyMap<string & import("effect/Brand").Brand<"MessageId">, {
80
+ readonly _tag: "System";
81
+ readonly content: string;
82
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
83
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
84
+ readonly createdAtMs?: number | undefined;
85
+ } | {
86
+ readonly _tag: "User";
87
+ readonly content: readonly [{
88
+ readonly type: "text";
89
+ readonly text: string;
90
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
91
+ readonly options: {
92
+ readonly [x: string]: Schema.Json;
93
+ };
94
+ }, ...{
95
+ readonly type: "text";
96
+ readonly text: string;
97
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
98
+ readonly options: {
99
+ readonly [x: string]: Schema.Json;
100
+ };
101
+ }[]] | readonly [{
102
+ readonly type: "text";
103
+ readonly text: string;
104
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
105
+ readonly options: {
106
+ readonly [x: string]: Schema.Json;
107
+ };
108
+ } | {
109
+ readonly type: "file";
110
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
111
+ readonly options: {
112
+ readonly [x: string]: Schema.Json;
113
+ };
114
+ readonly mediaType: string;
115
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
116
+ readonly fileName?: string | undefined;
117
+ }, ...({
118
+ readonly type: "text";
119
+ readonly text: string;
120
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
121
+ readonly options: {
122
+ readonly [x: string]: Schema.Json;
123
+ };
124
+ } | {
125
+ readonly type: "file";
126
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
127
+ readonly options: {
128
+ readonly [x: string]: Schema.Json;
129
+ };
130
+ readonly mediaType: string;
131
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
132
+ readonly fileName?: string | undefined;
133
+ })[]];
134
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
135
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
136
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
137
+ readonly createdAtMs?: number | undefined;
138
+ readonly disposition?: "queue" | "steer" | undefined;
139
+ readonly requestedDisposition?: "queue" | "steer" | undefined;
140
+ readonly cancellationReason?: string | undefined;
141
+ readonly cancelledByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
142
+ readonly cancelledSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
143
+ readonly consumedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
144
+ readonly consumedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
145
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
146
+ readonly pausedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
147
+ readonly promotedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
148
+ } | {
149
+ readonly _tag: "Steering";
150
+ readonly content: readonly [{
151
+ readonly type: "text";
152
+ readonly text: string;
153
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
154
+ readonly options: {
155
+ readonly [x: string]: Schema.Json;
156
+ };
157
+ }, ...{
158
+ readonly type: "text";
159
+ readonly text: string;
160
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
161
+ readonly options: {
162
+ readonly [x: string]: Schema.Json;
163
+ };
164
+ }[]] | readonly [{
165
+ readonly type: "text";
166
+ readonly text: string;
167
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
168
+ readonly options: {
169
+ readonly [x: string]: Schema.Json;
170
+ };
171
+ } | {
172
+ readonly type: "file";
173
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
174
+ readonly options: {
175
+ readonly [x: string]: Schema.Json;
176
+ };
177
+ readonly mediaType: string;
178
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
179
+ readonly fileName?: string | undefined;
180
+ }, ...({
181
+ readonly type: "text";
182
+ readonly text: string;
183
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
184
+ readonly options: {
185
+ readonly [x: string]: Schema.Json;
186
+ };
187
+ } | {
188
+ readonly type: "file";
189
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
190
+ readonly options: {
191
+ readonly [x: string]: Schema.Json;
192
+ };
193
+ readonly mediaType: string;
194
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
195
+ readonly fileName?: string | undefined;
196
+ })[]];
197
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
198
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
199
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
200
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
201
+ readonly createdAtMs?: number | undefined;
202
+ readonly cancellationReason?: string | undefined;
203
+ readonly cancelledByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
204
+ readonly cancelledSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
205
+ readonly consumedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
206
+ readonly consumedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
207
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
208
+ readonly pausedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
209
+ readonly promotedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
210
+ } | {
211
+ readonly _tag: "Assistant";
212
+ readonly content: {
213
+ readonly text: string;
214
+ readonly reasoning?: string | undefined;
215
+ };
216
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
217
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
218
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
219
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
220
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
221
+ readonly createdAtMs?: number | undefined;
222
+ readonly imported?: true | undefined;
223
+ readonly promptParts?: readonly ({
224
+ readonly type: "text";
225
+ readonly text: string;
226
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
227
+ readonly options: {
228
+ readonly [x: string]: Schema.Json;
229
+ };
230
+ } | {
231
+ readonly type: "file";
232
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
233
+ readonly options: {
234
+ readonly [x: string]: Schema.Json;
235
+ };
236
+ readonly mediaType: string;
237
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
238
+ readonly fileName?: string | undefined;
239
+ } | {
240
+ readonly type: "reasoning";
241
+ readonly text: string;
242
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
243
+ readonly options: {
244
+ readonly [x: string]: Schema.Json;
245
+ };
246
+ } | {
247
+ readonly type: "tool-call";
248
+ readonly id: string;
249
+ readonly name: string;
250
+ readonly params: unknown;
251
+ readonly providerExecuted: boolean;
252
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
253
+ readonly options: {
254
+ readonly [x: string]: Schema.Json;
255
+ };
256
+ } | {
257
+ readonly type: "tool-result";
258
+ readonly id: string;
259
+ readonly name: string;
260
+ readonly isFailure: boolean;
261
+ readonly result: unknown;
262
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
263
+ readonly options: {
264
+ readonly [x: string]: Schema.Json;
265
+ };
266
+ } | {
267
+ readonly type: "tool-approval-request";
268
+ readonly approvalId: string;
269
+ readonly toolCallId: string;
270
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
271
+ readonly options: {
272
+ readonly [x: string]: Schema.Json;
273
+ };
274
+ })[] | undefined;
275
+ } | {
276
+ readonly _tag: "AssistantPartial";
277
+ readonly content: {
278
+ readonly text: string;
279
+ readonly reasoning?: string | undefined;
280
+ };
281
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
282
+ readonly reason: string;
283
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
284
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
285
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
286
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
287
+ readonly createdAtMs?: number | undefined;
288
+ readonly promptParts?: readonly ({
289
+ readonly type: "text";
290
+ readonly text: string;
291
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
292
+ readonly options: {
293
+ readonly [x: string]: Schema.Json;
294
+ };
295
+ } | {
296
+ readonly type: "file";
297
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
298
+ readonly options: {
299
+ readonly [x: string]: Schema.Json;
300
+ };
301
+ readonly mediaType: string;
302
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
303
+ readonly fileName?: string | undefined;
304
+ } | {
305
+ readonly type: "reasoning";
306
+ readonly text: string;
307
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
308
+ readonly options: {
309
+ readonly [x: string]: Schema.Json;
310
+ };
311
+ } | {
312
+ readonly type: "tool-call";
313
+ readonly id: string;
314
+ readonly name: string;
315
+ readonly params: unknown;
316
+ readonly providerExecuted: boolean;
317
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
318
+ readonly options: {
319
+ readonly [x: string]: Schema.Json;
320
+ };
321
+ } | {
322
+ readonly type: "tool-result";
323
+ readonly id: string;
324
+ readonly name: string;
325
+ readonly isFailure: boolean;
326
+ readonly result: unknown;
327
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
328
+ readonly options: {
329
+ readonly [x: string]: Schema.Json;
330
+ };
331
+ } | {
332
+ readonly type: "tool-approval-request";
333
+ readonly approvalId: string;
334
+ readonly toolCallId: string;
335
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
336
+ readonly options: {
337
+ readonly [x: string]: Schema.Json;
338
+ };
339
+ })[] | undefined;
340
+ }>;
341
+ readonly lastSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
342
+ readonly commands: ReadonlyMap<string & import("effect/Brand").Brand<"CommandId">, {
343
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
344
+ readonly command?: import("effect-durable-agent/types/commands").SubmitMessageCommand | import("effect-durable-agent/types/commands").StopTurnCommand | import("effect-durable-agent/types/commands").CancelPendingMessageCommand | import("effect-durable-agent/types/commands").PromotePendingMessageCommand | import("effect-durable-agent/types/commands").ResumePendingMessagesCommand | undefined;
345
+ readonly admittedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
346
+ readonly admissionTrace?: {
347
+ readonly span: {
348
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
349
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
350
+ readonly sampled: boolean;
351
+ readonly tracestate: string | null;
352
+ };
353
+ readonly links: readonly {
354
+ readonly context: {
355
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
356
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
357
+ readonly sampled: boolean;
358
+ readonly tracestate: string | null;
359
+ };
360
+ readonly attributes: {
361
+ readonly [x: string]: string | number | boolean;
362
+ };
363
+ }[];
364
+ } | undefined;
365
+ readonly startedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
366
+ readonly terminal?: {
367
+ readonly _tag: "Completed";
368
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
369
+ } | {
370
+ readonly _tag: "Failed";
371
+ readonly error: {
372
+ readonly message: string;
373
+ readonly code?: string | undefined;
374
+ readonly details?: unknown;
375
+ };
376
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
377
+ } | {
378
+ readonly _tag: "Cancelled";
379
+ readonly reason: string;
380
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
381
+ } | undefined;
382
+ }>;
383
+ readonly runs: ReadonlyMap<string & import("effect/Brand").Brand<"RunId">, {
384
+ readonly trace: {
385
+ readonly root: {
386
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
387
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
388
+ readonly sampled: boolean;
389
+ readonly tracestate: string | null;
390
+ };
391
+ readonly links: readonly {
392
+ readonly context: {
393
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
394
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
395
+ readonly sampled: boolean;
396
+ readonly tracestate: string | null;
397
+ };
398
+ readonly attributes: {
399
+ readonly [x: string]: string | number | boolean;
400
+ };
401
+ }[];
402
+ };
403
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
404
+ readonly startedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
405
+ readonly commandIds: readonly (string & import("effect/Brand").Brand<"CommandId">)[];
406
+ readonly modelSelection?: {
407
+ readonly provider: string;
408
+ readonly modelId: string;
409
+ readonly settings?: unknown;
410
+ } | undefined;
411
+ readonly terminal?: {
412
+ readonly _tag: "Completed";
413
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
414
+ } | {
415
+ readonly _tag: "Failed";
416
+ readonly error: {
417
+ readonly message: string;
418
+ readonly code?: string | undefined;
419
+ readonly details?: unknown;
420
+ };
421
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
422
+ } | {
423
+ readonly _tag: "Interrupted";
424
+ readonly reason: string;
425
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
426
+ } | undefined;
427
+ readonly durationMs?: number | undefined;
428
+ readonly startedAtMs?: number | undefined;
429
+ readonly terminalAtMs?: number | undefined;
430
+ }>;
431
+ readonly recoveryContinuations: ReadonlyMap<string & import("effect/Brand").Brand<"RunId">, {
432
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
433
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
434
+ readonly interruptedRunId: string & import("effect/Brand").Brand<"RunId">;
435
+ readonly replacementRunId: string & import("effect/Brand").Brand<"RunId">;
436
+ }>;
437
+ readonly turns: ReadonlyMap<string & import("effect/Brand").Brand<"TurnId">, {
438
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
439
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
440
+ readonly startedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
441
+ readonly terminal?: {
442
+ readonly _tag: "Completed";
443
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
444
+ readonly usage?: {
445
+ readonly inputTokens?: number | undefined;
446
+ readonly cachedInputTokens?: number | undefined;
447
+ readonly cacheWriteInputTokens?: number | undefined;
448
+ readonly outputTokens?: number | undefined;
449
+ readonly textTokens?: number | undefined;
450
+ readonly reasoningTokens?: number | undefined;
451
+ } | undefined;
452
+ } | {
453
+ readonly _tag: "Failed";
454
+ readonly error: {
455
+ readonly message: string;
456
+ readonly code?: string | undefined;
457
+ readonly details?: unknown;
458
+ };
459
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
460
+ } | {
461
+ readonly _tag: "Stopped";
462
+ readonly reason: string;
463
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
464
+ } | undefined;
465
+ readonly durationMs?: number | undefined;
466
+ readonly startedAtMs?: number | undefined;
467
+ readonly terminalAtMs?: number | undefined;
468
+ }>;
469
+ readonly inferences: ReadonlyMap<string & import("effect/Brand").Brand<"InferenceId">, {
470
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
471
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
472
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
473
+ readonly startedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
474
+ readonly terminal?: {
475
+ readonly _tag: "Completed";
476
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
477
+ readonly usage?: {
478
+ readonly inputTokens?: number | undefined;
479
+ readonly cachedInputTokens?: number | undefined;
480
+ readonly cacheWriteInputTokens?: number | undefined;
481
+ readonly outputTokens?: number | undefined;
482
+ readonly textTokens?: number | undefined;
483
+ readonly reasoningTokens?: number | undefined;
484
+ } | undefined;
485
+ } | {
486
+ readonly _tag: "Failed";
487
+ readonly error: {
488
+ readonly message: string;
489
+ readonly code?: string | undefined;
490
+ readonly details?: unknown;
491
+ };
492
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
493
+ } | undefined;
494
+ readonly durationMs?: number | undefined;
495
+ readonly startedAtMs?: number | undefined;
496
+ readonly terminalAtMs?: number | undefined;
497
+ }>;
498
+ readonly toolCalls: ReadonlyMap<string & import("effect/Brand").Brand<"ToolCallId">, {
499
+ readonly toolCallId: string & import("effect/Brand").Brand<"ToolCallId">;
500
+ readonly startedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
501
+ readonly terminal?: {
502
+ readonly _tag: "Completed";
503
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
504
+ readonly result: unknown;
505
+ readonly promptPart?: {
506
+ readonly type: "tool-result";
507
+ readonly id: string;
508
+ readonly name: string;
509
+ readonly isFailure: boolean;
510
+ readonly result: unknown;
511
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
512
+ readonly options: {
513
+ readonly [x: string]: Schema.Json;
514
+ };
515
+ } | undefined;
516
+ } | {
517
+ readonly _tag: "Failed";
518
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
519
+ readonly error: {
520
+ readonly message: string;
521
+ readonly code?: string | undefined;
522
+ readonly details?: unknown;
523
+ };
524
+ readonly promptPart?: {
525
+ readonly type: "tool-result";
526
+ readonly id: string;
527
+ readonly name: string;
528
+ readonly isFailure: boolean;
529
+ readonly result: unknown;
530
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
531
+ readonly options: {
532
+ readonly [x: string]: Schema.Json;
533
+ };
534
+ } | undefined;
535
+ } | undefined;
536
+ readonly durationMs?: number | undefined;
537
+ readonly startedAtMs?: number | undefined;
538
+ readonly terminalAtMs?: number | undefined;
539
+ readonly decision?: {
540
+ readonly _tag: "Created";
541
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
542
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
543
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
544
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
545
+ readonly params: unknown;
546
+ readonly providerExecuted: boolean;
547
+ readonly providerPartId: string & import("effect/Brand").Brand<"ProviderPartId">;
548
+ readonly toolName: string;
549
+ readonly promptPart?: {
550
+ readonly type: "tool-call";
551
+ readonly id: string;
552
+ readonly name: string;
553
+ readonly params: unknown;
554
+ readonly providerExecuted: boolean;
555
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
556
+ readonly options: {
557
+ readonly [x: string]: Schema.Json;
558
+ };
559
+ } | undefined;
560
+ } | {
561
+ readonly _tag: "Rejected";
562
+ readonly reason: "unknown-tool" | "invalid-params";
563
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
564
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
565
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
566
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
567
+ readonly providerPartId: string & import("effect/Brand").Brand<"ProviderPartId">;
568
+ readonly toolName: string;
569
+ readonly modelFeedback: string;
570
+ readonly promptPart?: {
571
+ readonly type: "tool-result";
572
+ readonly id: string;
573
+ readonly name: string;
574
+ readonly isFailure: boolean;
575
+ readonly result: unknown;
576
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
577
+ readonly options: {
578
+ readonly [x: string]: Schema.Json;
579
+ };
580
+ } | undefined;
581
+ } | undefined;
582
+ }>;
583
+ readonly stopRequests: ReadonlyMap<string & import("effect/Brand").Brand<"CommandId">, {
584
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
585
+ readonly requestedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
586
+ readonly requestedRunId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
587
+ readonly requestedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
588
+ readonly appliedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
589
+ readonly appliedRunId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
590
+ readonly appliedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
591
+ readonly appliedInferenceId?: (string & import("effect/Brand").Brand<"InferenceId">) | undefined;
592
+ }>;
593
+ readonly compactions: ReadonlyMap<string & import("effect/Brand").Brand<"CompactionId">, {
594
+ readonly compactionId: string & import("effect/Brand").Brand<"CompactionId">;
595
+ readonly requestedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
596
+ readonly startedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
597
+ readonly terminal?: {
598
+ readonly _tag: "Completed";
599
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
600
+ } | {
601
+ readonly _tag: "Failed";
602
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
603
+ readonly error: {
604
+ readonly message: string;
605
+ readonly code?: string | undefined;
606
+ readonly details?: unknown;
607
+ };
608
+ } | undefined;
609
+ readonly summaryCreatedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
610
+ readonly summaryId?: (string & import("effect/Brand").Brand<"SummaryId">) | undefined;
611
+ readonly sourceFromSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
612
+ readonly sourceToSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
613
+ readonly rebasedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
614
+ readonly contextVersion?: (number & import("effect/Brand").Brand<"ContextVersion">) | undefined;
615
+ }>;
616
+ readonly context: {
617
+ readonly version: number & import("effect/Brand").Brand<"ContextVersion">;
618
+ readonly currentSummaryId?: (string & import("effect/Brand").Brand<"SummaryId">) | undefined;
619
+ };
620
+ readonly tokenConsumption: {
621
+ readonly byModel: readonly {
622
+ readonly provider: string;
623
+ readonly modelId: string;
624
+ readonly usage: {
625
+ readonly inputTokens: number;
626
+ readonly cachedInputTokens: number;
627
+ readonly cacheWriteInputTokens: number;
628
+ readonly outputTokens: number;
629
+ readonly textTokens: number;
630
+ readonly reasoningTokens: number;
631
+ };
632
+ }[];
633
+ };
634
+ readonly commandQueues: {
635
+ readonly pendingCommands: readonly {
636
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
637
+ readonly command: import("effect-durable-agent/types/commands").SubmitMessageCommand | import("effect-durable-agent/types/commands").StopTurnCommand | import("effect-durable-agent/types/commands").CancelPendingMessageCommand | import("effect-durable-agent/types/commands").PromotePendingMessageCommand | import("effect-durable-agent/types/commands").ResumePendingMessagesCommand;
638
+ readonly admittedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
639
+ readonly admissionTrace?: {
640
+ readonly span: {
641
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
642
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
643
+ readonly sampled: boolean;
644
+ readonly tracestate: string | null;
645
+ };
646
+ readonly links: readonly {
647
+ readonly context: {
648
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
649
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
650
+ readonly sampled: boolean;
651
+ readonly tracestate: string | null;
652
+ };
653
+ readonly attributes: {
654
+ readonly [x: string]: string | number | boolean;
655
+ };
656
+ }[];
657
+ } | undefined;
658
+ }[];
659
+ readonly queuedCommands: readonly {
660
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
661
+ readonly command: import("effect-durable-agent/types/commands").SubmitMessageCommand | import("effect-durable-agent/types/commands").StopTurnCommand | import("effect-durable-agent/types/commands").CancelPendingMessageCommand | import("effect-durable-agent/types/commands").PromotePendingMessageCommand | import("effect-durable-agent/types/commands").ResumePendingMessagesCommand;
662
+ readonly admittedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
663
+ readonly admissionTrace?: {
664
+ readonly span: {
665
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
666
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
667
+ readonly sampled: boolean;
668
+ readonly tracestate: string | null;
669
+ };
670
+ readonly links: readonly {
671
+ readonly context: {
672
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
673
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
674
+ readonly sampled: boolean;
675
+ readonly tracestate: string | null;
676
+ };
677
+ readonly attributes: {
678
+ readonly [x: string]: string | number | boolean;
679
+ };
680
+ }[];
681
+ } | undefined;
682
+ }[];
683
+ readonly activeControlCommands: readonly {
684
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
685
+ readonly command: import("effect-durable-agent/types/commands").SubmitMessageCommand | import("effect-durable-agent/types/commands").StopTurnCommand | import("effect-durable-agent/types/commands").CancelPendingMessageCommand | import("effect-durable-agent/types/commands").PromotePendingMessageCommand | import("effect-durable-agent/types/commands").ResumePendingMessagesCommand;
686
+ readonly admittedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
687
+ readonly admissionTrace?: {
688
+ readonly span: {
689
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
690
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
691
+ readonly sampled: boolean;
692
+ readonly tracestate: string | null;
693
+ };
694
+ readonly links: readonly {
695
+ readonly context: {
696
+ readonly traceId: string & import("effect/Brand").Brand<"EDATraceId">;
697
+ readonly spanId: string & import("effect/Brand").Brand<"EDASpanId">;
698
+ readonly sampled: boolean;
699
+ readonly tracestate: string | null;
700
+ };
701
+ readonly attributes: {
702
+ readonly [x: string]: string | number | boolean;
703
+ };
704
+ }[];
705
+ } | undefined;
706
+ }[];
707
+ readonly steeringByRun: ReadonlyMap<string & import("effect/Brand").Brand<"RunId">, readonly {
708
+ readonly content: readonly [{
709
+ readonly type: "text";
710
+ readonly text: string;
711
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
712
+ readonly options: {
713
+ readonly [x: string]: Schema.Json;
714
+ };
715
+ }, ...{
716
+ readonly type: "text";
717
+ readonly text: string;
718
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
719
+ readonly options: {
720
+ readonly [x: string]: Schema.Json;
721
+ };
722
+ }[]] | readonly [{
723
+ readonly type: "text";
724
+ readonly text: string;
725
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
726
+ readonly options: {
727
+ readonly [x: string]: Schema.Json;
728
+ };
729
+ } | {
730
+ readonly type: "file";
731
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
732
+ readonly options: {
733
+ readonly [x: string]: Schema.Json;
734
+ };
735
+ readonly mediaType: string;
736
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
737
+ readonly fileName?: string | undefined;
738
+ }, ...({
739
+ readonly type: "text";
740
+ readonly text: string;
741
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
742
+ readonly options: {
743
+ readonly [x: string]: Schema.Json;
744
+ };
745
+ } | {
746
+ readonly type: "file";
747
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
748
+ readonly options: {
749
+ readonly [x: string]: Schema.Json;
750
+ };
751
+ readonly mediaType: string;
752
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
753
+ readonly fileName?: string | undefined;
754
+ })[]];
755
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
756
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
757
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
758
+ readonly queuedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
759
+ readonly consumedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
760
+ readonly consumedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
761
+ }[]>;
762
+ readonly pendingQueue: readonly {
763
+ readonly disposition: "queue" | "steer";
764
+ readonly content: readonly [{
765
+ readonly type: "text";
766
+ readonly text: string;
767
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
768
+ readonly options: {
769
+ readonly [x: string]: Schema.Json;
770
+ };
771
+ }, ...{
772
+ readonly type: "text";
773
+ readonly text: string;
774
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
775
+ readonly options: {
776
+ readonly [x: string]: Schema.Json;
777
+ };
778
+ }[]] | readonly [{
779
+ readonly type: "text";
780
+ readonly text: string;
781
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
782
+ readonly options: {
783
+ readonly [x: string]: Schema.Json;
784
+ };
785
+ } | {
786
+ readonly type: "file";
787
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
788
+ readonly options: {
789
+ readonly [x: string]: Schema.Json;
790
+ };
791
+ readonly mediaType: string;
792
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
793
+ readonly fileName?: string | undefined;
794
+ }, ...({
795
+ readonly type: "text";
796
+ readonly text: string;
797
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
798
+ readonly options: {
799
+ readonly [x: string]: Schema.Json;
800
+ };
801
+ } | {
802
+ readonly type: "file";
803
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
804
+ readonly options: {
805
+ readonly [x: string]: Schema.Json;
806
+ };
807
+ readonly mediaType: string;
808
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
809
+ readonly fileName?: string | undefined;
810
+ })[]];
811
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
812
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
813
+ readonly submittedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
814
+ readonly effectiveSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
815
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
816
+ readonly targetRunId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
817
+ }[];
818
+ readonly pendingSteers: readonly {
819
+ readonly disposition: "queue" | "steer";
820
+ readonly content: readonly [{
821
+ readonly type: "text";
822
+ readonly text: string;
823
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
824
+ readonly options: {
825
+ readonly [x: string]: Schema.Json;
826
+ };
827
+ }, ...{
828
+ readonly type: "text";
829
+ readonly text: string;
830
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
831
+ readonly options: {
832
+ readonly [x: string]: Schema.Json;
833
+ };
834
+ }[]] | readonly [{
835
+ readonly type: "text";
836
+ readonly text: string;
837
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
838
+ readonly options: {
839
+ readonly [x: string]: Schema.Json;
840
+ };
841
+ } | {
842
+ readonly type: "file";
843
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
844
+ readonly options: {
845
+ readonly [x: string]: Schema.Json;
846
+ };
847
+ readonly mediaType: string;
848
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
849
+ readonly fileName?: string | undefined;
850
+ }, ...({
851
+ readonly type: "text";
852
+ readonly text: string;
853
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
854
+ readonly options: {
855
+ readonly [x: string]: Schema.Json;
856
+ };
857
+ } | {
858
+ readonly type: "file";
859
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
860
+ readonly options: {
861
+ readonly [x: string]: Schema.Json;
862
+ };
863
+ readonly mediaType: string;
864
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
865
+ readonly fileName?: string | undefined;
866
+ })[]];
867
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
868
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
869
+ readonly submittedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
870
+ readonly effectiveSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
871
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
872
+ readonly targetRunId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
873
+ }[];
874
+ readonly pausedQueue: readonly {
875
+ readonly disposition: "queue" | "steer";
876
+ readonly content: readonly [{
877
+ readonly type: "text";
878
+ readonly text: string;
879
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
880
+ readonly options: {
881
+ readonly [x: string]: Schema.Json;
882
+ };
883
+ }, ...{
884
+ readonly type: "text";
885
+ readonly text: string;
886
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
887
+ readonly options: {
888
+ readonly [x: string]: Schema.Json;
889
+ };
890
+ }[]] | readonly [{
891
+ readonly type: "text";
892
+ readonly text: string;
893
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
894
+ readonly options: {
895
+ readonly [x: string]: Schema.Json;
896
+ };
897
+ } | {
898
+ readonly type: "file";
899
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
900
+ readonly options: {
901
+ readonly [x: string]: Schema.Json;
902
+ };
903
+ readonly mediaType: string;
904
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
905
+ readonly fileName?: string | undefined;
906
+ }, ...({
907
+ readonly type: "text";
908
+ readonly text: string;
909
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
910
+ readonly options: {
911
+ readonly [x: string]: Schema.Json;
912
+ };
913
+ } | {
914
+ readonly type: "file";
915
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
916
+ readonly options: {
917
+ readonly [x: string]: Schema.Json;
918
+ };
919
+ readonly mediaType: string;
920
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
921
+ readonly fileName?: string | undefined;
922
+ })[]];
923
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
924
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
925
+ readonly submittedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
926
+ readonly effectiveSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
927
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
928
+ readonly targetRunId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
929
+ }[];
930
+ readonly active?: {
931
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
932
+ readonly runId?: (string & import("effect/Brand").Brand<"RunId">) | undefined;
933
+ } | undefined;
934
+ };
935
+ readonly modelSelection?: {
936
+ readonly provider: string;
937
+ readonly modelId: string;
938
+ readonly settings?: unknown;
939
+ } | undefined;
940
+ readonly runSchedulingRequest?: {
941
+ readonly requestId: string & import("effect/Brand").Brand<"RunRequestId">;
942
+ readonly requestedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
943
+ readonly work: {
944
+ readonly _tag: "Command";
945
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
946
+ } | {
947
+ readonly _tag: "Recovery";
948
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
949
+ readonly interruptedRunId: string & import("effect/Brand").Brand<"RunId">;
950
+ readonly inputMessageIds: readonly (string & import("effect/Brand").Brand<"MessageId">)[];
951
+ };
952
+ readonly deliveredSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
953
+ } | undefined;
954
+ };
955
+ readonly reducerStates: ReadonlyMap<string, unknown>;
956
+ readonly messages: readonly ({
957
+ readonly _tag: "User";
958
+ readonly content: readonly [{
959
+ readonly type: "text";
960
+ readonly text: string;
961
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
962
+ readonly options: {
963
+ readonly [x: string]: Schema.Json;
964
+ };
965
+ }, ...{
966
+ readonly type: "text";
967
+ readonly text: string;
968
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
969
+ readonly options: {
970
+ readonly [x: string]: Schema.Json;
971
+ };
972
+ }[]] | readonly [{
973
+ readonly type: "text";
974
+ readonly text: string;
975
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
976
+ readonly options: {
977
+ readonly [x: string]: Schema.Json;
978
+ };
979
+ } | {
980
+ readonly type: "file";
981
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
982
+ readonly options: {
983
+ readonly [x: string]: Schema.Json;
984
+ };
985
+ readonly mediaType: string;
986
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
987
+ readonly fileName?: string | undefined;
988
+ }, ...({
989
+ readonly type: "text";
990
+ readonly text: string;
991
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
992
+ readonly options: {
993
+ readonly [x: string]: Schema.Json;
994
+ };
995
+ } | {
996
+ readonly type: "file";
997
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
998
+ readonly options: {
999
+ readonly [x: string]: Schema.Json;
1000
+ };
1001
+ readonly mediaType: string;
1002
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1003
+ readonly fileName?: string | undefined;
1004
+ })[]];
1005
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
1006
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
1007
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1008
+ readonly createdAtMs?: number | undefined;
1009
+ readonly disposition?: "queue" | "steer" | undefined;
1010
+ readonly requestedDisposition?: "queue" | "steer" | undefined;
1011
+ readonly cancellationReason?: string | undefined;
1012
+ readonly cancelledByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
1013
+ readonly cancelledSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1014
+ readonly consumedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1015
+ readonly consumedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
1016
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
1017
+ readonly pausedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1018
+ readonly promotedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1019
+ } | {
1020
+ readonly _tag: "Assistant";
1021
+ readonly content: {
1022
+ readonly text: string;
1023
+ readonly reasoning?: string | undefined;
1024
+ };
1025
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
1026
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1027
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
1028
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
1029
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
1030
+ readonly createdAtMs?: number | undefined;
1031
+ readonly imported?: true | undefined;
1032
+ readonly promptParts?: readonly ({
1033
+ readonly type: "text";
1034
+ readonly text: string;
1035
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1036
+ readonly options: {
1037
+ readonly [x: string]: Schema.Json;
1038
+ };
1039
+ } | {
1040
+ readonly type: "file";
1041
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1042
+ readonly options: {
1043
+ readonly [x: string]: Schema.Json;
1044
+ };
1045
+ readonly mediaType: string;
1046
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1047
+ readonly fileName?: string | undefined;
1048
+ } | {
1049
+ readonly type: "reasoning";
1050
+ readonly text: string;
1051
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1052
+ readonly options: {
1053
+ readonly [x: string]: Schema.Json;
1054
+ };
1055
+ } | {
1056
+ readonly type: "tool-call";
1057
+ readonly id: string;
1058
+ readonly name: string;
1059
+ readonly params: unknown;
1060
+ readonly providerExecuted: boolean;
1061
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1062
+ readonly options: {
1063
+ readonly [x: string]: Schema.Json;
1064
+ };
1065
+ } | {
1066
+ readonly type: "tool-result";
1067
+ readonly id: string;
1068
+ readonly name: string;
1069
+ readonly isFailure: boolean;
1070
+ readonly result: unknown;
1071
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1072
+ readonly options: {
1073
+ readonly [x: string]: Schema.Json;
1074
+ };
1075
+ } | {
1076
+ readonly type: "tool-approval-request";
1077
+ readonly approvalId: string;
1078
+ readonly toolCallId: string;
1079
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1080
+ readonly options: {
1081
+ readonly [x: string]: Schema.Json;
1082
+ };
1083
+ })[] | undefined;
1084
+ } | {
1085
+ readonly _tag: "AssistantPartial";
1086
+ readonly content: {
1087
+ readonly text: string;
1088
+ readonly reasoning?: string | undefined;
1089
+ };
1090
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
1091
+ readonly reason: string;
1092
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1093
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
1094
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
1095
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
1096
+ readonly createdAtMs?: number | undefined;
1097
+ readonly promptParts?: readonly ({
1098
+ readonly type: "text";
1099
+ readonly text: string;
1100
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1101
+ readonly options: {
1102
+ readonly [x: string]: Schema.Json;
1103
+ };
1104
+ } | {
1105
+ readonly type: "file";
1106
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1107
+ readonly options: {
1108
+ readonly [x: string]: Schema.Json;
1109
+ };
1110
+ readonly mediaType: string;
1111
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1112
+ readonly fileName?: string | undefined;
1113
+ } | {
1114
+ readonly type: "reasoning";
1115
+ readonly text: string;
1116
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1117
+ readonly options: {
1118
+ readonly [x: string]: Schema.Json;
1119
+ };
1120
+ } | {
1121
+ readonly type: "tool-call";
1122
+ readonly id: string;
1123
+ readonly name: string;
1124
+ readonly params: unknown;
1125
+ readonly providerExecuted: boolean;
1126
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1127
+ readonly options: {
1128
+ readonly [x: string]: Schema.Json;
1129
+ };
1130
+ } | {
1131
+ readonly type: "tool-result";
1132
+ readonly id: string;
1133
+ readonly name: string;
1134
+ readonly isFailure: boolean;
1135
+ readonly result: unknown;
1136
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1137
+ readonly options: {
1138
+ readonly [x: string]: Schema.Json;
1139
+ };
1140
+ } | {
1141
+ readonly type: "tool-approval-request";
1142
+ readonly approvalId: string;
1143
+ readonly toolCallId: string;
1144
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1145
+ readonly options: {
1146
+ readonly [x: string]: Schema.Json;
1147
+ };
1148
+ })[] | undefined;
1149
+ } | {
1150
+ readonly _tag: "Steering";
1151
+ readonly content: readonly [{
1152
+ readonly type: "text";
1153
+ readonly text: string;
1154
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1155
+ readonly options: {
1156
+ readonly [x: string]: Schema.Json;
1157
+ };
1158
+ }, ...{
1159
+ readonly type: "text";
1160
+ readonly text: string;
1161
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1162
+ readonly options: {
1163
+ readonly [x: string]: Schema.Json;
1164
+ };
1165
+ }[]] | readonly [{
1166
+ readonly type: "text";
1167
+ readonly text: string;
1168
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1169
+ readonly options: {
1170
+ readonly [x: string]: Schema.Json;
1171
+ };
1172
+ } | {
1173
+ readonly type: "file";
1174
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1175
+ readonly options: {
1176
+ readonly [x: string]: Schema.Json;
1177
+ };
1178
+ readonly mediaType: string;
1179
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1180
+ readonly fileName?: string | undefined;
1181
+ }, ...({
1182
+ readonly type: "text";
1183
+ readonly text: string;
1184
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1185
+ readonly options: {
1186
+ readonly [x: string]: Schema.Json;
1187
+ };
1188
+ } | {
1189
+ readonly type: "file";
1190
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1191
+ readonly options: {
1192
+ readonly [x: string]: Schema.Json;
1193
+ };
1194
+ readonly mediaType: string;
1195
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1196
+ readonly fileName?: string | undefined;
1197
+ })[]];
1198
+ readonly commandId: string & import("effect/Brand").Brand<"CommandId">;
1199
+ readonly messageId: string & import("effect/Brand").Brand<"MessageId">;
1200
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1201
+ readonly consumedSeq: number & import("effect/Brand").Brand<"SequenceNumber">;
1202
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
1203
+ readonly createdAtMs?: number | undefined;
1204
+ readonly cancellationReason?: string | undefined;
1205
+ readonly cancelledByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
1206
+ readonly cancelledSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1207
+ readonly consumedTurnId?: (string & import("effect/Brand").Brand<"TurnId">) | undefined;
1208
+ readonly pausedByCommandId?: (string & import("effect/Brand").Brand<"CommandId">) | undefined;
1209
+ readonly pausedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1210
+ readonly promotedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1211
+ })[];
1212
+ }, options?: import("effect/SchemaAST").ParseOptions) => {
1213
+ readonly state: {
1214
+ readonly messages: ReadonlyMap<string, {
1215
+ readonly _tag: "System";
1216
+ readonly content: string;
1217
+ readonly messageId: string;
1218
+ readonly seq: number;
1219
+ readonly createdAtMs?: number | undefined;
1220
+ } | {
1221
+ readonly _tag: "User";
1222
+ readonly content: readonly [{
1223
+ readonly type: "text";
1224
+ readonly text: string;
1225
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1226
+ readonly options: {
1227
+ readonly [x: string]: Schema.Json;
1228
+ };
1229
+ }, ...{
1230
+ readonly type: "text";
1231
+ readonly text: string;
1232
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1233
+ readonly options: {
1234
+ readonly [x: string]: Schema.Json;
1235
+ };
1236
+ }[]] | readonly [{
1237
+ readonly type: "text";
1238
+ readonly text: string;
1239
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1240
+ readonly options: {
1241
+ readonly [x: string]: Schema.Json;
1242
+ };
1243
+ } | {
1244
+ readonly type: "file";
1245
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1246
+ readonly options: {
1247
+ readonly [x: string]: Schema.Json;
1248
+ };
1249
+ readonly mediaType: string;
1250
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1251
+ readonly fileName?: string | undefined;
1252
+ }, ...({
1253
+ readonly type: "text";
1254
+ readonly text: string;
1255
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1256
+ readonly options: {
1257
+ readonly [x: string]: Schema.Json;
1258
+ };
1259
+ } | {
1260
+ readonly type: "file";
1261
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1262
+ readonly options: {
1263
+ readonly [x: string]: Schema.Json;
1264
+ };
1265
+ readonly mediaType: string;
1266
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1267
+ readonly fileName?: string | undefined;
1268
+ })[]];
1269
+ readonly commandId: string;
1270
+ readonly messageId: string;
1271
+ readonly seq: number;
1272
+ readonly createdAtMs?: number | undefined;
1273
+ readonly disposition?: "queue" | "steer" | undefined;
1274
+ readonly requestedDisposition?: "queue" | "steer" | undefined;
1275
+ readonly cancellationReason?: string | undefined;
1276
+ readonly cancelledByCommandId?: string | undefined;
1277
+ readonly cancelledSeq?: number | undefined;
1278
+ readonly consumedSeq?: number | undefined;
1279
+ readonly consumedTurnId?: string | undefined;
1280
+ readonly pausedByCommandId?: string | undefined;
1281
+ readonly pausedSeq?: number | undefined;
1282
+ readonly promotedSeq?: number | undefined;
1283
+ } | {
1284
+ readonly _tag: "Steering";
1285
+ readonly content: readonly [{
1286
+ readonly type: "text";
1287
+ readonly text: string;
1288
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1289
+ readonly options: {
1290
+ readonly [x: string]: Schema.Json;
1291
+ };
1292
+ }, ...{
1293
+ readonly type: "text";
1294
+ readonly text: string;
1295
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1296
+ readonly options: {
1297
+ readonly [x: string]: Schema.Json;
1298
+ };
1299
+ }[]] | readonly [{
1300
+ readonly type: "text";
1301
+ readonly text: string;
1302
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1303
+ readonly options: {
1304
+ readonly [x: string]: Schema.Json;
1305
+ };
1306
+ } | {
1307
+ readonly type: "file";
1308
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1309
+ readonly options: {
1310
+ readonly [x: string]: Schema.Json;
1311
+ };
1312
+ readonly mediaType: string;
1313
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1314
+ readonly fileName?: string | undefined;
1315
+ }, ...({
1316
+ readonly type: "text";
1317
+ readonly text: string;
1318
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1319
+ readonly options: {
1320
+ readonly [x: string]: Schema.Json;
1321
+ };
1322
+ } | {
1323
+ readonly type: "file";
1324
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1325
+ readonly options: {
1326
+ readonly [x: string]: Schema.Json;
1327
+ };
1328
+ readonly mediaType: string;
1329
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1330
+ readonly fileName?: string | undefined;
1331
+ })[]];
1332
+ readonly commandId: string;
1333
+ readonly messageId: string;
1334
+ readonly seq: number;
1335
+ readonly runId: string;
1336
+ readonly createdAtMs?: number | undefined;
1337
+ readonly cancellationReason?: string | undefined;
1338
+ readonly cancelledByCommandId?: string | undefined;
1339
+ readonly cancelledSeq?: number | undefined;
1340
+ readonly consumedSeq?: number | undefined;
1341
+ readonly consumedTurnId?: string | undefined;
1342
+ readonly pausedByCommandId?: string | undefined;
1343
+ readonly pausedSeq?: number | undefined;
1344
+ readonly promotedSeq?: number | undefined;
1345
+ } | {
1346
+ readonly _tag: "Assistant";
1347
+ readonly content: {
1348
+ readonly text: string;
1349
+ readonly reasoning?: string | undefined;
1350
+ };
1351
+ readonly messageId: string;
1352
+ readonly seq: number;
1353
+ readonly runId: string;
1354
+ readonly inferenceId: string;
1355
+ readonly turnId: string;
1356
+ readonly createdAtMs?: number | undefined;
1357
+ readonly imported?: true | undefined;
1358
+ readonly promptParts?: readonly ({
1359
+ readonly type: "text";
1360
+ readonly text: string;
1361
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1362
+ readonly options: {
1363
+ readonly [x: string]: Schema.Json;
1364
+ };
1365
+ } | {
1366
+ readonly type: "file";
1367
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1368
+ readonly options: {
1369
+ readonly [x: string]: Schema.Json;
1370
+ };
1371
+ readonly mediaType: string;
1372
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1373
+ readonly fileName?: string | undefined;
1374
+ } | {
1375
+ readonly type: "reasoning";
1376
+ readonly text: string;
1377
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1378
+ readonly options: {
1379
+ readonly [x: string]: Schema.Json;
1380
+ };
1381
+ } | {
1382
+ readonly type: "tool-call";
1383
+ readonly id: string;
1384
+ readonly name: string;
1385
+ readonly params: unknown;
1386
+ readonly providerExecuted: boolean;
1387
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1388
+ readonly options: {
1389
+ readonly [x: string]: Schema.Json;
1390
+ };
1391
+ } | {
1392
+ readonly type: "tool-result";
1393
+ readonly id: string;
1394
+ readonly name: string;
1395
+ readonly isFailure: boolean;
1396
+ readonly result: unknown;
1397
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1398
+ readonly options: {
1399
+ readonly [x: string]: Schema.Json;
1400
+ };
1401
+ } | {
1402
+ readonly type: "tool-approval-request";
1403
+ readonly approvalId: string;
1404
+ readonly toolCallId: string;
1405
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1406
+ readonly options: {
1407
+ readonly [x: string]: Schema.Json;
1408
+ };
1409
+ })[] | undefined;
1410
+ } | {
1411
+ readonly _tag: "AssistantPartial";
1412
+ readonly content: {
1413
+ readonly text: string;
1414
+ readonly reasoning?: string | undefined;
1415
+ };
1416
+ readonly messageId: string;
1417
+ readonly reason: string;
1418
+ readonly seq: number;
1419
+ readonly runId: string;
1420
+ readonly inferenceId: string;
1421
+ readonly turnId: string;
1422
+ readonly createdAtMs?: number | undefined;
1423
+ readonly promptParts?: readonly ({
1424
+ readonly type: "text";
1425
+ readonly text: string;
1426
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1427
+ readonly options: {
1428
+ readonly [x: string]: Schema.Json;
1429
+ };
1430
+ } | {
1431
+ readonly type: "file";
1432
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1433
+ readonly options: {
1434
+ readonly [x: string]: Schema.Json;
1435
+ };
1436
+ readonly mediaType: string;
1437
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1438
+ readonly fileName?: string | undefined;
1439
+ } | {
1440
+ readonly type: "reasoning";
1441
+ readonly text: string;
1442
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1443
+ readonly options: {
1444
+ readonly [x: string]: Schema.Json;
1445
+ };
1446
+ } | {
1447
+ readonly type: "tool-call";
1448
+ readonly id: string;
1449
+ readonly name: string;
1450
+ readonly params: unknown;
1451
+ readonly providerExecuted: boolean;
1452
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1453
+ readonly options: {
1454
+ readonly [x: string]: Schema.Json;
1455
+ };
1456
+ } | {
1457
+ readonly type: "tool-result";
1458
+ readonly id: string;
1459
+ readonly name: string;
1460
+ readonly isFailure: boolean;
1461
+ readonly result: unknown;
1462
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1463
+ readonly options: {
1464
+ readonly [x: string]: Schema.Json;
1465
+ };
1466
+ } | {
1467
+ readonly type: "tool-approval-request";
1468
+ readonly approvalId: string;
1469
+ readonly toolCallId: string;
1470
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1471
+ readonly options: {
1472
+ readonly [x: string]: Schema.Json;
1473
+ };
1474
+ })[] | undefined;
1475
+ }>;
1476
+ readonly lastSeq: number;
1477
+ readonly commands: ReadonlyMap<string, {
1478
+ readonly commandId: string;
1479
+ readonly command?: {
1480
+ readonly _tag: "SubmitMessage";
1481
+ readonly disposition: "queue" | "steer" | "interrupt";
1482
+ readonly content: string | readonly [{
1483
+ readonly text: string;
1484
+ readonly type: "text";
1485
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1486
+ readonly options?: {
1487
+ readonly [x: string]: Schema.Json;
1488
+ } | undefined;
1489
+ } | {
1490
+ readonly type: "file";
1491
+ readonly mediaType: string;
1492
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1493
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1494
+ readonly options?: {
1495
+ readonly [x: string]: Schema.Json;
1496
+ } | undefined;
1497
+ readonly fileName?: string | undefined;
1498
+ }, ...({
1499
+ readonly text: string;
1500
+ readonly type: "text";
1501
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1502
+ readonly options?: {
1503
+ readonly [x: string]: Schema.Json;
1504
+ } | undefined;
1505
+ } | {
1506
+ readonly type: "file";
1507
+ readonly mediaType: string;
1508
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1509
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1510
+ readonly options?: {
1511
+ readonly [x: string]: Schema.Json;
1512
+ } | undefined;
1513
+ readonly fileName?: string | undefined;
1514
+ })[]];
1515
+ readonly expectedPausedMessageIdsToCancel?: readonly string[] | undefined;
1516
+ readonly commandId?: string | undefined;
1517
+ readonly idempotencyKey?: string | undefined;
1518
+ } | {
1519
+ readonly _tag: "StopTurn";
1520
+ readonly commandId?: string | undefined;
1521
+ readonly idempotencyKey?: string | undefined;
1522
+ } | {
1523
+ readonly _tag: "CancelPendingMessage";
1524
+ readonly messageId: string;
1525
+ readonly reason: "edit" | "user-cancel";
1526
+ readonly commandId?: string | undefined;
1527
+ readonly idempotencyKey?: string | undefined;
1528
+ } | {
1529
+ readonly _tag: "PromotePendingMessage";
1530
+ readonly messageId: string;
1531
+ readonly commandId?: string | undefined;
1532
+ readonly idempotencyKey?: string | undefined;
1533
+ } | {
1534
+ readonly _tag: "ResumePendingMessages";
1535
+ readonly messageIds: readonly [string, ...string[]];
1536
+ readonly commandId?: string | undefined;
1537
+ readonly idempotencyKey?: string | undefined;
1538
+ } | undefined;
1539
+ readonly admittedSeq?: number | undefined;
1540
+ readonly admissionTrace?: {
1541
+ readonly span: {
1542
+ readonly traceId: string;
1543
+ readonly spanId: string;
1544
+ readonly sampled: boolean;
1545
+ readonly tracestate: string | null;
1546
+ };
1547
+ readonly links: readonly {
1548
+ readonly context: {
1549
+ readonly traceId: string;
1550
+ readonly spanId: string;
1551
+ readonly sampled: boolean;
1552
+ readonly tracestate: string | null;
1553
+ };
1554
+ readonly attributes: {
1555
+ readonly [x: string]: string | number | boolean;
1556
+ };
1557
+ }[];
1558
+ } | undefined;
1559
+ readonly startedSeq?: number | undefined;
1560
+ readonly terminal?: {
1561
+ readonly _tag: "Completed";
1562
+ readonly seq: number;
1563
+ } | {
1564
+ readonly _tag: "Failed";
1565
+ readonly error: {
1566
+ readonly message: string;
1567
+ readonly code?: string | undefined;
1568
+ readonly details?: unknown;
1569
+ };
1570
+ readonly seq: number;
1571
+ } | {
1572
+ readonly _tag: "Cancelled";
1573
+ readonly reason: string;
1574
+ readonly seq: number;
1575
+ } | undefined;
1576
+ }>;
1577
+ readonly runs: ReadonlyMap<string, {
1578
+ readonly trace: {
1579
+ readonly root: {
1580
+ readonly traceId: string;
1581
+ readonly spanId: string;
1582
+ readonly sampled: boolean;
1583
+ readonly tracestate: string | null;
1584
+ };
1585
+ readonly links: readonly {
1586
+ readonly context: {
1587
+ readonly traceId: string;
1588
+ readonly spanId: string;
1589
+ readonly sampled: boolean;
1590
+ readonly tracestate: string | null;
1591
+ };
1592
+ readonly attributes: {
1593
+ readonly [x: string]: string | number | boolean;
1594
+ };
1595
+ }[];
1596
+ };
1597
+ readonly runId: string;
1598
+ readonly startedSeq: number;
1599
+ readonly commandIds: readonly string[];
1600
+ readonly modelSelection?: {
1601
+ readonly provider: string;
1602
+ readonly modelId: string;
1603
+ readonly settings?: unknown;
1604
+ } | undefined;
1605
+ readonly terminal?: {
1606
+ readonly _tag: "Completed";
1607
+ readonly seq: number;
1608
+ } | {
1609
+ readonly _tag: "Failed";
1610
+ readonly error: {
1611
+ readonly message: string;
1612
+ readonly code?: string | undefined;
1613
+ readonly details?: unknown;
1614
+ };
1615
+ readonly seq: number;
1616
+ } | {
1617
+ readonly _tag: "Interrupted";
1618
+ readonly reason: string;
1619
+ readonly seq: number;
1620
+ } | undefined;
1621
+ readonly durationMs?: number | undefined;
1622
+ readonly startedAtMs?: number | undefined;
1623
+ readonly terminalAtMs?: number | undefined;
1624
+ }>;
1625
+ readonly recoveryContinuations: ReadonlyMap<string, {
1626
+ readonly seq: number;
1627
+ readonly commandId: string;
1628
+ readonly interruptedRunId: string;
1629
+ readonly replacementRunId: string;
1630
+ }>;
1631
+ readonly turns: ReadonlyMap<string, {
1632
+ readonly runId: string;
1633
+ readonly turnId: string;
1634
+ readonly startedSeq: number;
1635
+ readonly terminal?: {
1636
+ readonly _tag: "Completed";
1637
+ readonly seq: number;
1638
+ readonly usage?: {
1639
+ readonly inputTokens?: number | undefined;
1640
+ readonly cachedInputTokens?: number | undefined;
1641
+ readonly cacheWriteInputTokens?: number | undefined;
1642
+ readonly outputTokens?: number | undefined;
1643
+ readonly textTokens?: number | undefined;
1644
+ readonly reasoningTokens?: number | undefined;
1645
+ } | undefined;
1646
+ } | {
1647
+ readonly _tag: "Failed";
1648
+ readonly error: {
1649
+ readonly message: string;
1650
+ readonly code?: string | undefined;
1651
+ readonly details?: unknown;
1652
+ };
1653
+ readonly seq: number;
1654
+ } | {
1655
+ readonly _tag: "Stopped";
1656
+ readonly reason: string;
1657
+ readonly seq: number;
1658
+ } | undefined;
1659
+ readonly durationMs?: number | undefined;
1660
+ readonly startedAtMs?: number | undefined;
1661
+ readonly terminalAtMs?: number | undefined;
1662
+ }>;
1663
+ readonly inferences: ReadonlyMap<string, {
1664
+ readonly runId: string;
1665
+ readonly inferenceId: string;
1666
+ readonly turnId: string;
1667
+ readonly startedSeq: number;
1668
+ readonly terminal?: {
1669
+ readonly _tag: "Completed";
1670
+ readonly seq: number;
1671
+ readonly usage?: {
1672
+ readonly inputTokens?: number | undefined;
1673
+ readonly cachedInputTokens?: number | undefined;
1674
+ readonly cacheWriteInputTokens?: number | undefined;
1675
+ readonly outputTokens?: number | undefined;
1676
+ readonly textTokens?: number | undefined;
1677
+ readonly reasoningTokens?: number | undefined;
1678
+ } | undefined;
1679
+ } | {
1680
+ readonly _tag: "Failed";
1681
+ readonly error: {
1682
+ readonly message: string;
1683
+ readonly code?: string | undefined;
1684
+ readonly details?: unknown;
1685
+ };
1686
+ readonly seq: number;
1687
+ } | undefined;
1688
+ readonly durationMs?: number | undefined;
1689
+ readonly startedAtMs?: number | undefined;
1690
+ readonly terminalAtMs?: number | undefined;
1691
+ }>;
1692
+ readonly toolCalls: ReadonlyMap<string, {
1693
+ readonly toolCallId: string & import("effect/Brand").Brand<"ToolCallId">;
1694
+ readonly startedSeq?: (number & import("effect/Brand").Brand<"SequenceNumber">) | undefined;
1695
+ readonly terminal?: {
1696
+ readonly _tag: "Completed";
1697
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1698
+ readonly result: unknown;
1699
+ readonly promptPart?: {
1700
+ readonly type: "tool-result";
1701
+ readonly id: string;
1702
+ readonly name: string;
1703
+ readonly isFailure: boolean;
1704
+ readonly result: unknown;
1705
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1706
+ readonly options: {
1707
+ readonly [x: string]: Schema.Json;
1708
+ };
1709
+ } | undefined;
1710
+ } | {
1711
+ readonly _tag: "Failed";
1712
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1713
+ readonly error: {
1714
+ readonly message: string;
1715
+ readonly code?: string | undefined;
1716
+ readonly details?: unknown;
1717
+ };
1718
+ readonly promptPart?: {
1719
+ readonly type: "tool-result";
1720
+ readonly id: string;
1721
+ readonly name: string;
1722
+ readonly isFailure: boolean;
1723
+ readonly result: unknown;
1724
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1725
+ readonly options: {
1726
+ readonly [x: string]: Schema.Json;
1727
+ };
1728
+ } | undefined;
1729
+ } | undefined;
1730
+ readonly durationMs?: number | undefined;
1731
+ readonly startedAtMs?: number | undefined;
1732
+ readonly terminalAtMs?: number | undefined;
1733
+ readonly decision?: {
1734
+ readonly _tag: "Created";
1735
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1736
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
1737
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
1738
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
1739
+ readonly params: unknown;
1740
+ readonly providerExecuted: boolean;
1741
+ readonly providerPartId: string & import("effect/Brand").Brand<"ProviderPartId">;
1742
+ readonly toolName: string;
1743
+ readonly promptPart?: {
1744
+ readonly type: "tool-call";
1745
+ readonly id: string;
1746
+ readonly name: string;
1747
+ readonly params: unknown;
1748
+ readonly providerExecuted: boolean;
1749
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1750
+ readonly options: {
1751
+ readonly [x: string]: Schema.Json;
1752
+ };
1753
+ } | undefined;
1754
+ } | {
1755
+ readonly _tag: "Rejected";
1756
+ readonly reason: "unknown-tool" | "invalid-params";
1757
+ readonly seq: number & import("effect/Brand").Brand<"SequenceNumber">;
1758
+ readonly runId: string & import("effect/Brand").Brand<"RunId">;
1759
+ readonly inferenceId: string & import("effect/Brand").Brand<"InferenceId">;
1760
+ readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
1761
+ readonly providerPartId: string & import("effect/Brand").Brand<"ProviderPartId">;
1762
+ readonly toolName: string;
1763
+ readonly modelFeedback: string;
1764
+ readonly promptPart?: {
1765
+ readonly type: "tool-result";
1766
+ readonly id: string;
1767
+ readonly name: string;
1768
+ readonly isFailure: boolean;
1769
+ readonly result: unknown;
1770
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
1771
+ readonly options: {
1772
+ readonly [x: string]: Schema.Json;
1773
+ };
1774
+ } | undefined;
1775
+ } | undefined;
1776
+ }>;
1777
+ readonly stopRequests: ReadonlyMap<string, {
1778
+ readonly commandId: string;
1779
+ readonly requestedSeq: number;
1780
+ readonly requestedRunId?: string | undefined;
1781
+ readonly requestedTurnId?: string | undefined;
1782
+ readonly appliedSeq?: number | undefined;
1783
+ readonly appliedRunId?: string | undefined;
1784
+ readonly appliedTurnId?: string | undefined;
1785
+ readonly appliedInferenceId?: string | undefined;
1786
+ }>;
1787
+ readonly compactions: ReadonlyMap<string, {
1788
+ readonly compactionId: string;
1789
+ readonly requestedSeq?: number | undefined;
1790
+ readonly startedSeq?: number | undefined;
1791
+ readonly terminal?: {
1792
+ readonly _tag: "Completed";
1793
+ readonly seq: number;
1794
+ } | {
1795
+ readonly _tag: "Failed";
1796
+ readonly seq: number;
1797
+ readonly error: {
1798
+ readonly message: string;
1799
+ readonly code?: string | undefined;
1800
+ readonly details?: unknown;
1801
+ };
1802
+ } | undefined;
1803
+ readonly summaryCreatedSeq?: number | undefined;
1804
+ readonly summaryId?: string | undefined;
1805
+ readonly sourceFromSeq?: number | undefined;
1806
+ readonly sourceToSeq?: number | undefined;
1807
+ readonly rebasedSeq?: number | undefined;
1808
+ readonly contextVersion?: number | undefined;
1809
+ }>;
1810
+ readonly context: {
1811
+ readonly version: number;
1812
+ readonly currentSummaryId?: string | undefined;
1813
+ };
1814
+ readonly tokenConsumption: {
1815
+ readonly byModel: readonly {
1816
+ readonly provider: string;
1817
+ readonly modelId: string;
1818
+ readonly usage: {
1819
+ readonly inputTokens: number;
1820
+ readonly cachedInputTokens: number;
1821
+ readonly cacheWriteInputTokens: number;
1822
+ readonly outputTokens: number;
1823
+ readonly textTokens: number;
1824
+ readonly reasoningTokens: number;
1825
+ };
1826
+ }[];
1827
+ };
1828
+ readonly commandQueues: {
1829
+ readonly pendingCommands: readonly {
1830
+ readonly commandId: string;
1831
+ readonly command: {
1832
+ readonly _tag: "SubmitMessage";
1833
+ readonly disposition: "queue" | "steer" | "interrupt";
1834
+ readonly content: string | readonly [{
1835
+ readonly text: string;
1836
+ readonly type: "text";
1837
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1838
+ readonly options?: {
1839
+ readonly [x: string]: Schema.Json;
1840
+ } | undefined;
1841
+ } | {
1842
+ readonly type: "file";
1843
+ readonly mediaType: string;
1844
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1845
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1846
+ readonly options?: {
1847
+ readonly [x: string]: Schema.Json;
1848
+ } | undefined;
1849
+ readonly fileName?: string | undefined;
1850
+ }, ...({
1851
+ readonly text: string;
1852
+ readonly type: "text";
1853
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1854
+ readonly options?: {
1855
+ readonly [x: string]: Schema.Json;
1856
+ } | undefined;
1857
+ } | {
1858
+ readonly type: "file";
1859
+ readonly mediaType: string;
1860
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1861
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1862
+ readonly options?: {
1863
+ readonly [x: string]: Schema.Json;
1864
+ } | undefined;
1865
+ readonly fileName?: string | undefined;
1866
+ })[]];
1867
+ readonly expectedPausedMessageIdsToCancel?: readonly string[] | undefined;
1868
+ readonly commandId?: string | undefined;
1869
+ readonly idempotencyKey?: string | undefined;
1870
+ } | {
1871
+ readonly _tag: "StopTurn";
1872
+ readonly commandId?: string | undefined;
1873
+ readonly idempotencyKey?: string | undefined;
1874
+ } | {
1875
+ readonly _tag: "CancelPendingMessage";
1876
+ readonly messageId: string;
1877
+ readonly reason: "edit" | "user-cancel";
1878
+ readonly commandId?: string | undefined;
1879
+ readonly idempotencyKey?: string | undefined;
1880
+ } | {
1881
+ readonly _tag: "PromotePendingMessage";
1882
+ readonly messageId: string;
1883
+ readonly commandId?: string | undefined;
1884
+ readonly idempotencyKey?: string | undefined;
1885
+ } | {
1886
+ readonly _tag: "ResumePendingMessages";
1887
+ readonly messageIds: readonly [string, ...string[]];
1888
+ readonly commandId?: string | undefined;
1889
+ readonly idempotencyKey?: string | undefined;
1890
+ };
1891
+ readonly admittedSeq: number;
1892
+ readonly admissionTrace?: {
1893
+ readonly span: {
1894
+ readonly traceId: string;
1895
+ readonly spanId: string;
1896
+ readonly sampled: boolean;
1897
+ readonly tracestate: string | null;
1898
+ };
1899
+ readonly links: readonly {
1900
+ readonly context: {
1901
+ readonly traceId: string;
1902
+ readonly spanId: string;
1903
+ readonly sampled: boolean;
1904
+ readonly tracestate: string | null;
1905
+ };
1906
+ readonly attributes: {
1907
+ readonly [x: string]: string | number | boolean;
1908
+ };
1909
+ }[];
1910
+ } | undefined;
1911
+ }[];
1912
+ readonly queuedCommands: readonly {
1913
+ readonly commandId: string;
1914
+ readonly command: {
1915
+ readonly _tag: "SubmitMessage";
1916
+ readonly disposition: "queue" | "steer" | "interrupt";
1917
+ readonly content: string | readonly [{
1918
+ readonly text: string;
1919
+ readonly type: "text";
1920
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1921
+ readonly options?: {
1922
+ readonly [x: string]: Schema.Json;
1923
+ } | undefined;
1924
+ } | {
1925
+ readonly type: "file";
1926
+ readonly mediaType: string;
1927
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1928
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1929
+ readonly options?: {
1930
+ readonly [x: string]: Schema.Json;
1931
+ } | undefined;
1932
+ readonly fileName?: string | undefined;
1933
+ }, ...({
1934
+ readonly text: string;
1935
+ readonly type: "text";
1936
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1937
+ readonly options?: {
1938
+ readonly [x: string]: Schema.Json;
1939
+ } | undefined;
1940
+ } | {
1941
+ readonly type: "file";
1942
+ readonly mediaType: string;
1943
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
1944
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
1945
+ readonly options?: {
1946
+ readonly [x: string]: Schema.Json;
1947
+ } | undefined;
1948
+ readonly fileName?: string | undefined;
1949
+ })[]];
1950
+ readonly expectedPausedMessageIdsToCancel?: readonly string[] | undefined;
1951
+ readonly commandId?: string | undefined;
1952
+ readonly idempotencyKey?: string | undefined;
1953
+ } | {
1954
+ readonly _tag: "StopTurn";
1955
+ readonly commandId?: string | undefined;
1956
+ readonly idempotencyKey?: string | undefined;
1957
+ } | {
1958
+ readonly _tag: "CancelPendingMessage";
1959
+ readonly messageId: string;
1960
+ readonly reason: "edit" | "user-cancel";
1961
+ readonly commandId?: string | undefined;
1962
+ readonly idempotencyKey?: string | undefined;
1963
+ } | {
1964
+ readonly _tag: "PromotePendingMessage";
1965
+ readonly messageId: string;
1966
+ readonly commandId?: string | undefined;
1967
+ readonly idempotencyKey?: string | undefined;
1968
+ } | {
1969
+ readonly _tag: "ResumePendingMessages";
1970
+ readonly messageIds: readonly [string, ...string[]];
1971
+ readonly commandId?: string | undefined;
1972
+ readonly idempotencyKey?: string | undefined;
1973
+ };
1974
+ readonly admittedSeq: number;
1975
+ readonly admissionTrace?: {
1976
+ readonly span: {
1977
+ readonly traceId: string;
1978
+ readonly spanId: string;
1979
+ readonly sampled: boolean;
1980
+ readonly tracestate: string | null;
1981
+ };
1982
+ readonly links: readonly {
1983
+ readonly context: {
1984
+ readonly traceId: string;
1985
+ readonly spanId: string;
1986
+ readonly sampled: boolean;
1987
+ readonly tracestate: string | null;
1988
+ };
1989
+ readonly attributes: {
1990
+ readonly [x: string]: string | number | boolean;
1991
+ };
1992
+ }[];
1993
+ } | undefined;
1994
+ }[];
1995
+ readonly activeControlCommands: readonly {
1996
+ readonly commandId: string;
1997
+ readonly command: {
1998
+ readonly _tag: "SubmitMessage";
1999
+ readonly disposition: "queue" | "steer" | "interrupt";
2000
+ readonly content: string | readonly [{
2001
+ readonly text: string;
2002
+ readonly type: "text";
2003
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
2004
+ readonly options?: {
2005
+ readonly [x: string]: Schema.Json;
2006
+ } | undefined;
2007
+ } | {
2008
+ readonly type: "file";
2009
+ readonly mediaType: string;
2010
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2011
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
2012
+ readonly options?: {
2013
+ readonly [x: string]: Schema.Json;
2014
+ } | undefined;
2015
+ readonly fileName?: string | undefined;
2016
+ }, ...({
2017
+ readonly text: string;
2018
+ readonly type: "text";
2019
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
2020
+ readonly options?: {
2021
+ readonly [x: string]: Schema.Json;
2022
+ } | undefined;
2023
+ } | {
2024
+ readonly type: "file";
2025
+ readonly mediaType: string;
2026
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2027
+ readonly "~effect/ai/Prompt/Part"?: "~effect/ai/Prompt/Part" | undefined;
2028
+ readonly options?: {
2029
+ readonly [x: string]: Schema.Json;
2030
+ } | undefined;
2031
+ readonly fileName?: string | undefined;
2032
+ })[]];
2033
+ readonly expectedPausedMessageIdsToCancel?: readonly string[] | undefined;
2034
+ readonly commandId?: string | undefined;
2035
+ readonly idempotencyKey?: string | undefined;
2036
+ } | {
2037
+ readonly _tag: "StopTurn";
2038
+ readonly commandId?: string | undefined;
2039
+ readonly idempotencyKey?: string | undefined;
2040
+ } | {
2041
+ readonly _tag: "CancelPendingMessage";
2042
+ readonly messageId: string;
2043
+ readonly reason: "edit" | "user-cancel";
2044
+ readonly commandId?: string | undefined;
2045
+ readonly idempotencyKey?: string | undefined;
2046
+ } | {
2047
+ readonly _tag: "PromotePendingMessage";
2048
+ readonly messageId: string;
2049
+ readonly commandId?: string | undefined;
2050
+ readonly idempotencyKey?: string | undefined;
2051
+ } | {
2052
+ readonly _tag: "ResumePendingMessages";
2053
+ readonly messageIds: readonly [string, ...string[]];
2054
+ readonly commandId?: string | undefined;
2055
+ readonly idempotencyKey?: string | undefined;
2056
+ };
2057
+ readonly admittedSeq: number;
2058
+ readonly admissionTrace?: {
2059
+ readonly span: {
2060
+ readonly traceId: string;
2061
+ readonly spanId: string;
2062
+ readonly sampled: boolean;
2063
+ readonly tracestate: string | null;
2064
+ };
2065
+ readonly links: readonly {
2066
+ readonly context: {
2067
+ readonly traceId: string;
2068
+ readonly spanId: string;
2069
+ readonly sampled: boolean;
2070
+ readonly tracestate: string | null;
2071
+ };
2072
+ readonly attributes: {
2073
+ readonly [x: string]: string | number | boolean;
2074
+ };
2075
+ }[];
2076
+ } | undefined;
2077
+ }[];
2078
+ readonly steeringByRun: ReadonlyMap<string, readonly {
2079
+ readonly content: readonly [{
2080
+ readonly type: "text";
2081
+ readonly text: string;
2082
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2083
+ readonly options: {
2084
+ readonly [x: string]: Schema.Json;
2085
+ };
2086
+ }, ...{
2087
+ readonly type: "text";
2088
+ readonly text: string;
2089
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2090
+ readonly options: {
2091
+ readonly [x: string]: Schema.Json;
2092
+ };
2093
+ }[]] | readonly [{
2094
+ readonly type: "text";
2095
+ readonly text: string;
2096
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2097
+ readonly options: {
2098
+ readonly [x: string]: Schema.Json;
2099
+ };
2100
+ } | {
2101
+ readonly type: "file";
2102
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2103
+ readonly options: {
2104
+ readonly [x: string]: Schema.Json;
2105
+ };
2106
+ readonly mediaType: string;
2107
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2108
+ readonly fileName?: string | undefined;
2109
+ }, ...({
2110
+ readonly type: "text";
2111
+ readonly text: string;
2112
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2113
+ readonly options: {
2114
+ readonly [x: string]: Schema.Json;
2115
+ };
2116
+ } | {
2117
+ readonly type: "file";
2118
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2119
+ readonly options: {
2120
+ readonly [x: string]: Schema.Json;
2121
+ };
2122
+ readonly mediaType: string;
2123
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2124
+ readonly fileName?: string | undefined;
2125
+ })[]];
2126
+ readonly commandId: string;
2127
+ readonly messageId: string;
2128
+ readonly runId: string;
2129
+ readonly queuedSeq: number;
2130
+ readonly consumedSeq?: number | undefined;
2131
+ readonly consumedTurnId?: string | undefined;
2132
+ }[]>;
2133
+ readonly pendingQueue: readonly {
2134
+ readonly disposition: "queue" | "steer";
2135
+ readonly content: readonly [{
2136
+ readonly type: "text";
2137
+ readonly text: string;
2138
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2139
+ readonly options: {
2140
+ readonly [x: string]: Schema.Json;
2141
+ };
2142
+ }, ...{
2143
+ readonly type: "text";
2144
+ readonly text: string;
2145
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2146
+ readonly options: {
2147
+ readonly [x: string]: Schema.Json;
2148
+ };
2149
+ }[]] | readonly [{
2150
+ readonly type: "text";
2151
+ readonly text: string;
2152
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2153
+ readonly options: {
2154
+ readonly [x: string]: Schema.Json;
2155
+ };
2156
+ } | {
2157
+ readonly type: "file";
2158
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2159
+ readonly options: {
2160
+ readonly [x: string]: Schema.Json;
2161
+ };
2162
+ readonly mediaType: string;
2163
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2164
+ readonly fileName?: string | undefined;
2165
+ }, ...({
2166
+ readonly type: "text";
2167
+ readonly text: string;
2168
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2169
+ readonly options: {
2170
+ readonly [x: string]: Schema.Json;
2171
+ };
2172
+ } | {
2173
+ readonly type: "file";
2174
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2175
+ readonly options: {
2176
+ readonly [x: string]: Schema.Json;
2177
+ };
2178
+ readonly mediaType: string;
2179
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2180
+ readonly fileName?: string | undefined;
2181
+ })[]];
2182
+ readonly commandId: string;
2183
+ readonly messageId: string;
2184
+ readonly submittedSeq: number;
2185
+ readonly effectiveSeq: number;
2186
+ readonly pausedByCommandId?: string | undefined;
2187
+ readonly targetRunId?: string | undefined;
2188
+ }[];
2189
+ readonly pendingSteers: readonly {
2190
+ readonly disposition: "queue" | "steer";
2191
+ readonly content: readonly [{
2192
+ readonly type: "text";
2193
+ readonly text: string;
2194
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2195
+ readonly options: {
2196
+ readonly [x: string]: Schema.Json;
2197
+ };
2198
+ }, ...{
2199
+ readonly type: "text";
2200
+ readonly text: string;
2201
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2202
+ readonly options: {
2203
+ readonly [x: string]: Schema.Json;
2204
+ };
2205
+ }[]] | readonly [{
2206
+ readonly type: "text";
2207
+ readonly text: string;
2208
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2209
+ readonly options: {
2210
+ readonly [x: string]: Schema.Json;
2211
+ };
2212
+ } | {
2213
+ readonly type: "file";
2214
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2215
+ readonly options: {
2216
+ readonly [x: string]: Schema.Json;
2217
+ };
2218
+ readonly mediaType: string;
2219
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2220
+ readonly fileName?: string | undefined;
2221
+ }, ...({
2222
+ readonly type: "text";
2223
+ readonly text: string;
2224
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2225
+ readonly options: {
2226
+ readonly [x: string]: Schema.Json;
2227
+ };
2228
+ } | {
2229
+ readonly type: "file";
2230
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2231
+ readonly options: {
2232
+ readonly [x: string]: Schema.Json;
2233
+ };
2234
+ readonly mediaType: string;
2235
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2236
+ readonly fileName?: string | undefined;
2237
+ })[]];
2238
+ readonly commandId: string;
2239
+ readonly messageId: string;
2240
+ readonly submittedSeq: number;
2241
+ readonly effectiveSeq: number;
2242
+ readonly pausedByCommandId?: string | undefined;
2243
+ readonly targetRunId?: string | undefined;
2244
+ }[];
2245
+ readonly pausedQueue: readonly {
2246
+ readonly disposition: "queue" | "steer";
2247
+ readonly content: readonly [{
2248
+ readonly type: "text";
2249
+ readonly text: string;
2250
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2251
+ readonly options: {
2252
+ readonly [x: string]: Schema.Json;
2253
+ };
2254
+ }, ...{
2255
+ readonly type: "text";
2256
+ readonly text: string;
2257
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2258
+ readonly options: {
2259
+ readonly [x: string]: Schema.Json;
2260
+ };
2261
+ }[]] | readonly [{
2262
+ readonly type: "text";
2263
+ readonly text: string;
2264
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2265
+ readonly options: {
2266
+ readonly [x: string]: Schema.Json;
2267
+ };
2268
+ } | {
2269
+ readonly type: "file";
2270
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2271
+ readonly options: {
2272
+ readonly [x: string]: Schema.Json;
2273
+ };
2274
+ readonly mediaType: string;
2275
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2276
+ readonly fileName?: string | undefined;
2277
+ }, ...({
2278
+ readonly type: "text";
2279
+ readonly text: string;
2280
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2281
+ readonly options: {
2282
+ readonly [x: string]: Schema.Json;
2283
+ };
2284
+ } | {
2285
+ readonly type: "file";
2286
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2287
+ readonly options: {
2288
+ readonly [x: string]: Schema.Json;
2289
+ };
2290
+ readonly mediaType: string;
2291
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2292
+ readonly fileName?: string | undefined;
2293
+ })[]];
2294
+ readonly commandId: string;
2295
+ readonly messageId: string;
2296
+ readonly submittedSeq: number;
2297
+ readonly effectiveSeq: number;
2298
+ readonly pausedByCommandId?: string | undefined;
2299
+ readonly targetRunId?: string | undefined;
2300
+ }[];
2301
+ readonly active?: {
2302
+ readonly commandId: string;
2303
+ readonly runId?: string | undefined;
2304
+ } | undefined;
2305
+ };
2306
+ readonly modelSelection?: {
2307
+ readonly provider: string;
2308
+ readonly modelId: string;
2309
+ readonly settings?: unknown;
2310
+ } | undefined;
2311
+ readonly runSchedulingRequest?: {
2312
+ readonly requestId: string;
2313
+ readonly requestedSeq: number;
2314
+ readonly work: {
2315
+ readonly _tag: "Command";
2316
+ readonly commandId: string;
2317
+ } | {
2318
+ readonly _tag: "Recovery";
2319
+ readonly commandId: string;
2320
+ readonly interruptedRunId: string;
2321
+ readonly inputMessageIds: readonly string[];
2322
+ };
2323
+ readonly deliveredSeq?: number | undefined;
2324
+ } | undefined;
2325
+ };
2326
+ readonly reducerStates: ReadonlyMap<string, unknown>;
2327
+ readonly messages: readonly ({
2328
+ readonly _tag: "User";
2329
+ readonly content: readonly [{
2330
+ readonly type: "text";
2331
+ readonly text: string;
2332
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2333
+ readonly options: {
2334
+ readonly [x: string]: Schema.Json;
2335
+ };
2336
+ }, ...{
2337
+ readonly type: "text";
2338
+ readonly text: string;
2339
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2340
+ readonly options: {
2341
+ readonly [x: string]: Schema.Json;
2342
+ };
2343
+ }[]] | readonly [{
2344
+ readonly type: "text";
2345
+ readonly text: string;
2346
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2347
+ readonly options: {
2348
+ readonly [x: string]: Schema.Json;
2349
+ };
2350
+ } | {
2351
+ readonly type: "file";
2352
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2353
+ readonly options: {
2354
+ readonly [x: string]: Schema.Json;
2355
+ };
2356
+ readonly mediaType: string;
2357
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2358
+ readonly fileName?: string | undefined;
2359
+ }, ...({
2360
+ readonly type: "text";
2361
+ readonly text: string;
2362
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2363
+ readonly options: {
2364
+ readonly [x: string]: Schema.Json;
2365
+ };
2366
+ } | {
2367
+ readonly type: "file";
2368
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2369
+ readonly options: {
2370
+ readonly [x: string]: Schema.Json;
2371
+ };
2372
+ readonly mediaType: string;
2373
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2374
+ readonly fileName?: string | undefined;
2375
+ })[]];
2376
+ readonly commandId: string;
2377
+ readonly messageId: string;
2378
+ readonly seq: number;
2379
+ readonly createdAtMs?: number | undefined;
2380
+ readonly disposition?: "queue" | "steer" | undefined;
2381
+ readonly requestedDisposition?: "queue" | "steer" | undefined;
2382
+ readonly cancellationReason?: string | undefined;
2383
+ readonly cancelledByCommandId?: string | undefined;
2384
+ readonly cancelledSeq?: number | undefined;
2385
+ readonly consumedSeq?: number | undefined;
2386
+ readonly consumedTurnId?: string | undefined;
2387
+ readonly pausedByCommandId?: string | undefined;
2388
+ readonly pausedSeq?: number | undefined;
2389
+ readonly promotedSeq?: number | undefined;
2390
+ } | {
2391
+ readonly _tag: "Assistant";
2392
+ readonly content: {
2393
+ readonly text: string;
2394
+ readonly reasoning?: string | undefined;
2395
+ };
2396
+ readonly messageId: string;
2397
+ readonly seq: number;
2398
+ readonly runId: string;
2399
+ readonly inferenceId: string;
2400
+ readonly turnId: string;
2401
+ readonly createdAtMs?: number | undefined;
2402
+ readonly imported?: true | undefined;
2403
+ readonly promptParts?: readonly ({
2404
+ readonly type: "text";
2405
+ readonly text: string;
2406
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2407
+ readonly options: {
2408
+ readonly [x: string]: Schema.Json;
2409
+ };
2410
+ } | {
2411
+ readonly type: "file";
2412
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2413
+ readonly options: {
2414
+ readonly [x: string]: Schema.Json;
2415
+ };
2416
+ readonly mediaType: string;
2417
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2418
+ readonly fileName?: string | undefined;
2419
+ } | {
2420
+ readonly type: "reasoning";
2421
+ readonly text: string;
2422
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2423
+ readonly options: {
2424
+ readonly [x: string]: Schema.Json;
2425
+ };
2426
+ } | {
2427
+ readonly type: "tool-call";
2428
+ readonly id: string;
2429
+ readonly name: string;
2430
+ readonly params: unknown;
2431
+ readonly providerExecuted: boolean;
2432
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2433
+ readonly options: {
2434
+ readonly [x: string]: Schema.Json;
2435
+ };
2436
+ } | {
2437
+ readonly type: "tool-result";
2438
+ readonly id: string;
2439
+ readonly name: string;
2440
+ readonly isFailure: boolean;
2441
+ readonly result: unknown;
2442
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2443
+ readonly options: {
2444
+ readonly [x: string]: Schema.Json;
2445
+ };
2446
+ } | {
2447
+ readonly type: "tool-approval-request";
2448
+ readonly approvalId: string;
2449
+ readonly toolCallId: string;
2450
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2451
+ readonly options: {
2452
+ readonly [x: string]: Schema.Json;
2453
+ };
2454
+ })[] | undefined;
2455
+ } | {
2456
+ readonly _tag: "AssistantPartial";
2457
+ readonly content: {
2458
+ readonly text: string;
2459
+ readonly reasoning?: string | undefined;
2460
+ };
2461
+ readonly messageId: string;
2462
+ readonly reason: string;
2463
+ readonly seq: number;
2464
+ readonly runId: string;
2465
+ readonly inferenceId: string;
2466
+ readonly turnId: string;
2467
+ readonly createdAtMs?: number | undefined;
2468
+ readonly promptParts?: readonly ({
2469
+ readonly type: "text";
2470
+ readonly text: string;
2471
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2472
+ readonly options: {
2473
+ readonly [x: string]: Schema.Json;
2474
+ };
2475
+ } | {
2476
+ readonly type: "file";
2477
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2478
+ readonly options: {
2479
+ readonly [x: string]: Schema.Json;
2480
+ };
2481
+ readonly mediaType: string;
2482
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2483
+ readonly fileName?: string | undefined;
2484
+ } | {
2485
+ readonly type: "reasoning";
2486
+ readonly text: string;
2487
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2488
+ readonly options: {
2489
+ readonly [x: string]: Schema.Json;
2490
+ };
2491
+ } | {
2492
+ readonly type: "tool-call";
2493
+ readonly id: string;
2494
+ readonly name: string;
2495
+ readonly params: unknown;
2496
+ readonly providerExecuted: boolean;
2497
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2498
+ readonly options: {
2499
+ readonly [x: string]: Schema.Json;
2500
+ };
2501
+ } | {
2502
+ readonly type: "tool-result";
2503
+ readonly id: string;
2504
+ readonly name: string;
2505
+ readonly isFailure: boolean;
2506
+ readonly result: unknown;
2507
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2508
+ readonly options: {
2509
+ readonly [x: string]: Schema.Json;
2510
+ };
2511
+ } | {
2512
+ readonly type: "tool-approval-request";
2513
+ readonly approvalId: string;
2514
+ readonly toolCallId: string;
2515
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2516
+ readonly options: {
2517
+ readonly [x: string]: Schema.Json;
2518
+ };
2519
+ })[] | undefined;
2520
+ } | {
2521
+ readonly _tag: "Steering";
2522
+ readonly content: readonly [{
2523
+ readonly type: "text";
2524
+ readonly text: string;
2525
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2526
+ readonly options: {
2527
+ readonly [x: string]: Schema.Json;
2528
+ };
2529
+ }, ...{
2530
+ readonly type: "text";
2531
+ readonly text: string;
2532
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2533
+ readonly options: {
2534
+ readonly [x: string]: Schema.Json;
2535
+ };
2536
+ }[]] | readonly [{
2537
+ readonly type: "text";
2538
+ readonly text: string;
2539
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2540
+ readonly options: {
2541
+ readonly [x: string]: Schema.Json;
2542
+ };
2543
+ } | {
2544
+ readonly type: "file";
2545
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2546
+ readonly options: {
2547
+ readonly [x: string]: Schema.Json;
2548
+ };
2549
+ readonly mediaType: string;
2550
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2551
+ readonly fileName?: string | undefined;
2552
+ }, ...({
2553
+ readonly type: "text";
2554
+ readonly text: string;
2555
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2556
+ readonly options: {
2557
+ readonly [x: string]: Schema.Json;
2558
+ };
2559
+ } | {
2560
+ readonly type: "file";
2561
+ readonly "~effect/ai/Prompt/Part": "~effect/ai/Prompt/Part";
2562
+ readonly options: {
2563
+ readonly [x: string]: Schema.Json;
2564
+ };
2565
+ readonly mediaType: string;
2566
+ readonly data: string | URL | Uint8Array<ArrayBufferLike>;
2567
+ readonly fileName?: string | undefined;
2568
+ })[]];
2569
+ readonly commandId: string;
2570
+ readonly messageId: string;
2571
+ readonly seq: number;
2572
+ readonly consumedSeq: number;
2573
+ readonly runId: string;
2574
+ readonly createdAtMs?: number | undefined;
2575
+ readonly cancellationReason?: string | undefined;
2576
+ readonly cancelledByCommandId?: string | undefined;
2577
+ readonly cancelledSeq?: number | undefined;
2578
+ readonly consumedTurnId?: string | undefined;
2579
+ readonly pausedByCommandId?: string | undefined;
2580
+ readonly pausedSeq?: number | undefined;
2581
+ readonly promotedSeq?: number | undefined;
2582
+ })[];
2583
+ };
112
2584
  //#endregion
113
2585
  export { EDASessionBlockOnCommandRpcInput, EDASessionCommandRpcInput, EDASessionDurableObject, EDASessionDurableObjectOptions, EDASessionEventsRpcInput, EDASessionGrantRunRpcInput, EDASessionRpcSurface, EDASessionRunRequestOutcomeRpcInput, EDASessionScopedRpcInput, EDASessionSubmitBatchRpcInput, type EDAWebSocketProjection, EDA_WEB_SOCKET_PROJECTION_HEADER, edaRuntimeConfig, encodeEdaRpcCommittedDurableEvent, encodeEdaRpcSessionSnapshot, getEDASessionDurableObjectByName };
114
2586
  //# sourceMappingURL=durable-object.d.ts.map