@nyte-ai/ai 0.0.24 → 0.0.25-beta.1

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 (68) hide show
  1. package/dist/chunks/{account-limits-cache-8qzk56vj.js → account-limits-cache-4qpef10z.js} +14 -1
  2. package/dist/chunks/{account-limits-cache-xds88kxd.js → account-limits-cache-525841fw.js} +12 -2
  3. package/dist/chunks/{account-limits-cache-r7mzqsvd.js → account-limits-cache-5zw0zvpy.js} +4 -4
  4. package/dist/chunks/{account-limits-cache-pfa86y8e.js → account-limits-cache-9twrnvar.js} +1 -1
  5. package/dist/chunks/{account-limits-cache-gznczekg.js → account-limits-cache-b25batbp.js} +1 -1
  6. package/dist/chunks/{account-limits-cache-1ny9js0t.js → account-limits-cache-c8r9ga7d.js} +8 -8
  7. package/dist/chunks/{account-limits-cache-1vkyhjec.js → account-limits-cache-eq2sae8w.js} +3 -3
  8. package/dist/chunks/{account-limits-cache-zn01kscn.js → account-limits-cache-gtv32njs.js} +1 -1
  9. package/dist/chunks/{account-limits-cache-nxkprk3g.js → account-limits-cache-gvscpb51.js} +1 -1
  10. package/dist/chunks/{account-limits-cache-1mjrnf6q.js → account-limits-cache-jt8g1rn2.js} +4 -4
  11. package/dist/chunks/{account-limits-cache-0n99ptc5.js → account-limits-cache-k4zewdqs.js} +1 -1
  12. package/dist/chunks/{account-limits-cache-h0fr16f1.js → account-limits-cache-kn9pwsba.js} +3 -3
  13. package/dist/chunks/{account-limits-cache-tj8a9am1.js → account-limits-cache-n916ac1t.js} +1 -1
  14. package/dist/chunks/{account-limits-cache-fdwad56n.js → account-limits-cache-qnrhx8gg.js} +1 -1
  15. package/dist/chunks/{account-limits-cache-4beqq05p.js → account-limits-cache-rp9ht95p.js} +1 -1
  16. package/dist/chunks/{account-limits-cache-n3yk6g5c.js → account-limits-cache-s77e2bgc.js} +1 -1
  17. package/dist/chunks/{account-limits-cache-bsknrh6t.js → account-limits-cache-sk1m9fsp.js} +1 -1
  18. package/dist/chunks/{account-limits-cache-aazmkcnq.js → account-limits-cache-w0abqhna.js} +2 -2
  19. package/dist/chunks/{account-limits-cache-j8c5ra3q.js → account-limits-cache-wawwj02k.js} +16 -5
  20. package/dist/chunks/{account-limits-cache-6r6bqm7g.js → account-limits-cache-ygydb22m.js} +1 -1
  21. package/dist/chunks/{account-limits-cache-fbkaq46e.js → account-limits-cache-z9mfzg68.js} +1 -1
  22. package/dist/src/api/anthropic-convert.d.ts +9 -3
  23. package/dist/src/api/anthropic-convert.js +5 -2
  24. package/dist/src/api/anthropic-messages.js +47 -16
  25. package/dist/src/api/anthropic-messages.lazy.js +1 -1
  26. package/dist/src/api/deferred.js +1 -1
  27. package/dist/src/api/google-generative-ai.js +1 -1
  28. package/dist/src/api/google-generative-ai.lazy.js +1 -1
  29. package/dist/src/api/openai-codex-compact.js +6 -6
  30. package/dist/src/api/openai-codex-protocol.js +3 -3
  31. package/dist/src/api/openai-codex-responses.js +7 -7
  32. package/dist/src/api/openai-codex-responses.lazy.js +1 -1
  33. package/dist/src/api/openai-codex-websocket.js +6 -6
  34. package/dist/src/api/openai-completions-convert.js +2 -2
  35. package/dist/src/api/openai-completions-params.js +3 -3
  36. package/dist/src/api/openai-completions-reasoning.d.ts +5 -5
  37. package/dist/src/api/openai-completions.js +4 -4
  38. package/dist/src/api/openai-completions.lazy.js +1 -1
  39. package/dist/src/api/openai-responses-convert.js +2 -2
  40. package/dist/src/api/openai-responses-events.d.ts +98 -98
  41. package/dist/src/api/openai-responses-stream.js +4 -4
  42. package/dist/src/api/openai-responses.js +4 -4
  43. package/dist/src/api/openai-responses.lazy.js +1 -1
  44. package/dist/src/api/transform-messages.d.ts +11 -1
  45. package/dist/src/api/transform-messages.js +3 -1
  46. package/dist/src/auth/oauth/authorization-input.d.ts +2 -2
  47. package/dist/src/index.js +19 -19
  48. package/dist/src/providers/anthropic.js +2 -2
  49. package/dist/src/providers/github-copilot.d.ts +1 -1
  50. package/dist/src/providers/github-copilot.js +4 -4
  51. package/dist/src/providers/nyte-catalog.js +14 -14
  52. package/dist/src/providers/openai-codex.js +2 -2
  53. package/dist/src/providers/openai.js +2 -2
  54. package/dist/src/providers/opencode-go.js +6 -6
  55. package/dist/src/providers/opencode.js +5 -5
  56. package/dist/src/providers/openrouter.js +2 -2
  57. package/dist/src/providers/vercel-ai-gateway.js +2 -2
  58. package/dist/src/utils/failure.js +1 -1
  59. package/dist/src/utils/json-parse.js +1 -1
  60. package/dist/src/utils/overflow.js +2 -2
  61. package/dist/src/utils/retry.js +2 -2
  62. package/package.json +3 -4
  63. /package/dist/chunks/{account-limits-cache-eyx1jcxc.js → account-limits-cache-20ttssmw.js} +0 -0
  64. /package/dist/chunks/{account-limits-cache-92q56978.js → account-limits-cache-3as87r3h.js} +0 -0
  65. /package/dist/chunks/{account-limits-cache-hxy4942k.js → account-limits-cache-khyz4r1r.js} +0 -0
  66. /package/dist/chunks/{account-limits-cache-k8z39pe7.js → account-limits-cache-s4xgnvwg.js} +0 -0
  67. /package/dist/chunks/{account-limits-cache-fdhrgjpr.js → account-limits-cache-yck8f1w5.js} +0 -0
  68. /package/dist/chunks/{account-limits-cache-tdgrj49j.js → account-limits-cache-z4y0mmpy.js} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  } from "../../chunks/account-limits-cache-zgzptd0z.js";
