effect-durable-agent 0.1.0-alpha.3 → 0.1.0-alpha.30

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 (221) hide show
  1. package/README.md +43 -41
  2. package/dist/assert-never-CoyUpoRB.js +18 -0
  3. package/dist/assert-never-CoyUpoRB.js.map +1 -0
  4. package/dist/{commands-Ce1ec6kH.d.ts → commands-3OD-p8dD.d.ts} +16 -9
  5. package/dist/compaction-63iEDHHl.js +523 -0
  6. package/dist/compaction-63iEDHHl.js.map +1 -0
  7. package/dist/context-projection-D_uRtK3r.d.ts +139 -0
  8. package/dist/{core-Hv3cFydL.d.ts → core-BcimKMIv.d.ts} +6 -4
  9. package/dist/delivery-2ZILvoRD.js +507 -0
  10. package/dist/delivery-2ZILvoRD.js.map +1 -0
  11. package/dist/{websocket-wire-D3tLrhe2.d.ts → delivery-RjM1_NAE.d.ts} +1019 -200
  12. package/dist/domain/command-queues.d.ts +81 -2
  13. package/dist/domain/command-queues.js +1 -1
  14. package/dist/domain/command-queues.js.map +1 -1
  15. package/dist/domain/context-projection.d.ts +2 -0
  16. package/dist/domain/context-projection.js +32 -0
  17. package/dist/domain/context-projection.js.map +1 -0
  18. package/dist/domain/message-transcript.d.ts +36 -2
  19. package/dist/domain/message-transcript.js +10 -2
  20. package/dist/domain/message-transcript.js.map +1 -1
  21. package/dist/domain/model-usage.d.ts +2 -0
  22. package/dist/domain/model-usage.js +59 -0
  23. package/dist/domain/model-usage.js.map +1 -0
  24. package/dist/domain/reduced-state-schema.d.ts +3 -996
  25. package/dist/domain/reduced-state-schema.js +121 -12
  26. package/dist/domain/reduced-state-schema.js.map +1 -1
  27. package/dist/domain/reduced-state.d.ts +3 -2
  28. package/dist/domain/reduced-state.js +937 -2
  29. package/dist/domain/reduced-state.js.map +1 -0
  30. package/dist/domain/run-scheduling.d.ts +2 -0
  31. package/dist/domain/run-scheduling.js +127 -0
  32. package/dist/domain/run-scheduling.js.map +1 -0
  33. package/dist/{durable-DlScwmCy.d.ts → durable-Cqv5ZRFA.d.ts} +8505 -2497
  34. package/dist/{durable-C3Rz7kg3.js → durable-D13w1Qr3.js} +253 -91
  35. package/dist/durable-D13w1Qr3.js.map +1 -0
  36. package/dist/envelope-BCzKUq_z.js +91 -0
  37. package/dist/envelope-BCzKUq_z.js.map +1 -0
  38. package/dist/envelope-Che6KatU.d.ts +254 -0
  39. package/dist/{keep-alive-p8dIcSVy.js → event-factory-_vF1bIJ7.js} +8 -10
  40. package/dist/event-factory-_vF1bIJ7.js.map +1 -0
  41. package/dist/{events-Bb9-Cu-7.d.ts → events-Dg0o5wWs.d.ts} +140 -324
  42. package/dist/{id-generator-C2Q15uZM.d.ts → id-generator-BKGoKjt-.d.ts} +3 -3
  43. package/dist/in-memory-CeODnZhE.js +150 -0
  44. package/dist/in-memory-CeODnZhE.js.map +1 -0
  45. package/dist/index.d.ts +8 -7
  46. package/dist/index.js +6 -5
  47. package/dist/interpreter-DKGJ1sSx.js +1452 -0
  48. package/dist/interpreter-DKGJ1sSx.js.map +1 -0
  49. package/dist/keep-alive-_zFCUvt3.d.ts +28 -0
  50. package/dist/model-resolver-D0vcDZsU.d.ts +24 -0
  51. package/dist/model-usage-0GeHwaaU.d.ts +54 -0
  52. package/dist/records--54mZEBx.js +675 -0
  53. package/dist/records--54mZEBx.js.map +1 -0
  54. package/dist/reduced-state-DU2ECOUp.d.ts +47821 -0
  55. package/dist/reduced-state-schema-B2t3cobf.d.ts +2187 -0
  56. package/dist/{reducer-registry-C0svUa63.d.ts → reducer-registry-JLU1yptN.d.ts} +24 -8
  57. package/dist/run-scheduling-wakeup-D_bGdicf.d.ts +24 -0
  58. package/dist/services/compaction.d.ts +2 -2
  59. package/dist/services/compaction.js +2 -426
  60. package/dist/services/id-generator.d.ts +1 -1
  61. package/dist/services/id-generator.js +4 -2
  62. package/dist/services/id-generator.js.map +1 -1
  63. package/dist/services/keep-alive.d.ts +2 -0
  64. package/dist/services/keep-alive.js +13 -0
  65. package/dist/services/keep-alive.js.map +1 -0
  66. package/dist/services/model-call.d.ts +15 -0
  67. package/dist/services/model-call.js +15 -0
  68. package/dist/services/model-call.js.map +1 -0
  69. package/dist/services/model-resolver.d.ts +2 -0
  70. package/dist/services/model-resolver.js +17 -0
  71. package/dist/services/model-resolver.js.map +1 -0
  72. package/dist/services/prompt-projector.d.ts +2 -2
  73. package/dist/services/prompt-projector.js +49 -5
  74. package/dist/services/prompt-projector.js.map +1 -1
  75. package/dist/services/reducer-registry.d.ts +2 -2
  76. package/dist/services/reducer-registry.js +21 -4
  77. package/dist/services/reducer-registry.js.map +1 -1
  78. package/dist/services/run-scheduler.d.ts +2 -0
  79. package/dist/services/run-scheduler.js +25 -0
  80. package/dist/services/run-scheduler.js.map +1 -0
  81. package/dist/services/run-scheduling-wakeup.d.ts +2 -0
  82. package/dist/services/run-scheduling-wakeup.js +13 -0
  83. package/dist/services/run-scheduling-wakeup.js.map +1 -0
  84. package/dist/services/runtime-layer.d.ts +48 -0
  85. package/dist/services/runtime-layer.js +51 -0
  86. package/dist/services/runtime-layer.js.map +1 -0
  87. package/dist/services/runtime.d.ts +1 -1
  88. package/dist/services/runtime.js +34 -20
  89. package/dist/services/runtime.js.map +1 -1
  90. package/dist/services/session-event-observer.d.ts +2 -0
  91. package/dist/services/session-event-observer.js +13 -0
  92. package/dist/services/session-event-observer.js.map +1 -0
  93. package/dist/services/session-query.d.ts +2 -2
  94. package/dist/services/session-query.js +141 -2
  95. package/dist/services/session-query.js.map +1 -0
  96. package/dist/services/session-state.d.ts +2 -0
  97. package/dist/services/session-state.js +2 -0
  98. package/dist/services/session-store.d.ts +2 -2
  99. package/dist/services/session-store.js +272 -2
  100. package/dist/services/session-store.js.map +1 -0
  101. package/dist/services/sink-checkpoint-store.d.ts +2 -0
  102. package/dist/services/sink-checkpoint-store.js +50 -0
  103. package/dist/services/sink-checkpoint-store.js.map +1 -0
  104. package/dist/services/sink-registry.d.ts +2 -2
  105. package/dist/services/sink-registry.js +1 -1
  106. package/dist/services/span-names.d.ts +1 -1
  107. package/dist/services/span-names.js +7 -1
  108. package/dist/services/span-names.js.map +1 -1
  109. package/dist/services/tool-registry.d.ts +2 -2
  110. package/dist/services/tool-registry.js +12 -3
  111. package/dist/services/tool-registry.js.map +1 -1
  112. package/dist/services/tracing.d.ts +3 -3
  113. package/dist/services/tracing.js +25 -4
  114. package/dist/services/tracing.js.map +1 -1
  115. package/dist/session-event-observer-HvrRckbC.d.ts +24 -0
  116. package/dist/{session-query-Cbf-e0rG.js → session-state-BQYsuBqi.js} +693 -251
  117. package/dist/session-state-BQYsuBqi.js.map +1 -0
  118. package/dist/session-store-CQxg9U82.d.ts +3302 -0
  119. package/dist/sink-checkpoint-store-DWGifxp0.d.ts +39 -0
  120. package/dist/sink-registry-DskRcyOS.js +345 -0
  121. package/dist/sink-registry-DskRcyOS.js.map +1 -0
  122. package/dist/subscription-DmO3BcdT.js +505 -0
  123. package/dist/subscription-DmO3BcdT.js.map +1 -0
  124. package/dist/subscription-rC35dAWn.d.ts +958 -0
  125. package/dist/testkit/layers.d.ts +34 -19
  126. package/dist/testkit/layers.js +30 -16
  127. package/dist/testkit/layers.js.map +1 -1
  128. package/dist/testkit/transcript.d.ts +226 -0
  129. package/dist/testkit/transcript.js +1475 -0
  130. package/dist/testkit/transcript.js.map +1 -0
  131. package/dist/{tool-registry-CcnkAAQK.d.ts → tool-registry-BzlMhwzj.d.ts} +44 -8
  132. package/dist/{tracing-BXHAkxkx.d.ts → tracing-BwjbF285.d.ts} +1 -2
  133. package/dist/transcript.d.ts +101 -0
  134. package/dist/transcript.js +107 -0
  135. package/dist/transcript.js.map +1 -0
  136. package/dist/types/commands.d.ts +2 -2
  137. package/dist/types/commands.js +8 -3
  138. package/dist/types/commands.js.map +1 -1
  139. package/dist/types/core.d.ts +2 -2
  140. package/dist/types/core.js +4 -2
  141. package/dist/types/core.js.map +1 -1
  142. package/dist/types/events/durable.d.ts +2 -2
  143. package/dist/types/events/durable.js +2 -2
  144. package/dist/types/events.d.ts +5 -4
  145. package/dist/types/events.js +3 -2
  146. package/dist/types/events.js.map +1 -1
  147. package/dist/types/tracing.d.ts +1 -1
  148. package/dist/types/tracing.js.map +1 -1
  149. package/dist/websocket/events.d.ts +2 -0
  150. package/dist/websocket/events.js +2 -0
  151. package/dist/websocket.d.ts +2201 -0
  152. package/dist/websocket.js +684 -0
  153. package/dist/websocket.js.map +1 -0
  154. package/dist/window-read-CBZEJ84M.d.ts +113 -0
  155. package/dist/window-read-DPFAA1hM.js +264 -0
  156. package/dist/window-read-DPFAA1hM.js.map +1 -0
  157. package/package.json +87 -46
  158. package/testing/offline-trace/README.md +2 -1
  159. package/CHANGELOG.md +0 -25
  160. package/CONTRIBUTING.md +0 -26
  161. package/SECURITY.md +0 -7
  162. package/dist/command-queues-CQ9cwRP7.d.ts +0 -468
  163. package/dist/compaction-1LSZR944.d.ts +0 -144
  164. package/dist/durable-C3Rz7kg3.js.map +0 -1
  165. package/dist/durable-object-runtime-CiMKxGs6.d.ts +0 -257
  166. package/dist/durable-object-runtime-wKiqaAt2.js +0 -1494
  167. package/dist/durable-object-runtime-wKiqaAt2.js.map +0 -1
  168. package/dist/durable-object-storage-Czy7IPrh.d.ts +0 -41
  169. package/dist/host/durable-object-runtime.d.ts +0 -2
  170. package/dist/host/durable-object-runtime.js +0 -2
  171. package/dist/host/durable-object-storage.d.ts +0 -2
  172. package/dist/host/durable-object-storage.js +0 -0
  173. package/dist/host/durable-object.d.ts +0 -83
  174. package/dist/host/durable-object.js +0 -191
  175. package/dist/host/durable-object.js.map +0 -1
  176. package/dist/host/websocket-wire.d.ts +0 -2
  177. package/dist/host/websocket-wire.js +0 -105
  178. package/dist/host/websocket-wire.js.map +0 -1
  179. package/dist/index-BVVgDSdq.d.ts +0 -1
  180. package/dist/keep-alive-DYDsH6qN.d.ts +0 -111
  181. package/dist/keep-alive-p8dIcSVy.js.map +0 -1
  182. package/dist/message-transcript-BCHdHAe2.d.ts +0 -32
  183. package/dist/prompt-projector-DimXJPOJ.d.ts +0 -39
  184. package/dist/reduced-state-C4nVVzz9.js +0 -910
  185. package/dist/reduced-state-C4nVVzz9.js.map +0 -1
  186. package/dist/runtime-DcdPOEuE.d.ts +0 -60
  187. package/dist/services/compaction.js.map +0 -1
  188. package/dist/session-query-Cbf-e0rG.js.map +0 -1
  189. package/dist/session-query-hxfujxUH.d.ts +0 -769
  190. package/dist/session-store-D2Ore1QC.d.ts +0 -295
  191. package/dist/session-store-pYxQW9qh.js +0 -214
  192. package/dist/session-store-pYxQW9qh.js.map +0 -1
  193. package/dist/sink-registry-BziFpxoE.d.ts +0 -158
  194. package/dist/sink-registry-CFC6xjsN.js +0 -312
  195. package/dist/sink-registry-CFC6xjsN.js.map +0 -1
  196. package/docs/assets/architecture.svg +0 -216
  197. package/docs/assets/event-sequence.svg +0 -133
  198. package/docs/assets/gcp-trace.png +0 -0
  199. package/docs/assets/hero.svg +0 -33
  200. package/docs/message-steering.md +0 -831
  201. package/docs/releasing.md +0 -96
  202. package/docs/spec.md +0 -777
  203. package/docs/subagents.md +0 -725
  204. package/docs/testing.md +0 -64
  205. package/docs/ui-projection.md +0 -742
  206. package/docs/websocket-protocol.md +0 -639
  207. package/examples/001-no-tools/README.md +0 -65
  208. package/examples/001-no-tools/worker.ts +0 -79
  209. package/examples/002-slack-bridge/README.md +0 -134
  210. package/examples/002-slack-bridge/events.ts +0 -115
  211. package/examples/002-slack-bridge/reducer.ts +0 -216
  212. package/examples/002-slack-bridge/scenario.test.ts +0 -223
  213. package/examples/002-slack-bridge/sinks.ts +0 -109
  214. package/examples/002-slack-bridge/worker.ts +0 -140
  215. package/examples/003-sandbox-lifecycle/README.md +0 -78
  216. package/examples/003-sandbox-lifecycle/events.ts +0 -203
  217. package/examples/003-sandbox-lifecycle/reducer.ts +0 -305
  218. package/examples/003-sandbox-lifecycle/scenario.test.ts +0 -202
  219. package/examples/_shared/event-id.ts +0 -12
  220. package/examples/_shared/http.ts +0 -27
  221. package/examples/_shared/openai.ts +0 -33
