@effect-uai/core 0.5.2 → 0.7.0

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 (175) hide show
  1. package/README.md +1 -1
  2. package/dist/{Audio-BfCTGnH3.d.mts → Audio-DPlTsNdz.d.mts} +3 -2
  3. package/dist/Audio-DPlTsNdz.d.mts.map +1 -0
  4. package/dist/{Items-BH8xUkoR.d.mts → Items-D8UaXQx_.d.mts} +15 -15
  5. package/dist/Items-D8UaXQx_.d.mts.map +1 -0
  6. package/dist/SandboxError-BvKypkJm.d.mts +158 -0
  7. package/dist/SandboxError-BvKypkJm.d.mts.map +1 -0
  8. package/dist/{Tool-87ViKCCO.d.mts → Tool-CiFXYjmR.d.mts} +11 -11
  9. package/dist/{Tool-87ViKCCO.d.mts.map → Tool-CiFXYjmR.d.mts.map} +1 -1
  10. package/dist/capabilities/Capabilities.d.mts +78 -0
  11. package/dist/capabilities/Capabilities.d.mts.map +1 -0
  12. package/dist/capabilities/Capabilities.mjs +65 -0
  13. package/dist/capabilities/Capabilities.mjs.map +1 -0
  14. package/dist/domain/Audio.d.mts +1 -1
  15. package/dist/domain/Audio.mjs.map +1 -1
  16. package/dist/domain/Items.d.mts +2 -2
  17. package/dist/domain/Items.mjs +15 -15
  18. package/dist/domain/Items.mjs.map +1 -1
  19. package/dist/domain/Music.d.mts +131 -72
  20. package/dist/domain/Music.d.mts.map +1 -1
  21. package/dist/domain/Music.mjs +36 -9
  22. package/dist/domain/Music.mjs.map +1 -1
  23. package/dist/domain/Transcript.d.mts +8 -2
  24. package/dist/domain/Transcript.d.mts.map +1 -1
  25. package/dist/domain/Transcript.mjs.map +1 -1
  26. package/dist/domain/Turn.d.mts +388 -2
  27. package/dist/domain/Turn.d.mts.map +1 -0
  28. package/dist/domain/Turn.mjs +13 -13
  29. package/dist/domain/Turn.mjs.map +1 -1
  30. package/dist/embedding-model/Embedding.d.mts +12 -2
  31. package/dist/embedding-model/Embedding.d.mts.map +1 -1
  32. package/dist/embedding-model/Embedding.mjs.map +1 -1
  33. package/dist/embedding-model/EmbeddingModel.d.mts +36 -23
  34. package/dist/embedding-model/EmbeddingModel.d.mts.map +1 -1
  35. package/dist/embedding-model/EmbeddingModel.mjs +20 -1
  36. package/dist/embedding-model/EmbeddingModel.mjs.map +1 -1
  37. package/dist/embedding-model/EmbeddingModel.test.mjs +15 -3
  38. package/dist/embedding-model/EmbeddingModel.test.mjs.map +1 -1
  39. package/dist/index.d.mts +13 -7
  40. package/dist/index.mjs +9 -3
  41. package/dist/language-model/LanguageModel.d.mts +5 -5
  42. package/dist/language-model/LanguageModel.d.mts.map +1 -1
  43. package/dist/language-model/LanguageModel.mjs.map +1 -1
  44. package/dist/loop/Loop.d.mts +37 -90
  45. package/dist/loop/Loop.d.mts.map +1 -1
  46. package/dist/loop/Loop.mjs +39 -93
  47. package/dist/loop/Loop.mjs.map +1 -1
  48. package/dist/loop/Loop.test.mjs +46 -54
  49. package/dist/loop/Loop.test.mjs.map +1 -1
  50. package/dist/music-generator/MusicGenerator.d.mts +48 -25
  51. package/dist/music-generator/MusicGenerator.d.mts.map +1 -1
  52. package/dist/music-generator/MusicGenerator.mjs +17 -9
  53. package/dist/music-generator/MusicGenerator.mjs.map +1 -1
  54. package/dist/music-generator/MusicGenerator.test.mjs +81 -56
  55. package/dist/music-generator/MusicGenerator.test.mjs.map +1 -1
  56. package/dist/sandbox/Memory.d.mts +53 -0
  57. package/dist/sandbox/Memory.d.mts.map +1 -0
  58. package/dist/sandbox/Memory.mjs +68 -0
  59. package/dist/sandbox/Memory.mjs.map +1 -0
  60. package/dist/sandbox/Sandbox.d.mts +717 -0
  61. package/dist/sandbox/Sandbox.d.mts.map +1 -0
  62. package/dist/sandbox/Sandbox.mjs +192 -0
  63. package/dist/sandbox/Sandbox.mjs.map +1 -0
  64. package/dist/sandbox/SandboxError.d.mts +2 -0
  65. package/dist/sandbox/SandboxError.mjs +89 -0
  66. package/dist/sandbox/SandboxError.mjs.map +1 -0
  67. package/dist/sandbox/SandboxImage.d.mts +28 -0
  68. package/dist/sandbox/SandboxImage.d.mts.map +1 -0
  69. package/dist/sandbox/SandboxImage.mjs +32 -0
  70. package/dist/sandbox/SandboxImage.mjs.map +1 -0
  71. package/dist/sandbox/SandboxNetwork.d.mts +34 -0
  72. package/dist/sandbox/SandboxNetwork.d.mts.map +1 -0
  73. package/dist/sandbox/SandboxNetwork.mjs +36 -0
  74. package/dist/sandbox/SandboxNetwork.mjs.map +1 -0
  75. package/dist/speech-synthesizer/SpeechSynthesizer.d.mts +84 -3
  76. package/dist/speech-synthesizer/SpeechSynthesizer.d.mts.map +1 -1
  77. package/dist/speech-synthesizer/SpeechSynthesizer.mjs +32 -2
  78. package/dist/speech-synthesizer/SpeechSynthesizer.mjs.map +1 -1
  79. package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs +59 -5
  80. package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs.map +1 -1
  81. package/dist/testing/MockMusicGenerator.d.mts +12 -7
  82. package/dist/testing/MockMusicGenerator.d.mts.map +1 -1
  83. package/dist/testing/MockMusicGenerator.mjs +4 -3
  84. package/dist/testing/MockMusicGenerator.mjs.map +1 -1
  85. package/dist/testing/MockProvider.d.mts +3 -3
  86. package/dist/testing/MockProvider.d.mts.map +1 -1
  87. package/dist/testing/MockProvider.mjs.map +1 -1
  88. package/dist/testing/MockSandbox.d.mts +604 -0
  89. package/dist/testing/MockSandbox.d.mts.map +1 -0
  90. package/dist/testing/MockSandbox.mjs +160 -0
  91. package/dist/testing/MockSandbox.mjs.map +1 -0
  92. package/dist/testing/MockSpeechSynthesizer.d.mts +27 -12
  93. package/dist/testing/MockSpeechSynthesizer.d.mts.map +1 -1
  94. package/dist/testing/MockSpeechSynthesizer.mjs +75 -51
  95. package/dist/testing/MockSpeechSynthesizer.mjs.map +1 -1
  96. package/dist/tool/{Resolvers.d.mts → Approval.d.mts} +27 -27
  97. package/dist/tool/Approval.d.mts.map +1 -0
  98. package/dist/tool/{Resolvers.mjs → Approval.mjs} +18 -18
  99. package/dist/tool/Approval.mjs.map +1 -0
  100. package/dist/tool/{Resolvers.test.mjs → Approval.test.mjs} +40 -40
  101. package/dist/tool/Approval.test.mjs.map +1 -0
  102. package/dist/tool/HistoryCheck.d.mts +6 -6
  103. package/dist/tool/HistoryCheck.d.mts.map +1 -1
  104. package/dist/tool/HistoryCheck.mjs +5 -5
  105. package/dist/tool/HistoryCheck.mjs.map +1 -1
  106. package/dist/tool/Tool.d.mts +2 -2
  107. package/dist/tool/Tool.mjs +4 -4
  108. package/dist/tool/Tool.mjs.map +1 -1
  109. package/dist/tool/ToolEvent.d.mts +19 -19
  110. package/dist/tool/ToolEvent.d.mts.map +1 -1
  111. package/dist/tool/ToolEvent.mjs +8 -8
  112. package/dist/tool/ToolEvent.mjs.map +1 -1
  113. package/dist/tool/{Outcome.d.mts → ToolResult.d.mts} +29 -29
  114. package/dist/tool/ToolResult.d.mts.map +1 -0
  115. package/dist/tool/ToolResult.mjs +61 -0
  116. package/dist/tool/ToolResult.mjs.map +1 -0
  117. package/dist/tool/Toolkit.d.mts +58 -26
  118. package/dist/tool/Toolkit.d.mts.map +1 -1
  119. package/dist/tool/Toolkit.mjs +62 -34
  120. package/dist/tool/Toolkit.mjs.map +1 -1
  121. package/dist/tool/Toolkit.test.mjs +13 -13
  122. package/dist/tool/Toolkit.test.mjs.map +1 -1
  123. package/dist/transcriber/Transcriber.d.mts +11 -10
  124. package/dist/transcriber/Transcriber.d.mts.map +1 -1
  125. package/dist/transcriber/Transcriber.mjs.map +1 -1
  126. package/dist/transcriber/Transcriber.test.mjs +3 -3
  127. package/dist/transcriber/Transcriber.test.mjs.map +1 -1
  128. package/package.json +35 -7
  129. package/src/capabilities/Capabilities.ts +81 -0
  130. package/src/domain/Audio.ts +2 -1
  131. package/src/domain/Items.ts +9 -9
  132. package/src/domain/Music.ts +142 -68
  133. package/src/domain/Transcript.ts +7 -1
  134. package/src/domain/Turn.ts +16 -16
  135. package/src/embedding-model/Embedding.ts +11 -0
  136. package/src/embedding-model/EmbeddingModel.test.ts +15 -4
  137. package/src/embedding-model/EmbeddingModel.ts +48 -21
  138. package/src/index.ts +8 -2
  139. package/src/language-model/LanguageModel.ts +3 -3
  140. package/src/loop/Loop.test.ts +93 -91
  141. package/src/loop/Loop.ts +72 -170
  142. package/src/music-generator/MusicGenerator.test.ts +78 -53
  143. package/src/music-generator/MusicGenerator.ts +65 -24
  144. package/src/sandbox/Memory.ts +128 -0
  145. package/src/sandbox/Sandbox.ts +639 -0
  146. package/src/sandbox/SandboxError.ts +140 -0
  147. package/src/sandbox/SandboxImage.ts +26 -0
  148. package/src/sandbox/SandboxNetwork.ts +34 -0
  149. package/src/speech-synthesizer/SpeechSynthesizer.test.ts +92 -3
  150. package/src/speech-synthesizer/SpeechSynthesizer.ts +109 -0
  151. package/src/testing/MockMusicGenerator.ts +28 -18
  152. package/src/testing/MockProvider.ts +21 -20
  153. package/src/testing/MockSandbox.ts +342 -0
  154. package/src/testing/MockSpeechSynthesizer.ts +137 -77
  155. package/src/tool/{Resolvers.test.ts → Approval.test.ts} +45 -54
  156. package/src/tool/{Resolvers.ts → Approval.ts} +25 -25
  157. package/src/tool/HistoryCheck.ts +10 -13
  158. package/src/tool/Tool.ts +13 -15
  159. package/src/tool/ToolEvent.ts +7 -7
  160. package/src/tool/{Outcome.ts → ToolResult.ts} +20 -20
  161. package/src/tool/Toolkit.test.ts +13 -13
  162. package/src/tool/Toolkit.ts +97 -73
  163. package/src/transcriber/Transcriber.test.ts +3 -3
  164. package/src/transcriber/Transcriber.ts +10 -7
  165. package/dist/Audio-BfCTGnH3.d.mts.map +0 -1
  166. package/dist/Items-BH8xUkoR.d.mts.map +0 -1
  167. package/dist/Turn-0CwCAyVe.d.mts +0 -388
  168. package/dist/Turn-0CwCAyVe.d.mts.map +0 -1
  169. package/dist/tool/Outcome.d.mts.map +0 -1
  170. package/dist/tool/Outcome.mjs +0 -61
  171. package/dist/tool/Outcome.mjs.map +0 -1
  172. package/dist/tool/Resolvers.d.mts.map +0 -1
  173. package/dist/tool/Resolvers.mjs.map +0 -1
  174. package/dist/tool/Resolvers.test.mjs.map +0 -1
  175. /package/dist/tool/{Resolvers.test.d.mts → Approval.test.d.mts} +0 -0