7
7
  import {
8
8
  reportsQuotaExhaustion2
9
- } from "../../chunks/account-limits-cache-xds88kxd.js";
9
+ } from "../../chunks/account-limits-cache-525841fw.js";
10
10
  import {
11
11
  headersToRecord2
12
12
  } from "../../chunks/account-limits-cache-ag5b8dja.js";
@@ -47,8 +47,8 @@ import"../../chunks/account-limits-cache-b4edaybk.js";
47
47
  import"../../chunks/account-limits-cache-h92bzz1j.js";
48
48
  import"../../chunks/account-limits-cache-0af5gqeg.js";
49
49
  import"../../chunks/account-limits-cache-eqwweapz.js";
50
- import"../../chunks/account-limits-cache-8qzk56vj.js";
51
- import"../../chunks/account-limits-cache-n3yk6g5c.js";
50
+ import"../../chunks/account-limits-cache-4qpef10z.js";
51
+ import"../../chunks/account-limits-cache-s77e2bgc.js";
52
52
  import {
53
53
  DEFAULT_MAX_RETRIES2,
54
54
  compressRequestBodyZstd2,
@@ -59,16 +59,16 @@ import {
59
59
  CodexProtocolError2,
60
60
  extractCodexEventError2,
61
61
  parseSSE2
62
- } from "../../chunks/account-limits-cache-gznczekg.js";
62
+ } from "../../chunks/account-limits-cache-b25batbp.js";
63
63
  import {
64
64
  clampOpenAIPromptCacheKey2
65
65
  } from "../../chunks/account-limits-cache-csbxvam7.js";
66
- import"../../chunks/account-limits-cache-fbkaq46e.js";
66
+ import"../../chunks/account-limits-cache-z9mfzg68.js";
67
67
  import"../../chunks/account-limits-cache-736tdyme.js";
68
68
  import"../../chunks/account-limits-cache-nem079h8.js";
69
69
  import {
70
70
  withPriorityTier2
71
- } from "../../chunks/account-limits-cache-aazmkcnq.js";
71
+ } from "../../chunks/account-limits-cache-w0abqhna.js";
72
72
 
73
73
  // src/api/openai-codex-compact.ts
74
74
  import { Type } from "typebox";