@@ -1,20 +1,45 @@
1
- import { a as PromotePendingMessageCommand, c as SubmitMessageCommand, o as ResumePendingMessagesCommand, s as StopTurnCommand, t as CancelPendingMessageCommand } from "./commands-Ce1ec6kH.js";
2
- import { A as EventEnvelope } from "./events-Bb9-Cu-7.js";
1
+ import { c as StopTurnCommand, l as SubmitMessageCommand, o as PromotePendingMessageCommand, s as ResumePendingMessagesCommand, t as CancelPendingMessageCommand } from "./commands-3OD-p8dD.js";
2
+ import { h as SequenceNumber } from "./core-BcimKMIv.js";
3
+ import { f as PositionedEvent, i as EventEnvelope } from "./envelope-Che6KatU.js";
4
+ import "./events-Dg0o5wWs.js";
5
+ import "./reduced-state-DU2ECOUp.js";
6
+ import * as Effect from "effect/Effect";
3
7
  import * as Schema from "effect/Schema";
4
-
5
- //#region src/host/websocket-wire.d.ts
8
+ //#region src/websocket/protocol.d.ts
6
9
  /** Current EDA live-event WebSocket wire protocol version. */
7
10
  declare const EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION: 1;
8
11
  /** Flow-control policy announced by the server in the hello frame. */
9
12
  declare const EDAWebSocketWireFlowControl: Schema.Struct<{
10
13
  readonly ackTimeoutMs: Schema.Int;
14
+ /** Deprecated: servers no longer send heartbeat frames. Kept so deployed clients can decode hello. */
11
15
  readonly heartbeatIntervalMs: Schema.Int;
12
16
  readonly maxFrameBytes: Schema.Int;
13
17
  readonly maxFrameEvents: Schema.Int;
14
18
  readonly maxInFlightFrames: Schema.Int;
19
+ /** Suggested client-originated ping cadence; absent on servers that still send heartbeats. */
20
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
15
21
  readonly subscriberBufferCapacityEvents: Schema.Int;
16
22
  }>;
17
23
  type EDAWebSocketWireFlowControl = typeof EDAWebSocketWireFlowControl.Type;
24
+ /**
25
+ * Canonical client liveness ping message.
26
+ *
27
+ * The exact string matters: hibernation-capable hosts register it with
28
+ * WebSocket auto-response so the runtime answers without waking the object.
29
+ */
30
+ declare const EDA_WEB_SOCKET_PING_MESSAGE = "{\"_tag\":\"ping\"}";
31
+ /** Canonical server pong message paired with {@link EDA_WEB_SOCKET_PING_MESSAGE}. */
32
+ declare const EDA_WEB_SOCKET_PONG_MESSAGE = "{\"_tag\":\"pong\"}";
33
+ /** Client liveness ping; hosts answer with a pong and never ACK-track it. */
34
+ declare const EDAWebSocketWirePingFrame: Schema.Struct<{
35
+ readonly _tag: Schema.Literal<"ping">;
36
+ }>;
37
+ type EDAWebSocketWirePingFrame = typeof EDAWebSocketWirePingFrame.Type;
38
+ /** Server liveness pong; clients may ignore it and must not ACK it. */
39
+ declare const EDAWebSocketWirePongFrame: Schema.Struct<{
40
+ readonly _tag: Schema.Literal<"pong">;
41
+ }>;
42
+ type EDAWebSocketWirePongFrame = typeof EDAWebSocketWirePongFrame.Type;
18
43
  declare const EDAWebSocketWireHelloFrame: Schema.Struct<{
19
44
  readonly _tag: Schema.Literal<"hello">;
20
45
  readonly protocolVersion: Schema.Literal<1>;
@@ -22,10 +47,13 @@ declare const EDAWebSocketWireHelloFrame: Schema.Struct<{
22
47
  readonly resumeSeq: Schema.Int;
23
48
  readonly flowControl: Schema.Struct<{
24
49
  readonly ackTimeoutMs: Schema.Int;
50
+ /** Deprecated: servers no longer send heartbeat frames. Kept so deployed clients can decode hello. */
25
51
  readonly heartbeatIntervalMs: Schema.Int;
26
52
  readonly maxFrameBytes: Schema.Int;
27
53
  readonly maxFrameEvents: Schema.Int;
28
54
  readonly maxInFlightFrames: Schema.Int;
55
+ /** Suggested client-originated ping cadence; absent on servers that still send heartbeats. */
56
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
29
57
  readonly subscriberBufferCapacityEvents: Schema.Int;
30
58
  }>;
31
59
  }>;
@@ -47,16 +75,27 @@ declare const EDAWebSocketWireErrorFrame: Schema.Struct<{
47
75
  readonly message: Schema.String;
48
76
  }>;
49
77
  type EDAWebSocketWireErrorFrame = typeof EDAWebSocketWireErrorFrame.Type;
78
+ /**
79
+ * Client acknowledgement. `frameId` is the transport receipt: it cumulatively frees flow-control
80
+ * capacity. On a transcript socket `appliedUpdateSeq` is the client's applied cut, the last
81
+ * transcript update it applied completely, and `durableThroughSeq` is that update's
82
+ * `throughSeq`; both advance only on complete updates, never on a partial chunked transfer.
83
+ * Raw event sockets ignore `appliedUpdateSeq`.
84
+ */
50
85
  declare const EDAWebSocketWireAckFrame: Schema.Struct<{
51
86
  readonly _tag: Schema.Literal<"ack">;
52
87
  readonly frameId: Schema.Int;
53
88
  readonly durableThroughSeq: Schema.Int;
89
+ readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
54
90
  }>;
55
91
  type EDAWebSocketWireAckFrame = typeof EDAWebSocketWireAckFrame.Type;
56
92
  declare const EDAWebSocketWireClientFrame: Schema.Union<readonly [Schema.Struct<{
57
93
  readonly _tag: Schema.Literal<"ack">;
58
94
  readonly frameId: Schema.Int;
59
95
  readonly durableThroughSeq: Schema.Int;
96
+ readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
97
+ }>, Schema.Struct<{
98
+ readonly _tag: Schema.Literal<"ping">;
60
99
  }>]>;
61
100
  type EDAWebSocketWireClientFrame = typeof EDAWebSocketWireClientFrame.Type;
62
101
  /** Exhaustive decision table for a concrete WebSocket event union. */
@@ -65,13 +104,380 @@ type EDAWebSocketEventConsumerPolicy<Event extends {
65
104
  }, Disposition> = Readonly<Record<Event["type"], Disposition>>;
66
105
  /** Complete framework-owned event union present on every EDA WebSocket. */
67
106
  declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
68
- readonly namespace: Schema.Literal<string>;
107
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
108
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
109
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
110
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
111
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
112
+ readonly span: Schema.Struct<{
113
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
114
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
115
+ readonly sampled: Schema.Boolean;
116
+ readonly tracestate: Schema.NullOr<Schema.String>;
117
+ }>;
118
+ readonly links: Schema.$Array<Schema.Struct<{
119
+ readonly context: Schema.Struct<{
120
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
121
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
122
+ readonly sampled: Schema.Boolean;
123
+ readonly tracestate: Schema.NullOr<Schema.String>;
124
+ }>;
125
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
126
+ }>>;
127
+ }>>;
128
+ readonly durability: Schema.Literal<"durable">;
129
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
130
+ readonly type: Schema.Literal<"TurnAttemptStarted">;
131
+ readonly schemaVersion: Schema.Literal<number>;
132
+ readonly payload: Schema.Struct<{
133
+ readonly runId: Schema.brand<Schema.String, "RunId">;
134
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
135
+ readonly attemptId: Schema.brand<Schema.String, "InferenceId">;
136
+ }>;
137
+ }>, Schema.Struct<{
138
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
139
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
140
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
141
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
142
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
143
+ readonly span: Schema.Struct<{
144
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
145
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
146
+ readonly sampled: Schema.Boolean;
147
+ readonly tracestate: Schema.NullOr<Schema.String>;
148
+ }>;
149
+ readonly links: Schema.$Array<Schema.Struct<{
150
+ readonly context: Schema.Struct<{
151
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
152
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
153
+ readonly sampled: Schema.Boolean;
154
+ readonly tracestate: Schema.NullOr<Schema.String>;
155
+ }>;
156
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
157
+ }>>;
158
+ }>>;
159
+ readonly durability: Schema.Literal<"durable">;
160
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
161
+ readonly type: Schema.Literal<"TurnAttemptCompleted">;
162
+ readonly schemaVersion: Schema.Literal<number>;
163
+ readonly payload: Schema.Struct<{
164
+ readonly runId: Schema.brand<Schema.String, "RunId">;
165
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
166
+ readonly attemptId: Schema.brand<Schema.String, "InferenceId">;
167
+ readonly finishReason: Schema.optionalKey<Schema.String>;
168
+ readonly usage: Schema.optionalKey<Schema.Struct<{
169
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
170
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
171
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
172
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
173
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
174
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
175
+ }>>;
176
+ readonly responseMetadata: Schema.optionalKey<Schema.Unknown>;
177
+ readonly finishMetadata: Schema.optionalKey<Schema.Unknown>;
178
+ }>;
179
+ }>, Schema.Struct<{
180
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
181
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
182
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
183
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
184
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
185
+ readonly span: Schema.Struct<{
186
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
187
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
188
+ readonly sampled: Schema.Boolean;
189
+ readonly tracestate: Schema.NullOr<Schema.String>;
190
+ }>;
191
+ readonly links: Schema.$Array<Schema.Struct<{
192
+ readonly context: Schema.Struct<{
193
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
194
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
195
+ readonly sampled: Schema.Boolean;
196
+ readonly tracestate: Schema.NullOr<Schema.String>;
197
+ }>;
198
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
199
+ }>>;
200
+ }>>;
201
+ readonly durability: Schema.Literal<"durable">;
202
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
203
+ readonly type: Schema.Literal<"AssistantMessageCommitted">;
204
+ readonly schemaVersion: Schema.Literal<number>;
205
+ readonly payload: Schema.Struct<{
206
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
207
+ readonly runId: Schema.brand<Schema.String, "RunId">;
208
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
209
+ readonly attemptId: Schema.brand<Schema.String, "InferenceId">;
210
+ readonly promptParts: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
211
+ readonly type: Schema.Literal<"text">;
212
+ readonly text: Schema.String;
213
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
214
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
215
+ }>, Schema.Struct<{
216
+ readonly type: Schema.Literal<"file">;
217
+ readonly mediaType: Schema.String;
218
+ readonly fileName: Schema.optional<Schema.String>;
219
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
220
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
221
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
222
+ }>, Schema.Struct<{
223
+ readonly type: Schema.Literal<"reasoning">;
224
+ readonly text: Schema.String;
225
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
226
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
227
+ }>, Schema.Struct<{
228
+ readonly type: Schema.Literal<"tool-call">;
229
+ readonly id: Schema.String;
230
+ readonly name: Schema.String;
231
+ readonly params: Schema.Unknown;
232
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
233
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
234
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
235
+ }>, Schema.Struct<{
236
+ readonly type: Schema.Literal<"tool-result">;
237
+ readonly id: Schema.String;
238
+ readonly name: Schema.String;
239
+ readonly isFailure: Schema.Boolean;
240
+ readonly result: Schema.Unknown;
241
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
242
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
243
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
244
+ }>, Schema.Struct<{
245
+ readonly type: Schema.Literal<"tool-approval-request">;
246
+ readonly approvalId: Schema.String;
247
+ readonly toolCallId: Schema.String;
248
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
249
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
250
+ }>]>>;
251
+ }>;
252
+ }>, Schema.Struct<{
253
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
254
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
255
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
256
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
257
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
258
+ readonly span: Schema.Struct<{
259
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
260
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
261
+ readonly sampled: Schema.Boolean;
262
+ readonly tracestate: Schema.NullOr<Schema.String>;
263
+ }>;
264
+ readonly links: Schema.$Array<Schema.Struct<{
265
+ readonly context: Schema.Struct<{
266
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
267
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
268
+ readonly sampled: Schema.Boolean;
269
+ readonly tracestate: Schema.NullOr<Schema.String>;
270
+ }>;
271
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
272
+ }>>;
273
+ }>>;
274
+ readonly durability: Schema.Literal<"durable">;
275
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
276
+ readonly type: Schema.Literal<"ToolCallCreated">;
277
+ readonly schemaVersion: Schema.Literal<number>;
278
+ readonly payload: Schema.Struct<{
279
+ readonly runId: Schema.brand<Schema.String, "RunId">;
280
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
281
+ readonly attemptId: Schema.brand<Schema.String, "InferenceId">;
282
+ readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
283
+ readonly promptPart: Schema.Struct<{
284
+ readonly type: Schema.Literal<"tool-call">;
285
+ readonly params: Schema.Unknown;
286
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
287
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
288
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
289
+ readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
290
+ readonly name: Schema.NonEmptyString;
291
+ }>;
292
+ }>;
293
+ }>]>, Schema.Union<readonly [Schema.Struct<{
294
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
295
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
296
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
297
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
298
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
299
+ readonly span: Schema.Struct<{
300
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
301
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
302
+ readonly sampled: Schema.Boolean;
303
+ readonly tracestate: Schema.NullOr<Schema.String>;
304
+ }>;
305
+ readonly links: Schema.$Array<Schema.Struct<{
306
+ readonly context: 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 attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
313
+ }>>;
314
+ }>>;
315
+ readonly durability: Schema.Literal<"durable">;
316
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
317
+ readonly type: Schema.Literal<"SessionConfigured">;
318
+ readonly schemaVersion: Schema.Literal<number>;
319
+ readonly payload: Schema.Struct<{
320
+ readonly modelSelection: Schema.Struct<{
321
+ readonly provider: Schema.NonEmptyString;
322
+ readonly modelId: Schema.NonEmptyString;
323
+ readonly settings: Schema.optionalKey<Schema.Unknown>;
324
+ }>;
325
+ }>;
326
+ }>, Schema.Union<readonly [Schema.Struct<{
327
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
328
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
329
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
330
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
331
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
332
+ readonly span: Schema.Struct<{
333
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
334
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
335
+ readonly sampled: Schema.Boolean;
336
+ readonly tracestate: Schema.NullOr<Schema.String>;
337
+ }>;
338
+ readonly links: Schema.$Array<Schema.Struct<{
339
+ readonly context: Schema.Struct<{
340
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
341
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
342
+ readonly sampled: Schema.Boolean;
343
+ readonly tracestate: Schema.NullOr<Schema.String>;
344
+ }>;
345
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
346
+ }>>;
347
+ }>>;
348
+ readonly durability: Schema.Literal<"durable">;
349
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
350
+ readonly type: Schema.Literal<"RunSchedulingRequested">;
351
+ readonly schemaVersion: Schema.Literal<number>;
352
+ readonly payload: Schema.Struct<{
353
+ readonly requestId: Schema.brand<Schema.String, "RunRequestId">;
354
+ readonly work: Schema.Union<readonly [Schema.TaggedStruct<"Command", {
355
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
356
+ }>, Schema.TaggedStruct<"Recovery", {
357
+ readonly commandId: Schema.brand<Schema.String, "CommandId">;
358
+ readonly interruptedRunId: Schema.brand<Schema.String, "RunId">;
359
+ readonly inputMessageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
360
+ }>]>;
361
+ }>;
362
+ }>, Schema.Struct<{
363
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
364
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
365
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
366
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
367
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
368
+ readonly span: Schema.Struct<{
369
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
370
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
371
+ readonly sampled: Schema.Boolean;
372
+ readonly tracestate: Schema.NullOr<Schema.String>;
373
+ }>;
374
+ readonly links: Schema.$Array<Schema.Struct<{
375
+ readonly context: Schema.Struct<{
376
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
377
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
378
+ readonly sampled: Schema.Boolean;
379
+ readonly tracestate: Schema.NullOr<Schema.String>;
380
+ }>;
381
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
382
+ }>>;
383
+ }>>;
384
+ readonly durability: Schema.Literal<"durable">;
385
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
386
+ readonly type: Schema.Literal<"RunSchedulingDelivered">;
387
+ readonly schemaVersion: Schema.Literal<number>;
388
+ readonly payload: Schema.Struct<{
389
+ readonly requestId: Schema.brand<Schema.String, "RunRequestId">;
390
+ }>;
391
+ }>, Schema.Struct<{
392
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
393
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
394
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
395
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
396
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
397
+ readonly span: Schema.Struct<{
398
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
399
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
400
+ readonly sampled: Schema.Boolean;
401
+ readonly tracestate: Schema.NullOr<Schema.String>;
402
+ }>;
403
+ readonly links: Schema.$Array<Schema.Struct<{
404
+ readonly context: Schema.Struct<{
405
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
406
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
407
+ readonly sampled: Schema.Boolean;
408
+ readonly tracestate: Schema.NullOr<Schema.String>;
409
+ }>;
410
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
411
+ }>>;
412
+ }>>;
413
+ readonly durability: Schema.Literal<"durable">;
414
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
415
+ readonly type: Schema.Literal<"RunSchedulingInvalidated">;
416
+ readonly schemaVersion: Schema.Literal<number>;
417
+ readonly payload: Schema.Struct<{
418
+ readonly requestId: Schema.brand<Schema.String, "RunRequestId">;
419
+ readonly reason: Schema.Literals<readonly ["stopped", "interrupted", "message-cancelled", "ineligible"]>;
420
+ }>;
421
+ }>, Schema.Struct<{
422
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
423
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
424
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
425
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
426
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
427
+ readonly span: Schema.Struct<{
428
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
429
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
430
+ readonly sampled: Schema.Boolean;
431
+ readonly tracestate: Schema.NullOr<Schema.String>;
432
+ }>;
433
+ readonly links: Schema.$Array<Schema.Struct<{
434
+ readonly context: Schema.Struct<{
435
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
436
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
437
+ readonly sampled: Schema.Boolean;
438
+ readonly tracestate: Schema.NullOr<Schema.String>;
439
+ }>;
440
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
441
+ }>>;
442
+ }>>;
443
+ readonly durability: Schema.Literal<"durable">;
444
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
445
+ readonly type: Schema.Literal<"RunSchedulingGranted">;
446
+ readonly schemaVersion: Schema.Literal<number>;
447
+ readonly payload: Schema.Struct<{
448
+ readonly requestId: Schema.brand<Schema.String, "RunRequestId">;
449
+ readonly runId: Schema.brand<Schema.String, "RunId">;
450
+ }>;
451
+ }>]>, Schema.Union<readonly [Schema.Struct<{
452
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
453
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
454
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
455
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
456
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
457
+ readonly span: Schema.Struct<{
458
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
459
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
460
+ readonly sampled: Schema.Boolean;
461
+ readonly tracestate: Schema.NullOr<Schema.String>;
462
+ }>;
463
+ readonly links: Schema.$Array<Schema.Struct<{
464
+ readonly context: Schema.Struct<{
465
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
466
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
467
+ readonly sampled: Schema.Boolean;
468
+ readonly tracestate: Schema.NullOr<Schema.String>;
469
+ }>;
470
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
471
+ }>>;
472
+ }>>;
473
+ readonly durability: Schema.Literal<"durable">;
474
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
69
475
  readonly type: Schema.Literal<"CommandAdmitted">;
70
476
  readonly schemaVersion: Schema.Literal<number>;
71
477
  readonly payload: Schema.Struct<{
72
478
  readonly command: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
73
479
  }>;
74
- readonly durability: Schema.Literal<"durable">;
480
+ }>, Schema.Struct<{
75
481
  readonly eventId: Schema.brand<Schema.String, "EventId">;
76
482
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
77
483
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -93,14 +499,14 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
93
499
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
94
500
  }>>;