package/README.md CHANGED
@@ -10,7 +10,7 @@ This package exposes:
10
10
 
11
11
  - **Domain types** - `Items`, `Turn`, `AiError`
12
12
  - **Provider contract** - `LanguageModel`
13
- - **Loop primitive** - `Loop` (`loop`, `loopWithState`, `value`, `next`, `stop`, `nextAfter`, `nextAfterFold`, `onTurnComplete`)
13
+ - **Loop primitive** - `Loop` (`loop`, `loopWithState`, `value`, `next`, `stop`, `nextAfter`, `onTurnComplete`)
14
14
  - **Tools** - `Tool`, `Toolkit`, `Outcome`, `ToolEvent`, `Resolvers`, `HistoryCheck`
15
15
  - **Streaming codecs** - `SSE`, `JSONL`, `Lines`
16
16
  - **Structured output** - `StructuredFormat`
@@ -1,4 +1,5 @@
1
1
  import { i as MediaUrl, n as MediaBytes, t as MediaBase64 } from "./Media-D_CpcM1Z.mjs";
2
+ import { Duration } from "effect";
2
3
 
3
4
  //#region src/domain/Audio.d.ts
4
5
  declare namespace Audio_d_exports {
@@ -54,8 +55,8 @@ type AudioChunk = {
54
55
  type AudioBlob = {
55
56
  readonly format: AudioFormat;
56
57
  readonly bytes: Uint8Array;
57
- readonly durationSeconds?: number;
58
+ readonly duration?: Duration.Duration;
58
59
  };
59
60
  //#endregion
60
61
  export { AudioSource as a, isAudioBytes as c, AudioMimeType as i, isAudioUrl as l, AudioChunk as n, Audio_d_exports as o, AudioFormat as r, isAudioBase64 as s, AudioBlob as t };
61
- //# sourceMappingURL=Audio-BfCTGnH3.d.mts.map
62
+ //# sourceMappingURL=Audio-DPlTsNdz.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Audio-DPlTsNdz.d.mts","names":[],"sources":["../src/domain/Audio.ts"],"mappings":";;;;;;;;;;;;;;;KAWY,aAAA;;;;;AAAZ;;;;;KA0BY,WAAA,GACR,QAAA,CAAS,aAAA,IACT,WAAA,CAAY,aAAA,IACZ,UAAA,CAAW,aAAA;AAAA,cAEF,UAAA,GAAc,CAAA,EAAG,WAAA,KAAc,CAAA,IAAK,QAAA,CAAS,aAAA;AAAA,cAC7C,aAAA,GAAiB,CAAA,EAAG,WAAA,KAAc,CAAA,IAAK,WAAA,CAAY,aAAA;AAAA,cAEnD,YAAA,GAAgB,CAAA,EAAG,WAAA,KAAc,CAAA,IAAK,UAAA,CAAW,aAAA;;;;;;;KAQlD,WAAA;EAAA,SACD,SAAA;EAAA,SACA,QAAA;EAAA,SAUA,UAAA,wDA1BK;EAAA,SA4BL,OAAA;EAAA,SACA,QAAA;AAAA;;AA1BX;;;;KAkCY,UAAA;EAAA,SACD,KAAA,EAAO,UAAA;AAAA;;;;;KAON,SAAA;EAAA,SACD,MAAA,EAAQ,WAAA;EAAA,SACR,KAAA,EAAO,UAAA;EAAA,SACP,QAAA,GAAW,QAAA,CAAS,QAAA;AAAA"}
@@ -3,7 +3,7 @@ import { Schema } from "effect";
3
3
 
4
4
  //#region src/domain/Items.d.ts
5
5
  declare namespace Items_d_exports {
6
- export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput, InputImage, InputText, InputTokensDetails, Item, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, UrlCitation, Usage, assistantText, functionCallOutput, isContainerFileCitation, isFileCitation, isFilePath, isFunctionCall, isFunctionCallOutput, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isUrlCitation, systemText, userText };
6
+ export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, HistoryItem, InputImage, InputText, InputTokensDetails, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, ToolCall, ToolCallOutput, UrlCitation, Usage, assistantText, isContainerFileCitation, isFileCitation, isFilePath, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isToolCall, isToolCallOutput, isUrlCitation, systemText, toolCallOutput, userText };
7
7
  }
