@opencode/ai 2.1.3 → 2.1.4

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 (106) hide show
  1. package/dist/experimental/evaluation.js +3 -10
  2. package/dist/image-client.d.ts +8 -8
  3. package/dist/image.d.ts +148 -148
  4. package/dist/promise.d.ts +120 -120
  5. package/dist/protocols/alibaba-chat.d.ts +12 -12
  6. package/dist/protocols/alibaba-messages.d.ts +11 -11
  7. package/dist/protocols/alibaba-responses.d.ts +35 -35
  8. package/dist/protocols/anthropic-messages.d.ts +40 -44
  9. package/dist/protocols/anthropic-messages.js +3 -3
  10. package/dist/protocols/bedrock-converse.d.ts +30 -32
  11. package/dist/protocols/bedrock-converse.js +2 -3
  12. package/dist/protocols/cartesia-speech.d.ts +32 -32
  13. package/dist/protocols/cohere-chat.d.ts +7 -8
  14. package/dist/protocols/deepgram-speech.d.ts +32 -32
  15. package/dist/protocols/elevenlabs-speech.d.ts +32 -32
  16. package/dist/protocols/gemini.d.ts +34 -34
  17. package/dist/protocols/gemini.js +2 -2
  18. package/dist/protocols/google-interactions.d.ts +14 -14
  19. package/dist/protocols/google-interactions.js +2 -2
  20. package/dist/protocols/google-speech.d.ts +32 -32
  21. package/dist/protocols/google-transcription.d.ts +32 -32
  22. package/dist/protocols/meta-messages.d.ts +23 -23
  23. package/dist/protocols/meta-responses.d.ts +78 -78
  24. package/dist/protocols/mistral-chat.d.ts +81 -78
  25. package/dist/protocols/mistral-chat.js +2 -1
  26. package/dist/protocols/open-responses-channel.js +47 -46
  27. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  28. package/dist/protocols/open-responses-continuation.js +3 -1
  29. package/dist/protocols/open-responses.d.ts +398 -398
  30. package/dist/protocols/open-responses.js +8 -7
  31. package/dist/protocols/openai-chat.d.ts +60 -60
  32. package/dist/protocols/openai-chat.js +3 -3
  33. package/dist/protocols/openai-compatible-chat.d.ts +13 -14
  34. package/dist/protocols/openai-compatible-responses.d.ts +36 -37
  35. package/dist/protocols/openai-images.d.ts +32 -32
  36. package/dist/protocols/openai-responses.d.ts +235 -235
  37. package/dist/protocols/openai-responses.js +1 -1
  38. package/dist/protocols/openai-speech.d.ts +32 -32
  39. package/dist/protocols/openai-transcription.d.ts +32 -32
  40. package/dist/protocols/openai-transcription.js +12 -7
  41. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  42. package/dist/protocols/utils/partial-json-options.js +0 -1
  43. package/dist/protocols/utils/tool-stream.d.ts +1 -1
  44. package/dist/protocols/venice-chat.d.ts +52 -53
  45. package/dist/protocols/venice-chat.js +6 -5
  46. package/dist/protocols/xai-responses.d.ts +78 -78
  47. package/dist/protocols/zai-chat.d.ts +33 -30
  48. package/dist/protocols/zai-chat.js +8 -3
  49. package/dist/protocols/zai-messages.d.ts +21 -19
  50. package/dist/protocols/zai-messages.js +3 -2
  51. package/dist/provider-error.js +5 -3
  52. package/dist/providers/alibaba.d.ts +69 -69
  53. package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
  54. package/dist/providers/amazon-bedrock.d.ts +15 -15
  55. package/dist/providers/anthropic-compatible.d.ts +13 -13
  56. package/dist/providers/anthropic.d.ts +13 -13
  57. package/dist/providers/azure.d.ts +106 -106
  58. package/dist/providers/baseten.d.ts +24 -24
  59. package/dist/providers/cerebras.d.ts +24 -24
  60. package/dist/providers/cloudflare-ai-gateway.d.ts +230 -227
  61. package/dist/providers/cloudflare-ai-gateway.js +1 -2
  62. package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
  63. package/dist/providers/cohere.d.ts +75 -75
  64. package/dist/providers/deepinfra.d.ts +24 -24
  65. package/dist/providers/deepseek.d.ts +24 -24
  66. package/dist/providers/digitalocean.d.ts +36 -36
  67. package/dist/providers/fireworks.d.ts +24 -24
  68. package/dist/providers/google-vertex-chat.d.ts +12 -12
  69. package/dist/providers/google-vertex-messages.d.ts +13 -13
  70. package/dist/providers/google-vertex-mistral.d.ts +17 -17
  71. package/dist/providers/google-vertex-responses.d.ts +35 -35
  72. package/dist/providers/google-vertex.d.ts +17 -17
  73. package/dist/providers/google-vertex.js +2 -2
  74. package/dist/providers/google.d.ts +17 -17
  75. package/dist/providers/groq.d.ts +24 -24
  76. package/dist/providers/meta.d.ts +179 -179
  77. package/dist/providers/minimax.d.ts +71 -71
  78. package/dist/providers/mistral.d.ts +28 -28
  79. package/dist/providers/moonshot.d.ts +202 -202
  80. package/dist/providers/open-responses-options.d.ts +0 -1
  81. package/dist/providers/open-responses-options.js +1 -1
  82. package/dist/providers/openai-compatible-responses.d.ts +35 -35
  83. package/dist/providers/openai-compatible.d.ts +12 -12
  84. package/dist/providers/openai-compatible.js +1 -1
  85. package/dist/providers/openai-options.d.ts +0 -1
  86. package/dist/providers/openai-options.js +0 -1
  87. package/dist/providers/openai.d.ts +100 -100
  88. package/dist/providers/openrouter.d.ts +36 -36
  89. package/dist/providers/togetherai.d.ts +24 -24
  90. package/dist/providers/venice.d.ts +195 -20
  91. package/dist/providers/xai.d.ts +12 -12
  92. package/dist/providers/zai-coding-plan.d.ts +149 -69
  93. package/dist/providers/zai.d.ts +84 -19
  94. package/dist/route/auth-options.d.ts +0 -3
  95. package/dist/route/auth.d.ts +0 -2
  96. package/dist/route/auth.js +0 -2
  97. package/dist/route/client.d.ts +0 -2
  98. package/dist/route/client.js +3 -4
  99. package/dist/route/executor-service.js +1 -1
  100. package/dist/speech-client.d.ts +8 -8
  101. package/dist/speech.d.ts +148 -148
  102. package/dist/transcription-client.d.ts +8 -8
  103. package/dist/transcription.d.ts +148 -148
  104. package/dist/video-client.d.ts +8 -8
  105. package/dist/video.d.ts +114 -114
  106. package/package.json +6 -5