95
501
  }>>;
96
- }>, Schema.Struct<{
97
- readonly namespace: Schema.Literal<string>;
502
+ readonly durability: Schema.Literal<"durable">;
503
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
98
504
  readonly type: Schema.Literal<"CommandStarted">;
99
505
  readonly schemaVersion: Schema.Literal<number>;
100
506
  readonly payload: Schema.Struct<{
101
507
  readonly commandId: Schema.brand<Schema.String, "CommandId">;
102
508
  }>;
103
- readonly durability: Schema.Literal<"durable">;
509
+ }>, Schema.Struct<{
104
510
  readonly eventId: Schema.brand<Schema.String, "EventId">;
105
511
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
106
512
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -122,14 +528,14 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
122
528
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
123
529
  }>>;
124
530
  }>>;
125
- }>, Schema.Struct<{
126
- readonly namespace: Schema.Literal<string>;
531
+ readonly durability: Schema.Literal<"durable">;
532
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
127
533
  readonly type: Schema.Literal<"CommandCompleted">;
128
534
  readonly schemaVersion: Schema.Literal<number>;
129
535
  readonly payload: Schema.Struct<{
130
536
  readonly commandId: Schema.brand<Schema.String, "CommandId">;
131
537
  }>;
132
- readonly durability: Schema.Literal<"durable">;
538
+ }>, Schema.Struct<{
133
539
  readonly eventId: Schema.brand<Schema.String, "EventId">;
134
540
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
135
541
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -151,8 +557,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
151
557
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
152
558
  }>>;
153
559
  }>>;
154
- }>, Schema.Struct<{
155
- readonly namespace: Schema.Literal<string>;
560
+ readonly durability: Schema.Literal<"durable">;
561
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
156
562
  readonly type: Schema.Literal<"CommandFailed">;
157
563
  readonly schemaVersion: Schema.Literal<number>;
158
564
  readonly payload: Schema.Struct<{
@@ -163,7 +569,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
163
569
  readonly details: Schema.optionalKey<Schema.Unknown>;
164
570
  }>;
165
571
  }>;
166
- readonly durability: Schema.Literal<"durable">;
572
+ }>, Schema.Struct<{
167
573
  readonly eventId: Schema.brand<Schema.String, "EventId">;
168
574
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
169
575
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -185,15 +591,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
185
591
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
186
592
  }>>;
187
593
  }>>;
188
- }>, Schema.Struct<{
189
- readonly namespace: Schema.Literal<string>;
594
+ readonly durability: Schema.Literal<"durable">;
595
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
190
596
  readonly type: Schema.Literal<"CommandCancelled">;
191
597
  readonly schemaVersion: Schema.Literal<number>;
192
598
  readonly payload: Schema.Struct<{
193
599
  readonly commandId: Schema.brand<Schema.String, "CommandId">;
194
600
  readonly reason: Schema.String;
195
601
  }>;
196
- readonly durability: Schema.Literal<"durable">;
602
+ }>]>, Schema.Union<readonly [Schema.Struct<{
197
603
  readonly eventId: Schema.brand<Schema.String, "EventId">;
198
604
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
199
605
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -215,15 +621,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
215
621
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
216
622
  }>>;
217
623
  }>>;
218
- }>]>, Schema.Union<readonly [Schema.Struct<{
219
- readonly namespace: Schema.Literal<string>;
624
+ readonly durability: Schema.Literal<"durable">;
625
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
220
626
  readonly type: Schema.Literal<"SystemMessageCommitted">;
221
627
  readonly schemaVersion: Schema.Literal<number>;
222
628
  readonly payload: Schema.Struct<{
223
629
  readonly messageId: Schema.brand<Schema.String, "MessageId">;
224
630
  readonly content: Schema.NonEmptyString;
225
631
  }>;
226
- readonly durability: Schema.Literal<"durable">;
632
+ }>, Schema.Struct<{
227
633
  readonly eventId: Schema.brand<Schema.String, "EventId">;
228
634
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
229
635
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -245,8 +651,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
245
651
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
246
652
  }>>;
247
653
  }>>;
248
- }>, Schema.Struct<{
249
- readonly namespace: Schema.Literal<string>;
654
+ readonly durability: Schema.Literal<"durable">;
655
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
250
656
  readonly type: Schema.Literal<"UserMessageCommitted">;
251
657
  readonly schemaVersion: Schema.Literal<number>;
252
658
  readonly payload: Schema.Struct<{
@@ -271,7 +677,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
271
677
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
272
678
  }>]>>]>;
273
679
  }>;
274
- readonly durability: Schema.Literal<"durable">;
680
+ }>, Schema.Struct<{
275
681
  readonly eventId: Schema.brand<Schema.String, "EventId">;
276
682
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
277
683
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -293,8 +699,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
293
699
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
294
700
  }>>;
295
701
  }>>;
296
- }>, Schema.Struct<{
297
- readonly namespace: Schema.Literal<string>;
702
+ readonly durability: Schema.Literal<"durable">;
703
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
298
704
  readonly type: Schema.Literal<"SteeringMessageQueued">;
299
705
  readonly schemaVersion: Schema.Literal<number>;
300
706
  readonly payload: Schema.Struct<{
@@ -320,7 +726,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
320
726
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
321
727
  }>]>>]>;
322
728
  }>;
323
- readonly durability: Schema.Literal<"durable">;
729
+ }>, Schema.Struct<{
324
730
  readonly eventId: Schema.brand<Schema.String, "EventId">;
325
731
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
326
732
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -342,8 +748,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
342
748
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
343
749
  }>>;
344
750
  }>>;
345
- }>, Schema.Struct<{
346
- readonly namespace: Schema.Literal<string>;
751
+ readonly durability: Schema.Literal<"durable">;
752
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
347
753
  readonly type: Schema.Literal<"SteeringMessageCancelled">;
348
754
  readonly schemaVersion: Schema.Literal<number>;
349
755
  readonly payload: Schema.Struct<{
@@ -351,7 +757,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
351
757
  readonly runId: Schema.brand<Schema.String, "RunId">;
352
758
  readonly reason: Schema.String;
353
759
  }>;
354
- readonly durability: Schema.Literal<"durable">;
760
+ }>, Schema.Struct<{
355
761
  readonly eventId: Schema.brand<Schema.String, "EventId">;
356
762
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
357
763
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -373,8 +779,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
373
779
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
374
780
  }>>;
375
781
  }>>;
376
- }>, Schema.Struct<{
377
- readonly namespace: Schema.Literal<string>;
782
+ readonly durability: Schema.Literal<"durable">;
783
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
378
784
  readonly type: Schema.Literal<"UserMessageSubmitted">;
379
785
  readonly schemaVersion: Schema.Literal<number>;
380
786
  readonly payload: Schema.Struct<{
@@ -400,7 +806,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
400
806
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
401
807
  }>]>>]>;
402
808
  }>;
403
- readonly durability: Schema.Literal<"durable">;
809
+ }>, Schema.Struct<{
404
810
  readonly eventId: Schema.brand<Schema.String, "EventId">;
405
811
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
406
812
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -422,8 +828,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
422
828
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
423
829
  }>>;
424
830
  }>>;