@@ -13,9 +13,9 @@ import {
13
13
  mapCodexEvents2,
14
14
  parseSSE2,
15
15
  parseErrorResponse2
16
- } from "../../chunks/account-limits-cache-gznczekg.js";
17
- import"../../chunks/account-limits-cache-n3yk6g5c.js";
18
- import"../../chunks/account-limits-cache-8qzk56vj.js";
16
+ } from "../../chunks/account-limits-cache-b25batbp.js";
17
+ import"../../chunks/account-limits-cache-s77e2bgc.js";
18
+ import"../../chunks/account-limits-cache-4qpef10z.js";
19
19
  import"../../chunks/account-limits-cache-h92bzz1j.js";
20
20
  import"../../chunks/account-limits-cache-eqwweapz.js";
21
21
  import"../../chunks/account-limits-cache-5ya94ve1.js";
@@ -18,7 +18,7 @@ import {
18
18
  } from "../../chunks/account-limits-cache-9wqk28n5.js";
19
19
  import {
20
20
  reportsQuotaExhaustion2
21
- } from "../../chunks/account-limits-cache-xds88kxd.js";
21
+ } from "../../chunks/account-limits-cache-525841fw.js";
22
22
  import"../../chunks/account-limits-cache-j2bt392s.js";
23
23
  import {
24
24
  retryProviderRequest2
@@ -45,8 +45,8 @@ import"../../chunks/account-limits-cache-5ya94ve1.js";
45
45
  import"../../chunks/account-limits-cache-b4edaybk.js";
46
46
  import"../../chunks/account-limits-cache-0af5gqeg.js";
47
47
  import"../../chunks/account-limits-cache-eqwweapz.js";
48
- import"../../chunks/account-limits-cache-8qzk56vj.js";
49
- import"../../chunks/account-limits-cache-n3yk6g5c.js";
48
+ import"../../chunks/account-limits-cache-4qpef10z.js";
49
+ import"../../chunks/account-limits-cache-s77e2bgc.js";
50
50
  import {
51
51
  compressRequestBodyZstd2,
52
52
  buildRequestBody2,
@@ -56,21 +56,21 @@ import {
56
56
  mapCodexEvents2,
57
57
  parseSSE2,
58
58
  parseErrorResponse2
59
- } from "../../chunks/account-limits-cache-gznczekg.js";
59
+ } from "../../chunks/account-limits-cache-b25batbp.js";
60
60
  import"../../chunks/account-limits-cache-gqsrbky9.js";
61
61
  import"../../chunks/account-limits-cache-b23sbrke.js";
62
62
  import"../../chunks/account-limits-cache-0yd6bde8.js";
63
63
  import"../../chunks/account-limits-cache-zgzptd0z.js";
64
- import"../../chunks/account-limits-cache-fbkaq46e.js";
64
+ import"../../chunks/account-limits-cache-z9mfzg68.js";
65
65
  import"../../chunks/account-limits-cache-736tdyme.js";
66
66
  import"../../chunks/account-limits-cache-nem079h8.js";
67
67
  import {
68
68
  withPriorityTier2,
69
69
  processResponsesStream2
70
- } from "../../chunks/account-limits-cache-aazmkcnq.js";
70
+ } from "../../chunks/account-limits-cache-w0abqhna.js";
71
71
  import {
72
72
  streamOverWebSocket2
73
- } from "../../chunks/account-limits-cache-1vkyhjec.js";
73
+ } from "../../chunks/account-limits-cache-eq2sae8w.js";
74
74
  import {
75
75
  clampOpenAIPromptCacheKey2
76
76
  } from "../../chunks/account-limits-cache-csbxvam7.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openAICodexResponsesApi2
3
- } from "../../chunks/account-limits-cache-tdgrj49j.js";
3
+ } from "../../chunks/account-limits-cache-z4y0mmpy.js";
4
4
  import"../../chunks/account-limits-cache-90c9c2eb.js";
5
5
  import"../../chunks/account-limits-cache-fsktnetm.js";
6
6
  import"../../chunks/account-limits-cache-zcbkmrvy.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  closeOpenAICodexWebSocketSessions2,
3
3
  streamOverWebSocket2
4
- } from "../../chunks/account-limits-cache-1vkyhjec.js";
5
- import"../../chunks/account-limits-cache-aazmkcnq.js";
4
+ } from "../../chunks/account-limits-cache-eq2sae8w.js";
5
+ import"../../chunks/account-limits-cache-w0abqhna.js";
6
6
  import"../../chunks/account-limits-cache-nem079h8.js";
