@roomle/embedding-lib 10.0.0 → 11.0.0-alpha.10

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 (76) hide show
  1. package/THIRD-PARTY-NOTICES.txt +2 -2
  2. package/ai.js +86 -17
  3. package/ai.min.js +83 -13
  4. package/{browser-D6M-d6y5.mjs → browser-Cys-y5Hy.mjs} +1 -2
  5. package/chat-model-B7BO8IhK.mjs +212 -0
  6. package/chat-model-XYf503pT.mjs +213 -0
  7. package/coerce-CuLRCRlo.mjs +6 -0
  8. package/coerce-Dup0o-HR.mjs +7 -0
  9. package/{comlink-m82YLjsS.mjs → comlink-7u13Z2ZH.mjs} +2 -3
  10. package/{comlink-BYqErFai.mjs → comlink-DKhvPU0o.mjs} +1 -1
  11. package/configurator.js +7 -7
  12. package/configurator.min.js +6 -5
  13. package/construction.js +279 -22
  14. package/construction.min.js +287 -27
  15. package/continuation-CswXtOus.mjs +10 -0
  16. package/continuation-NclHDSgS.mjs +9 -0
  17. package/{dist-DCzWWudD.mjs → dist-7-X7Xqsl.mjs} +851 -919
  18. package/{dist-CjIZv2gB.mjs → dist-BMxyw-Zs.mjs} +411 -405
  19. package/{dist-wPZpiGiu.mjs → dist-BU022PnG.mjs} +4 -9
  20. package/{dist-CGgFMwb1.mjs → dist-BY8OLJ2p.mjs} +1 -1
  21. package/{dist-6TznX-Ae.mjs → dist-BZSd56sr.mjs} +3850 -3942
  22. package/{dist-Ur4DqwwC.mjs → dist-Ba3J8AjB.mjs} +400 -390
  23. package/{dist-CnTUCpLZ.mjs → dist-CbQKC1xX.mjs} +1590 -1616
  24. package/{dist-BsVeWZ8R.mjs → dist-CiybWJvs.mjs} +44 -41
  25. package/{dist-BI_3AeI-.mjs → dist-CkZuNdCU.mjs} +6 -4
  26. package/{dist-Bt1FopV4.mjs → dist-D2ZAAHGn.mjs} +1058 -1042
  27. package/{dist-Cxe4osFc.mjs → dist-DjsS42rR.mjs} +916 -962
  28. package/{dist-Cmx_tCV5.mjs → dist-Jcq_kKKT.mjs} +403 -393
  29. package/{dist-D0XFfKEL.mjs → dist-S9sLSjZ4.mjs} +3112 -3104
  30. package/{dist-BV-32IEX.mjs → dist-XECXrV5Q.mjs} +1497 -1558
  31. package/{dist-CZbrRF4T.mjs → dist-a5_BIeaS.mjs} +45 -51
  32. package/{dist-Dr3LcjP6.mjs → dist-bQAJDeYc.mjs} +698 -748
  33. package/docs/md/web/embedding/CHANGELOG.md +20 -737
  34. package/{drag-ghost-C1WS2KmW.mjs → drag-ghost-QZelgA-_.mjs} +2 -3
  35. package/{drag-ghost-B24KVqgc.mjs → drag-ghost-VmgSWLva.mjs} +5 -7
  36. package/{drag-in-O5uwMddL.mjs → drag-in-Cd_67tzS.mjs} +4 -5
  37. package/{drag-in-CWHSbwvG.mjs → drag-in-DlDsgY4T.mjs} +3 -3
  38. package/embedding-plugins.js +1 -2
  39. package/embedding-plugins.min.js +1 -2
  40. package/{experimental-evaluation-DyONuPyk.mjs → experimental-evaluation-B4hKMgFH.mjs} +19 -38
  41. package/{experimental-evaluation-DPkDk-5A.mjs → experimental-evaluation-DmqghFSx.mjs} +1 -1
  42. package/{from-custom-view-BgmiWIEN.mjs → from-custom-view-6HMD_sPe.mjs} +5 -4
  43. package/{from-custom-view-CxmIIsHU.mjs → from-custom-view-BRFynafo.mjs} +16 -16
  44. package/{from-website-CvcnHmr2.mjs → from-website-Dl1VN4h7.mjs} +5 -6
  45. package/{from-website-B8qFEG_R.mjs → from-website-iZzauH4C.mjs} +3 -3
  46. package/hi.js +311 -186
  47. package/hi.min.js +336 -215
  48. package/mcp-tools-BLB7pCga.mjs +42 -0
  49. package/mcp-tools-BirFT2R0.mjs +41 -0
  50. package/package.json +1 -1
  51. package/packages/common/src/utils/ai-model-relay.d.ts +22 -2
  52. package/packages/embedding-lib/src/ai.d.ts +3 -1
  53. package/packages/embedding-lib/src/hi.d.ts +1 -1
  54. package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +40 -2
  55. package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +1 -1
  56. package/packages/web-sdk/packages/assistant.d.ts +2 -0
  57. package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.d.ts +1 -1
  58. package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -0
  59. package/packages/web-sdk/packages/common-core/src/planning-assistant/mcp-tools.d.ts +3 -1
  60. package/packages/web-sdk/packages/common-core/src/planning-assistant/runtime.d.ts +6 -1
  61. package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +5 -1
  62. package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +3 -0
  63. package/rolldown-runtime--db92txo.mjs +10 -0
  64. package/rolldown-runtime-CyjYJMBa.mjs +11 -0
  65. package/roomle-embedding-lib.js +26 -35
  66. package/roomle-embedding-lib.min.js +4 -4
  67. package/sbom.cdx.json +5 -5
  68. package/turn-limits-9LbUeSG2.mjs +9 -0
  69. package/turn-limits-Ciq383Bd.mjs +10 -0
  70. package/{utils-BwWn6Fw4.mjs → utils-CJnKZceY.mjs} +3 -4
  71. package/{utils-BoELtcEK.mjs → utils-DdNhTbJr.mjs} +6 -6
  72. package/chat-model-CFuHw4cp.mjs +0 -322
  73. package/chat-model-JqqVnnmY.mjs +0 -327
  74. package/coerce-CqJod_GZ.mjs +0 -8
  75. package/coerce-CsI42_k0.mjs +0 -6
  76. /package/{browser-BjtSrqbu.mjs → browser-CzLpXYFF.mjs} +0 -0
@@ -1,25 +1,25 @@
1
1
 
