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

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