@effect-uai/core 0.17.0 → 0.19.0-dev-20261109183959

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 (218) hide show
  1. package/README.md +5 -5
  2. package/dist/Content-D_Qfn8Ja.d.mts +48 -0
  3. package/dist/Content-D_Qfn8Ja.d.mts.map +1 -0
  4. package/dist/File-B923KvZ9.d.mts +46 -0
  5. package/dist/File-B923KvZ9.d.mts.map +1 -0
  6. package/dist/{Image-Cv6iBLTy.d.mts → Image-Bzc1H_UK.d.mts} +19 -8
  7. package/dist/Image-Bzc1H_UK.d.mts.map +1 -0
  8. package/dist/{Items-C7MyrYPX.d.mts → Items-Bvx8s9QH.d.mts} +109 -16
  9. package/dist/Items-Bvx8s9QH.d.mts.map +1 -0
  10. package/dist/{Loop-ChpaO-ya.d.mts → Loop-CeA0AelN.d.mts} +7 -6
  11. package/dist/Loop-CeA0AelN.d.mts.map +1 -0
  12. package/dist/Tool-Bkryw6-h.d.mts +206 -0
  13. package/dist/Tool-Bkryw6-h.d.mts.map +1 -0
  14. package/dist/ToolEvent-9inLx5cI.d.mts +22 -0
  15. package/dist/ToolEvent-9inLx5cI.d.mts.map +1 -0
  16. package/dist/ToolOutput-BNTIQgGB.d.mts +151 -0
  17. package/dist/ToolOutput-BNTIQgGB.d.mts.map +1 -0
  18. package/dist/Toolkit-D2VGeD5R.d.mts +212 -0
  19. package/dist/Toolkit-D2VGeD5R.d.mts.map +1 -0
  20. package/dist/browser/BrowserTool.d.mts +84 -22
  21. package/dist/browser/BrowserTool.d.mts.map +1 -1
  22. package/dist/browser/BrowserTool.mjs +5 -0
  23. package/dist/browser/BrowserTool.mjs.map +1 -1
  24. package/dist/capabilities/Capabilities.d.mts +1 -1
  25. package/dist/decision-model/Decision.test.mjs +4 -4
  26. package/dist/dist-B5K-y4Be.mjs +191 -0
  27. package/dist/dist-B5K-y4Be.mjs.map +1 -0
  28. package/dist/dist-CorQTQL-.mjs +1533 -0
  29. package/dist/dist-CorQTQL-.mjs.map +1 -0
  30. package/dist/dist-DNeuh84d.mjs +7 -0
  31. package/dist/dist-DNeuh84d.mjs.map +1 -0
  32. package/dist/dist-DzeSyeYF.mjs +10253 -0
  33. package/dist/dist-DzeSyeYF.mjs.map +1 -0
  34. package/dist/domain/File.d.mts +2 -0
  35. package/dist/domain/File.mjs +51 -0
  36. package/dist/domain/File.mjs.map +1 -0
  37. package/dist/domain/Image.d.mts +2 -2
  38. package/dist/domain/Image.mjs +12 -2
  39. package/dist/domain/Image.mjs.map +1 -1
  40. package/dist/domain/Items.d.mts +2 -2
  41. package/dist/domain/Items.mjs +65 -4
  42. package/dist/domain/Items.mjs.map +1 -1
  43. package/dist/domain/Realtime.d.mts +72 -490
  44. package/dist/domain/Realtime.d.mts.map +1 -1
  45. package/dist/domain/Research.d.mts +1 -1
  46. package/dist/domain/Transcript.test.mjs +3 -3
  47. package/dist/domain/Turn.d.mts +57 -262
  48. package/dist/domain/Turn.d.mts.map +1 -1
  49. package/dist/domain/Turn.mjs +1 -1
  50. package/dist/domain/Turn.test.mjs +2 -2
  51. package/dist/embedding-model/Embedding.d.mts +1 -1
  52. package/dist/embedding-model/EmbeddingModel.test.mjs +2 -2
  53. package/dist/embedding-model/EmbeddingModel.test.mjs.map +1 -1
  54. package/dist/image-generator/ImageGenerator.d.mts +10 -66
  55. package/dist/image-generator/ImageGenerator.d.mts.map +1 -1
  56. package/dist/index.C4tKZ0yW-LuFnBtmu.mjs +7042 -0
  57. package/dist/index.C4tKZ0yW-LuFnBtmu.mjs.map +1 -0
  58. package/dist/index.d.mts +10 -9
  59. package/dist/index.mjs +7 -6
  60. package/dist/language-model/LanguageModel.d.mts +2 -2
  61. package/dist/language-model/LanguageModel.test.mjs +2 -2
  62. package/dist/loop/Loop.d.mts +1 -1
  63. package/dist/loop/Loop.mjs.map +1 -1
  64. package/dist/loop/Loop.test.mjs +3 -3
  65. package/dist/math/Probability.test.mjs +2 -2
  66. package/dist/messenger/Messenger.d.mts +43 -289
  67. package/dist/messenger/Messenger.d.mts.map +1 -1
  68. package/dist/messenger/MessengerAdapter.test.mjs +3 -3
  69. package/dist/music-generator/MusicGenerator.test.mjs +3 -3
  70. package/dist/observability/Metrics.d.mts +1 -1
  71. package/dist/observability/Metrics.test.mjs +3 -3
  72. package/dist/observability/Telemetry.d.mts +1 -1
  73. package/dist/observability/Telemetry.mjs +1 -1
  74. package/dist/observability/Telemetry.mjs.map +1 -1
  75. package/dist/observability/Telemetry.test.mjs +4 -4
  76. package/dist/observability/Telemetry.test.mjs.map +1 -1
  77. package/dist/realtime/RealtimeSession.d.mts +1 -1
  78. package/dist/realtime/RealtimeSession.test.mjs +4 -4
  79. package/dist/retry/Retry.test.mjs +2 -2
  80. package/dist/sandbox/Sandbox.d.mts +32 -237
  81. package/dist/sandbox/Sandbox.d.mts.map +1 -1
  82. package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs +3 -3
  83. package/dist/streaming/JSONL.test.mjs +2 -2
  84. package/dist/streaming/Multipart.d.mts +1 -1
  85. package/dist/streaming/Multipart.mjs +3 -2
  86. package/dist/streaming/Multipart.mjs.map +1 -1
  87. package/dist/streaming/Multipart.test.mjs +28 -0
  88. package/dist/streaming/Multipart.test.mjs.map +1 -0
  89. package/dist/streaming/SSE.d.mts +1 -1
  90. package/dist/streaming/SSE.mjs +2 -2
  91. package/dist/streaming/SSE.mjs.map +1 -1
  92. package/dist/streaming/SSE.test.mjs +2 -2
  93. package/dist/streaming/Settle.test.mjs +3 -3
  94. package/dist/streaming/WebSocketSession.d.mts +5 -3
  95. package/dist/streaming/WebSocketSession.d.mts.map +1 -1
  96. package/dist/streaming/WebSocketSession.mjs +22 -10
  97. package/dist/streaming/WebSocketSession.mjs.map +1 -1
  98. package/dist/streaming/WebSocketSession.test.mjs +41 -5
  99. package/dist/streaming/WebSocketSession.test.mjs.map +1 -1
  100. package/dist/structured-format/StructuredFormat.mjs.map +1 -1
  101. package/dist/structured-format/StructuredFormat.test.mjs +2 -2
  102. package/dist/testing/FakeWebSocket.d.mts +5 -1
  103. package/dist/testing/FakeWebSocket.d.mts.map +1 -1
  104. package/dist/testing/FakeWebSocket.mjs +12 -6
  105. package/dist/testing/FakeWebSocket.mjs.map +1 -1
  106. package/dist/testing/MockMessenger.d.mts +19 -134
  107. package/dist/testing/MockMessenger.d.mts.map +1 -1
  108. package/dist/testing/MockProvider.d.mts +1 -1
  109. package/dist/testing/MockSandbox.d.mts +65 -446
  110. package/dist/testing/MockSandbox.d.mts.map +1 -1
  111. package/dist/tool/Content.d.mts +2 -0
  112. package/dist/tool/Content.mjs +46 -0
  113. package/dist/tool/Content.mjs.map +1 -0
  114. package/dist/tool/Content.test.d.mts +1 -0
  115. package/dist/tool/Content.test.mjs +48 -0
  116. package/dist/tool/Content.test.mjs.map +1 -0
  117. package/dist/tool/HistoryCheck.d.mts +6 -15
  118. package/dist/tool/HistoryCheck.d.mts.map +1 -1
  119. package/dist/tool/HistoryCheck.mjs +10 -24
  120. package/dist/tool/HistoryCheck.mjs.map +1 -1
  121. package/dist/tool/Tool.d.mts +2 -2
  122. package/dist/tool/Tool.mjs +55 -130
  123. package/dist/tool/Tool.mjs.map +1 -1
  124. package/dist/tool/Tool.test.mjs +222 -178
  125. package/dist/tool/Tool.test.mjs.map +1 -1
  126. package/dist/tool/ToolDecision.d.mts +164 -0
  127. package/dist/tool/ToolDecision.d.mts.map +1 -0
  128. package/dist/tool/ToolDecision.mjs +146 -0
  129. package/dist/tool/ToolDecision.mjs.map +1 -0
  130. package/dist/tool/ToolDecision.test.d.mts +1 -0
  131. package/dist/tool/ToolDecision.test.mjs +330 -0
  132. package/dist/tool/ToolDecision.test.mjs.map +1 -0
  133. package/dist/tool/ToolEvent.d.mts +2 -2
  134. package/dist/tool/ToolEvent.mjs +2 -34
  135. package/dist/tool/ToolEvent.mjs.map +1 -1
  136. package/dist/tool/ToolOutput.d.mts +2 -0
  137. package/dist/tool/ToolOutput.mjs +128 -0
  138. package/dist/tool/ToolOutput.mjs.map +1 -0
  139. package/dist/tool/ToolOutput.test.d.mts +1 -0
  140. package/dist/tool/ToolOutput.test.mjs +153 -0
  141. package/dist/tool/ToolOutput.test.mjs.map +1 -0
  142. package/dist/tool/Toolkit.d.mts +2 -2
  143. package/dist/tool/Toolkit.mjs +230 -165
  144. package/dist/tool/Toolkit.mjs.map +1 -1
  145. package/dist/tool/Toolkit.test.mjs +433 -391
  146. package/dist/tool/Toolkit.test.mjs.map +1 -1
  147. package/dist/transcriber/Transcriber.test.mjs +3 -3
  148. package/dist/web-read/WebReadTool.d.mts +2 -2
  149. package/dist/web-read/WebReadTool.mjs +1 -0
  150. package/dist/web-read/WebReadTool.mjs.map +1 -1
  151. package/dist/web-search/WebSearchTool.d.mts +2 -2
  152. package/dist/web-search/WebSearchTool.mjs +1 -0
  153. package/dist/web-search/WebSearchTool.mjs.map +1 -1
  154. package/package.json +18 -10
  155. package/src/browser/BrowserTool.ts +5 -0
  156. package/src/domain/File.ts +79 -0
  157. package/src/domain/Image.ts +14 -4
  158. package/src/domain/Items.ts +39 -3
  159. package/src/embedding-model/EmbeddingModel.test.ts +2 -2
  160. package/src/index.ts +3 -2
  161. package/src/loop/Loop.ts +25 -14
  162. package/src/observability/Telemetry.test.ts +1 -1
  163. package/src/observability/Telemetry.ts +2 -2
  164. package/src/streaming/Multipart.test.ts +26 -0
  165. package/src/streaming/Multipart.ts +6 -5
  166. package/src/streaming/SSE.ts +2 -2
  167. package/src/streaming/WebSocketSession.test.ts +54 -2
  168. package/src/streaming/WebSocketSession.ts +27 -6
  169. package/src/structured-format/StructuredFormat.ts +1 -1
  170. package/src/testing/FakeWebSocket.ts +21 -6
  171. package/src/tool/Content.test.ts +40 -0
  172. package/src/tool/Content.ts +38 -0
  173. package/src/tool/HistoryCheck.ts +21 -26
  174. package/src/tool/Tool.test.ts +240 -241
  175. package/src/tool/Tool.ts +204 -309
  176. package/src/tool/ToolDecision.test.ts +301 -0
  177. package/src/tool/ToolDecision.ts +360 -0
  178. package/src/tool/ToolEvent.ts +21 -41
  179. package/src/tool/ToolOutput.test.ts +132 -0
  180. package/src/tool/ToolOutput.ts +198 -0
  181. package/src/tool/Toolkit.test.ts +594 -454
  182. package/src/tool/Toolkit.ts +631 -356
  183. package/src/web-read/WebReadTool.ts +2 -1
  184. package/src/web-search/WebSearchTool.ts +2 -1
  185. package/dist/Image-Cv6iBLTy.d.mts.map +0 -1
  186. package/dist/Items-C7MyrYPX.d.mts.map +0 -1
  187. package/dist/Loop-ChpaO-ya.d.mts.map +0 -1
  188. package/dist/Tool-BF78QWtn.d.mts +0 -314
  189. package/dist/Tool-BF78QWtn.d.mts.map +0 -1
  190. package/dist/ToolEvent-Di4a723B.d.mts +0 -144
  191. package/dist/ToolEvent-Di4a723B.d.mts.map +0 -1
  192. package/dist/ToolResult-BsYQRjmW.d.mts +0 -152
  193. package/dist/ToolResult-BsYQRjmW.d.mts.map +0 -1
  194. package/dist/Toolkit-tlL0F2YR.d.mts +0 -193
  195. package/dist/Toolkit-tlL0F2YR.d.mts.map +0 -1
  196. package/dist/dist-BaenoU1A.mjs +0 -145
  197. package/dist/dist-BaenoU1A.mjs.map +0 -1
  198. package/dist/dist-nohcnkD6.mjs +0 -182
  199. package/dist/dist-nohcnkD6.mjs.map +0 -1
  200. package/dist/magic-string.es-CB2hOw9v.mjs +0 -1014
  201. package/dist/magic-string.es-CB2hOw9v.mjs.map +0 -1
  202. package/dist/test.DNmyFkvJ-YPzDR0Co.mjs +0 -10254
  203. package/dist/test.DNmyFkvJ-YPzDR0Co.mjs.map +0 -1
  204. package/dist/tool/Approval.d.mts +0 -113
  205. package/dist/tool/Approval.d.mts.map +0 -1
  206. package/dist/tool/Approval.mjs +0 -80
  207. package/dist/tool/Approval.mjs.map +0 -1
  208. package/dist/tool/Approval.test.mjs +0 -371
  209. package/dist/tool/Approval.test.mjs.map +0 -1
  210. package/dist/tool/ToolResult.d.mts +0 -2
  211. package/dist/tool/ToolResult.mjs +0 -85
  212. package/dist/tool/ToolResult.mjs.map +0 -1
  213. package/dist/utils-CiH_DjFW.mjs +0 -3918
  214. package/dist/utils-CiH_DjFW.mjs.map +0 -1
  215. package/src/tool/Approval.test.ts +0 -400
  216. package/src/tool/Approval.ts +0 -181
  217. package/src/tool/ToolResult.ts +0 -114
  218. /package/dist/{tool/Approval.test.d.mts → streaming/Multipart.test.d.mts} +0 -0