7
- import"../../chunks/account-limits-cache-gznczekg.js";
8
- import"../../chunks/account-limits-cache-n3yk6g5c.js";
9
- import"../../chunks/account-limits-cache-8qzk56vj.js";
7
+ import"../../chunks/account-limits-cache-b25batbp.js";
8
+ import"../../chunks/account-limits-cache-s77e2bgc.js";
9
+ import"../../chunks/account-limits-cache-4qpef10z.js";
10
10
  import"../../chunks/account-limits-cache-736tdyme.js";
11
11
  import"../../chunks/account-limits-cache-h92bzz1j.js";
12
12
  import"../../chunks/account-limits-cache-eqwweapz.js";
@@ -19,7 +19,7 @@ import"../../chunks/account-limits-cache-fvadc36m.js";
19
19
  import"../../chunks/account-limits-cache-ehy0ze2b.js";
20
20
  import"../../chunks/account-limits-cache-b4edaybk.js";
21
21
  import"../../chunks/account-limits-cache-6250ykn6.js";
22
- import"../../chunks/account-limits-cache-fbkaq46e.js";
22
+ import"../../chunks/account-limits-cache-z9mfzg68.js";
23
23
  import"../../chunks/account-limits-cache-gknnm1kv.js";
24
24
  import"../../chunks/account-limits-cache-ag5b8dja.js";
25
25
  import"../../chunks/account-limits-cache-fsktnetm.js";
@@ -4,9 +4,9 @@ import {
4
4
  applyAnthropicCacheControl2,
5
5
  convertMessages2,
6
6
  convertTools2
7
- } from "../../chunks/account-limits-cache-fdwad56n.js";
7
+ } from "../../chunks/account-limits-cache-qnrhx8gg.js";
8
8
  import"../../chunks/account-limits-cache-hj1h48sc.js";
9
- import"../../chunks/account-limits-cache-8qzk56vj.js";
9
+ import"../../chunks/account-limits-cache-4qpef10z.js";
10
10
  import"../../chunks/account-limits-cache-h92bzz1j.js";
11
11
  import"../../chunks/account-limits-cache-eqwweapz.js";
12
12
  import"../../chunks/account-limits-cache-0af5gqeg.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  buildParams2
3
- } from "../../chunks/account-limits-cache-zn01kscn.js";
4
- import"../../chunks/account-limits-cache-fdwad56n.js";
3
+ } from "../../chunks/account-limits-cache-gtv32njs.js";
4
+ import"../../chunks/account-limits-cache-qnrhx8gg.js";
5
5
  import"../../chunks/account-limits-cache-hj1h48sc.js";
6
6
  import"../../chunks/account-limits-cache-csbxvam7.js";
7
7
  import"../../chunks/account-limits-cache-k0pkzhbx.js";
8
- import"../../chunks/account-limits-cache-8qzk56vj.js";
8
+ import"../../chunks/account-limits-cache-4qpef10z.js";
9
9
  import"../../chunks/account-limits-cache-h92bzz1j.js";
10
10
  import"../../chunks/account-limits-cache-eqwweapz.js";
11
11
  import"../../chunks/account-limits-cache-0af5gqeg.js";
@@ -5,24 +5,24 @@
5
5
  */
6
6
  import { Type, type Static } from "typebox";
7
7
  export declare const OpenAIReasoningDetailSchema: Type.TUnion<[Type.TObject<{
8
+ id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
9
+ format: Type.TOptional<Type.TString>;
10
+ index: Type.TOptional<Type.TNumber>;
8
11
  type: Type.TLiteral<"reasoning.summary">;
9
12
  summary: Type.TString;
13
+ }>, Type.TObject<{
10
14
  id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
11
15
  format: Type.TOptional<Type.TString>;
12
16
  index: Type.TOptional<Type.TNumber>;
13
- }>, Type.TObject<{
14
17
  type: Type.TLiteral<"reasoning.encrypted">;
15
18
  data: Type.TString;
19
+ }>, Type.TObject<{
16
20
  id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
17
21
  format: Type.TOptional<Type.TString>;
18
22
  index: Type.TOptional<Type.TNumber>;
19
- }>, Type.TObject<{
20
23
  type: Type.TLiteral<"reasoning.text">;
21
24
  text: Type.TString;
22
25
  signature: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
23
- id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
24
- format: Type.TOptional<Type.TString>;
25
- index: Type.TOptional<Type.TNumber>;
26
26
  }>]>;
27
27
  export type OpenAIReasoningDetail = Static<typeof OpenAIReasoningDetailSchema>;
28
28
  type OpenAIEncryptedReasoningDetail = Extract<OpenAIReasoningDetail, {
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  parseStreamingJson2,
19
19
  parseToolCallArguments2
20
- } from "../../chunks/account-limits-cache-fbkaq46e.js";
20
+ } from "../../chunks/account-limits-cache-z9mfzg68.js";
21
21
  import {
22
22
  getNyteUserAgent2
23
23
  } from "../../chunks/account-limits-cache-gknnm1kv.js";