425
- }>, Schema.Struct<{
426
- readonly namespace: Schema.Literal<string>;
831
+ readonly durability: Schema.Literal<"durable">;
832
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
427
833
  readonly type: Schema.Literal<"UserMessagePromoted">;
428
834
  readonly schemaVersion: Schema.Literal<number>;
429
835
  readonly payload: Schema.Struct<{
@@ -432,7 +838,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
432
838
  readonly from: Schema.Literal<"queue">;
433
839
  readonly to: Schema.Literal<"steer">;
434
840
  }>;
435
- readonly durability: Schema.Literal<"durable">;
841
+ }>, Schema.Struct<{
436
842
  readonly eventId: Schema.brand<Schema.String, "EventId">;
437
843
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
438
844
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -454,8 +860,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
454
860
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
455
861
  }>>;
456
862
  }>>;
457
- }>, Schema.Struct<{
458
- readonly namespace: Schema.Literal<string>;
863
+ readonly durability: Schema.Literal<"durable">;
864
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
459
865
  readonly type: Schema.Literal<"UserMessageCancelled">;
460
866
  readonly schemaVersion: Schema.Literal<number>;
461
867
  readonly payload: Schema.Struct<{
@@ -463,7 +869,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
463
869
  readonly messageId: Schema.brand<Schema.String, "MessageId">;
464
870
  readonly reason: Schema.Literals<readonly ["edit", "user-cancel", "clear-paused-queue"]>;
465
871
  }>;
466
- readonly durability: Schema.Literal<"durable">;
872
+ }>, Schema.Struct<{
467
873
  readonly eventId: Schema.brand<Schema.String, "EventId">;
468
874
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
469
875
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -485,8 +891,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
485
891
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
486
892
  }>>;
487
893
  }>>;
488
- }>, Schema.Struct<{
489
- readonly namespace: Schema.Literal<string>;
894
+ readonly durability: Schema.Literal<"durable">;
895
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
490
896
  readonly type: Schema.Literal<"MessageQueuePaused">;
491
897
  readonly schemaVersion: Schema.Literal<number>;
492
898
  readonly payload: Schema.Struct<{
@@ -495,7 +901,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
495
901
  readonly messageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
496
902
  readonly reason: Schema.Literal<"user-interrupted">;
497
903
  }>;
498
- readonly durability: Schema.Literal<"durable">;
904
+ }>, Schema.Struct<{
499
905
  readonly eventId: Schema.brand<Schema.String, "EventId">;
500
906
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
501
907
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -517,17 +923,22 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
517
923
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
518
924
  }>>;
519
925
  }>>;
520
- }>, Schema.Struct<{
521
- readonly namespace: Schema.Literal<string>;
926
+ readonly durability: Schema.Literal<"durable">;
927
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
522
928
  readonly type: Schema.Literal<"PendingMessagesPaused">;
523
929
  readonly schemaVersion: Schema.Literal<number>;
524
- readonly payload: Schema.Struct<{
930
+ readonly payload: Schema.Union<readonly [Schema.Struct<{
525
931
  readonly interruptionCommandId: Schema.brand<Schema.String, "CommandId">;
932
+ readonly messageIds: Schema.NonEmptyArray<Schema.brand<Schema.String, "MessageId">>;
933
+ readonly reason: Schema.Literal<"user-interrupted">;
526
934
  readonly runId: Schema.brand<Schema.String, "RunId">;
935
+ }>, Schema.Struct<{
936
+ readonly interruptionCommandId: Schema.brand<Schema.String, "CommandId">;
527
937
  readonly messageIds: Schema.NonEmptyArray<Schema.brand<Schema.String, "MessageId">>;
528
938
  readonly reason: Schema.Literal<"user-interrupted">;
529
- }>;
530
- readonly durability: Schema.Literal<"durable">;
939
+ readonly runRequestId: Schema.brand<Schema.String, "RunRequestId">;
940
+ }>]>;
941
+ }>, Schema.Struct<{
531
942
  readonly eventId: Schema.brand<Schema.String, "EventId">;
532
943
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
533
944
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -549,8 +960,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
549
960
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
550
961
  }>>;
551
962
  }>>;
552
- }>, Schema.Struct<{
553
- readonly namespace: Schema.Literal<string>;
963
+ readonly durability: Schema.Literal<"durable">;
964
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
554
965
  readonly type: Schema.Literal<"AssistantMessageCommitted">;
555
966
  readonly schemaVersion: Schema.Literal<number>;
556
967
  readonly payload: Schema.Struct<{
@@ -589,6 +1000,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
589
1000
  readonly name: Schema.String;
590
1001
  readonly isFailure: Schema.Boolean;
591
1002
  readonly result: Schema.Unknown;
1003
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
592
1004
  readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
593
1005
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
594
1006
  }>, Schema.Struct<{
@@ -599,7 +1011,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
599
1011
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
600
1012
  }>]>>;
601
1013
  }>;
602
- readonly durability: Schema.Literal<"durable">;
1014
+ }>, Schema.Struct<{
603
1015
  readonly eventId: Schema.brand<Schema.String, "EventId">;
604
1016
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
605
1017
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -621,8 +1033,81 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
621
1033
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
622
1034
  }>>;
623
1035
  }>>;
1036
+ readonly durability: Schema.Literal<"durable">;
1037
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1038
+ readonly type: Schema.Literal<"AssistantMessageImported">;
1039
+ readonly schemaVersion: Schema.Literal<number>;
1040
+ readonly payload: Schema.Struct<{
1041
+ readonly messageId: Schema.brand<Schema.String, "MessageId">;
1042
+ readonly runId: Schema.brand<Schema.String, "RunId">;
1043
+ readonly turnId: Schema.brand<Schema.String, "TurnId">;
1044
+ readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1045
+ readonly promptParts: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
1046
+ readonly type: Schema.Literal<"text">;
1047
+ readonly text: Schema.String;
1048
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1049
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1050
+ }>, Schema.Struct<{
1051
+ readonly type: Schema.Literal<"file">;
1052
+ readonly mediaType: Schema.String;
1053
+ readonly fileName: Schema.optional<Schema.String>;
1054
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
1055
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1056
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1057
+ }>, Schema.Struct<{
1058
+ readonly type: Schema.Literal<"reasoning">;
1059
+ readonly text: Schema.String;
1060
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1061
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1062
+ }>, Schema.Struct<{
1063
+ readonly type: Schema.Literal<"tool-call">;
1064
+ readonly id: Schema.String;
1065
+ readonly name: Schema.String;
1066
+ readonly params: Schema.Unknown;
1067
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1068
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1069
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1070
+ }>, Schema.Struct<{
1071
+ readonly type: Schema.Literal<"tool-result">;
1072
+ readonly id: Schema.String;
1073
+ readonly name: Schema.String;
1074
+ readonly isFailure: Schema.Boolean;
1075
+ readonly result: Schema.Unknown;
1076
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1077
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1078
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1079
+ }>, Schema.Struct<{
1080
+ readonly type: Schema.Literal<"tool-approval-request">;
1081
+ readonly approvalId: Schema.String;
1082
+ readonly toolCallId: Schema.String;
1083
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1084
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1085
+ }>]>>;
1086
+ }>;
624
1087
  }>, Schema.Struct<{
625
- readonly namespace: Schema.Literal<string>;
1088
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
1089
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1090
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
1091
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
1092
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
1093
+ readonly span: Schema.Struct<{
1094
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1095
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1096
+ readonly sampled: Schema.Boolean;
1097
+ readonly tracestate: Schema.NullOr<Schema.String>;
1098
+ }>;
1099
+ readonly links: Schema.$Array<Schema.Struct<{
1100
+ readonly context: Schema.Struct<{
1101
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1102
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1103
+ readonly sampled: Schema.Boolean;
1104
+ readonly tracestate: Schema.NullOr<Schema.String>;
1105
+ }>;
1106
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1107
+ }>>;
1108
+ }>>;
1109
+ readonly durability: Schema.Literal<"durable">;
1110
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
626
1111
  readonly type: Schema.Literal<"AssistantPartialCommitted">;
627
1112
  readonly schemaVersion: Schema.Literal<number>;
628
1113
  readonly payload: Schema.Struct<{
@@ -661,6 +1146,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
661
1146
  readonly name: Schema.String;
662
1147
  readonly isFailure: Schema.Boolean;
663
1148
  readonly result: Schema.Unknown;
1149
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
664
1150
  readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
665
1151
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
666
1152
  }>, Schema.Struct<{
@@ -672,7 +1158,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
672
1158
  }>]>>;
673
1159
  readonly reason: Schema.String;
674
1160
  }>;
675
- readonly durability: Schema.Literal<"durable">;
1161
+ }>]>, Schema.Union<readonly [Schema.Struct<{
676
1162
  readonly eventId: Schema.brand<Schema.String, "EventId">;
677
1163
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
678
1164
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -694,8 +1180,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
694
1180
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
695
1181
  }>>;
696
1182
  }>>;
697
- }>]>, Schema.Union<readonly [Schema.Struct<{
698
- readonly namespace: Schema.Literal<string>;
1183
+ readonly durability: Schema.Literal<"durable">;
1184
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
699
1185
  readonly type: Schema.Literal<"RunStarted">;
700
1186
  readonly schemaVersion: Schema.Literal<number>;
701
1187
  readonly payload: Schema.Struct<{
@@ -724,7 +1210,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
724
1210
  }>>;
725
1211
  }>>;
726
1212
  }>;
727
- readonly durability: Schema.Literal<"durable">;
1213
+ }>, Schema.Struct<{
728
1214
  readonly eventId: Schema.brand<Schema.String, "EventId">;
729
1215
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
730
1216
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -746,14 +1232,14 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
746
1232
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
747
1233
  }>>;
748
1234
  }>>;
749
- }>, Schema.Struct<{
750
- readonly namespace: Schema.Literal<string>;
1235
+ readonly durability: Schema.Literal<"durable">;
1236
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
751
1237
  readonly type: Schema.Literal<"RunCompleted">;
752
1238
  readonly schemaVersion: Schema.Literal<number>;
753
1239
  readonly payload: Schema.Struct<{
754
1240
  readonly runId: Schema.brand<Schema.String, "RunId">;
755
1241
  }>;
756
- readonly durability: Schema.Literal<"durable">;
1242
+ }>, Schema.Struct<{
757
1243
  readonly eventId: Schema.brand<Schema.String, "EventId">;
758
1244
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
759
1245
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -775,8 +1261,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
775
1261
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
776
1262
  }>>;
777
1263
  }>>;
778
- }>, Schema.Struct<{
779
- readonly namespace: Schema.Literal<string>;
1264
+ readonly durability: Schema.Literal<"durable">;
1265
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
780
1266
  readonly type: Schema.Literal<"RunFailed">;
781
1267
  readonly schemaVersion: Schema.Literal<number>;
782
1268
  readonly payload: Schema.Struct<{
@@ -787,7 +1273,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
787
1273
  readonly details: Schema.optionalKey<Schema.Unknown>;
788
1274
  }>;
789
1275
  }>;
790
- readonly durability: Schema.Literal<"durable">;
1276
+ }>, Schema.Struct<{
791
1277
  readonly eventId: Schema.brand<Schema.String, "EventId">;
792
1278
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
793
1279
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -809,15 +1295,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
809
1295
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
810
1296
  }>>;
811
1297
  }>>;
812
- }>, Schema.Struct<{
813
- readonly namespace: Schema.Literal<string>;
1298
+ readonly durability: Schema.Literal<"durable">;
1299
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
814
1300
  readonly type: Schema.Literal<"RunInterrupted">;
815
1301
  readonly schemaVersion: Schema.Literal<number>;
816
1302
  readonly payload: Schema.Struct<{
817
1303
  readonly runId: Schema.brand<Schema.String, "RunId">;
818
1304
  readonly reason: Schema.String;
819
1305
  }>;
820
- readonly durability: Schema.Literal<"durable">;
1306
+ }>]>, Schema.Struct<{
821
1307
  readonly eventId: Schema.brand<Schema.String, "EventId">;
822
1308
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
823
1309
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -839,8 +1325,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
839
1325
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
840
1326
  }>>;
841
1327
  }>>;
842
- }>]>, Schema.Struct<{
843
- readonly namespace: Schema.Literal<string>;
1328
+ readonly durability: Schema.Literal<"durable">;
1329
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
844
1330
  readonly type: Schema.Literal<"RecoveryCompleted">;
845
1331
  readonly schemaVersion: Schema.Literal<number>;
846
1332
  readonly payload: Schema.Struct<{
@@ -851,7 +1337,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
851
1337
  readonly replacementRunId: Schema.brand<Schema.String, "RunId">;
852
1338
  }>>;
853
1339
  }>;
854
- readonly durability: Schema.Literal<"durable">;
1340
+ }>, Schema.Union<readonly [Schema.Struct<{
855
1341
  readonly eventId: Schema.brand<Schema.String, "EventId">;
856
1342
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
857
1343
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -873,8 +1359,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
873
1359
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
874
1360
  }>>;
875
1361
  }>>;
876
- }>, Schema.Union<readonly [Schema.Struct<{
877
- readonly namespace: Schema.Literal<string>;
1362
+ readonly durability: Schema.Literal<"durable">;
1363
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
878
1364
  readonly type: Schema.Literal<"TurnStarted">;
879
1365
  readonly schemaVersion: Schema.Literal<number>;
880
1366
  readonly payload: Schema.Struct<{
@@ -882,7 +1368,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
882
1368
  readonly turnId: Schema.brand<Schema.String, "TurnId">;
883
1369
  readonly inputMessageIds: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "MessageId">>>;
884
1370
  }>;
885
- readonly durability: Schema.Literal<"durable">;
1371
+ }>, Schema.Struct<{
886
1372
  readonly eventId: Schema.brand<Schema.String, "EventId">;
887
1373
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
888
1374
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -904,8 +1390,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
904
1390
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
905
1391
  }>>;
906
1392
  }>>;
