effect-durable-agent 0.1.0-alpha.16 → 0.1.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/{compaction-CCdfxYkq.js → compaction-Db6eoLce.js} +3 -3
  2. package/dist/{compaction-CCdfxYkq.js.map → compaction-Db6eoLce.js.map} +1 -1
  3. package/dist/{context-projection-C43pyxn2.d.ts → context-projection-Dr_kA41k.d.ts} +3 -3
  4. package/dist/domain/command-queues.d.ts +82 -2
  5. package/dist/domain/context-projection.d.ts +1 -1
  6. package/dist/domain/message-transcript.d.ts +1 -1
  7. package/dist/domain/model-usage.d.ts +1 -1
  8. package/dist/domain/model-usage.js +1 -1
  9. package/dist/domain/reduced-state-schema.d.ts +3 -992
  10. package/dist/domain/reduced-state-schema.js +116 -4
  11. package/dist/domain/reduced-state-schema.js.map +1 -1
  12. package/dist/domain/reduced-state.d.ts +2 -2
  13. package/dist/domain/reduced-state.js +1 -1
  14. package/dist/domain/run-scheduling.d.ts +1 -1
  15. package/dist/{durable-D_tjjz4B.js → durable-DRY7AcsF.js} +59 -40
  16. package/dist/durable-DRY7AcsF.js.map +1 -0
  17. package/dist/{durable-RSiz3YBK.d.ts → durable-DeQBR5wA.d.ts} +4266 -235
  18. package/dist/{envelope-DxQzo5rN.js → envelope-BCzKUq_z.js} +12 -3
  19. package/dist/envelope-BCzKUq_z.js.map +1 -0
  20. package/dist/{envelope-DkZyMIgp.d.ts → envelope-VXFEC8zr.d.ts} +68 -4
  21. package/dist/{event-factory-CX0_laE5.js → event-factory-CKuWhjS4.js} +3 -3
  22. package/dist/{event-factory-CX0_laE5.js.map → event-factory-CKuWhjS4.js.map} +1 -1
  23. package/dist/{events-LZFNoESe.d.ts → events-D3OAPXgS.d.ts} +22 -22
  24. package/dist/index.d.ts +6 -6
  25. package/dist/index.js +4 -4
  26. package/dist/{model-resolver-BPPJAsuh.d.ts → model-resolver-ci5D5WQv.d.ts} +2 -2
  27. package/dist/{model-usage-CdBEkTwU.d.ts → model-usage-CNcnhj72.d.ts} +2 -2
  28. package/dist/{reduced-state-BAKvToAh.js → reduced-state-DFIYylAq.js} +55 -56
  29. package/dist/reduced-state-DFIYylAq.js.map +1 -0
  30. package/dist/reduced-state-schema-CgW0mzpS.d.ts +2167 -0
  31. package/dist/reduced-state-xY-tYuGo.d.ts +47902 -0
  32. package/dist/{reducer-registry-BgtK0NuX.d.ts → reducer-registry-bRbc4COf.d.ts} +7 -4
  33. package/dist/{run-scheduling-wakeup-DRYZztL6.d.ts → run-scheduling-wakeup-CY5hfgMR.d.ts} +2 -2
  34. package/dist/services/compaction.d.ts +1 -1
  35. package/dist/services/compaction.js +1 -1
  36. package/dist/services/model-resolver.d.ts +1 -1
  37. package/dist/services/prompt-projector.d.ts +1 -1
  38. package/dist/services/reducer-registry.d.ts +1 -1
  39. package/dist/services/reducer-registry.js +19 -6
  40. package/dist/services/reducer-registry.js.map +1 -1
  41. package/dist/services/run-scheduler.d.ts +1 -2
  42. package/dist/services/run-scheduling-wakeup.d.ts +1 -1
  43. package/dist/services/runtime-layer.d.ts +11 -13
  44. package/dist/services/runtime-layer.js +11 -7
  45. package/dist/services/runtime-layer.js.map +1 -1
  46. package/dist/services/runtime.d.ts +1 -1
  47. package/dist/services/runtime.js +17 -9
  48. package/dist/services/runtime.js.map +1 -1
  49. package/dist/services/session-event-observer.d.ts +1 -1
  50. package/dist/services/session-query.d.ts +2 -2
  51. package/dist/services/session-query.js +30 -13
  52. package/dist/services/session-query.js.map +1 -1
  53. package/dist/services/session-state.d.ts +1 -1
  54. package/dist/services/session-state.js +1 -1
  55. package/dist/services/session-store.d.ts +2 -2
  56. package/dist/services/session-store.js +84 -16
  57. package/dist/services/session-store.js.map +1 -1
  58. package/dist/services/sink-checkpoint-store.d.ts +1 -1
  59. package/dist/services/sink-registry.d.ts +1 -1
  60. package/dist/services/sink-registry.js +1 -1
  61. package/dist/services/tool-registry.d.ts +1 -1
  62. package/dist/services/tool-registry.js.map +1 -1
  63. package/dist/services/tracing.d.ts +1 -1
  64. package/dist/{session-event-observer-DaFMKKNc.d.ts → session-event-observer-BWppl2Fr.d.ts} +2 -2
  65. package/dist/{session-state-CWKwjwdx.js → session-state-8PJZvuR3.js} +28 -20
  66. package/dist/session-state-8PJZvuR3.js.map +1 -0
  67. package/dist/{session-store-DCs--1kc.d.ts → session-store-CERvTeaV.d.ts} +25 -40
  68. package/dist/{sink-checkpoint-store-CasqHvDz.d.ts → sink-checkpoint-store-DTiswoqy.d.ts} +2 -2
  69. package/dist/{sink-registry-DUkifMag.js → sink-registry-B4yxTmlI.js} +33 -8
  70. package/dist/sink-registry-B4yxTmlI.js.map +1 -0
  71. package/dist/testkit/layers.d.ts +10 -16
  72. package/dist/testkit/layers.js +6 -6
  73. package/dist/testkit/layers.js.map +1 -1
  74. package/dist/{tool-registry-CHMtDCJ5.d.ts → tool-registry-D4ALie3K.d.ts} +11 -4
  75. package/dist/types/events/durable.d.ts +2 -2
  76. package/dist/types/events/durable.js +2 -2
  77. package/dist/types/events.d.ts +4 -4
  78. package/dist/types/events.js +3 -3
  79. package/dist/websocket.d.ts +66 -66
  80. package/dist/websocket.js +2 -2
  81. package/package.json +1 -1
  82. package/dist/command-queues-CtOtDZm3.d.ts +0 -556
  83. package/dist/compaction-BfzzyWko.d.ts +0 -165
  84. package/dist/durable-D_tjjz4B.js.map +0 -1
  85. package/dist/envelope-DxQzo5rN.js.map +0 -1
  86. package/dist/event-factory-CClLXzI9.d.ts +0 -91
  87. package/dist/index-BVVgDSdq.d.ts +0 -1
  88. package/dist/message-transcript-CEp0gCSQ.d.ts +0 -32
  89. package/dist/prompt-projector-Dh1-qvCH.d.ts +0 -39
  90. package/dist/reduced-state-BAKvToAh.js.map +0 -1
  91. package/dist/run-scheduler-CpPjFQD7.d.ts +0 -43
  92. package/dist/runtime-CX1M7jgX.d.ts +0 -69
  93. package/dist/session-query-BHB4OxR_.d.ts +0 -46
  94. package/dist/session-state-CWKwjwdx.js.map +0 -1
  95. package/dist/session-state-dE07Zzcr.d.ts +0 -895
  96. package/dist/sink-registry-CEBjrMd_.d.ts +0 -140
  97. package/dist/sink-registry-DUkifMag.js.map +0 -1