@@ -60,14 +60,14 @@ import {
60
60
  import"../../chunks/account-limits-cache-0af5gqeg.js";
61
61
  import"../../chunks/account-limits-cache-eqwweapz.js";
62
62
  import"../../chunks/account-limits-cache-b4edaybk.js";
63
- import"../../chunks/account-limits-cache-8qzk56vj.js";
63
+ import"../../chunks/account-limits-cache-4qpef10z.js";
64
64
  import {
65
65
  resolveCompat2
66
- } from "../../chunks/account-limits-cache-fdwad56n.js";
66
+ } from "../../chunks/account-limits-cache-qnrhx8gg.js";
67
67
  import"../../chunks/account-limits-cache-csbxvam7.js";
68
68
  import {
69
69
  buildParams2
70
- } from "../../chunks/account-limits-cache-zn01kscn.js";
70
+ } from "../../chunks/account-limits-cache-gtv32njs.js";
71
71
 
72
72
  // src/api/openai-completions.ts
73
73
  import OpenAI from "openai";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openAICompletionsApi2
3
- } from "../../chunks/account-limits-cache-eyx1jcxc.js";
3
+ } from "../../chunks/account-limits-cache-20ttssmw.js";
4
4
  import"../../chunks/account-limits-cache-90c9c2eb.js";
5
5
  import"../../chunks/account-limits-cache-fsktnetm.js";
6
6
  import"../../chunks/account-limits-cache-zcbkmrvy.js";
@@ -2,8 +2,8 @@ import {
2
2
  encodeTextSignatureV12,
3
3
  convertResponsesMessages2,
4
4
  convertResponsesTools2
5
- } from "../../chunks/account-limits-cache-n3yk6g5c.js";
6
- import"../../chunks/account-limits-cache-8qzk56vj.js";
5
+ } from "../../chunks/account-limits-cache-s77e2bgc.js";
6
+ import"../../chunks/account-limits-cache-4qpef10z.js";
7
7
  import"../../chunks/account-limits-cache-h92bzz1j.js";
8
8
  import"../../chunks/account-limits-cache-eqwweapz.js";
9
9
  import"../../chunks/account-limits-cache-0af5gqeg.js";
@@ -178,202 +178,202 @@ export declare const ResponsesStreamEventCheck: import("typebox/compile").Valida
178
178
  code: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
179
179
  message: Type.TOptional<Type.TString>;