@@ -1,6 +1,6 @@
1
- import { o as ImageSource } from "../Image-Cv6iBLTy.mjs";
2
- import { S as Usage, b as ToolCallOutput, o as HistoryItem, y as ToolCall } from "../Items-C7MyrYPX.mjs";
3
- import { u as ToolDescriptor } from "../Tool-BF78QWtn.mjs";
1
+ import { o as ImageSource } from "../Image-Bzc1H_UK.mjs";
2
+ import { S as ToolCallOutput, T as Usage, o as HistoryItem, x as ToolCall } from "../Items-Bvx8s9QH.mjs";
3
+ import { f as ToolDescriptor } from "../Tool-Bkryw6-h.mjs";
4
4
  import { r as AudioFormat } from "../Audio-_nGR4V0X.mjs";
5
5
  import { Data, Duration } from "effect";
6
6
  declare namespace Realtime_d_exports {
@@ -43,179 +43,30 @@ type RealtimeInput = Data.TaggedEnum<{
43
43
  readonly playedMs: number;
44
44
  };
45
45
  }>;
46
- declare const RealtimeInput: {
47
- readonly $is: <Tag extends "ActivityEnd" | "ActivityStart" | "Audio" | "Interrupt" | "PlaybackPosition" | "Text" | "ToolResult" | "VideoFrame">(tag: Tag) => (u: unknown) => u is Extract<{
48
- readonly _tag: "ActivityEnd";
49
- }, {
50
- readonly _tag: Tag;
51
- }> | Extract<{
52
- readonly _tag: "ActivityStart";
53
- }, {
54
- readonly _tag: Tag;
55
- }> | Extract<{
56
- readonly _tag: "Audio";
57
- readonly bytes: Uint8Array;
58
- }, {
59
- readonly _tag: Tag;
60
- }> | Extract<{
61
- readonly _tag: "Interrupt";
62
- }, {
63
- readonly _tag: Tag;
64
- }> | Extract<{
65
- readonly _tag: "PlaybackPosition";
66
- readonly responseId: string;
67
- readonly playedMs: number;
68
- }, {
69
- readonly _tag: Tag;
70
- }> | Extract<{
71
- readonly _tag: "Text";
72
- readonly text: string;
73
- readonly role?: "user" | "system";
74
- }, {
75
- readonly _tag: Tag;
76
- }> | Extract<{
77
- readonly _tag: "ToolResult";
78
- readonly output: ToolCallOutput;
79
- }, {
80
- readonly _tag: Tag;
81
- }> | Extract<{
82
- readonly _tag: "VideoFrame";
83
- readonly frame: ImageSource;
84
- }, {
85
- readonly _tag: Tag;
86
- }>;
87
- readonly $match: {
88
- <Cases extends { readonly [Tag in "ActivityEnd" | "ActivityStart" | "Audio" | "Interrupt" | "PlaybackPosition" | "Text" | "ToolResult" | "VideoFrame"]: (args: Extract<{
89
- readonly _tag: "ActivityEnd";
90
- } | {
91
- readonly _tag: "ActivityStart";
92
- } | {
93
- readonly _tag: "Audio";
94
- readonly bytes: Uint8Array;
95
- } | {
96
- readonly _tag: "Interrupt";
97
- } | {
98
- readonly _tag: "PlaybackPosition";
99
- readonly responseId: string;
100
- readonly playedMs: number;
101
- } | {
102
- readonly _tag: "Text";
103
- readonly text: string;
104
- readonly role?: "user" | "system";
105
- } | {
106
- readonly _tag: "ToolResult";
107
- readonly output: ToolCallOutput;
108
- } | {
109
- readonly _tag: "VideoFrame";
110
- readonly frame: ImageSource;
111
- }, {
112
- readonly _tag: Tag;
113
- }>) => any; }>(cases: Cases): (value: {
114
- readonly _tag: "ActivityEnd";
115
- } | {
116
- readonly _tag: "ActivityStart";
117
- } | {
118
- readonly _tag: "Audio";
119
- readonly bytes: Uint8Array;
120
- } | {
121
- readonly _tag: "Interrupt";
122
- } | {
123
- readonly _tag: "PlaybackPosition";
124
- readonly responseId: string;
125
- readonly playedMs: number;
126
- } | {
127
- readonly _tag: "Text";
128
- readonly text: string;
129
- readonly role?: "user" | "system";
130
- } | {
131
- readonly _tag: "ToolResult";
132
- readonly output: ToolCallOutput;
133
- } | {
134
- readonly _tag: "VideoFrame";
135
- readonly frame: ImageSource;
136
- }) => import("effect/Unify").Unify<ReturnType<Cases["ActivityEnd" | "ActivityStart" | "Audio" | "Interrupt" | "PlaybackPosition" | "Text" | "ToolResult" | "VideoFrame"]>>;
137
- <Cases extends { readonly [Tag in "ActivityEnd" | "ActivityStart" | "Audio" | "Interrupt" | "PlaybackPosition" | "Text" | "ToolResult" | "VideoFrame"]: (args: Extract<{
138
- readonly _tag: "ActivityEnd";
139
- } | {
140
- readonly _tag: "ActivityStart";
141
- } | {
142
- readonly _tag: "Audio";
143
- readonly bytes: Uint8Array;
144
- } | {
145
- readonly _tag: "Interrupt";
146
- } | {
147
- readonly _tag: "PlaybackPosition";
148
- readonly responseId: string;
149
- readonly playedMs: number;
150
- } | {
151
- readonly _tag: "Text";
152
- readonly text: string;
153
- readonly role?: "user" | "system";
154
- } | {
155
- readonly _tag: "ToolResult";
156
- readonly output: ToolCallOutput;
157
- } | {
158
- readonly _tag: "VideoFrame";
159
- readonly frame: ImageSource;
160
- }, {
161
- readonly _tag: Tag;
162
- }>) => any; }>(value: {
163
- readonly _tag: "ActivityEnd";
164
- } | {
165
- readonly _tag: "ActivityStart";
166
- } | {
167
- readonly _tag: "Audio";
168
- readonly bytes: Uint8Array;
169
- } | {
170
- readonly _tag: "Interrupt";
171
- } | {
172
- readonly _tag: "PlaybackPosition";
173
- readonly responseId: string;
174
- readonly playedMs: number;
175
- } | {
176
- readonly _tag: "Text";
177
- readonly text: string;
178
- readonly role?: "user" | "system";
179
- } | {
180
- readonly _tag: "ToolResult";
181
- readonly output: ToolCallOutput;
182
- } | {
183
- readonly _tag: "VideoFrame";
184
- readonly frame: ImageSource;
185
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["ActivityEnd" | "ActivityStart" | "Audio" | "Interrupt" | "PlaybackPosition" | "Text" | "ToolResult" | "VideoFrame"]>>;
186
- };
187
- readonly ActivityEnd: Data.TaggedEnum.ConstructorFrom<{
188
- readonly _tag: "ActivityEnd";
189
- }, "_tag">;
190
- readonly ActivityStart: Data.TaggedEnum.ConstructorFrom<{
191
- readonly _tag: "ActivityStart";
192
- }, "_tag">;
193
- readonly Audio: Data.TaggedEnum.ConstructorFrom<{
194
- readonly _tag: "Audio";
195
- readonly bytes: Uint8Array;
196
- }, "_tag">;
197
- readonly Interrupt: Data.TaggedEnum.ConstructorFrom<{
198
- readonly _tag: "Interrupt";
199
- }, "_tag">;
200
- readonly PlaybackPosition: Data.TaggedEnum.ConstructorFrom<{
201
- readonly _tag: "PlaybackPosition";
202
- readonly responseId: string;
203
- readonly playedMs: number;
204
- }, "_tag">;
205
- readonly Text: Data.TaggedEnum.ConstructorFrom<{
206
- readonly _tag: "Text";
207
- readonly text: string;
208
- readonly role?: "user" | "system";
209
- }, "_tag">;
210
- readonly ToolResult: Data.TaggedEnum.ConstructorFrom<{
211
- readonly _tag: "ToolResult";
212
- readonly output: ToolCallOutput;
213
- }, "_tag">;
214
- readonly VideoFrame: Data.TaggedEnum.ConstructorFrom<{
215
- readonly _tag: "VideoFrame";
216
- readonly frame: ImageSource;
217
- }, "_tag">;
218
- };
46
+ declare const RealtimeInput: Data.TaggedEnum.Constructor<{
47
+ readonly _tag: "ActivityEnd";
48
+ } | {
49
+ readonly _tag: "ActivityStart";
50
+ } | {
51
+ readonly _tag: "Audio";
52
+ readonly bytes: Uint8Array;
53
+ } | {
54
+ readonly _tag: "Interrupt";
55
+ } | {
56
+ readonly _tag: "PlaybackPosition";
57
+ readonly responseId: string;
58
+ readonly playedMs: number;
59
+ } | {
60
+ readonly _tag: "Text";
61
+ readonly text: string;
62
+ readonly role?: "user" | "system";
63
+ } | {
64
+ readonly _tag: "ToolResult";
65
+ readonly output: ToolCallOutput;
66
+ } | {
67
+ readonly _tag: "VideoFrame";
68
+ readonly frame: ImageSource;
69
+ }>;
219
70
  /**
220
71
  * What the session emits. Every `AudioDelta` and `OutputTranscriptDelta` is
221
72
  * bracketed by `ResponseStarted` and `ResponseDone` carrying the same
@@ -276,320 +127,51 @@ type RealtimeEvent = Data.TaggedEnum<{
276
127
  readonly message: string;
277
128
  };
278
129
  }>;
279
- declare const RealtimeEvent: {
280
- readonly $is: <Tag extends "AudioDelta" | "Error" | "InputTranscript" | "Interrupted" | "OutputTranscriptDelta" | "ResponseDone" | "ResponseStarted" | "ResumptionHandle" | "SessionEnding" | "SpeechStarted" | "SpeechStopped" | "ToolCall" | "ToolCallCancelled">(tag: Tag) => (u: unknown) => u is Extract<{
281
- readonly _tag: "AudioDelta";
282
- readonly responseId: string;
283
- readonly bytes: Uint8Array;
284
- }, {
285
- readonly _tag: Tag;
286
- }> | Extract<{
287
- readonly _tag: "Error";
288
- readonly code?: string;
289
- readonly message: string;
290
- }, {
291
- readonly _tag: Tag;
292
- }> | Extract<{
293
- readonly _tag: "InputTranscript";
294
- readonly text: string;
295
- readonly final: boolean;
296
- }, {
297
- readonly _tag: Tag;
298
- }> | Extract<{
299
- readonly _tag: "Interrupted";
300
- readonly responseId: string;
301
- }, {
302
- readonly _tag: Tag;
303
- }> | Extract<{
304
- readonly _tag: "OutputTranscriptDelta";
305
- readonly responseId: string;
306
- readonly text: string;
307
- }, {
308
- readonly _tag: Tag;
309
- }> | Extract<{
310
- readonly _tag: "ResponseDone";
311
- readonly responseId: string;
312
- readonly reason: "complete" | "interrupted" | "cancelled" | "error";
313
- readonly usage?: Usage;
314
- }, {
315
- readonly _tag: Tag;
316
- }> | Extract<{
317
- readonly _tag: "ResponseStarted";
318
- readonly responseId: string;
319
- }, {
320
- readonly _tag: Tag;
321
- }> | Extract<{
322
- readonly _tag: "ResumptionHandle";
323
- readonly handle: string;
324
- }, {
325
- readonly _tag: Tag;
326
- }> | Extract<{
327
- readonly _tag: "SessionEnding";
328
- readonly timeLeft?: Duration.Duration;
329
- }, {
330
- readonly _tag: Tag;
331
- }> | Extract<{
332
- readonly _tag: "SpeechStarted";
333
- }, {
334
- readonly _tag: Tag;
335
- }> | Extract<{
336
- readonly _tag: "SpeechStopped";
337
- }, {
338
- readonly _tag: Tag;
339
- }> | Extract<{
340
- readonly _tag: "ToolCall";
341
- readonly responseId: string;
342
- readonly call: ToolCall;
343
- }, {
344
- readonly _tag: Tag;
345
- }> | Extract<{
346
- readonly _tag: "ToolCallCancelled";
347
- readonly callIds: ReadonlyArray<string>;
348
- }, {
349
- readonly _tag: Tag;
350
- }>;
351
- readonly $match: {
352
- <Cases extends { readonly [Tag in "AudioDelta" | "Error" | "InputTranscript" | "Interrupted" | "OutputTranscriptDelta" | "ResponseDone" | "ResponseStarted" | "ResumptionHandle" | "SessionEnding" | "SpeechStarted" | "SpeechStopped" | "ToolCall" | "ToolCallCancelled"]: (args: Extract<{
353
- readonly _tag: "AudioDelta";
354
- readonly responseId: string;
355
- readonly bytes: Uint8Array;
356
- } | {
357
- readonly _tag: "Error";
358
- readonly code?: string;
359
- readonly message: string;
360
- } | {
361
- readonly _tag: "InputTranscript";
362
- readonly text: string;
363
- readonly final: boolean;
364
- } | {
365
- readonly _tag: "Interrupted";
366
- readonly responseId: string;
367
- } | {
368
- readonly _tag: "OutputTranscriptDelta";
369
- readonly responseId: string;
370
- readonly text: string;
371
- } | {
372
- readonly _tag: "ResponseDone";
373
- readonly responseId: string;
374
- readonly reason: "complete" | "interrupted" | "cancelled" | "error";
375
- readonly usage?: Usage;
376
- } | {
377
- readonly _tag: "ResponseStarted";
378
- readonly responseId: string;
379
- } | {
380
- readonly _tag: "ResumptionHandle";
381
- readonly handle: string;
382
- } | {
383
- readonly _tag: "SessionEnding";
384
- readonly timeLeft?: Duration.Duration;
385
- } | {
386
- readonly _tag: "SpeechStarted";
387
- } | {
388
- readonly _tag: "SpeechStopped";
389
- } | {
390
- readonly _tag: "ToolCall";
391
- readonly responseId: string;
392
- readonly call: ToolCall;
393
- } | {
394
- readonly _tag: "ToolCallCancelled";
395
- readonly callIds: ReadonlyArray<string>;
396
- }, {
397
- readonly _tag: Tag;
398
- }>) => any; }>(cases: Cases): (value: {
399
- readonly _tag: "AudioDelta";
400
- readonly responseId: string;
401
- readonly bytes: Uint8Array;
402
- } | {
403
- readonly _tag: "Error";
404
- readonly code?: string;
405
- readonly message: string;
406
- } | {
407
- readonly _tag: "InputTranscript";
408
- readonly text: string;
409
- readonly final: boolean;
410
- } | {
411
- readonly _tag: "Interrupted";
412
- readonly responseId: string;
413
- } | {
414
- readonly _tag: "OutputTranscriptDelta";
415
- readonly responseId: string;
416
- readonly text: string;
417
- } | {
418
- readonly _tag: "ResponseDone";
419
- readonly responseId: string;
420
- readonly reason: "complete" | "interrupted" | "cancelled" | "error";
421
- readonly usage?: Usage;
422
- } | {
423
- readonly _tag: "ResponseStarted";
424
- readonly responseId: string;
425
- } | {
426
- readonly _tag: "ResumptionHandle";
427
- readonly handle: string;
428
- } | {
429
- readonly _tag: "SessionEnding";
430
- readonly timeLeft?: Duration.Duration;
431
- } | {
432
- readonly _tag: "SpeechStarted";
433
- } | {
434
- readonly _tag: "SpeechStopped";
435
- } | {
436
- readonly _tag: "ToolCall";
437
- readonly responseId: string;
438
- readonly call: ToolCall;
439
- } | {
440
- readonly _tag: "ToolCallCancelled";
441
- readonly callIds: ReadonlyArray<string>;
442
- }) => import("effect/Unify").Unify<ReturnType<Cases["AudioDelta" | "Error" | "InputTranscript" | "Interrupted" | "OutputTranscriptDelta" | "ResponseDone" | "ResponseStarted" | "ResumptionHandle" | "SessionEnding" | "SpeechStarted" | "SpeechStopped" | "ToolCall" | "ToolCallCancelled"]>>;
443
- <Cases extends { readonly [Tag in "AudioDelta" | "Error" | "InputTranscript" | "Interrupted" | "OutputTranscriptDelta" | "ResponseDone" | "ResponseStarted" | "ResumptionHandle" | "SessionEnding" | "SpeechStarted" | "SpeechStopped" | "ToolCall" | "ToolCallCancelled"]: (args: Extract<{
444
- readonly _tag: "AudioDelta";
445
- readonly responseId: string;
446
- readonly bytes: Uint8Array;
447
- } | {
448
- readonly _tag: "Error";
449
- readonly code?: string;
450
- readonly message: string;
451
- } | {
452
- readonly _tag: "InputTranscript";
453
- readonly text: string;
454
- readonly final: boolean;
455
- } | {
456
- readonly _tag: "Interrupted";
457
- readonly responseId: string;
458
- } | {
459
- readonly _tag: "OutputTranscriptDelta";
460
- readonly responseId: string;
461
- readonly text: string;
462
- } | {
463
- readonly _tag: "ResponseDone";
464
- readonly responseId: string;
465
- readonly reason: "complete" | "interrupted" | "cancelled" | "error";
466
- readonly usage?: Usage;
467
- } | {
468
- readonly _tag: "ResponseStarted";
469
- readonly responseId: string;
470
- } | {
471
- readonly _tag: "ResumptionHandle";
472
- readonly handle: string;
473
- } | {
474
- readonly _tag: "SessionEnding";
475
- readonly timeLeft?: Duration.Duration;
476
- } | {
477
- readonly _tag: "SpeechStarted";
478
- } | {
479
- readonly _tag: "SpeechStopped";
480
- } | {
481
- readonly _tag: "ToolCall";
482
- readonly responseId: string;
483
- readonly call: ToolCall;
484
- } | {
485
- readonly _tag: "ToolCallCancelled";
486
- readonly callIds: ReadonlyArray<string>;
487
- }, {
488
- readonly _tag: Tag;
489
- }>) => any; }>(value: {
490
- readonly _tag: "AudioDelta";
491
- readonly responseId: string;
492
- readonly bytes: Uint8Array;
493
- } | {
494
- readonly _tag: "Error";
495
- readonly code?: string;
496
- readonly message: string;
497
- } | {
498
- readonly _tag: "InputTranscript";
499
- readonly text: string;
500
- readonly final: boolean;
501
- } | {
502
- readonly _tag: "Interrupted";
503
- readonly responseId: string;
504
- } | {
505
- readonly _tag: "OutputTranscriptDelta";
506
- readonly responseId: string;
507
- readonly text: string;
508
- } | {
509
- readonly _tag: "ResponseDone";
510
- readonly responseId: string;
511
- readonly reason: "complete" | "interrupted" | "cancelled" | "error";
512
- readonly usage?: Usage;
513
- } | {
514
- readonly _tag: "ResponseStarted";
515
- readonly responseId: string;
516
- } | {
517
- readonly _tag: "ResumptionHandle";
518
- readonly handle: string;
519
- } | {
520
- readonly _tag: "SessionEnding";
521
- readonly timeLeft?: Duration.Duration;
522
- } | {
523
- readonly _tag: "SpeechStarted";
524
- } | {
525
- readonly _tag: "SpeechStopped";
526
- } | {
527
- readonly _tag: "ToolCall";
528
- readonly responseId: string;
529
- readonly call: ToolCall;
530
- } | {
531
- readonly _tag: "ToolCallCancelled";
532
- readonly callIds: ReadonlyArray<string>;
533
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["AudioDelta" | "Error" | "InputTranscript" | "Interrupted" | "OutputTranscriptDelta" | "ResponseDone" | "ResponseStarted" | "ResumptionHandle" | "SessionEnding" | "SpeechStarted" | "SpeechStopped" | "ToolCall" | "ToolCallCancelled"]>>;
534
- };
535
- readonly AudioDelta: Data.TaggedEnum.ConstructorFrom<{
536
- readonly _tag: "AudioDelta";
537
- readonly responseId: string;
538
- readonly bytes: Uint8Array;
539
- }, "_tag">;
540
- readonly Error: Data.TaggedEnum.ConstructorFrom<{
541
- readonly _tag: "Error";
542
- readonly code?: string;
543
- readonly message: string;
544
- }, "_tag">;
545
- readonly InputTranscript: Data.TaggedEnum.ConstructorFrom<{
546
- readonly _tag: "InputTranscript";
547
- readonly text: string;
548
- readonly final: boolean;
549
- }, "_tag">;
550
- readonly Interrupted: Data.TaggedEnum.ConstructorFrom<{
551
- readonly _tag: "Interrupted";
552
- readonly responseId: string;
553
- }, "_tag">;
554
- readonly OutputTranscriptDelta: Data.TaggedEnum.ConstructorFrom<{
555
- readonly _tag: "OutputTranscriptDelta";
556
- readonly responseId: string;
557
- readonly text: string;
558
- }, "_tag">;
559
- readonly ResponseDone: Data.TaggedEnum.ConstructorFrom<{
560
- readonly _tag: "ResponseDone";
561
- readonly responseId: string;
562
- readonly reason: "complete" | "interrupted" | "cancelled" | "error";
563
- readonly usage?: Usage;
564
- }, "_tag">;
565
- readonly ResponseStarted: Data.TaggedEnum.ConstructorFrom<{
566
- readonly _tag: "ResponseStarted";
567
- readonly responseId: string;
568
- }, "_tag">;
569
- readonly ResumptionHandle: Data.TaggedEnum.ConstructorFrom<{
570
- readonly _tag: "ResumptionHandle";
571
- readonly handle: string;
572
- }, "_tag">;
573
- readonly SessionEnding: Data.TaggedEnum.ConstructorFrom<{
574
- readonly _tag: "SessionEnding";
575
- readonly timeLeft?: Duration.Duration;
576
- }, "_tag">;
577
- readonly SpeechStarted: Data.TaggedEnum.ConstructorFrom<{
578
- readonly _tag: "SpeechStarted";
579
- }, "_tag">;
580
- readonly SpeechStopped: Data.TaggedEnum.ConstructorFrom<{
581
- readonly _tag: "SpeechStopped";
582
- }, "_tag">;
583
- readonly ToolCall: Data.TaggedEnum.ConstructorFrom<{
584
- readonly _tag: "ToolCall";
585
- readonly responseId: string;
586
- readonly call: ToolCall;
587
- }, "_tag">;
588
- readonly ToolCallCancelled: Data.TaggedEnum.ConstructorFrom<{
589
- readonly _tag: "ToolCallCancelled";
590
- readonly callIds: ReadonlyArray<string>;
591
- }, "_tag">;
592
- };
130
+ declare const RealtimeEvent: Data.TaggedEnum.Constructor<{
131
+ readonly _tag: "AudioDelta";
132
+ readonly responseId: string;
133
+ readonly bytes: Uint8Array;
134
+ } | {
135
+ readonly _tag: "Error";
136
+ readonly code?: string;
137
+ readonly message: string;
138
+ } | {
139
+ readonly _tag: "InputTranscript";
140
+ readonly text: string;
141
+ readonly final: boolean;
142
+ } | {
143
+ readonly _tag: "Interrupted";
144
+ readonly responseId: string;
145
+ } | {
146
+ readonly _tag: "OutputTranscriptDelta";
147
+ readonly responseId: string;
148
+ readonly text: string;
149
+ } | {
150
+ readonly _tag: "ResponseDone";
151
+ readonly responseId: string;
152
+ readonly reason: "complete" | "interrupted" | "cancelled" | "error";
153
+ readonly usage?: Usage;
154
+ } | {
155
+ readonly _tag: "ResponseStarted";
156
+ readonly responseId: string;
157
+ } | {
158
+ readonly _tag: "ResumptionHandle";
159
+ readonly handle: string;
160
+ } | {
161
+ readonly _tag: "SessionEnding";
162
+ readonly timeLeft?: Duration.Duration;
163
+ } | {
164
+ readonly _tag: "SpeechStarted";
165
+ } | {
166
+ readonly _tag: "SpeechStopped";
167
+ } | {
168
+ readonly _tag: "ToolCall";
169
+ readonly responseId: string;
170
+ readonly call: ToolCall;
171
+ } | {
172
+ readonly _tag: "ToolCallCancelled";
173
+ readonly callIds: ReadonlyArray<string>;
174
+ }>;
593
175
  /**
594
176
  * Cross-provider session setup. Each adapter extends this, narrowing `model`
595
177
  * and adding its own knobs.
@@ -1 +1 @@
1
- {"version":3,"file":"Realtime.d.mts","names":[],"sources":["../../src/domain/Realtime.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KA6BY,gBAAgB,KAAK;EAC/B;aAAkB,OAAO;;EACzB;aAAiB;aAAuB;;EACxC;aAAuB,QAAQ;;EAC/B;EACA;aAAuB,OAAO;;EAC9B;EACA;EACA;aAA6B;aAA6B;;;cAG/C;;;;;;;;;;;aAVc,OAAA;;;;;;;;;aAOgB;aAA2B;;;;;aAN7C;aAAwB;;;;;aAChB,QAAA;;;;;aAED,OAAA;;;;;;;;;;;eAJL,OAAA;;;;;eAOgB;eAA2B;;;eAN7C;eAAwB;;;eAChB,QAAA;;;eAED,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAJL,OAAA;;;;;eAOgB;eAA2B;;;eAN7C;eAAwB;;;eAChB,QAAA;;;eAED,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAJL,OAAA;;;;;;;aAOgB;aAA2B;;;;aAN7C;aAAwB;;;;aAChB,QAAA;;;;aAED,OAAA;;;;;;;;;;;;;;;;;;;KAwBpB,gBAAgB,KAAK;EAC/B;aAA4B;;EAC5B;aAAuB;aAA6B,OAAO;;EAC3D;aAAkC;aAA6B;;EAC/D;aAA4B;aAAuB;;EACnD;EACA;EACA;aAAqB;aAA6B,MAAM;;EACxD;aAA8B,SAAS;;EACvC;aAAwB;;EACxB;aACW;aACA;aACA,QAAQ;;EAEnB;aAA6B;;EAC7B;aAA0B,WAAW,SAAS;;EAC9C;aAAkB;aAAwB;;;cAG/B;;;aAlBwB;aAAwB,OAAA;;;;;aAelC;aAA0B;;;;;aAbjB;aAAwB;;;;;aAKtB;;;;;aANU;aAAuB;;;;;aAQ9C;aACJ;aACA,QAAA;;;;;aAZqB;;;;;aAcH;;;;;aACA,WAAA,SAAS;;;;;;;;;;;;;aATb;aAAuB,MAAA;;;;;aACjB,SAAA;;;;;;;eANJ;eAAwB,OAAA;;;eAelC;eAA0B;;;eAbjB;eAAwB;;;eAKtB;;;eANU;eAAuB;;;eAQ9C;eACJ;eACA,QAAA;;;eAZqB;;;eAcH;;;eACA,WAAA,SAAS;;;;;;;eATb;eAAuB,MAAA;;;eACjB,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eANJ;eAAwB,OAAA;;;eAelC;eAA0B;;;eAbjB;eAAwB;;;eAKtB;;;eANU;eAAuB;;;eAQ9C;eACJ;eACA,QAAA;;;eAZqB;;;eAcH;;;eACA,WAAA,SAAS;;;;;;;eATb;eAAuB,MAAA;;;eACjB,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aANJ;aAAwB,OAAA;;;;aAelC;aAA0B;;;;aAbjB;aAAwB;;;;aAKtB;;;;aANU;aAAuB;;;;aAQ9C;aACJ;aACA,QAAA;;;;aAZqB;;;;aAcH;;;;aACA,WAAA,SAAS;;;;;;;;;;aATb;aAAuB,MAAA;;;;aACjB,SAAA;;;;;;;KAkB7B;WACD;WACA;WACA;;WAEA,QAAQ,cAAc;WACtB,aAAa;WACb,cAAc;;WAEd;;WAEA;;WAEA,UAAU,cAAc;;WAExB"}
1
+ {"version":3,"file":"Realtime.d.mts","names":[],"sources":["../../src/domain/Realtime.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KA6BY,gBAAgB,KAAK;EAC/B;aAAkB,OAAO;;EACzB;aAAiB;aAAuB;;EACxC;aAAuB,QAAQ;;EAC/B;EACA;aAAuB,OAAO;;EAC9B;EACA;EACA;aAA6B;aAA6B;;;cAG/C,eAAa,KAAA,WAAA;;;;;;WAVC,OAAA;;;;;WAOgB;WAA2B;;;WAN7C;WAAwB;;;WAChB,QAAA;;;WAED,OAAA;;;;;;;;;;;;;;;;;;KAwBpB,gBAAgB,KAAK;EAC/B;aAA4B;;EAC5B;aAAuB;aAA6B,OAAO;;EAC3D;aAAkC;aAA6B;;EAC/D;aAA4B;aAAuB;;EACnD;EACA;EACA;aAAqB;aAA6B,MAAM;;EACxD;aAA8B,SAAS;;EACvC;aAAwB;;EACxB;aACW;aACA;aACA,QAAQ;;EAEnB;aAA6B;;EAC7B;aAA0B,WAAW,SAAS;;EAC9C;aAAkB;aAAwB;;;cAG/B,eAAa,KAAA,WAAA;;WAlBW;WAAwB,OAAA;;;WAelC;WAA0B;;;WAbjB;WAAwB;;;WAKtB;;;WANU;WAAuB;;;WAQ9C;WACJ;WACA,QAAA;;;WAZqB;;;WAcH;;;WACA,WAAA,SAAS;;;;;;;WATb;WAAuB,MAAA;;;WACjB,SAAA;;;;;;KAkB7B;WACD;WACA;WACA;;WAEA,QAAQ,cAAc;WACtB,aAAa;WACb,cAAc;;WAEd;;WAEA;;WAEA,UAAU,cAAc;;WAExB"}
@@ -1,4 +1,4 @@
1
- import { o as HistoryItem } from "../Items-C7MyrYPX.mjs";
1
+ import { o as HistoryItem } from "../Items-Bvx8s9QH.mjs";
2
2
  import { JobRef, JobState } from "../job/Job.mjs";
3
3
  import { Turn } from "./Turn.mjs";
4
4
  declare namespace Research_d_exports {
@@ -1,7 +1,7 @@
1
1
  import { accumulatePartials } from "./Transcript.mjs";
2
- import { o as describe } from "../utils-CiH_DjFW.mjs";
3
- import { n as globalExpect } from "../test.DNmyFkvJ-YPzDR0Co.mjs";
4
- import { t as it } from "../dist-nohcnkD6.mjs";
2
+ import { m as describe } from "../dist-DzeSyeYF.mjs";
3
+ import { n as globalExpect } from "../index.C4tKZ0yW-LuFnBtmu.mjs";
4
+ import { t as it } from "../dist-B5K-y4Be.mjs";
5
5
  import { Effect, Queue, Ref, Stream } from "effect";
6
6
  import { TestClock } from "effect/testing";
7
7
  //#region src/domain/Transcript.test.ts