8
8
  declare const InputText: Schema.Struct<{
9
9
  readonly type: Schema.Literal<"input_text">;
@@ -74,8 +74,8 @@ declare const Annotation: Schema.Union<readonly [Schema.Struct<{
74
74
  }>]>;
75
75
  type Annotation = typeof Annotation.Type;
76
76
  declare const isUrlCitation: <I>(input: I) => input is I & {
77
- readonly url: string;
78
77
  readonly type: "url_citation";
78
+ readonly url: string;
79
79
  readonly start_index: number;
80
80
  readonly end_index: number;
81
81
  readonly title: string;
@@ -211,21 +211,21 @@ declare const Message: Schema.Struct<{
211
211
  readonly providerData: Schema.optional<Schema.Unknown>;
212
212
  }>;
213
213
  type Message = typeof Message.Type;
214
- declare const FunctionCall: Schema.Struct<{
214
+ declare const ToolCall: Schema.Struct<{
215
215
  readonly type: Schema.Literal<"function_call">;
216
216
  readonly call_id: Schema.String;
217
217
  readonly name: Schema.String;
218
218
  readonly arguments: Schema.String;
219
219
  readonly providerData: Schema.optional<Schema.Unknown>;
220
220
  }>;
221
- type FunctionCall = typeof FunctionCall.Type;
222
- declare const FunctionCallOutput: Schema.Struct<{
221
+ type ToolCall = typeof ToolCall.Type;
222
+ declare const ToolCallOutput: Schema.Struct<{
223
223
  readonly type: Schema.Literal<"function_call_output">;
224
224
  readonly call_id: Schema.String;
225
225
  readonly output: Schema.String;
226
226
  readonly providerData: Schema.optional<Schema.Unknown>;
227
227
  }>;
228
- type FunctionCallOutput = typeof FunctionCallOutput.Type;
228
+ type ToolCallOutput = typeof ToolCallOutput.Type;
229
229
  /**
230
230
  * Reasoning item - top-level, mirrors OpenAI Responses API. Common shape
231
231
  * across providers covers `summary` (human-readable text) and `signature`
@@ -240,7 +240,7 @@ declare const Reasoning: Schema.Struct<{
240
240
  readonly providerData: Schema.optional<Schema.Unknown>;
241
241
  }>;
242
242
  type Reasoning = typeof Reasoning.Type;
243
- declare const Item: Schema.Union<readonly [Schema.Struct<{
243
+ declare const HistoryItem: Schema.Union<readonly [Schema.Struct<{
244
244
  readonly type: Schema.Literal<"message">;
245
245
  readonly role: Schema.Literals<readonly ["user", "assistant", "system"]>;
246
246
  readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -296,7 +296,7 @@ declare const Item: Schema.Union<readonly [Schema.Struct<{
296
296
  readonly signature: Schema.optional<Schema.String>;
297
297
  readonly providerData: Schema.optional<Schema.Unknown>;
298
298
  }>]>;
299
- type Item = typeof Item.Type;
299
+ type HistoryItem = typeof HistoryItem.Type;
300
300
  declare const isInputText: <I>(input: I) => input is I & {
301
301
  readonly type: "input_text";
302
302
  readonly text: string;
@@ -309,8 +309,8 @@ declare const isOutputText: <I>(input: I) => input is I & {
309
309
  readonly type: "output_text";
310
310
  readonly text: string;
311
311
  readonly annotations?: readonly ({
312
- readonly url: string;
313
312
  readonly type: "url_citation";
313
+ readonly url: string;
314
314
  readonly start_index: number;
315
315
  readonly end_index: number;
316
316
  readonly title: string;
@@ -346,8 +346,8 @@ declare const isMessage: <I>(input: I) => input is I & {
346
346
  readonly type: "output_text";
347
347
  readonly text: string;
348
348
  readonly annotations?: readonly ({
349
- readonly url: string;
350
349
  readonly type: "url_citation";
350
+ readonly url: string;
351
351
  readonly start_index: number;
352
352
  readonly end_index: number;
353
353
  readonly title: string;
@@ -373,14 +373,14 @@ declare const isMessage: <I>(input: I) => input is I & {
373
373
  readonly role: "user" | "assistant" | "system";
374
374
  readonly providerData?: unknown;
375
375
  };
376
- declare const isFunctionCall: <I>(input: I) => input is I & {
376
+ declare const isToolCall: <I>(input: I) => input is I & {
377
377
  readonly type: "function_call";
378
378
  readonly call_id: string;
379
379
  readonly name: string;
380
380
  readonly arguments: string;
381
381
  readonly providerData?: unknown;
382
382
  };
383
- declare const isFunctionCallOutput: <I>(input: I) => input is I & {
383
+ declare const isToolCallOutput: <I>(input: I) => input is I & {
384
384
  readonly type: "function_call_output";
385
385
  readonly call_id: string;
386
386
  readonly output: string;
@@ -418,7 +418,7 @@ type StopReason = typeof StopReason.Type;
418
418
  declare const userText: (text: string) => Message;
419
419
  declare const systemText: (text: string) => Message;
420
420
  declare const assistantText: (text: string) => Message;
421
- declare const functionCallOutput: (call_id: string, output: string) => FunctionCallOutput;
421
+ declare const toolCallOutput: (call_id: string, output: string) => ToolCallOutput;
422
422
  //#endregion
423
- export { isInputText as A, functionCallOutput as C, isFunctionCall as D, isFilePath as E, isUrlCitation as F, systemText as I, userText as L, isOutputText as M, isReasoning as N, isFunctionCallOutput as O, isRefusal as P, assistantText as S, isFileCitation as T, Refusal as _, FilePath as a, UrlCitation as b, InputImage as c, Item as d, Items_d_exports as f, Reasoning as g, OutputTokensDetails as h, FileCitation as i, isMessage as j, isInputImage as k, InputText as l, OutputText as m, ContainerFileCitation as n, FunctionCall as o, Message as p, ContentBlock as r, FunctionCallOutput as s, Annotation as t, InputTokensDetails as u, Role as v, isContainerFileCitation as w, Usage as x, StopReason as y };
424
- //# sourceMappingURL=Items-BH8xUkoR.d.mts.map
423
+ export { isReasoning as A, isContainerFileCitation as C, isInputText as D, isInputImage as E, systemText as F, toolCallOutput as I, userText as L, isToolCall as M, isToolCallOutput as N, isMessage as O, isUrlCitation as P, assistantText as S, isFilePath as T, StopReason as _, FilePath as a, UrlCitation as b, InputText as c, Message as d, OutputText as f, Role as g, Refusal as h, FileCitation as i, isRefusal as j, isOutputText as k, InputTokensDetails as l, Reasoning as m, ContainerFileCitation as n, HistoryItem as o, OutputTokensDetails as p, ContentBlock as r, InputImage as s, Annotation as t, Items_d_exports as u, ToolCall as v, isFileCitation as w, Usage as x, ToolCallOutput as y };
424
+ //# sourceMappingURL=Items-D8UaXQx_.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Items-D8UaXQx_.d.mts","names":[],"sources":["../src/domain/Items.ts"],"mappings":";;;;;;;cAOa,SAAA,EAAS,MAAA,CAAA,MAAA;EAAA;;;KAIV,SAAA,UAAmB,SAAA,CAAU,IAAA;;;;;;;;;cAU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WAAA,MAAW,KAAA,EAAA,CAAA,KAAA,KAAA,IAAA,CAAA;EAAA;;;;;;cAMX,kBAAA,EAAkB,MAAA,CAAA,MAAA;EAAA;;KAGnB,kBAAA,UAA4B,kBAAA,CAAmB,IAAA;AAAA,cAE9C,mBAAA,EAAmB,MAAA,CAAA,MAAA;EAAA;;KAGpB,mBAAA,UAA6B,mBAAA,CAAoB,IAAA;AAAA,cAEhD,KAAA,EAAK,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;KAON,KAAA,UAAe,KAAA,CAAM,IAAA;AAAA,cAEpB,UAAA,EAAU,MAAA,CAAA,QAAA;AAAA,KAUX,UAAA,UAAoB,UAAA,CAAW,IAAA;AAAA,cAM9B,QAAA,GAAY,IAAA,aAAe,OAAA;AAAA,cAM3B,UAAA,GAAc,IAAA,aAAe,OAAA;AAAA,cAM7B,aAAA,GAAiB,IAAA,aAAe,OAAA;AAAA,cAMhC,cAAA,GAAkB,OAAA,UAAiB,MAAA,aAAiB,cAAA"}
@@ -0,0 +1,158 @@
1
+ import { Duration } from "effect";
2
+ import * as _$effect_Types0 from "effect/Types";
3
+ import * as _$effect_Cause0 from "effect/Cause";
4
+
5
+ //#region src/sandbox/SandboxError.d.ts
6
+ declare namespace SandboxError_d_exports {
7
+ export { SandboxAlreadyExists, SandboxAuthFailed, SandboxAuthSubtype, SandboxCreateFailed, SandboxError, SandboxExecFailed, SandboxInvalidRequest, SandboxNetworkPolicyDenied, SandboxNotFound, SandboxQuotaExceeded, SandboxTimeout, SandboxUnsupported };
8
+ }
9
+ declare const SandboxCreateFailed_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
10
+ readonly _tag: "SandboxCreateFailed";
11
+ } & Readonly<A>;
12
+ /**
13
+ * Failed to provision a sandbox. Covers image pull failures, region
14
+ * unavailability, the provider being unreachable, etc. The provider's
15
+ * structured reason (if any) is on `reason`; the raw error from the
16
+ * underlying SDK is on `raw`.
17
+ */
18
+ declare class SandboxCreateFailed extends SandboxCreateFailed_base<{
19
+ provider: string;
20
+ reason?: string;
21
+ raw: unknown;
22
+ }> {}
23
+ declare const SandboxNotFound_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
24
+ readonly _tag: "SandboxNotFound";
25
+ } & Readonly<A>;
26
+ /**
27
+ * The requested sandbox id does not exist (or was already destroyed).
28
+ * Distinct from `SandboxCreateFailed` — this is for `attach` / `destroy` /
29
+ * `get`-style lookups against a stale id.
30
+ */
31
+ declare class SandboxNotFound extends SandboxNotFound_base<{
32
+ provider: string;
33
+ id: string;
34
+ }> {}
35
+ declare const SandboxAlreadyExists_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
36
+ readonly _tag: "SandboxAlreadyExists";
37
+ } & Readonly<A>;
38
+ /**
39
+ * Caller tried to create a sandbox whose id is already taken. Providers
40
+ * that keyed by name (Microsandbox, Modal) surface this when a previous
41
+ * sandbox with the same name is still alive. Distinct from
42
+ * `SandboxCreateFailed` so callers can retry with `replace` semantics.
43
+ */
44
+ declare class SandboxAlreadyExists extends SandboxAlreadyExists_base<{
45
+ provider: string;
46
+ id: string;
47
+ }> {}
48
+ declare const SandboxExecFailed_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
49
+ readonly _tag: "SandboxExecFailed";
50
+ } & Readonly<A>;
51
+ /**
52
+ * A shell exec inside the sandbox failed at the transport / SDK layer —
53
+ * i.e. the SDK couldn't deliver the command to the guest, or the guest
54
+ * agent itself errored. A non-zero exit code from the guest's command
55
+ * is NOT an error; it's an `ExecResult` with `exitCode !== 0`.
56
+ */
57
+ declare class SandboxExecFailed extends SandboxExecFailed_base<{
58
+ provider: string;
59
+ reason?: string;
60
+ raw: unknown;
61
+ }> {}
62
+ declare const SandboxTimeout_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
63
+ readonly _tag: "SandboxTimeout";
64
+ } & Readonly<A>;
65
+ /**
66
+ * A sandbox operation (create, exec, file op) exceeded its time budget.
67
+ * Carries the budget that was breached for observability.
68
+ */
69
+ declare class SandboxTimeout extends SandboxTimeout_base<{
70
+ provider: string;
71
+ operation: "create" | "exec" | "filesystem" | "attach";
72
+ budget?: Duration.Duration;
73
+ raw?: unknown;
74
+ }> {}
75
+ declare const SandboxNetworkPolicyDenied_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
76
+ readonly _tag: "SandboxNetworkPolicyDenied";
77
+ } & Readonly<A>;
78
+ /**
79
+ * Outbound network request from inside the sandbox was blocked by the
80
+ * configured egress policy (host not on allowlist, CIDR mismatch, etc.).
81
+ * Surfaced when the provider's SDK reports the denial back to the host
82
+ * — many providers simply let the request fail inside the guest and
83
+ * never report this to the host, in which case this error is never
84
+ * raised by the adapter.
85
+ */
86
+ declare class SandboxNetworkPolicyDenied extends SandboxNetworkPolicyDenied_base<{
87
+ provider: string;
88
+ host?: string;
89
+ reason?: string;
90
+ raw: unknown;
91
+ }> {}
92
+ declare const SandboxQuotaExceeded_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
93
+ readonly _tag: "SandboxQuotaExceeded";
94
+ } & Readonly<A>;
95
+ /**
96
+ * Provider rejected the create / exec because account / org / project
97
+ * quota or concurrency limit was exceeded. Surfaced separately from
98
+ * `SandboxCreateFailed` so callers can back off and retry intelligently.
99
+ */
100
+ declare class SandboxQuotaExceeded extends SandboxQuotaExceeded_base<{
101
+ provider: string;
102
+ reason?: string;
103
+ raw: unknown;
104
+ }> {}
105
+ declare const SandboxInvalidRequest_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
106
+ readonly _tag: "SandboxInvalidRequest";
107
+ } & Readonly<A>;
108
+ /**
109
+ * Caller's request shape is malformed for the wired provider — e.g. a
110
+ * Dockerfile passed to a provider that only accepts registry refs, a
111
+ * hostname allowlist passed to a CIDR-only provider, etc. Adapters
112
+ * should also reject these at the request-schema layer where possible;
113
+ * this is the runtime fallback.
114
+ */
115
+ declare class SandboxInvalidRequest extends SandboxInvalidRequest_base<{
116
+ provider: string;
117
+ param?: string;
118
+ reason?: string;
119
+ raw?: unknown;
120
+ }> {}
121
+ /**
122
+ * Sandbox SDK could not authenticate against the provider. Subtype
123
+ * mirrors the model-side `AiError.AuthFailed` shape for consistency.
124
+ */
125
+ type SandboxAuthSubtype = "auth" | "permission" | "billing" | "quota";
126
+ declare const SandboxAuthFailed_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
127
+ readonly _tag: "SandboxAuthFailed";
128
+ } & Readonly<A>;
129
+ declare class SandboxAuthFailed extends SandboxAuthFailed_base<{
130
+ provider: string;
131
+ subtype: SandboxAuthSubtype;
132
+ raw: unknown;
133
+ }> {}
134
+ declare const SandboxUnsupported_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
135
+ readonly _tag: "SandboxUnsupported";
136
+ } & Readonly<A>;
137
+ /**
138
+ * The wired provider does not implement the requested capability for
139
+ * this specific request. Distinct from `SandboxInvalidRequest` (the
140
+ * request shape is malformed) and from compile-time capability
141
+ * markers (`SandboxSnapshots`, `SandboxSecretInjection`, …) which gate
142
+ * blanket provider-level gaps.
143
+ *
144
+ * Reserved for request-data-dependent gaps where the provider supports
145
+ * the method in general but not for these inputs — e.g. passing
146
+ * `hosts: [...]` to a CIDR-only allowlist provider, or passing
147
+ * `dockerfile: ...` to a provider whose `SandboxCustomImage` marker
148
+ * was provided but which only accepts a flat Dockerfile string.
149
+ */
150
+ declare class SandboxUnsupported extends SandboxUnsupported_base<{
151
+ provider: string;
152
+ capability: string;
153
+ reason?: string;
154
+ }> {}
155
+ type SandboxError = SandboxCreateFailed | SandboxNotFound | SandboxAlreadyExists | SandboxExecFailed | SandboxTimeout | SandboxNetworkPolicyDenied | SandboxQuotaExceeded | SandboxInvalidRequest | SandboxAuthFailed | SandboxUnsupported;
156
+ //#endregion
157
+ export { SandboxError as a, SandboxInvalidRequest as c, SandboxQuotaExceeded as d, SandboxTimeout as f, SandboxCreateFailed as i, SandboxNetworkPolicyDenied as l, SandboxAuthFailed as n, SandboxError_d_exports as o, SandboxUnsupported as p, SandboxAuthSubtype as r, SandboxExecFailed as s, SandboxAlreadyExists as t, SandboxNotFound as u };
158
+ //# sourceMappingURL=SandboxError-BvKypkJm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxError-BvKypkJm.d.mts","names":[],"sources":["../src/sandbox/SandboxError.ts"],"mappings":";;;;;;;;cAAuC,wBAAA;;;;;;;;;cAQ1B,mBAAA,SAA4B,wBAAA;EACvC,QAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,oBAAA;;;;AAZkC;;;;cAmB1B,eAAA,SAAwB,oBAAA;EACnC,QAAA;EACA,EAAA;AAAA;AAAA,cACG,yBAAA;;;;;;;;;cAQQ,oBAAA,SAA6B,yBAAA;EACxC,QAAA;EACA,EAAA;AAAA;AAAA,cACG,sBAAA;;;;;;;;AAzBL;cAiCa,iBAAA,SAA0B,sBAAA;EACrC,QAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,mBAAA;;;AAjCA;;;;AAAA,cAuCQ,cAAA,SAAuB,mBAAA;EAClC,QAAA;EACA,SAAA;EACA,MAAA,GAAS,QAAA,CAAS,QAAA;EAClB,GAAA;AAAA;AAAA,cACG,+BAAA;;;;;;;;;;;cAUQ,0BAAA,SAAmC,+BAAA;EAC9C,QAAA;EACA,IAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,yBAAA;;;;;;;;cAOQ,oBAAA,SAA6B,yBAAA;EACxC,QAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,cACG,0BAAA;;;;;;;;;;cASQ,qBAAA,SAA8B,0BAAA;EACzC,QAAA;EACA,KAAA;EACA,MAAA;EACA,GAAA;AAAA;;;;;KAOU,kBAAA;AAAA,cAAgE,sBAAA;;;cAE/D,iBAAA,SAA0B,sBAAA;EACrC,QAAA;EACA,OAAA,EAAS,kBAAA;EACT,GAAA;AAAA;AAAA,cACG,uBAAA;;;;;;AA3EA;;;;;;;;;;cA0FQ,kBAAA,SAA2B,uBAAA;EACtC,QAAA;EACA,UAAA;EACA,MAAA;AAAA;AAAA,KAGU,YAAA,GACR,mBAAA,GACA,eAAA,GACA,oBAAA,GACA,iBAAA,GACA,cAAA,GACA,0BAAA,GACA,oBAAA,GACA,qBAAA,GACA,iBAAA,GACA,kBAAA"}
@@ -1,11 +1,11 @@
1
- import { o as FunctionCall, s as FunctionCallOutput } from "./Items-BH8xUkoR.mjs";
1
+ import { v as ToolCall, y as ToolCallOutput } from "./Items-D8UaXQx_.mjs";
2
2
  import { Effect, Schema, Stream } from "effect";
