@opencode/ai 2.1.2 → 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 (140) hide show
  1. package/dist/cache-policy.js +6 -5
  2. package/dist/experimental/evaluation.d.ts +7 -6
  3. package/dist/experimental/evaluation.js +3 -11
  4. package/dist/experimental/realtime.d.ts +59 -0
  5. package/dist/experimental/realtime.js +21 -13
  6. package/dist/experimental.d.ts +1 -1
  7. package/dist/generation.js +1 -1
  8. package/dist/image-client.d.ts +11 -9
  9. package/dist/image.d.ts +158 -150
  10. package/dist/image.js +2 -2
  11. package/dist/llm.d.ts +2 -4
  12. package/dist/llm.js +2 -2
  13. package/dist/media-model.d.ts +2 -2
  14. package/dist/media-model.js +1 -1
  15. package/dist/promise.d.ts +121 -121
  16. package/dist/promise.js +3 -5
  17. package/dist/protocols/alibaba-chat.d.ts +18 -18
  18. package/dist/protocols/alibaba-chat.js +3 -3
  19. package/dist/protocols/alibaba-messages.d.ts +12 -12
  20. package/dist/protocols/alibaba-messages.js +1 -1
  21. package/dist/protocols/alibaba-responses.d.ts +38 -38
  22. package/dist/protocols/anthropic-messages.d.ts +40 -44
  23. package/dist/protocols/anthropic-messages.js +13 -15
  24. package/dist/protocols/bedrock-converse.d.ts +36 -85
  25. package/dist/protocols/bedrock-converse.js +6 -6
  26. package/dist/protocols/bedrock-event-stream.d.ts +6 -1
  27. package/dist/protocols/bedrock-event-stream.js +9 -8
  28. package/dist/protocols/cartesia-speech.d.ts +32 -32
  29. package/dist/protocols/cohere-chat.d.ts +13 -10
  30. package/dist/protocols/cohere-chat.js +2 -2
  31. package/dist/protocols/deepgram-speech.d.ts +32 -32
  32. package/dist/protocols/elevenlabs-speech.d.ts +32 -32
  33. package/dist/protocols/gemini.d.ts +46 -36
  34. package/dist/protocols/gemini.js +12 -15
  35. package/dist/protocols/google-interactions.d.ts +14 -13
  36. package/dist/protocols/google-interactions.js +16 -11
  37. package/dist/protocols/google-speech.d.ts +32 -32
  38. package/dist/protocols/google-transcription.d.ts +32 -32
  39. package/dist/protocols/meta-messages.d.ts +23 -23
  40. package/dist/protocols/meta-responses.d.ts +84 -84
  41. package/dist/protocols/mistral-chat.d.ts +81 -78
  42. package/dist/protocols/mistral-chat.js +3 -5
  43. package/dist/protocols/open-responses-channel.js +47 -46
  44. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  45. package/dist/protocols/open-responses-continuation.js +3 -1
  46. package/dist/protocols/open-responses.d.ts +419 -419
  47. package/dist/protocols/open-responses.js +11 -10
  48. package/dist/protocols/openai-chat.d.ts +68 -67
  49. package/dist/protocols/openai-chat.js +7 -8
  50. package/dist/protocols/openai-compatible-chat.d.ts +13 -14
  51. package/dist/protocols/openai-compatible-responses.d.ts +39 -40
  52. package/dist/protocols/openai-images.d.ts +32 -32
  53. package/dist/protocols/openai-responses.d.ts +253 -253
  54. package/dist/protocols/openai-responses.js +1 -1
  55. package/dist/protocols/openai-speech.d.ts +32 -32
  56. package/dist/protocols/openai-transcription.d.ts +32 -32
  57. package/dist/protocols/openai-transcription.js +12 -7
  58. package/dist/protocols/utils/open-responses-options.d.ts +8 -8
  59. package/dist/protocols/utils/open-responses-options.js +4 -6
  60. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  61. package/dist/protocols/utils/partial-json-options.js +0 -1
  62. package/dist/protocols/utils/partial-json.js +5 -4
  63. package/dist/protocols/utils/tool-schema.d.ts +0 -3
  64. package/dist/protocols/utils/tool-schema.js +0 -4
  65. package/dist/protocols/utils/tool-stream.d.ts +1 -1
  66. package/dist/protocols/venice-chat.d.ts +52 -53
  67. package/dist/protocols/venice-chat.js +6 -5
  68. package/dist/protocols/xai-images.js +3 -4
  69. package/dist/protocols/xai-responses.d.ts +81 -81
  70. package/dist/protocols/zai-chat.d.ts +33 -30
  71. package/dist/protocols/zai-chat.js +8 -3
  72. package/dist/protocols/zai-messages.d.ts +21 -19
  73. package/dist/protocols/zai-messages.js +3 -2
  74. package/dist/provider-error.js +8 -7
  75. package/dist/providers/alibaba.d.ts +74 -74
  76. package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
  77. package/dist/providers/amazon-bedrock.d.ts +16 -13
  78. package/dist/providers/anthropic-compatible.d.ts +13 -13
  79. package/dist/providers/anthropic.d.ts +13 -13
  80. package/dist/providers/azure.d.ts +112 -112
  81. package/dist/providers/baseten.d.ts +24 -24
  82. package/dist/providers/cerebras.d.ts +24 -24
  83. package/dist/providers/cloudflare-ai-gateway.d.ts +237 -234
  84. package/dist/providers/cloudflare-ai-gateway.js +3 -6
  85. package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
  86. package/dist/providers/cohere.d.ts +78 -74
  87. package/dist/providers/deepinfra.d.ts +24 -24
  88. package/dist/providers/deepseek.d.ts +24 -24
  89. package/dist/providers/digitalocean.d.ts +36 -36
  90. package/dist/providers/fireworks.d.ts +24 -24
  91. package/dist/providers/google-vertex-chat.d.ts +12 -12
  92. package/dist/providers/google-vertex-interactions.d.ts +3 -3
  93. package/dist/providers/google-vertex-messages.d.ts +20 -20
  94. package/dist/providers/google-vertex-mistral.d.ts +14 -14
  95. package/dist/providers/google-vertex-responses.d.ts +38 -38
  96. package/dist/providers/google-vertex.d.ts +17 -17
  97. package/dist/providers/google-vertex.js +2 -2
  98. package/dist/providers/google.d.ts +79 -79
  99. package/dist/providers/groq.d.ts +24 -24
  100. package/dist/providers/meta.d.ts +189 -189
  101. package/dist/providers/minimax.d.ts +202 -202
  102. package/dist/providers/mistral.d.ts +28 -28
  103. package/dist/providers/moonshot.d.ts +202 -202
  104. package/dist/providers/open-responses-options.d.ts +0 -1
  105. package/dist/providers/open-responses-options.js +1 -1
  106. package/dist/providers/openai-compatible-responses.d.ts +38 -38
  107. package/dist/providers/openai-compatible.d.ts +12 -12
  108. package/dist/providers/openai-compatible.js +1 -1
  109. package/dist/providers/openai-options.d.ts +3 -4
  110. package/dist/providers/openai-options.js +0 -1
  111. package/dist/providers/openai.d.ts +103 -103
  112. package/dist/providers/openrouter.d.ts +171 -112
  113. package/dist/providers/openrouter.js +40 -33
  114. package/dist/providers/togetherai.d.ts +24 -24
  115. package/dist/providers/venice.d.ts +195 -20
  116. package/dist/providers/xai.d.ts +12 -12
  117. package/dist/providers/zai-coding-plan.d.ts +152 -72
  118. package/dist/providers/zai.d.ts +84 -19
  119. package/dist/route/auth-options.d.ts +0 -3
  120. package/dist/route/auth.d.ts +0 -2
  121. package/dist/route/auth.js +0 -2
  122. package/dist/route/client.d.ts +0 -218
  123. package/dist/route/client.js +3 -7
  124. package/dist/route/executor-service.js +1 -1
  125. package/dist/route/transport/http.js +5 -8
  126. package/dist/schema/errors.d.ts +1 -1
  127. package/dist/schema/errors.js +1 -1
  128. package/dist/schema/messages.js +4 -7
  129. package/dist/speech-client.d.ts +11 -9
  130. package/dist/speech.d.ts +158 -150
  131. package/dist/speech.js +2 -2
  132. package/dist/transcription-client.d.ts +11 -9
  133. package/dist/transcription.d.ts +158 -150
  134. package/dist/transcription.js +2 -2
  135. package/dist/video-client.d.ts +11 -9
  136. package/dist/video.d.ts +124 -116
  137. package/dist/video.js +2 -2
  138. package/package.json +7 -6
  139. package/dist/protocols/utils/openai-options.d.ts +0 -16
  140. package/dist/protocols/utils/openai-options.js +0 -15