907
- }>, Schema.Struct<{
908
- readonly namespace: Schema.Literal<string>;
1393
+ readonly durability: Schema.Literal<"durable">;
1394
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
909
1395
  readonly type: Schema.Literal<"TurnCompleted">;
910
1396
  readonly schemaVersion: Schema.Literal<number>;
911
1397
  readonly payload: Schema.Struct<{
@@ -914,12 +1400,13 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
914
1400
  readonly usage: Schema.optionalKey<Schema.Struct<{
915
1401
  readonly inputTokens: Schema.optionalKey<Schema.Int>;
916
1402
  readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
1403
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
917
1404
  readonly outputTokens: Schema.optionalKey<Schema.Int>;
918
1405
  readonly textTokens: Schema.optionalKey<Schema.Int>;
919
1406
  readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
920
1407
  }>>;
921
1408
  }>;
922
- readonly durability: Schema.Literal<"durable">;
1409
+ }>, Schema.Struct<{
923
1410
  readonly eventId: Schema.brand<Schema.String, "EventId">;
924
1411
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
925
1412
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -941,8 +1428,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
941
1428
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
942
1429
  }>>;
943
1430
  }>>;
944
- }>, Schema.Struct<{
945
- readonly namespace: Schema.Literal<string>;
1431
+ readonly durability: Schema.Literal<"durable">;
1432
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
946
1433
  readonly type: Schema.Literal<"TurnFailed">;
947
1434
  readonly schemaVersion: Schema.Literal<number>;
948
1435
  readonly payload: Schema.Struct<{
@@ -954,7 +1441,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
954
1441
  readonly details: Schema.optionalKey<Schema.Unknown>;
955
1442
  }>;
956
1443
  }>;
957
- readonly durability: Schema.Literal<"durable">;
1444
+ }>, Schema.Struct<{
958
1445
  readonly eventId: Schema.brand<Schema.String, "EventId">;
959
1446
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
960
1447
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -976,8 +1463,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
976
1463
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
977
1464
  }>>;
978
1465
  }>>;
979
- }>, Schema.Struct<{
980
- readonly namespace: Schema.Literal<string>;
1466
+ readonly durability: Schema.Literal<"durable">;
1467
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
981
1468
  readonly type: Schema.Literal<"TurnStopped">;
982
1469
  readonly schemaVersion: Schema.Literal<number>;
983
1470
  readonly payload: Schema.Struct<{
@@ -985,7 +1472,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
985
1472
  readonly turnId: Schema.brand<Schema.String, "TurnId">;
986
1473
  readonly reason: Schema.String;
987
1474
  }>;
988
- readonly durability: Schema.Literal<"durable">;
1475
+ }>]>, Schema.Union<readonly [Schema.Struct<{
989
1476
  readonly eventId: Schema.brand<Schema.String, "EventId">;
990
1477
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
991
1478
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1007,8 +1494,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1007
1494
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1008
1495
  }>>;
1009
1496
  }>>;
1010
- }>]>, Schema.Union<readonly [Schema.Struct<{
1011
- readonly namespace: Schema.Literal<string>;
1497
+ readonly durability: Schema.Literal<"durable">;
1498
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1012
1499
  readonly type: Schema.Literal<"InferenceStarted">;
1013
1500
  readonly schemaVersion: Schema.Literal<number>;
1014
1501
  readonly payload: Schema.Struct<{
@@ -1016,7 +1503,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1016
1503
  readonly turnId: Schema.brand<Schema.String, "TurnId">;
1017
1504
  readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1018
1505
  }>;
1019
- readonly durability: Schema.Literal<"durable">;
1506
+ }>, Schema.Struct<{
1020
1507
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1021
1508
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1022
1509
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1038,8 +1525,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1038
1525
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1039
1526
  }>>;
1040
1527
  }>>;
1041
- }>, Schema.Struct<{
1042
- readonly namespace: Schema.Literal<string>;
1528
+ readonly durability: Schema.Literal<"durable">;
1529
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1043
1530
  readonly type: Schema.Literal<"InferenceCompleted">;
1044
1531
  readonly schemaVersion: Schema.Literal<number>;
1045
1532
  readonly payload: Schema.Struct<{
@@ -1050,6 +1537,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1050
1537
  readonly usage: Schema.optionalKey<Schema.Struct<{
1051
1538
  readonly inputTokens: Schema.optionalKey<Schema.Int>;
1052
1539
  readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
1540
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
1053
1541
  readonly outputTokens: Schema.optionalKey<Schema.Int>;
1054
1542
  readonly textTokens: Schema.optionalKey<Schema.Int>;
1055
1543
  readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
@@ -1057,7 +1545,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1057
1545
  readonly responseMetadata: Schema.optionalKey<Schema.Unknown>;
1058
1546
  readonly finishMetadata: Schema.optionalKey<Schema.Unknown>;
1059
1547
  }>;
1060
- readonly durability: Schema.Literal<"durable">;
1548
+ }>, Schema.Struct<{
1061
1549
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1062
1550
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1063
1551
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1079,8 +1567,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1079
1567
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1080
1568
  }>>;
1081
1569
  }>>;
1082
- }>, Schema.Struct<{
1083
- readonly namespace: Schema.Literal<string>;
1570
+ readonly durability: Schema.Literal<"durable">;
1571
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1084
1572
  readonly type: Schema.Literal<"InferenceFailed">;
1085
1573
  readonly schemaVersion: Schema.Literal<number>;
1086
1574
  readonly payload: Schema.Struct<{
@@ -1093,7 +1581,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1093
1581
  readonly details: Schema.optionalKey<Schema.Unknown>;
1094
1582
  }>;
1095
1583
  }>;
1096
- readonly durability: Schema.Literal<"durable">;
1584
+ }>]>, Schema.Union<readonly [Schema.Struct<{
1097
1585
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1098
1586
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1099
1587
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1115,8 +1603,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1115
1603
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1116
1604
  }>>;
1117
1605
  }>>;
1118
- }>]>, Schema.Union<readonly [Schema.Struct<{
1119
- readonly namespace: Schema.Literal<string>;
1606
+ readonly durability: Schema.Literal<"durable">;
1607
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1120
1608
  readonly type: Schema.Literal<"ToolCallCreated">;
1121
1609
  readonly schemaVersion: Schema.Literal<number>;
1122
1610
  readonly payload: Schema.Struct<{
@@ -1125,16 +1613,16 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1125
1613
  readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1126
1614
  readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1127
1615
  readonly promptPart: Schema.Struct<{
1128
- readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1129
- readonly name: Schema.NonEmptyString;
1130
1616
  readonly type: Schema.Literal<"tool-call">;
1131
1617
  readonly params: Schema.Unknown;
1132
1618
  readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1133
1619
  readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1134
1620
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1621
+ readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1622
+ readonly name: Schema.NonEmptyString;
1135
1623
  }>;
1136
1624
  }>;
1137
- readonly durability: Schema.Literal<"durable">;
1625
+ }>, Schema.Struct<{
1138
1626
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1139
1627
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1140
1628
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1156,8 +1644,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1156
1644
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1157
1645
  }>>;
1158
1646
  }>>;
1159
- }>, Schema.Struct<{
1160
- readonly namespace: Schema.Literal<string>;
1647
+ readonly durability: Schema.Literal<"durable">;
1648
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1161
1649
  readonly type: Schema.Literal<"ToolCallRejected">;
1162
1650
  readonly schemaVersion: Schema.Literal<number>;
1163
1651
  readonly payload: Schema.Struct<{
@@ -1166,20 +1654,21 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1166
1654
  readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
1167
1655
  readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1168
1656
  readonly promptPart: Schema.Struct<{
1657
+ readonly type: Schema.Literal<"tool-result">;
1658
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1659
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1660
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1661
+ readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1662
+ readonly name: Schema.NonEmptyString;
1169
1663
  readonly isFailure: Schema.Literal<true>;
1170
1664
  readonly result: Schema.Struct<{
1171
1665
  readonly message: Schema.String;
1172
1666
  readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
1173
1667
  readonly modelFeedback: Schema.NonEmptyString;
1174
1668
  }>;
1175
- readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1176
- readonly name: Schema.NonEmptyString;
1177
- readonly type: Schema.Literal<"tool-result">;
1178
- readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1179
- readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1180
1669
  }>;
1181
1670
  }>;
1182
- readonly durability: Schema.Literal<"durable">;
1671
+ }>, Schema.Struct<{
1183
1672
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1184
1673
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1185
1674
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1201,14 +1690,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1201
1690
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1202
1691
  }>>;
1203
1692
  }>>;
1204
- }>, Schema.Struct<{
1205
- readonly namespace: Schema.Literal<string>;
1693
+ readonly durability: Schema.Literal<"durable">;
1694
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1206
1695
  readonly type: Schema.Literal<"ToolCallStarted">;
1207
1696
  readonly schemaVersion: Schema.Literal<number>;
1208
1697
  readonly payload: Schema.Struct<{
1209
1698
  readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1699
+ readonly attempt: Schema.optionalKey<Schema.Int>;
1210
1700
  }>;
1211
- readonly durability: Schema.Literal<"durable">;
1701
+ }>, Schema.Struct<{
1212
1702
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1213
1703
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1214
1704
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1230,23 +1720,24 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1230
1720
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1231
1721
  }>>;
1232
1722
  }>>;
1233
- }>, Schema.Struct<{
1234
- readonly namespace: Schema.Literal<string>;
1723
+ readonly durability: Schema.Literal<"durable">;
1724
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1235
1725
  readonly type: Schema.Literal<"ToolCallCompleted">;
1236
1726
  readonly schemaVersion: Schema.Literal<number>;
1237
1727
  readonly payload: Schema.Struct<{
1238
1728
  readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1239
1729
  readonly promptPart: Schema.Struct<{
1240
- readonly isFailure: Schema.Literal<false>;
1241
- readonly result: Schema.Unknown;
1242
- readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1243
- readonly name: Schema.NonEmptyString;
1244
1730
  readonly type: Schema.Literal<"tool-result">;
1731
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1245
1732
  readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1246
1733
  readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1734
+ readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1735
+ readonly name: Schema.NonEmptyString;
1736
+ readonly isFailure: Schema.Literal<false>;
1737
+ readonly result: Schema.Unknown;
1247
1738
  }>;
1248
1739
  }>;
1249
- readonly durability: Schema.Literal<"durable">;
1740
+ }>, Schema.Struct<{
1250
1741
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1251
1742
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1252
1743
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1268,8 +1759,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1268
1759
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1269
1760
  }>>;
1270
1761
  }>>;
1271
- }>, Schema.Struct<{
1272
- readonly namespace: Schema.Literal<string>;
1762
+ readonly durability: Schema.Literal<"durable">;
1763
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1273
1764
  readonly type: Schema.Literal<"ToolCallFailed">;
1274
1765
  readonly schemaVersion: Schema.Literal<number>;
1275
1766
  readonly payload: Schema.Struct<{
@@ -1280,20 +1771,21 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1280
1771
  readonly details: Schema.optionalKey<Schema.Unknown>;
1281
1772
  }>>;
1282
1773
  readonly promptPart: Schema.Struct<{
1774
+ readonly type: Schema.Literal<"tool-result">;
1775
+ readonly providerExecuted: Schema.withDecodingDefault<Schema.Boolean>;
1776
+ readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1777
+ readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1778
+ readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1779
+ readonly name: Schema.NonEmptyString;
1283
1780
  readonly isFailure: Schema.Literal<true>;
1284
1781
  readonly result: Schema.Struct<{
1285
1782
  readonly message: Schema.String;
1286
1783
  readonly code: Schema.optionalKey<Schema.String>;
1287
1784
  readonly details: Schema.optionalKey<Schema.Unknown>;
1288
1785
  }>;
1289
- readonly id: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1290
- readonly name: Schema.NonEmptyString;
1291
- readonly type: Schema.Literal<"tool-result">;
1292
- readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
1293
- readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
1294
1786
  }>;
1295
1787
  }>;
1296
- readonly durability: Schema.Literal<"durable">;
1788
+ }>]>, Schema.Union<readonly [Schema.Struct<{
1297
1789
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1298
1790
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1299
1791
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1315,8 +1807,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1315
1807
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1316
1808
  }>>;
1317
1809
  }>>;
1318
- }>]>, Schema.Union<readonly [Schema.Struct<{
1319
- readonly namespace: Schema.Literal<string>;
1810
+ readonly durability: Schema.Literal<"durable">;
1811
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1320
1812
  readonly type: Schema.Literal<"StopTurnRequested">;
1321
1813
  readonly schemaVersion: Schema.Literal<number>;
1322
1814
  readonly payload: Schema.Struct<{
@@ -1324,7 +1816,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1324
1816
  readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
1325
1817
  readonly turnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
1326
1818
  }>;
1327
- readonly durability: Schema.Literal<"durable">;
1819
+ }>, Schema.Struct<{
1328
1820
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1329
1821
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1330
1822
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1346,8 +1838,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1346
1838
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1347
1839
  }>>;
1348
1840
  }>>;
1349
- }>, Schema.Struct<{
1350
- readonly namespace: Schema.Literal<string>;
1841
+ readonly durability: Schema.Literal<"durable">;
1842
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1351
1843
  readonly type: Schema.Literal<"StopTurnApplied">;
1352
1844
  readonly schemaVersion: Schema.Literal<number>;
1353
1845
  readonly payload: Schema.Struct<{
@@ -1356,7 +1848,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1356
1848
  readonly turnId: Schema.brand<Schema.String, "TurnId">;
1357
1849
  readonly inferenceId: Schema.optionalKey<Schema.brand<Schema.String, "InferenceId">>;
1358
1850
  }>;
1359
- readonly durability: Schema.Literal<"durable">;
1851
+ }>]>, Schema.Union<readonly [Schema.Struct<{
1360
1852
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1361
1853
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1362
1854
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1378,15 +1870,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1378
1870
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1379
1871
  }>>;
1380
1872
  }>>;