180
180
  }>]>, {
181
+ type: "response.custom_tool_call_input.delta";
182
+ output_index?: number | undefined;
183
+ delta: string;
184
+ } | {
185
+ type: "response.function_call_arguments.delta";
186
+ output_index?: number | undefined;
187
+ delta: string;
188
+ } | {
189
+ type: "response.output_text.delta";
190
+ output_index?: number | undefined;
191
+ delta: string;
192
+ } | {
193
+ type: "response.reasoning_summary_text.delta";
194
+ output_index?: number | undefined;
195
+ delta: string;
196
+ } | {
197
+ type: "response.reasoning_text.delta";
198
+ output_index?: number | undefined;
199
+ delta: string;
200
+ } | {
201
+ type: "response.refusal.delta";
202
+ output_index?: number | undefined;
203
+ delta: string;
204
+ } | {
181
205
  type: "response.created";
182
206
  response: {
183
207
  id?: string | undefined;
184
208
  };
185
209
  } | {
186
- output_index?: number | undefined;
187
210
  type: "response.output_item.added" | "response.output_item.done";
211
+ output_index?: number | undefined;
188
212
  item: {
189
- content?: {
213
+ type: "reasoning";
214
+ id: string;
215
+ summary?: {
190
216
  text: string;
191
217
  }[] | undefined;
192
- summary?: {
218
+ content?: {
193
219
  text: string;
194
220
  }[] | undefined;
195
221
  encrypted_content?: string | null | undefined;
196
- id: string;
197
- type: "reasoning";
198
222
  } | {
223
+ type: "message";
199
224
  id?: string | undefined;
225
+ phase?: "commentary" | "final_answer" | null | undefined;
200
226
  content?: ({
201
- text: string;
202
227
  type: "output_text";
228
+ text: string;
203
229
  } | {
204
230
  type: "refusal";
205
231
  refusal: string;
206
232
  })[] | undefined;
207
- phase?: "commentary" | "final_answer" | null | undefined;
208
- type: "message";
209
233
  } | {
234
+ type: "function_call";
210
235
  id?: string | undefined;
236
+ call_id: string;
237
+ name: string;
211
238
  arguments?: string | undefined;
212
239
  namespace?: string | undefined;
213
- name: string;
214
- type: "function_call";
215
- call_id: string;
216
240
  } | {
241
+ type: "custom_tool_call";
217
242
  id?: string | undefined;
243
+ call_id: string;
244
+ name: string;
218
245
  input?: string | undefined;
219
246
  namespace?: string | undefined;
220
- name: string;
221
- type: "custom_tool_call";
222
- call_id: string;
223
247
  };
224
248
  } | {
249
+ type: "response.reasoning_summary_part.done";
225
250
  output_index?: number | undefined;
226
- type: "response.reasoning_summary_text.delta";
227
- delta: string;
228
251
  } | {
252
+ type: "response.function_call_arguments.done";
229
253
  output_index?: number | undefined;
230
- type: "response.reasoning_summary_part.done";
254
+ arguments: string;
231
255
  } | {
256
+ type: "response.custom_tool_call_input.done";
232
257
  output_index?: number | undefined;
233
- type: "response.reasoning_text.delta";
234
- delta: string;
258
+ input: string;
235
259
  } | {
260
+ type: "response.completed" | "response.failed" | "response.incomplete";
261
+ response: {
262
+ id?: string | undefined;
263
+ status?: "cancelled" | "completed" | "failed" | "in_progress" | "incomplete" | "queued" | undefined;
264
+ incomplete_details?: {
265
+ reason?: string | undefined;
266
+ } | null | undefined;
267
+ error?: {
268
+ code?: string | null | undefined;
269
+ message?: string | undefined;
270
+ } | null | undefined;
271
+ output?: unknown[] | undefined;
272
+ usage?: unknown;
273
+ service_tier?: unknown;
274
+ };
275
+ } | {
276
+ type: "error";
277
+ code?: string | null | undefined;
278
+ message?: string | undefined;
279
+ }, {
280
+ type: "response.custom_tool_call_input.delta";
236
281
  output_index?: number | undefined;
237
- type: "response.output_text.delta";
238
282
  delta: string;
239
283
  } | {
284
+ type: "response.function_call_arguments.delta";
240
285
  output_index?: number | undefined;
241
- type: "response.refusal.delta";
242
286
  delta: string;
243
287
  } | {
288
+ type: "response.output_text.delta";
244
289
  output_index?: number | undefined;
245
- type: "response.function_call_arguments.delta";
246
290
  delta: string;
247
291
  } | {
292
+ type: "response.reasoning_summary_text.delta";
248
293
  output_index?: number | undefined;
249
- arguments: string;
250
- type: "response.function_call_arguments.done";
294
+ delta: string;
251
295
  } | {
296
+ type: "response.reasoning_text.delta";
252
297
  output_index?: number | undefined;
253
- type: "response.custom_tool_call_input.delta";
254
298
  delta: string;
255
299
  } | {
300
+ type: "response.refusal.delta";
256
301
  output_index?: number | undefined;
257
- input: string;
258
- type: "response.custom_tool_call_input.done";
259
- } | {
260
- type: "response.completed" | "response.incomplete" | "response.failed";
261
- response: {
262
- error?: {
263
- message?: string | undefined;
264
- code?: string | null | undefined;
265
- } | null | undefined;
266
- id?: string | undefined;
267
- service_tier?: unknown;
268
- status?: "failed" | "completed" | "in_progress" | "incomplete" | "cancelled" | "queued" | undefined;
269
- usage?: unknown;
270
- output?: unknown[] | undefined;
271
- incomplete_details?: {
272
- reason?: string | undefined;
273
- } | null | undefined;
274
- };
302
+ delta: string;
275
303
  } | {
276
- message?: string | undefined;
277
- code?: string | null | undefined;
278
- type: "error";
279
- }, {
280
304
  type: "response.created";
281
305
  response: {
282
306
  id?: string | undefined;
283
307
  };
284
308
  } | {
285
- output_index?: number | undefined;
286
309
  type: "response.output_item.added" | "response.output_item.done";
310
+ output_index?: number | undefined;
287
311
  item: {
288
- content?: {
312
+ type: "reasoning";
313
+ id: string;
314
+ summary?: {
289
315
  text: string;
290
316
  }[] | undefined;
291
- summary?: {
317
+ content?: {
292
318
  text: string;
293
319
  }[] | undefined;
294
320
  encrypted_content?: string | null | undefined;
295
- id: string;
296
- type: "reasoning";
297
321
  } | {
322
+ type: "message";
298
323
  id?: string | undefined;
324
+ phase?: "commentary" | "final_answer" | null | undefined;
299
325
  content?: ({
300
- text: string;
301
326
  type: "output_text";
327
+ text: string;
302
328
  } | {
303
329
  type: "refusal";
304
330
  refusal: string;
305
331
  })[] | undefined;
306
- phase?: "commentary" | "final_answer" | null | undefined;
307
- type: "message";
308
332
  } | {
333
+ type: "function_call";
309
334
  id?: string | undefined;
335
+ call_id: string;
336
+ name: string;
310
337
  arguments?: string | undefined;
311
338
  namespace?: string | undefined;
312
- name: string;
313
- type: "function_call";
314
- call_id: string;
315
339
  } | {
340
+ type: "custom_tool_call";
316
341
  id?: string | undefined;
342
+ call_id: string;
343
+ name: string;
317
344
  input?: string | undefined;
318
345
  namespace?: string | undefined;
319
- name: string;
320
- type: "custom_tool_call";
321
- call_id: string;
322
346
  };
323
347
  } | {
324
- output_index?: number | undefined;
325
- type: "response.reasoning_summary_text.delta";
326
- delta: string;
327
- } | {
328
- output_index?: number | undefined;
329
348
  type: "response.reasoning_summary_part.done";
330
- } | {
331
- output_index?: number | undefined;
332
- type: "response.reasoning_text.delta";
333
- delta: string;
334
- } | {
335
- output_index?: number | undefined;
336
- type: "response.output_text.delta";
337
- delta: string;
338
- } | {
339
- output_index?: number | undefined;
340
- type: "response.refusal.delta";
341
- delta: string;
342
- } | {
343
349
  output_index?: number | undefined;
344
- type: "response.function_call_arguments.delta";
345
- delta: string;
346
350
  } | {
347
- output_index?: number | undefined;
348
- arguments: string;
349
351
  type: "response.function_call_arguments.done";
350
- } | {
351
352
  output_index?: number | undefined;
352
- type: "response.custom_tool_call_input.delta";
353
- delta: string;
353
+ arguments: string;
354
354
  } | {
355
+ type: "response.custom_tool_call_input.done";
355
356
  output_index?: number | undefined;
356
357
  input: string;
357
- type: "response.custom_tool_call_input.done";
358
358
  } | {
359
- type: "response.completed" | "response.incomplete" | "response.failed";
359
+ type: "response.completed" | "response.failed" | "response.incomplete";
360
360
  response: {
361
- error?: {
362
- message?: string | undefined;
363
- code?: string | null | undefined;
364
- } | null | undefined;
365
361
  id?: string | undefined;
366
- service_tier?: unknown;
367
- status?: "failed" | "completed" | "in_progress" | "incomplete" | "cancelled" | "queued" | undefined;
368
- usage?: unknown;
369
- output?: unknown[] | undefined;
362
+ status?: "cancelled" | "completed" | "failed" | "in_progress" | "incomplete" | "queued" | undefined;
370
363
  incomplete_details?: {
371
364
  reason?: string | undefined;
372
365
  } | null | undefined;
366
+ error?: {
367
+ code?: string | null | undefined;
368
+ message?: string | undefined;
369
+ } | null | undefined;
370
+ output?: unknown[] | undefined;
371
+ usage?: unknown;
372
+ service_tier?: unknown;
373
373
  };
374
374
  } | {
375
- message?: string | undefined;
376
- code?: string | null | undefined;
377
375
  type: "error";
376
+ code?: string | null | undefined;
377
+ message?: string | undefined;
378
378
  }>;
379
379
  export {};
@@ -2,17 +2,17 @@ import {
2
2
  withPriorityTier2,
3
3
  ResponsesUsageError2,
4
4
  processResponsesStream2
5
- } from "../../chunks/account-limits-cache-aazmkcnq.js";
5
+ } from "../../chunks/account-limits-cache-w0abqhna.js";
6
6
  import"../../chunks/account-limits-cache-nem079h8.js";
7
- import"../../chunks/account-limits-cache-n3yk6g5c.js";
8
- import"../../chunks/account-limits-cache-8qzk56vj.js";
7
+ import"../../chunks/account-limits-cache-s77e2bgc.js";
8
+ import"../../chunks/account-limits-cache-4qpef10z.js";
9
9
  import"../../chunks/account-limits-cache-736tdyme.js";
10
10
  import"../../chunks/account-limits-cache-h92bzz1j.js";
11
11
  import"../../chunks/account-limits-cache-eqwweapz.js";
12
12
  import"../../chunks/account-limits-cache-0af5gqeg.js";
13
13
  import"../../chunks/account-limits-cache-b4edaybk.js";
14
14
  import"../../chunks/account-limits-cache-6250ykn6.js";
15
- import"../../chunks/account-limits-cache-fbkaq46e.js";
15
+ import"../../chunks/account-limits-cache-z9mfzg68.js";
16
16
  import"../../chunks/account-limits-cache-fsktnetm.js";
17
17
  import"../../chunks/account-limits-cache-zcbkmrvy.js";
18
18
  import"../../chunks/account-limits-cache-a6cgeagz.js";
@@ -50,19 +50,19 @@ import {
50
50
  } from "../../chunks/account-limits-cache-csbxvam7.js";
51
51
  import"../../chunks/account-limits-cache-0af5gqeg.js";
52
52
  import"../../chunks/account-limits-cache-eqwweapz.js";
53
- import"../../chunks/account-limits-cache-8qzk56vj.js";
53
+ import"../../chunks/account-limits-cache-4qpef10z.js";
54
54
  import {
55
55
  convertResponsesMessages2,
56
56
  convertResponsesTools2
57
- } from "../../chunks/account-limits-cache-n3yk6g5c.js";
57
+ } from "../../chunks/account-limits-cache-s77e2bgc.js";
58
58
  import"../../chunks/account-limits-cache-zgzptd0z.js";
59
- import"../../chunks/account-limits-cache-fbkaq46e.js";
59
+ import"../../chunks/account-limits-cache-z9mfzg68.js";
60
60
  import"../../chunks/account-limits-cache-736tdyme.js";
61
61
  import"../../chunks/account-limits-cache-nem079h8.js";
62
62
  import {
63
63
  withPriorityTier2,
64
64
  processResponsesStream2
65
- } from "../../chunks/account-limits-cache-aazmkcnq.js";
65
+ } from "../../chunks/account-limits-cache-w0abqhna.js";
66
66
  import {
67
67
  readOpenAICompactResponse2
68
68
  } from "../../chunks/account-limits-cache-pfr14mcn.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openAIResponsesApi2
3
- } from "../../chunks/account-limits-cache-k8z39pe7.js";
3
+ } from "../../chunks/account-limits-cache-s4xgnvwg.js";
4
4
  import"../../chunks/account-limits-cache-90c9c2eb.js";