@@ -42,13 +42,13 @@ export declare const protocol: Protocol<{
42
42
  readonly input: readonly ({
43
43
  readonly type: "model_output" | "user_input";
44
44
  readonly content: readonly ({
45
+ readonly type: "text";
46
+ readonly text: string;
47
+ } | {
45
48
  readonly type: "audio" | "document" | "image" | "video";
46
49
  readonly data?: string | undefined;
47
50
  readonly uri?: string | undefined;
48
51
  readonly mime_type: string;
49
- } | {
50
- readonly type: "text";
51
- readonly text: string;
52
52
  })[];
53
53
  } | {
54
54
  readonly type: "thought";
@@ -99,6 +99,8 @@ export declare const protocol: Protocol<{
99
99
  } | undefined;
100
100
  };
101
101
  }, string, {
102
+ readonly event_type: "unknown";
103
+ } | {
102
104
  readonly event_type: "step.start";
103
105
  readonly index: number;
104
106
  readonly step: {
@@ -122,6 +124,9 @@ export declare const protocol: Protocol<{
122
124
  readonly event_type: "step.delta";
123
125
  readonly index: number;
124
126
  readonly delta: {
127
+ readonly type: "unknown";
128
+ readonly rawType: string;
129
+ } | {
125
130
  readonly type: "text";
126
131
  readonly text: string;
127
132
  } | {
@@ -136,8 +141,6 @@ export declare const protocol: Protocol<{
136
141
  readonly type: "text";
137
142
  readonly text: string;
138
143
  };
139
- } | {
140
- readonly type: string;
141
144
  };
142
145
  } | {
143
146
  readonly event_type: "step.stop";
@@ -147,10 +150,6 @@ export declare const protocol: Protocol<{
147
150
  readonly interaction: {
148
151
  readonly id?: string | undefined;
149
152
  };
150
- } | {
151
- readonly event_type: "interaction.status_update";
152
- readonly interaction_id?: string | undefined;
153
- readonly status: string;
154
153
  } | {
155
154
  readonly event_type: "interaction.completed";
156
155
  readonly interaction: {
@@ -171,20 +170,22 @@ export declare const protocol: Protocol<{
171
170
  readonly event_type: "error";
172
171
  readonly error: unknown;
173
172
  } | {
174
- readonly event_type: "unknown";
173
+ readonly event_type: "interaction.status_update";
174
+ readonly interaction_id?: string | undefined;
175
+ readonly status: string;
175
176
  }, ParserState>;
176
177
  export declare const route: Route<{
177
178
  readonly model: string;
178
179
  readonly input: readonly ({
179
180
  readonly type: "model_output" | "user_input";
180
181
  readonly content: readonly ({
182
+ readonly type: "text";
183
+ readonly text: string;
184
+ } | {
181
185
  readonly type: "audio" | "document" | "image" | "video";
182
186
  readonly data?: string | undefined;
183
187
  readonly uri?: string | undefined;
184
188
  readonly mime_type: string;
185
- } | {
186
- readonly type: "text";
187
- readonly text: string;
188
189
  })[];
189
190
  } | {
190
191
  readonly type: "thought";
@@ -108,13 +108,20 @@ const OutputStep = Schema.Struct({
108
108
  summary: Schema.optional(Schema.Array(Text)),
109
109
  content: Schema.optional(Schema.Array(Schema.Struct({ type: Schema.String, text: Schema.optional(Schema.String) }))),
110
110
  });
111
+ const KNOWN_DELTA_TYPES = new Set(["text", "arguments_delta", "thought_signature", "thought_summary"]);
112
+ const UnknownDelta = Schema.Struct({
113
+ type: Schema.String.check(Schema.makeFilter((type) => !KNOWN_DELTA_TYPES.has(type))),
114
+ }).pipe(Schema.decodeTo(Schema.Struct({ type: Schema.Literal("unknown"), rawType: Schema.String }), {
115
+ decode: SchemaGetter.transform((delta) => ({ type: "unknown", rawType: delta.type })),
116
+ encode: SchemaGetter.forbidden(() => "Unknown Google Interactions deltas are decode-only"),
117
+ }));
111
118
  const Delta = Schema.Union([
112
119
  Schema.Struct({ type: Schema.Literal("text"), text: Schema.String }),
113
120
  Schema.Struct({ type: Schema.Literal("arguments_delta"), arguments: Schema.String }),
114
121
  Schema.Struct({ type: Schema.Literal("thought_signature"), signature: Schema.String }),
115
122
  Schema.Struct({ type: Schema.Literal("thought_summary"), content: Text }),
116
123
  // Unknown output modalities must fail explicitly rather than disappearing from a successful response.
117
- Schema.Struct({ type: Schema.String }),
124
+ UnknownDelta,
118
125
  ]);
119
126
  const Interaction = Schema.StructWithRest(Schema.Struct({
120
127
  id: Schema.optional(Schema.String),
@@ -173,13 +180,11 @@ const mediaContent = Effect.fnUntraced(function* (asset) {
173
180
  });
174
181
  const signature = (metadata, key) => {
175
182
  const value = metadata?.[key];
176
- return ProviderShared.isRecord(value) && typeof value.interactionSignature === "string"
177
- ? value.interactionSignature
178
- : undefined;
183
+ return typeof value?.interactionSignature === "string" ? value.interactionSignature : undefined;
179
184
  };
180
185
  const lowerMessages = Effect.fnUntraced(function* (request) {
181
186
  const steps = [];
182
- const key = request.model.route.providerMetadataKey ?? String(request.model.provider);
187
+ const key = request.model.route.providerMetadataKey ?? request.model.provider;
183
188
  for (const message of request.messages) {
184
189
  if (message.role === "system") {
185
190
  const part = yield* ProviderShared.wrappedSystemUpdate("Google Interactions", message);
@@ -362,17 +367,17 @@ const onDelta = Effect.fnUntraced(function* (state, index, delta) {
362
367
  if (!step)
363
368
  return yield* ProviderShared.eventError(ADAPTER, "Interactions delta without step.start", encodeJson(delta));
364
369
  const events = [];
365
- if (delta.type === "text" && "text" in delta && step.type === "model_output")
370
+ if (delta.type === "text" && step.type === "model_output")
366
371
  return [
367
372
  { ...state, lifecycle: Lifecycle.textDelta(state.lifecycle, events, String(index), delta.text) },
368
373
  events,
369
374
  ];
370
- if (delta.type === "thought_summary" && "content" in delta && step.type === "thought")
375
+ if (delta.type === "thought_summary" && step.type === "thought")
371
376
  return [
372
377
  { ...state, lifecycle: Lifecycle.reasoningDelta(state.lifecycle, events, String(index), delta.content.text) },
373
378
  events,
374
379
  ];
375
- if (delta.type === "thought_signature" && "signature" in delta) {
380
+ if (delta.type === "thought_signature") {
376
381
  const next = { ...step, signature: delta.signature };
377
382
  const tool = state.tools[index];
378
383
  return [
@@ -384,13 +389,13 @@ const onDelta = Effect.fnUntraced(function* (state, index, delta) {
384
389
  events,
385
390
  ];
386
391
  }
387
- if (delta.type === "arguments_delta" && "arguments" in delta && step.type === "function_call") {
392
+ if (delta.type === "arguments_delta" && step.type === "function_call") {
388
393
  const result = ToolStream.appendExisting(ADAPTER, state.tools, index, delta.arguments, "Interactions arguments without function call");
389
394
  if (ToolStream.isError(result))
390
395
  return yield* result;
391
396
  return [{ ...state, tools: result.tools }, result.events];
392
397
  }
393
- return yield* ProviderShared.eventError(ADAPTER, `Unsupported Interactions delta: ${delta.type}`, encodeJson(delta));
398
+ return yield* ProviderShared.eventError(ADAPTER, `Unsupported Interactions delta: ${delta.type === "unknown" ? delta.rawType : delta.type}`, encodeJson(delta));
394
399
  });
395
400
  const onStop = Effect.fnUntraced(function* (state, index) {
396
401
  const step = state.steps[index];
@@ -471,7 +476,7 @@ export const protocol = Protocol.make({
471
476
  event: Protocol.jsonEvent(Event),
472
477
  initial: (request) => ({
473
478
  route: `${request.model.provider}/${ADAPTER}`,
474
- metadataKey: request.model.route.providerMetadataKey ?? String(request.model.provider),
479
+ metadataKey: request.model.route.providerMetadataKey ?? request.model.provider,
475
480
  lifecycle: Lifecycle.initial(),
476
481
  steps: {},
477
482
  tools: ToolStream.empty(),
@@ -26,14 +26,6 @@ interface State extends SpeechStream.Audio, GeminiGenerateContent.Metadata {
26
26
  readonly mimeType?: string;
27
27
  }
28
28
  export declare const protocol: MediaProtocol.Streamed<Request, {
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
- } | {
37
29
  readonly type: "audio-delta";
38
30
  readonly chunk: Uint8Array<ArrayBufferLike>;
39
31
  } | {
@@ -43,18 +35,18 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
43
35
  readonly startSeconds: number;
44
36
  readonly endSeconds: number;
45
37
  }[];
38
+ } | {
39
+ readonly type: "generation-queued";
40
+ readonly id: string;
41
+ readonly position?: number | undefined;
42
+ } | {
43
+ readonly type: "generation-progress";
44
+ readonly id: string;
45
+ readonly progress?: number | undefined;
46
46
  } | {
47
47
  readonly type: "finish";
48
48
  readonly audio: import("../media.js").Asset;
49
49
  readonly usage?: {
50
- readonly type: "tokens";
51
- readonly input?: number | undefined;
52
- readonly output?: number | undefined;
53
- readonly total?: number | undefined;
54
- readonly details?: {
55
- readonly [x: string]: unknown;
56
- } | undefined;
57
- } | {
58
50
  readonly type: "seconds";
59
51
  readonly seconds: number;
60
52
  } | {
@@ -66,6 +58,14 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
66
58
  } | {
67
59
  readonly type: "compute";
68
60
  readonly seconds: number;
61
+ } | {
62
+ readonly type: "tokens";
63
+ readonly input?: number | undefined;
64
+ readonly output?: number | undefined;
65
+ readonly total?: number | undefined;
66
+ readonly details?: {
67
+ readonly [x: string]: unknown;
68
+ } | undefined;
69
69
  } | undefined;
70
70
  readonly notices?: readonly {
71
71
  readonly type: "filtered" | "moderated" | "other";
@@ -85,14 +85,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
85
85
  export declare const model: (input: MediaRoute.ModelInput) => SpeechModel<GoogleSpeechOptions>;
86
86
  export declare const GoogleSpeech: {
87
87
  readonly protocol: MediaProtocol.Streamed<Request, {
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
- } | {
96
88
  readonly type: "audio-delta";
97
89
  readonly chunk: Uint8Array<ArrayBufferLike>;
98
90
  } | {
@@ -102,18 +94,18 @@ export declare const GoogleSpeech: {
102
94
  readonly startSeconds: number;
103
95
  readonly endSeconds: number;
104
96
  }[];
97
+ } | {
98
+ readonly type: "generation-queued";
99
+ readonly id: string;
100
+ readonly position?: number | undefined;
101
+ } | {
102
+ readonly type: "generation-progress";
103
+ readonly id: string;
104
+ readonly progress?: number | undefined;
105
105
  } | {
106
106
  readonly type: "finish";
107
107
  readonly audio: import("../media.js").Asset;
108
108
  readonly usage?: {
109
- readonly type: "tokens";
110
- readonly input?: number | undefined;
111
- readonly output?: number | undefined;
112
- readonly total?: number | undefined;
113
- readonly details?: {
114
- readonly [x: string]: unknown;
115
- } | undefined;
116
- } | {
117
109
  readonly type: "seconds";
118
110
  readonly seconds: number;
119
111
  } | {
@@ -125,6 +117,14 @@ export declare const GoogleSpeech: {
125
117
  } | {
126
118
  readonly type: "compute";
127
119
  readonly seconds: number;
120
+ } | {
121
+ readonly type: "tokens";
122
+ readonly input?: number | undefined;
123
+ readonly output?: number | undefined;
124
+ readonly total?: number | undefined;
125
+ readonly details?: {
126
+ readonly [x: string]: unknown;
127
+ } | undefined;
128
128
  } | undefined;
129
129
  readonly notices?: readonly {
130
130
  readonly type: "filtered" | "moderated" | "other";
@@ -22,14 +22,6 @@ interface State extends GeminiGenerateContent.Metadata {
22
22
  readonly words: Array<TranscriptionWord>;
23
23
  }
24
24
  export declare const protocol: MediaProtocol.Streamed<Request, {
25
- readonly type: "generation-queued";
26
- readonly id: string;
27
- readonly position?: number | undefined;
28
- } | {
29
- readonly type: "generation-progress";
30
- readonly id: string;
31
- readonly progress?: number | undefined;
32
- } | {
33
25
  readonly type: "text-delta";
34
26
  readonly delta: string;
35
27
  } | {
@@ -40,6 +32,14 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
40
32
  readonly endSeconds: number;
41
33
  readonly speaker?: string | undefined;
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 text: string;
45
45
  readonly segments?: readonly {
@@ -58,14 +58,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
58
58
  readonly language?: string | undefined;
59
59
  readonly durationSeconds?: number | undefined;
60
60
  readonly usage?: {
61
- readonly type: "tokens";
62
- readonly input?: number | undefined;
63
- readonly output?: number | undefined;
64
- readonly total?: number | undefined;
65
- readonly details?: {
66
- readonly [x: string]: unknown;
67
- } | undefined;
68
- } | {
69
61
  readonly type: "seconds";
70
62
  readonly seconds: number;
71
63
  } | {
@@ -77,6 +69,14 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
77
69
  } | {
78
70
  readonly type: "compute";
79
71
  readonly seconds: number;
72
+ } | {
73
+ readonly type: "tokens";
74
+ readonly input?: number | undefined;
75
+ readonly output?: number | undefined;
76
+ readonly total?: number | undefined;
77
+ readonly details?: {
78
+ readonly [x: string]: unknown;
79
+ } | undefined;
80
80
  } | undefined;
81
81
  readonly notices?: readonly {
82
82
  readonly type: "filtered" | "moderated" | "other";
@@ -97,14 +97,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
97
97
  export declare const model: (input: MediaRoute.ModelInput) => TranscriptionModel<GoogleTranscriptionOptions>;
98
98
  export declare const GoogleTranscription: {
99
99
  readonly protocol: MediaProtocol.Streamed<Request, {
100
- readonly type: "generation-queued";
101
- readonly id: string;
102
- readonly position?: number | undefined;
103
- } | {
104
- readonly type: "generation-progress";
105
- readonly id: string;
106
- readonly progress?: number | undefined;
107
- } | {
108
100
  readonly type: "text-delta";
109
101
  readonly delta: string;
110
102
  } | {
@@ -115,6 +107,14 @@ export declare const GoogleTranscription: {
115
107
  readonly endSeconds: number;
116
108
  readonly speaker?: string | undefined;
117
109
  };
110
+ } | {
111
+ readonly type: "generation-queued";
112
+ readonly id: string;
113
+ readonly position?: number | undefined;
114
+ } | {
115
+ readonly type: "generation-progress";
116
+ readonly id: string;
117
+ readonly progress?: number | undefined;
118
118
  } | {
119
119
  readonly text: string;
120
120
  readonly segments?: readonly {
@@ -133,14 +133,6 @@ export declare const GoogleTranscription: {
133
133
  readonly language?: string | undefined;
134
134
  readonly durationSeconds?: number | undefined;
135
135
  readonly usage?: {
136
- readonly type: "tokens";
137
- readonly input?: number | undefined;
138
- readonly output?: number | undefined;
139
- readonly total?: number | undefined;
140
- readonly details?: {
141
- readonly [x: string]: unknown;
142
- } | undefined;
143
- } | {
144
136
  readonly type: "seconds";
145
137
  readonly seconds: number;
146
138
  } | {
@@ -152,6 +144,14 @@ export declare const GoogleTranscription: {
152
144
  } | {
153
145
  readonly type: "compute";
154
146
  readonly seconds: number;
147
+ } | {
148
+ readonly type: "tokens";
149
+ readonly input?: number | undefined;
150
+ readonly output?: number | undefined;
151
+ readonly total?: number | undefined;
152
+ readonly details?: {
153
+ readonly [x: string]: unknown;
154
+ } | undefined;
155
155
  } | undefined;
156
156
  readonly notices?: readonly {
157
157
  readonly type: "filtered" | "moderated" | "other";
@@ -141,23 +141,15 @@ export declare const protocol: Protocol<{
141
141
  } | {
142
142
  readonly role: "assistant";
143
143
  readonly content: readonly ({
144
+ readonly type: "compaction";
145
+ readonly content: string | null;
146
+ } | {
144
147
  readonly type: "text";
145
148
  readonly text: string;
146
149
  readonly cache_control?: {
147
150
  readonly type: "ephemeral";
148
151
  readonly ttl?: "1h" | "5m" | undefined;
149
152
  } | undefined;
150
- } | {
151
- readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
152
- readonly tool_use_id: string;
153
- readonly content: unknown;
154
- readonly cache_control?: {
155
- readonly type: "ephemeral";
156
- readonly ttl?: "1h" | "5m" | undefined;
157
- } | undefined;
158
- } | {
159
- readonly type: "compaction";
160
- readonly content: string | null;
161
153
  } | {
162
154
  readonly type: "thinking";
163
155
  readonly thinking: string;
@@ -191,6 +183,14 @@ export declare const protocol: Protocol<{
191
183
  readonly type: "ephemeral";
192
184
  readonly ttl?: "1h" | "5m" | undefined;
193
185
  } | undefined;
186
+ } | {
187
+ readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
188
+ readonly tool_use_id: string;
189
+ readonly content: unknown;
190
+ readonly cache_control?: {
191
+ readonly type: "ephemeral";
192
+ readonly ttl?: "1h" | "5m" | undefined;
193
+ } | undefined;
194
194
  })[];
195
195
  } | {
196
196
  readonly role: "system";
@@ -221,6 +221,8 @@ export declare const protocol: Protocol<{
221
221
  readonly top_k?: number | undefined;
222
222
  readonly stop_sequences?: readonly string[] | undefined;
223
223
  readonly thinking?: {
224
+ readonly type: "between_tools" | "disabled";
225
+ } | {
224
226
  readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
225
227
  readonly block_binding?: {
226
228
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
@@ -233,8 +235,6 @@ export declare const protocol: Protocol<{
233
235
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
234
236
  } | undefined;
235
237
  readonly type: "adaptive";
236
- } | {
237
- readonly type: "between_tools" | "disabled";
238
238
  } | undefined;
239
239
  readonly output_config?: {
240
240
  readonly effort?: string | undefined;
@@ -261,16 +261,6 @@ export declare const protocol: Protocol<{
261
261
  } | undefined;
262
262
  readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
263
263
  readonly tools?: readonly ({
264
- readonly name: string;
265
- readonly description: string;
266
- readonly input_schema: {
267
- readonly [x: string]: unknown;
268
- };
269
- readonly cache_control?: {
270
- readonly type: "ephemeral";
271
- readonly ttl?: "1h" | "5m" | undefined;
272
- } | undefined;
273
- } | {
274
264
  readonly type: "web_search";
275
265
  readonly name: "web_search";
276
266
  readonly user_location?: {
@@ -280,6 +270,16 @@ export declare const protocol: Protocol<{
280
270
  readonly country?: string | undefined;
281
271
  readonly timezone?: string | undefined;
282
272
  } | undefined;
273
+ } | {
274
+ readonly name: string;
275
+ readonly description: string;
276
+ readonly input_schema: {
277
+ readonly [x: string]: unknown;
278
+ };
279
+ readonly cache_control?: {
280
+ readonly type: "ephemeral";
281
+ readonly ttl?: "1h" | "5m" | undefined;
282
+ } | undefined;
283
283
  })[] | undefined;
284
284
  }, string, {
285
285
  readonly [x: string]: unknown;