@@ -0,0 +1,2167 @@
1
+ import { c as StopTurnCommand, l as SubmitMessageCommand, o as PromotePendingMessageCommand, s as ResumePendingMessagesCommand, t as CancelPendingMessageCommand } from "./commands-p8venTWs.js";
2
+ import * as Schema from "effect/Schema";
3
+
4
+ //#region src/domain/reduced-state-schema.d.ts
5
+ /**
6
+ * Canonical Effect Prompt file part with an explicit JSON string encoding.
7
+ *
8
+ * Strings pass through unchanged, URLs use their href, and bytes become a data
9
+ * URL. Decoding produces the normal Prompt.FilePart type.
10
+ */
11
+ declare const JsonPromptFilePart: Schema.decodeTo<Schema.Struct<{
12
+ readonly type: Schema.Literal<"file">;
13
+ readonly mediaType: Schema.String;
14
+ readonly fileName: Schema.optional<Schema.String>;
15
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
16
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
17
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
18
+ }>, Schema.Struct<{
19
+ readonly data: Schema.String;
20
+ readonly type: Schema.Literal<"file">;
21
+ readonly mediaType: Schema.String;
22
+ readonly fileName: Schema.optional<Schema.String>;
23
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
24
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
25
+ }>, never, never>;
26
+ declare const JsonUserMessagePart: Schema.Union<readonly [Schema.Struct<{
27
+ readonly type: Schema.Literal<"text">;
28
+ readonly text: Schema.String;
29
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
30
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
31
+ }>, Schema.decodeTo<Schema.Struct<{
32
+ readonly type: Schema.Literal<"file">;
33
+ readonly mediaType: Schema.String;
34
+ readonly fileName: Schema.optional<Schema.String>;
35
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
36
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
37
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
38
+ }>, Schema.Struct<{
39
+ readonly data: Schema.String;
40
+ readonly type: Schema.Literal<"file">;
41
+ readonly mediaType: Schema.String;
42
+ readonly fileName: Schema.optional<Schema.String>;
43
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
44
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
45
+ }>, never, never>]>;
46
+ declare const JsonUserMessageContent: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
47
+ readonly type: Schema.Literal<"text">;
48
+ readonly text: Schema.String;
49
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
50
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
51
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
52
+ readonly type: Schema.Literal<"text">;
53
+ readonly text: Schema.String;
54
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
55
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
56
+ }>, Schema.decodeTo<Schema.Struct<{
57
+ readonly type: Schema.Literal<"file">;
58
+ readonly mediaType: Schema.String;
59
+ readonly fileName: Schema.optional<Schema.String>;
60
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
61
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
62
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
63
+ }>, Schema.Struct<{
64
+ readonly data: Schema.String;
65
+ readonly type: Schema.Literal<"file">;
66
+ readonly mediaType: Schema.String;
67
+ readonly fileName: Schema.optional<Schema.String>;
68
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
69
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
70
+ }>, never, never>]>>]>;
71
+ declare const JsonAssistantMessagePart: Schema.Union<readonly [Schema.Struct<{
72
+ readonly type: Schema.Literal<"text">;
73
+ readonly text: Schema.String;
74
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
75
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
76
+ }>, Schema.decodeTo<Schema.Struct<{
77
+ readonly type: Schema.Literal<"file">;
78
+ readonly mediaType: Schema.String;
79
+ readonly fileName: Schema.optional<Schema.String>;
80
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
81
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
82
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
83
+ }>, Schema.Struct<{
84
+ readonly data: Schema.String;
85
+ readonly type: Schema.Literal<"file">;
86
+ readonly mediaType: Schema.String;
87
+ readonly fileName: Schema.optional<Schema.String>;
88
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
89
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
90
+ }>, never, never>, Schema.Struct<{
91
+ readonly type: Schema.Literal<"reasoning">;
92
+ readonly text: Schema.String;
93
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
94
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
95
+ }>, Schema.Struct<{
96
+ readonly type: Schema.Literal<"tool-call">;
97
+ readonly id: Schema.String;
98
+ readonly name: Schema.String;
99
+ readonly params: Schema.Unknown;
100
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
101
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
102
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
103
+ }>, Schema.Struct<{
104
+ readonly type: Schema.Literal<"tool-result">;
105
+ readonly id: Schema.String;
106
+ readonly name: Schema.String;
107
+ readonly isFailure: Schema.Boolean;
108
+ readonly result: Schema.Unknown;
109
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
110
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
111
+ }>, Schema.Struct<{
112
+ readonly type: Schema.Literal<"tool-approval-request">;
113
+ readonly approvalId: Schema.String;
114
+ readonly toolCallId: Schema.String;
115
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
116
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
117
+ }>]>;
118
+ /**
119
+ * Command schema for JSON snapshots.
120
+ *
121
+ * Every command except SubmitMessage is reused directly. SubmitMessage only
122
+ * replaces canonical Prompt file data with its explicit JSON string projection.
123
+ */
124
+ declare const JsonEDACommand: Schema.Union<readonly [Schema.Struct<{
125
+ readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
126
+ readonly type: Schema.Literal<"text">;
127
+ readonly text: Schema.String;
128
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
129
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
130
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
131
+ readonly type: Schema.Literal<"text">;
132
+ readonly text: Schema.String;
133
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
134
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
135
+ }>, Schema.decodeTo<Schema.Struct<{
136
+ readonly type: Schema.Literal<"file">;
137
+ readonly mediaType: Schema.String;
138
+ readonly fileName: Schema.optional<Schema.String>;
139
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
140
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
141
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
142
+ }>, Schema.Struct<{
143
+ readonly data: Schema.String;
144
+ readonly type: Schema.Literal<"file">;
145
+ readonly mediaType: Schema.String;
146
+ readonly fileName: Schema.optional<Schema.String>;
147
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
148
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
149
+ }>, never, never>]>>]>;
150
+ readonly _tag: Schema.tag<"SubmitMessage">;
151
+ readonly disposition: Schema.Literals<readonly ["queue", "steer", "interrupt"]>;
152
+ readonly expectedPausedMessageIdsToCancel: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "MessageId">>>;
153
+ readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
154
+ readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
155
+ }>, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
156
+ declare const CommandTerminalSchema: Schema.Union<readonly [Schema.Struct<{
157
+ readonly _tag: Schema.Literal<"Completed">;
158
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
159
+ }>, Schema.Struct<{
160
+ readonly _tag: Schema.Literal<"Failed">;
161
+ readonly error: Schema.Struct<{
162
+ readonly message: Schema.String;
163
+ readonly code: Schema.optionalKey<Schema.String>;
164
+ readonly details: Schema.optionalKey<Schema.Unknown>;
165
+ }>;
166
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
167
+ }>, Schema.Struct<{
168
+ readonly _tag: Schema.Literal<"Cancelled">;
169
+ readonly reason: Schema.String;
170
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
171
+ }>]>;
172
+ declare const RunTerminalSchema: Schema.Union<readonly [Schema.Struct<{
173
+ readonly _tag: Schema.Literal<"Completed">;
174
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
175
+ }>, Schema.Struct<{
176
+ readonly _tag: Schema.Literal<"Failed">;
177
+ readonly error: Schema.Struct<{
178
+ readonly message: Schema.String;
179
+ readonly code: Schema.optionalKey<Schema.String>;
180
+ readonly details: Schema.optionalKey<Schema.Unknown>;
181
+ }>;
182
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
183
+ }>, Schema.Struct<{
184
+ readonly _tag: Schema.Literal<"Interrupted">;
185
+ readonly reason: Schema.String;
186
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
187
+ }>]>;
188
+ declare const TurnTerminalSchema: Schema.Union<readonly [Schema.Struct<{
189
+ readonly _tag: Schema.Literal<"Completed">;
190
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
191
+ readonly usage: Schema.optionalKey<Schema.Struct<{
192
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
193
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
194
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
195
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
196
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
197
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
198
+ }>>;
199
+ }>, Schema.Struct<{
200
+ readonly _tag: Schema.Literal<"Failed">;
201
+ readonly error: Schema.Struct<{
202
+ readonly message: Schema.String;
203
+ readonly code: Schema.optionalKey<Schema.String>;
204
+ readonly details: Schema.optionalKey<Schema.Unknown>;
205
+ }>;
206
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
207
+ }>, Schema.Struct<{
208
+ readonly _tag: Schema.Literal<"Stopped">;
209
+ readonly reason: Schema.String;
210
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
211
+ }>]>;
212
+ declare const InferenceTerminalSchema: Schema.Union<readonly [Schema.Struct<{
213
+ readonly _tag: Schema.Literal<"Completed">;
214
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
215
+ readonly usage: Schema.optionalKey<Schema.Struct<{
216
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
217
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
218
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
219
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
220
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
221
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
222
+ }>>;
223
+ }>, Schema.Struct<{
224
+ readonly _tag: Schema.Literal<"Failed">;
225
+ readonly error: Schema.Struct<{
226
+ readonly message: Schema.String;
227
+ readonly code: Schema.optionalKey<Schema.String>;
228
+ readonly details: Schema.optionalKey<Schema.Unknown>;
229
+ }>;
230
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
231
+ }>]>;
232
+ declare const CommandRecordSchema: Schema.Struct<{
233
+ readonly admittedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
234
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
235
+ readonly span: Schema.Struct<{
236
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
237
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
238
+ readonly sampled: Schema.Boolean;
239
+ readonly tracestate: Schema.NullOr<Schema.String>;
240
+ }>;
241
+ readonly links: Schema.$Array<Schema.Struct<{
242
+ readonly context: Schema.Struct<{
243
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
244
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
245
+ readonly sampled: Schema.Boolean;
246
+ readonly tracestate: Schema.NullOr<Schema.String>;
247
+ }>;
248
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
249
+ }>>;
250
+ }>>;
251
+ readonly command: Schema.optionalKey<Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>>;
252
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
253
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
254
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
255
+ readonly _tag: Schema.Literal<"Completed">;
256
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
257
+ }>, Schema.Struct<{
258
+ readonly _tag: Schema.Literal<"Failed">;
259
+ readonly error: Schema.Struct<{
260
+ readonly message: Schema.String;
261
+ readonly code: Schema.optionalKey<Schema.String>;
262
+ readonly details: Schema.optionalKey<Schema.Unknown>;
263
+ }>;
264
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
265
+ }>, Schema.Struct<{
266
+ readonly _tag: Schema.Literal<"Cancelled">;
267
+ readonly reason: Schema.String;
268
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
269
+ }>]>>;
270
+ }>;
271
+ declare const JsonCommandRecordSchema: Schema.Struct<{
272
+ readonly command: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
273
+ readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
274
+ readonly type: Schema.Literal<"text">;
275
+ readonly text: Schema.String;
276
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
277
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
278
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
279
+ readonly type: Schema.Literal<"text">;
280
+ readonly text: Schema.String;
281
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
282
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
283
+ }>, Schema.decodeTo<Schema.Struct<{
284
+ readonly type: Schema.Literal<"file">;
285
+ readonly mediaType: Schema.String;
286
+ readonly fileName: Schema.optional<Schema.String>;
287
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
288
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
289
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
290
+ }>, Schema.Struct<{
291
+ readonly data: Schema.String;
292
+ readonly type: Schema.Literal<"file">;
293
+ readonly mediaType: Schema.String;
294
+ readonly fileName: Schema.optional<Schema.String>;
295
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
296
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
297
+ }>, never, never>]>>]>;
298
+ readonly _tag: Schema.tag<"SubmitMessage">;
299
+ readonly disposition: Schema.Literals<readonly ["queue", "steer", "interrupt"]>;
300
+ readonly expectedPausedMessageIdsToCancel: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "MessageId">>>;
301
+ readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
302
+ readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
303
+ }>, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>>;
304
+ readonly admittedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
305
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
306
+ readonly span: Schema.Struct<{
307
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
308
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
309
+ readonly sampled: Schema.Boolean;
310
+ readonly tracestate: Schema.NullOr<Schema.String>;
311
+ }>;
312
+ readonly links: Schema.$Array<Schema.Struct<{
313
+ readonly context: Schema.Struct<{
314
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
315
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
316
+ readonly sampled: Schema.Boolean;
317
+ readonly tracestate: Schema.NullOr<Schema.String>;
318
+ }>;
319
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
320
+ }>>;
321
+ }>>;
322
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
323
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
324
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
325
+ readonly _tag: Schema.Literal<"Completed">;
326
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
327
+ }>, Schema.Struct<{
328
+ readonly _tag: Schema.Literal<"Failed">;
329
+ readonly error: Schema.Struct<{
330
+ readonly message: Schema.String;
331
+ readonly code: Schema.optionalKey<Schema.String>;
332
+ readonly details: Schema.optionalKey<Schema.Unknown>;
333
+ }>;
334
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
335
+ }>, Schema.Struct<{
336
+ readonly _tag: Schema.Literal<"Cancelled">;
337
+ readonly reason: Schema.String;
338
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
339
+ }>]>>;
340
+ }>;
341
+ declare const RunRecordSchema: Schema.Struct<{
342
+ readonly commandIds: Schema.$Array<Schema.brand<Schema.String, "CommandId">>;
343
+ readonly runId: Schema.brand<Schema.String, "RunId">;
344
+ readonly startedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
345
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
346
+ readonly _tag: Schema.Literal<"Completed">;
347
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
348
+ }>, Schema.Struct<{
349
+ readonly _tag: Schema.Literal<"Failed">;
350
+ readonly error: Schema.Struct<{
351
+ readonly message: Schema.String;
352
+ readonly code: Schema.optionalKey<Schema.String>;
353
+ readonly details: Schema.optionalKey<Schema.Unknown>;
354
+ }>;
355
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
356
+ }>, Schema.Struct<{
357
+ readonly _tag: Schema.Literal<"Interrupted">;
358
+ readonly reason: Schema.String;
359
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
360
+ }>]>>;
361
+ readonly trace: Schema.Struct<{
362
+ readonly root: Schema.Struct<{
363
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
364
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
365
+ readonly sampled: Schema.Boolean;
366
+ readonly tracestate: Schema.NullOr<Schema.String>;
367
+ }>;
368
+ readonly links: Schema.$Array<Schema.Struct<{
369
+ readonly context: Schema.Struct<{
370
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
371
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
372
+ readonly sampled: Schema.Boolean;
373
+ readonly tracestate: Schema.NullOr<Schema.String>;
374
+ }>;
375
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
376
+ }>>;
377
+ }>;
378
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
379
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
380
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
381
+ readonly modelSelection: Schema.optionalKey<Schema.Struct<{
382
+ readonly provider: Schema.NonEmptyString;
383
+ readonly modelId: Schema.NonEmptyString;
384
+ readonly settings: Schema.optionalKey<Schema.Unknown>;
385
+ }>>;
386
+ }>;
387
+ declare const TurnRecordSchema: Schema.Struct<{
388
+ readonly runId: Schema.brand<Schema.String, "RunId">;
389
+ readonly startedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
390
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
391
+ readonly _tag: Schema.Literal<"Completed">;
392
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
393
+ readonly usage: Schema.optionalKey<Schema.Struct<{
394
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
395
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
396
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
397
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
398
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
399
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
400
+ }>>;
401
+ }>, Schema.Struct<{
402
+ readonly _tag: Schema.Literal<"Failed">;
403
+ readonly error: Schema.Struct<{
404
+ readonly message: Schema.String;
405
+ readonly code: Schema.optionalKey<Schema.String>;
406
+ readonly details: Schema.optionalKey<Schema.Unknown>;
407
+ }>;
408
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
409
+ }>, Schema.Struct<{
410
+ readonly _tag: Schema.Literal<"Stopped">;
411
+ readonly reason: Schema.String;
412
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
413
+ }>]>>;
414
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
415
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
416
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
417
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
418
+ }>;
419
+ declare const InferenceRecordSchema: Schema.Struct<{
420
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
421
+ readonly runId: Schema.brand<Schema.String, "RunId">;
422
+ readonly startedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
423
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
424
+ readonly _tag: Schema.Literal<"Completed">;
425
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
426
+ readonly usage: Schema.optionalKey<Schema.Struct<{
427
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
428
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
429
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
430
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
431
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
432
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
433
+ }>>;
434
+ }>, Schema.Struct<{
435
+ readonly _tag: Schema.Literal<"Failed">;
436
+ readonly error: Schema.Struct<{
437
+ readonly message: Schema.String;
438
+ readonly code: Schema.optionalKey<Schema.String>;
439
+ readonly details: Schema.optionalKey<Schema.Unknown>;
440
+ }>;
441
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
442
+ }>]>>;
443
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
444
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
445
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
446
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
447
+ }>;
448
+ declare const ToolDecisionSchema: Schema.Union<readonly [Schema.Struct<{
449
+ readonly _tag: Schema.Literal<"Created">;
450
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
451
+ readonly params: Schema.Unknown;
452
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
453
+ readonly type: Schema.Literal<"tool-call">;
454
+ readonly id: Schema.String;
455
+ readonly name: Schema.String;
456
+ readonly params: Schema.Unknown;
457
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
458
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
459
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
460
+ }>>;
461
+ readonly providerExecuted: Schema.Boolean;
462
+ readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
463
+ readonly runId: Schema.brand<Schema.String, "RunId">;
464
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
465
+ readonly toolName: Schema.NonEmptyString;
466
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
467
+ }>, Schema.Struct<{
468
+ readonly _tag: Schema.Literal<"Rejected">;
469
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
470
+ readonly modelFeedback: Schema.String;
471
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
472
+ readonly type: Schema.Literal<"tool-result">;
473
+ readonly id: Schema.String;
474
+ readonly name: Schema.String;
475
+ readonly isFailure: Schema.Boolean;
476
+ readonly result: Schema.Unknown;
477
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
478
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
479
+ }>>;
480
+ readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
481
+ readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
482
+ readonly runId: Schema.brand<Schema.String, "RunId">;
483
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
484
+ readonly toolName: Schema.NonEmptyString;
485
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
486
+ }>]>;
487
+ declare const ToolTerminalSchema: Schema.Union<readonly [Schema.Struct<{
488
+ readonly _tag: Schema.Literal<"Completed">;
489
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
490
+ readonly type: Schema.Literal<"tool-result">;
491
+ readonly id: Schema.String;
492
+ readonly name: Schema.String;
493
+ readonly isFailure: Schema.Boolean;
494
+ readonly result: Schema.Unknown;
495
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
496
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
497
+ }>>;
498
+ readonly result: Schema.Unknown;
499
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
500
+ }>, Schema.Struct<{
501
+ readonly _tag: Schema.Literal<"Failed">;
502
+ readonly error: Schema.Struct<{
503
+ readonly message: Schema.String;
504
+ readonly code: Schema.optionalKey<Schema.String>;
505
+ readonly details: Schema.optionalKey<Schema.Unknown>;
506
+ }>;
507
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
508
+ readonly type: Schema.Literal<"tool-result">;
509
+ readonly id: Schema.String;
510
+ readonly name: Schema.String;
511
+ readonly isFailure: Schema.Boolean;
512
+ readonly result: Schema.Unknown;
513
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
514
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
515
+ }>>;
516
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
517
+ }>]>;
518
+ declare const ToolCallRecordSchema: Schema.Struct<{
519
+ readonly decision: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
520
+ readonly _tag: Schema.Literal<"Created">;
521
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
522
+ readonly params: Schema.Unknown;
523
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
524
+ readonly type: Schema.Literal<"tool-call">;
525
+ readonly id: Schema.String;
526
+ readonly name: Schema.String;
527
+ readonly params: Schema.Unknown;
528
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
529
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
530
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
531
+ }>>;
532
+ readonly providerExecuted: Schema.Boolean;
533
+ readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
534
+ readonly runId: Schema.brand<Schema.String, "RunId">;
535
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
536
+ readonly toolName: Schema.NonEmptyString;
537
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
538
+ }>, Schema.Struct<{
539
+ readonly _tag: Schema.Literal<"Rejected">;
540
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
541
+ readonly modelFeedback: Schema.String;
542
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
543
+ readonly type: Schema.Literal<"tool-result">;
544
+ readonly id: Schema.String;
545
+ readonly name: Schema.String;
546
+ readonly isFailure: Schema.Boolean;
547
+ readonly result: Schema.Unknown;
548
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
549
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
550
+ }>>;
551
+ readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
552
+ readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
553
+ readonly runId: Schema.brand<Schema.String, "RunId">;
554
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
555
+ readonly toolName: Schema.NonEmptyString;
556
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
557
+ }>]>>;
558
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
559
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
560
+ readonly _tag: Schema.Literal<"Completed">;
561
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
562
+ readonly type: Schema.Literal<"tool-result">;
563
+ readonly id: Schema.String;
564
+ readonly name: Schema.String;
565
+ readonly isFailure: Schema.Boolean;
566
+ readonly result: Schema.Unknown;
567
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
568
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
569
+ }>>;
570
+ readonly result: Schema.Unknown;
571
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
572
+ }>, Schema.Struct<{
573
+ readonly _tag: Schema.Literal<"Failed">;
574
+ readonly error: Schema.Struct<{
575
+ readonly message: Schema.String;
576
+ readonly code: Schema.optionalKey<Schema.String>;
577
+ readonly details: Schema.optionalKey<Schema.Unknown>;
578
+ }>;
579
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
580
+ readonly type: Schema.Literal<"tool-result">;
581
+ readonly id: Schema.String;
582
+ readonly name: Schema.String;
583
+ readonly isFailure: Schema.Boolean;
584
+ readonly result: Schema.Unknown;
585
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
586
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
587
+ }>>;
588
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
589
+ }>]>>;
590
+ readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
591
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
592
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
593
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
594
+ }>;
595
+ declare const MessageRecordSchema: Schema.Union<readonly [Schema.Struct<{
596
+ readonly _tag: Schema.Literal<"System">;
597
+ readonly content: Schema.NonEmptyString;
598
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
599
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
600
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
601
+ }>, Schema.Struct<{
602
+ readonly _tag: Schema.Literal<"User">;
603
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
604
+ readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
605
+ readonly type: Schema.Literal<"text">;
606
+ readonly text: Schema.String;
607
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
608
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
609
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
610
+ readonly type: Schema.Literal<"text">;
611
+ readonly text: Schema.String;
612
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
613
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
614
+ }>, Schema.Struct<{
615
+ readonly type: Schema.Literal<"file">;
616
+ readonly mediaType: Schema.String;
617
+ readonly fileName: Schema.optional<Schema.String>;
618
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
619
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
620
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
621
+ }>]>>]>;
622
+ readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
623
+ readonly requestedDisposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
624
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
625
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
626
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
627
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
628
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
629
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
630
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
631
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
632
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
633
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
634
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
635
+ }>, Schema.Struct<{
636
+ readonly _tag: Schema.Literal<"Steering">;
637
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
638
+ readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
639
+ readonly type: Schema.Literal<"text">;
640
+ readonly text: Schema.String;
641
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
642
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
643
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
644
+ readonly type: Schema.Literal<"text">;
645
+ readonly text: Schema.String;
646
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
647
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
648
+ }>, Schema.Struct<{
649
+ readonly type: Schema.Literal<"file">;
650
+ readonly mediaType: Schema.String;
651
+ readonly fileName: Schema.optional<Schema.String>;
652
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
653
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
654
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
655
+ }>]>>]>;
656
+ readonly runId: Schema.brand<Schema.String, "RunId">;
657
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
658
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
659
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
660
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
661
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
662
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
663
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
664
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
665
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
666
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
667
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
668
+ }>, Schema.Struct<{
669
+ readonly _tag: Schema.Literal<"Assistant">;
670
+ readonly content: Schema.Struct<{
671
+ readonly text: Schema.String;
672
+ readonly reasoning: Schema.optionalKey<Schema.String>;
673
+ }>;
674
+ readonly imported: Schema.optionalKey<Schema.Literal<true>>;
675
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
676
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
677
+ readonly type: Schema.Literal<"text">;
678
+ readonly text: Schema.String;
679
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
680
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
681
+ }>, Schema.Struct<{
682
+ readonly type: Schema.Literal<"file">;
683
+ readonly mediaType: Schema.String;
684
+ readonly fileName: Schema.optional<Schema.String>;
685
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
686
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
687
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
688
+ }>, Schema.Struct<{
689
+ readonly type: Schema.Literal<"reasoning">;
690
+ readonly text: Schema.String;
691
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
692
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
693
+ }>, Schema.Struct<{
694
+ readonly type: Schema.Literal<"tool-call">;
695
+ readonly id: Schema.String;
696
+ readonly name: Schema.String;
697
+ readonly params: Schema.Unknown;
698
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
699
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
700
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
701
+ }>, Schema.Struct<{
702
+ readonly type: Schema.Literal<"tool-result">;
703
+ readonly id: Schema.String;
704
+ readonly name: Schema.String;
705
+ readonly isFailure: Schema.Boolean;
706
+ readonly result: Schema.Unknown;
707
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
708
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
709
+ }>, Schema.Struct<{
710
+ readonly type: Schema.Literal<"tool-approval-request">;
711
+ readonly approvalId: Schema.String;
712
+ readonly toolCallId: Schema.String;
713
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
714
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
715
+ }>]>>>;
716
+ readonly runId: Schema.brand<Schema.String, "RunId">;
717
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
718
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
719
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
720
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
721
+ }>, Schema.Struct<{
722
+ readonly _tag: Schema.Literal<"AssistantPartial">;
723
+ readonly content: Schema.Struct<{
724
+ readonly text: Schema.String;
725
+ readonly reasoning: Schema.optionalKey<Schema.String>;
726
+ }>;
727
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
728
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
729
+ readonly type: Schema.Literal<"text">;
730
+ readonly text: Schema.String;
731
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
732
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
733
+ }>, Schema.Struct<{
734
+ readonly type: Schema.Literal<"file">;
735
+ readonly mediaType: Schema.String;
736
+ readonly fileName: Schema.optional<Schema.String>;
737
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
738
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
739
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
740
+ }>, Schema.Struct<{
741
+ readonly type: Schema.Literal<"reasoning">;
742
+ readonly text: Schema.String;
743
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
744
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
745
+ }>, Schema.Struct<{
746
+ readonly type: Schema.Literal<"tool-call">;
747
+ readonly id: Schema.String;
748
+ readonly name: Schema.String;
749
+ readonly params: Schema.Unknown;
750
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
751
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
752
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
753
+ }>, Schema.Struct<{
754
+ readonly type: Schema.Literal<"tool-result">;
755
+ readonly id: Schema.String;
756
+ readonly name: Schema.String;
757
+ readonly isFailure: Schema.Boolean;
758
+ readonly result: Schema.Unknown;
759
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
760
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
761
+ }>, Schema.Struct<{
762
+ readonly type: Schema.Literal<"tool-approval-request">;
763
+ readonly approvalId: Schema.String;
764
+ readonly toolCallId: Schema.String;
765
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
766
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
767
+ }>]>>>;
768
+ readonly reason: Schema.String;
769
+ readonly runId: Schema.brand<Schema.String, "RunId">;
770
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
771
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
772
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
773
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
774
+ }>]>;
775
+ /** Lossless structured-clone query content; admission string transforms do not apply. */
776
+ declare const QueryUserMessageContent: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
777
+ readonly type: Schema.Literal<"text">;
778
+ readonly text: Schema.String;
779
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
780
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
781
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
782
+ readonly type: Schema.Literal<"text">;
783
+ readonly text: Schema.String;
784
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
785
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
786
+ }>, Schema.Struct<{
787
+ readonly type: Schema.Literal<"file">;
788
+ readonly mediaType: Schema.String;
789
+ readonly fileName: Schema.optional<Schema.String>;
790
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
791
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
792
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
793
+ }>]>>]>>;
794
+ /** Message query records preserve Prompt-part arrays and their structured-clone fields. */
795
+ declare const QueryMessageRecordSchema: Schema.Union<readonly [Schema.Struct<{
796
+ readonly _tag: Schema.Literal<"System">;
797
+ readonly content: Schema.NonEmptyString;
798
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
799
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
800
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
801
+ }>, Schema.Struct<{
802
+ readonly _tag: Schema.Literal<"User">;
803
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
804
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
805
+ readonly type: Schema.Literal<"text">;
806
+ readonly text: Schema.String;
807
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
808
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
809
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
810
+ readonly type: Schema.Literal<"text">;
811
+ readonly text: Schema.String;
812
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
813
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
814
+ }>, Schema.Struct<{
815
+ readonly type: Schema.Literal<"file">;
816
+ readonly mediaType: Schema.String;
817
+ readonly fileName: Schema.optional<Schema.String>;
818
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
819
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
820
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
821
+ }>]>>]>>;
822
+ readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
823
+ readonly requestedDisposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
824
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
825
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
826
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
827
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
828
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
829
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
830
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
831
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
832
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
833
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
834
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
835
+ }>, Schema.Struct<{
836
+ readonly _tag: Schema.Literal<"Steering">;
837
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
838
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
839
+ readonly type: Schema.Literal<"text">;
840
+ readonly text: Schema.String;
841
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
842
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
843
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
844
+ readonly type: Schema.Literal<"text">;
845
+ readonly text: Schema.String;
846
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
847
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
848
+ }>, Schema.Struct<{
849
+ readonly type: Schema.Literal<"file">;
850
+ readonly mediaType: Schema.String;
851
+ readonly fileName: Schema.optional<Schema.String>;
852
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
853
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
854
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
855
+ }>]>>]>>;
856
+ readonly runId: Schema.brand<Schema.String, "RunId">;
857
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
858
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
859
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
860
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
861
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
862
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
863
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
864
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
865
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
866
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
867
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
868
+ }>, Schema.Struct<{
869
+ readonly _tag: Schema.Literal<"Assistant">;
870
+ readonly content: Schema.Struct<{
871
+ readonly text: Schema.String;
872
+ readonly reasoning: Schema.optionalKey<Schema.String>;
873
+ }>;
874
+ readonly imported: Schema.optionalKey<Schema.Literal<true>>;
875
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
876
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.toType<Schema.Struct<{
877
+ readonly type: Schema.Literal<"text">;
878
+ readonly text: Schema.String;
879
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
880
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
881
+ }>>, Schema.toType<Schema.Struct<{
882
+ readonly type: Schema.Literal<"file">;
883
+ readonly mediaType: Schema.String;
884
+ readonly fileName: Schema.optional<Schema.String>;
885
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
886
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
887
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
888
+ }>>, Schema.toType<Schema.Struct<{
889
+ readonly type: Schema.Literal<"reasoning">;
890
+ readonly text: Schema.String;
891
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
892
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
893
+ }>>, Schema.toType<Schema.Struct<{
894
+ readonly type: Schema.Literal<"tool-call">;
895
+ readonly id: Schema.String;
896
+ readonly name: Schema.String;
897
+ readonly params: Schema.Unknown;
898
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
899
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
900
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
901
+ }>>, Schema.toType<Schema.Struct<{
902
+ readonly type: Schema.Literal<"tool-result">;
903
+ readonly id: Schema.String;
904
+ readonly name: Schema.String;
905
+ readonly isFailure: Schema.Boolean;
906
+ readonly result: Schema.Unknown;
907
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
908
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
909
+ }>>, Schema.toType<Schema.Struct<{
910
+ readonly type: Schema.Literal<"tool-approval-request">;
911
+ readonly approvalId: Schema.String;
912
+ readonly toolCallId: Schema.String;
913
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
914
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
915
+ }>>]>>>;
916
+ readonly runId: Schema.brand<Schema.String, "RunId">;
917
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
918
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
919
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
920
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
921
+ }>, Schema.Struct<{
922
+ readonly _tag: Schema.Literal<"AssistantPartial">;
923
+ readonly content: Schema.Struct<{
924
+ readonly text: Schema.String;
925
+ readonly reasoning: Schema.optionalKey<Schema.String>;
926
+ }>;
927
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
928
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.toType<Schema.Struct<{
929
+ readonly type: Schema.Literal<"text">;
930
+ readonly text: Schema.String;
931
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
932
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
933
+ }>>, Schema.toType<Schema.Struct<{
934
+ readonly type: Schema.Literal<"file">;
935
+ readonly mediaType: Schema.String;
936
+ readonly fileName: Schema.optional<Schema.String>;
937
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
938
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
939
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
940
+ }>>, Schema.toType<Schema.Struct<{
941
+ readonly type: Schema.Literal<"reasoning">;
942
+ readonly text: Schema.String;
943
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
944
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
945
+ }>>, Schema.toType<Schema.Struct<{
946
+ readonly type: Schema.Literal<"tool-call">;
947
+ readonly id: Schema.String;
948
+ readonly name: Schema.String;
949
+ readonly params: Schema.Unknown;
950
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
951
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
952
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
953
+ }>>, Schema.toType<Schema.Struct<{
954
+ readonly type: Schema.Literal<"tool-result">;
955
+ readonly id: Schema.String;
956
+ readonly name: Schema.String;
957
+ readonly isFailure: Schema.Boolean;
958
+ readonly result: Schema.Unknown;
959
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
960
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
961
+ }>>, Schema.toType<Schema.Struct<{
962
+ readonly type: Schema.Literal<"tool-approval-request">;
963
+ readonly approvalId: Schema.String;
964
+ readonly toolCallId: Schema.String;
965
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
966
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
967
+ }>>]>>>;
968
+ readonly reason: Schema.String;
969
+ readonly runId: Schema.brand<Schema.String, "RunId">;
970
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
971
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
972
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
973
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
974
+ }>]>;
975
+ declare const JsonMessageRecordSchema: Schema.Union<readonly [Schema.Struct<{
976
+ readonly _tag: Schema.Literal<"System">;
977
+ readonly content: Schema.NonEmptyString;
978
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
979
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
980
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
981
+ }>, Schema.Struct<{
982
+ readonly _tag: Schema.Literal<"User">;
983
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
984
+ readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
985
+ readonly type: Schema.Literal<"text">;
986
+ readonly text: Schema.String;
987
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
988
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
989
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
990
+ readonly type: Schema.Literal<"text">;
991
+ readonly text: Schema.String;
992
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
993
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
994
+ }>, Schema.decodeTo<Schema.Struct<{
995
+ readonly type: Schema.Literal<"file">;
996
+ readonly mediaType: Schema.String;
997
+ readonly fileName: Schema.optional<Schema.String>;
998
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
999
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1000
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1001
+ }>, Schema.Struct<{
1002
+ readonly data: Schema.String;
1003
+ readonly type: Schema.Literal<"file">;
1004
+ readonly mediaType: Schema.String;
1005
+ readonly fileName: Schema.optional<Schema.String>;
1006
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1007
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1008
+ }>, never, never>]>>]>;
1009
+ readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
1010
+ readonly requestedDisposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
1011
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
1012
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1013
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1014
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1015
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1016
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1017
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1018
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1019
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1020
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1021
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1022
+ }>, Schema.Struct<{
1023
+ readonly _tag: Schema.Literal<"Steering">;
1024
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1025
+ readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1026
+ readonly type: Schema.Literal<"text">;
1027
+ readonly text: Schema.String;
1028
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1029
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1030
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1031
+ readonly type: Schema.Literal<"text">;
1032
+ readonly text: Schema.String;
1033
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1034
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1035
+ }>, Schema.decodeTo<Schema.Struct<{
1036
+ readonly type: Schema.Literal<"file">;
1037
+ readonly mediaType: Schema.String;
1038
+ readonly fileName: Schema.optional<Schema.String>;
1039
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1040
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1041
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1042
+ }>, Schema.Struct<{
1043
+ readonly data: Schema.String;
1044
+ readonly type: Schema.Literal<"file">;
1045
+ readonly mediaType: Schema.String;
1046
+ readonly fileName: Schema.optional<Schema.String>;
1047
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1048
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1049
+ }>, never, never>]>>]>;
1050
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1051
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
1052
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1053
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1054
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1055
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1056
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1057
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1058
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1059
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1060
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1061
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1062
+ }>, Schema.Struct<{
1063
+ readonly _tag: Schema.Literal<"Assistant">;
1064
+ readonly content: Schema.Struct<{
1065
+ readonly text: Schema.String;
1066
+ readonly reasoning: Schema.optionalKey<Schema.String>;
1067
+ }>;
1068
+ readonly imported: Schema.optionalKey<Schema.Literal<true>>;
1069
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1070
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1071
+ readonly type: Schema.Literal<"text">;
1072
+ readonly text: Schema.String;
1073
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1074
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1075
+ }>, Schema.decodeTo<Schema.Struct<{
1076
+ readonly type: Schema.Literal<"file">;
1077
+ readonly mediaType: Schema.String;
1078
+ readonly fileName: Schema.optional<Schema.String>;
1079
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1080
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1081
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1082
+ }>, Schema.Struct<{
1083
+ readonly data: Schema.String;
1084
+ readonly type: Schema.Literal<"file">;
1085
+ readonly mediaType: Schema.String;
1086
+ readonly fileName: Schema.optional<Schema.String>;
1087
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1088
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1089
+ }>, never, never>, Schema.Struct<{
1090
+ readonly type: Schema.Literal<"reasoning">;
1091
+ readonly text: Schema.String;
1092
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1093
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1094
+ }>, Schema.Struct<{
1095
+ readonly type: Schema.Literal<"tool-call">;
1096
+ readonly id: Schema.String;
1097
+ readonly name: Schema.String;
1098
+ readonly params: Schema.Unknown;
1099
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1100
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1101
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1102
+ }>, Schema.Struct<{
1103
+ readonly type: Schema.Literal<"tool-result">;
1104
+ readonly id: Schema.String;
1105
+ readonly name: Schema.String;
1106
+ readonly isFailure: Schema.Boolean;
1107
+ readonly result: Schema.Unknown;
1108
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1109
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1110
+ }>, Schema.Struct<{
1111
+ readonly type: Schema.Literal<"tool-approval-request">;
1112
+ readonly approvalId: Schema.String;
1113
+ readonly toolCallId: Schema.String;
1114
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1115
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1116
+ }>]>>>;
1117
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1118
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1119
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1120
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1121
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1122
+ }>, Schema.Struct<{
1123
+ readonly _tag: Schema.Literal<"AssistantPartial">;
1124
+ readonly content: Schema.Struct<{
1125
+ readonly text: Schema.String;
1126
+ readonly reasoning: Schema.optionalKey<Schema.String>;
1127
+ }>;
1128
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1129
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1130
+ readonly type: Schema.Literal<"text">;
1131
+ readonly text: Schema.String;
1132
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1133
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1134
+ }>, Schema.decodeTo<Schema.Struct<{
1135
+ readonly type: Schema.Literal<"file">;
1136
+ readonly mediaType: Schema.String;
1137
+ readonly fileName: Schema.optional<Schema.String>;
1138
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1139
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1140
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1141
+ }>, Schema.Struct<{
1142
+ readonly data: Schema.String;
1143
+ readonly type: Schema.Literal<"file">;
1144
+ readonly mediaType: Schema.String;
1145
+ readonly fileName: Schema.optional<Schema.String>;
1146
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1147
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1148
+ }>, never, never>, Schema.Struct<{
1149
+ readonly type: Schema.Literal<"reasoning">;
1150
+ readonly text: Schema.String;
1151
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1152
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1153
+ }>, Schema.Struct<{
1154
+ readonly type: Schema.Literal<"tool-call">;
1155
+ readonly id: Schema.String;
1156
+ readonly name: Schema.String;
1157
+ readonly params: Schema.Unknown;
1158
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1159
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1160
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1161
+ }>, Schema.Struct<{
1162
+ readonly type: Schema.Literal<"tool-result">;
1163
+ readonly id: Schema.String;
1164
+ readonly name: Schema.String;
1165
+ readonly isFailure: Schema.Boolean;
1166
+ readonly result: Schema.Unknown;
1167
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1168
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1169
+ }>, Schema.Struct<{
1170
+ readonly type: Schema.Literal<"tool-approval-request">;
1171
+ readonly approvalId: Schema.String;
1172
+ readonly toolCallId: Schema.String;
1173
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1174
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1175
+ }>]>>>;
1176
+ readonly reason: Schema.String;
1177
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1178
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1179
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1180
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1181
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1182
+ }>]>;
1183
+ declare const RecoveryContinuationRecordSchema: Schema.Struct<{
1184
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1185
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1186
+ readonly interruptedRunId: Schema.brand<Schema.String, "RunId">;
1187
+ readonly replacementRunId: Schema.brand<Schema.String, "RunId">;
1188
+ }>;
1189
+ /** Structured-clone schema for the existing StopRequestRecord query representation. */
1190
+ declare const StopRequestRecordSchema: Schema.Struct<{
1191
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1192
+ readonly requestedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1193
+ readonly requestedRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1194
+ readonly requestedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1195
+ readonly appliedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1196
+ readonly appliedRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1197
+ readonly appliedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1198
+ readonly appliedInferenceId: Schema.optionalKey<Schema.brand<Schema.String, "InferenceId">>;
1199
+ }>;
1200
+ /** Structured-clone schema for the existing CompactionTerminal query representation. */
1201
+ declare const CompactionTerminalSchema: Schema.Union<readonly [Schema.Struct<{
1202
+ readonly _tag: Schema.Literal<"Completed">;
1203
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1204
+ }>, Schema.Struct<{
1205
+ readonly _tag: Schema.Literal<"Failed">;
1206
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1207
+ readonly error: Schema.Struct<{
1208
+ readonly message: Schema.String;
1209
+ readonly code: Schema.optionalKey<Schema.String>;
1210
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1211
+ }>;
1212
+ }>]>;
1213
+ /** Structured-clone schema for the existing CompactionRecord query representation. */
1214
+ declare const CompactionRecordSchema: Schema.Struct<{
1215
+ readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
1216
+ readonly requestedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1217
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1218
+ readonly summaryCreatedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1219
+ readonly summaryId: Schema.optionalKey<Schema.brand<Schema.String, "SummaryId">>;
1220
+ readonly sourceFromSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1221
+ readonly sourceToSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1222
+ readonly rebasedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1223
+ readonly contextVersion: Schema.optionalKey<Schema.brand<Schema.Int, "ContextVersion">>;
1224
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1225
+ readonly _tag: Schema.Literal<"Completed">;
1226
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1227
+ }>, Schema.Struct<{
1228
+ readonly _tag: Schema.Literal<"Failed">;
1229
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1230
+ readonly error: Schema.Struct<{
1231
+ readonly message: Schema.String;
1232
+ readonly code: Schema.optionalKey<Schema.String>;
1233
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1234
+ }>;
1235
+ }>]>>;
1236
+ }>;
1237
+ /** Structured-clone schema for the existing ContextRecord query representation. */
1238
+ declare const ContextRecordSchema: Schema.Struct<{
1239
+ readonly version: Schema.brand<Schema.Int, "ContextVersion">;
1240
+ readonly currentSummaryId: Schema.optionalKey<Schema.brand<Schema.String, "SummaryId">>;
1241
+ }>;
1242
+ /** Structured-clone schema for the existing ActiveCommandEvidence query representation. */
1243
+ declare const ActiveCommandEvidenceSchema: Schema.Struct<{
1244
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1245
+ readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1246
+ }>;
1247
+ /** Structured-clone schema for the existing PendingCommand query representation. */
1248
+ declare const PendingCommandSchema: Schema.Struct<{
1249
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1250
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
1251
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1252
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
1253
+ readonly span: Schema.Struct<{
1254
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1255
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1256
+ readonly sampled: Schema.Boolean;
1257
+ readonly tracestate: Schema.NullOr<Schema.String>;
1258
+ }>;
1259
+ readonly links: Schema.$Array<Schema.Struct<{
1260
+ readonly context: Schema.Struct<{
1261
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1262
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1263
+ readonly sampled: Schema.Boolean;
1264
+ readonly tracestate: Schema.NullOr<Schema.String>;
1265
+ }>;
1266
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1267
+ }>>;
1268
+ }>>;
1269
+ }>;
1270
+ /** Structured-clone schema for the existing PendingSteeringMessage query representation. */
1271
+ declare const PendingSteeringMessageSchema: Schema.Struct<{
1272
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1273
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1274
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1275
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1276
+ readonly type: Schema.Literal<"text">;
1277
+ readonly text: Schema.String;
1278
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1279
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1280
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1281
+ readonly type: Schema.Literal<"text">;
1282
+ readonly text: Schema.String;
1283
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1284
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1285
+ }>, Schema.Struct<{
1286
+ readonly type: Schema.Literal<"file">;
1287
+ readonly mediaType: Schema.String;
1288
+ readonly fileName: Schema.optional<Schema.String>;
1289
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1290
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1291
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1292
+ }>]>>]>>;
1293
+ readonly queuedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1294
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1295
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1296
+ }>;
1297
+ /** Structured-clone schema for the existing PendingUserMessage query representation. */
1298
+ declare const PendingUserMessageSchema: Schema.Struct<{
1299
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1300
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1301
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1302
+ readonly type: Schema.Literal<"text">;
1303
+ readonly text: Schema.String;
1304
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1305
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1306
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1307
+ readonly type: Schema.Literal<"text">;
1308
+ readonly text: Schema.String;
1309
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1310
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1311
+ }>, Schema.Struct<{
1312
+ readonly type: Schema.Literal<"file">;
1313
+ readonly mediaType: Schema.String;
1314
+ readonly fileName: Schema.optional<Schema.String>;
1315
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1316
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1317
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1318
+ }>]>>]>>;
1319
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1320
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1321
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
1322
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1323
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1324
+ }>;
1325
+ /** Structured-clone schema for the existing CommandQueues query representation. */
1326
+ declare const CommandQueuesSchema: Schema.Struct<{
1327
+ readonly active: Schema.optional<Schema.Struct<{
1328
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1329
+ readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1330
+ }>>;
1331
+ readonly pendingCommands: Schema.$Array<Schema.Struct<{
1332
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1333
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
1334
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1335
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
1336
+ readonly span: Schema.Struct<{
1337
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1338
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1339
+ readonly sampled: Schema.Boolean;
1340
+ readonly tracestate: Schema.NullOr<Schema.String>;
1341
+ }>;
1342
+ readonly links: Schema.$Array<Schema.Struct<{
1343
+ readonly context: Schema.Struct<{
1344
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1345
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1346
+ readonly sampled: Schema.Boolean;
1347
+ readonly tracestate: Schema.NullOr<Schema.String>;
1348
+ }>;
1349
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1350
+ }>>;
1351
+ }>>;
1352
+ }>>;
1353
+ readonly queuedCommands: Schema.$Array<Schema.Struct<{
1354
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1355
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
1356
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1357
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
1358
+ readonly span: Schema.Struct<{
1359
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1360
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1361
+ readonly sampled: Schema.Boolean;
1362
+ readonly tracestate: Schema.NullOr<Schema.String>;
1363
+ }>;
1364
+ readonly links: Schema.$Array<Schema.Struct<{
1365
+ readonly context: Schema.Struct<{
1366
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1367
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1368
+ readonly sampled: Schema.Boolean;
1369
+ readonly tracestate: Schema.NullOr<Schema.String>;
1370
+ }>;
1371
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1372
+ }>>;
1373
+ }>>;
1374
+ }>>;
1375
+ readonly activeControlCommands: Schema.$Array<Schema.Struct<{
1376
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1377
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
1378
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1379
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
1380
+ readonly span: Schema.Struct<{
1381
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1382
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1383
+ readonly sampled: Schema.Boolean;
1384
+ readonly tracestate: Schema.NullOr<Schema.String>;
1385
+ }>;
1386
+ readonly links: Schema.$Array<Schema.Struct<{
1387
+ readonly context: Schema.Struct<{
1388
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1389
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1390
+ readonly sampled: Schema.Boolean;
1391
+ readonly tracestate: Schema.NullOr<Schema.String>;
1392
+ }>;
1393
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1394
+ }>>;
1395
+ }>>;
1396
+ }>>;
1397
+ readonly steeringByRun: Schema.$ReadonlyMap<Schema.brand<Schema.String, "RunId">, Schema.$Array<Schema.Struct<{
1398
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1399
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1400
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1401
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1402
+ readonly type: Schema.Literal<"text">;
1403
+ readonly text: Schema.String;
1404
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1405
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1406
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1407
+ readonly type: Schema.Literal<"text">;
1408
+ readonly text: Schema.String;
1409
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1410
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1411
+ }>, Schema.Struct<{
1412
+ readonly type: Schema.Literal<"file">;
1413
+ readonly mediaType: Schema.String;
1414
+ readonly fileName: Schema.optional<Schema.String>;
1415
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1416
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1417
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1418
+ }>]>>]>>;
1419
+ readonly queuedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1420
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1421
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1422
+ }>>>;
1423
+ readonly pendingQueue: Schema.$Array<Schema.Struct<{
1424
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1425
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1426
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1427
+ readonly type: Schema.Literal<"text">;
1428
+ readonly text: Schema.String;
1429
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1430
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1431
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1432
+ readonly type: Schema.Literal<"text">;
1433
+ readonly text: Schema.String;
1434
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1435
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1436
+ }>, Schema.Struct<{
1437
+ readonly type: Schema.Literal<"file">;
1438
+ readonly mediaType: Schema.String;
1439
+ readonly fileName: Schema.optional<Schema.String>;
1440
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1441
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1442
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1443
+ }>]>>]>>;
1444
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1445
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1446
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
1447
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1448
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1449
+ }>>;
1450
+ readonly pendingSteers: Schema.$Array<Schema.Struct<{
1451
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1452
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1453
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1454
+ readonly type: Schema.Literal<"text">;
1455
+ readonly text: Schema.String;
1456
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1457
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1458
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1459
+ readonly type: Schema.Literal<"text">;
1460
+ readonly text: Schema.String;
1461
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1462
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1463
+ }>, Schema.Struct<{
1464
+ readonly type: Schema.Literal<"file">;
1465
+ readonly mediaType: Schema.String;
1466
+ readonly fileName: Schema.optional<Schema.String>;
1467
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1468
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1469
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1470
+ }>]>>]>>;
1471
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1472
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1473
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
1474
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1475
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1476
+ }>>;
1477
+ readonly pausedQueue: Schema.$Array<Schema.Struct<{
1478
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1479
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1480
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1481
+ readonly type: Schema.Literal<"text">;
1482
+ readonly text: Schema.String;
1483
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1484
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1485
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1486
+ readonly type: Schema.Literal<"text">;
1487
+ readonly text: Schema.String;
1488
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1489
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1490
+ }>, Schema.Struct<{
1491
+ readonly type: Schema.Literal<"file">;
1492
+ readonly mediaType: Schema.String;
1493
+ readonly fileName: Schema.optional<Schema.String>;
1494
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1495
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1496
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1497
+ }>]>>]>>;
1498
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1499
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1500
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
1501
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1502
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1503
+ }>>;
1504
+ }>;
1505
+ /** Structured-clone schema for the existing ReducedState query representation. */
1506
+ declare const ReducedStateSchema: Schema.Struct<{
1507
+ readonly runSchedulingRequest: Schema.optionalKey<Schema.Struct<{
1508
+ readonly requestedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1509
+ readonly deliveredSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1510
+ readonly requestId: Schema.brand<Schema.String, "RunRequestId">;
1511
+ readonly work: Schema.Union<readonly [Schema.TaggedStruct<"Command", {
1512
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1513
+ }>, Schema.TaggedStruct<"Recovery", {
1514
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1515
+ readonly interruptedRunId: Schema.brand<Schema.String, "RunId">;
1516
+ readonly inputMessageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
1517
+ }>]>;
1518
+ }>>;
1519
+ readonly modelSelection: Schema.optionalKey<Schema.Struct<{
1520
+ readonly provider: Schema.NonEmptyString;
1521
+ readonly modelId: Schema.NonEmptyString;
1522
+ readonly settings: Schema.optionalKey<Schema.Unknown>;
1523
+ }>>;
1524
+ readonly lastSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1525
+ readonly commands: Schema.$ReadonlyMap<Schema.brand<Schema.String, "CommandId">, Schema.Struct<{
1526
+ readonly admittedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1527
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
1528
+ readonly span: Schema.Struct<{
1529
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1530
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1531
+ readonly sampled: Schema.Boolean;
1532
+ readonly tracestate: Schema.NullOr<Schema.String>;
1533
+ }>;
1534
+ readonly links: Schema.$Array<Schema.Struct<{
1535
+ readonly context: Schema.Struct<{
1536
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1537
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1538
+ readonly sampled: Schema.Boolean;
1539
+ readonly tracestate: Schema.NullOr<Schema.String>;
1540
+ }>;
1541
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1542
+ }>>;
1543
+ }>>;
1544
+ readonly command: Schema.optionalKey<Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>>;
1545
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1546
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1547
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1548
+ readonly _tag: Schema.Literal<"Completed">;
1549
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1550
+ }>, Schema.Struct<{
1551
+ readonly _tag: Schema.Literal<"Failed">;
1552
+ readonly error: Schema.Struct<{
1553
+ readonly message: Schema.String;
1554
+ readonly code: Schema.optionalKey<Schema.String>;
1555
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1556
+ }>;
1557
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1558
+ }>, Schema.Struct<{
1559
+ readonly _tag: Schema.Literal<"Cancelled">;
1560
+ readonly reason: Schema.String;
1561
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1562
+ }>]>>;
1563
+ }>>;
1564
+ readonly runs: Schema.$ReadonlyMap<Schema.brand<Schema.String, "RunId">, Schema.Struct<{
1565
+ readonly commandIds: Schema.$Array<Schema.brand<Schema.String, "CommandId">>;
1566
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1567
+ readonly startedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1568
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1569
+ readonly _tag: Schema.Literal<"Completed">;
1570
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1571
+ }>, Schema.Struct<{
1572
+ readonly _tag: Schema.Literal<"Failed">;
1573
+ readonly error: Schema.Struct<{
1574
+ readonly message: Schema.String;
1575
+ readonly code: Schema.optionalKey<Schema.String>;
1576
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1577
+ }>;
1578
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1579
+ }>, Schema.Struct<{
1580
+ readonly _tag: Schema.Literal<"Interrupted">;
1581
+ readonly reason: Schema.String;
1582
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1583
+ }>]>>;
1584
+ readonly trace: Schema.Struct<{
1585
+ readonly root: Schema.Struct<{
1586
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1587
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1588
+ readonly sampled: Schema.Boolean;
1589
+ readonly tracestate: Schema.NullOr<Schema.String>;
1590
+ }>;
1591
+ readonly links: Schema.$Array<Schema.Struct<{
1592
+ readonly context: Schema.Struct<{
1593
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1594
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1595
+ readonly sampled: Schema.Boolean;
1596
+ readonly tracestate: Schema.NullOr<Schema.String>;
1597
+ }>;
1598
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1599
+ }>>;
1600
+ }>;
1601
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
1602
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
1603
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
1604
+ readonly modelSelection: Schema.optionalKey<Schema.Struct<{
1605
+ readonly provider: Schema.NonEmptyString;
1606
+ readonly modelId: Schema.NonEmptyString;
1607
+ readonly settings: Schema.optionalKey<Schema.Unknown>;
1608
+ }>>;
1609
+ }>>;
1610
+ readonly recoveryContinuations: Schema.$ReadonlyMap<Schema.brand<Schema.String, "RunId">, Schema.Struct<{
1611
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1612
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1613
+ readonly interruptedRunId: Schema.brand<Schema.String, "RunId">;
1614
+ readonly replacementRunId: Schema.brand<Schema.String, "RunId">;
1615
+ }>>;
1616
+ readonly turns: Schema.$ReadonlyMap<Schema.brand<Schema.String, "TurnId">, Schema.Struct<{
1617
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1618
+ readonly startedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1619
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1620
+ readonly _tag: Schema.Literal<"Completed">;
1621
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1622
+ readonly usage: Schema.optionalKey<Schema.Struct<{
1623
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
1624
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
1625
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
1626
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
1627
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
1628
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
1629
+ }>>;
1630
+ }>, Schema.Struct<{
1631
+ readonly _tag: Schema.Literal<"Failed">;
1632
+ readonly error: Schema.Struct<{
1633
+ readonly message: Schema.String;
1634
+ readonly code: Schema.optionalKey<Schema.String>;
1635
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1636
+ }>;
1637
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1638
+ }>, Schema.Struct<{
1639
+ readonly _tag: Schema.Literal<"Stopped">;
1640
+ readonly reason: Schema.String;
1641
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1642
+ }>]>>;
1643
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1644
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
1645
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
1646
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
1647
+ }>>;
1648
+ readonly inferences: Schema.$ReadonlyMap<Schema.brand<Schema.String, "InferenceId">, Schema.Struct<{
1649
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1650
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1651
+ readonly startedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1652
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1653
+ readonly _tag: Schema.Literal<"Completed">;
1654
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1655
+ readonly usage: Schema.optionalKey<Schema.Struct<{
1656
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
1657
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
1658
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
1659
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
1660
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
1661
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
1662
+ }>>;
1663
+ }>, Schema.Struct<{
1664
+ readonly _tag: Schema.Literal<"Failed">;
1665
+ readonly error: Schema.Struct<{
1666
+ readonly message: Schema.String;
1667
+ readonly code: Schema.optionalKey<Schema.String>;
1668
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1669
+ }>;
1670
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1671
+ }>]>>;
1672
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1673
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
1674
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
1675
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
1676
+ }>>;
1677
+ readonly toolCalls: Schema.$ReadonlyMap<Schema.brand<Schema.String, "ToolCallId">, Schema.toType<Schema.Struct<{
1678
+ readonly decision: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1679
+ readonly _tag: Schema.Literal<"Created">;
1680
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1681
+ readonly params: Schema.Unknown;
1682
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
1683
+ readonly type: Schema.Literal<"tool-call">;
1684
+ readonly id: Schema.String;
1685
+ readonly name: Schema.String;
1686
+ readonly params: Schema.Unknown;
1687
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1688
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1689
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1690
+ }>>;
1691
+ readonly providerExecuted: Schema.Boolean;
1692
+ readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1693
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1694
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1695
+ readonly toolName: Schema.NonEmptyString;
1696
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1697
+ }>, Schema.Struct<{
1698
+ readonly _tag: Schema.Literal<"Rejected">;
1699
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1700
+ readonly modelFeedback: Schema.String;
1701
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
1702
+ readonly type: Schema.Literal<"tool-result">;
1703
+ readonly id: Schema.String;
1704
+ readonly name: Schema.String;
1705
+ readonly isFailure: Schema.Boolean;
1706
+ readonly result: Schema.Unknown;
1707
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1708
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1709
+ }>>;
1710
+ readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1711
+ readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
1712
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1713
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1714
+ readonly toolName: Schema.NonEmptyString;
1715
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1716
+ }>]>>;
1717
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1718
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1719
+ readonly _tag: Schema.Literal<"Completed">;
1720
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
1721
+ readonly type: Schema.Literal<"tool-result">;
1722
+ readonly id: Schema.String;
1723
+ readonly name: Schema.String;
1724
+ readonly isFailure: Schema.Boolean;
1725
+ readonly result: Schema.Unknown;
1726
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1727
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1728
+ }>>;
1729
+ readonly result: Schema.Unknown;
1730
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1731
+ }>, Schema.Struct<{
1732
+ readonly _tag: Schema.Literal<"Failed">;
1733
+ readonly error: Schema.Struct<{
1734
+ readonly message: Schema.String;
1735
+ readonly code: Schema.optionalKey<Schema.String>;
1736
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1737
+ }>;
1738
+ readonly promptPart: Schema.optionalKey<Schema.Struct<{
1739
+ readonly type: Schema.Literal<"tool-result">;
1740
+ readonly id: Schema.String;
1741
+ readonly name: Schema.String;
1742
+ readonly isFailure: Schema.Boolean;
1743
+ readonly result: Schema.Unknown;
1744
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1745
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1746
+ }>>;
1747
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1748
+ }>]>>;
1749
+ readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1750
+ readonly durationMs: Schema.optionalKey<Schema.Finite>;
1751
+ readonly startedAtMs: Schema.optionalKey<Schema.Int>;
1752
+ readonly terminalAtMs: Schema.optionalKey<Schema.Int>;
1753
+ }>>>;
1754
+ readonly messages: Schema.$ReadonlyMap<Schema.brand<Schema.String, "MessageId">, Schema.Union<readonly [Schema.Struct<{
1755
+ readonly _tag: Schema.Literal<"System">;
1756
+ readonly content: Schema.NonEmptyString;
1757
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1758
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1759
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1760
+ }>, Schema.Struct<{
1761
+ readonly _tag: Schema.Literal<"User">;
1762
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1763
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1764
+ readonly type: Schema.Literal<"text">;
1765
+ readonly text: Schema.String;
1766
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1767
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1768
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1769
+ readonly type: Schema.Literal<"text">;
1770
+ readonly text: Schema.String;
1771
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1772
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1773
+ }>, Schema.Struct<{
1774
+ readonly type: Schema.Literal<"file">;
1775
+ readonly mediaType: Schema.String;
1776
+ readonly fileName: Schema.optional<Schema.String>;
1777
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1778
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1779
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1780
+ }>]>>]>>;
1781
+ readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
1782
+ readonly requestedDisposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer"]>>;
1783
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
1784
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1785
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1786
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1787
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1788
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1789
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1790
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1791
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1792
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1793
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1794
+ }>, Schema.Struct<{
1795
+ readonly _tag: Schema.Literal<"Steering">;
1796
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1797
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
1798
+ readonly type: Schema.Literal<"text">;
1799
+ readonly text: Schema.String;
1800
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1801
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1802
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1803
+ readonly type: Schema.Literal<"text">;
1804
+ readonly text: Schema.String;
1805
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1806
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1807
+ }>, Schema.Struct<{
1808
+ readonly type: Schema.Literal<"file">;
1809
+ readonly mediaType: Schema.String;
1810
+ readonly fileName: Schema.optional<Schema.String>;
1811
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1812
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1813
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1814
+ }>]>>]>>;
1815
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1816
+ readonly cancellationReason: Schema.optionalKey<Schema.String>;
1817
+ readonly cancelledByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1818
+ readonly cancelledSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1819
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1820
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1821
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
1822
+ readonly pausedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1823
+ readonly promotedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1824
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1825
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1826
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1827
+ }>, Schema.Struct<{
1828
+ readonly _tag: Schema.Literal<"Assistant">;
1829
+ readonly content: Schema.Struct<{
1830
+ readonly text: Schema.String;
1831
+ readonly reasoning: Schema.optionalKey<Schema.String>;
1832
+ }>;
1833
+ readonly imported: Schema.optionalKey<Schema.Literal<true>>;
1834
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1835
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.toType<Schema.Struct<{
1836
+ readonly type: Schema.Literal<"text">;
1837
+ readonly text: Schema.String;
1838
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1839
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1840
+ }>>, Schema.toType<Schema.Struct<{
1841
+ readonly type: Schema.Literal<"file">;
1842
+ readonly mediaType: Schema.String;
1843
+ readonly fileName: Schema.optional<Schema.String>;
1844
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1845
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1846
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1847
+ }>>, Schema.toType<Schema.Struct<{
1848
+ readonly type: Schema.Literal<"reasoning">;
1849
+ readonly text: Schema.String;
1850
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1851
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1852
+ }>>, Schema.toType<Schema.Struct<{
1853
+ readonly type: Schema.Literal<"tool-call">;
1854
+ readonly id: Schema.String;
1855
+ readonly name: Schema.String;
1856
+ readonly params: Schema.Unknown;
1857
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1858
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1859
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1860
+ }>>, Schema.toType<Schema.Struct<{
1861
+ readonly type: Schema.Literal<"tool-result">;
1862
+ readonly id: Schema.String;
1863
+ readonly name: Schema.String;
1864
+ readonly isFailure: Schema.Boolean;
1865
+ readonly result: Schema.Unknown;
1866
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1867
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1868
+ }>>, Schema.toType<Schema.Struct<{
1869
+ readonly type: Schema.Literal<"tool-approval-request">;
1870
+ readonly approvalId: Schema.String;
1871
+ readonly toolCallId: Schema.String;
1872
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1873
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1874
+ }>>]>>>;
1875
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1876
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1877
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1878
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1879
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1880
+ }>, Schema.Struct<{
1881
+ readonly _tag: Schema.Literal<"AssistantPartial">;
1882
+ readonly content: Schema.Struct<{
1883
+ readonly text: Schema.String;
1884
+ readonly reasoning: Schema.optionalKey<Schema.String>;
1885
+ }>;
1886
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1887
+ readonly promptParts: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.toType<Schema.Struct<{
1888
+ readonly type: Schema.Literal<"text">;
1889
+ readonly text: Schema.String;
1890
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1891
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1892
+ }>>, Schema.toType<Schema.Struct<{
1893
+ readonly type: Schema.Literal<"file">;
1894
+ readonly mediaType: Schema.String;
1895
+ readonly fileName: Schema.optional<Schema.String>;
1896
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1897
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1898
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1899
+ }>>, Schema.toType<Schema.Struct<{
1900
+ readonly type: Schema.Literal<"reasoning">;
1901
+ readonly text: Schema.String;
1902
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1903
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1904
+ }>>, Schema.toType<Schema.Struct<{
1905
+ readonly type: Schema.Literal<"tool-call">;
1906
+ readonly id: Schema.String;
1907
+ readonly name: Schema.String;
1908
+ readonly params: Schema.Unknown;
1909
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1910
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1911
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1912
+ }>>, Schema.toType<Schema.Struct<{
1913
+ readonly type: Schema.Literal<"tool-result">;
1914
+ readonly id: Schema.String;
1915
+ readonly name: Schema.String;
1916
+ readonly isFailure: Schema.Boolean;
1917
+ readonly result: Schema.Unknown;
1918
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1919
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1920
+ }>>, Schema.toType<Schema.Struct<{
1921
+ readonly type: Schema.Literal<"tool-approval-request">;
1922
+ readonly approvalId: Schema.String;
1923
+ readonly toolCallId: Schema.String;
1924
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1925
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1926
+ }>>]>>>;
1927
+ readonly reason: Schema.String;
1928
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1929
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1930
+ readonly createdAtMs: Schema.optionalKey<Schema.Int>;
1931
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1932
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1933
+ }>]>>;
1934
+ readonly stopRequests: Schema.$ReadonlyMap<Schema.brand<Schema.String, "CommandId">, Schema.Struct<{
1935
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1936
+ readonly requestedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1937
+ readonly requestedRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1938
+ readonly requestedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1939
+ readonly appliedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1940
+ readonly appliedRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1941
+ readonly appliedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1942
+ readonly appliedInferenceId: Schema.optionalKey<Schema.brand<Schema.String, "InferenceId">>;
1943
+ }>>;
1944
+ readonly compactions: Schema.$ReadonlyMap<Schema.brand<Schema.String, "CompactionId">, Schema.Struct<{
1945
+ readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
1946
+ readonly requestedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1947
+ readonly startedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1948
+ readonly summaryCreatedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1949
+ readonly summaryId: Schema.optionalKey<Schema.brand<Schema.String, "SummaryId">>;
1950
+ readonly sourceFromSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1951
+ readonly sourceToSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1952
+ readonly rebasedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
1953
+ readonly contextVersion: Schema.optionalKey<Schema.brand<Schema.Int, "ContextVersion">>;
1954
+ readonly terminal: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1955
+ readonly _tag: Schema.Literal<"Completed">;
1956
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1957
+ }>, Schema.Struct<{
1958
+ readonly _tag: Schema.Literal<"Failed">;
1959
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
1960
+ readonly error: Schema.Struct<{
1961
+ readonly message: Schema.String;
1962
+ readonly code: Schema.optionalKey<Schema.String>;
1963
+ readonly details: Schema.optionalKey<Schema.Unknown>;
1964
+ }>;
1965
+ }>]>>;
1966
+ }>>;
1967
+ readonly context: Schema.Struct<{
1968
+ readonly version: Schema.brand<Schema.Int, "ContextVersion">;
1969
+ readonly currentSummaryId: Schema.optionalKey<Schema.brand<Schema.String, "SummaryId">>;
1970
+ }>;
1971
+ readonly tokenConsumption: Schema.Struct<{
1972
+ readonly byModel: Schema.$Array<Schema.Struct<{
1973
+ readonly provider: Schema.NonEmptyString;
1974
+ readonly modelId: Schema.NonEmptyString;
1975
+ readonly usage: Schema.Struct<{
1976
+ readonly inputTokens: Schema.Int;
1977
+ readonly cachedInputTokens: Schema.Int;
1978
+ readonly cacheWriteInputTokens: Schema.Int;
1979
+ readonly outputTokens: Schema.Int;
1980
+ readonly textTokens: Schema.Int;
1981
+ readonly reasoningTokens: Schema.Int;
1982
+ }>;
1983
+ }>>;
1984
+ }>;
1985
+ readonly commandQueues: Schema.Struct<{
1986
+ readonly active: Schema.optional<Schema.Struct<{
1987
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1988
+ readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1989
+ }>>;
1990
+ readonly pendingCommands: Schema.$Array<Schema.Struct<{
1991
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
1992
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
1993
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1994
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
1995
+ readonly span: Schema.Struct<{
1996
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1997
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1998
+ readonly sampled: Schema.Boolean;
1999
+ readonly tracestate: Schema.NullOr<Schema.String>;
2000
+ }>;
2001
+ readonly links: Schema.$Array<Schema.Struct<{
2002
+ readonly context: Schema.Struct<{
2003
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2004
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2005
+ readonly sampled: Schema.Boolean;
2006
+ readonly tracestate: Schema.NullOr<Schema.String>;
2007
+ }>;
2008
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
2009
+ }>>;
2010
+ }>>;
2011
+ }>>;
2012
+ readonly queuedCommands: Schema.$Array<Schema.Struct<{
2013
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
2014
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
2015
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2016
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
2017
+ readonly span: Schema.Struct<{
2018
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2019
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2020
+ readonly sampled: Schema.Boolean;
2021
+ readonly tracestate: Schema.NullOr<Schema.String>;
2022
+ }>;
2023
+ readonly links: Schema.$Array<Schema.Struct<{
2024
+ readonly context: Schema.Struct<{
2025
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2026
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2027
+ readonly sampled: Schema.Boolean;
2028
+ readonly tracestate: Schema.NullOr<Schema.String>;
2029
+ }>;
2030
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
2031
+ }>>;
2032
+ }>>;
2033
+ }>>;
2034
+ readonly activeControlCommands: Schema.$Array<Schema.Struct<{
2035
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
2036
+ readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
2037
+ readonly admittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2038
+ readonly admissionTrace: Schema.optionalKey<Schema.Struct<{
2039
+ readonly span: Schema.Struct<{
2040
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2041
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2042
+ readonly sampled: Schema.Boolean;
2043
+ readonly tracestate: Schema.NullOr<Schema.String>;
2044
+ }>;
2045
+ readonly links: Schema.$Array<Schema.Struct<{
2046
+ readonly context: Schema.Struct<{
2047
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2048
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2049
+ readonly sampled: Schema.Boolean;
2050
+ readonly tracestate: Schema.NullOr<Schema.String>;
2051
+ }>;
2052
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
2053
+ }>>;
2054
+ }>>;
2055
+ }>>;
2056
+ readonly steeringByRun: Schema.$ReadonlyMap<Schema.brand<Schema.String, "RunId">, Schema.$Array<Schema.Struct<{
2057
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
2058
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
2059
+ readonly runId: Schema.brand<Schema.String, "RunId">;
2060
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
2061
+ readonly type: Schema.Literal<"text">;
2062
+ readonly text: Schema.String;
2063
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2064
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2065
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
2066
+ readonly type: Schema.Literal<"text">;
2067
+ readonly text: Schema.String;
2068
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2069
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2070
+ }>, Schema.Struct<{
2071
+ readonly type: Schema.Literal<"file">;
2072
+ readonly mediaType: Schema.String;
2073
+ readonly fileName: Schema.optional<Schema.String>;
2074
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
2075
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2076
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2077
+ }>]>>]>>;
2078
+ readonly queuedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2079
+ readonly consumedSeq: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
2080
+ readonly consumedTurnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
2081
+ }>>>;
2082
+ readonly pendingQueue: Schema.$Array<Schema.Struct<{
2083
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
2084
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
2085
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
2086
+ readonly type: Schema.Literal<"text">;
2087
+ readonly text: Schema.String;
2088
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2089
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2090
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
2091
+ readonly type: Schema.Literal<"text">;
2092
+ readonly text: Schema.String;
2093
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2094
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2095
+ }>, Schema.Struct<{
2096
+ readonly type: Schema.Literal<"file">;
2097
+ readonly mediaType: Schema.String;
2098
+ readonly fileName: Schema.optional<Schema.String>;
2099
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
2100
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2101
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2102
+ }>]>>]>>;
2103
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2104
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2105
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
2106
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
2107
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
2108
+ }>>;
2109
+ readonly pendingSteers: Schema.$Array<Schema.Struct<{
2110
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
2111
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
2112
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
2113
+ readonly type: Schema.Literal<"text">;
2114
+ readonly text: Schema.String;
2115
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2116
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2117
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
2118
+ readonly type: Schema.Literal<"text">;
2119
+ readonly text: Schema.String;
2120
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2121
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2122
+ }>, Schema.Struct<{
2123
+ readonly type: Schema.Literal<"file">;
2124
+ readonly mediaType: Schema.String;
2125
+ readonly fileName: Schema.optional<Schema.String>;
2126
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
2127
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2128
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2129
+ }>]>>]>>;
2130
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2131
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2132
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
2133
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
2134
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
2135
+ }>>;
2136
+ readonly pausedQueue: Schema.$Array<Schema.Struct<{
2137
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
2138
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
2139
+ readonly content: Schema.toType<Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
2140
+ readonly type: Schema.Literal<"text">;
2141
+ readonly text: Schema.String;
2142
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2143
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2144
+ }>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
2145
+ readonly type: Schema.Literal<"text">;
2146
+ readonly text: Schema.String;
2147
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2148
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2149
+ }>, Schema.Struct<{
2150
+ readonly type: Schema.Literal<"file">;
2151
+ readonly mediaType: Schema.String;
2152
+ readonly fileName: Schema.optional<Schema.String>;
2153
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
2154
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
2155
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
2156
+ }>]>>]>>;
2157
+ readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2158
+ readonly effectiveSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2159
+ readonly disposition: Schema.Union<readonly [Schema.Literal<"queue">, Schema.Literal<"steer">]>;
2160
+ readonly targetRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
2161
+ readonly pausedByCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
2162
+ }>>;
2163
+ }>;
2164
+ }>;
2165
+ //#endregion
2166
+ export { ToolTerminalSchema as A, RecoveryContinuationRecordSchema as C, StopRequestRecordSchema as D, RunTerminalSchema as E, TurnTerminalSchema as M, ToolCallRecordSchema as O, QueryUserMessageContent as S, RunRecordSchema as T, MessageRecordSchema as _, CompactionRecordSchema as a, PendingUserMessageSchema as b, InferenceRecordSchema as c, JsonCommandRecordSchema as d, JsonEDACommand as f, JsonUserMessagePart as g, JsonUserMessageContent as h, CommandTerminalSchema as i, TurnRecordSchema as j, ToolDecisionSchema as k, InferenceTerminalSchema as l, JsonPromptFilePart as m, CommandQueuesSchema as n, CompactionTerminalSchema as o, JsonMessageRecordSchema as p, CommandRecordSchema as r, ContextRecordSchema as s, ActiveCommandEvidenceSchema as t, JsonAssistantMessagePart as u, PendingCommandSchema as v, ReducedStateSchema as w, QueryMessageRecordSchema as x, PendingSteeringMessageSchema as y };
2167
+ //# sourceMappingURL=reduced-state-schema-CgW0mzpS.d.ts.map