1381
- }>]>, Schema.Union<readonly [Schema.Struct<{
1382
- readonly namespace: Schema.Literal<string>;
1873
+ readonly durability: Schema.Literal<"durable">;
1874
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1383
1875
  readonly type: Schema.Literal<"ContextProjected">;
1384
1876
  readonly schemaVersion: Schema.Literal<number>;
1385
1877
  readonly payload: Schema.Struct<{
1386
1878
  readonly contextVersion: Schema.brand<Schema.Int, "ContextVersion">;
1387
1879
  readonly throughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1388
1880
  }>;
1389
- readonly durability: Schema.Literal<"durable">;
1881
+ }>, Schema.Struct<{
1390
1882
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1391
1883
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1392
1884
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1408,8 +1900,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1408
1900
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1409
1901
  }>>;
1410
1902
  }>>;
1411
- }>, Schema.Struct<{
1412
- readonly namespace: Schema.Literal<string>;
1903
+ readonly durability: Schema.Literal<"durable">;
1904
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1413
1905
  readonly type: Schema.Literal<"CompactionRequested">;
1414
1906
  readonly schemaVersion: Schema.Literal<number>;
1415
1907
  readonly payload: Schema.Struct<{
@@ -1417,7 +1909,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1417
1909
  readonly sourceFromSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1418
1910
  readonly sourceToSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1419
1911
  }>;
1420
- readonly durability: Schema.Literal<"durable">;
1912
+ }>, Schema.Struct<{
1421
1913
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1422
1914
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1423
1915
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1439,14 +1931,14 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1439
1931
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1440
1932
  }>>;
1441
1933
  }>>;
1442
- }>, Schema.Struct<{
1443
- readonly namespace: Schema.Literal<string>;
1934
+ readonly durability: Schema.Literal<"durable">;
1935
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1444
1936
  readonly type: Schema.Literal<"CompactionStarted">;
1445
1937
  readonly schemaVersion: Schema.Literal<number>;
1446
1938
  readonly payload: Schema.Struct<{
1447
1939
  readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
1448
1940
  }>;
1449
- readonly durability: Schema.Literal<"durable">;
1941
+ }>, Schema.Struct<{
1450
1942
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1451
1943
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1452
1944
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1468,8 +1960,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1468
1960
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1469
1961
  }>>;
1470
1962
  }>>;
1471
- }>, Schema.Struct<{
1472
- readonly namespace: Schema.Literal<string>;
1963
+ readonly durability: Schema.Literal<"durable">;
1964
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1473
1965
  readonly type: Schema.Literal<"SummaryCreated">;
1474
1966
  readonly schemaVersion: Schema.Literal<number>;
1475
1967
  readonly payload: Schema.Struct<{
@@ -1479,7 +1971,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1479
1971
  readonly sourceToSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1480
1972
  readonly summary: Schema.Unknown;
1481
1973
  }>;
1482
- readonly durability: Schema.Literal<"durable">;
1974
+ }>, Schema.Struct<{
1483
1975
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1484
1976
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1485
1977
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1501,14 +1993,27 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1501
1993
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1502
1994
  }>>;
1503
1995
  }>>;
1504
- }>, Schema.Struct<{
1505
- readonly namespace: Schema.Literal<string>;
1996
+ readonly durability: Schema.Literal<"durable">;
1997
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1506
1998
  readonly type: Schema.Literal<"CompactionCompleted">;
1507
1999
  readonly schemaVersion: Schema.Literal<number>;
1508
2000
  readonly payload: Schema.Struct<{
1509
2001
  readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
2002
+ readonly modelSelection: Schema.optionalKey<Schema.Struct<{
2003
+ readonly provider: Schema.NonEmptyString;
2004
+ readonly modelId: Schema.NonEmptyString;
2005
+ readonly settings: Schema.optionalKey<Schema.Unknown>;
2006
+ }>>;
2007
+ readonly usage: Schema.optionalKey<Schema.Struct<{
2008
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
2009
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
2010
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
2011
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
2012
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
2013
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
2014
+ }>>;
1510
2015
  }>;
1511
- readonly durability: Schema.Literal<"durable">;
2016
+ }>, Schema.Struct<{
1512
2017
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1513
2018
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1514
2019
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1530,8 +2035,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1530
2035
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1531
2036
  }>>;
1532
2037
  }>>;
1533
- }>, Schema.Struct<{
1534
- readonly namespace: Schema.Literal<string>;
2038
+ readonly durability: Schema.Literal<"durable">;
2039
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1535
2040
  readonly type: Schema.Literal<"ContextRebased">;
1536
2041
  readonly schemaVersion: Schema.Literal<number>;
1537
2042
  readonly payload: Schema.Struct<{
@@ -1540,7 +2045,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1540
2045
  readonly contextVersion: Schema.brand<Schema.Int, "ContextVersion">;
1541
2046
  readonly retainedFromContextSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1542
2047
  }>;
1543
- readonly durability: Schema.Literal<"durable">;
2048
+ }>, Schema.Struct<{
1544
2049
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1545
2050
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1546
2051
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1562,8 +2067,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1562
2067
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1563
2068
  }>>;
1564
2069
  }>>;
1565
- }>, Schema.Struct<{
1566
- readonly namespace: Schema.Literal<string>;
2070
+ readonly durability: Schema.Literal<"durable">;
2071
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1567
2072
  readonly type: Schema.Literal<"CompactionFailed">;
1568
2073
  readonly schemaVersion: Schema.Literal<number>;
1569
2074
  readonly payload: Schema.Struct<{
@@ -1573,8 +2078,21 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1573
2078
  readonly code: Schema.optionalKey<Schema.String>;
1574
2079
  readonly details: Schema.optionalKey<Schema.Unknown>;
1575
2080
  }>;
2081
+ readonly modelSelection: Schema.optionalKey<Schema.Struct<{
2082
+ readonly provider: Schema.NonEmptyString;
2083
+ readonly modelId: Schema.NonEmptyString;
2084
+ readonly settings: Schema.optionalKey<Schema.Unknown>;
2085
+ }>>;
2086
+ readonly usage: Schema.optionalKey<Schema.Struct<{
2087
+ readonly inputTokens: Schema.optionalKey<Schema.Int>;
2088
+ readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
2089
+ readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
2090
+ readonly outputTokens: Schema.optionalKey<Schema.Int>;
2091
+ readonly textTokens: Schema.optionalKey<Schema.Int>;
2092
+ readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
2093
+ }>>;
1576
2094
  }>;
1577
- readonly durability: Schema.Literal<"durable">;
2095
+ }>]>, Schema.Union<readonly [Schema.Struct<{
1578
2096
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1579
2097
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1580
2098
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1596,15 +2114,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1596
2114
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1597
2115
  }>>;
1598
2116
  }>>;
1599
- }>]>, Schema.Union<readonly [Schema.Struct<{
1600
- readonly namespace: Schema.Literal<string>;
2117
+ readonly durability: Schema.Literal<"durable">;
2118
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1601
2119
  readonly type: Schema.Literal<"BaseStateRequested">;
1602
2120
  readonly schemaVersion: Schema.Literal<number>;
1603
2121
  readonly payload: Schema.Struct<{
1604
2122
  readonly baseStateId: Schema.brand<Schema.String, "BaseStateId">;
1605
2123
  readonly requestedThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1606
2124
  }>;
1607
- readonly durability: Schema.Literal<"durable">;
2125
+ }>, Schema.Struct<{
1608
2126
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1609
2127
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1610
2128
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1626,15 +2144,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1626
2144
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1627
2145
  }>>;
1628
2146
  }>>;
1629
- }>, Schema.Struct<{
1630
- readonly namespace: Schema.Literal<string>;
2147
+ readonly durability: Schema.Literal<"durable">;
2148
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1631
2149
  readonly type: Schema.Literal<"BaseStateCreated">;
1632
2150
  readonly schemaVersion: Schema.Literal<number>;
1633
2151
  readonly payload: Schema.Struct<{
1634
2152
  readonly baseStateId: Schema.brand<Schema.String, "BaseStateId">;
1635
2153
  readonly coversThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
1636
2154
  }>;
1637
- readonly durability: Schema.Literal<"durable">;
2155
+ }>, Schema.Struct<{
1638
2156
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1639
2157
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1640
2158
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1656,8 +2174,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1656
2174
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1657
2175
  }>>;
1658
2176
  }>>;
1659
- }>, Schema.Struct<{
1660
- readonly namespace: Schema.Literal<string>;
2177
+ readonly durability: Schema.Literal<"durable">;
2178
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1661
2179
  readonly type: Schema.Literal<"BaseStateFailed">;
1662
2180
  readonly schemaVersion: Schema.Literal<number>;
1663
2181
  readonly payload: Schema.Struct<{
@@ -1668,7 +2186,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1668
2186
  readonly details: Schema.optionalKey<Schema.Unknown>;
1669
2187
  }>;
1670
2188
  }>;
1671
- readonly durability: Schema.Literal<"durable">;
2189
+ }>]>]>]>, Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1672
2190
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1673
2191
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1674
2192
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1690,15 +2208,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1690
2208
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1691
2209
  }>>;
1692
2210
  }>>;
1693
- }>]>]>, Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1694
- readonly namespace: Schema.Literal<string>;
2211
+ readonly durability: Schema.Literal<"ephemeral">;
2212
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1695
2213
  readonly type: Schema.Literal<"TextDelta">;
1696
2214
  readonly schemaVersion: Schema.Literal<number>;
1697
2215
  readonly payload: Schema.Struct<{
1698
2216
  readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1699
2217
  readonly delta: Schema.String;
1700
2218
  }>;
1701
- readonly durability: Schema.Literal<"ephemeral">;
2219
+ }>, Schema.Struct<{
1702
2220
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1703
2221
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1704
2222
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1720,15 +2238,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1720
2238
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1721
2239
  }>>;
1722
2240
  }>>;
1723
- }>, Schema.Struct<{
1724
- readonly namespace: Schema.Literal<string>;
2241
+ readonly durability: Schema.Literal<"ephemeral">;
2242
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1725
2243
  readonly type: Schema.Literal<"ReasoningDelta">;
1726
2244
  readonly schemaVersion: Schema.Literal<number>;
1727
2245
  readonly payload: Schema.Struct<{
1728
2246
  readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1729
2247
  readonly delta: Schema.String;
1730
2248
  }>;
1731
- readonly durability: Schema.Literal<"ephemeral">;
2249
+ }>, Schema.Struct<{
1732
2250
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1733
2251
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1734
2252
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1750,8 +2268,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1750
2268
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1751
2269
  }>>;
1752
2270
  }>>;
1753
- }>, Schema.Struct<{
1754
- readonly namespace: Schema.Literal<string>;
2271
+ readonly durability: Schema.Literal<"ephemeral">;
2272
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1755
2273
  readonly type: Schema.Literal<"ToolParamsStart">;
1756
2274
  readonly schemaVersion: Schema.Literal<number>;
1757
2275
  readonly payload: Schema.Struct<{
@@ -1760,7 +2278,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1760
2278
  readonly toolName: Schema.NonEmptyString;
1761
2279
  readonly providerExecuted: Schema.Boolean;
1762
2280
  }>;
1763
- readonly durability: Schema.Literal<"ephemeral">;
2281
+ }>, Schema.Struct<{
1764
2282
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1765
2283
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1766
2284
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1782,8 +2300,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1782
2300
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1783
2301
  }>>;
1784
2302
  }>>;
1785
- }>, Schema.Struct<{
1786
- readonly namespace: Schema.Literal<string>;
2303
+ readonly durability: Schema.Literal<"ephemeral">;
2304
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1787
2305
  readonly type: Schema.Literal<"ToolParamsDelta">;
1788
2306
  readonly schemaVersion: Schema.Literal<number>;
1789
2307
  readonly payload: Schema.Struct<{
@@ -1791,7 +2309,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1791
2309
  readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1792
2310
  readonly delta: Schema.String;
1793
2311
  }>;
1794
- readonly durability: Schema.Literal<"ephemeral">;
2312
+ }>, Schema.Struct<{
1795
2313
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1796
2314
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1797
2315
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1813,15 +2331,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1813
2331
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1814
2332
  }>>;
1815
2333
  }>>;
1816
- }>, Schema.Struct<{
1817
- readonly namespace: Schema.Literal<string>;
2334
+ readonly durability: Schema.Literal<"ephemeral">;
2335
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1818
2336
  readonly type: Schema.Literal<"ToolParamsEnd">;
1819
2337
  readonly schemaVersion: Schema.Literal<number>;
1820
2338
  readonly payload: Schema.Struct<{
1821
2339
  readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
1822
2340
  readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
1823
2341
  }>;
1824
- readonly durability: Schema.Literal<"ephemeral">;
2342
+ }>]>, Schema.Union<readonly [Schema.Struct<{
1825
2343
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1826
2344
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1827
2345
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1843,15 +2361,15 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1843
2361
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1844
2362
  }>>;
1845
2363
  }>>;
1846
- }>]>, Schema.Union<readonly [Schema.Struct<{
1847
- readonly namespace: Schema.Literal<string>;
2364
+ readonly durability: Schema.Literal<"ephemeral">;
2365
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1848
2366
  readonly type: Schema.Literal<"SubscriberStatus">;
1849
2367
  readonly schemaVersion: Schema.Literal<number>;
1850
2368
  readonly payload: Schema.Struct<{
1851
2369
  readonly status: Schema.Literals<readonly ["connected", "catching-up", "live", "lagging", "closed"]>;
1852
2370
  readonly reason: Schema.optionalKey<Schema.String>;
1853
2371
  }>;
1854
- readonly durability: Schema.Literal<"ephemeral">;
2372
+ }>, Schema.Struct<{
1855
2373
  readonly eventId: Schema.brand<Schema.String, "EventId">;
1856
2374
  readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1857
2375
  readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
@@ -1873,8 +2391,8 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1873
2391
  readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1874
2392
  }>>;
1875
2393
  }>>;