5
5
  import"../../chunks/account-limits-cache-fsktnetm.js";
6
6
  import"../../chunks/account-limits-cache-zcbkmrvy.js";
@@ -1,4 +1,14 @@
1
- import type { Api, AssistantMessage, Message, Model } from "../types.ts";
1
+ import type { Api, AssistantMessage, ImageContent, Message, Model, TextContent, ToolResultMessage } from "../types.ts";
2
+ /**
3
+ * Splits the images out of an error tool result, for APIs that reject anything but text in one
4
+ * (Anthropic). Send `content` as the tool result, then `caption` and `images` after all tool
5
+ * results of the turn, in the same user message. Undefined when the result needs no split.
6
+ */
7
+ export declare function splitErrorToolResultImages(msg: ToolResultMessage): {
8
+ content: TextContent[];
9
+ caption: string;
10
+ images: ImageContent[];
11
+ } | undefined;
2
12
  /**
3
13
  * Normalize tool call ID for cross-provider compatibility.
4
14
  * OpenAI Responses API generates IDs that are 450+ chars with special characters like `|`.
@@ -1,6 +1,8 @@
1
1
  import {
2
+ splitErrorToolResultImages2,
2
3
  transformMessages2
3
- } from "../../chunks/account-limits-cache-8qzk56vj.js";
4
+ } from "../../chunks/account-limits-cache-4qpef10z.js";
4
5
  export {
6
+ splitErrorToolResultImages2 as splitErrorToolResultImages,
5
7
  transformMessages2 as transformMessages
6
8
  };
@@ -3,12 +3,12 @@
3
3
  * `code=...&state=...` query string, or a bare code. Browser-safe.
4
4
  */
5
5
  export declare function parseAuthorizationInput(input: string): {
6
- code?: undefined;
7
6
  state?: undefined;
7
+ code?: undefined;
8
8
  } | {
9
9
  code: string | undefined;
10
10
  state: string | undefined;
11
11
  } | {
12
- code: string;
13
12
  state?: undefined;
13
+ code: string;
14
14
  };