3
3
  import * as _$effect_Cause0 from "effect/Cause";
4
4
  import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
5
5
 
6
6
  //#region src/tool/Tool.d.ts
7
7
  declare namespace Tool_d_exports {
8
- export { AnyKindTool, AnyPlainTool, AnyStreamingTool, StreamingTool, Tool, ToolDescriptor, ToolError, ToolInputSchema, execute, fromEffectSchema, fromStandardSchema, isStreamingTool, make, streaming, toDescriptors };
8
+ export { AnyPlainTool, AnyStreamingTool, AnyTool, StreamingTool, Tool, ToolDescriptor, ToolError, ToolInputSchema, execute, fromEffectSchema, fromStandardSchema, isStreamingTool, make, streaming, toDescriptors };
9
9
  }
10
10
  declare const ToolError_base: Schema.Class<ToolError, Schema.TaggedStruct<"ToolError", {
11
11
  readonly call_id: Schema.String;
@@ -62,7 +62,7 @@ type Tool<Name extends string, Input, Output, R = never> = {
62
62
  /**
63
63
  * Provider-agnostic tool descriptor. Each provider maps `inputSchema`
64
64
  * to its own wire field (OpenAI → `parameters`, Anthropic →
65
- * `input_schema`). Built from a `Tool` by `Toolkit.toDescriptors`.
65
+ * `input_schema`). Built from a `Tool` by `Tool.toDescriptors`.
66
66
  */
67
67
  type ToolDescriptor = {
68
68
  readonly name: string;
@@ -83,20 +83,20 @@ type StreamingTool<Name extends string, Input, Event, Output, R = never> = {
83
83
  declare const streaming: <Name extends string, Input, Event, Output, R = never>(spec: Omit<StreamingTool<Name, Input, Event, Output, R>, "_kind">) => StreamingTool<Name, Input, Event, Output, R>;
84
84
  type AnyStreamingTool<R = any> = StreamingTool<string, any, any, any, R>;
85
85
  type AnyPlainTool<R = any> = Tool<string, any, any, R>;
86
- type AnyKindTool<R = any> = AnyStreamingTool<R> | AnyPlainTool<R>;
87
- declare const isStreamingTool: <R>(t: AnyKindTool<R>) => t is AnyStreamingTool<R>;
86
+ type AnyTool<R = any> = AnyStreamingTool<R> | AnyPlainTool<R>;
87
+ declare const isStreamingTool: <R>(t: AnyTool<R>) => t is AnyStreamingTool<R>;
88
88
  /**
89
89
  * Render any-kind tools (mixed plain and streaming) to provider-agnostic
90
- * descriptors. Mirrors `Toolkit.toDescriptors` but accepts the union type
91
- * so a single list can carry both kinds.
90
+ * descriptors. Accepts the union type so a single list can carry both
91
+ * plain and streaming tools.
92
92
  */
93
- declare const toDescriptors: <R>(tools: ReadonlyArray<AnyKindTool<R>>) => ReadonlyArray<ToolDescriptor>;
93
+ declare const toDescriptors: <R>(tools: ReadonlyArray<AnyTool<R>>) => ReadonlyArray<ToolDescriptor>;
94
94
  /**
95
95
  * Decode and validate the JSON arguments of a function_call against the
96
96
  * tool's input schema, run the tool, and serialize the output into a
97
97
  * function_call_output item.
98
98
  */
99
- declare const execute: <Name extends string, Input, Output, R>(tool: Tool<Name, Input, Output, R>, call: FunctionCall) => Effect.Effect<FunctionCallOutput, ToolError, R>;
99
+ declare const execute: <Name extends string, Input, Output, R>(tool: Tool<Name, Input, Output, R>, call: ToolCall) => Effect.Effect<ToolCallOutput, ToolError, R>;
100
100
  //#endregion
101
- export { Tool as a, ToolInputSchema as c, fromEffectSchema as d, fromStandardSchema as f, toDescriptors as g, streaming as h, StreamingTool as i, Tool_d_exports as l, make as m, AnyPlainTool as n, ToolDescriptor as o, isStreamingTool as p, AnyStreamingTool as r, ToolError as s, AnyKindTool as t, execute as u };
102
- //# sourceMappingURL=Tool-87ViKCCO.d.mts.map
101
+ export { Tool as a, ToolInputSchema as c, fromEffectSchema as d, fromStandardSchema as f, toDescriptors as g, streaming as h, StreamingTool as i, Tool_d_exports as l, make as m, AnyStreamingTool as n, ToolDescriptor as o, isStreamingTool as p, AnyTool as r, ToolError as s, AnyPlainTool as t, execute as u };
102
+ //# sourceMappingURL=Tool-CiFXYjmR.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tool-87ViKCCO.d.mts","names":[],"sources":["../src/tool/Tool.ts"],"mappings":";;;;;;;;;cAE0E,cAAA;;;;;;cAG7D,SAAA,SAAkB,cAAA;;;;;;;;;;KAmBnB,eAAA,oBAAmC,gBAAA,UAA0B,KAAA,IACvE,oBAAA,UAA8B,KAAA;;;;AAvB0C;;cA8B7D,gBAAA,aAA8B,MAAA,CAAO,KAAA,wBAChD,MAAA,EAAQ,CAAA,KAC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AW,CAAA"}
@@ -0,0 +1,78 @@
1
+ import { Effect } from "effect";
2
+
3
+ //#region src/capabilities/Capabilities.d.ts
4
+ declare namespace Capabilities_d_exports {
5
+ export { CapabilityWarning, warnDropped, warnDroppedWhen };
6
+ }
7
+ /**
8
+ * Structured event emitted when a provider adapter drops a Common
9
+ * request field because its wire API has no place to put it (bucket 2
10
+ * per the capabilities policy: the provider has no structured
11
+ * interpretation; the output is still valid, just less aligned with
12
+ * the caller's hint).
13
+ *
14
+ * Carried on `Effect.logWarning` today for visibility; may be
15
+ * promoted to a typed `AiError` variant in the future if callers need
16
+ * to react programmatically. The shape itself is stable.
17
+ *
18
+ * @category capabilities
19
+ */
20
+ type CapabilityWarning = {
21
+ readonly _tag: "CapabilityWarning";
22
+ readonly provider: string; /** The capability name as it appears in docs (`"lyrics"`, `"bpm"`). */
23
+ readonly capability: string; /** The Common-request field name that was dropped. */
24
+ readonly field: string; /** The value the caller passed; included when useful for debugging. */
25
+ readonly value?: unknown; /** Human-readable explanation; should suggest a workaround. */
26
+ readonly reason: string;
27
+ };
28
+ /**
29
+ * Emit a structured `CapabilityWarning` via `Effect.logWarning`. Use
30
+ * when a provider adapter receives a Common-request field it has no
31
+ * structured wire field for, and would otherwise drop silently.
32
+ *
33
+ * Bucket-2 cases only (per the capabilities policy): the provider has
34
+ * no interpretation; the output is still valid, just less aligned
35
+ * with the caller's hint. For bucket-1 cases (structurally broken
36
+ * output if dropped, like wrong audio format), fail
37
+ * `AiError.Unsupported` instead.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * if (request.lyrics !== undefined) {
42
+ * yield* warnDropped({
43
+ * provider: "lyria",
44
+ * capability: "lyrics",
45
+ * field: "lyrics",
46
+ * reason: "Lyria 3 sync has no `lyrics` wire field. Embed in your prompt instead.",
47
+ * })
48
+ * }
49
+ * ```
50
+ */
51
+ declare const warnDropped: (warning: Omit<CapabilityWarning, "_tag">) => Effect.Effect<void>;
52
+ /**
53
+ * Shorthand for the most common shape: warn-and-drop when a specific
54
+ * field on the Common request is set. The field's value is included
55
+ * automatically.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * yield* Effect.all([
60
+ * warnDroppedWhen(request.lyrics, {
61
+ * provider: "lyria",
62
+ * capability: "lyrics",
63
+ * field: "lyrics",
64
+ * reason: "Lyria 3 sync has no `lyrics` wire field. Embed in your prompt instead.",
65
+ * }),
66
+ * warnDroppedWhen(request.duration, {
67
+ * provider: "lyria",
68
+ * capability: "duration",
69
+ * field: "duration",
70
+ * reason: "Lyria 3 clip is fixed at 30 s.",
71
+ * }),
72
+ * ], { discard: true })
73
+ * ```
74
+ */
75
+ declare const warnDroppedWhen: <T>(value: T | undefined, warning: Omit<CapabilityWarning, "_tag" | "value">) => Effect.Effect<void>;
76
+ //#endregion
77
+ export { CapabilityWarning, Capabilities_d_exports as t, warnDropped, warnDroppedWhen };
78
+ //# sourceMappingURL=Capabilities.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Capabilities.d.mts","names":[],"sources":["../../src/capabilities/Capabilities.ts"],"mappings":";;;;;;;;;;;;;;AAeA;;;;;KAAY,iBAAA;EAAA,SACD,IAAA;EAAA,SACA,QAAA,UAMA;EAAA,SAJA,UAAA,UAMM;EAAA,SAJN,KAAA,UA8BE;EAAA,SA5BF,KAAA;WAEA,MAAA;AAAA;;;;;;;;;;;AAoDX;;;;;;;;;;;;;cA1Ba,WAAA,GAAe,OAAA,EAAS,IAAA,CAAK,iBAAA,cAA6B,MAAA,CAAO,MAAA;;;;;;;;;;;;;;;;;;;;;;;;cA0BjE,eAAA,MACX,KAAA,EAAO,CAAA,cACP,OAAA,EAAS,IAAA,CAAK,iBAAA,wBACb,MAAA,CAAO,MAAA"}
@@ -0,0 +1,65 @@
1
+ import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
2
+ import { Effect } from "effect";
3
+ //#region src/capabilities/Capabilities.ts
4
+ var Capabilities_exports = /* @__PURE__ */ __exportAll({
5
+ warnDropped: () => warnDropped,
6
+ warnDroppedWhen: () => warnDroppedWhen
7
+ });
8
+ /**
9
+ * Emit a structured `CapabilityWarning` via `Effect.logWarning`. Use
10
+ * when a provider adapter receives a Common-request field it has no
11
+ * structured wire field for, and would otherwise drop silently.
12
+ *
13
+ * Bucket-2 cases only (per the capabilities policy): the provider has
14
+ * no interpretation; the output is still valid, just less aligned
15
+ * with the caller's hint. For bucket-1 cases (structurally broken
16
+ * output if dropped, like wrong audio format), fail
17
+ * `AiError.Unsupported` instead.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * if (request.lyrics !== undefined) {
22
+ * yield* warnDropped({
23
+ * provider: "lyria",
24
+ * capability: "lyrics",
25
+ * field: "lyrics",
26
+ * reason: "Lyria 3 sync has no `lyrics` wire field. Embed in your prompt instead.",
27
+ * })
28
+ * }
29
+ * ```
30
+ */
31
+ const warnDropped = (warning) => Effect.logWarning("Capability dropped", {
32
+ ...warning,
33
+ _tag: "CapabilityWarning"
34
+ });
35
+ /**
36
+ * Shorthand for the most common shape: warn-and-drop when a specific
37
+ * field on the Common request is set. The field's value is included
38
+ * automatically.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * yield* Effect.all([
43
+ * warnDroppedWhen(request.lyrics, {
44
+ * provider: "lyria",
45
+ * capability: "lyrics",
46
+ * field: "lyrics",
47
+ * reason: "Lyria 3 sync has no `lyrics` wire field. Embed in your prompt instead.",
48
+ * }),
49
+ * warnDroppedWhen(request.duration, {
50
+ * provider: "lyria",
51
+ * capability: "duration",
52
+ * field: "duration",
53
+ * reason: "Lyria 3 clip is fixed at 30 s.",
54
+ * }),
55
+ * ], { discard: true })
56
+ * ```
57
+ */
58
+ const warnDroppedWhen = (value, warning) => value === void 0 ? Effect.void : warnDropped({
59
+ ...warning,
60
+ value
61
+ });
62
+ //#endregion
63
+ export { Capabilities_exports as t, warnDropped, warnDroppedWhen };
64
+
65
+ //# sourceMappingURL=Capabilities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Capabilities.mjs","names":[],"sources":["../../src/capabilities/Capabilities.ts"],"sourcesContent":["import { Effect } from \"effect\"\n\n/**\n * Structured event emitted when a provider adapter drops a Common\n * request field because its wire API has no place to put it (bucket 2\n * per the capabilities policy: the provider has no structured\n * interpretation; the output is still valid, just less aligned with\n * the caller's hint).\n *\n * Carried on `Effect.logWarning` today for visibility; may be\n * promoted to a typed `AiError` variant in the future if callers need\n * to react programmatically. The shape itself is stable.\n *\n * @category capabilities\n */\nexport type CapabilityWarning = {\n readonly _tag: \"CapabilityWarning\"\n readonly provider: string\n /** The capability name as it appears in docs (`\"lyrics\"`, `\"bpm\"`). */\n readonly capability: string\n /** The Common-request field name that was dropped. */\n readonly field: string\n /** The value the caller passed; included when useful for debugging. */\n readonly value?: unknown\n /** Human-readable explanation; should suggest a workaround. */\n readonly reason: string\n}\n\n/**\n * Emit a structured `CapabilityWarning` via `Effect.logWarning`. Use\n * when a provider adapter receives a Common-request field it has no\n * structured wire field for, and would otherwise drop silently.\n *\n * Bucket-2 cases only (per the capabilities policy): the provider has\n * no interpretation; the output is still valid, just less aligned\n * with the caller's hint. For bucket-1 cases (structurally broken\n * output if dropped, like wrong audio format), fail\n * `AiError.Unsupported` instead.\n *\n * @example\n * ```ts\n * if (request.lyrics !== undefined) {\n * yield* warnDropped({\n * provider: \"lyria\",\n * capability: \"lyrics\",\n * field: \"lyrics\",\n * reason: \"Lyria 3 sync has no `lyrics` wire field. Embed in your prompt instead.\",\n * })\n * }\n * ```\n */\nexport const warnDropped = (warning: Omit<CapabilityWarning, \"_tag\">): Effect.Effect<void> =>\n Effect.logWarning(\"Capability dropped\", { ...warning, _tag: \"CapabilityWarning\" })\n\n/**\n * Shorthand for the most common shape: warn-and-drop when a specific\n * field on the Common request is set. The field's value is included\n * automatically.\n *\n * @example\n * ```ts\n * yield* Effect.all([\n * warnDroppedWhen(request.lyrics, {\n * provider: \"lyria\",\n * capability: \"lyrics\",\n * field: \"lyrics\",\n * reason: \"Lyria 3 sync has no `lyrics` wire field. Embed in your prompt instead.\",\n * }),\n * warnDroppedWhen(request.duration, {\n * provider: \"lyria\",\n * capability: \"duration\",\n * field: \"duration\",\n * reason: \"Lyria 3 clip is fixed at 30 s.\",\n * }),\n * ], { discard: true })\n * ```\n */\nexport const warnDroppedWhen = <T>(\n value: T | undefined,\n warning: Omit<CapabilityWarning, \"_tag\" | \"value\">,\n): Effect.Effect<void> => (value === undefined ? Effect.void : warnDropped({ ...warning, value }))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,eAAe,YAC1B,OAAO,WAAW,sBAAsB;CAAE,GAAG;CAAS,MAAM;CAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAyBpF,MAAa,mBACX,OACA,YACyB,UAAU,KAAA,IAAY,OAAO,OAAO,YAAY;CAAE,GAAG;CAAS;CAAO,CAAC"}
@@ -1,2 +1,2 @@
1
- import { a as AudioSource, c as isAudioBytes, i as AudioMimeType, l as isAudioUrl, n as AudioChunk, r as AudioFormat, s as isAudioBase64, t as AudioBlob } from "../Audio-BfCTGnH3.mjs";
1
+ import { a as AudioSource, c as isAudioBytes, i as AudioMimeType, l as isAudioUrl, n as AudioChunk, r as AudioFormat, s as isAudioBase64, t as AudioBlob } from "../Audio-DPlTsNdz.mjs";
2
2
  export { AudioBlob, AudioChunk, AudioFormat, AudioMimeType, AudioSource, isAudioBase64, isAudioBytes, isAudioUrl };
@@ -1 +1 @@
1
- {"version":3,"file":"Audio.mjs","names":[],"sources":["../../src/domain/Audio.ts"],"sourcesContent":["import type { MediaBase64, MediaBytes, MediaUrl } from \"./Media.js\"\n\n/**\n * MIME types we care about across STT input and TTS output. Container-\n * level only — sample rate / encoding flavours live on `AudioFormat`.\n *\n * Per-provider request types narrow this further. The `(string & {})`\n * tail keeps autocomplete on the literals while still accepting any\n * string, so unusual formats work without an SDK update.\n */\nexport type AudioMimeType =\n | \"audio/mpeg\"\n | \"audio/wav\"\n | \"audio/x-wav\"\n | \"audio/ogg\"\n | \"audio/opus\"\n | \"audio/flac\"\n | \"audio/aac\"\n | \"audio/mp4\"\n | \"audio/webm\"\n | \"audio/L16\"\n | \"audio/pcm\"\n | \"audio/mulaw\"\n | \"audio/alaw\"\n // eslint-disable-next-line @typescript-eslint/ban-types\n | (string & {})\n\n/**\n * Audio at rest — instantiates `MediaSource` with the audio MIME union.\n * Used for sync STT input.\n *\n * URL variant is best-effort: some providers (OpenAI, Cartesia, Azure\n * short-audio) reject URL ingestion and the adapter must upload via the\n * `bytes` or `base64` variant instead. Adapter layers reject unsupported\n * shapes up front with `AiError.InvalidRequest`.\n */\nexport type AudioSource =\n | MediaUrl<AudioMimeType>\n | MediaBase64<AudioMimeType>\n | MediaBytes<AudioMimeType>\n\nexport const isAudioUrl = (s: AudioSource): s is MediaUrl<AudioMimeType> => s._tag === \"url\"\nexport const isAudioBase64 = (s: AudioSource): s is MediaBase64<AudioMimeType> =>\n s._tag === \"base64\"\nexport const isAudioBytes = (s: AudioSource): s is MediaBytes<AudioMimeType> => s._tag === \"bytes\"\n\n/**\n * Structural audio format. Used both as TTS output spec and as STT\n * streaming-input declaration. Providers that use compound slugs\n * (`mp3_44100_128`, `audio-16khz-128kbitrate-mono-mp3`,\n * `aura-2-thalia-en`) are encoded at the adapter layer.\n */\nexport type AudioFormat = {\n readonly container: \"mp3\" | \"wav\" | \"ogg\" | \"opus\" | \"flac\" | \"aac\" | \"webm\" | \"raw\"\n readonly encoding:\n | \"pcm_s16le\"\n | \"pcm_f32le\"\n | \"pcm_mulaw\"\n | \"pcm_alaw\"\n | \"mp3\"\n | \"opus\"\n | \"vorbis\"\n | \"flac\"\n | \"aac\"\n readonly sampleRate: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000\n /** mp3 / opus only. */\n readonly bitRate?: number\n readonly channels?: 1 | 2\n}\n\n/**\n * Streamed audio chunk. `bytes` carries the codec-encoded payload as\n * declared on the stream's `AudioFormat`. No per-chunk timestamp here —\n * providers that emit timing do so via `TranscriptEvent.words[]`.\n */\nexport type AudioChunk = {\n readonly bytes: Uint8Array\n}\n\n/**\n * Full audio result for sync TTS. Format mirrors the request; provider\n * layers normalize.\n */\nexport type AudioBlob = {\n readonly format: AudioFormat\n readonly bytes: Uint8Array\n readonly durationSeconds?: number\n}\n"],"mappings":";;;;;;;AAyCA,MAAa,cAAc,MAAiD,EAAE,SAAS;AACvF,MAAa,iBAAiB,MAC5B,EAAE,SAAS;AACb,MAAa,gBAAgB,MAAmD,EAAE,SAAS"}
1
+ {"version":3,"file":"Audio.mjs","names":[],"sources":["../../src/domain/Audio.ts"],"sourcesContent":["import type { Duration } from \"effect\"\nimport type { MediaBase64, MediaBytes, MediaUrl } from \"./Media.js\"\n\n/**\n * MIME types we care about across STT input and TTS output. Container-\n * level only — sample rate / encoding flavours live on `AudioFormat`.\n *\n * Per-provider request types narrow this further. The `(string & {})`\n * tail keeps autocomplete on the literals while still accepting any\n * string, so unusual formats work without an SDK update.\n */\nexport type AudioMimeType =\n | \"audio/mpeg\"\n | \"audio/wav\"\n | \"audio/x-wav\"\n | \"audio/ogg\"\n | \"audio/opus\"\n | \"audio/flac\"\n | \"audio/aac\"\n | \"audio/mp4\"\n | \"audio/webm\"\n | \"audio/L16\"\n | \"audio/pcm\"\n | \"audio/mulaw\"\n | \"audio/alaw\"\n // eslint-disable-next-line @typescript-eslint/ban-types\n | (string & {})\n\n/**\n * Audio at rest — instantiates `MediaSource` with the audio MIME union.\n * Used for sync STT input.\n *\n * URL variant is best-effort: some providers (OpenAI, Cartesia, Azure\n * short-audio) reject URL ingestion and the adapter must upload via the\n * `bytes` or `base64` variant instead. Adapter layers reject unsupported\n * shapes up front with `AiError.InvalidRequest`.\n */\nexport type AudioSource =\n | MediaUrl<AudioMimeType>\n | MediaBase64<AudioMimeType>\n | MediaBytes<AudioMimeType>\n\nexport const isAudioUrl = (s: AudioSource): s is MediaUrl<AudioMimeType> => s._tag === \"url\"\nexport const isAudioBase64 = (s: AudioSource): s is MediaBase64<AudioMimeType> =>\n s._tag === \"base64\"\nexport const isAudioBytes = (s: AudioSource): s is MediaBytes<AudioMimeType> => s._tag === \"bytes\"\n\n/**\n * Structural audio format. Used both as TTS output spec and as STT\n * streaming-input declaration. Providers that use compound slugs\n * (`mp3_44100_128`, `audio-16khz-128kbitrate-mono-mp3`,\n * `aura-2-thalia-en`) are encoded at the adapter layer.\n */\nexport type AudioFormat = {\n readonly container: \"mp3\" | \"wav\" | \"ogg\" | \"opus\" | \"flac\" | \"aac\" | \"webm\" | \"raw\"\n readonly encoding:\n | \"pcm_s16le\"\n | \"pcm_f32le\"\n | \"pcm_mulaw\"\n | \"pcm_alaw\"\n | \"mp3\"\n | \"opus\"\n | \"vorbis\"\n | \"flac\"\n | \"aac\"\n readonly sampleRate: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000\n /** mp3 / opus only. */\n readonly bitRate?: number\n readonly channels?: 1 | 2\n}\n\n/**\n * Streamed audio chunk. `bytes` carries the codec-encoded payload as\n * declared on the stream's `AudioFormat`. No per-chunk timestamp here —\n * providers that emit timing do so via `TranscriptEvent.words[]`.\n */\nexport type AudioChunk = {\n readonly bytes: Uint8Array\n}\n\n/**\n * Full audio result for sync TTS. Format mirrors the request; provider\n * layers normalize.\n */\nexport type AudioBlob = {\n readonly format: AudioFormat\n readonly bytes: Uint8Array\n readonly duration?: Duration.Duration\n}\n"],"mappings":";;;;;;;AA0CA,MAAa,cAAc,MAAiD,EAAE,SAAS;AACvF,MAAa,iBAAiB,MAC5B,EAAE,SAAS;AACb,MAAa,gBAAgB,MAAmD,EAAE,SAAS"}
@@ -1,2 +1,2 @@
1
- import { A as isInputText, C as functionCallOutput, D as isFunctionCall, E as isFilePath, F as isUrlCitation, I as systemText, L as userText, M as isOutputText, N as isReasoning, O as isFunctionCallOutput, P as isRefusal, S as assistantText, T as isFileCitation, _ as Refusal, a as FilePath, b as UrlCitation, c as InputImage, d as Item, g as Reasoning, h as OutputTokensDetails, i as FileCitation, j as isMessage, k as isInputImage, l as InputText, m as OutputText, n as ContainerFileCitation, o as FunctionCall, p as Message, r as ContentBlock, s as FunctionCallOutput, t as Annotation, u as InputTokensDetails, v as Role, w as isContainerFileCitation, x as Usage, y as StopReason } from "../Items-BH8xUkoR.mjs";
2
- export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput, InputImage, InputText, InputTokensDetails, Item, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, UrlCitation, Usage, assistantText, functionCallOutput, isContainerFileCitation, isFileCitation, isFilePath, isFunctionCall, isFunctionCallOutput, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isUrlCitation, systemText, userText };
1
+ import { A as isReasoning, C as isContainerFileCitation, D as isInputText, E as isInputImage, F as systemText, I as toolCallOutput, L as userText, M as isToolCall, N as isToolCallOutput, O as isMessage, P as isUrlCitation, S as assistantText, T as isFilePath, _ as StopReason, a as FilePath, b as UrlCitation, c as InputText, d as Message, f as OutputText, g as Role, h as Refusal, i as FileCitation, j as isRefusal, k as isOutputText, l as InputTokensDetails, m as Reasoning, n as ContainerFileCitation, o as HistoryItem, p as OutputTokensDetails, r as ContentBlock, s as InputImage, t as Annotation, v as ToolCall, w as isFileCitation, x as Usage, y as ToolCallOutput } from "../Items-D8UaXQx_.mjs";
2
+ export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, HistoryItem, InputImage, InputText, InputTokensDetails, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, ToolCall, ToolCallOutput, UrlCitation, Usage, assistantText, isContainerFileCitation, isFileCitation, isFilePath, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isToolCall, isToolCallOutput, isUrlCitation, systemText, toolCallOutput, userText };