1876
- }>, Schema.Struct<{
1877
- readonly namespace: Schema.Literal<string>;
2394
+ readonly durability: Schema.Literal<"ephemeral">;
2395
+ readonly namespace: Schema.Literal<"effect-durable-agent">;
1878
2396
  readonly type: Schema.Literal<"TraceStatus">;
1879
2397
  readonly schemaVersion: Schema.Literal<number>;
1880
2398
  readonly payload: Schema.Struct<{
@@ -1882,28 +2400,6 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
1882
2400
  readonly spanName: Schema.NonEmptyString;
1883
2401
  readonly details: Schema.optionalKey<Schema.Unknown>;
1884
2402
  }>;
1885
- readonly durability: Schema.Literal<"ephemeral">;
1886
- readonly eventId: Schema.brand<Schema.String, "EventId">;
1887
- readonly sessionId: Schema.brand<Schema.String, "SessionId">;
1888
- readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
1889
- readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
1890
- readonly trace: Schema.withConstructorDefault<Schema.Struct<{
1891
- readonly span: Schema.Struct<{
1892
- readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1893
- readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1894
- readonly sampled: Schema.Boolean;
1895
- readonly tracestate: Schema.NullOr<Schema.String>;
1896
- }>;
1897
- readonly links: Schema.$Array<Schema.Struct<{
1898
- readonly context: Schema.Struct<{
1899
- readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
1900
- readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
1901
- readonly sampled: Schema.Boolean;
1902
- readonly tracestate: Schema.NullOr<Schema.String>;
1903
- }>;
1904
- readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
1905
- }>>;
1906
- }>>;
1907
2403
  }>]>]>]>;
1908
2404
  type EDAFrameworkWebSocketEvent = typeof EDAFrameworkWebSocketEvent.Type;