2
- import { $ as e, $t as t, At as n, Bt as r, Dn as i, E as a, Et as o, Ft as s, H as c, Ht as l, It as u, Jt as d, K as f, M as p, N as m, Pt as h, Rt as g, S as _, Sn as v, T as y, Tt as b, U as x, Vt as S, Wt as C, X as w, Yt as T, Zt as E, _ as D, _n as ee, _t as O, an as k, bn as A, bt as j, ct as te, dn as M, dt as ne, f as N, fn as P, g as F, h as re, in as I, j as L, jn as R, jt as z, k as B, kt as V, ln as H, m as U, mt as ie, nn as ae, nt as oe, on as W, ot as G, pt as se, rn as ce, sn as K, st as q, tn as J, tt as le, un as Y, ut as ue, w as de, wt as fe, yt as pe, zt as me } from "./dist-BV-32IEX.mjs";
3
- import { t as he } from "./experimental-evaluation-DyONuPyk.mjs";
4
- //#region node_modules/@ai-sdk/anthropic/dist/index.js
5
- var X = de({
6
- errorSchema: G(() => r(k({
7
- type: J("error"),
8
- error: k({
9
- type: H(),
10
- message: H()
11
- })
12
- }))),
2
+ import { $ as e, $t as t, At as n, Bt as r, Dn as i, E as a, Et as o, Ft as s, H as c, Ht as l, It as u, Jt as d, K as f, M as p, N as m, Pt as h, Rt as g, S as _, Sn as v, T as y, Tt as b, U as x, Vt as S, Wt as C, X as ee, Yt as w, Zt as T, _ as E, _n as te, _t as D, an as O, bn as k, bt as ne, ct as re, dn as A, dt as j, f as M, fn as N, g as P, h as ie, in as F, j as I, jn as L, jt as R, k as z, kt as B, ln as V, m as H, mt as ae, nn as oe, nt as se, on as U, ot as W, pt as ce, rn as G, sn as K, st as q, tn as J, tt as le, un as Y, ut as ue, w as de, wt as fe, yt as pe, zt as me } from "./dist-XECXrV5Q.mjs";
3
+ import { t as he } from "./experimental-evaluation-B4hKMgFH.mjs";
4
+ // node_modules/@ai-sdk/anthropic/dist/index.js
5
+ var ge = W(() => r(O({
6
+ type: J("error"),
7
+ error: O({
8
+ type: V(),
9
+ message: V()
10
+ })
11
+ }))), X = de({
12
+ errorSchema: ge,
13
13
  errorToMessage: (e) => e.error.message
14
- }), ge = G(() => r(k({
15
- id: H(),
14
+ }), _e = W(() => r(O({
15
+ id: V(),
16
16
  type: J("file"),
17
- filename: H(),
18
- mime_type: H(),
19
- size_bytes: I(),
20
- created_at: H(),
21
- downloadable: T().nullish()
22
- }))), _e = class {
17
+ filename: V(),
18
+ mime_type: V(),
19
+ size_bytes: F(),
20
+ created_at: V(),
21
+ downloadable: w().nullish()
22
+ }))), ve = class {
23
23
  constructor(e) {
24
24
  this.config = e, this.specificationVersion = "v4";
25
25
  }
@@ -27,14 +27,14 @@ var X = de({
27
27
  return this.config.provider;
28
28
  }
29
29
  async uploadFile({ data: e, mediaType: t, filename: n, abortSignal: r, headers: i }) {
30
- let o = F(e), s = new Blob([o], { type: t }), c = new FormData();
30
+ let o = P(e), s = new Blob([o], { type: t }), c = new FormData();
31
31
  n == null ? c.append("file", s) : c.append("file", s, n);
32
32
  let { value: l } = await pe({
33
33
  url: `${this.config.baseURL}/files`,
34
- headers: N(this.config.headers(), { "anthropic-beta": "files-api-2025-04-14" }, i),
34
+ headers: M(this.config.headers(), { "anthropic-beta": "files-api-2025-04-14" }, i),
35
35
  formData: c,
36
36
  failedResponseHandler: X,
37
- successfulResponseHandler: a(ge),
37
+ successfulResponseHandler: a(_e),
38
38
  abortSignal: r,
39
39
  fetch: this.config.fetch
40
40
  });
@@ -52,682 +52,682 @@ var X = de({
52
52
  } }
53
53
  };
54
54
  }
55
- }, ve = k({
56
- type: H(),
57
- category: H().nullish(),
58
- explanation: H().nullish(),
59
- recommended_model: H().nullish()
60
- }), ye = k({
61
- type: H(),
62
- status: k({
63
- type: H(),
64
- tool_uses: K(H(), k({
65
- type: H(),
66
- outcome: H().nullish(),
67
- explanation: H().nullish()
55
+ }, ye = O({
56
+ type: V(),
57
+ category: V().nullish(),
58
+ explanation: V().nullish(),
59
+ recommended_model: V().nullish()
60
+ }), be = O({
61
+ type: V(),
62
+ status: O({
63
+ type: V(),
64
+ tool_uses: K(V(), O({
65
+ type: V(),
66
+ outcome: V().nullish(),
67
+ explanation: V().nullish()
68
68
  })).nullish()
69
69
  })
70
- }), Z = M([
71
- k({
70
+ }), Z = A([
71
+ O({
72
72
  type: J("code_execution_20250825"),
73
- tool_id: H()
73
+ tool_id: V()
74
74
  }),
75
- k({
75
+ O({
76
76
  type: J("code_execution_20260120"),
77
- tool_id: H()
77
+ tool_id: V()
78
78
  }),
79
- k({ type: J("direct") })
80
- ]), be = E("type", [
81
- k({
79
+ O({ type: J("direct") })
80
+ ]), xe = T("type", [
81
+ O({
82
82
  type: J("web_search_result_location"),
83
- cited_text: H(),
84
- url: H(),
85
- title: H().nullable(),
86
- encrypted_index: H()
83
+ cited_text: V(),
84
+ url: V(),
85
+ title: V().nullable(),
86
+ encrypted_index: V()
87
87
  }),
88
- k({
88
+ O({
89
89
  type: J("page_location"),
90
- cited_text: H(),
91
- document_index: I(),
92
- document_title: H().nullable(),
93
- start_page_number: I(),
94
- end_page_number: I(),
95
- file_id: H().nullish()
90
+ cited_text: V(),
91
+ document_index: F(),
92
+ document_title: V().nullable(),
93
+ start_page_number: F(),
94
+ end_page_number: F(),
95
+ file_id: V().nullish()
96
96
  }),
97
- k({
97
+ O({
98
98
  type: J("char_location"),
99
- cited_text: H(),
100
- document_index: I(),
101
- document_title: H().nullable(),
102
- start_char_index: I(),
103
- end_char_index: I(),
104
- file_id: H().nullish()
99
+ cited_text: V(),
100
+ document_index: F(),
101
+ document_title: V().nullable(),
102
+ start_char_index: F(),
103
+ end_char_index: F(),
104
+ file_id: V().nullish()
105
105
  }),
106
- k({
106
+ O({
107
107
  type: J("content_block_location"),
108
- cited_text: H(),
109
- document_index: I(),
110
- document_title: H().nullable(),
111
- start_block_index: I(),
112
- end_block_index: I(),
113
- file_id: H().nullable()
108
+ cited_text: V(),
109
+ document_index: F(),
110
+ document_title: V().nullable(),
111
+ start_block_index: F(),
112
+ end_block_index: F(),
113
+ file_id: V().nullable()
114
114
  }),
115
- k({
115
+ O({
116
116
  type: J("search_result_location"),
117
- cited_text: H(),
118
- search_result_index: I(),
119
- source: H(),
120
- title: H().nullable(),
121
- start_block_index: I(),
122
- end_block_index: I()
117
+ cited_text: V(),
118
+ search_result_index: F(),
119
+ source: V(),
120
+ title: V().nullable(),
121
+ start_block_index: F(),
122
+ end_block_index: F()
123
123
  })
124
- ]), xe = M([H(), d(M([H(), k({
124
+ ]), Se = A([V(), d(A([V(), O({
125
125
  type: J("text"),
126
- text: H(),
126
+ text: V(),
127
127
  citations: d(t()).nullable().optional()
128
- })]))]), Se = k({
129
- type: H(),
130
- path: H(),
131
- reason: H()
132
- }), Ce = G(() => r(k({
128
+ })]))]), Ce = O({
129
+ type: V(),
130
+ path: V(),
131
+ reason: V()
132
+ }), we = W(() => r(O({
133
133
  type: J("message"),
134
- id: H().nullish(),
135
- model: H().nullish(),
136
- content: d(E("type", [
137
- k({
134
+ id: V().nullish(),
135
+ model: V().nullish(),
136
+ content: d(T("type", [
137
+ O({
138
138
  type: J("text"),
139
- text: H(),
140
- citations: d(be).nullable().optional()
139
+ text: V(),
140
+ citations: d(xe).nullable().optional()
141
141
  }),
142
- k({
142
+ O({
143
143
  type: J("thinking"),
144
- thinking: H(),
145
- signature: H()
144
+ thinking: V(),
145
+ signature: V()
146
146
  }),
147
- k({
147
+ O({
148
148
  type: J("redacted_thinking"),
149
- data: H()
149
+ data: V()
150
150
  }),
151
- k({
151
+ O({
152
152
  type: J("compaction"),
153
- content: H().nullish(),
154
- signature: H().nullish()
153
+ content: V().nullish(),
154
+ signature: V().nullish()
155
155
  }),
156
- k({
156
+ O({
157
157
  type: J("tool_use"),
158
- id: H(),
159
- name: H(),
160
- input: P(),
158
+ id: V(),
159
+ name: V(),
160
+ input: N(),
161
161
  caller: Z.optional(),
162
- toolset_name: H().nullish()
162
+ toolset_name: V().nullish()
163
163
  }),
164
- k({
164
+ O({
165
165
  type: J("server_tool_use"),
166
- id: H(),
167
- name: H(),
168
- input: K(H(), P()).nullish(),
166
+ id: V(),
167
+ name: V(),
168
+ input: K(V(), N()).nullish(),
169
169
  caller: Z.optional()
170
170
  }),
171
- k({
171
+ O({
172
172
  type: J("mcp_tool_use"),
173
- id: H(),
174
- name: H(),
175
- input: P(),
176
- server_name: H()
173
+ id: V(),
174
+ name: V(),
175
+ input: N(),
176
+ server_name: V()
177
177
  }),
178
- k({
178
+ O({
179
179
  type: J("mcp_tool_result"),
180
- tool_use_id: H(),
181
- is_error: T(),
182
- content: xe
180
+ tool_use_id: V(),
181
+ is_error: w(),
182
+ content: Se
183
183
  }),
184
- k({
184
+ O({
185
185
  type: J("web_fetch_tool_result"),
186
- tool_use_id: H(),
186
+ tool_use_id: V(),
187
187
  caller: Z.optional(),
188
- content: M([k({
188
+ content: A([O({
189
189
  type: J("web_fetch_result"),
190
- url: H(),
191
- retrieved_at: H().nullable(),
192
- content: k({
190
+ url: V(),
191
+ retrieved_at: V().nullable(),
192
+ content: O({
193
193
  type: J("document"),
194
- title: H().nullable(),
195
- citations: k({ enabled: T() }).optional(),
196
- source: M([k({
194
+ title: V().nullable(),
195
+ citations: O({ enabled: w() }).optional(),
196
+ source: A([O({
197
197
  type: J("base64"),
198
198
  media_type: J("application/pdf"),
199
- data: H()
200
- }), k({
199
+ data: V()
200
+ }), O({
201
201
  type: J("text"),
202
202
  media_type: J("text/plain"),
203
- data: H()
203
+ data: V()
204
204
  })])
205
205
  })
206
- }), k({
206
+ }), O({
207
207
  type: J("web_fetch_tool_result_error"),
208
- error_code: H()
208
+ error_code: V()
209
209
  })])
210
210
  }),
211
- k({
211
+ O({
212
212
  type: J("web_search_tool_result"),
213
- tool_use_id: H(),
213
+ tool_use_id: V(),
214
214
  caller: Z.optional(),
215
- content: M([d(k({
215
+ content: A([d(O({
216
216
  type: J("web_search_result"),
217
- url: H(),
218
- title: H().nullable(),
219
- encrypted_content: H(),
220
- page_age: H().nullish()
221
- })), k({
217
+ url: V(),
218
+ title: V().nullable(),
219
+ encrypted_content: V(),
220
+ page_age: V().nullish()
221
+ })), O({
222
222
  type: J("web_search_tool_result_error"),
223
- error_code: H()
223
+ error_code: V()
224
224
  })])
225
225
  }),
226
- k({
226
+ O({
227
227
  type: J("code_execution_tool_result"),
228
- tool_use_id: H(),
229
- content: M([
230
- k({
228
+ tool_use_id: V(),
229
+ content: A([
230
+ O({
231
231
  type: J("code_execution_result"),
232
- stdout: H(),
233
- stderr: H(),
234
- return_code: I(),
235
- content: d(k({
232
+ stdout: V(),
233
+ stderr: V(),
234
+ return_code: F(),
235
+ content: d(O({
236
236
  type: J("code_execution_output"),
237
- file_id: H()
237
+ file_id: V()
238
238
  })).optional().default([])
239
239
  }),
240
- k({
240
+ O({
241
241
  type: J("encrypted_code_execution_result"),
242
- encrypted_stdout: H(),
243
- stderr: H(),
244
- return_code: I(),
245
- content: d(k({
242
+ encrypted_stdout: V(),
243
+ stderr: V(),
244
+ return_code: F(),
245
+ content: d(O({
246
246
  type: J("code_execution_output"),
247
- file_id: H()
247
+ file_id: V()
248
248
  })).optional().default([])
249
249
  }),
250
- k({
250
+ O({
251
251
  type: J("code_execution_tool_result_error"),
252
- error_code: H()
252
+ error_code: V()
253
253
  })
254
254
  ])
255
255
  }),
256
- k({
256
+ O({
257
257
  type: J("bash_code_execution_tool_result"),
258
- tool_use_id: H(),
259
- content: E("type", [k({
258
+ tool_use_id: V(),
259
+ content: T("type", [O({
260
260
  type: J("bash_code_execution_result"),
261
- content: d(k({
261
+ content: d(O({
262
262
  type: J("bash_code_execution_output"),
263
- file_id: H()
263
+ file_id: V()
264
264
  })),
265
- stdout: H(),
266
- stderr: H(),
267
- return_code: I()
268
- }), k({
265
+ stdout: V(),
266
+ stderr: V(),
267
+ return_code: F()
268
+ }), O({
269
269
  type: J("bash_code_execution_tool_result_error"),
270
- error_code: H()
270
+ error_code: V()
271
271
  })])
272
272
  }),
273
- k({
273
+ O({
274
274
  type: J("text_editor_code_execution_tool_result"),
275
- tool_use_id: H(),
276
- content: E("type", [
277
- k({
275
+ tool_use_id: V(),
276
+ content: T("type", [
277
+ O({
278
278
  type: J("text_editor_code_execution_tool_result_error"),
279
- error_code: H()
279
+ error_code: V()
280
280
  }),
281
- k({
281
+ O({
282
282
  type: J("text_editor_code_execution_view_result"),
283
- content: H(),
284
- file_type: H(),
285
- num_lines: I().nullable(),
286
- start_line: I().nullable(),
287
- total_lines: I().nullable()
283
+ content: V(),
284
+ file_type: V(),
285
+ num_lines: F().nullable(),
286
+ start_line: F().nullable(),
287
+ total_lines: F().nullable()
288
288
  }),
289
- k({
289
+ O({
290
290
  type: J("text_editor_code_execution_create_result"),
291
- is_file_update: T()
291
+ is_file_update: w()
292
292
  }),
293
- k({
293
+ O({
294
294
  type: J("text_editor_code_execution_str_replace_result"),
295
- lines: d(H()).nullable(),
296
- new_lines: I().nullable(),
297
- new_start: I().nullable(),
298
- old_lines: I().nullable(),
299
- old_start: I().nullable()
295
+ lines: d(V()).nullable(),
296
+ new_lines: F().nullable(),
297
+ new_start: F().nullable(),
298
+ old_lines: F().nullable(),
299
+ old_start: F().nullable()
300
300
  })
301
301
  ])
302
302
  }),
303
- k({
303
+ O({
304
304
  type: J("tool_search_tool_result"),
305
- tool_use_id: H(),
306
- content: M([k({
305
+ tool_use_id: V(),
306
+ content: A([O({
307
307
  type: J("tool_search_tool_search_result"),
308
- tool_references: d(k({
308
+ tool_references: d(O({
309
309
  type: J("tool_reference"),
310
- tool_name: H()
310
+ tool_name: V()
311
311
  }))
312
- }), k({
312
+ }), O({
313
313
  type: J("tool_search_tool_result_error"),
314
- error_code: H()
314
+ error_code: V()
315
315
  })])
316
316
  }),
317
- k({
317
+ O({
318
318
  type: J("container_upload"),
319
- file_id: H()
319
+ file_id: V()
320
320
  }),
321
- k({
321
+ O({
322
322
  type: J("advisor_tool_result"),
323
- tool_use_id: H(),
324
- content: E("type", [
325
- k({
323
+ tool_use_id: V(),
324
+ content: T("type", [
325
+ O({
326
326
  type: J("advisor_result"),
327
- text: H(),
328
- stop_reason: H().nullish()
327
+ text: V(),
328
+ stop_reason: V().nullish()
329
329
  }),
330
- k({
330
+ O({
331
331
  type: J("advisor_redacted_result"),
332
- encrypted_content: H(),
333
- stop_reason: H().nullish()
332
+ encrypted_content: V(),
333
+ stop_reason: V().nullish()
334
334
  }),
335
- k({
335
+ O({
336
336
  type: J("advisor_tool_result_error"),
337
- error_code: H()
337
+ error_code: V()
338
338
  })
339
339
  ])
340
340
  }),
341
- k({ type: J("fallback") })
341
+ O({ type: J("fallback") })
342
342
  ])),
343
- stop_reason: H().nullish(),
344
- stop_sequence: H().nullish(),
345
- stop_details: ve.nullish(),
346
- input_transformations: d(Se).nullish(),
347
- safeguard_results: d(ye).nullish(),
348
- usage: ae({
349
- input_tokens: I(),
350
- output_tokens: I(),
351
- output_tokens_details: k({ thinking_tokens: I().nullish() }).nullish(),
352
- cache_creation_input_tokens: I().nullish(),
353
- cache_read_input_tokens: I().nullish(),
354
- iterations: d(k({
355
- type: M([
343
+ stop_reason: V().nullish(),
344
+ stop_sequence: V().nullish(),
345
+ stop_details: ye.nullish(),
346
+ input_transformations: d(Ce).nullish(),
347
+ safeguard_results: d(be).nullish(),
348
+ usage: oe({
349
+ input_tokens: F(),
350
+ output_tokens: F(),
351
+ output_tokens_details: O({ thinking_tokens: F().nullish() }).nullish(),
352
+ cache_creation_input_tokens: F().nullish(),
353
+ cache_read_input_tokens: F().nullish(),
354
+ iterations: d(O({
355
+ type: A([
356
356
  J("compaction"),
357
357
  J("message"),
358
358
  J("advisor_message"),
359
359
  J("fallback_message")
360
360
  ]),
361
- model: H().nullish(),
362
- input_tokens: I(),
363
- output_tokens: I(),
364
- cache_creation_input_tokens: I().nullish(),
365
- cache_read_input_tokens: I().nullish()
361
+ model: V().nullish(),
362
+ input_tokens: F(),
363
+ output_tokens: F(),
364
+ cache_creation_input_tokens: F().nullish(),
365
+ cache_read_input_tokens: F().nullish()
366
366
  })).nullish()
367
367
  }),
368
- container: k({
369
- expires_at: H(),
370
- id: H(),
371
- skills: d(k({
372
- type: M([J("anthropic"), J("custom")]),
373
- skill_id: H(),
374
- version: H()
368
+ container: O({
369
+ expires_at: V(),
370
+ id: V(),
371
+ skills: d(O({
372
+ type: A([J("anthropic"), J("custom")]),
373
+ skill_id: V(),
374
+ version: V()
375
375
  })).nullish()
376
376
  }).nullish(),
377
- context_management: k({ applied_edits: d(M([
378
- k({
377
+ context_management: O({ applied_edits: d(A([
378
+ O({
379
379
  type: J("clear_tool_uses_20250919"),
380
- cleared_tool_uses: I(),
381
- cleared_input_tokens: I()
380
+ cleared_tool_uses: F(),
381
+ cleared_input_tokens: F()
382
382
  }),
383
- k({
383
+ O({
384
384
  type: J("clear_thinking_20251015"),
385
- cleared_thinking_turns: I(),
386
- cleared_input_tokens: I()
385
+ cleared_thinking_turns: F(),
386
+ cleared_input_tokens: F()
387
387
  }),
388
- k({ type: J("compact_20260112") })
388
+ O({ type: J("compact_20260112") })
389
389
  ])) }).nullish()
390
- }))), we = G(() => r(E("type", [
391
- k({
390
+ }))), Te = W(() => r(T("type", [
391
+ O({
392
392
  type: J("message_start"),
393
- message: k({
394
- id: H().nullish(),
395
- model: H().nullish(),
396
- role: H().nullish(),
397
- usage: ae({
398
- input_tokens: I(),
399
- cache_creation_input_tokens: I().nullish(),
400
- cache_read_input_tokens: I().nullish()
393
+ message: O({
394
+ id: V().nullish(),
395
+ model: V().nullish(),
396
+ role: V().nullish(),
397
+ usage: oe({
398
+ input_tokens: F(),
399
+ cache_creation_input_tokens: F().nullish(),
400
+ cache_read_input_tokens: F().nullish()
401
401
  }),
402
- content: d(E("type", [k({
402
+ content: d(T("type", [O({
403
403
  type: J("tool_use"),
404
- id: H(),
405
- name: H(),
406
- input: P(),
404
+ id: V(),
405
+ name: V(),
406
+ input: N(),
407
407
  caller: Z.optional(),
408
- toolset_name: H().nullish()
408
+ toolset_name: V().nullish()
409
409
  })])).nullish(),
410
- stop_reason: H().nullish(),
411
- input_transformations: d(Se).nullish(),
412
- container: k({
413
- expires_at: H(),
414
- id: H()
410
+ stop_reason: V().nullish(),
411
+ input_transformations: d(Ce).nullish(),
412
+ container: O({
413
+ expires_at: V(),
414
+ id: V()
415
415
  }).nullish()
416
416
  })
417
417
  }),
418
- k({
418
+ O({
419
419
  type: J("content_block_start"),
420
- index: I(),
421
- content_block: E("type", [
422
- k({
420
+ index: F(),
421
+ content_block: T("type", [
422
+ O({
423
423
  type: J("text"),
424
- text: H()
424
+ text: V()
425
425
  }),
426
- k({
426
+ O({
427
427
  type: J("thinking"),
428
- thinking: H()
428
+ thinking: V()
429
429
  }),
430
- k({
430
+ O({
431
431
  type: J("tool_use"),
432
- id: H(),
433
- name: H(),
434
- input: K(H(), P()).optional(),
432
+ id: V(),
433
+ name: V(),
434
+ input: K(V(), N()).optional(),
435
435
  caller: Z.optional(),
436
- toolset_name: H().nullish()
436
+ toolset_name: V().nullish()
437
437
  }),
438
- k({
438
+ O({
439
439
  type: J("redacted_thinking"),
440
- data: H()
440
+ data: V()
441
441
  }),
442
- k({
442
+ O({
443
443
  type: J("compaction"),
444
- content: H().nullish(),
445
- signature: H().nullish()
444
+ content: V().nullish(),
445
+ signature: V().nullish()
446
446
  }),
447
- k({
447
+ O({
448
448
  type: J("server_tool_use"),
449
- id: H(),
450
- name: H(),
451
- input: K(H(), P()).nullish(),
449
+ id: V(),
450
+ name: V(),
451
+ input: K(V(), N()).nullish(),
452
452
  caller: Z.optional()
453
453
  }),
454
- k({
454
+ O({
455
455
  type: J("mcp_tool_use"),
456
- id: H(),
457
- name: H(),
458
- input: P(),
459
- server_name: H()
456
+ id: V(),
457
+ name: V(),
458
+ input: N(),
459
+ server_name: V()
460
460
  }),
461
- k({
461
+ O({
462
462
  type: J("mcp_tool_result"),
463
- tool_use_id: H(),
464
- is_error: T(),
465
- content: xe
463
+ tool_use_id: V(),
464
+ is_error: w(),
465
+ content: Se
466
466
  }),
467
- k({
467
+ O({
468
468
  type: J("web_fetch_tool_result"),
469
- tool_use_id: H(),
469
+ tool_use_id: V(),
470
470
  caller: Z.optional(),
471
- content: M([k({
471
+ content: A([O({
472
472
  type: J("web_fetch_result"),
473
- url: H(),
474
- retrieved_at: H().nullable(),
475
- content: k({
473
+ url: V(),
474
+ retrieved_at: V().nullable(),
475
+ content: O({
476
476
  type: J("document"),
477
- title: H().nullable(),
478
- citations: k({ enabled: T() }).optional(),
479
- source: M([k({
477
+ title: V().nullable(),
478
+ citations: O({ enabled: w() }).optional(),
479
+ source: A([O({
480
480
  type: J("base64"),
481
481
  media_type: J("application/pdf"),
482
- data: H()
483
- }), k({
482
+ data: V()
483
+ }), O({
484
484
  type: J("text"),
485
485
  media_type: J("text/plain"),
486
- data: H()
486
+ data: V()
487
487
  })])
488
488
  })
489
- }), k({
489
+ }), O({
490
490
  type: J("web_fetch_tool_result_error"),
491
- error_code: H()
491
+ error_code: V()
492
492
  })])
493
493
  }),
494
- k({
494
+ O({
495
495
  type: J("web_search_tool_result"),
496
- tool_use_id: H(),
496
+ tool_use_id: V(),
497
497
  caller: Z.optional(),
498
- content: M([d(k({
498
+ content: A([d(O({
499
499
  type: J("web_search_result"),
500
- url: H(),
501
- title: H().nullable(),
502
- encrypted_content: H(),
503
- page_age: H().nullish()
504
- })), k({
500
+ url: V(),
501
+ title: V().nullable(),
502
+ encrypted_content: V(),
503
+ page_age: V().nullish()
504
+ })), O({
505
505
  type: J("web_search_tool_result_error"),
506
- error_code: H()
506
+ error_code: V()
507
507
  })])
508
508
  }),
509
- k({
509
+ O({
510
510
  type: J("code_execution_tool_result"),
511
- tool_use_id: H(),
512
- content: M([
513
- k({
511
+ tool_use_id: V(),
512
+ content: A([
513
+ O({
514
514
  type: J("code_execution_result"),
515
- stdout: H(),
516
- stderr: H(),
517
- return_code: I(),
518
- content: d(k({
515
+ stdout: V(),
516
+ stderr: V(),
517
+ return_code: F(),
518
+ content: d(O({
519
519
  type: J("code_execution_output"),
520
- file_id: H()
520
+ file_id: V()
521
521
  })).optional().default([])
522
522
  }),
523
- k({
523
+ O({
524
524
  type: J("encrypted_code_execution_result"),
525
- encrypted_stdout: H(),
526
- stderr: H(),
527
- return_code: I(),
528
- content: d(k({
525
+ encrypted_stdout: V(),
526
+ stderr: V(),
527
+ return_code: F(),
528
+ content: d(O({
529
529
  type: J("code_execution_output"),
530
- file_id: H()
530
+ file_id: V()
531
531
  })).optional().default([])
532
532
  }),
533
- k({
533
+ O({
534
534
  type: J("code_execution_tool_result_error"),
535
- error_code: H()
535
+ error_code: V()
536
536
  })
537
537
  ])
538
538
  }),
539
- k({
539
+ O({
540
540
  type: J("bash_code_execution_tool_result"),
541
- tool_use_id: H(),
542
- content: E("type", [k({
541
+ tool_use_id: V(),
542
+ content: T("type", [O({
543
543
  type: J("bash_code_execution_result"),
544
- content: d(k({
544
+ content: d(O({
545
545
  type: J("bash_code_execution_output"),
546
- file_id: H()
546
+ file_id: V()
547
547
  })),
548
- stdout: H(),
549
- stderr: H(),
550
- return_code: I()
551
- }), k({
548
+ stdout: V(),
549
+ stderr: V(),
550
+ return_code: F()
551
+ }), O({
552
552
  type: J("bash_code_execution_tool_result_error"),
553
- error_code: H()
553
+ error_code: V()
554
554
  })])
555
555
  }),
556
- k({
556
+ O({
557
557
  type: J("text_editor_code_execution_tool_result"),
558
- tool_use_id: H(),
559
- content: E("type", [
560
- k({
558
+ tool_use_id: V(),
559
+ content: T("type", [
560
+ O({
561
561
  type: J("text_editor_code_execution_tool_result_error"),
562
- error_code: H()
562
+ error_code: V()
563
563
  }),
564
- k({
564
+ O({
565
565
  type: J("text_editor_code_execution_view_result"),
566
- content: H(),
567
- file_type: H(),
568
- num_lines: I().nullable(),
569
- start_line: I().nullable(),
570
- total_lines: I().nullable()
566
+ content: V(),
567
+ file_type: V(),
568
+ num_lines: F().nullable(),
569
+ start_line: F().nullable(),
570
+ total_lines: F().nullable()
571
571
  }),
572
- k({
572
+ O({
573
573
  type: J("text_editor_code_execution_create_result"),
574
- is_file_update: T()
574
+ is_file_update: w()
575
575
  }),
576
- k({
576
+ O({
577
577
  type: J("text_editor_code_execution_str_replace_result"),
578
- lines: d(H()).nullable(),
579
- new_lines: I().nullable(),
580
- new_start: I().nullable(),
581
- old_lines: I().nullable(),
582
- old_start: I().nullable()
578
+ lines: d(V()).nullable(),
579
+ new_lines: F().nullable(),
580
+ new_start: F().nullable(),
581
+ old_lines: F().nullable(),
582
+ old_start: F().nullable()
583
583
  })
584
584
  ])
585
585
  }),
586
- k({
586
+ O({
587
587
  type: J("tool_search_tool_result"),
588
- tool_use_id: H(),
589
- content: M([k({
588
+ tool_use_id: V(),
589
+ content: A([O({
590
590
  type: J("tool_search_tool_search_result"),
591
- tool_references: d(k({
591
+ tool_references: d(O({
592
592
  type: J("tool_reference"),
593
- tool_name: H()
593
+ tool_name: V()
594
594
  }))
595
- }), k({
595
+ }), O({
596
596
  type: J("tool_search_tool_result_error"),
597
- error_code: H()
597
+ error_code: V()
598
598
  })])
599
599
  }),
600
- k({
600
+ O({
601
601
  type: J("advisor_tool_result"),
602
- tool_use_id: H(),
603
- content: E("type", [
604
- k({
602
+ tool_use_id: V(),
603
+ content: T("type", [
604
+ O({
605
605
  type: J("advisor_result"),
606
- text: H(),
607
- stop_reason: H().nullish()
606
+ text: V(),
607
+ stop_reason: V().nullish()
608
608
  }),
609
- k({
609
+ O({
610
610
  type: J("advisor_redacted_result"),
611
- encrypted_content: H(),
612
- stop_reason: H().nullish()
611
+ encrypted_content: V(),
612
+ stop_reason: V().nullish()
613
613
  }),
614
- k({
614
+ O({
615
615
  type: J("advisor_tool_result_error"),
616
- error_code: H()
616
+ error_code: V()
617
617
  })
618
618
  ])
619
619
  }),
620
- k({ type: J("fallback") })
620
+ O({ type: J("fallback") })
621
621
  ])
622
622
  }),
623
- k({
623
+ O({
624
624
  type: J("content_block_delta"),
625
- index: I(),
626
- delta: E("type", [
627
- k({
625
+ index: F(),
626
+ delta: T("type", [
627
+ O({
628
628
  type: J("input_json_delta"),
629
- partial_json: H()
629
+ partial_json: V()
630
630
  }),
631
- k({
631
+ O({
632
632
  type: J("text_delta"),
633
- text: H()
633
+ text: V()
634
634
  }),
635
- k({
635
+ O({
636
636
  type: J("thinking_delta"),
637
- thinking: H()
637
+ thinking: V()
638
638
  }),
639
- k({
639
+ O({
640
640
  type: J("signature_delta"),
641
- signature: H()
641
+ signature: V()
642
642
  }),
643
- k({
643
+ O({
644
644
  type: J("compaction_delta"),
645
- content: H().nullish()
645
+ content: V().nullish()
646
646
  }),
647
- k({
647
+ O({
648
648
  type: J("citations_delta"),
649
- citation: be
649
+ citation: xe
650
650
  })
651
651
  ])
652
652
  }),
653
- k({
653
+ O({
654
654
  type: J("content_block_stop"),
655
- index: I()
655
+ index: F()
656
656
  }),
657
- k({
657
+ O({
658
658
  type: J("error"),
659
- error: k({
660
- type: H(),
661
- message: H(),
662
- code: M([H(), I()]).nullish(),
663
- statusCode: I().nullish(),
664
- isRetryable: T().nullish(),
665
- data: P().nullish()
659
+ error: O({
660
+ type: V(),
661
+ message: V(),
662
+ code: A([V(), F()]).nullish(),
663
+ statusCode: F().nullish(),
664
+ isRetryable: w().nullish(),
665
+ data: N().nullish()
666
666
  })
667
667
  }),
668
- k({
668
+ O({
669
669
  type: J("message_delta"),
670
- delta: k({
671
- stop_reason: H().nullish(),
672
- stop_sequence: H().nullish(),
673
- stop_details: ve.nullish(),
674
- safeguard_results: d(ye).nullish(),
675
- container: k({
676
- expires_at: H(),
677
- id: H(),
678
- skills: d(k({
679
- type: M([J("anthropic"), J("custom")]),
680
- skill_id: H(),
681
- version: H()
670
+ delta: O({
671
+ stop_reason: V().nullish(),
672
+ stop_sequence: V().nullish(),
673
+ stop_details: ye.nullish(),
674
+ safeguard_results: d(be).nullish(),
675
+ container: O({
676
+ expires_at: V(),
677
+ id: V(),
678
+ skills: d(O({
679
+ type: A([J("anthropic"), J("custom")]),
680
+ skill_id: V(),
681
+ version: V()
682
682
  })).nullish()
683
683
  }).nullish()
684
684
  }),
685
- usage: ae({
686
- input_tokens: I().nullish(),
687
- output_tokens: I(),
688
- output_tokens_details: k({ thinking_tokens: I().nullish() }).nullish(),
689
- cache_creation_input_tokens: I().nullish(),
690
- cache_read_input_tokens: I().nullish(),
691
- iterations: d(k({
692
- type: M([
685
+ usage: oe({
686
+ input_tokens: F().nullish(),
687
+ output_tokens: F(),
688
+ output_tokens_details: O({ thinking_tokens: F().nullish() }).nullish(),
689
+ cache_creation_input_tokens: F().nullish(),
690
+ cache_read_input_tokens: F().nullish(),
691
+ iterations: d(O({
692
+ type: A([
693
693
  J("compaction"),
694
694
  J("message"),
695
695
  J("advisor_message"),
696
696
  J("fallback_message")
697
697
  ]),
698
- model: H().nullish(),
699
- input_tokens: I(),
700
- output_tokens: I(),
701
- cache_creation_input_tokens: I().nullish(),
702
- cache_read_input_tokens: I().nullish()
698
+ model: V().nullish(),
699
+ input_tokens: F(),
700
+ output_tokens: F(),
701
+ cache_creation_input_tokens: F().nullish(),
702
+ cache_read_input_tokens: F().nullish()
703
703
  })).nullish()
704
704
  }),
705
- input_transformations: d(Se).nullish(),
706
- context_management: k({ applied_edits: d(M([
707
- k({
705
+ input_transformations: d(Ce).nullish(),
706
+ context_management: O({ applied_edits: d(A([
707
+ O({
708
708
  type: J("clear_tool_uses_20250919"),
709
- cleared_tool_uses: I(),
710
- cleared_input_tokens: I()
709
+ cleared_tool_uses: F(),
710
+ cleared_input_tokens: F()
711
711
  }),
712
- k({
712
+ O({
713
713
  type: J("clear_thinking_20251015"),
714
- cleared_thinking_turns: I(),
715
- cleared_input_tokens: I()
714
+ cleared_thinking_turns: F(),
715
+ cleared_input_tokens: F()
716
716
  }),
717
- k({ type: J("compact_20260112") })
717
+ O({ type: J("compact_20260112") })
718
718
  ])) }).nullish()
719
719
  }),
720
- k({ type: J("message_stop") }),
721
- k({ type: J("ping") })
722
- ]))), Te = G(() => r(k({
723
- signature: H().optional(),
724
- redactedData: H().optional()
725
- }))), Ee = k({
726
- containerUpload: T().optional(),
727
- citations: k({ enabled: T() }).optional(),
728
- title: H().optional(),
729
- context: H().optional()
730
- }), De = k({
720
+ O({ type: J("message_stop") }),
721
+ O({ type: J("ping") })
722
+ ]))), Ee = W(() => r(O({
723
+ signature: V().optional(),
724
+ redactedData: V().optional()
725
+ }))), De = O({
726
+ containerUpload: w().optional(),
727
+ citations: O({ enabled: w() }).optional(),
728
+ title: V().optional(),
729
+ context: V().optional()
730
+ }), Oe = O({
731
731
  clearAt: J("next_user_message").optional(),
732
732
  effort: C([
733
733
  "low",
@@ -736,69 +736,69 @@ var X = de({
736
736
  "xhigh",
737
737
  "max"
738
738
  ]).optional(),
739
- toolChanges: d(E("type", [k({
739
+ toolChanges: d(T("type", [O({
740
740
  type: J("tool_addition"),
741
- toolName: H()
742
- }), k({
741
+ toolName: V()
742
+ }), O({
743
743
  type: J("tool_removal"),
744
- toolName: H()
744
+ toolName: V()
745
745
  })])).optional()
746
- }), Oe = k({
747
- sendReasoning: T().optional(),
746
+ }), ke = O({
747
+ sendReasoning: w().optional(),
748
748
  structuredOutputMode: C([
749
749
  "outputFormat",
750
750
  "jsonTool",
751
751
  "auto"
752
752
  ]).optional(),
753
- thinking: M([E("type", [
754
- k({
753
+ thinking: A([T("type", [
754
+ O({
755
755
  type: J("adaptive"),
756
756
  display: C([
757
757
  "omitted",
758
758
  "summarized",
759
759
  "updates"
760
760
  ]).optional(),
761
- blockBinding: k({ prefixMismatchBehavior: C(["error", "drop_block"]) }).optional()
761
+ blockBinding: O({ prefixMismatchBehavior: C(["error", "drop_block"]) }).optional()
762
762
  }),
763
- k({
763
+ O({
764
764
  type: J("enabled"),
765
- budgetTokens: I().optional()
765
+ budgetTokens: F().optional()
766
766
  }),
767
- k({ type: J("disabled") }),
768
- k({ type: J("between_tools") })
769
- ]), k({
770
- type: ce().optional(),
771
- blockBinding: k({ prefixMismatchBehavior: C(["error", "drop_block"]) })
767
+ O({ type: J("disabled") }),
768
+ O({ type: J("between_tools") })
769
+ ]), O({
770
+ type: G().optional(),
771
+ blockBinding: O({ prefixMismatchBehavior: C(["error", "drop_block"]) })
772
772
  })]).optional(),
773
- disableParallelToolUse: T().optional(),
774
- cacheControl: k({
773
+ disableParallelToolUse: w().optional(),
774
+ cacheControl: O({
775
775
  type: J("ephemeral"),
776
- ttl: M([J("5m"), J("1h")]).optional()
776
+ ttl: A([J("5m"), J("1h")]).optional()
777
777
  }).optional(),
778
- metadata: k({ userId: H().optional() }).optional(),
779
- mcpServers: d(k({
778
+ metadata: O({ userId: V().optional() }).optional(),
779
+ mcpServers: d(O({
780
780
  type: J("url"),
781
- name: H(),
782
- url: H(),
783
- authorizationToken: H().nullish(),
784
- toolConfiguration: k({
785
- enabled: T().nullish(),
786
- allowedTools: d(H()).nullish()
781
+ name: V(),
782
+ url: V(),
783
+ authorizationToken: V().nullish(),
784
+ toolConfiguration: O({
785
+ enabled: w().nullish(),
786
+ allowedTools: d(V()).nullish()
787
787
  }).nullish()
788
788
  })).optional(),
789
- container: k({
790
- id: H().optional(),
791
- skills: d(E("type", [k({
789
+ container: O({
790
+ id: V().optional(),
791
+ skills: d(T("type", [O({
792
792
  type: J("anthropic"),
793
- skillId: H(),
794
- version: H().optional()
795
- }), k({
793
+ skillId: V(),
794
+ version: V().optional()
795
+ }), O({
796
796
  type: J("custom"),
797
- providerReference: K(H(), H()),
798
- version: H().optional()
797
+ providerReference: K(V(), V()),
798
+ version: V().optional()
799
799
  })])).optional()
800
800
  }).optional(),
801
- toolStreaming: T().optional(),
801
+ toolStreaming: w().optional(),
802
802
  effort: C([
803
803
  "low",
804
804
  "medium",
@@ -806,131 +806,125 @@ var X = de({
806
806
  "xhigh",
807
807
  "max"
808
808
  ]).optional(),
809
- taskBudget: k({
809
+ taskBudget: O({
810
810
  type: J("tokens"),
811
- total: I().int().min(2e4),
812
- remaining: I().int().min(0).optional()
811
+ total: F().int().min(2e4),
812
+ remaining: F().int().min(0).optional()
813
813
  }).optional(),
814
814
  speed: C(["fast", "standard"]).optional(),
815
815
  serviceTier: C(["auto", "standard_only"]).optional(),
816
816
  inferenceGeo: C(["us", "global"]).optional(),
817
- fallbacks: M([J("default"), d(k({
818
- model: H(),
819
- max_tokens: I().int().optional(),
820
- thinking: K(H(), P()).optional(),
821
- output_config: K(H(), P()).optional(),
817
+ fallbacks: A([J("default"), d(O({
818
+ model: V(),
819
+ max_tokens: F().int().optional(),
820
+ thinking: K(V(), N()).optional(),
821
+ output_config: K(V(), N()).optional(),
822
822
  speed: C(["fast", "standard"]).optional()
823
823
  }))]).optional(),
824
- anthropicBeta: d(H()).optional(),
825
- safeguards: d(k({
824
+ anthropicBeta: d(V()).optional(),
825
+ safeguards: d(O({
826
826
  type: J("dangerous_tool_use"),
827
- classifierContext: K(H(), P()).optional()
827
+ classifierContext: K(V(), N()).optional()
828
828
  })).optional(),
829
- compaction: k({
829
+ compaction: O({
830
830
  type: J("summarize"),
831
- instructions: H().optional()
831
+ instructions: V().optional()
832
832
  }).optional(),
833
- contextManagement: k({ edits: d(E("type", [
834
- k({
833
+ contextManagement: O({ edits: d(T("type", [
834
+ O({
835
835
  type: J("clear_tool_uses_20250919"),
836
- trigger: E("type", [k({
836
+ trigger: T("type", [O({
837
837
  type: J("input_tokens"),
838
- value: I()
839
- }), k({
838
+ value: F()
839
+ }), O({
840
840
  type: J("tool_uses"),
841
- value: I()
841
+ value: F()
842
842
  })]).optional(),
843
- keep: k({
843
+ keep: O({
844
844
  type: J("tool_uses"),
845
- value: I()
845
+ value: F()
846
846
  }).optional(),
847
- clearAtLeast: k({
847
+ clearAtLeast: O({
848
848
  type: J("input_tokens"),
849
- value: I()
849
+ value: F()
850
850
  }).optional(),
851
- clearToolInputs: T().optional(),
852
- excludeTools: d(H()).optional()
851
+ clearToolInputs: w().optional(),
852
+ excludeTools: d(V()).optional()
853
853
  }),
854
- k({
854
+ O({
855
855
  type: J("clear_thinking_20251015"),
856
- keep: M([J("all"), k({
856
+ keep: A([J("all"), O({
857
857
  type: J("thinking_turns"),
858
- value: I()
858
+ value: F()
859
859
  })]).optional()
860
860
  }),
861
- k({
861
+ O({
862
862
  type: J("compact_20260112"),
863
- trigger: k({
863
+ trigger: O({
864
864
  type: J("input_tokens"),
865
- value: I()
865
+ value: F()
866
866
  }).optional(),
867
- pauseAfterCompaction: T().optional(),
868
- instructions: H().optional()
867
+ pauseAfterCompaction: w().optional(),
868
+ instructions: V().optional()
869
869
  })
870
870
  ])) }).optional()
871
- }), ke = 4;
872
- function Ae(e) {
871
+ }), Ae = 4;
872
+ function je(e) {
873
873
  let t = e?.anthropic;
874
874
  return t?.cacheControl ?? t?.cache_control;
875
875
  }
876
- var je = class {
876
+ var Me = class {
877
877
  constructor() {
878
878
  this.breakpointCount = 0, this.warnings = [];
879
879
  }
880
880
  getCacheControl(e, t) {
881
- let n = Ae(e);
881
+ let n = je(e);
882
882
  if (n) {
883
- if (!t.canCache) {
884
- this.warnings.push({
885
- type: "unsupported",
886
- feature: "cache_control on non-cacheable context",
887
- details: `cache_control cannot be set on ${t.type}. It will be ignored.`
888
- });
889
- return;
890
- }
891
- if (this.breakpointCount++, this.breakpointCount > ke) {
892
- this.warnings.push({
893
- type: "unsupported",
894
- feature: "cacheControl breakpoint limit",
895
- details: `Maximum ${ke} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`
896
- });
897
- return;
898
- }
899
- return n;
883
+ if (!t.canCache) this.warnings.push({
884
+ type: "unsupported",
885
+ feature: "cache_control on non-cacheable context",
886
+ details: `cache_control cannot be set on ${t.type}. It will be ignored.`
887
+ });
888
+ else if (this.breakpointCount++, this.breakpointCount > Ae) this.warnings.push({
889
+ type: "unsupported",
890
+ feature: "cacheControl breakpoint limit",
891
+ details: `Maximum ${Ae} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`
892
+ });
893
+ else return n;
900
894
  }
901
895
  }
902
896
  getWarnings() {
903
897
  return this.warnings;
904
898
  }
905
- }, Me = G(() => r(k({
906
- model: H(),
907
- maxUses: I().optional(),
908
- maxTokens: I().int().min(1024).optional(),
909
- caching: k({
899
+ }, Ne = W(() => r(O({
900
+ model: V(),
901
+ maxUses: F().optional(),
902
+ maxTokens: F().int().min(1024).optional(),
903
+ caching: O({
910
904
  type: J("ephemeral"),
911
- ttl: M([J("5m"), J("1h")])
905
+ ttl: A([J("5m"), J("1h")])
912
906
  }).optional()
913
- }))), Ne = G(() => r(E("type", [
914
- k({
907
+ }))), Pe = W(() => r(T("type", [
908
+ O({
915
909
  type: J("advisor_result"),
916
- text: H(),
917
- stopReason: H().optional()
910
+ text: V(),
911
+ stopReason: V().optional()
918
912
  }),
919
- k({
913
+ O({
920
914
  type: J("advisor_redacted_result"),
921
- encryptedContent: H(),
922
- stopReason: H().optional()
915
+ encryptedContent: V(),
916
+ stopReason: V().optional()
923
917
  }),
924
- k({
918
+ O({
925
919
  type: J("advisor_tool_result_error"),
926
- errorCode: H()
920
+ errorCode: V()
927
921
  })
928
- ]))), Pe = L({
922
+ ]))), Fe = W(() => r(O({}).strict())), Ie = I({
929
923
  id: "anthropic.advisor_20260301",
930
- inputSchema: G(() => r(k({}).strict())),
931
- outputSchema: Ne,
924
+ inputSchema: Fe,
925
+ outputSchema: Pe,
932
926
  supportsDeferredResults: !0
933
- }), Fe = (e) => Pe(e), Ie = [
927
+ }), Le = (e) => Ie(e), Re = [
934
928
  "screenshot",
935
929
  "zoom",
936
930
  "left_click",
@@ -948,209 +942,209 @@ var je = class {
948
942
  "key",
949
943
  "hold_key",
950
944
  "wait"
951
- ], Le = G(() => r(k({
952
- action: C(Ie),
953
- coordinate: Y([I().int(), I().int()]).optional(),
954
- duration: I().optional(),
945
+ ], ze = W(() => r(O({
946
+ action: C(Re),
947
+ coordinate: Y([F().int(), F().int()]).optional(),
948
+ duration: F().optional(),
955
949
  region: Y([
956
- I().int(),
957
- I().int(),
958
- I().int(),
959
- I().int()
950
+ F().int(),
951
+ F().int(),
952
+ F().int(),
953
+ F().int()
960
954
  ]).optional(),
961
- repeat: I().int().optional(),
962
- scroll_amount: I().optional(),
955
+ repeat: F().int().optional(),
956
+ scroll_amount: F().optional(),
963
957
  scroll_direction: C([
964
958
  "up",
965
959
  "down",
966
960
  "left",
967
961
  "right"
968
962
  ]).optional(),
969
- start_coordinate: Y([I().int(), I().int()]).optional(),
970
- text: H().optional()
971
- }))), Re = G(() => r(k({ configs: W(C(Ie), k({
972
- enabled: T().optional(),
973
- deferLoading: T().optional()
974
- })).optional() }))), ze = B({
963
+ start_coordinate: Y([F().int(), F().int()]).optional(),
964
+ text: V().optional()
965
+ }))), Be = W(() => r(O({ configs: U(C(Re), O({
966
+ enabled: w().optional(),
967
+ deferLoading: w().optional()
968
+ })).optional() }))), Ve = z({
975
969
  id: "anthropic.computer_toolset_20260801",
976
- inputSchema: Le
977
- }), Be = G(() => r(k({ maxCharacters: I().optional() }))), Ve = B({
970
+ inputSchema: ze
971
+ }), He = W(() => r(O({ maxCharacters: F().optional() }))), Ue = W(() => r(O({
972
+ command: C([
973
+ "view",
974
+ "create",
975
+ "str_replace",
976
+ "insert"
977
+ ]),
978
+ path: V(),
979
+ file_text: V().optional(),
980
+ insert_line: F().int().optional(),
981
+ new_str: V().optional(),
982
+ insert_text: V().optional(),
983
+ old_str: V().optional(),
984
+ view_range: d(F().int()).optional()
985
+ }))), We = z({
978
986
  id: "anthropic.text_editor_20250728",
979
- inputSchema: G(() => r(k({
980
- command: C([
981
- "view",
982
- "create",
983
- "str_replace",
984
- "insert"
985
- ]),
986
- path: H(),
987
- file_text: H().optional(),
988
- insert_line: I().int().optional(),
989
- new_str: H().optional(),
990
- insert_text: H().optional(),
991
- old_str: H().optional(),
992
- view_range: d(I().int()).optional()
993
- })))
994
- }), He = (e = {}) => Ve(e), Ue = G(() => r(k({
995
- maxUses: I().optional(),
996
- allowedDomains: d(H()).optional(),
997
- blockedDomains: d(H()).optional(),
998
- userLocation: k({
987
+ inputSchema: Ue
988
+ }), Ge = (e = {}) => We(e), Ke = W(() => r(O({
989
+ maxUses: F().optional(),
990
+ allowedDomains: d(V()).optional(),
991
+ blockedDomains: d(V()).optional(),
992
+ userLocation: O({
999
993
  type: J("approximate"),
1000
- city: H().optional(),
1001
- region: H().optional(),
1002
- country: H().optional(),
1003
- timezone: H().optional()
994
+ city: V().optional(),
995
+ region: V().optional(),
996
+ country: V().optional(),
997
+ timezone: V().optional()
1004
998
  }).optional(),
1005
999
  responseInclusion: C(["full", "excluded"]).optional()
1006
- }))), We = G(() => r(d(k({
1007
- url: H(),
1008
- title: H().nullable(),
1009
- pageAge: H().nullable(),
1010
- encryptedContent: H(),
1000
+ }))), qe = W(() => r(d(O({
1001
+ url: V(),
1002
+ title: V().nullable(),
1003
+ pageAge: V().nullable(),
1004
+ encryptedContent: V(),
1011
1005
  type: J("web_search_result")
1012
- })))), Ge = L({
1006
+ })))), Je = W(() => r(O({ query: V() }))), Ye = I({
1013
1007
  id: "anthropic.web_search_20260318",
1014
- inputSchema: G(() => r(k({ query: H() }))),
1015
- outputSchema: We,
1008
+ inputSchema: Je,
1009
+ outputSchema: qe,
1016
1010
  supportsDeferredResults: !0
1017
- }), Ke = (e = {}) => Ge(e), qe = G(() => r(k({
1018
- maxUses: I().optional(),
1019
- allowedDomains: d(H()).optional(),
1020
- blockedDomains: d(H()).optional(),
1021
- userLocation: k({
1011
+ }), Xe = (e = {}) => Ye(e), Ze = W(() => r(O({
1012
+ maxUses: F().optional(),
1013
+ allowedDomains: d(V()).optional(),
1014
+ blockedDomains: d(V()).optional(),
1015
+ userLocation: O({
1022
1016
  type: J("approximate"),
1023
- city: H().optional(),
1024
- region: H().optional(),
1025
- country: H().optional(),
1026
- timezone: H().optional()
1017
+ city: V().optional(),
1018
+ region: V().optional(),
1019
+ country: V().optional(),
1020
+ timezone: V().optional()
1027
1021
  }).optional()
1028
- }))), Je = G(() => r(d(k({
1029
- url: H(),
1030
- title: H().nullable(),
1031
- pageAge: H().nullable(),
1032
- encryptedContent: H(),
1022
+ }))), Qe = W(() => r(d(O({
1023
+ url: V(),
1024
+ title: V().nullable(),
1025
+ pageAge: V().nullable(),
1026
+ encryptedContent: V(),
1033
1027
  type: J("web_search_result")
1034
- })))), Ye = L({
1028
+ })))), $e = W(() => r(O({ query: V() }))), et = I({
1035
1029
  id: "anthropic.web_search_20260209",
1036
- inputSchema: G(() => r(k({ query: H() }))),
1037
- outputSchema: Je,
1030
+ inputSchema: $e,
1031
+ outputSchema: Qe,
1038
1032
  supportsDeferredResults: !0
1039
- }), Xe = (e = {}) => Ye(e), Ze = G(() => r(k({
1040
- maxUses: I().optional(),
1041
- allowedDomains: d(H()).optional(),
1042
- blockedDomains: d(H()).optional(),
1043
- userLocation: k({
1033
+ }), tt = (e = {}) => et(e), nt = W(() => r(O({
1034
+ maxUses: F().optional(),
1035
+ allowedDomains: d(V()).optional(),
1036
+ blockedDomains: d(V()).optional(),
1037
+ userLocation: O({
1044
1038
  type: J("approximate"),
1045
- city: H().optional(),
1046
- region: H().optional(),
1047
- country: H().optional(),
1048
- timezone: H().optional()
1039
+ city: V().optional(),
1040
+ region: V().optional(),
1041
+ country: V().optional(),
1042
+ timezone: V().optional()
1049
1043
  }).optional()
1050
- }))), Qe = G(() => r(d(k({
1051
- url: H(),
1052
- title: H().nullable(),
1053
- pageAge: H().nullable(),
1054
- encryptedContent: H(),
1044
+ }))), rt = W(() => r(d(O({
1045
+ url: V(),
1046
+ title: V().nullable(),
1047
+ pageAge: V().nullable(),
1048
+ encryptedContent: V(),
1055
1049
  type: J("web_search_result")
1056
- })))), $e = L({
1050
+ })))), it = W(() => r(O({ query: V() }))), at = I({
1057
1051
  id: "anthropic.web_search_20250305",
1058
- inputSchema: G(() => r(k({ query: H() }))),
1059
- outputSchema: Qe,
1052
+ inputSchema: it,
1053
+ outputSchema: rt,
1060
1054
  supportsDeferredResults: !0
1061
- }), et = (e = {}) => $e(e), tt = G(() => r(k({
1062
- maxUses: I().optional(),
1063
- allowedDomains: d(H()).optional(),
1064
- blockedDomains: d(H()).optional(),
1065
- citations: k({ enabled: T() }).optional(),
1066
- maxContentTokens: I().optional(),
1067
- useCache: T().optional(),
1055
+ }), ot = (e = {}) => at(e), st = W(() => r(O({
1056
+ maxUses: F().optional(),
1057
+ allowedDomains: d(V()).optional(),
1058
+ blockedDomains: d(V()).optional(),
1059
+ citations: O({ enabled: w() }).optional(),
1060
+ maxContentTokens: F().optional(),
1061
+ useCache: w().optional(),
1068
1062
  responseInclusion: C(["full", "excluded"]).optional()
1069
- }))), nt = G(() => r(k({
1063
+ }))), ct = W(() => r(O({
1070
1064
  type: J("web_fetch_result"),
1071
- url: H(),
1072
- content: k({
1065
+ url: V(),
1066
+ content: O({
1073
1067
  type: J("document"),
1074
- title: H().nullable(),
1075
- citations: k({ enabled: T() }).optional(),
1076
- source: M([k({
1068
+ title: V().nullable(),
1069
+ citations: O({ enabled: w() }).optional(),
1070
+ source: A([O({
1077
1071
  type: J("base64"),
1078
1072
  mediaType: J("application/pdf"),
1079
- data: H()
1080
- }), k({
1073
+ data: V()
1074
+ }), O({
1081
1075
  type: J("text"),
1082
1076
  mediaType: J("text/plain"),
1083
- data: H()
1077
+ data: V()
1084
1078
  })])
1085
1079
  }),
1086
- retrievedAt: H().nullable()
1087
- }))), rt = L({
1080
+ retrievedAt: V().nullable()
1081
+ }))), lt = W(() => r(O({ url: V() }))), ut = I({
1088
1082
  id: "anthropic.web_fetch_20260318",
1089
- inputSchema: G(() => r(k({ url: H() }))),
1090
- outputSchema: nt,
1083
+ inputSchema: lt,
1084
+ outputSchema: ct,
1091
1085
  supportsDeferredResults: !0
1092
- }), it = (e = {}) => rt(e), at = G(() => r(k({
1093
- maxUses: I().optional(),
1094
- allowedDomains: d(H()).optional(),
1095
- blockedDomains: d(H()).optional(),
1096
- citations: k({ enabled: T() }).optional(),
1097
- maxContentTokens: I().optional()
1098
- }))), ot = G(() => r(k({
1086
+ }), dt = (e = {}) => ut(e), ft = W(() => r(O({
1087
+ maxUses: F().optional(),
1088
+ allowedDomains: d(V()).optional(),
1089
+ blockedDomains: d(V()).optional(),
1090
+ citations: O({ enabled: w() }).optional(),
1091
+ maxContentTokens: F().optional()
1092
+ }))), pt = W(() => r(O({
1099
1093
  type: J("web_fetch_result"),
1100
- url: H(),
1101
- content: k({
1094
+ url: V(),
1095
+ content: O({
1102
1096
  type: J("document"),
1103
- title: H().nullable(),
1104
- citations: k({ enabled: T() }).optional(),
1105
- source: M([k({
1097
+ title: V().nullable(),
1098
+ citations: O({ enabled: w() }).optional(),
1099
+ source: A([O({
1106
1100
  type: J("base64"),
1107
1101
  mediaType: J("application/pdf"),
1108
- data: H()
1109
- }), k({
1102
+ data: V()
1103
+ }), O({
1110
1104
  type: J("text"),
1111
1105
  mediaType: J("text/plain"),
1112
- data: H()
1106
+ data: V()
1113
1107
  })])
1114
1108
  }),
1115
- retrievedAt: H().nullable()
1116
- }))), st = L({
1109
+ retrievedAt: V().nullable()
1110
+ }))), mt = W(() => r(O({ url: V() }))), ht = I({
1117
1111
  id: "anthropic.web_fetch_20260209",
1118
- inputSchema: G(() => r(k({ url: H() }))),
1119
- outputSchema: ot,
1112
+ inputSchema: mt,
1113
+ outputSchema: pt,
1120
1114
  supportsDeferredResults: !0
1121
- }), ct = (e = {}) => st(e), lt = G(() => r(k({
1122
- maxUses: I().optional(),
1123
- allowedDomains: d(H()).optional(),
1124
- blockedDomains: d(H()).optional(),
1125
- citations: k({ enabled: T() }).optional(),
1126
- maxContentTokens: I().optional()
1127
- }))), ut = G(() => r(k({
1115
+ }), gt = (e = {}) => ht(e), _t = W(() => r(O({
1116
+ maxUses: F().optional(),
1117
+ allowedDomains: d(V()).optional(),
1118
+ blockedDomains: d(V()).optional(),
1119
+ citations: O({ enabled: w() }).optional(),
1120
+ maxContentTokens: F().optional()
1121
+ }))), vt = W(() => r(O({
1128
1122
  type: J("web_fetch_result"),
1129
- url: H(),
1130
- content: k({
1123
+ url: V(),
1124
+ content: O({
1131
1125
  type: J("document"),
1132
- title: H().nullable(),
1133
- citations: k({ enabled: T() }).optional(),
1134
- source: M([k({
1126
+ title: V().nullable(),
1127
+ citations: O({ enabled: w() }).optional(),
1128
+ source: A([O({
1135
1129
  type: J("base64"),
1136
1130
  mediaType: J("application/pdf"),
1137
- data: H()
1138
- }), k({
1131
+ data: V()
1132
+ }), O({
1139
1133
  type: J("text"),
1140
1134
  mediaType: J("text/plain"),
1141
- data: H()
1135
+ data: V()
1142
1136
  })])
1143
1137
  }),
1144
- retrievedAt: H().nullable()
1145
- }))), dt = L({
1138
+ retrievedAt: V().nullable()
1139
+ }))), yt = W(() => r(O({ url: V() }))), bt = I({
1146
1140
  id: "anthropic.web_fetch_20250910",
1147
- inputSchema: G(() => r(k({ url: H() }))),
1148
- outputSchema: ut,
1141
+ inputSchema: yt,
1142
+ outputSchema: vt,
1149
1143
  supportsDeferredResults: !0
1150
- }), ft = (e = {}) => dt(e);
1151
- async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheControlValidator: r, supportsStructuredOutput: i, supportsStrictTools: a, defaultEagerInputStreaming: o = !1, rejectsForcedToolUse: s = !1 }) {
1144
+ }), xt = (e = {}) => bt(e);
1145
+ async function St({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheControlValidator: r, supportsStructuredOutput: i, supportsStrictTools: a, defaultEagerInputStreaming: o = !1, rejectsForcedToolUse: s = !1 }) {
1152
1146
  e = e?.length ? e : void 0;
1153
- let c = [], l = /* @__PURE__ */ new Set(), d = r || new je();
1147
+ let c = [], l = /* @__PURE__ */ new Set(), d = r || new Me();
1154
1148
  if (e == null) return {
1155
1149
  tools: void 0,
1156
1150
  toolChoice: void 0,
@@ -1226,7 +1220,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1226
1220
  case "anthropic.computer_toolset_20260801": {
1227
1221
  let e = await u({
1228
1222
  value: t.args,
1229
- schema: Re
1223
+ schema: Be
1230
1224
  }), n = e.configs == null ? void 0 : Object.fromEntries(Object.entries(e.configs).map(([e, t]) => [e, {
1231
1225
  ...t?.enabled != null && { enabled: t.enabled },
1232
1226
  ...t?.deferLoading != null && { defer_loading: t.deferLoading }
@@ -1272,7 +1266,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1272
1266
  case "anthropic.text_editor_20250728": {
1273
1267
  let e = await u({
1274
1268
  value: t.args,
1275
- schema: Be
1269
+ schema: He
1276
1270
  });
1277
1271
  f.push({
1278
1272
  name: "str_replace_based_edit_tool",
@@ -1306,7 +1300,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1306
1300
  l.add("web-fetch-2025-09-10");
1307
1301
  let e = await u({
1308
1302
  value: t.args,
1309
- schema: lt
1303
+ schema: _t
1310
1304
  });
1311
1305
  f.push({
1312
1306
  type: "web_fetch_20250910",
@@ -1324,7 +1318,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1324
1318
  l.add("code-execution-web-tools-2026-02-09");
1325
1319
  let e = await u({
1326
1320
  value: t.args,
1327
- schema: at
1321
+ schema: ft
1328
1322
  });
1329
1323
  f.push({
1330
1324
  type: "web_fetch_20260209",
@@ -1341,7 +1335,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1341
1335
  case "anthropic.web_fetch_20260318": {
1342
1336
  let e = await u({
1343
1337
  value: t.args,
1344
- schema: tt
1338
+ schema: st
1345
1339
  });
1346
1340
  f.push({
1347
1341
  type: "web_fetch_20260318",
@@ -1360,7 +1354,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1360
1354
  case "anthropic.web_search_20250305": {
1361
1355
  let e = await u({
1362
1356
  value: t.args,
1363
- schema: Ze
1357
+ schema: nt
1364
1358
  });
1365
1359
  f.push({
1366
1360
  type: "web_search_20250305",
@@ -1377,7 +1371,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1377
1371
  l.add("code-execution-web-tools-2026-02-09");
1378
1372
  let e = await u({
1379
1373
  value: t.args,
1380
- schema: qe
1374
+ schema: Ze
1381
1375
  });
1382
1376
  f.push({
1383
1377
  type: "web_search_20260209",
@@ -1393,7 +1387,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1393
1387
  case "anthropic.web_search_20260318": {
1394
1388
  let e = await u({
1395
1389
  value: t.args,
1396
- schema: Ue
1390
+ schema: Ke
1397
1391
  });
1398
1392
  f.push({
1399
1393
  type: "web_search_20260318",
@@ -1423,7 +1417,7 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1423
1417
  l.add("advisor-tool-2026-03-01");
1424
1418
  let e = await u({
1425
1419
  value: t.args,
1426
- schema: Me
1420
+ schema: Ne
1427
1421
  });
1428
1422
  f.push({
1429
1423
  type: "advisor_20260301",
@@ -1435,20 +1429,16 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1435
1429
  });
1436
1430
  break;
1437
1431
  }
1438
- default:
1439
- c.push({
1440
- type: "unsupported",
1441
- feature: `provider-defined tool ${t.id}`
1442
- });
1443
- break;
1432
+ default: c.push({
1433
+ type: "unsupported",
1434
+ feature: `provider-defined tool ${t.id}`
1435
+ });
1444
1436
  }
1445
1437
  break;
1446
- default:
1447
- c.push({
1448
- type: "unsupported",
1449
- feature: `tool ${t}`
1450
- });
1451
- break;
1438
+ default: c.push({
1439
+ type: "unsupported",
1440
+ feature: `tool ${t}`
1441
+ });
1452
1442
  }
1453
1443
  if (t == null) return {
1454
1444
  tools: f,
@@ -1519,10 +1509,10 @@ async function pt({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheCon
1519
1509
  toolWarnings: c,
1520
1510
  betas: l
1521
1511
  };
1522
- default: throw new R({ functionality: `tool choice type: ${p}` });
1512
+ default: throw new L({ functionality: `tool choice type: ${p}` });
1523
1513
  }
1524
1514
  }
1525
- function mt({ usage: e, rawUsage: t }) {
1515
+ function Ct({ usage: e, rawUsage: t }) {
1526
1516
  let n = e.cache_creation_input_tokens ?? 0, r = e.cache_read_input_tokens ?? 0, i = e.output_tokens_details?.thinking_tokens ?? void 0, a, o, s = e.iterations?.some((e) => e.type === "fallback_message");
1527
1517
  if (e.iterations && e.iterations.length > 0 && !s) {
1528
1518
  let t = e.iterations.filter((e) => e.type === "compaction" || e.type === "message");
@@ -1552,103 +1542,103 @@ function mt({ usage: e, rawUsage: t }) {
1552
1542
  raw: t ?? e
1553
1543
  };
1554
1544
  }
1555
- var ht = G(() => r(k({
1545
+ var wt = W(() => r(O({
1556
1546
  type: J("code_execution_result"),
1557
- stdout: H(),
1558
- stderr: H(),
1559
- return_code: I(),
1560
- content: d(k({
1547
+ stdout: V(),
1548
+ stderr: V(),
1549
+ return_code: F(),
1550
+ content: d(O({
1561
1551
  type: J("code_execution_output"),
1562
- file_id: H()
1552
+ file_id: V()
1563
1553
  })).optional().default([])
1564
- }))), gt = L({
1554
+ }))), Tt = W(() => r(O({ code: V() }))), Et = I({
1565
1555
  id: "anthropic.code_execution_20250522",
1566
- inputSchema: G(() => r(k({ code: H() }))),
1567
- outputSchema: ht
1568
- }), _t = (e = {}) => gt(e), vt = G(() => r(E("type", [
1569
- k({
1556
+ inputSchema: Tt,
1557
+ outputSchema: wt
1558
+ }), Dt = (e = {}) => Et(e), Ot = W(() => r(T("type", [
1559
+ O({
1570
1560
  type: J("code_execution_result"),
1571
- stdout: H(),
1572
- stderr: H(),
1573
- return_code: I(),
1574
- content: d(k({
1561
+ stdout: V(),
1562
+ stderr: V(),
1563
+ return_code: F(),
1564
+ content: d(O({
1575
1565
  type: J("code_execution_output"),
1576
- file_id: H()
1566
+ file_id: V()
1577
1567
  })).optional().default([])
1578
1568
  }),
1579
- k({
1569
+ O({
1580
1570
  type: J("bash_code_execution_result"),
1581
- content: d(k({
1571
+ content: d(O({
1582
1572
  type: J("bash_code_execution_output"),
1583
- file_id: H()
1573
+ file_id: V()
1584
1574
  })),
1585
- stdout: H(),
1586
- stderr: H(),
1587
- return_code: I()
1575
+ stdout: V(),
1576
+ stderr: V(),
1577
+ return_code: F()
1588
1578
  }),
1589
- k({
1579
+ O({
1590
1580
  type: J("bash_code_execution_tool_result_error"),
1591
- error_code: H()
1581
+ error_code: V()
1592
1582
  }),
1593
- k({
1583
+ O({
1594
1584
  type: J("text_editor_code_execution_tool_result_error"),
1595
- error_code: H()
1585
+ error_code: V()
1596
1586
  }),
1597
- k({
1587
+ O({
1598
1588
  type: J("text_editor_code_execution_view_result"),
1599
- content: H(),
1600
- file_type: H(),
1601
- num_lines: I().nullable(),
1602
- start_line: I().nullable(),
1603
- total_lines: I().nullable()
1589
+ content: V(),
1590
+ file_type: V(),
1591
+ num_lines: F().nullable(),
1592
+ start_line: F().nullable(),
1593
+ total_lines: F().nullable()
1604
1594
  }),
1605
- k({
1595
+ O({
1606
1596
  type: J("text_editor_code_execution_create_result"),
1607
- is_file_update: T()
1597
+ is_file_update: w()
1608
1598
  }),
1609
- k({
1599
+ O({
1610
1600
  type: J("text_editor_code_execution_str_replace_result"),
1611
- lines: d(H()).nullable(),
1612
- new_lines: I().nullable(),
1613
- new_start: I().nullable(),
1614
- old_lines: I().nullable(),
1615
- old_start: I().nullable()
1601
+ lines: d(V()).nullable(),
1602
+ new_lines: F().nullable(),
1603
+ new_start: F().nullable(),
1604
+ old_lines: F().nullable(),
1605
+ old_start: F().nullable()
1616
1606
  })
1617
- ]))), yt = L({
1618
- id: "anthropic.code_execution_20250825",
1619
- inputSchema: G(() => r(E("type", [
1620
- k({
1621
- type: J("programmatic-tool-call"),
1622
- code: H()
1607
+ ]))), kt = W(() => r(T("type", [
1608
+ O({
1609
+ type: J("programmatic-tool-call"),
1610
+ code: V()
1611
+ }),
1612
+ O({
1613
+ type: J("bash_code_execution"),
1614
+ command: V()
1615
+ }),
1616
+ T("command", [
1617
+ O({
1618
+ type: J("text_editor_code_execution"),
1619
+ command: J("view"),
1620
+ path: V()
1623
1621
  }),
1624
- k({
1625
- type: J("bash_code_execution"),
1626
- command: H()
1622
+ O({
1623
+ type: J("text_editor_code_execution"),
1624
+ command: J("create"),
1625
+ path: V(),
1626
+ file_text: V().nullish()
1627
1627
  }),
1628
- E("command", [
1629
- k({
1630
- type: J("text_editor_code_execution"),
1631
- command: J("view"),
1632
- path: H()
1633
- }),
1634
- k({
1635
- type: J("text_editor_code_execution"),
1636
- command: J("create"),
1637
- path: H(),
1638
- file_text: H().nullish()
1639
- }),
1640
- k({
1641
- type: J("text_editor_code_execution"),
1642
- command: J("str_replace"),
1643
- path: H(),
1644
- old_str: H(),
1645
- new_str: H()
1646
- })
1647
- ])
1648
- ]))),
1649
- outputSchema: vt,
1628
+ O({
1629
+ type: J("text_editor_code_execution"),
1630
+ command: J("str_replace"),
1631
+ path: V(),
1632
+ old_str: V(),
1633
+ new_str: V()
1634
+ })
1635
+ ])
1636
+ ]))), At = I({
1637
+ id: "anthropic.code_execution_20250825",
1638
+ inputSchema: kt,
1639
+ outputSchema: Ot,
1650
1640
  supportsDeferredResults: !0
1651
- }), bt = (e = {}) => h(yt(e), {
1641
+ }), jt = (e = {}) => h(At(e), {
1652
1642
  type: "provider",
1653
1643
  prepareProviderOptions: (e) => {
1654
1644
  let t = e?.anthropic;
@@ -1660,100 +1650,100 @@ var ht = G(() => r(k({
1660
1650
  }
1661
1651
  };
1662
1652
  }
1663
- }), xt = G(() => r(E("type", [
1664
- k({
1653
+ }), Mt = W(() => r(T("type", [
1654
+ O({
1665
1655
  type: J("code_execution_result"),
1666
- stdout: H(),
1667
- stderr: H(),
1668
- return_code: I(),
1669
- content: d(k({
1656
+ stdout: V(),
1657
+ stderr: V(),
1658
+ return_code: F(),
1659
+ content: d(O({
1670
1660
  type: J("code_execution_output"),
1671
- file_id: H()
1661
+ file_id: V()
1672
1662
  })).optional().default([])
1673
1663
  }),
1674
- k({
1664
+ O({
1675
1665
  type: J("encrypted_code_execution_result"),
1676
- encrypted_stdout: H(),
1677
- stderr: H(),
1678
- return_code: I(),
1679
- content: d(k({
1666
+ encrypted_stdout: V(),
1667
+ stderr: V(),
1668
+ return_code: F(),
1669
+ content: d(O({
1680
1670
  type: J("code_execution_output"),
1681
- file_id: H()
1671
+ file_id: V()
1682
1672
  })).optional().default([])
1683
1673
  }),
1684
- k({
1674
+ O({
1685
1675
  type: J("bash_code_execution_result"),
1686
- content: d(k({
1676
+ content: d(O({
1687
1677
  type: J("bash_code_execution_output"),
1688
- file_id: H()
1678
+ file_id: V()
1689
1679
  })),
1690
- stdout: H(),
1691
- stderr: H(),
1692
- return_code: I()
1680
+ stdout: V(),
1681
+ stderr: V(),
1682
+ return_code: F()
1693
1683
  }),
1694
- k({
1684
+ O({
1695
1685
  type: J("bash_code_execution_tool_result_error"),
1696
- error_code: H()
1686
+ error_code: V()
1697
1687
  }),
1698
- k({
1688
+ O({
1699
1689
  type: J("text_editor_code_execution_tool_result_error"),
1700
- error_code: H()
1690
+ error_code: V()
1701
1691
  }),
1702
- k({
1692
+ O({
1703
1693
  type: J("text_editor_code_execution_view_result"),
1704
- content: H(),
1705
- file_type: H(),
1706
- num_lines: I().nullable(),
1707
- start_line: I().nullable(),
1708
- total_lines: I().nullable()
1694
+ content: V(),
1695
+ file_type: V(),
1696
+ num_lines: F().nullable(),
1697
+ start_line: F().nullable(),
1698
+ total_lines: F().nullable()
1709
1699
  }),
1710
- k({
1700
+ O({
1711
1701
  type: J("text_editor_code_execution_create_result"),
1712
- is_file_update: T()
1702
+ is_file_update: w()
1713
1703
  }),
1714
- k({
1704
+ O({
1715
1705
  type: J("text_editor_code_execution_str_replace_result"),
1716
- lines: d(H()).nullable(),
1717
- new_lines: I().nullable(),
1718
- new_start: I().nullable(),
1719
- old_lines: I().nullable(),
1720
- old_start: I().nullable()
1706
+ lines: d(V()).nullable(),
1707
+ new_lines: F().nullable(),
1708
+ new_start: F().nullable(),
1709
+ old_lines: F().nullable(),
1710
+ old_start: F().nullable()
1721
1711
  })
1722
- ]))), St = L({
1723
- id: "anthropic.code_execution_20260120",
1724
- inputSchema: G(() => r(E("type", [
1725
- k({
1726
- type: J("programmatic-tool-call"),
1727
- code: H()
1712
+ ]))), Nt = W(() => r(T("type", [
1713
+ O({
1714
+ type: J("programmatic-tool-call"),
1715
+ code: V()
1716
+ }),
1717
+ O({
1718
+ type: J("bash_code_execution"),
1719
+ command: V()
1720
+ }),
1721
+ T("command", [
1722
+ O({
1723
+ type: J("text_editor_code_execution"),
1724
+ command: J("view"),
1725
+ path: V()
1728
1726
  }),
1729
- k({
1730
- type: J("bash_code_execution"),
1731
- command: H()
1727
+ O({
1728
+ type: J("text_editor_code_execution"),
1729
+ command: J("create"),
1730
+ path: V(),
1731
+ file_text: V().nullish()
1732
1732
  }),
1733
- E("command", [
1734
- k({
1735
- type: J("text_editor_code_execution"),
1736
- command: J("view"),
1737
- path: H()
1738
- }),
1739
- k({
1740
- type: J("text_editor_code_execution"),
1741
- command: J("create"),
1742
- path: H(),
1743
- file_text: H().nullish()
1744
- }),
1745
- k({
1746
- type: J("text_editor_code_execution"),
1747
- command: J("str_replace"),
1748
- path: H(),
1749
- old_str: H(),
1750
- new_str: H()
1751
- })
1752
- ])
1753
- ]))),
1754
- outputSchema: xt,
1733
+ O({
1734
+ type: J("text_editor_code_execution"),
1735
+ command: J("str_replace"),
1736
+ path: V(),
1737
+ old_str: V(),
1738
+ new_str: V()
1739
+ })
1740
+ ])
1741
+ ]))), Pt = I({
1742
+ id: "anthropic.code_execution_20260120",
1743
+ inputSchema: Nt,
1744
+ outputSchema: Mt,
1755
1745
  supportsDeferredResults: !0
1756
- }), Ct = (e = {}) => h(St(e), {
1746
+ }), Ft = (e = {}) => h(Pt(e), {
1757
1747
  type: "provider",
1758
1748
  prepareProviderOptions: (e) => {
1759
1749
  let t = e?.anthropic;
@@ -1765,22 +1755,22 @@ var ht = G(() => r(k({
1765
1755
  }
1766
1756
  };
1767
1757
  }
1768
- }), wt = G(() => r(d(k({
1758
+ }), It = W(() => r(d(O({
1769
1759
  type: J("tool_reference"),
1770
- toolName: H()
1771
- })))), Tt = L({
1760
+ toolName: V()
1761
+ })))), Lt = W(() => r(O({
1762
+ pattern: V(),
1763
+ limit: F().optional()
1764
+ }))), Rt = I({
1772
1765
  id: "anthropic.tool_search_regex_20251119",
1773
- inputSchema: G(() => r(k({
1774
- pattern: H(),
1775
- limit: I().optional()
1776
- }))),
1777
- outputSchema: wt,
1766
+ inputSchema: Lt,
1767
+ outputSchema: It,
1778
1768
  supportsDeferredResults: !0
1779
- }), Et = (e = {}) => Tt(e);
1780
- function Dt(e) {
1781
- return typeof e == "string" ? new TextDecoder().decode(re(e)) : new TextDecoder().decode(e);
1769
+ }), zt = (e = {}) => Rt(e);
1770
+ function Bt(e) {
1771
+ return typeof e == "string" ? new TextDecoder().decode(ie(e)) : new TextDecoder().decode(e);
1782
1772
  }
1783
- function Ot(e) {
1773
+ function Vt(e) {
1784
1774
  try {
1785
1775
  if (typeof e == "string") return n(e);
1786
1776
  if (typeof e == "object" && e) return e;
@@ -1790,27 +1780,27 @@ function Ot(e) {
1790
1780
  }
1791
1781
  return {};
1792
1782
  }
1793
- async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValidator: a, toolNameMapping: s, toolsetNames: c = {} }) {
1794
- let l = /* @__PURE__ */ new Set(), d = At(t), p = a || new je(), m, h = [], g = -1;
1783
+ async function Ht({ prompt: t, sendReasoning: r, warnings: i, cacheControlValidator: a, toolNameMapping: s, toolsetNames: c = {} }) {
1784
+ let l = /* @__PURE__ */ new Set(), d = Ut(t), p = a || new Me(), m, h = [], g = -1;
1795
1785
  async function _(e) {
1796
- return (await O({
1786
+ return (await D({
1797
1787
  provider: "anthropic",
1798
1788
  providerOptions: e,
1799
- schema: Ee
1789
+ schema: De
1800
1790
  }))?.citations?.enabled ?? !1;
1801
1791
  }
1802
1792
  async function v(e) {
1803
- return (await O({
1793
+ return (await D({
1804
1794
  provider: "anthropic",
1805
1795
  providerOptions: e,
1806
- schema: Ee
1796
+ schema: De
1807
1797
  }))?.containerUpload ?? !1;
1808
1798
  }
1809
1799
  async function y(e) {
1810
- let t = await O({
1800
+ let t = await D({
1811
1801
  provider: "anthropic",
1812
1802
  providerOptions: e,
1813
- schema: Ee
1803
+ schema: De
1814
1804
  });
1815
1805
  return {
1816
1806
  title: t?.title,
@@ -1823,10 +1813,10 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
1823
1813
  case "system": {
1824
1814
  let e = [];
1825
1815
  for (let { content: t, providerOptions: n } of a.messages) {
1826
- let r = await O({
1816
+ let r = await D({
1827
1817
  provider: "anthropic",
1828
1818
  providerOptions: n,
1829
- schema: De
1819
+ schema: Oe
1830
1820
  }), i = r?.toolChanges ?? [], a = [];
1831
1821
  (t !== "" || i.length === 0 && r?.clearAt == null && r?.effort == null) && a.push({
1832
1822
  type: "text",
@@ -1899,104 +1889,102 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
1899
1889
  cache_control: s
1900
1890
  });
1901
1891
  break;
1902
- case "file":
1903
- switch (r.data.type) {
1904
- case "reference": {
1905
- let e = o({
1906
- reference: r.data.reference,
1907
- provider: "anthropic"
1908
- });
1909
- l.add("files-api-2025-04-14"), await v(r.providerOptions) ? t.push({
1910
- type: "container_upload",
1892
+ case "file": switch (r.data.type) {
1893
+ case "reference": {
1894
+ let e = o({
1895
+ reference: r.data.reference,
1896
+ provider: "anthropic"
1897
+ });
1898
+ l.add("files-api-2025-04-14"), await v(r.providerOptions) ? t.push({
1899
+ type: "container_upload",
1900
+ file_id: e
1901
+ }) : f(r.mediaType) === "image" ? t.push({
1902
+ type: "image",
1903
+ source: {
1904
+ type: "file",
1911
1905
  file_id: e
1912
- }) : f(r.mediaType) === "image" ? t.push({
1913
- type: "image",
1914
- source: {
1915
- type: "file",
1916
- file_id: e
1917
- },
1918
- cache_control: s
1919
- }) : t.push({
1920
- type: "document",
1921
- source: {
1922
- type: "file",
1923
- file_id: e
1924
- },
1925
- cache_control: s
1926
- });
1927
- break;
1928
- }
1929
- case "text": {
1906
+ },
1907
+ cache_control: s
1908
+ }) : t.push({
1909
+ type: "document",
1910
+ source: {
1911
+ type: "file",
1912
+ file_id: e
1913
+ },
1914
+ cache_control: s
1915
+ });
1916
+ break;
1917
+ }
1918
+ case "text": {
1919
+ let e = await _(r.providerOptions), n = await y(r.providerOptions);
1920
+ t.push({
1921
+ type: "document",
1922
+ source: {
1923
+ type: "text",
1924
+ media_type: "text/plain",
1925
+ data: r.data.text
1926
+ },
1927
+ title: n.title ?? r.filename,
1928
+ ...n.context && { context: n.context },
1929
+ ...e && { citations: { enabled: !0 } },
1930
+ cache_control: s
1931
+ });
1932
+ break;
1933
+ }
1934
+ case "url":
1935
+ case "data": {
1936
+ let e = f(r.mediaType);
1937
+ if (e === "image") t.push({
1938
+ type: "image",
1939
+ source: r.data.type === "url" ? {
1940
+ type: "url",
1941
+ url: r.data.url.toString()
1942
+ } : {
1943
+ type: "base64",
1944
+ media_type: b({ part: r }),
1945
+ data: E(r.data.data)
1946
+ },
1947
+ cache_control: s
1948
+ });
1949
+ else if (e === "application" && (r.data.type === "url" ? r.mediaType === "application/pdf" : b({ part: r }) === "application/pdf")) {
1950
+ l.add("pdfs-2024-09-25");
1930
1951
  let e = await _(r.providerOptions), n = await y(r.providerOptions);
1931
1952
  t.push({
1932
1953
  type: "document",
1933
- source: {
1934
- type: "text",
1935
- media_type: "text/plain",
1936
- data: r.data.text
1954
+ source: r.data.type === "url" ? {
1955
+ type: "url",
1956
+ url: r.data.url.toString()
1957
+ } : {
1958
+ type: "base64",
1959
+ media_type: "application/pdf",
1960
+ data: E(r.data.data)
1937
1961
  },
1938
1962
  title: n.title ?? r.filename,
1939
1963
  ...n.context && { context: n.context },
1940
1964
  ...e && { citations: { enabled: !0 } },
1941
1965
  cache_control: s
1942
1966
  });
1943
- break;
1944
- }
1945
- case "url":
1946
- case "data": {
1947
- let e = f(r.mediaType);
1948
- if (e === "image") t.push({
1949
- type: "image",
1967
+ } else if (r.mediaType === "text/plain") {
1968
+ let e = await _(r.providerOptions), n = await y(r.providerOptions);
1969
+ t.push({
1970
+ type: "document",
1950
1971
  source: r.data.type === "url" ? {
1951
1972
  type: "url",
1952
1973
  url: r.data.url.toString()
1953
1974
  } : {
1954
- type: "base64",
1955
- media_type: b({ part: r }),
1956
- data: D(r.data.data)
1975
+ type: "text",
1976
+ media_type: "text/plain",
1977
+ data: Bt(r.data.data)
1957
1978
  },
1979
+ title: n.title ?? r.filename,
1980
+ ...n.context && { context: n.context },
1981
+ ...e && { citations: { enabled: !0 } },
1958
1982
  cache_control: s
1959
1983
  });
1960
- else if (e === "application" && (r.data.type === "url" ? r.mediaType === "application/pdf" : b({ part: r }) === "application/pdf")) {
1961
- l.add("pdfs-2024-09-25");
1962
- let e = await _(r.providerOptions), n = await y(r.providerOptions);
1963
- t.push({
1964
- type: "document",
1965
- source: r.data.type === "url" ? {
1966
- type: "url",
1967
- url: r.data.url.toString()
1968
- } : {
1969
- type: "base64",
1970
- media_type: "application/pdf",
1971
- data: D(r.data.data)
1972
- },
1973
- title: n.title ?? r.filename,
1974
- ...n.context && { context: n.context },
1975
- ...e && { citations: { enabled: !0 } },
1976
- cache_control: s
1977
- });
1978
- } else if (r.mediaType === "text/plain") {
1979
- let e = await _(r.providerOptions), n = await y(r.providerOptions);
1980
- t.push({
1981
- type: "document",
1982
- source: r.data.type === "url" ? {
1983
- type: "url",
1984
- url: r.data.url.toString()
1985
- } : {
1986
- type: "text",
1987
- media_type: "text/plain",
1988
- data: Dt(r.data.data)
1989
- },
1990
- title: n.title ?? r.filename,
1991
- ...n.context && { context: n.context },
1992
- ...e && { citations: { enabled: !0 } },
1993
- cache_control: s
1994
- });
1995
- } else throw new R({ functionality: `media type: ${r.mediaType}` });
1996
- break;
1997
- }
1984
+ } else throw new L({ functionality: `media type: ${r.mediaType}` });
1985
+ break;
1998
1986
  }
1999
- break;
1987
+ }
2000
1988
  }
2001
1989
  }
2002
1990
  break;
@@ -2043,7 +2031,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2043
2031
  source: {
2044
2032
  type: "base64",
2045
2033
  media_type: b({ part: e }),
2046
- data: D(e.data.data)
2034
+ data: E(e.data.data)
2047
2035
  }
2048
2036
  };
2049
2037
  if (b({ part: e }) === "application/pdf") return l.add("pdfs-2024-09-25"), {
@@ -2051,7 +2039,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2051
2039
  source: {
2052
2040
  type: "base64",
2053
2041
  media_type: "application/pdf",
2054
- data: D(e.data.data)
2042
+ data: E(e.data.data)
2055
2043
  }
2056
2044
  };
2057
2045
  i.push({
@@ -2094,11 +2082,9 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2094
2082
  case "execution-denied":
2095
2083
  h = s.reason ?? "Tool call execution denied.";
2096
2084
  break;
2097
- default:
2098
- h = JSON.stringify(s.value);
2099
- break;
2085
+ default: h = JSON.stringify(s.value);
2100
2086
  }
2101
- let g = Mt({
2087
+ let g = Gt({
2102
2088
  toolName: o.toolName,
2103
2089
  providerOptions: o.providerOptions,
2104
2090
  toolsetNames: c
@@ -2108,7 +2094,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2108
2094
  tool_use_id: o.toolCallId,
2109
2095
  ...g != null && { toolset_name: g },
2110
2096
  content: h,
2111
- is_error: s.type === "error-text" || s.type === "error-json" ? !0 : void 0,
2097
+ is_error: s.type === "error-text" || s.type === "error-json" || void 0,
2112
2098
  cache_control: m
2113
2099
  });
2114
2100
  }
@@ -2155,10 +2141,10 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2155
2141
  }
2156
2142
  case "reasoning":
2157
2143
  if (r) {
2158
- let t = await O({
2144
+ let t = await D({
2159
2145
  provider: "anthropic",
2160
2146
  providerOptions: o.providerOptions,
2161
- schema: Te
2147
+ schema: Ee
2162
2148
  });
2163
2149
  t == null ? i.push({
2164
2150
  type: "other",
@@ -2186,7 +2172,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2186
2172
  });
2187
2173
  break;
2188
2174
  case "tool-call": {
2189
- let n = Nt(o.providerOptions);
2175
+ let n = Kt(o.providerOptions);
2190
2176
  if (o.providerExecuted) {
2191
2177
  let r = s.toProviderToolName(o.toolName);
2192
2178
  if (o.providerOptions?.anthropic?.type === "mcp-tool-use") {
@@ -2247,13 +2233,13 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2247
2233
  });
2248
2234
  break;
2249
2235
  }
2250
- let r = Mt({
2236
+ let r = Gt({
2251
2237
  toolName: o.toolName,
2252
2238
  providerOptions: o.providerOptions,
2253
2239
  toolsetNames: c
2254
2240
  });
2255
2241
  if (r != null) {
2256
- let { action: t, ...a } = Pt(o.input);
2242
+ let { action: t, ...a } = qt(o.input);
2257
2243
  if (typeof t != "string") {
2258
2244
  i.push({
2259
2245
  type: "other",
@@ -2276,14 +2262,14 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2276
2262
  type: "tool_use",
2277
2263
  id: o.toolCallId,
2278
2264
  name: o.toolName,
2279
- input: Pt(o.input),
2265
+ input: qt(o.input),
2280
2266
  ...n && { caller: n },
2281
2267
  cache_control: g
2282
2268
  });
2283
2269
  break;
2284
2270
  }
2285
2271
  case "tool-result": {
2286
- let r = s.toProviderToolName(o.toolName), a = Nt(o.providerOptions);
2272
+ let r = s.toProviderToolName(o.toolName), a = Kt(o.providerOptions);
2287
2273
  if (t.has(o.toolCallId)) {
2288
2274
  let t = o.output;
2289
2275
  if (t.type !== "json" && t.type !== "error-json") {
@@ -2343,7 +2329,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2343
2329
  if (t.value.type === "code_execution_result") {
2344
2330
  let n = await u({
2345
2331
  value: t.value,
2346
- schema: ht
2332
+ schema: wt
2347
2333
  });
2348
2334
  e.push({
2349
2335
  type: "code_execution_tool_result",
@@ -2360,7 +2346,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2360
2346
  } else if (t.value.type === "encrypted_code_execution_result") {
2361
2347
  let n = await u({
2362
2348
  value: t.value,
2363
- schema: xt
2349
+ schema: Mt
2364
2350
  });
2365
2351
  n.type === "encrypted_code_execution_result" && e.push({
2366
2352
  type: "code_execution_tool_result",
@@ -2377,7 +2363,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2377
2363
  } else {
2378
2364
  let n = await u({
2379
2365
  value: t.value,
2380
- schema: vt
2366
+ schema: Ot
2381
2367
  });
2382
2368
  n.type === "code_execution_result" ? e.push({
2383
2369
  type: "code_execution_tool_result",
@@ -2418,7 +2404,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2418
2404
  tool_use_id: o.toolCallId,
2419
2405
  content: {
2420
2406
  type: "web_fetch_tool_result_error",
2421
- error_code: Ot(t.value).errorCode ?? "unavailable"
2407
+ error_code: Vt(t.value).errorCode ?? "unavailable"
2422
2408
  },
2423
2409
  ...a && { caller: a },
2424
2410
  cache_control: g
@@ -2434,7 +2420,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2434
2420
  }
2435
2421
  let n = await u({
2436
2422
  value: t.value,
2437
- schema: ut
2423
+ schema: vt
2438
2424
  });
2439
2425
  e.push({
2440
2426
  type: "web_fetch_tool_result",
@@ -2467,7 +2453,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2467
2453
  tool_use_id: o.toolCallId,
2468
2454
  content: {
2469
2455
  type: "web_search_tool_result_error",
2470
- error_code: Ot(t.value).errorCode ?? "unavailable"
2456
+ error_code: Vt(t.value).errorCode ?? "unavailable"
2471
2457
  },
2472
2458
  ...a && { caller: a },
2473
2459
  cache_control: g
@@ -2483,7 +2469,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2483
2469
  }
2484
2470
  let n = await u({
2485
2471
  value: t.value,
2486
- schema: Qe
2472
+ schema: rt
2487
2473
  });
2488
2474
  e.push({
2489
2475
  type: "web_search_tool_result",
@@ -2511,7 +2497,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2511
2497
  }
2512
2498
  let n = (await u({
2513
2499
  value: t.value,
2514
- schema: wt
2500
+ schema: It
2515
2501
  })).map((e) => ({
2516
2502
  type: "tool_reference",
2517
2503
  tool_name: e.toolName
@@ -2538,7 +2524,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2538
2524
  }
2539
2525
  let n = await u({
2540
2526
  value: t.value,
2541
- schema: Ne
2527
+ schema: Pe
2542
2528
  });
2543
2529
  n.type === "advisor_result" ? e.push({
2544
2530
  type: "advisor_tool_result",
@@ -2580,7 +2566,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2580
2566
  }
2581
2567
  e.length > 0 && h.push({
2582
2568
  role: "assistant",
2583
- content: jt(e)
2569
+ content: Wt(e)
2584
2570
  });
2585
2571
  break;
2586
2572
  }
@@ -2611,7 +2597,7 @@ async function kt({ prompt: t, sendReasoning: r, warnings: i, cacheControlValida
2611
2597
  betas: l
2612
2598
  };
2613
2599
  }
2614
- function At(e) {
2600
+ function Ut(e) {
2615
2601
  let t = [], n;
2616
2602
  for (let r of e) {
2617
2603
  let { role: e } = r;
@@ -2645,7 +2631,7 @@ function At(e) {
2645
2631
  }
2646
2632
  return t;
2647
2633
  }
2648
- function jt(e) {
2634
+ function Wt(e) {
2649
2635
  let t = [], n = [];
2650
2636
  function r() {
2651
2637
  t.push(...n.filter((e) => e.type !== "tool_use"), ...n.filter((e) => e.type === "tool_use")), n = [];
@@ -2653,23 +2639,23 @@ function jt(e) {
2653
2639
  for (let i of e) i.type === "thinking" || i.type === "redacted_thinking" ? (r(), t.push(i)) : n.push(i);
2654
2640
  return r(), t;
2655
2641
  }
2656
- function Mt({ toolName: e, providerOptions: t, toolsetNames: n }) {
2642
+ function Gt({ toolName: e, providerOptions: t, toolsetNames: n }) {
2657
2643
  let r = n[e];
2658
2644
  if (r != null) return r;
2659
2645
  let i = t?.anthropic?.toolsetName;
2660
2646
  return typeof i == "string" ? i : void 0;
2661
2647
  }
2662
- function Nt(e) {
2648
+ function Kt(e) {
2663
2649
  let t = e?.anthropic?.caller;
2664
2650
  return (t?.type === "code_execution_20250825" || t?.type === "code_execution_20260120") && t.toolId ? {
2665
2651
  type: t.type,
2666
2652
  tool_id: t.toolId
2667
2653
  } : t?.type === "direct" ? { type: "direct" } : void 0;
2668
2654
  }
2669
- function Pt(e) {
2655
+ function qt(e) {
2670
2656
  return typeof e == "object" && e && !Array.isArray(e) ? e : { rawInvalidInput: e };
2671
2657
  }
2672
- function Ft({ finishReason: e, isJsonResponseFromTool: t }) {
2658
+ function Jt({ finishReason: e, isJsonResponseFromTool: t }) {
2673
2659
  switch (e) {
2674
2660
  case "pause_turn":
2675
2661
  case "end_turn":
@@ -2682,7 +2668,7 @@ function Ft({ finishReason: e, isJsonResponseFromTool: t }) {
2682
2668
  default: return "other";
2683
2669
  }
2684
2670
  }
2685
- var It = /* @__PURE__ */ new Set([
2671
+ var Yt = /* @__PURE__ */ new Set([
2686
2672
  "date-time",
2687
2673
  "time",
2688
2674
  "date",
@@ -2693,7 +2679,7 @@ var It = /* @__PURE__ */ new Set([
2693
2679
  "ipv4",
2694
2680
  "ipv6",
2695
2681
  "uuid"
2696
- ]), Lt = [
2682
+ ]), Xt = [
2697
2683
  "minimum",
2698
2684
  "maximum",
2699
2685
  "exclusiveMinimum",
@@ -2709,39 +2695,39 @@ var It = /* @__PURE__ */ new Set([
2709
2695
  "maxProperties",
2710
2696
  "not"
2711
2697
  ];
2712
- function Rt(e) {
2713
- return zt(e);
2698
+ function Zt(e) {
2699
+ return Qt(e);
2714
2700
  }
2715
2701
  function Q(e) {
2716
- return typeof e == "boolean" || !oe(e) ? e : zt(e);
2702
+ return typeof e == "boolean" || !se(e) ? e : Qt(e);
2717
2703
  }
2718
- function zt(e) {
2704
+ function Qt(e) {
2719
2705
  let t = {}, n = e;
2720
2706
  if (e.$ref != null) return { $ref: e.$ref };
2721
2707
  if (e.$schema != null && (t.$schema = e.$schema), e.$id != null && (t.$id = e.$id), e.title != null && (t.title = e.title), e.description != null && (t.description = e.description), e.default !== void 0 && (t.default = e.default), e.const !== void 0 && (t.const = e.const), e.enum != null && (t.enum = e.enum), e.type != null && (t.type = e.type), e.anyOf == null ? e.oneOf != null && (t.anyOf = e.oneOf.map(Q)) : t.anyOf = e.anyOf.map(Q), e.allOf != null && (t.allOf = e.allOf.map(Q)), e.definitions != null && (t.definitions = Object.fromEntries(Object.entries(e.definitions).map(([e, t]) => [e, Q(t)]))), n.$defs != null) {
2722
2708
  let e = t;
2723
2709
  e.$defs = Object.fromEntries(Object.entries(n.$defs).map(([e, t]) => [e, Q(t)]));
2724
2710
  }
2725
- (e.type === "object" || e.properties != null) && (e.properties != null && (t.properties = Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, Q(t)]))), t.additionalProperties = !1, e.required != null && (t.required = e.required)), e.items != null && (t.items = Array.isArray(e.items) ? e.items.map(Q) : Q(e.items)), typeof e.format == "string" && It.has(e.format) && (t.format = e.format);
2726
- let r = Bt(e);
2711
+ (e.type === "object" || e.properties != null) && (e.properties != null && (t.properties = Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, Q(t)]))), t.additionalProperties = !1, e.required != null && (t.required = e.required)), e.items != null && (t.items = Array.isArray(e.items) ? e.items.map(Q) : Q(e.items)), typeof e.format == "string" && Yt.has(e.format) && (t.format = e.format);
2712
+ let r = $t(e);
2727
2713
  return r != null && (t.description = t.description == null ? r : `${t.description}
2728
2714
  ${r}`), t;
2729
2715
  }
2730
- function Bt(e) {
2731
- let t = Lt.flatMap((t) => {
2716
+ function $t(e) {
2717
+ let t = Xt.flatMap((t) => {
2732
2718
  let n = e[t];
2733
- return n == null || n === !1 ? [] : `${Vt(t)}: ${Ht(n)}`;
2719
+ return n == null || n === !1 ? [] : `${en(t)}: ${tn(n)}`;
2734
2720
  });
2735
- return typeof e.format == "string" && !It.has(e.format) && t.push(`format: ${e.format}`), t.length === 0 ? void 0 : `${t.join("; ")}.`;
2721
+ return typeof e.format == "string" && !Yt.has(e.format) && t.push(`format: ${e.format}`), t.length === 0 ? void 0 : `${t.join("; ")}.`;
2736
2722
  }
2737
- function Vt(e) {
2723
+ function en(e) {
2738
2724
  return e.replace(/[A-Z]/g, (e) => ` ${e.toLowerCase()}`);
2739
2725
  }
2740
- function Ht(e) {
2726
+ function tn(e) {
2741
2727
  return typeof e == "string" ? e : JSON.stringify(e);
2742
2728
  }
2743
- function Ut(e) {
2744
- let t = Wt(e.type);
2729
+ function nn(e) {
2730
+ let t = rn(e.type);
2745
2731
  return p({
2746
2732
  message: e.message,
2747
2733
  type: e.type,
@@ -2751,7 +2737,7 @@ function Ut(e) {
2751
2737
  data: "data" in e ? e.data : e
2752
2738
  });
2753
2739
  }
2754
- function Wt(e) {
2740
+ function rn(e) {
2755
2741
  switch (e) {
2756
2742
  case "api_error": return {
2757
2743
  statusCode: 500,
@@ -2789,7 +2775,7 @@ function Wt(e) {
2789
2775
  default: return {};
2790
2776
  }
2791
2777
  }
2792
- function Gt(e, t, n) {
2778
+ function an(e, t, n) {
2793
2779
  if (e.type === "web_search_result_location") return {
2794
2780
  type: "source",
2795
2781
  sourceType: "url",
@@ -2821,37 +2807,37 @@ function Gt(e, t, n) {
2821
2807
  } }
2822
2808
  };
2823
2809
  }
2824
- function Kt(e) {
2810
+ function on(e) {
2825
2811
  return e == null ? void 0 : {
2826
2812
  type: e.type,
2827
2813
  toolId: "tool_id" in e ? e.tool_id : void 0
2828
2814
  };
2829
2815
  }
2830
2816
  function $(e) {
2831
- let t = Kt(e);
2817
+ let t = on(e);
2832
2818
  return t == null ? {} : { providerMetadata: { anthropic: { caller: t } } };
2833
2819
  }
2834
- function qt(e) {
2820
+ function sn(e) {
2835
2821
  let t = {};
2836
2822
  for (let n of e ?? []) n.type === "provider" && n.id === "anthropic.computer_toolset_20260801" && (t[n.name] = "computer");
2837
2823
  return t;
2838
2824
  }
2839
- function Jt({ memberName: e, input: t }) {
2825
+ function cn({ memberName: e, input: t }) {
2840
2826
  return {
2841
2827
  action: e,
2842
2828
  ...typeof t == "object" && t && !Array.isArray(t) ? t : {}
2843
2829
  };
2844
2830
  }
2845
- function Yt(e) {
2831
+ function ln(e) {
2846
2832
  let t = e.indexOf(".");
2847
2833
  return t === -1 ? e : e.substring(0, t);
2848
2834
  }
2849
- var Xt = class e {
2835
+ var un = class e {
2850
2836
  constructor(e, t) {
2851
2837
  this.specificationVersion = "v4", this.modelId = e, this.config = t, this.generateId = t.generateId ?? c;
2852
2838
  }
2853
2839
  static [l](e) {
2854
- return z({
2840
+ return R({
2855
2841
  modelId: e.modelId,
2856
2842
  config: e.config
2857
2843
  });
@@ -2892,20 +2878,20 @@ var Xt = class e {
2892
2878
  feature: "responseFormat",
2893
2879
  details: "JSON response format requires a schema. The response format is ignored."
2894
2880
  }));
2895
- let x = Yt(t.provider), S = await O({
2881
+ let x = ln(t.provider), S = await D({
2896
2882
  provider: "anthropic",
2897
2883
  providerOptions: v,
2898
- schema: Oe
2899
- }), C = x === "anthropic" ? null : await O({
2884
+ schema: ke
2885
+ }), C = x === "anthropic" ? null : await D({
2900
2886
  provider: x,
2901
2887
  providerOptions: v,
2902
- schema: Oe
2903
- }), T = C != null, E = Object.assign({}, S ?? {}, C ?? {}), { maxOutputTokens: D, supportsStructuredOutput: ee, supportsAdaptiveThinking: k, rejectsSamplingParameters: j, supportsXhighEffort: te, rejectsThinkingDisabledAboveHighEffort: M, rejectsThinkingDisabled: ne, rejectsForcedToolUse: N, supportsBetweenToolsThinking: P, isKnownModel: F } = Zt(e);
2904
- !F && i == null && b.push({
2888
+ schema: ke
2889
+ }), w = C != null, T = Object.assign({}, S ?? {}, C ?? {}), { maxOutputTokens: E, supportsStructuredOutput: te, supportsAdaptiveThinking: O, rejectsSamplingParameters: ne, supportsXhighEffort: re, rejectsThinkingDisabledAboveHighEffort: A, rejectsThinkingDisabled: j, rejectsForcedToolUse: M, supportsBetweenToolsThinking: N, isKnownModel: P } = dn(e);
2890
+ !P && i == null && b.push({
2905
2891
  type: "compatibility",
2906
2892
  feature: "maxOutputTokens",
2907
- details: `The model "${e}" is unknown. The max output tokens have been limited to ${D}. Set maxOutputTokens explicitly to override this limit.`
2908
- }), j && (a != null && (b.push({
2893
+ details: `The model "${e}" is unknown. The max output tokens have been limited to ${E}. Set maxOutputTokens explicitly to override this limit.`
2894
+ }), ne && (a != null && (b.push({
2909
2895
  type: "unsupported",
2910
2896
  feature: "temperature",
2911
2897
  details: `temperature is not supported by ${e} and will be ignored`
@@ -2918,29 +2904,29 @@ var Xt = class e {
2918
2904
  feature: "topP",
2919
2905
  details: `topP is not supported by ${e} and will be ignored`
2920
2906
  }), s = void 0));
2921
- let re = F || e.includes("claude-"), I = (t.supportsNativeStructuredOutput ?? !0) && ee, L = (t.supportsStrictTools ?? !0) && ee, R = E?.structuredOutputMode ?? "auto", z = R === "outputFormat" || R === "auto" && I;
2922
- !z && N && I && f?.type === "json" && f.schema != null && (b.push({
2907
+ let ie = P || e.includes("claude-"), F = (t.supportsNativeStructuredOutput ?? !0) && te, I = (t.supportsStrictTools ?? !0) && te, L = T?.structuredOutputMode ?? "auto", R = L === "outputFormat" || L === "auto" && F;
2908
+ !R && M && F && f?.type === "json" && f.schema != null && (b.push({
2923
2909
  type: "unsupported",
2924
2910
  feature: "providerOptions.anthropic.structuredOutputMode",
2925
2911
  details: `structuredOutputMode 'jsonTool' is not supported by ${e} because it rejects forced tool use. Using 'outputFormat' instead.`
2926
- }), z = !0);
2927
- let B = f?.type === "json" && f.schema != null && !z ? {
2912
+ }), R = !0);
2913
+ let z = f?.type === "json" && f.schema != null && !R ? {
2928
2914
  type: "function",
2929
2915
  name: "json",
2930
2916
  description: "Respond with a JSON object.",
2931
2917
  inputSchema: f.schema
2932
2918
  } : void 0;
2933
- B != null && E?.disableParallelToolUse === !1 && b.push({
2919
+ z != null && T?.disableParallelToolUse === !1 && b.push({
2934
2920
  type: "unsupported",
2935
2921
  feature: "providerOptions.anthropic.disableParallelToolUse",
2936
2922
  details: "`disableParallelToolUse: false` is ignored when using the JSON response tool. Parallel tool use is disabled to ensure a single coherent JSON tool call."
2937
2923
  });
2938
- let V = E?.contextManagement, H = E?.compaction;
2939
- if (V != null && H != null) throw new A({
2924
+ let B = T?.contextManagement, V = T?.compaction;
2925
+ if (B != null && V != null) throw new k({
2940
2926
  argument: "providerOptions",
2941
2927
  message: "Anthropic provider options `compaction` and `contextManagement` cannot be used together."
2942
2928
  });
2943
- let U = new je(), ie = m({
2929
+ let H = new Me(), ae = m({
2944
2930
  tools: h,
2945
2931
  providerToolNames: {
2946
2932
  "anthropic.code_execution_20250522": "code_execution",
@@ -2967,53 +2953,53 @@ var Xt = class e {
2967
2953
  "anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25",
2968
2954
  "anthropic.advisor_20260301": "advisor"
2969
2955
  }
2970
- }), ae = qt(h), { prompt: oe, betas: W } = await kt({
2956
+ }), oe = sn(h), { prompt: se, betas: U } = await Ht({
2971
2957
  prompt: r,
2972
- sendReasoning: E?.sendReasoning ?? !0,
2958
+ sendReasoning: T?.sendReasoning ?? !0,
2973
2959
  warnings: b,
2974
- cacheControlValidator: U,
2975
- toolNameMapping: ie,
2976
- toolsetNames: ae
2960
+ cacheControlValidator: H,
2961
+ toolNameMapping: ae,
2962
+ toolsetNames: oe
2977
2963
  });
2978
- if (w(_) && E?.effort == null) {
2979
- let t = $t({
2964
+ if (ee(_) && T?.effort == null) {
2965
+ let t = pn({
2980
2966
  reasoning: _,
2981
2967
  modelId: e,
2982
- supportsAdaptiveThinking: k,
2983
- supportsXhighEffort: te,
2984
- rejectsThinkingDisabled: ne,
2985
- supportsBetweenToolsThinking: P,
2986
- maxOutputTokensForModel: D,
2968
+ supportsAdaptiveThinking: O,
2969
+ supportsXhighEffort: re,
2970
+ rejectsThinkingDisabled: j,
2971
+ supportsBetweenToolsThinking: N,
2972
+ maxOutputTokensForModel: E,
2987
2973
  warnings: b
2988
2974
  });
2989
- t != null && (E.thinking ??= t.thinking, t.effort != null && E.thinking?.type !== "disabled" && (E.effort = t.effort));
2975
+ t != null && (T.thinking ??= t.thinking, t.effort != null && T.thinking?.type !== "disabled" && (T.effort = t.effort));
2990
2976
  }
2991
- if (ne && E?.thinking != null) {
2992
- let t = E.thinking;
2993
- t.type === "disabled" && P ? (b.push({
2977
+ if (j && T?.thinking != null) {
2978
+ let t = T.thinking;
2979
+ t.type === "disabled" && N ? (b.push({
2994
2980
  type: "unsupported",
2995
2981
  feature: "providerOptions.anthropic.thinking",
2996
2982
  details: `thinking cannot be disabled for ${e}. Using 'between_tools' thinking, the lowest thinking setting, instead.`
2997
- }), E.thinking = { type: "between_tools" }) : t.type === "disabled" ? (b.push({
2983
+ }), T.thinking = { type: "between_tools" }) : t.type === "disabled" ? (b.push({
2998
2984
  type: "unsupported",
2999
2985
  feature: "providerOptions.anthropic.thinking",
3000
2986
  details: `thinking cannot be disabled for ${e}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
3001
- }), E.thinking = void 0) : t.type === "enabled" && (b.push({
2987
+ }), T.thinking = void 0) : t.type === "enabled" && (b.push({
3002
2988
  type: "unsupported",
3003
2989
  feature: "providerOptions.anthropic.thinking",
3004
2990
  details: `budget-based thinking is not supported by ${e}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
3005
- }), E.thinking = { type: "adaptive" });
2991
+ }), T.thinking = { type: "adaptive" });
3006
2992
  }
3007
- M && E?.thinking?.type === "disabled" && (E.effort === "xhigh" || E.effort === "max") && (b.push({
2993
+ A && T?.thinking?.type === "disabled" && (T.effort === "xhigh" || T.effort === "max") && (b.push({
3008
2994
  type: "unsupported",
3009
2995
  feature: "providerOptions.anthropic.effort",
3010
- details: `effort '${E.effort}' is not supported by ${e} when thinking is disabled. The effort has been lowered to 'high'.`
3011
- }), E.effort = "high"), E?.thinking?.type === "between_tools" && (E.effort === "xhigh" || E.effort === "max") && (b.push({
2996
+ details: `effort '${T.effort}' is not supported by ${e} when thinking is disabled. The effort has been lowered to 'high'.`
2997
+ }), T.effort = "high"), T?.thinking?.type === "between_tools" && (T.effort === "xhigh" || T.effort === "max") && (b.push({
3012
2998
  type: "unsupported",
3013
2999
  feature: "providerOptions.anthropic.effort",
3014
- details: `effort '${E.effort}' is not supported with 'between_tools' thinking. The effort has been lowered to 'high'.`
3015
- }), E.effort = "high");
3016
- let G = E?.thinking?.type, se = G === "enabled" || G === "adaptive" || G === "between_tools", ce = E?.thinking != null && "blockBinding" in E.thinking ? E.thinking.blockBinding : void 0, K = se || G === "disabled" || ce != null, q = G === "enabled" ? E?.thinking?.budgetTokens : void 0, J = G === "adaptive" ? E?.thinking?.display : void 0, le = i ?? D, Y = {
3000
+ details: `effort '${T.effort}' is not supported with 'between_tools' thinking. The effort has been lowered to 'high'.`
3001
+ }), T.effort = "high");
3002
+ let W = T?.thinking?.type, ce = W === "enabled" || W === "adaptive" || W === "between_tools", G = T?.thinking != null && "blockBinding" in T.thinking ? T.thinking.blockBinding : void 0, K = ce || W === "disabled" || G != null, q = W === "enabled" ? T?.thinking?.budgetTokens : void 0, J = W === "adaptive" ? T?.thinking?.display : void 0, le = i ?? E, Y = {
3017
3003
  model: e,
3018
3004
  max_tokens: le,
3019
3005
  temperature: a,
@@ -3021,30 +3007,30 @@ var Xt = class e {
3021
3007
  top_p: s,
3022
3008
  stop_sequences: d,
3023
3009
  ...K && { thinking: {
3024
- ...G != null && { type: G },
3010
+ ...W != null && { type: W },
3025
3011
  ...q != null && { budget_tokens: q },
3026
3012
  ...J != null && { display: J },
3027
- ...ce != null && { block_binding: { prefix_mismatch_behavior: ce.prefixMismatchBehavior } }
3013
+ ...G != null && { block_binding: { prefix_mismatch_behavior: G.prefixMismatchBehavior } }
3028
3014
  } },
3029
- ...(E?.effort || E?.taskBudget || z && f?.type === "json" && f.schema != null) && { output_config: {
3030
- ...E?.effort && { effort: E.effort },
3031
- ...E?.taskBudget && { task_budget: {
3032
- type: E.taskBudget.type,
3033
- total: E.taskBudget.total,
3034
- ...E.taskBudget.remaining != null && { remaining: E.taskBudget.remaining }
3015
+ ...(T?.effort || T?.taskBudget || R && f?.type === "json" && f.schema != null) && { output_config: {
3016
+ ...T?.effort && { effort: T.effort },
3017
+ ...T?.taskBudget && { task_budget: {
3018
+ type: T.taskBudget.type,
3019
+ total: T.taskBudget.total,
3020
+ ...T.taskBudget.remaining != null && { remaining: T.taskBudget.remaining }
3035
3021
  } },
3036
- ...z && f?.type === "json" && f.schema != null && { format: {
3022
+ ...R && f?.type === "json" && f.schema != null && { format: {
3037
3023
  type: "json_schema",
3038
- schema: Rt(f.schema)
3024
+ schema: Zt(f.schema)
3039
3025
  } }
3040
3026
  } },
3041
- ...E?.speed && { speed: E.speed },
3042
- ...E?.serviceTier && { service_tier: E.serviceTier },
3043
- ...E?.inferenceGeo && { inference_geo: E.inferenceGeo },
3044
- ...E?.fallbacks != null && (E.fallbacks === "default" || E.fallbacks.length > 0) && { fallbacks: E.fallbacks },
3045
- ...E?.cacheControl && { cache_control: E.cacheControl },
3046
- ...E?.metadata?.userId != null && { metadata: { user_id: E.metadata.userId } },
3047
- ...E?.mcpServers && E.mcpServers.length > 0 && { mcp_servers: E.mcpServers.map((e) => ({
3027
+ ...T?.speed && { speed: T.speed },
3028
+ ...T?.serviceTier && { service_tier: T.serviceTier },
3029
+ ...T?.inferenceGeo && { inference_geo: T.inferenceGeo },
3030
+ ...T?.fallbacks != null && (T.fallbacks === "default" || T.fallbacks.length > 0) && { fallbacks: T.fallbacks },
3031
+ ...T?.cacheControl && { cache_control: T.cacheControl },
3032
+ ...T?.metadata?.userId != null && { metadata: { user_id: T.metadata.userId } },
3033
+ ...T?.mcpServers && T.mcpServers.length > 0 && { mcp_servers: T.mcpServers.map((e) => ({
3048
3034
  type: e.type,
3049
3035
  name: e.name,
3050
3036
  url: e.url,
@@ -3054,9 +3040,9 @@ var Xt = class e {
3054
3040
  enabled: e.toolConfiguration.enabled
3055
3041
  } : void 0
3056
3042
  })) },
3057
- ...E?.container && { container: E.container.skills && E.container.skills.length > 0 ? {
3058
- id: E.container.id,
3059
- skills: E.container.skills.map((e) => ({
3043
+ ...T?.container && { container: T.container.skills && T.container.skills.length > 0 ? {
3044
+ id: T.container.id,
3045
+ skills: T.container.skills.map((e) => ({
3060
3046
  type: e.type,
3061
3047
  skill_id: e.type === "custom" ? o({
3062
3048
  reference: e.providerReference,
@@ -3064,18 +3050,18 @@ var Xt = class e {
3064
3050
  }) : e.skillId,
3065
3051
  version: e.version
3066
3052
  }))
3067
- } : E.container.id },
3068
- system: oe.system,
3069
- messages: oe.messages,
3070
- ...E?.safeguards && E.safeguards.length > 0 && { safeguards: E.safeguards.map((e) => ({
3053
+ } : T.container.id },
3054
+ system: se.system,
3055
+ messages: se.messages,
3056
+ ...T?.safeguards && T.safeguards.length > 0 && { safeguards: T.safeguards.map((e) => ({
3071
3057
  type: e.type,
3072
3058
  ...e.classifierContext !== void 0 && { classifier_context: e.classifierContext }
3073
3059
  })) },
3074
- ...H && { compaction: {
3075
- type: H.type,
3076
- ...H.instructions !== void 0 && { instructions: H.instructions }
3060
+ ...V && { compaction: {
3061
+ type: V.type,
3062
+ ...V.instructions !== void 0 && { instructions: V.instructions }
3077
3063
  } },
3078
- ...V && { context_management: { edits: V.edits.map((e) => {
3064
+ ...B && { context_management: { edits: B.edits.map((e) => {
3079
3065
  let t = e.type;
3080
3066
  switch (t) {
3081
3067
  case "clear_tool_uses_20250919": return {
@@ -3105,7 +3091,7 @@ var Xt = class e {
3105
3091
  }
3106
3092
  }).filter((e) => e !== void 0) } }
3107
3093
  };
3108
- se ? (G === "enabled" && q == null && (b.push({
3094
+ ce ? (W === "enabled" && q == null && (b.push({
3109
3095
  type: "compatibility",
3110
3096
  feature: "extended thinking",
3111
3097
  details: "thinking budget is required when thinking is enabled. using default budget of 1024 tokens."
@@ -3124,43 +3110,43 @@ var Xt = class e {
3124
3110
  type: "unsupported",
3125
3111
  feature: "topP",
3126
3112
  details: "topP is not supported when thinking is enabled"
3127
- })), Y.max_tokens = le + (q ?? 0)) : re && s != null && a != null && (b.push({
3113
+ })), Y.max_tokens = le + (q ?? 0)) : ie && s != null && a != null && (b.push({
3128
3114
  type: "unsupported",
3129
3115
  feature: "topP",
3130
3116
  details: "topP is not supported when temperature is set. topP is ignored."
3131
- }), Y.top_p = void 0), F && Y.max_tokens > D && (i != null && b.push({
3117
+ }), Y.top_p = void 0), P && Y.max_tokens > E && (i != null && b.push({
3132
3118
  type: "unsupported",
3133
3119
  feature: "maxOutputTokens",
3134
- details: `${Y.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${e} ${D} max output tokens. The max output tokens have been limited to ${D}.`
3135
- }), Y.max_tokens = D), E?.mcpServers && E.mcpServers.length > 0 && W.add("mcp-client-2025-04-04"), E?.safeguards && E.safeguards.length > 0 && W.add("dangerous-tool-use-2026-09-03"), H && W.add("compact-2026-09-04"), V && (W.add("context-management-2025-06-27"), V.edits.some((e) => e.type === "compact_20260112") && W.add("compact-2026-01-12")), E?.container && E.container.skills && E.container.skills.length > 0 && (W.add("code-execution-2025-08-25"), W.add("skills-2025-10-02"), W.add("files-api-2025-04-14"), h?.some((e) => e.type === "provider" && (e.id === "anthropic.code_execution_20250825" || e.id === "anthropic.code_execution_20260120")) || b.push({
3120
+ details: `${Y.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${e} ${E} max output tokens. The max output tokens have been limited to ${E}.`
3121
+ }), Y.max_tokens = E), T?.mcpServers && T.mcpServers.length > 0 && U.add("mcp-client-2025-04-04"), T?.safeguards && T.safeguards.length > 0 && U.add("dangerous-tool-use-2026-09-03"), V && U.add("compact-2026-09-04"), B && (U.add("context-management-2025-06-27"), B.edits.some((e) => e.type === "compact_20260112") && U.add("compact-2026-01-12")), T?.container && T.container.skills && T.container.skills.length > 0 && (U.add("code-execution-2025-08-25"), U.add("skills-2025-10-02"), U.add("files-api-2025-04-14"), h?.some((e) => e.type === "provider" && (e.id === "anthropic.code_execution_20250825" || e.id === "anthropic.code_execution_20260120")) || b.push({
3136
3122
  type: "other",
3137
3123
  message: "code execution tool is required when using skills"
3138
- })), E?.taskBudget && W.add("task-budgets-2026-03-13"), E?.speed === "fast" && W.add("fast-mode-2026-02-01"), J === "updates" && W.add("thinking-display-updates-2026-08-18"), ce != null && W.add("thinking-binding-controls-2026-08-01"), E?.fallbacks === "default" ? W.add("server-side-fallback-2026-07-01") : E?.fallbacks && E.fallbacks.length > 0 && W.add("server-side-fallback-2026-06-01");
3139
- let ue = y && (E?.toolStreaming ?? !0), { tools: de, toolChoice: fe, toolWarnings: pe, betas: me } = await pt(B == null ? {
3124
+ })), T?.taskBudget && U.add("task-budgets-2026-03-13"), T?.speed === "fast" && U.add("fast-mode-2026-02-01"), J === "updates" && U.add("thinking-display-updates-2026-08-18"), G != null && U.add("thinking-binding-controls-2026-08-01"), T?.fallbacks === "default" ? U.add("server-side-fallback-2026-07-01") : T?.fallbacks && T.fallbacks.length > 0 && U.add("server-side-fallback-2026-06-01");
3125
+ let ue = y && (T?.toolStreaming ?? !0), { tools: de, toolChoice: fe, toolWarnings: pe, betas: me } = await St(z == null ? {
3140
3126
  tools: h ?? [],
3141
3127
  toolChoice: g,
3142
- disableParallelToolUse: E?.disableParallelToolUse,
3143
- cacheControlValidator: U,
3144
- supportsStructuredOutput: I,
3145
- supportsStrictTools: L,
3128
+ disableParallelToolUse: T?.disableParallelToolUse,
3129
+ cacheControlValidator: H,
3130
+ supportsStructuredOutput: F,
3131
+ supportsStrictTools: I,
3146
3132
  defaultEagerInputStreaming: ue,
3147
- rejectsForcedToolUse: N
3133
+ rejectsForcedToolUse: M
3148
3134
  } : {
3149
- tools: [...h ?? [], B],
3135
+ tools: [...h ?? [], z],
3150
3136
  toolChoice: { type: "required" },
3151
3137
  disableParallelToolUse: !0,
3152
- cacheControlValidator: U,
3138
+ cacheControlValidator: H,
3153
3139
  supportsStructuredOutput: !1,
3154
- supportsStrictTools: L,
3140
+ supportsStrictTools: I,
3155
3141
  defaultEagerInputStreaming: ue,
3156
- rejectsForcedToolUse: N
3157
- }), he = U.getWarnings();
3142
+ rejectsForcedToolUse: M
3143
+ }), he = H.getWarnings();
3158
3144
  return {
3159
3145
  args: {
3160
3146
  ...Y,
3161
3147
  tools: de,
3162
3148
  tool_choice: fe,
3163
- stream: y === !0 ? !0 : void 0
3149
+ stream: y === !0 || void 0
3164
3150
  },
3165
3151
  warnings: [
3166
3152
  ...b,
@@ -3168,15 +3154,15 @@ var Xt = class e {
3168
3154
  ...he
3169
3155
  ],
3170
3156
  betas: /* @__PURE__ */ new Set([
3171
- ...W,
3157
+ ...U,
3172
3158
  ...me,
3173
3159
  ...n,
3174
- ...E?.anthropicBeta ?? []
3160
+ ...T?.anthropicBeta ?? []
3175
3161
  ]),
3176
- usesJsonResponseTool: B != null,
3177
- toolNameMapping: ie,
3162
+ usesJsonResponseTool: z != null,
3163
+ toolNameMapping: ae,
3178
3164
  providerOptionsName: x,
3179
- usedCustomProviderKey: T
3165
+ usedCustomProviderKey: w
3180
3166
  };
3181
3167
  }
3182
3168
  getArgs(t) {
@@ -3187,7 +3173,7 @@ var Xt = class e {
3187
3173
  });
3188
3174
  }
3189
3175
  async getHeaders({ betas: e, headers: t }) {
3190
- return N(this.config.headers ? await fe(this.config.headers) : void 0, t, e.size > 0 ? { "anthropic-beta": Array.from(e).join(",") } : {});
3176
+ return M(this.config.headers ? await fe(this.config.headers) : void 0, t, e.size > 0 ? { "anthropic-beta": Array.from(e).join(",") } : {});
3191
3177
  }
3192
3178
  async getBetasFromHeaders(e) {
3193
3179
  let t = (this.config.headers ? await fe(this.config.headers) : void 0)?.["anthropic-beta"] ?? "", n = e?.["anthropic-beta"] ?? "";
@@ -3214,7 +3200,7 @@ var Xt = class e {
3214
3200
  ...e,
3215
3201
  stream: !1,
3216
3202
  userSuppliedBetas: await this.getBetasFromHeaders(e.headers)
3217
- }), l = [...this.extractCitationDocuments(e.prompt)], u = Qt(t.tools), { responseHeaders: d, value: f, rawValue: p } = await j({
3203
+ }), l = [...this.extractCitationDocuments(e.prompt)], u = fn(t.tools), { responseHeaders: d, value: f, rawValue: p } = await ne({
3218
3204
  url: this.buildRequestUrl(!1),
3219
3205
  headers: await this.getHeaders({
3220
3206
  betas: r,
@@ -3222,7 +3208,7 @@ var Xt = class e {
3222
3208
  }),
3223
3209
  body: this.transformRequestBody(t, r),
3224
3210
  failedResponseHandler: X,
3225
- successfulResponseHandler: a(Ce),
3211
+ successfulResponseHandler: a(we),
3226
3212
  abortSignal: e.abortSignal,
3227
3213
  fetch: this.config.fetch
3228
3214
  }), m = [], h = {}, g = {}, _ = !1;
@@ -3235,7 +3221,7 @@ var Xt = class e {
3235
3221
  text: e.text,
3236
3222
  ...t != null && t.length > 0 && { providerMetadata: { anthropic: { citations: t } } }
3237
3223
  }), e.citations) for (let t of e.citations) {
3238
- let e = Gt(t, l, this.generateId);
3224
+ let e = an(t, l, this.generateId);
3239
3225
  e && m.push(e);
3240
3226
  }
3241
3227
  }
@@ -3286,7 +3272,7 @@ var Xt = class e {
3286
3272
  type: "tool-call",
3287
3273
  toolCallId: e.id,
3288
3274
  toolName: o.toCustomToolName(e.toolset_name),
3289
- input: JSON.stringify(Jt({
3275
+ input: JSON.stringify(cn({
3290
3276
  memberName: e.name,
3291
3277
  input: e.input
3292
3278
  })),
@@ -3536,18 +3522,17 @@ var Xt = class e {
3536
3522
  });
3537
3523
  break;
3538
3524
  }
3539
- case "fallback": break;
3540
3525
  }
3541
3526
  return {
3542
3527
  content: m,
3543
3528
  finishReason: {
3544
- unified: Ft({
3529
+ unified: Jt({
3545
3530
  finishReason: f.stop_reason,
3546
3531
  isJsonResponseFromTool: _
3547
3532
  }),
3548
3533
  raw: f.stop_reason ?? void 0
3549
3534
  },
3550
- usage: mt({ usage: f.usage }),
3535
+ usage: Ct({ usage: f.usage }),
3551
3536
  request: { body: t },
3552
3537
  response: {
3553
3538
  id: f.id ?? void 0,
@@ -3557,7 +3542,7 @@ var Xt = class e {
3557
3542
  },
3558
3543
  warnings: n,
3559
3544
  providerMetadata: (() => {
3560
- let e = tn(f.stop_details), t = {
3545
+ let e = hn(f.stop_details), t = {
3561
3546
  usage: f.usage,
3562
3547
  stopSequence: f.stop_sequence ?? null,
3563
3548
  ...e == null ? {} : { stopDetails: e },
@@ -3580,7 +3565,7 @@ var Xt = class e {
3580
3565
  version: e.version
3581
3566
  })) ?? null
3582
3567
  } : null,
3583
- contextManagement: en(f.context_management) ?? null
3568
+ contextManagement: mn(f.context_management) ?? null
3584
3569
  }, n = { anthropic: t };
3585
3570
  return c && s !== "anthropic" && (n[s] = t), n;
3586
3571
  })()
@@ -3592,7 +3577,7 @@ var Xt = class e {
3592
3577
  ...e,
3593
3578
  stream: !0,
3594
3579
  userSuppliedBetas: await this.getBetasFromHeaders(e.headers)
3595
- }), l = [...this.extractCitationDocuments(e.prompt)], u = Qt(t.tools), d = this.buildRequestUrl(!0), { responseHeaders: f, value: p } = await j({
3580
+ }), l = [...this.extractCitationDocuments(e.prompt)], u = fn(t.tools), d = this.buildRequestUrl(!0), { responseHeaders: f, value: p } = await ne({
3596
3581
  url: d,
3597
3582
  headers: await this.getHeaders({
3598
3583
  betas: i,
@@ -3600,7 +3585,7 @@ var Xt = class e {
3600
3585
  }),
3601
3586
  body: this.transformRequestBody(t, i),
3602
3587
  failedResponseHandler: X,
3603
- successfulResponseHandler: _(we),
3588
+ successfulResponseHandler: _(Te),
3604
3589
  abortSignal: e.abortSignal,
3605
3590
  fetch: this.config.fetch
3606
3591
  }), m = {
@@ -3612,7 +3597,7 @@ var Xt = class e {
3612
3597
  cache_creation_input_tokens: 0,
3613
3598
  cache_read_input_tokens: 0,
3614
3599
  iterations: null
3615
- }, g = {}, y = {}, b = {}, x = null, S, C = null, w, T, E, D = null, O = !1, k = !1, A, te = !1, M, ne = this.generateId, [N, P] = p.pipeThrough(new TransformStream({
3600
+ }, g = {}, y = {}, b = {}, x = null, S, C = null, ee, w, T, E = null, D = !1, O = !1, k, re = !1, A, j = this.generateId, [M, N] = p.pipeThrough(new TransformStream({
3616
3601
  start(e) {
3617
3602
  e.enqueue({
3618
3603
  type: "stream-start",
@@ -3620,7 +3605,7 @@ var Xt = class e {
3620
3605
  });
3621
3606
  },
3622
3607
  transform(t, r) {
3623
- if (te) return;
3608
+ if (re) return;
3624
3609
  if (e.includeRawChunks && r.enqueue({
3625
3610
  type: "raw",
3626
3611
  rawValue: t.rawValue
@@ -3637,7 +3622,7 @@ var Xt = class e {
3637
3622
  case "content_block_start": {
3638
3623
  let e = i.content_block, t = e.type;
3639
3624
  if (t === "fallback") return;
3640
- switch (M = t, t) {
3625
+ switch (A = t, t) {
3641
3626
  case "text":
3642
3627
  if (a) return;
3643
3628
  g[i.index] = {
@@ -3679,7 +3664,7 @@ var Xt = class e {
3679
3664
  });
3680
3665
  return;
3681
3666
  case "tool_use":
3682
- if (a && e.name === "json") O = !0, g[i.index] = {
3667
+ if (a && e.name === "json") D = !0, g[i.index] = {
3683
3668
  type: "text",
3684
3669
  citations: []
3685
3670
  }, r.enqueue({
@@ -3687,7 +3672,7 @@ var Xt = class e {
3687
3672
  id: String(i.index)
3688
3673
  });
3689
3674
  else if (e.toolset_name != null) {
3690
- let t = Kt(e.caller), n = o.toCustomToolName(e.toolset_name), a = e.input && Object.keys(e.input).length > 0;
3675
+ let t = on(e.caller), n = o.toCustomToolName(e.toolset_name), a = e.input && Object.keys(e.input).length > 0;
3691
3676
  g[i.index] = {
3692
3677
  type: "tool-call",
3693
3678
  toolCallId: e.id,
@@ -3705,7 +3690,7 @@ var Xt = class e {
3705
3690
  toolName: n
3706
3691
  });
3707
3692
  } else {
3708
- let t = Kt(e.caller), n = e.input && Object.keys(e.input).length > 0 ? JSON.stringify(e.input) : "";
3693
+ let t = on(e.caller), n = e.input && Object.keys(e.input).length > 0 ? JSON.stringify(e.input) : "";
3709
3694
  g[i.index] = {
3710
3695
  type: "tool-call",
3711
3696
  toolCallId: e.id,
@@ -3721,7 +3706,7 @@ var Xt = class e {
3721
3706
  }
3722
3707
  return;
3723
3708
  case "server_tool_use": {
3724
- let t = Kt(e.caller);
3709
+ let t = on(e.caller);
3725
3710
  if ([
3726
3711
  "web_fetch",
3727
3712
  "web_search",
@@ -3840,7 +3825,7 @@ var Xt = class e {
3840
3825
  for (let t of e.content) r.enqueue({
3841
3826
  type: "source",
3842
3827
  sourceType: "url",
3843
- id: ne(),
3828
+ id: j(),
3844
3829
  url: t.url,
3845
3830
  ...t.title == null ? {} : { title: t.title },
3846
3831
  providerMetadata: { anthropic: { pageAge: t.page_age ?? null } }
@@ -4003,54 +3988,52 @@ var Xt = class e {
4003
3988
  id: String(i.index)
4004
3989
  });
4005
3990
  break;
4006
- case "tool-call":
4007
- if (!(a && e.toolName === "json")) {
4008
- if (e.toolset != null) {
4009
- let t = {};
4010
- try {
4011
- t = e.input === "" ? {} : n(e.input);
4012
- } catch {
4013
- t = void 0;
4014
- }
4015
- e.input = t === void 0 ? e.input : JSON.stringify(Jt({
4016
- memberName: e.toolset.memberName,
4017
- input: t
4018
- })), r.enqueue({
4019
- type: "tool-input-delta",
4020
- id: e.toolCallId,
4021
- delta: e.input
4022
- });
3991
+ case "tool-call": if (!(a && e.toolName === "json")) {
3992
+ if (e.toolset != null) {
3993
+ let t = {};
3994
+ try {
3995
+ t = e.input === "" ? {} : n(e.input);
3996
+ } catch {
3997
+ t = void 0;
4023
3998
  }
4024
- r.enqueue({
4025
- type: "tool-input-end",
4026
- id: e.toolCallId
4027
- });
4028
- let t = e.input === "" ? "{}" : e.input;
4029
- if (e.providerToolName === "code_execution") try {
4030
- let e = n(t);
4031
- typeof e == "object" && e && "code" in e && !("type" in e) && (t = JSON.stringify({
4032
- type: "programmatic-tool-call",
4033
- ...e
4034
- }));
4035
- } catch {}
4036
- r.enqueue({
4037
- type: "tool-call",
4038
- toolCallId: e.toolCallId,
4039
- toolName: e.toolName,
4040
- input: t,
4041
- providerExecuted: e.providerExecuted,
4042
- ...u && e.providerToolName === "code_execution" ? { dynamic: !0 } : {},
4043
- ...(e.caller || e.toolset) && { providerMetadata: { anthropic: {
4044
- ...e.toolset && { toolsetName: e.toolset.name },
4045
- ...e.caller && { caller: e.caller }
4046
- } } }
3999
+ e.input = t === void 0 ? e.input : JSON.stringify(cn({
4000
+ memberName: e.toolset.memberName,
4001
+ input: t
4002
+ })), r.enqueue({
4003
+ type: "tool-input-delta",
4004
+ id: e.toolCallId,
4005
+ delta: e.input
4047
4006
  });
4048
4007
  }
4049
- break;
4008
+ r.enqueue({
4009
+ type: "tool-input-end",
4010
+ id: e.toolCallId
4011
+ });
4012
+ let t = e.input === "" ? "{}" : e.input;
4013
+ if (e.providerToolName === "code_execution") try {
4014
+ let e = n(t);
4015
+ typeof e == "object" && e && "code" in e && !("type" in e) && (t = JSON.stringify({
4016
+ type: "programmatic-tool-call",
4017
+ ...e
4018
+ }));
4019
+ } catch {}
4020
+ r.enqueue({
4021
+ type: "tool-call",
4022
+ toolCallId: e.toolCallId,
4023
+ toolName: e.toolName,
4024
+ input: t,
4025
+ providerExecuted: e.providerExecuted,
4026
+ ...u && e.providerToolName === "code_execution" ? { dynamic: !0 } : {},
4027
+ ...(e.caller || e.toolset) && { providerMetadata: { anthropic: {
4028
+ ...e.toolset && { toolsetName: e.toolset.name },
4029
+ ...e.caller && { caller: e.caller }
4030
+ } } }
4031
+ });
4032
+ }
4050
4033
  }
4051
4034
  delete g[i.index];
4052
4035
  }
4053
- M = void 0;
4036
+ A = void 0;
4054
4037
  return;
4055
4038
  case "content_block_delta": {
4056
4039
  let e = i.delta.type;
@@ -4071,7 +4054,7 @@ var Xt = class e {
4071
4054
  });
4072
4055
  return;
4073
4056
  case "signature_delta":
4074
- M === "thinking" && r.enqueue({
4057
+ A === "thinking" && r.enqueue({
4075
4058
  type: "reasoning-delta",
4076
4059
  id: String(i.index),
4077
4060
  delta: "",
@@ -4088,7 +4071,7 @@ var Xt = class e {
4088
4071
  case "input_json_delta": {
4089
4072
  let e = g[i.index], t = i.delta.partial_json;
4090
4073
  if (t.length === 0) return;
4091
- if (O) {
4074
+ if (D) {
4092
4075
  if (e?.type !== "text") return;
4093
4076
  r.enqueue({
4094
4077
  type: "text-delta",
@@ -4112,7 +4095,7 @@ var Xt = class e {
4112
4095
  case "citations_delta": {
4113
4096
  let e = i.delta.citation, t = g[i.index];
4114
4097
  t?.type === "text" && e.type === "web_search_result_location" && t.citations.push(e);
4115
- let n = Gt(e, l, ne);
4098
+ let n = an(e, l, j);
4116
4099
  n && r.enqueue(n);
4117
4100
  return;
4118
4101
  }
@@ -4120,25 +4103,25 @@ var Xt = class e {
4120
4103
  }
4121
4104
  }
4122
4105
  case "message_start":
4123
- if (k) {
4124
- if (A === i.message.id) return;
4125
- te = !0, r.enqueue({
4106
+ if (O) {
4107
+ if (k === i.message.id) return;
4108
+ re = !0, r.enqueue({
4126
4109
  type: "error",
4127
4110
  error: new v({
4128
4111
  data: i,
4129
- message: `Received message_start for message ${JSON.stringify(i.message.id)} while message ${JSON.stringify(A)} is still open.`
4112
+ message: `Received message_start for message ${JSON.stringify(i.message.id)} while message ${JSON.stringify(k)} is still open.`
4130
4113
  })
4131
4114
  });
4132
4115
  return;
4133
4116
  }
4134
- if (k = !0, A = i.message.id, h.input_tokens = i.message.usage.input_tokens, h.cache_read_input_tokens = i.message.usage.cache_read_input_tokens ?? 0, h.cache_creation_input_tokens = i.message.usage.cache_creation_input_tokens ?? 0, S = { ...i.message.usage }, i.message.input_transformations != null && (T = i.message.input_transformations), i.message.container != null && (D = {
4117
+ if (O = !0, k = i.message.id, h.input_tokens = i.message.usage.input_tokens, h.cache_read_input_tokens = i.message.usage.cache_read_input_tokens ?? 0, h.cache_creation_input_tokens = i.message.usage.cache_creation_input_tokens ?? 0, S = { ...i.message.usage }, i.message.input_transformations != null && (w = i.message.input_transformations), i.message.container != null && (E = {
4135
4118
  expiresAt: i.message.container.expires_at,
4136
4119
  id: i.message.container.id,
4137
4120
  skills: null
4138
4121
  }), i.message.stop_reason != null && (m = {
4139
- unified: Ft({
4122
+ unified: Jt({
4140
4123
  finishReason: i.message.stop_reason,
4141
- isJsonResponseFromTool: O
4124
+ isJsonResponseFromTool: D
4142
4125
  }),
4143
4126
  raw: i.message.stop_reason
4144
4127
  }), r.enqueue({
@@ -4148,7 +4131,7 @@ var Xt = class e {
4148
4131
  }), i.message.content != null) for (let e = 0; e < i.message.content.length; e++) {
4149
4132
  let t = i.message.content[e];
4150
4133
  if (t.type === "tool_use") {
4151
- let e = Kt(t.caller);
4134
+ let e = on(t.caller);
4152
4135
  r.enqueue({
4153
4136
  type: "tool-input-start",
4154
4137
  id: t.id,
@@ -4174,12 +4157,12 @@ var Xt = class e {
4174
4157
  return;
4175
4158
  case "message_delta":
4176
4159
  i.usage.input_tokens != null && h.input_tokens !== i.usage.input_tokens && (h.input_tokens = i.usage.input_tokens), h.output_tokens = i.usage.output_tokens, i.usage.output_tokens_details != null && (h.output_tokens_details = i.usage.output_tokens_details), i.usage.cache_read_input_tokens != null && (h.cache_read_input_tokens = i.usage.cache_read_input_tokens), i.usage.cache_creation_input_tokens != null && (h.cache_creation_input_tokens = i.usage.cache_creation_input_tokens), i.usage.iterations != null && (h.iterations = i.usage.iterations), m = {
4177
- unified: Ft({
4160
+ unified: Jt({
4178
4161
  finishReason: i.delta.stop_reason,
4179
- isJsonResponseFromTool: O
4162
+ isJsonResponseFromTool: D
4180
4163
  }),
4181
4164
  raw: i.delta.stop_reason ?? void 0
4182
- }, C = i.delta.stop_sequence ?? null, w = tn(i.delta.stop_details), D = i.delta.container == null ? null : {
4165
+ }, C = i.delta.stop_sequence ?? null, ee = hn(i.delta.stop_details), E = i.delta.container == null ? null : {
4183
4166
  expiresAt: i.delta.container.expires_at,
4184
4167
  id: i.delta.container.id,
4185
4168
  skills: i.delta.container.skills?.map((e) => ({
@@ -4187,19 +4170,19 @@ var Xt = class e {
4187
4170
  skillId: e.skill_id,
4188
4171
  version: e.version
4189
4172
  })) ?? null
4190
- }, i.context_management && (x = en(i.context_management)), i.input_transformations != null && (T = i.input_transformations), i.delta.safeguard_results != null && (E = i.delta.safeguard_results), S = {
4173
+ }, i.context_management && (x = mn(i.context_management)), i.input_transformations != null && (w = i.input_transformations), i.delta.safeguard_results != null && (T = i.delta.safeguard_results), S = {
4191
4174
  ...S,
4192
4175
  ...i.usage
4193
4176
  };
4194
4177
  return;
4195
4178
  case "message_stop": {
4196
- k = !1, A = void 0;
4179
+ O = !1, k = void 0;
4197
4180
  let e = {
4198
4181
  usage: S ?? null,
4199
4182
  stopSequence: C,
4200
- ...w == null ? {} : { stopDetails: w },
4201
- ...T == null ? {} : { inputTransformations: T },
4202
- ...E == null ? {} : { safeguardResults: E },
4183
+ ...ee == null ? {} : { stopDetails: ee },
4184
+ ...w == null ? {} : { inputTransformations: w },
4185
+ ...T == null ? {} : { safeguardResults: T },
4203
4186
  iterations: h.iterations ? h.iterations.map((e) => ({
4204
4187
  type: e.type,
4205
4188
  ...e.model == null ? {} : { model: e.model },
@@ -4208,13 +4191,13 @@ var Xt = class e {
4208
4191
  ...e.cache_creation_input_tokens ? { cacheCreationInputTokens: e.cache_creation_input_tokens } : {},
4209
4192
  ...e.cache_read_input_tokens ? { cacheReadInputTokens: e.cache_read_input_tokens } : {}
4210
4193
  })) : null,
4211
- container: D,
4194
+ container: E,
4212
4195
  contextManagement: x
4213
4196
  }, t = { anthropic: e };
4214
4197
  c && s !== "anthropic" && (t[s] = e), r.enqueue({
4215
4198
  type: "finish",
4216
4199
  finishReason: m,
4217
- usage: mt({
4200
+ usage: Ct({
4218
4201
  usage: h,
4219
4202
  rawUsage: S
4220
4203
  }),
@@ -4225,19 +4208,19 @@ var Xt = class e {
4225
4208
  case "error":
4226
4209
  r.enqueue({
4227
4210
  type: "error",
4228
- error: Ut(i.error)
4211
+ error: nn(i.error)
4229
4212
  });
4230
4213
  return;
4231
4214
  default: throw Error(`Unsupported chunk type: ${i}`);
4232
4215
  }
4233
4216
  }
4234
- })).tee(), F = N.getReader();
4217
+ })).tee(), P = M.getReader();
4235
4218
  try {
4236
- await F.read();
4237
- let e = await F.read();
4238
- if (e.value?.type === "raw" && (e = await F.read()), e.value?.type === "error") {
4219
+ await P.read();
4220
+ let e = await P.read();
4221
+ if (e.value?.type === "raw" && (e = await P.read()), e.value?.type === "error") {
4239
4222
  let n = e.value.error;
4240
- throw le(n) ? new ee({
4223
+ throw le(n) ? new te({
4241
4224
  message: n.message,
4242
4225
  url: d,
4243
4226
  requestBodyValues: t,
@@ -4248,16 +4231,16 @@ var Xt = class e {
4248
4231
  }) : Error("Expected a normalized Anthropic stream error");
4249
4232
  }
4250
4233
  } finally {
4251
- F.cancel().catch(() => {}), F.releaseLock();
4234
+ P.cancel().catch(() => {}), P.releaseLock();
4252
4235
  }
4253
4236
  return {
4254
- stream: P,
4237
+ stream: N,
4255
4238
  request: { body: t },
4256
4239
  response: { headers: f }
4257
4240
  };
4258
4241
  }
4259
4242
  };
4260
- function Zt(e) {
4243
+ function dn(e) {
4261
4244
  return e.includes("claude-sonnet-5-5") ? {
4262
4245
  maxOutputTokens: 128e3,
4263
4246
  supportsStructuredOutput: !0,
@@ -4425,23 +4408,18 @@ function Zt(e) {
4425
4408
  isKnownModel: !1
4426
4409
  };
4427
4410
  }
4428
- function Qt(e) {
4411
+ function fn(e) {
4429
4412
  if (!e) return !1;
4430
4413
  let t = !1, n = !1;
4431
- for (let r of e) {
4432
- if ("type" in r && (r.type === "web_fetch_20260209" || r.type === "web_fetch_20260318" || r.type === "web_search_20260209" || r.type === "web_search_20260318")) {
4433
- t = !0;
4434
- continue;
4435
- }
4436
- if ("type" in r && (r.type === "code_execution_20250522" || r.type === "code_execution_20250825" || r.type === "code_execution_20260120")) {
4437
- n = !0;
4438
- break;
4439
- }
4414
+ for (let r of e) if ("type" in r && (r.type === "web_fetch_20260209" || r.type === "web_fetch_20260318" || r.type === "web_search_20260209" || r.type === "web_search_20260318")) t = !0;
4415
+ else if ("type" in r && (r.type === "code_execution_20250522" || r.type === "code_execution_20250825" || r.type === "code_execution_20260120")) {
4416
+ n = !0;
4417
+ break;
4440
4418
  }
4441
4419
  return t && !n;
4442
4420
  }
4443
- function $t({ reasoning: e, modelId: t, supportsAdaptiveThinking: n, supportsXhighEffort: r, rejectsThinkingDisabled: i, supportsBetweenToolsThinking: a, maxOutputTokensForModel: o, warnings: s }) {
4444
- if (!w(e)) return;
4421
+ function pn({ reasoning: e, modelId: t, supportsAdaptiveThinking: n, supportsXhighEffort: r, rejectsThinkingDisabled: i, supportsBetweenToolsThinking: a, maxOutputTokensForModel: o, warnings: s }) {
4422
+ if (!ee(e)) return;
4445
4423
  if (e === "none") return a ? { thinking: { type: "between_tools" } } : i ? (s.push({
4446
4424
  type: "compatibility",
4447
4425
  feature: "reasoning",
@@ -4452,7 +4430,7 @@ function $t({ reasoning: e, modelId: t, supportsAdaptiveThinking: n, supportsXhi
4452
4430
  type: "adaptive",
4453
4431
  display: "summarized"
4454
4432
  },
4455
- effort: ne({
4433
+ effort: j({
4456
4434
  reasoning: e,
4457
4435
  effortMap: {
4458
4436
  minimal: "low",
@@ -4475,7 +4453,7 @@ function $t({ reasoning: e, modelId: t, supportsAdaptiveThinking: n, supportsXhi
4475
4453
  budgetTokens: c
4476
4454
  } };
4477
4455
  }
4478
- function en(e) {
4456
+ function mn(e) {
4479
4457
  return e ? { appliedEdits: e.applied_edits.map((e) => {
4480
4458
  switch (e.type) {
4481
4459
  case "clear_tool_uses_20250919": return {
@@ -4492,7 +4470,7 @@ function en(e) {
4492
4470
  }
4493
4471
  }).filter((e) => e !== void 0) } : null;
4494
4472
  }
4495
- function tn(e) {
4473
+ function hn(e) {
4496
4474
  if (e != null) return {
4497
4475
  type: e.type,
4498
4476
  ...e.category == null ? {} : { category: e.category },
@@ -4500,28 +4478,28 @@ function tn(e) {
4500
4478
  ...e.recommended_model == null ? {} : { recommendedModel: e.recommended_model }
4501
4479
  };
4502
4480
  }
4503
- var nn = /^[A-Za-z0-9_-]{1,64}$/, rn = Oe.pick({ anthropicBeta: !0 }), an = () => k({
4504
- id: H(),
4481
+ var gn = /^[A-Za-z0-9_-]{1,64}$/, _n = ke.pick({ anthropicBeta: !0 }), vn = () => O({
4482
+ id: V(),
4505
4483
  type: J("message_batch"),
4506
- processing_status: H(),
4507
- request_counts: k({
4508
- processing: I(),
4509
- succeeded: I(),
4510
- errored: I(),
4511
- canceled: I(),
4512
- expired: I()
4484
+ processing_status: V(),
4485
+ request_counts: O({
4486
+ processing: F(),
4487
+ succeeded: F(),
4488
+ errored: F(),
4489
+ canceled: F(),
4490
+ expired: F()
4513
4491
  }),
4514
- created_at: H(),
4515
- expires_at: H(),
4516
- archived_at: H().nullish(),
4517
- cancel_initiated_at: H().nullish(),
4518
- ended_at: H().nullish(),
4519
- results_url: H().nullish()
4520
- }), on = G(() => r(an())), sn = G(() => r(k({
4521
- data: d(an()),
4522
- has_more: T(),
4523
- last_id: H().nullish()
4524
- }))), cn = /* @__PURE__ */ new Set([
4492
+ created_at: V(),
4493
+ expires_at: V(),
4494
+ archived_at: V().nullish(),
4495
+ cancel_initiated_at: V().nullish(),
4496
+ ended_at: V().nullish(),
4497
+ results_url: V().nullish()
4498
+ }), yn = W(() => r(vn())), bn = W(() => r(O({
4499
+ data: d(vn()),
4500
+ has_more: w(),
4501
+ last_id: V().nullish()
4502
+ }))), xn = /* @__PURE__ */ new Set([
4525
4503
  "advisor_tool_result",
4526
4504
  "bash_code_execution_tool_result",
4527
4505
  "code_execution_tool_result",
@@ -4539,44 +4517,44 @@ var nn = /^[A-Za-z0-9_-]{1,64}$/, rn = Oe.pick({ anthropicBeta: !0 }), an = () =
4539
4517
  "tool_use",
4540
4518
  "web_fetch_tool_result",
4541
4519
  "web_search_tool_result"
4542
- ]), ln = G(() => r(E("type", [
4543
- k({
4520
+ ]), Sn = W(() => r(T("type", [
4521
+ O({
4544
4522
  type: J("succeeded"),
4545
- message: P()
4523
+ message: N()
4546
4524
  }),
4547
- k({
4525
+ O({
4548
4526
  type: J("errored"),
4549
- error: k({
4527
+ error: O({
4550
4528
  type: J("error"),
4551
- error: k({
4552
- type: H(),
4553
- message: H()
4529
+ error: O({
4530
+ type: V(),
4531
+ message: V()
4554
4532
  }),
4555
- request_id: H().nullish()
4533
+ request_id: V().nullish()
4556
4534
  })
4557
4535
  }),
4558
- k({ type: J("canceled") }),
4559
- k({ type: J("expired") })
4560
- ]))), un = G(() => r(k({
4561
- custom_id: H(),
4562
- result: P()
4536
+ O({ type: J("canceled") }),
4537
+ O({ type: J("expired") })
4538
+ ]))), Cn = W(() => r(O({
4539
+ custom_id: V(),
4540
+ result: N()
4563
4541
  })));
4564
- function dn(e) {
4542
+ function wn(e) {
4565
4543
  for (let t of e) {
4566
4544
  let e = t.type;
4567
- if (e !== "text") throw new R({
4545
+ if (e !== "text") throw new L({
4568
4546
  functionality: `batch request type: ${e}`,
4569
4547
  message: `The Anthropic Message Batches API does not support batch requests with type "${e}".`
4570
4548
  });
4571
4549
  }
4572
4550
  }
4573
- var fn = class {
4551
+ var Tn = class {
4574
4552
  constructor(e) {
4575
4553
  this.options = e, this.specificationVersion = "v4", this.provider = e.provider, this.supportedUrls = e.supportedUrls, this.generateId = e.config.generateId ?? c;
4576
4554
  }
4577
4555
  async doStartBatch({ requests: e, providerOptions: t, headers: n, abortSignal: r, webhookUrl: i }) {
4578
- dn(e), mn(e);
4579
- let o = new Set(await pn({
4556
+ wn(e), Dn(e);
4557
+ let o = new Set(await En({
4580
4558
  provider: this.options.config.provider,
4581
4559
  providerOptions: t
4582
4560
  })), s = new Set(o), c = [], l = i == null ? [] : [{ warning: {
@@ -4585,14 +4563,14 @@ var fn = class {
4585
4563
  details: "The Anthropic Message Batches API does not support completion webhooks."
4586
4564
  } }];
4587
4565
  for (let t of e) {
4588
- if ((await pn({
4566
+ if ((await En({
4589
4567
  provider: this.options.config.provider,
4590
4568
  providerOptions: t.options.providerOptions
4591
- })).length > 0) throw new R({
4569
+ })).length > 0) throw new L({
4592
4570
  functionality: "per-request providerOptions.anthropic.anthropicBeta",
4593
4571
  message: `Anthropic Message Batches do not support per-request betas (request "${t.id}"). Set providerOptions.anthropic.anthropicBeta on startBatch instead.`
4594
4572
  });
4595
- let e = await Xt.prepareRequest({
4573
+ let e = await un.prepareRequest({
4596
4574
  modelId: t.modelId,
4597
4575
  config: this.options.config,
4598
4576
  options: {
@@ -4601,17 +4579,17 @@ var fn = class {
4601
4579
  userSuppliedBetas: new Set(o)
4602
4580
  }
4603
4581
  });
4604
- if (e.usesJsonResponseTool) throw new R({
4582
+ if (e.usesJsonResponseTool) throw new L({
4605
4583
  functionality: "batch responseFormat JSON-tool fallback",
4606
4584
  message: `Anthropic Message Batches cannot decode the JSON-tool structured-output fallback (request "${t.id}") because batch results are retrieved independently of the start call. Use a model that supports native output_format structured outputs.`
4607
4585
  });
4608
4586
  let n = t.options.tools?.find((t) => t.type === "provider" && e.toolNameMapping.toProviderToolName(t.name) !== t.name);
4609
- if (n != null) throw new R({
4587
+ if (n != null) throw new L({
4610
4588
  functionality: "aliased provider tool names in batches",
4611
4589
  message: `Anthropic Message Batches cannot restore the custom provider-tool name "${n.name}" when results are retrieved independently of the start call (request "${t.id}"). Use the provider's canonical tool name.`
4612
4590
  });
4613
4591
  let r = this.options.config.transformRequestBody?.(e.args, e.betas) ?? e.args;
4614
- hn({
4592
+ On({
4615
4593
  body: r,
4616
4594
  requestId: t.id
4617
4595
  }), c.push({
@@ -4624,7 +4602,7 @@ var fn = class {
4624
4602
  warning: n
4625
4603
  });
4626
4604
  }
4627
- let { value: u } = await j({
4605
+ let { value: u } = await ne({
4628
4606
  url: this.getBatchUrl(""),
4629
4607
  headers: await this.getStartBatchHeaders({
4630
4608
  betas: s,
@@ -4632,26 +4610,26 @@ var fn = class {
4632
4610
  }),
4633
4611
  body: { requests: c },
4634
4612
  failedResponseHandler: X,
4635
- successfulResponseHandler: a(on),
4613
+ successfulResponseHandler: a(yn),
4636
4614
  abortSignal: r,
4637
4615
  fetch: this.options.config.fetch
4638
4616
  });
4639
4617
  return {
4640
4618
  batchId: u.id,
4641
- ...gn(u),
4619
+ ...kn(u),
4642
4620
  warnings: l
4643
4621
  };
4644
4622
  }
4645
4623
  async doGetBatchStatus(e) {
4646
- return gn(await this.retrieveBatch(e));
4624
+ return kn(await this.retrieveBatch(e));
4647
4625
  }
4648
4626
  async doCancelBatch(e) {
4649
- return await j({
4627
+ return await ne({
4650
4628
  url: this.getBatchUrl(`/${encodeURIComponent(e.batchId)}/cancel`),
4651
4629
  headers: await this.getBatchHeaders(e.headers),
4652
4630
  body: {},
4653
4631
  failedResponseHandler: X,
4654
- successfulResponseHandler: a(on),
4632
+ successfulResponseHandler: a(yn),
4655
4633
  abortSignal: e.abortSignal,
4656
4634
  fetch: this.options.config.fetch
4657
4635
  }), {};
@@ -4664,25 +4642,25 @@ var fn = class {
4664
4642
  validateUrl: !1,
4665
4643
  headers: await this.getBatchHeaders(e.headers),
4666
4644
  failedResponseHandler: X,
4667
- successfulResponseHandler: a(sn),
4645
+ successfulResponseHandler: a(bn),
4668
4646
  abortSignal: e.abortSignal,
4669
4647
  fetch: this.options.config.fetch
4670
4648
  });
4671
4649
  return {
4672
4650
  batches: n.data.map((e) => ({
4673
4651
  batchId: e.id,
4674
- ...gn(e)
4652
+ ...kn(e)
4675
4653
  })),
4676
4654
  ...n.has_more && n.last_id != null ? { nextCursor: n.last_id } : {}
4677
4655
  };
4678
4656
  }
4679
4657
  async doGetBatchResults(e) {
4680
4658
  let t = await this.retrieveBatch(e);
4681
- if (gn(t).status === "pending") throw new A({
4659
+ if (kn(t).status === "pending") throw new k({
4682
4660
  argument: "batchId",
4683
4661
  message: `Anthropic batch "${e.batchId}" is not complete.`
4684
4662
  });
4685
- if (t.archived_at != null) throw new A({
4663
+ if (t.archived_at != null) throw new k({
4686
4664
  argument: "batchId",
4687
4665
  message: `Anthropic batch "${e.batchId}" results are no longer available.`
4688
4666
  });
@@ -4697,11 +4675,11 @@ var fn = class {
4697
4675
  trustedOrigin: this.options.config.baseURL,
4698
4676
  headers: await this.getBatchHeaders(e.headers),
4699
4677
  failedResponseHandler: X,
4700
- successfulResponseHandler: y(un),
4678
+ successfulResponseHandler: y(Cn),
4701
4679
  abortSignal: e.abortSignal,
4702
4680
  fetch: this.options.config.fetch
4703
4681
  });
4704
- return U(this.iterateBatchResults(n));
4682
+ return H(this.iterateBatchResults(n));
4705
4683
  }
4706
4684
  async retrieveBatch(e) {
4707
4685
  let { value: t } = await x({
@@ -4709,65 +4687,65 @@ var fn = class {
4709
4687
  validateUrl: !1,
4710
4688
  headers: await this.getBatchHeaders(e.headers),
4711
4689
  failedResponseHandler: X,
4712
- successfulResponseHandler: a(on),
4690
+ successfulResponseHandler: a(yn),
4713
4691
  abortSignal: e.abortSignal,
4714
4692
  fetch: this.options.config.fetch
4715
4693
  });
4716
4694
  return t;
4717
4695
  }
4718
4696
  async *iterateBatchResults(e) {
4719
- for await (let t of e) yield await yn(t, this.generateId);
4697
+ for await (let t of e) yield await Mn(t, this.generateId);
4720
4698
  }
4721
4699
  getBatchUrl(e) {
4722
4700
  return `${this.options.config.baseURL}/messages/batches${e}`;
4723
4701
  }
4724
4702
  async getStartBatchHeaders({ betas: e, headers: t }) {
4725
- return N(ie(await this.getBatchHeaders(t)), { "anthropic-beta": e.size > 0 ? Array.from(e).join(",") : void 0 });
4703
+ return M(ae(await this.getBatchHeaders(t)), { "anthropic-beta": e.size > 0 ? Array.from(e).join(",") : void 0 });
4726
4704
  }
4727
4705
  async getBatchHeaders(e) {
4728
- return N(this.options.config.headers ? await fe(this.options.config.headers) : void 0, e);
4706
+ return M(this.options.config.headers ? await fe(this.options.config.headers) : void 0, e);
4729
4707
  }
4730
4708
  };
4731
- async function pn({ provider: e, providerOptions: t }) {
4732
- let n = e.split(".")[0], r = await O({
4709
+ async function En({ provider: e, providerOptions: t }) {
4710
+ let n = e.split(".")[0], r = await D({
4733
4711
  provider: "anthropic",
4734
4712
  providerOptions: t,
4735
- schema: rn
4736
- }), i = n === "anthropic" ? void 0 : await O({
4713
+ schema: _n
4714
+ }), i = n === "anthropic" ? void 0 : await D({
4737
4715
  provider: n,
4738
4716
  providerOptions: t,
4739
- schema: rn
4717
+ schema: _n
4740
4718
  });
4741
4719
  return Object.assign({}, r ?? {}, i ?? {}).anthropicBeta ?? [];
4742
4720
  }
4743
- function mn(e) {
4721
+ function Dn(e) {
4744
4722
  let t = /* @__PURE__ */ new Set();
4745
4723
  for (let n of e) {
4746
- if (!nn.test(n.id)) throw new A({
4724
+ if (!gn.test(n.id)) throw new k({
4747
4725
  argument: "requests",
4748
4726
  message: `Anthropic batch request ID "${n.id}" must match ^[A-Za-z0-9_-]{1,64}$.`
4749
4727
  });
4750
- if (t.has(n.id)) throw new A({
4728
+ if (t.has(n.id)) throw new k({
4751
4729
  argument: "requests",
4752
4730
  message: `Anthropic batch request IDs must be unique; duplicate ID "${n.id}".`
4753
4731
  });
4754
4732
  t.add(n.id);
4755
4733
  }
4756
4734
  }
4757
- function hn({ body: e, requestId: t }) {
4758
- if (e.speed != null) throw new R({
4735
+ function On({ body: e, requestId: t }) {
4736
+ if (e.speed != null) throw new L({
4759
4737
  functionality: "providerOptions.anthropic.speed",
4760
4738
  message: `Anthropic Message Batches do not support speed (request "${t}").`
4761
4739
  });
4762
- if (Array.isArray(e.fallbacks) && e.fallbacks.some((e) => typeof e == "object" && !!e && "speed" in e && e.speed != null)) throw new R({
4740
+ if (Array.isArray(e.fallbacks) && e.fallbacks.some((e) => typeof e == "object" && !!e && "speed" in e && e.speed != null)) throw new L({
4763
4741
  functionality: "providerOptions.anthropic.fallbacks[].speed",
4764
4742
  message: `Anthropic Message Batches do not support fallback speed (request "${t}").`
4765
4743
  });
4766
4744
  }
4767
- function gn(e) {
4768
- let t = vn(e.request_counts);
4745
+ function kn(e) {
4746
+ let t = jn(e.request_counts);
4769
4747
  return {
4770
- status: _n(e.processing_status),
4748
+ status: An(e.processing_status),
4771
4749
  rawStatus: e.processing_status,
4772
4750
  ...t == null ? {} : { requestCounts: t },
4773
4751
  createdAt: e.created_at,
@@ -4781,26 +4759,26 @@ function gn(e) {
4781
4759
  } }
4782
4760
  };
4783
4761
  }
4784
- function _n(e) {
4762
+ function An(e) {
4785
4763
  switch (e) {
4786
4764
  case "ended": return "completed";
4787
4765
  default: return "pending";
4788
4766
  }
4789
4767
  }
4790
- function vn(e) {
4791
- return se({
4768
+ function jn(e) {
4769
+ return ce({
4792
4770
  total: e.processing + e.succeeded + e.errored + e.canceled + e.expired,
4793
4771
  pending: e.processing,
4794
4772
  completed: e.succeeded,
4795
4773
  failed: e.errored + e.canceled + e.expired
4796
4774
  });
4797
4775
  }
4798
- async function yn(e, t) {
4799
- let n = await V({
4776
+ async function Mn(e, t) {
4777
+ let n = await B({
4800
4778
  value: e.result,
4801
- schema: ln
4779
+ schema: Sn
4802
4780
  });
4803
- if (!n.success) return bn(e.custom_id);
4781
+ if (!n.success) return Nn(e.custom_id);
4804
4782
  let r = n.value;
4805
4783
  switch (r.type) {
4806
4784
  case "canceled": return {
@@ -4827,17 +4805,17 @@ async function yn(e, t) {
4827
4805
  };
4828
4806
  }
4829
4807
  case "succeeded": {
4830
- let n = await xn(r.message);
4831
- return n == null ? bn(e.custom_id) : {
4808
+ let n = await Pn(r.message);
4809
+ return n == null ? Nn(e.custom_id) : {
4832
4810
  type: "text",
4833
4811
  id: e.custom_id,
4834
4812
  status: "succeeded",
4835
- result: Sn(n, t)
4813
+ result: Fn(n, t)
4836
4814
  };
4837
4815
  }
4838
4816
  }
4839
4817
  }
4840
- function bn(e) {
4818
+ function Nn(e) {
4841
4819
  return {
4842
4820
  type: "text",
4843
4821
  id: e,
@@ -4848,37 +4826,37 @@ function bn(e) {
4848
4826
  }
4849
4827
  };
4850
4828
  }
4851
- async function xn(e) {
4852
- let t = await V({
4829
+ async function Pn(e) {
4830
+ let t = await B({
4853
4831
  value: e,
4854
- schema: Ce
4832
+ schema: we
4855
4833
  });
4856
4834
  if (t.success) return t.value;
4857
- if (!oe(e) || !Array.isArray(e.content)) return;
4835
+ if (!se(e) || !Array.isArray(e.content)) return;
4858
4836
  let n = [];
4859
4837
  for (let t of e.content) {
4860
- let r = await V({
4838
+ let r = await B({
4861
4839
  value: {
4862
4840
  ...e,
4863
4841
  content: [t]
4864
4842
  },
4865
- schema: Ce
4843
+ schema: we
4866
4844
  });
4867
4845
  if (r.success) {
4868
4846
  let [e] = r.value.content;
4869
4847
  e != null && n.push(e);
4870
- } else if (!oe(t) || typeof t.type != "string" || cn.has(t.type)) return;
4848
+ } else if (!se(t) || typeof t.type != "string" || xn.has(t.type)) return;
4871
4849
  }
4872
- let r = await V({
4850
+ let r = await B({
4873
4851
  value: {
4874
4852
  ...e,
4875
4853
  content: n
4876
4854
  },
4877
- schema: Ce
4855
+ schema: we
4878
4856
  });
4879
4857
  return r.success ? r.value : void 0;
4880
4858
  }
4881
- function Sn(e, t) {
4859
+ function Fn(e, t) {
4882
4860
  let n = [], r = {}, i = {};
4883
4861
  for (let a of e.content) switch (a.type) {
4884
4862
  case "text":
@@ -4889,7 +4867,7 @@ function Sn(e, t) {
4889
4867
  ...e != null && e.length > 0 && { providerMetadata: { anthropic: { citations: e } } }
4890
4868
  });
4891
4869
  for (let e of a.citations ?? []) {
4892
- let r = Gt(e, [], t);
4870
+ let r = an(e, [], t);
4893
4871
  r != null && n.push(r);
4894
4872
  }
4895
4873
  break;
@@ -4931,7 +4909,7 @@ function Sn(e, t) {
4931
4909
  toolCallId: a.id,
4932
4910
  toolName: a.name,
4933
4911
  input: JSON.stringify(a.input),
4934
- ...Cn(a.caller)
4912
+ ...In(a.caller)
4935
4913
  });
4936
4914
  break;
4937
4915
  case "server_tool_use": {
@@ -4949,7 +4927,7 @@ function Sn(e, t) {
4949
4927
  } : a.input),
4950
4928
  providerExecuted: !0,
4951
4929
  ...t ? { dynamic: !0 } : {},
4952
- ...Cn(a.caller)
4930
+ ...In(a.caller)
4953
4931
  });
4954
4932
  break;
4955
4933
  }
@@ -5008,7 +4986,7 @@ function Sn(e, t) {
5008
4986
  type: a.content.type,
5009
4987
  url: a.content.url
5010
4988
  } },
5011
- ...Cn(a.caller)
4989
+ ...In(a.caller)
5012
4990
  });
5013
4991
  break;
5014
4992
  case "web_search_tool_result":
@@ -5029,7 +5007,7 @@ function Sn(e, t) {
5029
5007
  type: a.content.type
5030
5008
  }
5031
5009
  },
5032
- ...Cn(a.caller)
5010
+ ...In(a.caller)
5033
5011
  }), Array.isArray(a.content)) for (let e of a.content) n.push({
5034
5012
  type: "source",
5035
5013
  sourceType: "url",
@@ -5081,61 +5059,58 @@ function Sn(e, t) {
5081
5059
  });
5082
5060
  break;
5083
5061
  }
5084
- case "advisor_tool_result":
5085
- a.content.type === "advisor_result" ? n.push({
5086
- type: "tool-result",
5087
- toolCallId: a.tool_use_id,
5088
- toolName: "advisor",
5089
- result: {
5090
- type: a.content.type,
5091
- text: a.content.text,
5092
- ...a.content.stop_reason == null ? {} : { stopReason: a.content.stop_reason }
5093
- }
5094
- }) : a.content.type === "advisor_redacted_result" ? n.push({
5095
- type: "tool-result",
5096
- toolCallId: a.tool_use_id,
5097
- toolName: "advisor",
5098
- result: {
5099
- type: a.content.type,
5100
- encryptedContent: a.content.encrypted_content,
5101
- ...a.content.stop_reason == null ? {} : { stopReason: a.content.stop_reason }
5102
- }
5103
- }) : n.push({
5104
- type: "tool-result",
5105
- toolCallId: a.tool_use_id,
5106
- toolName: "advisor",
5107
- isError: !0,
5108
- result: {
5109
- errorCode: a.content.error_code,
5110
- type: a.content.type
5111
- }
5112
- });
5113
- break;
5114
- case "fallback": break;
5062
+ case "advisor_tool_result": a.content.type === "advisor_result" ? n.push({
5063
+ type: "tool-result",
5064
+ toolCallId: a.tool_use_id,
5065
+ toolName: "advisor",
5066
+ result: {
5067
+ type: a.content.type,
5068
+ text: a.content.text,
5069
+ ...a.content.stop_reason == null ? {} : { stopReason: a.content.stop_reason }
5070
+ }
5071
+ }) : a.content.type === "advisor_redacted_result" ? n.push({
5072
+ type: "tool-result",
5073
+ toolCallId: a.tool_use_id,
5074
+ toolName: "advisor",
5075
+ result: {
5076
+ type: a.content.type,
5077
+ encryptedContent: a.content.encrypted_content,
5078
+ ...a.content.stop_reason == null ? {} : { stopReason: a.content.stop_reason }
5079
+ }
5080
+ }) : n.push({
5081
+ type: "tool-result",
5082
+ toolCallId: a.tool_use_id,
5083
+ toolName: "advisor",
5084
+ isError: !0,
5085
+ result: {
5086
+ errorCode: a.content.error_code,
5087
+ type: a.content.type
5088
+ }
5089
+ });
5115
5090
  }
5116
5091
  return {
5117
5092
  content: n,
5118
5093
  finishReason: {
5119
- unified: Ft({ finishReason: e.stop_reason }),
5094
+ unified: Jt({ finishReason: e.stop_reason }),
5120
5095
  raw: e.stop_reason ?? void 0
5121
5096
  },
5122
- usage: mt({ usage: e.usage }),
5097
+ usage: Ct({ usage: e.usage }),
5123
5098
  response: {
5124
5099
  id: e.id ?? void 0,
5125
5100
  modelId: e.model ?? void 0
5126
5101
  },
5127
5102
  warnings: [],
5128
- providerMetadata: { anthropic: wn(e) }
5103
+ providerMetadata: { anthropic: Ln(e) }
5129
5104
  };
5130
5105
  }
5131
- function Cn(e) {
5106
+ function In(e) {
5132
5107
  return e == null ? {} : { providerMetadata: { anthropic: { caller: {
5133
5108
  type: e.type,
5134
5109
  toolId: e.tool_id
5135
5110
  } } } };
5136
5111
  }
5137
- function wn(e) {
5138
- let t = En(e.stop_details);
5112
+ function Ln(e) {
5113
+ let t = zn(e.stop_details);
5139
5114
  return {
5140
5115
  usage: e.usage,
5141
5116
  stopSequence: e.stop_sequence ?? null,
@@ -5159,10 +5134,10 @@ function wn(e) {
5159
5134
  version: e.version
5160
5135
  })) ?? null
5161
5136
  } : null,
5162
- contextManagement: Tn(e.context_management)
5137
+ contextManagement: Rn(e.context_management)
5163
5138
  };
5164
5139
  }
5165
- function Tn(e) {
5140
+ function Rn(e) {
5166
5141
  return e ? { appliedEdits: e.applied_edits.map((e) => {
5167
5142
  switch (e.type) {
5168
5143
  case "clear_tool_uses_20250919": return {
@@ -5179,7 +5154,7 @@ function Tn(e) {
5179
5154
  }
5180
5155
  }) } : null;
5181
5156
  }
5182
- function En(e) {
5157
+ function zn(e) {
5183
5158
  if (e != null) return {
5184
5159
  type: e.type,
5185
5160
  ...e.category == null ? {} : { category: e.category },
@@ -5187,16 +5162,16 @@ function En(e) {
5187
5162
  ...e.recommended_model == null ? {} : { recommendedModel: e.recommended_model }
5188
5163
  };
5189
5164
  }
5190
- var Dn = B({
5165
+ var Bn = W(() => r(O({
5166
+ command: V(),
5167
+ restart: w().optional()
5168
+ }))), Vn = z({
5191
5169
  id: "anthropic.bash_20241022",
5192
- inputSchema: G(() => r(k({
5193
- command: H(),
5194
- restart: T().optional()
5195
- })))
5170
+ inputSchema: Bn
5196
5171
  });
5197
- function On(e = {}) {
5172
+ function Hn(e = {}) {
5198
5173
  let { execute: t, ...n } = e;
5199
- return Dn(t === void 0 ? {
5174
+ return Vn(t === void 0 ? {
5200
5175
  ...n,
5201
5176
  execute: async ({ command: e }, { abortSignal: t, experimental_sandbox: n }) => {
5202
5177
  if (!n) throw Error("Sandbox session is not available");
@@ -5210,16 +5185,16 @@ function On(e = {}) {
5210
5185
  ...t === null ? {} : { execute: t }
5211
5186
  });
5212
5187
  }
5213
- var kn = B({
5188
+ var Un = W(() => r(O({
5189
+ command: V(),
5190
+ restart: w().optional()
5191
+ }))), Wn = z({
5214
5192
  id: "anthropic.bash_20250124",
5215
- inputSchema: G(() => r(k({
5216
- command: H(),
5217
- restart: T().optional()
5218
- })))
5193
+ inputSchema: Un
5219
5194
  });
5220
- function An(e = {}) {
5195
+ function Gn(e = {}) {
5221
5196
  let { execute: t, ...n } = e;
5222
- return kn(t === void 0 ? {
5197
+ return Wn(t === void 0 ? {
5223
5198
  ...n,
5224
5199
  execute: async ({ command: e }, { abortSignal: t, experimental_sandbox: n }) => {
5225
5200
  if (!n) throw Error("Sandbox session is not available");
@@ -5233,242 +5208,242 @@ function An(e = {}) {
5233
5208
  ...t === null ? {} : { execute: t }
5234
5209
  });
5235
5210
  }
5236
- var jn = B({
5211
+ var Kn = W(() => r(O({
5212
+ action: C([
5213
+ "key",
5214
+ "type",
5215
+ "mouse_move",
5216
+ "left_click",
5217
+ "left_click_drag",
5218
+ "right_click",
5219
+ "middle_click",
5220
+ "double_click",
5221
+ "screenshot",
5222
+ "cursor_position"
5223
+ ]),
5224
+ coordinate: d(F().int()).optional(),
5225
+ text: V().optional()
5226
+ }))), qn = z({
5237
5227
  id: "anthropic.computer_20241022",
5238
- inputSchema: G(() => r(k({
5239
- action: C([
5240
- "key",
5241
- "type",
5242
- "mouse_move",
5243
- "left_click",
5244
- "left_click_drag",
5245
- "right_click",
5246
- "middle_click",
5247
- "double_click",
5248
- "screenshot",
5249
- "cursor_position"
5250
- ]),
5251
- coordinate: d(I().int()).optional(),
5252
- text: H().optional()
5253
- })))
5254
- }), Mn = B({
5228
+ inputSchema: Kn
5229
+ }), Jn = W(() => r(O({
5230
+ action: C([
5231
+ "key",
5232
+ "hold_key",
5233
+ "type",
5234
+ "cursor_position",
5235
+ "mouse_move",
5236
+ "left_mouse_down",
5237
+ "left_mouse_up",
5238
+ "left_click",
5239
+ "left_click_drag",
5240
+ "right_click",
5241
+ "middle_click",
5242
+ "double_click",
5243
+ "triple_click",
5244
+ "scroll",
5245
+ "wait",
5246
+ "screenshot"
5247
+ ]),
5248
+ coordinate: Y([F().int(), F().int()]).optional(),
5249
+ duration: F().optional(),
5250
+ scroll_amount: F().optional(),
5251
+ scroll_direction: C([
5252
+ "up",
5253
+ "down",
5254
+ "left",
5255
+ "right"
5256
+ ]).optional(),
5257
+ start_coordinate: Y([F().int(), F().int()]).optional(),
5258
+ text: V().optional()
5259
+ }))), Yn = z({
5255
5260
  id: "anthropic.computer_20250124",
5256
- inputSchema: G(() => r(k({
5257
- action: C([
5258
- "key",
5259
- "hold_key",
5260
- "type",
5261
- "cursor_position",
5262
- "mouse_move",
5263
- "left_mouse_down",
5264
- "left_mouse_up",
5265
- "left_click",
5266
- "left_click_drag",
5267
- "right_click",
5268
- "middle_click",
5269
- "double_click",
5270
- "triple_click",
5271
- "scroll",
5272
- "wait",
5273
- "screenshot"
5274
- ]),
5275
- coordinate: Y([I().int(), I().int()]).optional(),
5276
- duration: I().optional(),
5277
- scroll_amount: I().optional(),
5278
- scroll_direction: C([
5279
- "up",
5280
- "down",
5281
- "left",
5282
- "right"
5283
- ]).optional(),
5284
- start_coordinate: Y([I().int(), I().int()]).optional(),
5285
- text: H().optional()
5286
- })))
5287
- }), Nn = B({
5261
+ inputSchema: Jn
5262
+ }), Xn = W(() => r(O({
5263
+ action: C([
5264
+ "key",
5265
+ "hold_key",
5266
+ "type",
5267
+ "cursor_position",
5268
+ "mouse_move",
5269
+ "left_mouse_down",
5270
+ "left_mouse_up",
5271
+ "left_click",
5272
+ "left_click_drag",
5273
+ "right_click",
5274
+ "middle_click",
5275
+ "double_click",
5276
+ "triple_click",
5277
+ "scroll",
5278
+ "wait",
5279
+ "screenshot",
5280
+ "zoom"
5281
+ ]),
5282
+ coordinate: Y([F().int(), F().int()]).optional(),
5283
+ duration: F().optional(),
5284
+ region: Y([
5285
+ F().int(),
5286
+ F().int(),
5287
+ F().int(),
5288
+ F().int()
5289
+ ]).optional(),
5290
+ scroll_amount: F().optional(),
5291
+ scroll_direction: C([
5292
+ "up",
5293
+ "down",
5294
+ "left",
5295
+ "right"
5296
+ ]).optional(),
5297
+ start_coordinate: Y([F().int(), F().int()]).optional(),
5298
+ text: V().optional()
5299
+ }))), Zn = z({
5288
5300
  id: "anthropic.computer_20251124",
5289
- inputSchema: G(() => r(k({
5290
- action: C([
5291
- "key",
5292
- "hold_key",
5293
- "type",
5294
- "cursor_position",
5295
- "mouse_move",
5296
- "left_mouse_down",
5297
- "left_mouse_up",
5298
- "left_click",
5299
- "left_click_drag",
5300
- "right_click",
5301
- "middle_click",
5302
- "double_click",
5303
- "triple_click",
5304
- "scroll",
5305
- "wait",
5306
- "screenshot",
5307
- "zoom"
5308
- ]),
5309
- coordinate: Y([I().int(), I().int()]).optional(),
5310
- duration: I().optional(),
5311
- region: Y([
5312
- I().int(),
5313
- I().int(),
5314
- I().int(),
5315
- I().int()
5316
- ]).optional(),
5317
- scroll_amount: I().optional(),
5318
- scroll_direction: C([
5319
- "up",
5320
- "down",
5321
- "left",
5322
- "right"
5323
- ]).optional(),
5324
- start_coordinate: Y([I().int(), I().int()]).optional(),
5325
- text: H().optional()
5326
- })))
5327
- }), Pn = B({
5301
+ inputSchema: Xn
5302
+ }), Qn = W(() => r(T("command", [
5303
+ O({
5304
+ command: J("view"),
5305
+ path: V(),
5306
+ view_range: Y([F(), F()]).optional()
5307
+ }),
5308
+ O({
5309
+ command: J("create"),
5310
+ path: V(),
5311
+ file_text: V()
5312
+ }),
5313
+ O({
5314
+ command: J("str_replace"),
5315
+ path: V(),
5316
+ old_str: V(),
5317
+ new_str: V()
5318
+ }),
5319
+ O({
5320
+ command: J("insert"),
5321
+ path: V(),
5322
+ insert_line: F(),
5323
+ insert_text: V()
5324
+ }),
5325
+ O({
5326
+ command: J("delete"),
5327
+ path: V()
5328
+ }),
5329
+ O({
5330
+ command: J("rename"),
5331
+ old_path: V(),
5332
+ new_path: V()
5333
+ })
5334
+ ]))), $n = z({
5328
5335
  id: "anthropic.memory_20250818",
5329
- inputSchema: G(() => r(E("command", [
5330
- k({
5331
- command: J("view"),
5332
- path: H(),
5333
- view_range: Y([I(), I()]).optional()
5334
- }),
5335
- k({
5336
- command: J("create"),
5337
- path: H(),
5338
- file_text: H()
5339
- }),
5340
- k({
5341
- command: J("str_replace"),
5342
- path: H(),
5343
- old_str: H(),
5344
- new_str: H()
5345
- }),
5346
- k({
5347
- command: J("insert"),
5348
- path: H(),
5349
- insert_line: I(),
5350
- insert_text: H()
5351
- }),
5352
- k({
5353
- command: J("delete"),
5354
- path: H()
5355
- }),
5356
- k({
5357
- command: J("rename"),
5358
- old_path: H(),
5359
- new_path: H()
5360
- })
5361
- ])))
5362
- }), Fn = B({
5336
+ inputSchema: Qn
5337
+ }), er = W(() => r(O({
5338
+ command: C([
5339
+ "view",
5340
+ "create",
5341
+ "str_replace",
5342
+ "insert",
5343
+ "undo_edit"
5344
+ ]),
5345
+ path: V(),
5346
+ file_text: V().optional(),
5347
+ insert_line: F().int().optional(),
5348
+ new_str: V().optional(),
5349
+ insert_text: V().optional(),
5350
+ old_str: V().optional(),
5351
+ view_range: d(F().int()).optional()
5352
+ }))), tr = z({
5363
5353
  id: "anthropic.text_editor_20241022",
5364
- inputSchema: G(() => r(k({
5365
- command: C([
5366
- "view",
5367
- "create",
5368
- "str_replace",
5369
- "insert",
5370
- "undo_edit"
5371
- ]),
5372
- path: H(),
5373
- file_text: H().optional(),
5374
- insert_line: I().int().optional(),
5375
- new_str: H().optional(),
5376
- insert_text: H().optional(),
5377
- old_str: H().optional(),
5378
- view_range: d(I().int()).optional()
5379
- })))
5380
- }), In = B({
5354
+ inputSchema: er
5355
+ }), nr = W(() => r(O({
5356
+ command: C([
5357
+ "view",
5358
+ "create",
5359
+ "str_replace",
5360
+ "insert",
5361
+ "undo_edit"
5362
+ ]),
5363
+ path: V(),
5364
+ file_text: V().optional(),
5365
+ insert_line: F().int().optional(),
5366
+ new_str: V().optional(),
5367
+ insert_text: V().optional(),
5368
+ old_str: V().optional(),
5369
+ view_range: d(F().int()).optional()
5370
+ }))), rr = z({
5381
5371
  id: "anthropic.text_editor_20250124",
5382
- inputSchema: G(() => r(k({
5383
- command: C([
5384
- "view",
5385
- "create",
5386
- "str_replace",
5387
- "insert",
5388
- "undo_edit"
5389
- ]),
5390
- path: H(),
5391
- file_text: H().optional(),
5392
- insert_line: I().int().optional(),
5393
- new_str: H().optional(),
5394
- insert_text: H().optional(),
5395
- old_str: H().optional(),
5396
- view_range: d(I().int()).optional()
5397
- })))
5398
- }), Ln = B({
5372
+ inputSchema: nr
5373
+ }), ir = W(() => r(O({
5374
+ command: C([
5375
+ "view",
5376
+ "create",
5377
+ "str_replace",
5378
+ "insert"
5379
+ ]),
5380
+ path: V(),
5381
+ file_text: V().optional(),
5382
+ insert_line: F().int().optional(),
5383
+ new_str: V().optional(),
5384
+ insert_text: V().optional(),
5385
+ old_str: V().optional(),
5386
+ view_range: d(F().int()).optional()
5387
+ }))), ar = z({
5399
5388
  id: "anthropic.text_editor_20250429",
5400
- inputSchema: G(() => r(k({
5401
- command: C([
5402
- "view",
5403
- "create",
5404
- "str_replace",
5405
- "insert"
5406
- ]),
5407
- path: H(),
5408
- file_text: H().optional(),
5409
- insert_line: I().int().optional(),
5410
- new_str: H().optional(),
5411
- insert_text: H().optional(),
5412
- old_str: H().optional(),
5413
- view_range: d(I().int()).optional()
5414
- })))
5415
- }), Rn = G(() => r(d(k({
5389
+ inputSchema: ir
5390
+ }), or = W(() => r(d(O({
5416
5391
  type: J("tool_reference"),
5417
- toolName: H()
5418
- })))), zn = L({
5392
+ toolName: V()
5393
+ })))), sr = W(() => r(O({
5394
+ query: V(),
5395
+ limit: F().optional()
5396
+ }))), cr = I({
5419
5397
  id: "anthropic.tool_search_bm25_20251119",
5420
- inputSchema: G(() => r(k({
5421
- query: H(),
5422
- limit: I().optional()
5423
- }))),
5424
- outputSchema: Rn,
5398
+ inputSchema: sr,
5399
+ outputSchema: or,
5425
5400
  supportsDeferredResults: !0
5426
- }), Bn = {
5427
- advisor_20260301: Fe,
5428
- bash_20241022: On,
5429
- bash_20250124: An,
5430
- codeExecution_20250522: _t,
5431
- codeExecution_20250825: bt,
5432
- codeExecution_20260120: Ct,
5433
- computer_20241022: jn,
5434
- computer_20250124: Mn,
5435
- computer_20251124: Nn,
5436
- computerToolset_20260801: ze,
5437
- memory_20250818: Pn,
5438
- textEditor_20241022: Fn,
5439
- textEditor_20250124: In,
5440
- textEditor_20250429: Ln,
5441
- textEditor_20250728: He,
5442
- webFetch_20250910: ft,
5443
- webFetch_20260209: ct,
5444
- webFetch_20260318: it,
5445
- webSearch_20250305: et,
5446
- webSearch_20260209: Xe,
5447
- webSearch_20260318: Ke,
5448
- toolSearchRegex_20251119: Et,
5449
- toolSearchBm25_20251119: (e = {}) => zn(e)
5450
- }, Vn = G(() => r(k({
5451
- id: H(),
5452
- display_title: H().nullish(),
5453
- name: H().nullish(),
5454
- description: H().nullish(),
5455
- latest_version: H().nullish(),
5456
- source: H(),
5457
- created_at: H(),
5458
- updated_at: H()
5401
+ }), lr = {
5402
+ advisor_20260301: Le,
5403
+ bash_20241022: Hn,
5404
+ bash_20250124: Gn,
5405
+ codeExecution_20250522: Dt,
5406
+ codeExecution_20250825: jt,
5407
+ codeExecution_20260120: Ft,
5408
+ computer_20241022: qn,
5409
+ computer_20250124: Yn,
5410
+ computer_20251124: Zn,
5411
+ computerToolset_20260801: Ve,
5412
+ memory_20250818: $n,
5413
+ textEditor_20241022: tr,
5414
+ textEditor_20250124: rr,
5415
+ textEditor_20250429: ar,
5416
+ textEditor_20250728: Ge,
5417
+ webFetch_20250910: xt,
5418
+ webFetch_20260209: gt,
5419
+ webFetch_20260318: dt,
5420
+ webSearch_20250305: ot,
5421
+ webSearch_20260209: tt,
5422
+ webSearch_20260318: Xe,
5423
+ toolSearchRegex_20251119: zt,
5424
+ toolSearchBm25_20251119: (e = {}) => cr(e)
5425
+ }, ur = W(() => r(O({
5426
+ id: V(),
5427
+ display_title: V().nullish(),
5428
+ name: V().nullish(),
5429
+ description: V().nullish(),
5430
+ latest_version: V().nullish(),
5431
+ source: V(),
5432
+ created_at: V(),
5433
+ updated_at: V()
5459
5434
  })));
5460
- G(() => r(k({ data: d(k({ version: H() })) })));
5461
- var Hn = G(() => r(k({
5462
- type: H(),
5463
- skill_id: H(),
5464
- name: H().nullish(),
5465
- description: H().nullish()
5435
+ W(() => r(O({ data: d(O({ version: V() })) })));
5436
+ var dr = W(() => r(O({
5437
+ type: V(),
5438
+ skill_id: V(),
5439
+ name: V().nullish(),
5440
+ description: V().nullish()
5466
5441
  })));
5467
- function Un(e) {
5442
+ function fr(e) {
5468
5443
  let t = encodeURIComponent(e);
5469
5444
  return t === "." ? "%252E" : t === ".." ? "%252E%252E" : t;
5470
5445
  }
5471
- var Wn = class {
5446
+ var pr = class {
5472
5447
  constructor(e) {
5473
5448
  this.config = e, this.specificationVersion = "v4";
5474
5449
  }
@@ -5476,15 +5451,15 @@ var Wn = class {
5476
5451
  return this.config.provider;
5477
5452
  }
5478
5453
  async getHeaders() {
5479
- return N(await fe(this.config.headers), { "anthropic-beta": "skills-2025-10-02" });
5454
+ return M(await fe(this.config.headers), { "anthropic-beta": "skills-2025-10-02" });
5480
5455
  }
5481
5456
  async fetchVersionMetadata({ skillId: e, version: t, headers: n }) {
5482
5457
  let { value: r } = await x({
5483
- url: `${this.config.baseURL}/skills/${Un(e)}/versions/${Un(t)}`,
5458
+ url: `${this.config.baseURL}/skills/${fr(e)}/versions/${fr(t)}`,
5484
5459
  validateUrl: !1,
5485
5460
  headers: n,
5486
5461
  failedResponseHandler: X,
5487
- successfulResponseHandler: a(Hn),
5462
+ successfulResponseHandler: a(dr),
5488
5463
  fetch: this.config.fetch
5489
5464
  });
5490
5465
  return {
@@ -5496,7 +5471,7 @@ var Wn = class {
5496
5471
  let t = [], n = new FormData();
5497
5472
  e.displayTitle != null && n.append("display_title", e.displayTitle);
5498
5473
  for (let t of e.files) {
5499
- let e = F(t.data);
5474
+ let e = P(t.data);
5500
5475
  n.append("files[]", new Blob([e]), t.path);
5501
5476
  }
5502
5477
  let r = await this.getHeaders(), { value: i } = await pe({
@@ -5504,7 +5479,7 @@ var Wn = class {
5504
5479
  headers: r,
5505
5480
  formData: n,
5506
5481
  failedResponseHandler: X,
5507
- successfulResponseHandler: a(Vn),
5482
+ successfulResponseHandler: a(ur),
5508
5483
  fetch: this.config.fetch
5509
5484
  }), o = i.latest_version == null ? {} : await this.fetchVersionMetadata({
5510
5485
  skillId: i.id,
@@ -5525,20 +5500,20 @@ var Wn = class {
5525
5500
  warnings: t
5526
5501
  };
5527
5502
  }
5528
- }, Gn = "4.0.68", Kn = "https://api.anthropic.com", qn = `${Kn}/v1`;
5529
- function Jn(e) {
5503
+ }, mr = "4.0.68", hr = "https://api.anthropic.com", gr = `${hr}/v1`;
5504
+ function _r(e) {
5530
5505
  let t = me(s(e));
5531
- return t === Kn ? qn : t;
5506
+ return t === hr ? gr : t;
5532
5507
  }
5533
- function Yn(e = {}) {
5534
- let t = Jn(te({
5508
+ function vr(e = {}) {
5509
+ let t = _r(re({
5535
5510
  settingValue: e.baseURL,
5536
5511
  environmentVariableName: "ANTHROPIC_BASE_URL"
5537
- })) ?? qn, n = e.name ?? "anthropic.messages", r = {
5512
+ })) ?? gr, n = e.name ?? "anthropic.messages", r = {
5538
5513
  "image/*": [/^https?:\/\/.*$/],
5539
5514
  "application/pdf": [/^https?:\/\/.*$/]
5540
5515
  };
5541
- if (e.apiKey && e.authToken) throw new A({
5516
+ if (e.apiKey && e.authToken) throw new k({
5542
5517
  argument: "apiKey/authToken",
5543
5518
  message: "Both apiKey and authToken were provided. Please use only one authentication method."
5544
5519
  });
@@ -5552,7 +5527,7 @@ function Yn(e = {}) {
5552
5527
  "anthropic-version": "2023-06-01",
5553
5528
  ...t,
5554
5529
  ...e.headers
5555
- }, `ai-sdk-anthropic/${Gn}`);
5530
+ }, `ai-sdk-anthropic/${mr}`);
5556
5531
  }, o = {
5557
5532
  provider: n,
5558
5533
  baseURL: t,
@@ -5560,11 +5535,11 @@ function Yn(e = {}) {
5560
5535
  fetch: e.fetch,
5561
5536
  generateId: e.generateId ?? c,
5562
5537
  supportedUrls: () => r
5563
- }, s = (e) => new Xt(e, o), l = () => new fn({
5538
+ }, s = (e) => new un(e, o), l = () => new Tn({
5564
5539
  provider: `${n.replace(/\.messages$/, "")}.batch`,
5565
5540
  config: o,
5566
5541
  supportedUrls: r
5567
- }), u = () => new Wn({
5542
+ }), u = () => new pr({
5568
5543
  provider: `${n.replace(".messages", "")}.skills`,
5569
5544
  baseURL: t,
5570
5545
  headers: a,
@@ -5586,13 +5561,12 @@ function Yn(e = {}) {
5586
5561
  modelId: e,
5587
5562
  modelType: "imageModel"
5588
5563
  });
5589
- }, d.files = () => new _e({
5564
+ }, d.files = () => new ve({
5590
5565
  provider: n,
5591
5566
  baseURL: t,
5592
5567
  headers: a,
5593
5568
  fetch: e.fetch
5594
- }), d.skills = u, d.tools = Bn, d;
5569
+ }), d.skills = u, d.tools = lr, d;
5595
5570
  }
5596
- Yn();
5597
- //#endregion
5598
- export { Yn as createAnthropic };
5571
+ vr();
5572
+ export { vr as createAnthropic };