@@ -10,7 +10,6 @@ export declare const DEFAULT_BASE_URL = "https://api.anthropic.com/v1";
10
10
  export declare const PATH = "/messages";
11
11
  export declare const DEFAULT_MAX_TOKENS = 32000;
12
12
  export declare const framing: Framing.Definition<string>;
13
- export type ThinkingBlockBinding = typeof AnthropicThinkingBlockBinding.Type;
14
13
  export type ThinkingInput = typeof Thinking.Encoded;
15
14
  /** Caller-facing provider options; unknown keys are accepted and ignored. `Options.Type` is the wire-ready form. */
16
15
  export type OptionsInput = ProviderOptions & typeof Options.Encoded;
@@ -27,9 +26,6 @@ export declare const ContextManagement: Schema.Struct<{
27
26
  }>>;
28
27
  }>;
29
28
  export type ContextManagement = typeof ContextManagement.Type;
30
- declare const AnthropicThinkingBlockBinding: Schema.Struct<{
31
- readonly prefix_mismatch_behavior: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"drop_block" | "error">, import("../schema/options.js").OpenString<"drop_block" | "error">>>;
32
- }>;
33
29
  declare const Thinking: Schema.Union<readonly [Schema.decodeTo<Schema.Struct<{
34
30
  readonly display: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"omitted" | "summarized">, import("../schema/options.js").OpenString<"omitted" | "summarized">>>;
35
31
  readonly block_binding: Schema.optional<Schema.Struct<{
@@ -553,12 +549,30 @@ export declare const protocol: Protocol<{
553
549
  } | {
554
550
  readonly role: "assistant";
555
551
  readonly content: readonly ({
552
+ readonly type: "compaction";
553
+ readonly content: string | null;
554
+ } | {
556
555
  readonly type: "text";
557
556
  readonly text: string;
558
557
  readonly cache_control?: {
559
558
  readonly type: "ephemeral";
560
559
  readonly ttl?: "1h" | "5m" | undefined;
561
560
  } | undefined;
561
+ } | {
562
+ readonly type: "thinking";
563
+ readonly thinking: string;
564
+ readonly signature: string;
565
+ readonly cache_control?: {
566
+ readonly type: "ephemeral";
567
+ readonly ttl?: "1h" | "5m" | undefined;
568
+ } | undefined;
569
+ } | {
570
+ readonly type: "redacted_thinking";
571
+ readonly data: string;
572
+ readonly cache_control?: {
573
+ readonly type: "ephemeral";
574
+ readonly ttl?: "1h" | "5m" | undefined;
575
+ } | undefined;
562
576
  } | {
563
577
  readonly type: "tool_use";
564
578
  readonly id: string;
@@ -585,24 +599,6 @@ export declare const protocol: Protocol<{
585
599
  readonly type: "ephemeral";
586
600
  readonly ttl?: "1h" | "5m" | undefined;
587
601
  } | undefined;
588
- } | {
589
- readonly type: "compaction";
590
- readonly content: string | null;
591
- } | {
592
- readonly type: "thinking";
593
- readonly thinking: string;
594
- readonly signature: string;
595
- readonly cache_control?: {
596
- readonly type: "ephemeral";
597
- readonly ttl?: "1h" | "5m" | undefined;
598
- } | undefined;
599
- } | {
600
- readonly type: "redacted_thinking";
601
- readonly data: string;
602
- readonly cache_control?: {
603
- readonly type: "ephemeral";
604
- readonly ttl?: "1h" | "5m" | undefined;
605
- } | undefined;
606
602
  })[];
607
603
  } | {
608
604
  readonly role: "system";
@@ -644,6 +640,8 @@ export declare const protocol: Protocol<{
644
640
  readonly top_k?: number | undefined;
645
641
  readonly stop_sequences?: readonly string[] | undefined;
646
642
  readonly thinking?: {
643
+ readonly type: "between_tools" | "disabled";
644
+ } | {
647
645
  readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
648
646
  readonly block_binding?: {
649
647
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
@@ -656,8 +654,6 @@ export declare const protocol: Protocol<{
656
654
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
657
655
  } | undefined;
658
656
  readonly type: "adaptive";
659
- } | {
660
- readonly type: "between_tools" | "disabled";
661
657
  } | undefined;
662
658
  readonly output_config?: {
663
659
  readonly effort?: string | undefined;
@@ -913,12 +909,30 @@ export declare const route: Route<{
913
909
  } | {
914
910
  readonly role: "assistant";
915
911
  readonly content: readonly ({
912
+ readonly type: "compaction";
913
+ readonly content: string | null;
914
+ } | {
916
915
  readonly type: "text";
917
916
  readonly text: string;
918
917
  readonly cache_control?: {
919
918
  readonly type: "ephemeral";
920
919
  readonly ttl?: "1h" | "5m" | undefined;
921
920
  } | undefined;
921
+ } | {
922
+ readonly type: "thinking";
923
+ readonly thinking: string;
924
+ readonly signature: string;
925
+ readonly cache_control?: {
926
+ readonly type: "ephemeral";
927
+ readonly ttl?: "1h" | "5m" | undefined;
928
+ } | undefined;
929
+ } | {
930
+ readonly type: "redacted_thinking";
931
+ readonly data: string;
932
+ readonly cache_control?: {
933
+ readonly type: "ephemeral";
934
+ readonly ttl?: "1h" | "5m" | undefined;
935
+ } | undefined;
922
936
  } | {
923
937
  readonly type: "tool_use";
924
938
  readonly id: string;
@@ -945,24 +959,6 @@ export declare const route: Route<{
945
959
  readonly type: "ephemeral";
946
960
  readonly ttl?: "1h" | "5m" | undefined;
947
961
  } | undefined;
948
- } | {
949
- readonly type: "compaction";
950
- readonly content: string | null;
951
- } | {
952
- readonly type: "thinking";
953
- readonly thinking: string;
954
- readonly signature: string;
955
- readonly cache_control?: {
956
- readonly type: "ephemeral";
957
- readonly ttl?: "1h" | "5m" | undefined;
958
- } | undefined;
959
- } | {
960
- readonly type: "redacted_thinking";
961
- readonly data: string;
962
- readonly cache_control?: {
963
- readonly type: "ephemeral";
964
- readonly ttl?: "1h" | "5m" | undefined;
965
- } | undefined;
966
962
  })[];
967
963
  } | {
968
964
  readonly role: "system";
@@ -1004,6 +1000,8 @@ export declare const route: Route<{
1004
1000
  readonly top_k?: number | undefined;
1005
1001
  readonly stop_sequences?: readonly string[] | undefined;
1006
1002
  readonly thinking?: {
1003
+ readonly type: "between_tools" | "disabled";
1004
+ } | {
1007
1005
  readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
1008
1006
  readonly block_binding?: {
1009
1007
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
@@ -1016,8 +1014,6 @@ export declare const route: Route<{
1016
1014
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
1017
1015
  } | undefined;
1018
1016
  readonly type: "adaptive";
1019
- } | {
1020
- readonly type: "between_tools" | "disabled";
1021
1017
  } | undefined;
1022
1018
  readonly output_config?: {
1023
1019
  readonly effort?: string | undefined;
@@ -678,7 +678,7 @@ const requireThinkingSignature = (request) => {
678
678
  };
679
679
  // Opus 4.8 and every Claude 5 model accept mid-conversation system messages; later versions inherit support.
680
680
  const supportsNativeSystemUpdates = (request) => {
681
- const version = claudeVersion(String(request.model.id));
681
+ const version = claudeVersion(request.model.id);
682
682
  if (version === undefined)
683
683
  return false;
684
684
  if (version.family === "opus" && version.major === 4)
@@ -723,7 +723,7 @@ const appendToUserTurn = (messages, block) => {
723
723
  };
724
724
  const lowerMessages = Effect.fnUntraced(function* (request, breakpoints) {
725
725
  const messages = [];
726
- const providerMetadataKey = request.model.route.providerMetadataKey ?? String(request.model.provider);
726
+ const providerMetadataKey = request.model.route.providerMetadataKey ?? request.model.provider;
727
727
  // Text updates stay where they are unless a user turn follows them; then they move after the latest
728
728
  // user turn, the nearest spot where Anthropic accepts a native system message.
729
729
  const holdUpdates = supportsNativeSystemUpdates(request);
@@ -1385,7 +1385,7 @@ export const protocol = Protocol.make({
1385
1385
  initial: (request) => ({
1386
1386
  provider: request.model.provider,
1387
1387
  compactions: {},
1388
- providerMetadataKey: request.model.route.providerMetadataKey ?? String(request.model.provider),
1388
+ providerMetadataKey: request.model.route.providerMetadataKey ?? request.model.provider,
1389
1389
  tools: ToolStream.empty(),
1390
1390
  reasoningSignatures: {},
1391
1391
  lifecycle: Lifecycle.initial(),
@@ -2,7 +2,6 @@ import { Schema } from "effect";
2
2
  import { Route } from "../route/client.js";
3
3
  import { Protocol } from "../route/protocol.js";
4
4
  import { Usage, type FinishReasonDetails } from "../schema/index.js";
5
- import { BedrockAuth } from "./utils/bedrock-auth.js";
6
5
  import { Lifecycle } from "./utils/lifecycle.js";
7
6
  import { ToolStream } from "./utils/tool-stream.js";
8
7
  export type { Credentials as BedrockCredentials } from "./utils/bedrock-auth.js";
@@ -146,6 +145,21 @@ export declare const protocol: Protocol<{
146
145
  readonly type: "default";
147
146
  readonly ttl?: "1h" | "5m" | undefined;
148
147
  };
148
+ } | {
149
+ readonly image: {
150
+ readonly format: "gif" | "jpeg" | "png" | "webp";
151
+ readonly source: {
152
+ readonly bytes: string;
153
+ };
154
+ };
155
+ } | {
156
+ readonly document: {
157
+ readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
158
+ readonly name: string;
159
+ readonly source: {
160
+ readonly bytes: string;
161
+ };
162
+ };
149
163
  } | {
150
164
  readonly text: string;
151
165
  } | {
@@ -173,21 +187,6 @@ export declare const protocol: Protocol<{
173
187
  })[];
174
188
  readonly status?: "error" | "success" | undefined;
175
189
  };
176
- } | {
177
- readonly image: {
178
- readonly format: "gif" | "jpeg" | "png" | "webp";
179
- readonly source: {
180
- readonly bytes: string;
181
- };
182
- };
183
- } | {
184
- readonly document: {
185
- readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
186
- readonly name: string;
187
- readonly source: {
188
- readonly bytes: string;
189
- };
190
- };
191
190
  })[];
192
191
  } | {
193
192
  readonly role: "assistant";
@@ -334,6 +333,21 @@ export declare const route: Route<{
334
333
  readonly type: "default";
335
334
  readonly ttl?: "1h" | "5m" | undefined;
336
335
  };
336
+ } | {
337
+ readonly image: {
338
+ readonly format: "gif" | "jpeg" | "png" | "webp";
339
+ readonly source: {
340
+ readonly bytes: string;
341
+ };
342
+ };
343
+ } | {
344
+ readonly document: {
345
+ readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
346
+ readonly name: string;
347
+ readonly source: {
348
+ readonly bytes: string;
349
+ };
350
+ };
337
351
  } | {
338
352
  readonly text: string;
339
353
  } | {
@@ -361,21 +375,6 @@ export declare const route: Route<{
361
375
  })[];
362
376
  readonly status?: "error" | "success" | undefined;
363
377
  };
364
- } | {
365
- readonly image: {
366
- readonly format: "gif" | "jpeg" | "png" | "webp";
367
- readonly source: {
368
- readonly bytes: string;
369
- };
370
- };
371
- } | {
372
- readonly document: {
373
- readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
374
- readonly name: string;
375
- readonly source: {
376
- readonly bytes: string;
377
- };
378
- };
379
378
  })[];
380
379
  } | {
381
380
  readonly role: "assistant";
@@ -451,5 +450,4 @@ export declare const route: Route<{
451
450
  readonly [x: string]: unknown;
452
451
  readonly rawBody: string;
453
452
  }>, import("../route/client.js").CompactionOperations | undefined>;
454
- export declare const sigV4Auth: typeof BedrockAuth.sigV4;
455
453
  export * as BedrockConverse from "./bedrock-converse.js";
@@ -244,7 +244,7 @@ const lowerMessages = Effect.fnUntraced(function* (request, breakpoints) {
244
244
  const documentNames = new Set();
245
245
  // Mistral can reject replay IDs even when they satisfy Converse's broader ID syntax.
246
246
  const normalizeID = request.model.id.includes("mistral.") ? MistralToolID.normalizer(request) : (id) => id;
247
- const providerMetadataKey = request.model.route.providerMetadataKey ?? String(request.model.provider);
247
+ const providerMetadataKey = request.model.route.providerMetadataKey ?? request.model.provider;
248
248
  const hoistImages = !keepToolImagesInline(request.model.id);
249
249
  // Bedrock expects parallel tool results before any images hoisted beside them.
250
250
  const pendingImages = [];
@@ -693,7 +693,7 @@ export const protocol = Protocol.make({
693
693
  stream: {
694
694
  event: BedrockEventStream.Frame.pipe(Schema.decodeTo(BedrockEvent)),
695
695
  initial: (request) => ({
696
- providerMetadataKey: request.model.route.providerMetadataKey ?? String(request.model.provider),
696
+ providerMetadataKey: request.model.route.providerMetadataKey ?? request.model.provider,
697
697
  tools: ToolStream.empty(),
698
698
  finishReason: undefined,
699
699
  usage: undefined,
@@ -718,5 +718,4 @@ export const route = Route.make({
718
718
  auth: BedrockAuth.auth,
719
719
  framing,
720
720
  });
721
- export const sigV4Auth = BedrockAuth.sigV4;
722
721
  export * as BedrockConverse from "./bedrock-converse.js";
@@ -23,14 +23,6 @@ interface State extends SpeechStream.Audio {
23
23
  readonly done: boolean;
24
24
  }
25
25
  export declare const protocol: MediaProtocol.Streamed<Request, {
26
- readonly type: "generation-queued";
27
- readonly id: string;
28
- readonly position?: number | undefined;
29
- } | {
30
- readonly type: "generation-progress";
31
- readonly id: string;
32
- readonly progress?: number | undefined;
33
- } | {
34
26
  readonly type: "audio-delta";
35
27
  readonly chunk: Uint8Array<ArrayBufferLike>;
36
28
  } | {
@@ -40,18 +32,18 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
40
32
  readonly startSeconds: number;
41
33
  readonly endSeconds: number;
42
34
  }[];
35
+ } | {
36
+ readonly type: "generation-queued";
37
+ readonly id: string;
38
+ readonly position?: number | undefined;
39
+ } | {
40
+ readonly type: "generation-progress";
41
+ readonly id: string;
42
+ readonly progress?: number | undefined;
43
43
  } | {
44
44
  readonly type: "finish";
45
45
  readonly audio: import("../media.js").Asset;
46
46
  readonly usage?: {
47
- readonly type: "tokens";
48
- readonly input?: number | undefined;
49
- readonly output?: number | undefined;
50
- readonly total?: number | undefined;
51
- readonly details?: {
52
- readonly [x: string]: unknown;
53
- } | undefined;
54
- } | {
55
47
  readonly type: "seconds";
56
48
  readonly seconds: number;
57
49
  } | {
@@ -63,6 +55,14 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
63
55
  } | {
64
56
  readonly type: "compute";
65
57
  readonly seconds: number;
58
+ } | {
59
+ readonly type: "tokens";
60
+ readonly input?: number | undefined;
61
+ readonly output?: number | undefined;
62
+ readonly total?: number | undefined;
63
+ readonly details?: {
64
+ readonly [x: string]: unknown;
65
+ } | undefined;
66
66
  } | undefined;
67
67
  readonly notices?: readonly {
68
68
  readonly type: "filtered" | "moderated" | "other";
@@ -82,14 +82,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
82
82
  export declare const model: (input: MediaRoute.ModelInput) => SpeechModel<CartesiaSpeechOptions>;
83
83
  export declare const CartesiaSpeech: {
84
84
  readonly protocol: MediaProtocol.Streamed<Request, {
85
- readonly type: "generation-queued";
86
- readonly id: string;
87
- readonly position?: number | undefined;
88
- } | {
89
- readonly type: "generation-progress";
90
- readonly id: string;
91
- readonly progress?: number | undefined;
92
- } | {
93
85
  readonly type: "audio-delta";
94
86
  readonly chunk: Uint8Array<ArrayBufferLike>;
95
87
  } | {
@@ -99,18 +91,18 @@ export declare const CartesiaSpeech: {
99
91
  readonly startSeconds: number;
100
92
  readonly endSeconds: number;
101
93
  }[];
94
+ } | {
95
+ readonly type: "generation-queued";
96
+ readonly id: string;
97
+ readonly position?: number | undefined;
98
+ } | {
99
+ readonly type: "generation-progress";
100
+ readonly id: string;
101
+ readonly progress?: number | undefined;
102
102
  } | {
103
103
  readonly type: "finish";
104
104
  readonly audio: import("../media.js").Asset;
105
105
  readonly usage?: {
106
- readonly type: "tokens";
107
- readonly input?: number | undefined;
108
- readonly output?: number | undefined;
109
- readonly total?: number | undefined;
110
- readonly details?: {
111
- readonly [x: string]: unknown;
112
- } | undefined;
113
- } | {
114
106
  readonly type: "seconds";
115
107
  readonly seconds: number;
116
108
  } | {
@@ -122,6 +114,14 @@ export declare const CartesiaSpeech: {
122
114
  } | {
123
115
  readonly type: "compute";
124
116
  readonly seconds: number;
117
+ } | {
118
+ readonly type: "tokens";
119
+ readonly input?: number | undefined;
120
+ readonly output?: number | undefined;
121
+ readonly total?: number | undefined;
122
+ readonly details?: {
123
+ readonly [x: string]: unknown;
124
+ } | undefined;
125
125
  } | undefined;
126
126
  readonly notices?: readonly {
127
127
  readonly type: "filtered" | "moderated" | "other";
@@ -11,11 +11,6 @@ declare const Options: Schema.Struct<{
11
11
  }>>;
12
12
  }>;
13
13
  export type ProviderOptionsInput = Schema.Schema.Type<typeof Options>;
14
- type State = {
15
- readonly lifecycle: Lifecycle.State;
16
- readonly tools: ToolStream.State<number>;
17
- readonly finished: boolean;
18
- };
19
14
  export declare const protocol: Protocol<{
20
15
  readonly model: string;
21
16
  readonly messages: readonly {
@@ -68,6 +63,8 @@ export declare const protocol: Protocol<{
68
63
  readonly frequency_penalty?: number | undefined;
69
64
  readonly presence_penalty?: number | undefined;
70
65
  }, string, {
66
+ readonly type: "unknown";
67
+ } | {
71
68
  readonly type: "message-start";
72
69
  } | {
73
70
  readonly type: "content-delta" | "content-start";
@@ -127,9 +124,11 @@ export declare const protocol: Protocol<{
127
124
  };
128
125
  } | {
129
126
  readonly type: "citation-end" | "citation-start";
130
- } | {
131
- readonly type: "unknown";
132
- }, State>;
127
+ }, {
128
+ readonly lifecycle: Lifecycle.State;
129
+ readonly finished: boolean;
130
+ readonly tools: Partial<Record<number, ToolStream.PendingTool>>;
131
+ }>;
133
132
  export declare const route: Route<{
134
133
  readonly model: string;
135
134
  readonly messages: readonly {
@@ -16,14 +16,6 @@ export type DeepgramSpeechOptions = {
16
16
  } & Record<string, unknown>;
17
17
  export type Request = SpeechRequestFor<DeepgramSpeechOptions>;
18
18
  export declare const protocol: MediaProtocol.Streamed<Request, {
19
- readonly type: "generation-queued";
20
- readonly id: string;
21
- readonly position?: number | undefined;
22
- } | {
23
- readonly type: "generation-progress";
24
- readonly id: string;
25
- readonly progress?: number | undefined;
26
- } | {
27
19
  readonly type: "audio-delta";
28
20
  readonly chunk: Uint8Array<ArrayBufferLike>;
29
21
  } | {
@@ -33,18 +25,18 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
33
25
  readonly startSeconds: number;
34
26
  readonly endSeconds: number;
35
27
  }[];
28
+ } | {
29
+ readonly type: "generation-queued";
30
+ readonly id: string;
31
+ readonly position?: number | undefined;
32
+ } | {
33
+ readonly type: "generation-progress";
34
+ readonly id: string;
35
+ readonly progress?: number | undefined;
36
36
  } | {
37
37
  readonly type: "finish";
38
38
  readonly audio: import("../media.js").Asset;
39
39
  readonly usage?: {
40
- readonly type: "tokens";
41
- readonly input?: number | undefined;
42
- readonly output?: number | undefined;
43
- readonly total?: number | undefined;
44
- readonly details?: {
45
- readonly [x: string]: unknown;
46
- } | undefined;
47
- } | {
48
40
  readonly type: "seconds";
49
41
  readonly seconds: number;
50
42
  } | {
@@ -56,6 +48,14 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
56
48
  } | {
57
49
  readonly type: "compute";
58
50
  readonly seconds: number;
51
+ } | {
52
+ readonly type: "tokens";
53
+ readonly input?: number | undefined;
54
+ readonly output?: number | undefined;
55
+ readonly total?: number | undefined;
56
+ readonly details?: {
57
+ readonly [x: string]: unknown;
58
+ } | undefined;
59
59
  } | undefined;
60
60
  readonly notices?: readonly {
61
61
  readonly type: "filtered" | "moderated" | "other";
@@ -75,14 +75,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
75
75
  export declare const model: (input: MediaRoute.ModelInput) => SpeechModel<DeepgramSpeechOptions>;
76
76
  export declare const DeepgramSpeech: {
77
77
  readonly protocol: MediaProtocol.Streamed<Request, {
78
- readonly type: "generation-queued";
79
- readonly id: string;
80
- readonly position?: number | undefined;
81
- } | {
82
- readonly type: "generation-progress";
83
- readonly id: string;
84
- readonly progress?: number | undefined;
85
- } | {
86
78
  readonly type: "audio-delta";
87
79
  readonly chunk: Uint8Array<ArrayBufferLike>;
88
80
  } | {
@@ -92,18 +84,18 @@ export declare const DeepgramSpeech: {
92
84
  readonly startSeconds: number;
93
85
  readonly endSeconds: number;
94
86
  }[];
87
+ } | {
88
+ readonly type: "generation-queued";
89
+ readonly id: string;
90
+ readonly position?: number | undefined;
91
+ } | {
92
+ readonly type: "generation-progress";
93
+ readonly id: string;
94
+ readonly progress?: number | undefined;
95
95
  } | {
96
96
  readonly type: "finish";
97
97
  readonly audio: import("../media.js").Asset;
98
98
  readonly usage?: {
99
- readonly type: "tokens";
100
- readonly input?: number | undefined;
101
- readonly output?: number | undefined;
102
- readonly total?: number | undefined;
103
- readonly details?: {
104
- readonly [x: string]: unknown;
105
- } | undefined;
106
- } | {
107
99
  readonly type: "seconds";
108
100
  readonly seconds: number;
109
101
  } | {
@@ -115,6 +107,14 @@ export declare const DeepgramSpeech: {
115
107
  } | {
116
108
  readonly type: "compute";
117
109
  readonly seconds: number;
110
+ } | {
111
+ readonly type: "tokens";
112
+ readonly input?: number | undefined;
113
+ readonly output?: number | undefined;
114
+ readonly total?: number | undefined;
115
+ readonly details?: {
116
+ readonly [x: string]: unknown;
117
+ } | undefined;
118
118
  } | undefined;
119
119
  readonly notices?: readonly {
120
120
  readonly type: "filtered" | "moderated" | "other";
@@ -19,14 +19,6 @@ export type ElevenLabsSpeechOptions = {
19
19
  } & Record<string, unknown>;
20
20
  export type Request = SpeechRequestFor<ElevenLabsSpeechOptions>;
21
21
  export declare const protocol: MediaProtocol.Streamed<Request, {
22
- readonly type: "generation-queued";
23
- readonly id: string;
24
- readonly position?: number | undefined;
25
- } | {
26
- readonly type: "generation-progress";
27
- readonly id: string;
28
- readonly progress?: number | undefined;
29
- } | {
30
22
  readonly type: "audio-delta";
31
23
  readonly chunk: Uint8Array<ArrayBufferLike>;
32
24
  } | {
@@ -36,18 +28,18 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
36
28
  readonly startSeconds: number;
37
29
  readonly endSeconds: number;
38
30
  }[];
31
+ } | {
32
+ readonly type: "generation-queued";
33
+ readonly id: string;
34
+ readonly position?: number | undefined;
35
+ } | {
36
+ readonly type: "generation-progress";
37
+ readonly id: string;
38
+ readonly progress?: number | undefined;
39
39
  } | {
40
40
  readonly type: "finish";
41
41
  readonly audio: import("../media.js").Asset;
42
42
  readonly usage?: {
43
- readonly type: "tokens";
44
- readonly input?: number | undefined;
45
- readonly output?: number | undefined;
46
- readonly total?: number | undefined;
47
- readonly details?: {
48
- readonly [x: string]: unknown;
49
- } | undefined;
50
- } | {
51
43
  readonly type: "seconds";
52
44
  readonly seconds: number;
53
45
  } | {
@@ -59,6 +51,14 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
59
51
  } | {
60
52
  readonly type: "compute";
61
53
  readonly seconds: number;
54
+ } | {
55
+ readonly type: "tokens";
56
+ readonly input?: number | undefined;
57
+ readonly output?: number | undefined;
58
+ readonly total?: number | undefined;
59
+ readonly details?: {
60
+ readonly [x: string]: unknown;
61
+ } | undefined;
62
62
  } | undefined;
63
63
  readonly notices?: readonly {
64
64
  readonly type: "filtered" | "moderated" | "other";
@@ -78,14 +78,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
78
78
  export declare const model: (input: MediaRoute.ModelInput) => SpeechModel<ElevenLabsSpeechOptions>;
79
79
  export declare const ElevenLabsSpeech: {
80
80
  readonly protocol: MediaProtocol.Streamed<Request, {
81
- readonly type: "generation-queued";
82
- readonly id: string;
83
- readonly position?: number | undefined;
84
- } | {
85
- readonly type: "generation-progress";
86
- readonly id: string;
87
- readonly progress?: number | undefined;
88
- } | {
89
81
  readonly type: "audio-delta";
90
82
  readonly chunk: Uint8Array<ArrayBufferLike>;
91
83
  } | {
@@ -95,18 +87,18 @@ export declare const ElevenLabsSpeech: {
95
87
  readonly startSeconds: number;
96
88
  readonly endSeconds: number;
97
89
  }[];
90
+ } | {
91
+ readonly type: "generation-queued";
92
+ readonly id: string;
93
+ readonly position?: number | undefined;
94
+ } | {
95
+ readonly type: "generation-progress";
96
+ readonly id: string;
97
+ readonly progress?: number | undefined;
98
98
  } | {
99
99
  readonly type: "finish";
100
100
  readonly audio: import("../media.js").Asset;
101
101
  readonly usage?: {
102
- readonly type: "tokens";
103
- readonly input?: number | undefined;
104
- readonly output?: number | undefined;
105
- readonly total?: number | undefined;
106
- readonly details?: {
107
- readonly [x: string]: unknown;
108
- } | undefined;
109
- } | {
110
102
  readonly type: "seconds";
111
103
  readonly seconds: number;
112
104
  } | {
@@ -118,6 +110,14 @@ export declare const ElevenLabsSpeech: {
118
110
  } | {
119
111
  readonly type: "compute";
120
112
  readonly seconds: number;
113
+ } | {
114
+ readonly type: "tokens";
115
+ readonly input?: number | undefined;
116
+ readonly output?: number | undefined;
117
+ readonly total?: number | undefined;
118
+ readonly details?: {
119
+ readonly [x: string]: unknown;
120
+ } | undefined;
121
121
  } | undefined;
122
122
  readonly notices?: readonly {
123
123
  readonly type: "filtered" | "moderated" | "other";