1909
2405
  declare const makeEDAWebSocketDomainSchemas: <EventSchema extends Schema.Codec<EventEnvelope, unknown, never, never>>(event: EventSchema) => {
@@ -1934,10 +2430,13 @@ declare const makeEDAWebSocketDomainSchemas: <EventSchema extends Schema.Codec<E
1934
2430
  readonly resumeSeq: Schema.Int;
1935
2431
  readonly flowControl: Schema.Struct<{
1936
2432
  readonly ackTimeoutMs: Schema.Int;
2433
+ /** Deprecated: servers no longer send heartbeat frames. Kept so deployed clients can decode hello. */
1937
2434
  readonly heartbeatIntervalMs: Schema.Int;
1938
2435
  readonly maxFrameBytes: Schema.Int;
1939
2436
  readonly maxFrameEvents: Schema.Int;
1940
2437
  readonly maxInFlightFrames: Schema.Int;
2438
+ /** Suggested client-originated ping cadence; absent on servers that still send heartbeats. */
2439
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
1941
2440
  readonly subscriberBufferCapacityEvents: Schema.Int;
1942
2441
  }>;
1943
2442
  }>, Schema.Struct<{
@@ -1955,6 +2454,8 @@ declare const makeEDAWebSocketDomainSchemas: <EventSchema extends Schema.Codec<E
1955
2454
  readonly _tag: Schema.Literal<"heartbeat">;
1956
2455
  readonly serverTimeMs: Schema.Int;
1957
2456
  readonly durableThroughSeq: Schema.Int;
2457
+ }>, Schema.Struct<{
2458
+ readonly _tag: Schema.Literal<"pong">;
1958
2459
  }>, Schema.Struct<{
1959
2460
  readonly _tag: Schema.Literal<"lagged">;
1960
2461
  readonly resumeSeq: Schema.Int;
@@ -2074,10 +2575,13 @@ declare const EDAWebSocketHostDomain: {
2074
2575
  readonly resumeSeq: Schema.Int;
2075
2576
  readonly flowControl: Schema.Struct<{
2076
2577
  readonly ackTimeoutMs: Schema.Int;
2578
+ /** Deprecated: servers no longer send heartbeat frames. Kept so deployed clients can decode hello. */
2077
2579
  readonly heartbeatIntervalMs: Schema.Int;
2078
2580
  readonly maxFrameBytes: Schema.Int;
2079
2581
  readonly maxFrameEvents: Schema.Int;
2080
2582
  readonly maxInFlightFrames: Schema.Int;
2583
+ /** Suggested client-originated ping cadence; absent on servers that still send heartbeats. */
2584
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
2081
2585
  readonly subscriberBufferCapacityEvents: Schema.Int;
2082
2586
  }>;
2083
2587
  }>, Schema.Struct<{
@@ -2122,6 +2626,8 @@ declare const EDAWebSocketHostDomain: {
2122
2626
  readonly _tag: Schema.Literal<"heartbeat">;
2123
2627
  readonly serverTimeMs: Schema.Int;
2124
2628
  readonly durableThroughSeq: Schema.Int;
2629
+ }>, Schema.Struct<{
2630
+ readonly _tag: Schema.Literal<"pong">;
2125
2631
  }>, Schema.Struct<{
2126
2632
  readonly _tag: Schema.Literal<"lagged">;
2127
2633
  readonly resumeSeq: Schema.Int;
@@ -2162,11 +2668,324 @@ declare const edaFrameworkWebSocketWireProtocol: EDAWebSocketWireProtocol<typeof
2162
2668
  * Framework durable and ephemeral events are included automatically. Future EDA
2163
2669
  * apps register only their custom events. Servers use the returned domain schemas
2164
2670
  * and typed encoder; external consumers decode with the wire schemas. Pass the
2165
- * returned `host` adapter to `EDASessionDurableObjectHost`.
2671
+ * returned `host` adapter to the selected host package.
2166
2672
  */
2167
2673
  declare const makeEDAWebSocketWireProtocol: <AppEventSchema extends Schema.Codec<EventEnvelope, unknown, never, never>>(options: {
2168
2674
  readonly appEvents: AppEventSchema;
2169
2675
  }) => EDAWebSocketWireProtocol<Schema.Union<readonly [typeof EDAFrameworkWebSocketEvent, AppEventSchema]>>;
2170
2676
  //#endregion
2171
- export { EDAWebSocketWireAckFrame as a, EDAWebSocketWireFlowControl as c, EDAWebSocketWireLaggedFrame as d, EDAWebSocketWireProtocol as f, makeEDAWebSocketWireProtocol as h, EDAWebSocketServerFrameInput as i, EDAWebSocketWireHeartbeatFrame as l, edaFrameworkWebSocketWireProtocol as m, EDAWebSocketEventConsumerPolicy as n, EDAWebSocketWireClientFrame as o, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION as p, EDAWebSocketServerFrameEncoder as r, EDAWebSocketWireErrorFrame as s, EDAFrameworkWebSocketEvent as t, EDAWebSocketWireHelloFrame as u };
2172
- //# sourceMappingURL=websocket-wire-D3tLrhe2.d.ts.map
2677
+ //#region src/websocket/messages.d.ts
2678
+ /** Current EDA live-event WebSocket protocol version. */
2679
+ declare const EDA_WEB_SOCKET_PROTOCOL_VERSION: 1;
2680
+ /** WebSocket close code used when a subscriber cannot keep up with live delivery. */
2681
+ declare const EDA_WS_CLOSE_LAGGED = 4008;
2682
+ /** WebSocket close code used for normal host-driven shutdown. */
2683
+ declare const EDA_WS_CLOSE_GOING_AWAY = 1001;
2684
+ /** WebSocket close code used for malformed client protocol messages. */
2685
+ declare const EDA_WS_CLOSE_PROTOCOL_ERROR = 1002;
2686
+ /** WebSocket close code used when the host cannot send a frame. */
2687
+ declare const EDA_WS_CLOSE_SEND_FAILED = 1011;
2688
+ /** WebSocket close code used for unsupported binary messages. */
2689
+ declare const EDA_WS_CLOSE_UNSUPPORTED_DATA = 1003;
2690
+ /** Live subscriber identity persisted in WebSocket attachments. */
2691
+ declare const SubscriberId: Schema.brand<Schema.NonEmptyString, "SubscriberId">;
2692
+ type SubscriberId = typeof SubscriberId.Type;
2693
+ /** Per-connection monotonically increasing server frame id. */
2694
+ declare const FrameId: Schema.brand<Schema.Int, "FrameId">;
2695
+ type FrameId = typeof FrameId.Type;
2696
+ /** Flow-control policy announced by the server in the hello frame. */
2697
+ declare const EDAWebSocketFlowControl: Schema.Struct<{
2698
+ readonly ackTimeoutMs: Schema.Int;
2699
+ readonly heartbeatIntervalMs: Schema.Int;
2700
+ readonly maxFrameBytes: Schema.Int;
2701
+ readonly maxFrameEvents: Schema.Int;
2702
+ readonly maxInFlightFrames: Schema.Int;
2703
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
2704
+ readonly subscriberBufferCapacityEvents: Schema.Int;
2705
+ }>;
2706
+ type EDAWebSocketFlowControl = typeof EDAWebSocketFlowControl.Type;
2707
+ /** Default bounded policy sized for fast model deltas and large durable tool/message events. */
2708
+ declare const defaultEDAWebSocketFlowControl: EDAWebSocketFlowControl;
2709
+ /** First server frame; announces protocol and flow-control policy. */
2710
+ declare const EDAWebSocketHelloFrame: Schema.Struct<{
2711
+ readonly _tag: Schema.Literal<"hello">;
2712
+ readonly protocolVersion: Schema.Literal<1>;
2713
+ readonly flowControl: Schema.Struct<{
2714
+ readonly ackTimeoutMs: Schema.Int;
2715
+ readonly heartbeatIntervalMs: Schema.Int;
2716
+ readonly maxFrameBytes: Schema.Int;
2717
+ readonly maxFrameEvents: Schema.Int;
2718
+ readonly maxInFlightFrames: Schema.Int;
2719
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
2720
+ readonly subscriberBufferCapacityEvents: Schema.Int;
2721
+ }>;
2722
+ readonly subscriberId: Schema.brand<Schema.NonEmptyString, "SubscriberId">;
2723
+ readonly resumeSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2724
+ }>;
2725
+ type EDAWebSocketHelloFrame = typeof EDAWebSocketHelloFrame.Type;
2726
+ /** Ordered positioned events delivered to the client. */
2727
+ declare const EDAWebSocketEventsFrame: Schema.Struct<{
2728
+ readonly _tag: Schema.Literal<"events">;
2729
+ readonly frameId: Schema.brand<Schema.Int, "FrameId">;
2730
+ readonly events: Schema.NonEmptyArray<Schema.Struct<{
2731
+ readonly position: Schema.Struct<{
2732
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
2733
+ readonly subSeq: Schema.brand<Schema.Int, "SubSequenceNumber">;
2734
+ }>;
2735
+ readonly event: Schema.Struct<{
2736
+ readonly namespace: Schema.NonEmptyString;
2737
+ readonly type: Schema.NonEmptyString;
2738
+ readonly schemaVersion: Schema.Int;
2739
+ readonly durability: Schema.Literals<readonly ["durable", "ephemeral"]>;
2740
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
2741
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
2742
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
2743
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
2744
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
2745
+ readonly span: Schema.Struct<{
2746
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2747
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2748
+ readonly sampled: Schema.Boolean;
2749
+ readonly tracestate: Schema.NullOr<Schema.String>;
2750
+ }>;
2751
+ readonly links: Schema.$Array<Schema.Struct<{
2752
+ readonly context: Schema.Struct<{
2753
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2754
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2755
+ readonly sampled: Schema.Boolean;
2756
+ readonly tracestate: Schema.NullOr<Schema.String>;
2757
+ }>;
2758
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
2759
+ }>>;
2760
+ }>>;
2761
+ readonly payload: Schema.Unknown;
2762
+ }>;
2763
+ }>>;
2764
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2765
+ }>;
2766
+ type EDAWebSocketEventsFrame = typeof EDAWebSocketEventsFrame.Type;
2767
+ /**
2768
+ * Deprecated idle server keepalive frame.
2769
+ *
2770
+ * Servers no longer send heartbeats; the schema remains so deployed clients
2771
+ * keep decoding the server frame union. Liveness is client-originated via
2772
+ * {@link EDAWebSocketPingFrame} and the host-level auto-response pong.
2773
+ */
2774
+ declare const EDAWebSocketHeartbeatFrame: Schema.Struct<{
2775
+ readonly _tag: Schema.Literal<"heartbeat">;
2776
+ readonly serverTimeMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
2777
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2778
+ }>;
2779
+ type EDAWebSocketHeartbeatFrame = typeof EDAWebSocketHeartbeatFrame.Type;
2780
+ /** Client liveness ping; hosts answer with a pong and never ACK-track it. */
2781
+ declare const EDAWebSocketPingFrame: Schema.Struct<{
2782
+ readonly _tag: Schema.Literal<"ping">;
2783
+ }>;
2784
+ type EDAWebSocketPingFrame = typeof EDAWebSocketPingFrame.Type;
2785
+ /** Server liveness pong; clients may ignore it and must not ACK it. */
2786
+ declare const EDAWebSocketPongFrame: Schema.Struct<{
2787
+ readonly _tag: Schema.Literal<"pong">;
2788
+ }>;
2789
+ type EDAWebSocketPongFrame = typeof EDAWebSocketPongFrame.Type;
2790
+ /** Optional final frame sent before a lag-close. */
2791
+ declare const EDAWebSocketLaggedFrame: Schema.Struct<{
2792
+ readonly _tag: Schema.Literal<"lagged">;
2793
+ readonly reason: Schema.Literals<readonly ["buffer-overflow", "ack-timeout"]>;
2794
+ readonly resumeSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2795
+ }>;
2796
+ type EDAWebSocketLaggedFrame = typeof EDAWebSocketLaggedFrame.Type;
2797
+ /** Optional final frame sent before a protocol/internal close. */
2798
+ declare const EDAWebSocketErrorFrame: Schema.Struct<{
2799
+ readonly _tag: Schema.Literal<"error">;
2800
+ readonly message: Schema.String;
2801
+ }>;
2802
+ type EDAWebSocketErrorFrame = typeof EDAWebSocketErrorFrame.Type;
2803
+ /** Server-to-client application frame union. */
2804
+ declare const EDAWebSocketServerFrame: Schema.Union<readonly [Schema.Struct<{
2805
+ readonly _tag: Schema.Literal<"hello">;
2806
+ readonly protocolVersion: Schema.Literal<1>;
2807
+ readonly flowControl: Schema.Struct<{
2808
+ readonly ackTimeoutMs: Schema.Int;
2809
+ readonly heartbeatIntervalMs: Schema.Int;
2810
+ readonly maxFrameBytes: Schema.Int;
2811
+ readonly maxFrameEvents: Schema.Int;
2812
+ readonly maxInFlightFrames: Schema.Int;
2813
+ readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
2814
+ readonly subscriberBufferCapacityEvents: Schema.Int;
2815
+ }>;
2816
+ readonly subscriberId: Schema.brand<Schema.NonEmptyString, "SubscriberId">;
2817
+ readonly resumeSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2818
+ }>, Schema.Struct<{
2819
+ readonly _tag: Schema.Literal<"events">;
2820
+ readonly frameId: Schema.brand<Schema.Int, "FrameId">;
2821
+ readonly events: Schema.NonEmptyArray<Schema.Struct<{
2822
+ readonly position: Schema.Struct<{
2823
+ readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
2824
+ readonly subSeq: Schema.brand<Schema.Int, "SubSequenceNumber">;
2825
+ }>;
2826
+ readonly event: Schema.Struct<{
2827
+ readonly namespace: Schema.NonEmptyString;
2828
+ readonly type: Schema.NonEmptyString;
2829
+ readonly schemaVersion: Schema.Int;
2830
+ readonly durability: Schema.Literals<readonly ["durable", "ephemeral"]>;
2831
+ readonly eventId: Schema.brand<Schema.String, "EventId">;
2832
+ readonly sessionId: Schema.brand<Schema.String, "SessionId">;
2833
+ readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
2834
+ readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
2835
+ readonly trace: Schema.withConstructorDefault<Schema.Struct<{
2836
+ readonly span: Schema.Struct<{
2837
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2838
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2839
+ readonly sampled: Schema.Boolean;
2840
+ readonly tracestate: Schema.NullOr<Schema.String>;
2841
+ }>;
2842
+ readonly links: Schema.$Array<Schema.Struct<{
2843
+ readonly context: Schema.Struct<{
2844
+ readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
2845
+ readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
2846
+ readonly sampled: Schema.Boolean;
2847
+ readonly tracestate: Schema.NullOr<Schema.String>;
2848
+ }>;
2849
+ readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
2850
+ }>>;
2851
+ }>>;
2852
+ readonly payload: Schema.Unknown;
2853
+ }>;
2854
+ }>>;
2855
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2856
+ }>, Schema.Struct<{
2857
+ readonly _tag: Schema.Literal<"heartbeat">;
2858
+ readonly serverTimeMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
2859
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2860
+ }>, Schema.Struct<{
2861
+ readonly _tag: Schema.Literal<"pong">;
2862
+ }>, Schema.Struct<{
2863
+ readonly _tag: Schema.Literal<"lagged">;
2864
+ readonly reason: Schema.Literals<readonly ["buffer-overflow", "ack-timeout"]>;
2865
+ readonly resumeSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2866
+ }>, Schema.Struct<{
2867
+ readonly _tag: Schema.Literal<"error">;
2868
+ readonly message: Schema.String;
2869
+ }>]>;
2870
+ type EDAWebSocketServerFrame = typeof EDAWebSocketServerFrame.Type;
2871
+ /** Client acknowledgement after applying a server frame. */
2872
+ declare const EDAWebSocketAckFrame: Schema.Struct<{
2873
+ readonly _tag: Schema.Literal<"ack">;
2874
+ readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
2875
+ readonly frameId: Schema.brand<Schema.Int, "FrameId">;
2876
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2877
+ }>;
2878
+ type EDAWebSocketAckFrame = typeof EDAWebSocketAckFrame.Type;
2879
+ /** Client-to-server application frame union. */
2880
+ declare const EDAWebSocketClientFrame: Schema.Union<readonly [Schema.Struct<{
2881
+ readonly _tag: Schema.Literal<"ack">;
2882
+ readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
2883
+ readonly frameId: Schema.brand<Schema.Int, "FrameId">;
2884
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2885
+ }>, Schema.Struct<{
2886
+ readonly _tag: Schema.Literal<"ping">;
2887
+ }>]>;
2888
+ type EDAWebSocketClientFrame = typeof EDAWebSocketClientFrame.Type;
2889
+ /** Serialize a server frame for a text WebSocket message. */
2890
+ declare const encodeEDAWebSocketServerFrame: (frame: EDAWebSocketServerFrame, protocol?: EDAWebSocketServerFrameEncoder) => string;
2891
+ /** Decode an inbound text WebSocket message at the host boundary. */
2892
+ declare const decodeEDAWebSocketClientMessage: (input: string) => Effect.Effect<EDAWebSocketClientFrame, unknown>;
2893
+ /** Short close reason that fits the WebSocket protocol reason limit. */
2894
+ declare const laggedCloseReason: (seq: SequenceNumber) => string;
2895
+ //#endregion
2896
+ //#region src/websocket/delivery.d.ts
2897
+ /** Slow subscriber reasons that intentionally close only the lagging socket. */
2898
+ declare const SubscriberLagReason: Schema.Literals<readonly ["buffer-overflow", "ack-timeout"]>;
2899
+ type SubscriberLagReason = typeof SubscriberLagReason.Type;
2900
+ /** One sent-but-unacknowledged events frame. */
2901
+ declare const EDAWebSocketInFlightFrame: Schema.Struct<{
2902
+ readonly frameId: Schema.brand<Schema.Int, "FrameId">;
2903
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2904
+ readonly sentAtMs: Schema.Number;
2905
+ }>;
2906
+ type EDAWebSocketInFlightFrame = typeof EDAWebSocketInFlightFrame.Type;
2907
+ /** Compact consecutive host-suppressed receipts blocked by a visible ACK. */
2908
+ declare const EDAWebSocketSuppressedRange: Schema.Struct<{
2909
+ readonly fromFrameId: Schema.brand<Schema.Int, "FrameId">;
2910
+ readonly throughFrameId: Schema.brand<Schema.Int, "FrameId">;
2911
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2912
+ }>;
2913
+ type EDAWebSocketSuppressedRange = typeof EDAWebSocketSuppressedRange.Type;
2914
+ /** Complete delivery bookkeeping persisted in the WebSocket attachment. */
2915
+ declare const EDAWebSocketDeliveryCheckpoint: Schema.Struct<{
2916
+ readonly lastAckedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2917
+ readonly lastAckedFrameId: Schema.Int;
2918
+ readonly lastSentFrameId: Schema.Int;
2919
+ readonly nextFrameId: Schema.Int;
2920
+ readonly sentDurableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2921
+ readonly inFlight: Schema.$Array<Schema.Struct<{
2922
+ readonly frameId: Schema.brand<Schema.Int, "FrameId">;
2923
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2924
+ readonly sentAtMs: Schema.Number;
2925
+ }>>;
2926
+ /** Host-projected receipts waiting behind an earlier client-visible ACK. */
2927
+ readonly suppressed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2928
+ readonly fromFrameId: Schema.brand<Schema.Int, "FrameId">;
2929
+ readonly throughFrameId: Schema.brand<Schema.Int, "FrameId">;
2930
+ readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
2931
+ }>>>;
2932
+ }>;
2933
+ type EDAWebSocketDeliveryCheckpoint = typeof EDAWebSocketDeliveryCheckpoint.Type;
2934
+ /** In-memory delivery state for one accepted event WebSocket. */
2935
+ interface EDAWebSocketDeliveryState extends EDAWebSocketDeliveryCheckpoint {
2936
+ readonly subscriberId: SubscriberId;
2937
+ readonly policy: EDAWebSocketFlowControl;
2938
+ /** Ephemeral events are live-only and intentionally absent from the attachment. */
2939
+ readonly pendingEphemeral: ReadonlyArray<PositionedEvent>;
2940
+ readonly suppressed: ReadonlyArray<EDAWebSocketSuppressedRange>;
2941
+ }
2942
+ /** Explicit instructions emitted by the pure delivery state machine. */
2943
+ type EDAWebSocketDeliveryAction = {
2944
+ readonly _tag: "Persist";
2945
+ } | {
2946
+ readonly _tag: "Send";
2947
+ readonly frames: ReadonlyArray<EDAWebSocketServerFrame>;
2948
+ } | {
2949
+ readonly _tag: "ReadEventPage";
2950
+ readonly afterSeq: SequenceNumber;
2951
+ } | {
2952
+ readonly _tag: "Close";
2953
+ readonly code: number;
2954
+ readonly reason: string;
2955
+ };
2956
+ /** Result of one pure delivery transition. */
2957
+ interface EDAWebSocketDeliveryResult {
2958
+ readonly state: EDAWebSocketDeliveryState;
2959
+ readonly actions: ReadonlyArray<EDAWebSocketDeliveryAction>;
2960
+ }
2961
+ interface MakeDeliveryStateInput {
2962
+ readonly subscriberId: SubscriberId;
2963
+ readonly resumeSeq: SequenceNumber;
2964
+ readonly policy: EDAWebSocketFlowControl;
2965
+ }
2966
+ /** Build delivery state for a newly accepted connection. */
2967
+ declare const makeWebSocketDeliveryState: (input: MakeDeliveryStateInput) => EDAWebSocketDeliveryState;
2968
+ /** Rebuild exact ACK bookkeeping from a hibernating WebSocket attachment. */
2969
+ declare const restoreWebSocketDeliveryState: (input: {
2970
+ readonly subscriberId: SubscriberId;
2971
+ readonly policy: EDAWebSocketFlowControl;
2972
+ readonly checkpoint: EDAWebSocketDeliveryCheckpoint;
2973
+ }) => EDAWebSocketDeliveryState;
2974
+ /** Project in-memory delivery state into the attachment-safe checkpoint. */
2975
+ declare const checkpointWebSocketDeliveryState: (state: EDAWebSocketDeliveryState) => EDAWebSocketDeliveryCheckpoint;
2976
+ /** First frame for a freshly accepted connection. Restores never re-send hello. */
2977
+ declare const deliveryHelloFrame: (state: EDAWebSocketDeliveryState) => EDAWebSocketHelloFrame;
2978
+ /** Deliver committed durable events read from the store. */
2979
+ declare const onDurableEvents: (state: EDAWebSocketDeliveryState, events: ReadonlyArray<PositionedEvent>, head: SequenceNumber, nowMs: number) => EDAWebSocketDeliveryResult;
2980
+ /** Deliver one live ephemeral event, buffering only while this isolate is active. */
2981
+ declare const onEphemeralEvent: (state: EDAWebSocketDeliveryState, event: PositionedEvent, nowMs: number) => EDAWebSocketDeliveryResult;
2982
+ /** Apply one client ACK, reopen the window, and drain buffered ephemeral events. */
2983
+ declare const onClientAck: (state: EDAWebSocketDeliveryState, ack: EDAWebSocketAckFrame, nowMs: number) => EDAWebSocketDeliveryResult;
2984
+ /**
2985
+ * Apply one exact host-suppressed receipt without cumulatively ACKing any
2986
+ * earlier client-visible frame.
2987
+ */
2988
+ declare const onHostSuppressedFrame: (state: EDAWebSocketDeliveryState, frame: Pick<EDAWebSocketEventsFrame, "durableThroughSeq" | "frameId">, nowMs: number) => EDAWebSocketDeliveryResult;
2989
+ //#endregion
2990
+ export { EDAWebSocketWireProtocol as $, EDA_WS_CLOSE_LAGGED as A, EDAFrameworkWebSocketEvent as B, EDAWebSocketHelloFrame as C, EDAWebSocketServerFrame as D, EDAWebSocketPongFrame as E, SubscriberId as F, EDAWebSocketWireClientFrame as G, EDAWebSocketServerFrameEncoder as H, decodeEDAWebSocketClientMessage as I, EDAWebSocketWireHeartbeatFrame as J, EDAWebSocketWireErrorFrame as K, defaultEDAWebSocketFlowControl as L, EDA_WS_CLOSE_SEND_FAILED as M, EDA_WS_CLOSE_UNSUPPORTED_DATA as N, EDA_WEB_SOCKET_PROTOCOL_VERSION as O, FrameId as P, EDAWebSocketWirePongFrame as Q, encodeEDAWebSocketServerFrame as R, EDAWebSocketHeartbeatFrame as S, EDAWebSocketPingFrame as T, EDAWebSocketServerFrameInput as U, EDAWebSocketEventConsumerPolicy as V, EDAWebSocketWireAckFrame as W, EDAWebSocketWireLaggedFrame as X, EDAWebSocketWireHelloFrame as Y, EDAWebSocketWirePingFrame as Z, EDAWebSocketAckFrame as _, EDAWebSocketInFlightFrame as a, EDAWebSocketEventsFrame as b, SubscriberLagReason as c, makeWebSocketDeliveryState as d, EDA_WEB_SOCKET_PING_MESSAGE as et, onClientAck as f, restoreWebSocketDeliveryState as g, onHostSuppressedFrame as h, EDAWebSocketDeliveryState as i, makeEDAWebSocketWireProtocol as it, EDA_WS_CLOSE_PROTOCOL_ERROR as j, EDA_WS_CLOSE_GOING_AWAY as k, checkpointWebSocketDeliveryState as l, onEphemeralEvent as m, EDAWebSocketDeliveryCheckpoint as n, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION as nt, EDAWebSocketSuppressedRange as o, onDurableEvents as p, EDAWebSocketWireFlowControl as q, EDAWebSocketDeliveryResult as r, edaFrameworkWebSocketWireProtocol as rt, MakeDeliveryStateInput as s, EDAWebSocketDeliveryAction as t, EDA_WEB_SOCKET_PONG_MESSAGE as tt, deliveryHelloFrame as u, EDAWebSocketClientFrame as v, EDAWebSocketLaggedFrame as w, EDAWebSocketFlowControl as x, EDAWebSocketErrorFrame as y, laggedCloseReason as z };
2991
+ //# sourceMappingURL=delivery-RjM1_NAE.d.ts.map