@roomle/embedding-lib 0.0.0-dev-20f436f → 0.0.0-dev-d66646c
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.
- package/THIRD-PARTY-NOTICES.txt +2 -2
- package/ai.js +8 -8
- package/ai.min.js +7 -6
- package/{browser-D6M-d6y5.mjs → browser-Cys-y5Hy.mjs} +1 -2
- package/chat-model-DooKwd8I.mjs +117 -0
- package/chat-model-KHuz1Ej9.mjs +118 -0
- package/coerce-CuLRCRlo.mjs +6 -0
- package/coerce-Dup0o-HR.mjs +7 -0
- package/{comlink-CG3f9q6z.mjs → comlink-7u13Z2ZH.mjs} +2 -3
- package/{comlink-hSUzCx9j.mjs → comlink-DKhvPU0o.mjs} +1 -1
- package/configurator.js +3 -4
- package/configurator.min.js +2 -2
- package/construction.js +387 -31
- package/construction.min.js +395 -36
- package/continuation-COcMrXyj.mjs +14 -0
- package/continuation-D2hsmYf1.mjs +13 -0
- package/{dist-Cm3aF4sf.mjs → dist-7-X7Xqsl.mjs} +851 -919
- package/{dist-BQaw78-_.mjs → dist-BMxyw-Zs.mjs} +411 -405
- package/{dist-0WZWTj8T.mjs → dist-BU022PnG.mjs} +4 -9
- package/{dist-DkR6G9Kj.mjs → dist-BY8OLJ2p.mjs} +1 -1
- package/{dist-6TznX-Ae.mjs → dist-BZSd56sr.mjs} +3850 -3942
- package/{dist-70R0b5Mq.mjs → dist-Ba3J8AjB.mjs} +400 -390
- package/{dist-CTS0DDwt.mjs → dist-CbQKC1xX.mjs} +1590 -1616
- package/{dist-BmOBP9h9.mjs → dist-CiybWJvs.mjs} +44 -41
- package/{dist-CPG4atmb.mjs → dist-CkZuNdCU.mjs} +6 -4
- package/{dist-Bt1FopV4.mjs → dist-D2ZAAHGn.mjs} +1058 -1042
- package/{dist-BWNv7qW9.mjs → dist-DjsS42rR.mjs} +916 -962
- package/{dist-9UI7dzwc.mjs → dist-Jcq_kKKT.mjs} +403 -393
- package/{dist-D0XFfKEL.mjs → dist-S9sLSjZ4.mjs} +3112 -3104
- package/{dist-BV-32IEX.mjs → dist-XECXrV5Q.mjs} +1497 -1558
- package/{dist-Bc2s-kJZ.mjs → dist-a5_BIeaS.mjs} +45 -51
- package/{dist-Crrp-Bno.mjs → dist-bQAJDeYc.mjs} +698 -748
- package/{drag-ghost-BpIDzSdK.mjs → drag-ghost-QZelgA-_.mjs} +2 -3
- package/{drag-ghost-Bhb0_67G.mjs → drag-ghost-VmgSWLva.mjs} +5 -7
- package/{drag-in-mE_ozj_Q.mjs → drag-in-Cd_67tzS.mjs} +4 -5
- package/{drag-in-CGBG4wEk.mjs → drag-in-DlDsgY4T.mjs} +3 -3
- package/embedding-plugins.js +1 -2
- package/embedding-plugins.min.js +1 -2
- package/{experimental-evaluation-FzKFGoye.mjs → experimental-evaluation-B4hKMgFH.mjs} +19 -38
- package/{experimental-evaluation-DczxmJme.mjs → experimental-evaluation-DmqghFSx.mjs} +1 -1
- package/{from-custom-view-B3fIWMox.mjs → from-custom-view-6HMD_sPe.mjs} +5 -4
- package/{from-custom-view-B3HCOhdT.mjs → from-custom-view-BRFynafo.mjs} +16 -16
- package/{from-website-DaTahmvJ.mjs → from-website-Dl1VN4h7.mjs} +5 -6
- package/{from-website-DUQ9USj1.mjs → from-website-iZzauH4C.mjs} +3 -3
- package/hi.js +228 -233
- package/hi.min.js +207 -204
- package/mcp-tools-C6O2gQZW.mjs +41 -0
- package/mcp-tools-m_3IX0vB.mjs +40 -0
- package/package.json +1 -1
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +0 -6
- package/packages/web-sdk/packages/assistant.d.ts +3 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-recovery.d.ts +5 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/continuation.d.ts +5 -3
- package/packages/web-sdk/packages/common-core/src/planning-assistant/runtime.d.ts +4 -1
- package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +2 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/usage.d.ts +16 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant.d.ts +19 -1
- package/rolldown-runtime--db92txo.mjs +10 -0
- package/rolldown-runtime-CyjYJMBa.mjs +11 -0
- package/roomle-embedding-lib.js +25 -34
- package/roomle-embedding-lib.min.js +3 -3
- package/sbom.cdx.json +5 -5
- package/usage-CgXarvBY.mjs +16 -0
- package/usage-c8evaONq.mjs +17 -0
- package/{utils-BwWn6Fw4.mjs → utils-CJnKZceY.mjs} +3 -4
- package/{utils-BoELtcEK.mjs → utils-DdNhTbJr.mjs} +6 -6
- package/chat-model-C1ov616e.mjs +0 -377
- package/chat-model-CifTV-8H.mjs +0 -373
- package/coerce-CqJod_GZ.mjs +0 -8
- package/coerce-CsI42_k0.mjs +0 -6
- package/mcp-tools-CC8DTfZA.mjs +0 -2
- package/mcp-tools-CfJ_ue_2.mjs +0 -2
- /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
|
|
3
|
-
import { t as he } from "./experimental-evaluation-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
}),
|
|
15
|
-
id:
|
|
14
|
+
}), _e = W(() => r(O({
|
|
15
|
+
id: V(),
|
|
16
16
|
type: J("file"),
|
|
17
|
-
filename:
|
|
18
|
-
mime_type:
|
|
19
|
-
size_bytes:
|
|
20
|
-
created_at:
|
|
21
|
-
downloadable:
|
|
22
|
-
}))),
|
|
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 =
|
|
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:
|
|
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(
|
|
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
|
-
},
|
|
56
|
-
type:
|
|
57
|
-
category:
|
|
58
|
-
explanation:
|
|
59
|
-
recommended_model:
|
|
60
|
-
}),
|
|
61
|
-
type:
|
|
62
|
-
status:
|
|
63
|
-
type:
|
|
64
|
-
tool_uses: K(
|
|
65
|
-
type:
|
|
66
|
-
outcome:
|
|
67
|
-
explanation:
|
|
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 =
|
|
71
|
-
|
|
70
|
+
}), Z = A([
|
|
71
|
+
O({
|
|
72
72
|
type: J("code_execution_20250825"),
|
|
73
|
-
tool_id:
|
|
73
|
+
tool_id: V()
|
|
74
74
|
}),
|
|
75
|
-
|
|
75
|
+
O({
|
|
76
76
|
type: J("code_execution_20260120"),
|
|
77
|
-
tool_id:
|
|
77
|
+
tool_id: V()
|
|
78
78
|
}),
|
|
79
|
-
|
|
80
|
-
]),
|
|
81
|
-
|
|
79
|
+
O({ type: J("direct") })
|
|
80
|
+
]), xe = T("type", [
|
|
81
|
+
O({
|
|
82
82
|
type: J("web_search_result_location"),
|
|
83
|
-
cited_text:
|
|
84
|
-
url:
|
|
85
|
-
title:
|
|
86
|
-
encrypted_index:
|
|
83
|
+
cited_text: V(),
|
|
84
|
+
url: V(),
|
|
85
|
+
title: V().nullable(),
|
|
86
|
+
encrypted_index: V()
|
|
87
87
|
}),
|
|
88
|
-
|
|
88
|
+
O({
|
|
89
89
|
type: J("page_location"),
|
|
90
|
-
cited_text:
|
|
91
|
-
document_index:
|
|
92
|
-
document_title:
|
|
93
|
-
start_page_number:
|
|
94
|
-
end_page_number:
|
|
95
|
-
file_id:
|
|
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
|
-
|
|
97
|
+
O({
|
|
98
98
|
type: J("char_location"),
|
|
99
|
-
cited_text:
|
|
100
|
-
document_index:
|
|
101
|
-
document_title:
|
|
102
|
-
start_char_index:
|
|
103
|
-
end_char_index:
|
|
104
|
-
file_id:
|
|
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
|
-
|
|
106
|
+
O({
|
|
107
107
|
type: J("content_block_location"),
|
|
108
|
-
cited_text:
|
|
109
|
-
document_index:
|
|
110
|
-
document_title:
|
|
111
|
-
start_block_index:
|
|
112
|
-
end_block_index:
|
|
113
|
-
file_id:
|
|
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
|
-
|
|
115
|
+
O({
|
|
116
116
|
type: J("search_result_location"),
|
|
117
|
-
cited_text:
|
|
118
|
-
search_result_index:
|
|
119
|
-
source:
|
|
120
|
-
title:
|
|
121
|
-
start_block_index:
|
|
122
|
-
end_block_index:
|
|
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
|
-
]),
|
|
124
|
+
]), Se = A([V(), d(A([V(), O({
|
|
125
125
|
type: J("text"),
|
|
126
|
-
text:
|
|
126
|
+
text: V(),
|
|
127
127
|
citations: d(t()).nullable().optional()
|
|
128
|
-
})]))]),
|
|
129
|
-
type:
|
|
130
|
-
path:
|
|
131
|
-
reason:
|
|
132
|
-
}),
|
|
128
|
+
})]))]), Ce = O({
|
|
129
|
+
type: V(),
|
|
130
|
+
path: V(),
|
|
131
|
+
reason: V()
|
|
132
|
+
}), we = W(() => r(O({
|
|
133
133
|
type: J("message"),
|
|
134
|
-
id:
|
|
135
|
-
model:
|
|
136
|
-
content: d(
|
|
137
|
-
|
|
134
|
+
id: V().nullish(),
|
|
135
|
+
model: V().nullish(),
|
|
136
|
+
content: d(T("type", [
|
|
137
|
+
O({
|
|
138
138
|
type: J("text"),
|
|
139
|
-
text:
|
|
140
|
-
citations: d(
|
|
139
|
+
text: V(),
|
|
140
|
+
citations: d(xe).nullable().optional()
|
|
141
141
|
}),
|
|
142
|
-
|
|
142
|
+
O({
|
|
143
143
|
type: J("thinking"),
|
|
144
|
-
thinking:
|
|
145
|
-
signature:
|
|
144
|
+
thinking: V(),
|
|
145
|
+
signature: V()
|
|
146
146
|
}),
|
|
147
|
-
|
|
147
|
+
O({
|
|
148
148
|
type: J("redacted_thinking"),
|
|
149
|
-
data:
|
|
149
|
+
data: V()
|
|
150
150
|
}),
|
|
151
|
-
|
|
151
|
+
O({
|
|
152
152
|
type: J("compaction"),
|
|
153
|
-
content:
|
|
154
|
-
signature:
|
|
153
|
+
content: V().nullish(),
|
|
154
|
+
signature: V().nullish()
|
|
155
155
|
}),
|
|
156
|
-
|
|
156
|
+
O({
|
|
157
157
|
type: J("tool_use"),
|
|
158
|
-
id:
|
|
159
|
-
name:
|
|
160
|
-
input:
|
|
158
|
+
id: V(),
|
|
159
|
+
name: V(),
|
|
160
|
+
input: N(),
|
|
161
161
|
caller: Z.optional(),
|
|
162
|
-
toolset_name:
|
|
162
|
+
toolset_name: V().nullish()
|
|
163
163
|
}),
|
|
164
|
-
|
|
164
|
+
O({
|
|
165
165
|
type: J("server_tool_use"),
|
|
166
|
-
id:
|
|
167
|
-
name:
|
|
168
|
-
input: K(
|
|
166
|
+
id: V(),
|
|
167
|
+
name: V(),
|
|
168
|
+
input: K(V(), N()).nullish(),
|
|
169
169
|
caller: Z.optional()
|
|
170
170
|
}),
|
|
171
|
-
|
|
171
|
+
O({
|
|
172
172
|
type: J("mcp_tool_use"),
|
|
173
|
-
id:
|
|
174
|
-
name:
|
|
175
|
-
input:
|
|
176
|
-
server_name:
|
|
173
|
+
id: V(),
|
|
174
|
+
name: V(),
|
|
175
|
+
input: N(),
|
|
176
|
+
server_name: V()
|
|
177
177
|
}),
|
|
178
|
-
|
|
178
|
+
O({
|
|
179
179
|
type: J("mcp_tool_result"),
|
|
180
|
-
tool_use_id:
|
|
181
|
-
is_error:
|
|
182
|
-
content:
|
|
180
|
+
tool_use_id: V(),
|
|
181
|
+
is_error: w(),
|
|
182
|
+
content: Se
|
|
183
183
|
}),
|
|
184
|
-
|
|
184
|
+
O({
|
|
185
185
|
type: J("web_fetch_tool_result"),
|
|
186
|
-
tool_use_id:
|
|
186
|
+
tool_use_id: V(),
|
|
187
187
|
caller: Z.optional(),
|
|
188
|
-
content:
|
|
188
|
+
content: A([O({
|
|
189
189
|
type: J("web_fetch_result"),
|
|
190
|
-
url:
|
|
191
|
-
retrieved_at:
|
|
192
|
-
content:
|
|
190
|
+
url: V(),
|
|
191
|
+
retrieved_at: V().nullable(),
|
|
192
|
+
content: O({
|
|
193
193
|
type: J("document"),
|
|
194
|
-
title:
|
|
195
|
-
citations:
|
|
196
|
-
source:
|
|
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:
|
|
200
|
-
}),
|
|
199
|
+
data: V()
|
|
200
|
+
}), O({
|
|
201
201
|
type: J("text"),
|
|
202
202
|
media_type: J("text/plain"),
|
|
203
|
-
data:
|
|
203
|
+
data: V()
|
|
204
204
|
})])
|
|
205
205
|
})
|
|
206
|
-
}),
|
|
206
|
+
}), O({
|
|
207
207
|
type: J("web_fetch_tool_result_error"),
|
|
208
|
-
error_code:
|
|
208
|
+
error_code: V()
|
|
209
209
|
})])
|
|
210
210
|
}),
|
|
211
|
-
|
|
211
|
+
O({
|
|
212
212
|
type: J("web_search_tool_result"),
|
|
213
|
-
tool_use_id:
|
|
213
|
+
tool_use_id: V(),
|
|
214
214
|
caller: Z.optional(),
|
|
215
|
-
content:
|
|
215
|
+
content: A([d(O({
|
|
216
216
|
type: J("web_search_result"),
|
|
217
|
-
url:
|
|
218
|
-
title:
|
|
219
|
-
encrypted_content:
|
|
220
|
-
page_age:
|
|
221
|
-
})),
|
|
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:
|
|
223
|
+
error_code: V()
|
|
224
224
|
})])
|
|
225
225
|
}),
|
|
226
|
-
|
|
226
|
+
O({
|
|
227
227
|
type: J("code_execution_tool_result"),
|
|
228
|
-
tool_use_id:
|
|
229
|
-
content:
|
|
230
|
-
|
|
228
|
+
tool_use_id: V(),
|
|
229
|
+
content: A([
|
|
230
|
+
O({
|
|
231
231
|
type: J("code_execution_result"),
|
|
232
|
-
stdout:
|
|
233
|
-
stderr:
|
|
234
|
-
return_code:
|
|
235
|
-
content: d(
|
|
232
|
+
stdout: V(),
|
|
233
|
+
stderr: V(),
|
|
234
|
+
return_code: F(),
|
|
235
|
+
content: d(O({
|
|
236
236
|
type: J("code_execution_output"),
|
|
237
|
-
file_id:
|
|
237
|
+
file_id: V()
|
|
238
238
|
})).optional().default([])
|
|
239
239
|
}),
|
|
240
|
-
|
|
240
|
+
O({
|
|
241
241
|
type: J("encrypted_code_execution_result"),
|
|
242
|
-
encrypted_stdout:
|
|
243
|
-
stderr:
|
|
244
|
-
return_code:
|
|
245
|
-
content: d(
|
|
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:
|
|
247
|
+
file_id: V()
|
|
248
248
|
})).optional().default([])
|
|
249
249
|
}),
|
|
250
|
-
|
|
250
|
+
O({
|
|
251
251
|
type: J("code_execution_tool_result_error"),
|
|
252
|
-
error_code:
|
|
252
|
+
error_code: V()
|
|
253
253
|
})
|
|
254
254
|
])
|
|
255
255
|
}),
|
|
256
|
-
|
|
256
|
+
O({
|
|
257
257
|
type: J("bash_code_execution_tool_result"),
|
|
258
|
-
tool_use_id:
|
|
259
|
-
content:
|
|
258
|
+
tool_use_id: V(),
|
|
259
|
+
content: T("type", [O({
|
|
260
260
|
type: J("bash_code_execution_result"),
|
|
261
|
-
content: d(
|
|
261
|
+
content: d(O({
|
|
262
262
|
type: J("bash_code_execution_output"),
|
|
263
|
-
file_id:
|
|
263
|
+
file_id: V()
|
|
264
264
|
})),
|
|
265
|
-
stdout:
|
|
266
|
-
stderr:
|
|
267
|
-
return_code:
|
|
268
|
-
}),
|
|
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:
|
|
270
|
+
error_code: V()
|
|
271
271
|
})])
|
|
272
272
|
}),
|
|
273
|
-
|
|
273
|
+
O({
|
|
274
274
|
type: J("text_editor_code_execution_tool_result"),
|
|
275
|
-
tool_use_id:
|
|
276
|
-
content:
|
|
277
|
-
|
|
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:
|
|
279
|
+
error_code: V()
|
|
280
280
|
}),
|
|
281
|
-
|
|
281
|
+
O({
|
|
282
282
|
type: J("text_editor_code_execution_view_result"),
|
|
283
|
-
content:
|
|
284
|
-
file_type:
|
|
285
|
-
num_lines:
|
|
286
|
-
start_line:
|
|
287
|
-
total_lines:
|
|
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
|
-
|
|
289
|
+
O({
|
|
290
290
|
type: J("text_editor_code_execution_create_result"),
|
|
291
|
-
is_file_update:
|
|
291
|
+
is_file_update: w()
|
|
292
292
|
}),
|
|
293
|
-
|
|
293
|
+
O({
|
|
294
294
|
type: J("text_editor_code_execution_str_replace_result"),
|
|
295
|
-
lines: d(
|
|
296
|
-
new_lines:
|
|
297
|
-
new_start:
|
|
298
|
-
old_lines:
|
|
299
|
-
old_start:
|
|
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
|
-
|
|
303
|
+
O({
|
|
304
304
|
type: J("tool_search_tool_result"),
|
|
305
|
-
tool_use_id:
|
|
306
|
-
content:
|
|
305
|
+
tool_use_id: V(),
|
|
306
|
+
content: A([O({
|
|
307
307
|
type: J("tool_search_tool_search_result"),
|
|
308
|
-
tool_references: d(
|
|
308
|
+
tool_references: d(O({
|
|
309
309
|
type: J("tool_reference"),
|
|
310
|
-
tool_name:
|
|
310
|
+
tool_name: V()
|
|
311
311
|
}))
|
|
312
|
-
}),
|
|
312
|
+
}), O({
|
|
313
313
|
type: J("tool_search_tool_result_error"),
|
|
314
|
-
error_code:
|
|
314
|
+
error_code: V()
|
|
315
315
|
})])
|
|
316
316
|
}),
|
|
317
|
-
|
|
317
|
+
O({
|
|
318
318
|
type: J("container_upload"),
|
|
319
|
-
file_id:
|
|
319
|
+
file_id: V()
|
|
320
320
|
}),
|
|
321
|
-
|
|
321
|
+
O({
|
|
322
322
|
type: J("advisor_tool_result"),
|
|
323
|
-
tool_use_id:
|
|
324
|
-
content:
|
|
325
|
-
|
|
323
|
+
tool_use_id: V(),
|
|
324
|
+
content: T("type", [
|
|
325
|
+
O({
|
|
326
326
|
type: J("advisor_result"),
|
|
327
|
-
text:
|
|
328
|
-
stop_reason:
|
|
327
|
+
text: V(),
|
|
328
|
+
stop_reason: V().nullish()
|
|
329
329
|
}),
|
|
330
|
-
|
|
330
|
+
O({
|
|
331
331
|
type: J("advisor_redacted_result"),
|
|
332
|
-
encrypted_content:
|
|
333
|
-
stop_reason:
|
|
332
|
+
encrypted_content: V(),
|
|
333
|
+
stop_reason: V().nullish()
|
|
334
334
|
}),
|
|
335
|
-
|
|
335
|
+
O({
|
|
336
336
|
type: J("advisor_tool_result_error"),
|
|
337
|
-
error_code:
|
|
337
|
+
error_code: V()
|
|
338
338
|
})
|
|
339
339
|
])
|
|
340
340
|
}),
|
|
341
|
-
|
|
341
|
+
O({ type: J("fallback") })
|
|
342
342
|
])),
|
|
343
|
-
stop_reason:
|
|
344
|
-
stop_sequence:
|
|
345
|
-
stop_details:
|
|
346
|
-
input_transformations: d(
|
|
347
|
-
safeguard_results: d(
|
|
348
|
-
usage:
|
|
349
|
-
input_tokens:
|
|
350
|
-
output_tokens:
|
|
351
|
-
output_tokens_details:
|
|
352
|
-
cache_creation_input_tokens:
|
|
353
|
-
cache_read_input_tokens:
|
|
354
|
-
iterations: d(
|
|
355
|
-
type:
|
|
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:
|
|
362
|
-
input_tokens:
|
|
363
|
-
output_tokens:
|
|
364
|
-
cache_creation_input_tokens:
|
|
365
|
-
cache_read_input_tokens:
|
|
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:
|
|
369
|
-
expires_at:
|
|
370
|
-
id:
|
|
371
|
-
skills: d(
|
|
372
|
-
type:
|
|
373
|
-
skill_id:
|
|
374
|
-
version:
|
|
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:
|
|
378
|
-
|
|
377
|
+
context_management: O({ applied_edits: d(A([
|
|
378
|
+
O({
|
|
379
379
|
type: J("clear_tool_uses_20250919"),
|
|
380
|
-
cleared_tool_uses:
|
|
381
|
-
cleared_input_tokens:
|
|
380
|
+
cleared_tool_uses: F(),
|
|
381
|
+
cleared_input_tokens: F()
|
|
382
382
|
}),
|
|
383
|
-
|
|
383
|
+
O({
|
|
384
384
|
type: J("clear_thinking_20251015"),
|
|
385
|
-
cleared_thinking_turns:
|
|
386
|
-
cleared_input_tokens:
|
|
385
|
+
cleared_thinking_turns: F(),
|
|
386
|
+
cleared_input_tokens: F()
|
|
387
387
|
}),
|
|
388
|
-
|
|
388
|
+
O({ type: J("compact_20260112") })
|
|
389
389
|
])) }).nullish()
|
|
390
|
-
}))),
|
|
391
|
-
|
|
390
|
+
}))), Te = W(() => r(T("type", [
|
|
391
|
+
O({
|
|
392
392
|
type: J("message_start"),
|
|
393
|
-
message:
|
|
394
|
-
id:
|
|
395
|
-
model:
|
|
396
|
-
role:
|
|
397
|
-
usage:
|
|
398
|
-
input_tokens:
|
|
399
|
-
cache_creation_input_tokens:
|
|
400
|
-
cache_read_input_tokens:
|
|
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(
|
|
402
|
+
content: d(T("type", [O({
|
|
403
403
|
type: J("tool_use"),
|
|
404
|
-
id:
|
|
405
|
-
name:
|
|
406
|
-
input:
|
|
404
|
+
id: V(),
|
|
405
|
+
name: V(),
|
|
406
|
+
input: N(),
|
|
407
407
|
caller: Z.optional(),
|
|
408
|
-
toolset_name:
|
|
408
|
+
toolset_name: V().nullish()
|
|
409
409
|
})])).nullish(),
|
|
410
|
-
stop_reason:
|
|
411
|
-
input_transformations: d(
|
|
412
|
-
container:
|
|
413
|
-
expires_at:
|
|
414
|
-
id:
|
|
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
|
-
|
|
418
|
+
O({
|
|
419
419
|
type: J("content_block_start"),
|
|
420
|
-
index:
|
|
421
|
-
content_block:
|
|
422
|
-
|
|
420
|
+
index: F(),
|
|
421
|
+
content_block: T("type", [
|
|
422
|
+
O({
|
|
423
423
|
type: J("text"),
|
|
424
|
-
text:
|
|
424
|
+
text: V()
|
|
425
425
|
}),
|
|
426
|
-
|
|
426
|
+
O({
|
|
427
427
|
type: J("thinking"),
|
|
428
|
-
thinking:
|
|
428
|
+
thinking: V()
|
|
429
429
|
}),
|
|
430
|
-
|
|
430
|
+
O({
|
|
431
431
|
type: J("tool_use"),
|
|
432
|
-
id:
|
|
433
|
-
name:
|
|
434
|
-
input: K(
|
|
432
|
+
id: V(),
|
|
433
|
+
name: V(),
|
|
434
|
+
input: K(V(), N()).optional(),
|
|
435
435
|
caller: Z.optional(),
|
|
436
|
-
toolset_name:
|
|
436
|
+
toolset_name: V().nullish()
|
|
437
437
|
}),
|
|
438
|
-
|
|
438
|
+
O({
|
|
439
439
|
type: J("redacted_thinking"),
|
|
440
|
-
data:
|
|
440
|
+
data: V()
|
|
441
441
|
}),
|
|
442
|
-
|
|
442
|
+
O({
|
|
443
443
|
type: J("compaction"),
|
|
444
|
-
content:
|
|
445
|
-
signature:
|
|
444
|
+
content: V().nullish(),
|
|
445
|
+
signature: V().nullish()
|
|
446
446
|
}),
|
|
447
|
-
|
|
447
|
+
O({
|
|
448
448
|
type: J("server_tool_use"),
|
|
449
|
-
id:
|
|
450
|
-
name:
|
|
451
|
-
input: K(
|
|
449
|
+
id: V(),
|
|
450
|
+
name: V(),
|
|
451
|
+
input: K(V(), N()).nullish(),
|
|
452
452
|
caller: Z.optional()
|
|
453
453
|
}),
|
|
454
|
-
|
|
454
|
+
O({
|
|
455
455
|
type: J("mcp_tool_use"),
|
|
456
|
-
id:
|
|
457
|
-
name:
|
|
458
|
-
input:
|
|
459
|
-
server_name:
|
|
456
|
+
id: V(),
|
|
457
|
+
name: V(),
|
|
458
|
+
input: N(),
|
|
459
|
+
server_name: V()
|
|
460
460
|
}),
|
|
461
|
-
|
|
461
|
+
O({
|
|
462
462
|
type: J("mcp_tool_result"),
|
|
463
|
-
tool_use_id:
|
|
464
|
-
is_error:
|
|
465
|
-
content:
|
|
463
|
+
tool_use_id: V(),
|
|
464
|
+
is_error: w(),
|
|
465
|
+
content: Se
|
|
466
466
|
}),
|
|
467
|
-
|
|
467
|
+
O({
|
|
468
468
|
type: J("web_fetch_tool_result"),
|
|
469
|
-
tool_use_id:
|
|
469
|
+
tool_use_id: V(),
|
|
470
470
|
caller: Z.optional(),
|
|
471
|
-
content:
|
|
471
|
+
content: A([O({
|
|
472
472
|
type: J("web_fetch_result"),
|
|
473
|
-
url:
|
|
474
|
-
retrieved_at:
|
|
475
|
-
content:
|
|
473
|
+
url: V(),
|
|
474
|
+
retrieved_at: V().nullable(),
|
|
475
|
+
content: O({
|
|
476
476
|
type: J("document"),
|
|
477
|
-
title:
|
|
478
|
-
citations:
|
|
479
|
-
source:
|
|
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:
|
|
483
|
-
}),
|
|
482
|
+
data: V()
|
|
483
|
+
}), O({
|
|
484
484
|
type: J("text"),
|
|
485
485
|
media_type: J("text/plain"),
|
|
486
|
-
data:
|
|
486
|
+
data: V()
|
|
487
487
|
})])
|
|
488
488
|
})
|
|
489
|
-
}),
|
|
489
|
+
}), O({
|
|
490
490
|
type: J("web_fetch_tool_result_error"),
|
|
491
|
-
error_code:
|
|
491
|
+
error_code: V()
|
|
492
492
|
})])
|
|
493
493
|
}),
|
|
494
|
-
|
|
494
|
+
O({
|
|
495
495
|
type: J("web_search_tool_result"),
|
|
496
|
-
tool_use_id:
|
|
496
|
+
tool_use_id: V(),
|
|
497
497
|
caller: Z.optional(),
|
|
498
|
-
content:
|
|
498
|
+
content: A([d(O({
|
|
499
499
|
type: J("web_search_result"),
|
|
500
|
-
url:
|
|
501
|
-
title:
|
|
502
|
-
encrypted_content:
|
|
503
|
-
page_age:
|
|
504
|
-
})),
|
|
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:
|
|
506
|
+
error_code: V()
|
|
507
507
|
})])
|
|
508
508
|
}),
|
|
509
|
-
|
|
509
|
+
O({
|
|
510
510
|
type: J("code_execution_tool_result"),
|
|
511
|
-
tool_use_id:
|
|
512
|
-
content:
|
|
513
|
-
|
|
511
|
+
tool_use_id: V(),
|
|
512
|
+
content: A([
|
|
513
|
+
O({
|
|
514
514
|
type: J("code_execution_result"),
|
|
515
|
-
stdout:
|
|
516
|
-
stderr:
|
|
517
|
-
return_code:
|
|
518
|
-
content: d(
|
|
515
|
+
stdout: V(),
|
|
516
|
+
stderr: V(),
|
|
517
|
+
return_code: F(),
|
|
518
|
+
content: d(O({
|
|
519
519
|
type: J("code_execution_output"),
|
|
520
|
-
file_id:
|
|
520
|
+
file_id: V()
|
|
521
521
|
})).optional().default([])
|
|
522
522
|
}),
|
|
523
|
-
|
|
523
|
+
O({
|
|
524
524
|
type: J("encrypted_code_execution_result"),
|
|
525
|
-
encrypted_stdout:
|
|
526
|
-
stderr:
|
|
527
|
-
return_code:
|
|
528
|
-
content: d(
|
|
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:
|
|
530
|
+
file_id: V()
|
|
531
531
|
})).optional().default([])
|
|
532
532
|
}),
|
|
533
|
-
|
|
533
|
+
O({
|
|
534
534
|
type: J("code_execution_tool_result_error"),
|
|
535
|
-
error_code:
|
|
535
|
+
error_code: V()
|
|
536
536
|
})
|
|
537
537
|
])
|
|
538
538
|
}),
|
|
539
|
-
|
|
539
|
+
O({
|
|
540
540
|
type: J("bash_code_execution_tool_result"),
|
|
541
|
-
tool_use_id:
|
|
542
|
-
content:
|
|
541
|
+
tool_use_id: V(),
|
|
542
|
+
content: T("type", [O({
|
|
543
543
|
type: J("bash_code_execution_result"),
|
|
544
|
-
content: d(
|
|
544
|
+
content: d(O({
|
|
545
545
|
type: J("bash_code_execution_output"),
|
|
546
|
-
file_id:
|
|
546
|
+
file_id: V()
|
|
547
547
|
})),
|
|
548
|
-
stdout:
|
|
549
|
-
stderr:
|
|
550
|
-
return_code:
|
|
551
|
-
}),
|
|
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:
|
|
553
|
+
error_code: V()
|
|
554
554
|
})])
|
|
555
555
|
}),
|
|
556
|
-
|
|
556
|
+
O({
|
|
557
557
|
type: J("text_editor_code_execution_tool_result"),
|
|
558
|
-
tool_use_id:
|
|
559
|
-
content:
|
|
560
|
-
|
|
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:
|
|
562
|
+
error_code: V()
|
|
563
563
|
}),
|
|
564
|
-
|
|
564
|
+
O({
|
|
565
565
|
type: J("text_editor_code_execution_view_result"),
|
|
566
|
-
content:
|
|
567
|
-
file_type:
|
|
568
|
-
num_lines:
|
|
569
|
-
start_line:
|
|
570
|
-
total_lines:
|
|
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
|
-
|
|
572
|
+
O({
|
|
573
573
|
type: J("text_editor_code_execution_create_result"),
|
|
574
|
-
is_file_update:
|
|
574
|
+
is_file_update: w()
|
|
575
575
|
}),
|
|
576
|
-
|
|
576
|
+
O({
|
|
577
577
|
type: J("text_editor_code_execution_str_replace_result"),
|
|
578
|
-
lines: d(
|
|
579
|
-
new_lines:
|
|
580
|
-
new_start:
|
|
581
|
-
old_lines:
|
|
582
|
-
old_start:
|
|
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
|
-
|
|
586
|
+
O({
|
|
587
587
|
type: J("tool_search_tool_result"),
|
|
588
|
-
tool_use_id:
|
|
589
|
-
content:
|
|
588
|
+
tool_use_id: V(),
|
|
589
|
+
content: A([O({
|
|
590
590
|
type: J("tool_search_tool_search_result"),
|
|
591
|
-
tool_references: d(
|
|
591
|
+
tool_references: d(O({
|
|
592
592
|
type: J("tool_reference"),
|
|
593
|
-
tool_name:
|
|
593
|
+
tool_name: V()
|
|
594
594
|
}))
|
|
595
|
-
}),
|
|
595
|
+
}), O({
|
|
596
596
|
type: J("tool_search_tool_result_error"),
|
|
597
|
-
error_code:
|
|
597
|
+
error_code: V()
|
|
598
598
|
})])
|
|
599
599
|
}),
|
|
600
|
-
|
|
600
|
+
O({
|
|
601
601
|
type: J("advisor_tool_result"),
|
|
602
|
-
tool_use_id:
|
|
603
|
-
content:
|
|
604
|
-
|
|
602
|
+
tool_use_id: V(),
|
|
603
|
+
content: T("type", [
|
|
604
|
+
O({
|
|
605
605
|
type: J("advisor_result"),
|
|
606
|
-
text:
|
|
607
|
-
stop_reason:
|
|
606
|
+
text: V(),
|
|
607
|
+
stop_reason: V().nullish()
|
|
608
608
|
}),
|
|
609
|
-
|
|
609
|
+
O({
|
|
610
610
|
type: J("advisor_redacted_result"),
|
|
611
|
-
encrypted_content:
|
|
612
|
-
stop_reason:
|
|
611
|
+
encrypted_content: V(),
|
|
612
|
+
stop_reason: V().nullish()
|
|
613
613
|
}),
|
|
614
|
-
|
|
614
|
+
O({
|
|
615
615
|
type: J("advisor_tool_result_error"),
|
|
616
|
-
error_code:
|
|
616
|
+
error_code: V()
|
|
617
617
|
})
|
|
618
618
|
])
|
|
619
619
|
}),
|
|
620
|
-
|
|
620
|
+
O({ type: J("fallback") })
|
|
621
621
|
])
|
|
622
622
|
}),
|
|
623
|
-
|
|
623
|
+
O({
|
|
624
624
|
type: J("content_block_delta"),
|
|
625
|
-
index:
|
|
626
|
-
delta:
|
|
627
|
-
|
|
625
|
+
index: F(),
|
|
626
|
+
delta: T("type", [
|
|
627
|
+
O({
|
|
628
628
|
type: J("input_json_delta"),
|
|
629
|
-
partial_json:
|
|
629
|
+
partial_json: V()
|
|
630
630
|
}),
|
|
631
|
-
|
|
631
|
+
O({
|
|
632
632
|
type: J("text_delta"),
|
|
633
|
-
text:
|
|
633
|
+
text: V()
|
|
634
634
|
}),
|
|
635
|
-
|
|
635
|
+
O({
|
|
636
636
|
type: J("thinking_delta"),
|
|
637
|
-
thinking:
|
|
637
|
+
thinking: V()
|
|
638
638
|
}),
|
|
639
|
-
|
|
639
|
+
O({
|
|
640
640
|
type: J("signature_delta"),
|
|
641
|
-
signature:
|
|
641
|
+
signature: V()
|
|
642
642
|
}),
|
|
643
|
-
|
|
643
|
+
O({
|
|
644
644
|
type: J("compaction_delta"),
|
|
645
|
-
content:
|
|
645
|
+
content: V().nullish()
|
|
646
646
|
}),
|
|
647
|
-
|
|
647
|
+
O({
|
|
648
648
|
type: J("citations_delta"),
|
|
649
|
-
citation:
|
|
649
|
+
citation: xe
|
|
650
650
|
})
|
|
651
651
|
])
|
|
652
652
|
}),
|
|
653
|
-
|
|
653
|
+
O({
|
|
654
654
|
type: J("content_block_stop"),
|
|
655
|
-
index:
|
|
655
|
+
index: F()
|
|
656
656
|
}),
|
|
657
|
-
|
|
657
|
+
O({
|
|
658
658
|
type: J("error"),
|
|
659
|
-
error:
|
|
660
|
-
type:
|
|
661
|
-
message:
|
|
662
|
-
code:
|
|
663
|
-
statusCode:
|
|
664
|
-
isRetryable:
|
|
665
|
-
data:
|
|
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
|
-
|
|
668
|
+
O({
|
|
669
669
|
type: J("message_delta"),
|
|
670
|
-
delta:
|
|
671
|
-
stop_reason:
|
|
672
|
-
stop_sequence:
|
|
673
|
-
stop_details:
|
|
674
|
-
safeguard_results: d(
|
|
675
|
-
container:
|
|
676
|
-
expires_at:
|
|
677
|
-
id:
|
|
678
|
-
skills: d(
|
|
679
|
-
type:
|
|
680
|
-
skill_id:
|
|
681
|
-
version:
|
|
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:
|
|
686
|
-
input_tokens:
|
|
687
|
-
output_tokens:
|
|
688
|
-
output_tokens_details:
|
|
689
|
-
cache_creation_input_tokens:
|
|
690
|
-
cache_read_input_tokens:
|
|
691
|
-
iterations: d(
|
|
692
|
-
type:
|
|
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:
|
|
699
|
-
input_tokens:
|
|
700
|
-
output_tokens:
|
|
701
|
-
cache_creation_input_tokens:
|
|
702
|
-
cache_read_input_tokens:
|
|
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(
|
|
706
|
-
context_management:
|
|
707
|
-
|
|
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:
|
|
710
|
-
cleared_input_tokens:
|
|
709
|
+
cleared_tool_uses: F(),
|
|
710
|
+
cleared_input_tokens: F()
|
|
711
711
|
}),
|
|
712
|
-
|
|
712
|
+
O({
|
|
713
713
|
type: J("clear_thinking_20251015"),
|
|
714
|
-
cleared_thinking_turns:
|
|
715
|
-
cleared_input_tokens:
|
|
714
|
+
cleared_thinking_turns: F(),
|
|
715
|
+
cleared_input_tokens: F()
|
|
716
716
|
}),
|
|
717
|
-
|
|
717
|
+
O({ type: J("compact_20260112") })
|
|
718
718
|
])) }).nullish()
|
|
719
719
|
}),
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
]))),
|
|
723
|
-
signature:
|
|
724
|
-
redactedData:
|
|
725
|
-
}))),
|
|
726
|
-
containerUpload:
|
|
727
|
-
citations:
|
|
728
|
-
title:
|
|
729
|
-
context:
|
|
730
|
-
}),
|
|
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(
|
|
739
|
+
toolChanges: d(T("type", [O({
|
|
740
740
|
type: J("tool_addition"),
|
|
741
|
-
toolName:
|
|
742
|
-
}),
|
|
741
|
+
toolName: V()
|
|
742
|
+
}), O({
|
|
743
743
|
type: J("tool_removal"),
|
|
744
|
-
toolName:
|
|
744
|
+
toolName: V()
|
|
745
745
|
})])).optional()
|
|
746
|
-
}),
|
|
747
|
-
sendReasoning:
|
|
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:
|
|
754
|
-
|
|
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:
|
|
761
|
+
blockBinding: O({ prefixMismatchBehavior: C(["error", "drop_block"]) }).optional()
|
|
762
762
|
}),
|
|
763
|
-
|
|
763
|
+
O({
|
|
764
764
|
type: J("enabled"),
|
|
765
|
-
budgetTokens:
|
|
765
|
+
budgetTokens: F().optional()
|
|
766
766
|
}),
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
]),
|
|
770
|
-
type:
|
|
771
|
-
blockBinding:
|
|
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:
|
|
774
|
-
cacheControl:
|
|
773
|
+
disableParallelToolUse: w().optional(),
|
|
774
|
+
cacheControl: O({
|
|
775
775
|
type: J("ephemeral"),
|
|
776
|
-
ttl:
|
|
776
|
+
ttl: A([J("5m"), J("1h")]).optional()
|
|
777
777
|
}).optional(),
|
|
778
|
-
metadata:
|
|
779
|
-
mcpServers: d(
|
|
778
|
+
metadata: O({ userId: V().optional() }).optional(),
|
|
779
|
+
mcpServers: d(O({
|
|
780
780
|
type: J("url"),
|
|
781
|
-
name:
|
|
782
|
-
url:
|
|
783
|
-
authorizationToken:
|
|
784
|
-
toolConfiguration:
|
|
785
|
-
enabled:
|
|
786
|
-
allowedTools: d(
|
|
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:
|
|
790
|
-
id:
|
|
791
|
-
skills: d(
|
|
789
|
+
container: O({
|
|
790
|
+
id: V().optional(),
|
|
791
|
+
skills: d(T("type", [O({
|
|
792
792
|
type: J("anthropic"),
|
|
793
|
-
skillId:
|
|
794
|
-
version:
|
|
795
|
-
}),
|
|
793
|
+
skillId: V(),
|
|
794
|
+
version: V().optional()
|
|
795
|
+
}), O({
|
|
796
796
|
type: J("custom"),
|
|
797
|
-
providerReference: K(
|
|
798
|
-
version:
|
|
797
|
+
providerReference: K(V(), V()),
|
|
798
|
+
version: V().optional()
|
|
799
799
|
})])).optional()
|
|
800
800
|
}).optional(),
|
|
801
|
-
toolStreaming:
|
|
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:
|
|
809
|
+
taskBudget: O({
|
|
810
810
|
type: J("tokens"),
|
|
811
|
-
total:
|
|
812
|
-
remaining:
|
|
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:
|
|
818
|
-
model:
|
|
819
|
-
max_tokens:
|
|
820
|
-
thinking: K(
|
|
821
|
-
output_config: K(
|
|
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(
|
|
825
|
-
safeguards: d(
|
|
824
|
+
anthropicBeta: d(V()).optional(),
|
|
825
|
+
safeguards: d(O({
|
|
826
826
|
type: J("dangerous_tool_use"),
|
|
827
|
-
classifierContext: K(
|
|
827
|
+
classifierContext: K(V(), N()).optional()
|
|
828
828
|
})).optional(),
|
|
829
|
-
compaction:
|
|
829
|
+
compaction: O({
|
|
830
830
|
type: J("summarize"),
|
|
831
|
-
instructions:
|
|
831
|
+
instructions: V().optional()
|
|
832
832
|
}).optional(),
|
|
833
|
-
contextManagement:
|
|
834
|
-
|
|
833
|
+
contextManagement: O({ edits: d(T("type", [
|
|
834
|
+
O({
|
|
835
835
|
type: J("clear_tool_uses_20250919"),
|
|
836
|
-
trigger:
|
|
836
|
+
trigger: T("type", [O({
|
|
837
837
|
type: J("input_tokens"),
|
|
838
|
-
value:
|
|
839
|
-
}),
|
|
838
|
+
value: F()
|
|
839
|
+
}), O({
|
|
840
840
|
type: J("tool_uses"),
|
|
841
|
-
value:
|
|
841
|
+
value: F()
|
|
842
842
|
})]).optional(),
|
|
843
|
-
keep:
|
|
843
|
+
keep: O({
|
|
844
844
|
type: J("tool_uses"),
|
|
845
|
-
value:
|
|
845
|
+
value: F()
|
|
846
846
|
}).optional(),
|
|
847
|
-
clearAtLeast:
|
|
847
|
+
clearAtLeast: O({
|
|
848
848
|
type: J("input_tokens"),
|
|
849
|
-
value:
|
|
849
|
+
value: F()
|
|
850
850
|
}).optional(),
|
|
851
|
-
clearToolInputs:
|
|
852
|
-
excludeTools: d(
|
|
851
|
+
clearToolInputs: w().optional(),
|
|
852
|
+
excludeTools: d(V()).optional()
|
|
853
853
|
}),
|
|
854
|
-
|
|
854
|
+
O({
|
|
855
855
|
type: J("clear_thinking_20251015"),
|
|
856
|
-
keep:
|
|
856
|
+
keep: A([J("all"), O({
|
|
857
857
|
type: J("thinking_turns"),
|
|
858
|
-
value:
|
|
858
|
+
value: F()
|
|
859
859
|
})]).optional()
|
|
860
860
|
}),
|
|
861
|
-
|
|
861
|
+
O({
|
|
862
862
|
type: J("compact_20260112"),
|
|
863
|
-
trigger:
|
|
863
|
+
trigger: O({
|
|
864
864
|
type: J("input_tokens"),
|
|
865
|
-
value:
|
|
865
|
+
value: F()
|
|
866
866
|
}).optional(),
|
|
867
|
-
pauseAfterCompaction:
|
|
868
|
-
instructions:
|
|
867
|
+
pauseAfterCompaction: w().optional(),
|
|
868
|
+
instructions: V().optional()
|
|
869
869
|
})
|
|
870
870
|
])) }).optional()
|
|
871
|
-
}),
|
|
872
|
-
function
|
|
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
|
|
876
|
+
var Me = class {
|
|
877
877
|
constructor() {
|
|
878
878
|
this.breakpointCount = 0, this.warnings = [];
|
|
879
879
|
}
|
|
880
880
|
getCacheControl(e, t) {
|
|
881
|
-
let n =
|
|
881
|
+
let n = je(e);
|
|
882
882
|
if (n) {
|
|
883
|
-
if (!t.canCache) {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
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
|
-
},
|
|
906
|
-
model:
|
|
907
|
-
maxUses:
|
|
908
|
-
maxTokens:
|
|
909
|
-
caching:
|
|
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:
|
|
905
|
+
ttl: A([J("5m"), J("1h")])
|
|
912
906
|
}).optional()
|
|
913
|
-
}))),
|
|
914
|
-
|
|
907
|
+
}))), Pe = W(() => r(T("type", [
|
|
908
|
+
O({
|
|
915
909
|
type: J("advisor_result"),
|
|
916
|
-
text:
|
|
917
|
-
stopReason:
|
|
910
|
+
text: V(),
|
|
911
|
+
stopReason: V().optional()
|
|
918
912
|
}),
|
|
919
|
-
|
|
913
|
+
O({
|
|
920
914
|
type: J("advisor_redacted_result"),
|
|
921
|
-
encryptedContent:
|
|
922
|
-
stopReason:
|
|
915
|
+
encryptedContent: V(),
|
|
916
|
+
stopReason: V().optional()
|
|
923
917
|
}),
|
|
924
|
-
|
|
918
|
+
O({
|
|
925
919
|
type: J("advisor_tool_result_error"),
|
|
926
|
-
errorCode:
|
|
920
|
+
errorCode: V()
|
|
927
921
|
})
|
|
928
|
-
]))),
|
|
922
|
+
]))), Fe = W(() => r(O({}).strict())), Ie = I({
|
|
929
923
|
id: "anthropic.advisor_20260301",
|
|
930
|
-
inputSchema:
|
|
931
|
-
outputSchema:
|
|
924
|
+
inputSchema: Fe,
|
|
925
|
+
outputSchema: Pe,
|
|
932
926
|
supportsDeferredResults: !0
|
|
933
|
-
}),
|
|
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
|
-
],
|
|
952
|
-
action: C(
|
|
953
|
-
coordinate: Y([
|
|
954
|
-
duration:
|
|
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
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
950
|
+
F().int(),
|
|
951
|
+
F().int(),
|
|
952
|
+
F().int(),
|
|
953
|
+
F().int()
|
|
960
954
|
]).optional(),
|
|
961
|
-
repeat:
|
|
962
|
-
scroll_amount:
|
|
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([
|
|
970
|
-
text:
|
|
971
|
-
}))),
|
|
972
|
-
enabled:
|
|
973
|
-
deferLoading:
|
|
974
|
-
})).optional() }))),
|
|
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:
|
|
977
|
-
}),
|
|
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:
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
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:
|
|
1001
|
-
region:
|
|
1002
|
-
country:
|
|
1003
|
-
timezone:
|
|
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
|
-
}))),
|
|
1007
|
-
url:
|
|
1008
|
-
title:
|
|
1009
|
-
pageAge:
|
|
1010
|
-
encryptedContent:
|
|
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
|
-
})))),
|
|
1006
|
+
})))), Je = W(() => r(O({ query: V() }))), Ye = I({
|
|
1013
1007
|
id: "anthropic.web_search_20260318",
|
|
1014
|
-
inputSchema:
|
|
1015
|
-
outputSchema:
|
|
1008
|
+
inputSchema: Je,
|
|
1009
|
+
outputSchema: qe,
|
|
1016
1010
|
supportsDeferredResults: !0
|
|
1017
|
-
}),
|
|
1018
|
-
maxUses:
|
|
1019
|
-
allowedDomains: d(
|
|
1020
|
-
blockedDomains: d(
|
|
1021
|
-
userLocation:
|
|
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:
|
|
1024
|
-
region:
|
|
1025
|
-
country:
|
|
1026
|
-
timezone:
|
|
1017
|
+
city: V().optional(),
|
|
1018
|
+
region: V().optional(),
|
|
1019
|
+
country: V().optional(),
|
|
1020
|
+
timezone: V().optional()
|
|
1027
1021
|
}).optional()
|
|
1028
|
-
}))),
|
|
1029
|
-
url:
|
|
1030
|
-
title:
|
|
1031
|
-
pageAge:
|
|
1032
|
-
encryptedContent:
|
|
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
|
-
})))),
|
|
1028
|
+
})))), $e = W(() => r(O({ query: V() }))), et = I({
|
|
1035
1029
|
id: "anthropic.web_search_20260209",
|
|
1036
|
-
inputSchema:
|
|
1037
|
-
outputSchema:
|
|
1030
|
+
inputSchema: $e,
|
|
1031
|
+
outputSchema: Qe,
|
|
1038
1032
|
supportsDeferredResults: !0
|
|
1039
|
-
}),
|
|
1040
|
-
maxUses:
|
|
1041
|
-
allowedDomains: d(
|
|
1042
|
-
blockedDomains: d(
|
|
1043
|
-
userLocation:
|
|
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:
|
|
1046
|
-
region:
|
|
1047
|
-
country:
|
|
1048
|
-
timezone:
|
|
1039
|
+
city: V().optional(),
|
|
1040
|
+
region: V().optional(),
|
|
1041
|
+
country: V().optional(),
|
|
1042
|
+
timezone: V().optional()
|
|
1049
1043
|
}).optional()
|
|
1050
|
-
}))),
|
|
1051
|
-
url:
|
|
1052
|
-
title:
|
|
1053
|
-
pageAge:
|
|
1054
|
-
encryptedContent:
|
|
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
|
-
})))),
|
|
1050
|
+
})))), it = W(() => r(O({ query: V() }))), at = I({
|
|
1057
1051
|
id: "anthropic.web_search_20250305",
|
|
1058
|
-
inputSchema:
|
|
1059
|
-
outputSchema:
|
|
1052
|
+
inputSchema: it,
|
|
1053
|
+
outputSchema: rt,
|
|
1060
1054
|
supportsDeferredResults: !0
|
|
1061
|
-
}),
|
|
1062
|
-
maxUses:
|
|
1063
|
-
allowedDomains: d(
|
|
1064
|
-
blockedDomains: d(
|
|
1065
|
-
citations:
|
|
1066
|
-
maxContentTokens:
|
|
1067
|
-
useCache:
|
|
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
|
-
}))),
|
|
1063
|
+
}))), ct = W(() => r(O({
|
|
1070
1064
|
type: J("web_fetch_result"),
|
|
1071
|
-
url:
|
|
1072
|
-
content:
|
|
1065
|
+
url: V(),
|
|
1066
|
+
content: O({
|
|
1073
1067
|
type: J("document"),
|
|
1074
|
-
title:
|
|
1075
|
-
citations:
|
|
1076
|
-
source:
|
|
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:
|
|
1080
|
-
}),
|
|
1073
|
+
data: V()
|
|
1074
|
+
}), O({
|
|
1081
1075
|
type: J("text"),
|
|
1082
1076
|
mediaType: J("text/plain"),
|
|
1083
|
-
data:
|
|
1077
|
+
data: V()
|
|
1084
1078
|
})])
|
|
1085
1079
|
}),
|
|
1086
|
-
retrievedAt:
|
|
1087
|
-
}))),
|
|
1080
|
+
retrievedAt: V().nullable()
|
|
1081
|
+
}))), lt = W(() => r(O({ url: V() }))), ut = I({
|
|
1088
1082
|
id: "anthropic.web_fetch_20260318",
|
|
1089
|
-
inputSchema:
|
|
1090
|
-
outputSchema:
|
|
1083
|
+
inputSchema: lt,
|
|
1084
|
+
outputSchema: ct,
|
|
1091
1085
|
supportsDeferredResults: !0
|
|
1092
|
-
}),
|
|
1093
|
-
maxUses:
|
|
1094
|
-
allowedDomains: d(
|
|
1095
|
-
blockedDomains: d(
|
|
1096
|
-
citations:
|
|
1097
|
-
maxContentTokens:
|
|
1098
|
-
}))),
|
|
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:
|
|
1101
|
-
content:
|
|
1094
|
+
url: V(),
|
|
1095
|
+
content: O({
|
|
1102
1096
|
type: J("document"),
|
|
1103
|
-
title:
|
|
1104
|
-
citations:
|
|
1105
|
-
source:
|
|
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:
|
|
1109
|
-
}),
|
|
1102
|
+
data: V()
|
|
1103
|
+
}), O({
|
|
1110
1104
|
type: J("text"),
|
|
1111
1105
|
mediaType: J("text/plain"),
|
|
1112
|
-
data:
|
|
1106
|
+
data: V()
|
|
1113
1107
|
})])
|
|
1114
1108
|
}),
|
|
1115
|
-
retrievedAt:
|
|
1116
|
-
}))),
|
|
1109
|
+
retrievedAt: V().nullable()
|
|
1110
|
+
}))), mt = W(() => r(O({ url: V() }))), ht = I({
|
|
1117
1111
|
id: "anthropic.web_fetch_20260209",
|
|
1118
|
-
inputSchema:
|
|
1119
|
-
outputSchema:
|
|
1112
|
+
inputSchema: mt,
|
|
1113
|
+
outputSchema: pt,
|
|
1120
1114
|
supportsDeferredResults: !0
|
|
1121
|
-
}),
|
|
1122
|
-
maxUses:
|
|
1123
|
-
allowedDomains: d(
|
|
1124
|
-
blockedDomains: d(
|
|
1125
|
-
citations:
|
|
1126
|
-
maxContentTokens:
|
|
1127
|
-
}))),
|
|
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:
|
|
1130
|
-
content:
|
|
1123
|
+
url: V(),
|
|
1124
|
+
content: O({
|
|
1131
1125
|
type: J("document"),
|
|
1132
|
-
title:
|
|
1133
|
-
citations:
|
|
1134
|
-
source:
|
|
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:
|
|
1138
|
-
}),
|
|
1131
|
+
data: V()
|
|
1132
|
+
}), O({
|
|
1139
1133
|
type: J("text"),
|
|
1140
1134
|
mediaType: J("text/plain"),
|
|
1141
|
-
data:
|
|
1135
|
+
data: V()
|
|
1142
1136
|
})])
|
|
1143
1137
|
}),
|
|
1144
|
-
retrievedAt:
|
|
1145
|
-
}))),
|
|
1138
|
+
retrievedAt: V().nullable()
|
|
1139
|
+
}))), yt = W(() => r(O({ url: V() }))), bt = I({
|
|
1146
1140
|
id: "anthropic.web_fetch_20250910",
|
|
1147
|
-
inputSchema:
|
|
1148
|
-
outputSchema:
|
|
1141
|
+
inputSchema: yt,
|
|
1142
|
+
outputSchema: vt,
|
|
1149
1143
|
supportsDeferredResults: !0
|
|
1150
|
-
}),
|
|
1151
|
-
async function
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
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
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
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
|
|
1512
|
+
default: throw new L({ functionality: `tool choice type: ${p}` });
|
|
1523
1513
|
}
|
|
1524
1514
|
}
|
|
1525
|
-
function
|
|
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
|
|
1545
|
+
var wt = W(() => r(O({
|
|
1556
1546
|
type: J("code_execution_result"),
|
|
1557
|
-
stdout:
|
|
1558
|
-
stderr:
|
|
1559
|
-
return_code:
|
|
1560
|
-
content: d(
|
|
1547
|
+
stdout: V(),
|
|
1548
|
+
stderr: V(),
|
|
1549
|
+
return_code: F(),
|
|
1550
|
+
content: d(O({
|
|
1561
1551
|
type: J("code_execution_output"),
|
|
1562
|
-
file_id:
|
|
1552
|
+
file_id: V()
|
|
1563
1553
|
})).optional().default([])
|
|
1564
|
-
}))),
|
|
1554
|
+
}))), Tt = W(() => r(O({ code: V() }))), Et = I({
|
|
1565
1555
|
id: "anthropic.code_execution_20250522",
|
|
1566
|
-
inputSchema:
|
|
1567
|
-
outputSchema:
|
|
1568
|
-
}),
|
|
1569
|
-
|
|
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:
|
|
1572
|
-
stderr:
|
|
1573
|
-
return_code:
|
|
1574
|
-
content: d(
|
|
1561
|
+
stdout: V(),
|
|
1562
|
+
stderr: V(),
|
|
1563
|
+
return_code: F(),
|
|
1564
|
+
content: d(O({
|
|
1575
1565
|
type: J("code_execution_output"),
|
|
1576
|
-
file_id:
|
|
1566
|
+
file_id: V()
|
|
1577
1567
|
})).optional().default([])
|
|
1578
1568
|
}),
|
|
1579
|
-
|
|
1569
|
+
O({
|
|
1580
1570
|
type: J("bash_code_execution_result"),
|
|
1581
|
-
content: d(
|
|
1571
|
+
content: d(O({
|
|
1582
1572
|
type: J("bash_code_execution_output"),
|
|
1583
|
-
file_id:
|
|
1573
|
+
file_id: V()
|
|
1584
1574
|
})),
|
|
1585
|
-
stdout:
|
|
1586
|
-
stderr:
|
|
1587
|
-
return_code:
|
|
1575
|
+
stdout: V(),
|
|
1576
|
+
stderr: V(),
|
|
1577
|
+
return_code: F()
|
|
1588
1578
|
}),
|
|
1589
|
-
|
|
1579
|
+
O({
|
|
1590
1580
|
type: J("bash_code_execution_tool_result_error"),
|
|
1591
|
-
error_code:
|
|
1581
|
+
error_code: V()
|
|
1592
1582
|
}),
|
|
1593
|
-
|
|
1583
|
+
O({
|
|
1594
1584
|
type: J("text_editor_code_execution_tool_result_error"),
|
|
1595
|
-
error_code:
|
|
1585
|
+
error_code: V()
|
|
1596
1586
|
}),
|
|
1597
|
-
|
|
1587
|
+
O({
|
|
1598
1588
|
type: J("text_editor_code_execution_view_result"),
|
|
1599
|
-
content:
|
|
1600
|
-
file_type:
|
|
1601
|
-
num_lines:
|
|
1602
|
-
start_line:
|
|
1603
|
-
total_lines:
|
|
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
|
-
|
|
1595
|
+
O({
|
|
1606
1596
|
type: J("text_editor_code_execution_create_result"),
|
|
1607
|
-
is_file_update:
|
|
1597
|
+
is_file_update: w()
|
|
1608
1598
|
}),
|
|
1609
|
-
|
|
1599
|
+
O({
|
|
1610
1600
|
type: J("text_editor_code_execution_str_replace_result"),
|
|
1611
|
-
lines: d(
|
|
1612
|
-
new_lines:
|
|
1613
|
-
new_start:
|
|
1614
|
-
old_lines:
|
|
1615
|
-
old_start:
|
|
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
|
-
]))),
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
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
|
-
|
|
1625
|
-
type: J("
|
|
1626
|
-
command:
|
|
1622
|
+
O({
|
|
1623
|
+
type: J("text_editor_code_execution"),
|
|
1624
|
+
command: J("create"),
|
|
1625
|
+
path: V(),
|
|
1626
|
+
file_text: V().nullish()
|
|
1627
1627
|
}),
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
1664
|
-
|
|
1653
|
+
}), Mt = W(() => r(T("type", [
|
|
1654
|
+
O({
|
|
1665
1655
|
type: J("code_execution_result"),
|
|
1666
|
-
stdout:
|
|
1667
|
-
stderr:
|
|
1668
|
-
return_code:
|
|
1669
|
-
content: d(
|
|
1656
|
+
stdout: V(),
|
|
1657
|
+
stderr: V(),
|
|
1658
|
+
return_code: F(),
|
|
1659
|
+
content: d(O({
|
|
1670
1660
|
type: J("code_execution_output"),
|
|
1671
|
-
file_id:
|
|
1661
|
+
file_id: V()
|
|
1672
1662
|
})).optional().default([])
|
|
1673
1663
|
}),
|
|
1674
|
-
|
|
1664
|
+
O({
|
|
1675
1665
|
type: J("encrypted_code_execution_result"),
|
|
1676
|
-
encrypted_stdout:
|
|
1677
|
-
stderr:
|
|
1678
|
-
return_code:
|
|
1679
|
-
content: d(
|
|
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:
|
|
1671
|
+
file_id: V()
|
|
1682
1672
|
})).optional().default([])
|
|
1683
1673
|
}),
|
|
1684
|
-
|
|
1674
|
+
O({
|
|
1685
1675
|
type: J("bash_code_execution_result"),
|
|
1686
|
-
content: d(
|
|
1676
|
+
content: d(O({
|
|
1687
1677
|
type: J("bash_code_execution_output"),
|
|
1688
|
-
file_id:
|
|
1678
|
+
file_id: V()
|
|
1689
1679
|
})),
|
|
1690
|
-
stdout:
|
|
1691
|
-
stderr:
|
|
1692
|
-
return_code:
|
|
1680
|
+
stdout: V(),
|
|
1681
|
+
stderr: V(),
|
|
1682
|
+
return_code: F()
|
|
1693
1683
|
}),
|
|
1694
|
-
|
|
1684
|
+
O({
|
|
1695
1685
|
type: J("bash_code_execution_tool_result_error"),
|
|
1696
|
-
error_code:
|
|
1686
|
+
error_code: V()
|
|
1697
1687
|
}),
|
|
1698
|
-
|
|
1688
|
+
O({
|
|
1699
1689
|
type: J("text_editor_code_execution_tool_result_error"),
|
|
1700
|
-
error_code:
|
|
1690
|
+
error_code: V()
|
|
1701
1691
|
}),
|
|
1702
|
-
|
|
1692
|
+
O({
|
|
1703
1693
|
type: J("text_editor_code_execution_view_result"),
|
|
1704
|
-
content:
|
|
1705
|
-
file_type:
|
|
1706
|
-
num_lines:
|
|
1707
|
-
start_line:
|
|
1708
|
-
total_lines:
|
|
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
|
-
|
|
1700
|
+
O({
|
|
1711
1701
|
type: J("text_editor_code_execution_create_result"),
|
|
1712
|
-
is_file_update:
|
|
1702
|
+
is_file_update: w()
|
|
1713
1703
|
}),
|
|
1714
|
-
|
|
1704
|
+
O({
|
|
1715
1705
|
type: J("text_editor_code_execution_str_replace_result"),
|
|
1716
|
-
lines: d(
|
|
1717
|
-
new_lines:
|
|
1718
|
-
new_start:
|
|
1719
|
-
old_lines:
|
|
1720
|
-
old_start:
|
|
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
|
-
]))),
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
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
|
-
|
|
1730
|
-
type: J("
|
|
1731
|
-
command:
|
|
1727
|
+
O({
|
|
1728
|
+
type: J("text_editor_code_execution"),
|
|
1729
|
+
command: J("create"),
|
|
1730
|
+
path: V(),
|
|
1731
|
+
file_text: V().nullish()
|
|
1732
1732
|
}),
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
1758
|
+
}), It = W(() => r(d(O({
|
|
1769
1759
|
type: J("tool_reference"),
|
|
1770
|
-
toolName:
|
|
1771
|
-
})))),
|
|
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:
|
|
1774
|
-
|
|
1775
|
-
limit: I().optional()
|
|
1776
|
-
}))),
|
|
1777
|
-
outputSchema: wt,
|
|
1766
|
+
inputSchema: Lt,
|
|
1767
|
+
outputSchema: It,
|
|
1778
1768
|
supportsDeferredResults: !0
|
|
1779
|
-
}),
|
|
1780
|
-
function
|
|
1781
|
-
return typeof e == "string" ? new TextDecoder().decode(
|
|
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
|
|
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
|
|
1794
|
-
let l = /* @__PURE__ */ new Set(), d =
|
|
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
|
|
1786
|
+
return (await D({
|
|
1797
1787
|
provider: "anthropic",
|
|
1798
1788
|
providerOptions: e,
|
|
1799
|
-
schema:
|
|
1789
|
+
schema: De
|
|
1800
1790
|
}))?.citations?.enabled ?? !1;
|
|
1801
1791
|
}
|
|
1802
1792
|
async function v(e) {
|
|
1803
|
-
return (await
|
|
1793
|
+
return (await D({
|
|
1804
1794
|
provider: "anthropic",
|
|
1805
1795
|
providerOptions: e,
|
|
1806
|
-
schema:
|
|
1796
|
+
schema: De
|
|
1807
1797
|
}))?.containerUpload ?? !1;
|
|
1808
1798
|
}
|
|
1809
1799
|
async function y(e) {
|
|
1810
|
-
let t = await
|
|
1800
|
+
let t = await D({
|
|
1811
1801
|
provider: "anthropic",
|
|
1812
1802
|
providerOptions: e,
|
|
1813
|
-
schema:
|
|
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
|
|
1816
|
+
let r = await D({
|
|
1827
1817
|
provider: "anthropic",
|
|
1828
1818
|
providerOptions: n,
|
|
1829
|
-
schema:
|
|
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
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
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
|
-
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
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: "
|
|
1935
|
-
|
|
1936
|
-
|
|
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
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
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: "
|
|
1955
|
-
media_type:
|
|
1956
|
-
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
|
-
|
|
1961
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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 =
|
|
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"
|
|
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
|
|
2144
|
+
let t = await D({
|
|
2159
2145
|
provider: "anthropic",
|
|
2160
2146
|
providerOptions: o.providerOptions,
|
|
2161
|
-
schema:
|
|
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 =
|
|
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 =
|
|
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 } =
|
|
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:
|
|
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 =
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2655
|
+
function qt(e) {
|
|
2670
2656
|
return typeof e == "object" && e && !Array.isArray(e) ? e : { rawInvalidInput: e };
|
|
2671
2657
|
}
|
|
2672
|
-
function
|
|
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
|
|
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
|
-
]),
|
|
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
|
|
2713
|
-
return
|
|
2698
|
+
function Zt(e) {
|
|
2699
|
+
return Qt(e);
|
|
2714
2700
|
}
|
|
2715
2701
|
function Q(e) {
|
|
2716
|
-
return typeof e == "boolean" || !
|
|
2702
|
+
return typeof e == "boolean" || !se(e) ? e : Qt(e);
|
|
2717
2703
|
}
|
|
2718
|
-
function
|
|
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" &&
|
|
2726
|
-
let r =
|
|
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
|
|
2731
|
-
let t =
|
|
2716
|
+
function $t(e) {
|
|
2717
|
+
let t = Xt.flatMap((t) => {
|
|
2732
2718
|
let n = e[t];
|
|
2733
|
-
return n == null || n === !1 ? [] : `${
|
|
2719
|
+
return n == null || n === !1 ? [] : `${en(t)}: ${tn(n)}`;
|
|
2734
2720
|
});
|
|
2735
|
-
return typeof e.format == "string" && !
|
|
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
|
|
2723
|
+
function en(e) {
|
|
2738
2724
|
return e.replace(/[A-Z]/g, (e) => ` ${e.toLowerCase()}`);
|
|
2739
2725
|
}
|
|
2740
|
-
function
|
|
2726
|
+
function tn(e) {
|
|
2741
2727
|
return typeof e == "string" ? e : JSON.stringify(e);
|
|
2742
2728
|
}
|
|
2743
|
-
function
|
|
2744
|
-
let t =
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
2817
|
+
let t = on(e);
|
|
2832
2818
|
return t == null ? {} : { providerMetadata: { anthropic: { caller: t } } };
|
|
2833
2819
|
}
|
|
2834
|
-
function
|
|
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
|
|
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
|
|
2831
|
+
function ln(e) {
|
|
2846
2832
|
let t = e.indexOf(".");
|
|
2847
2833
|
return t === -1 ? e : e.substring(0, t);
|
|
2848
2834
|
}
|
|
2849
|
-
var
|
|
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
|
|
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 =
|
|
2881
|
+
let x = ln(t.provider), S = await D({
|
|
2896
2882
|
provider: "anthropic",
|
|
2897
2883
|
providerOptions: v,
|
|
2898
|
-
schema:
|
|
2899
|
-
}), C = x === "anthropic" ? null : await
|
|
2884
|
+
schema: ke
|
|
2885
|
+
}), C = x === "anthropic" ? null : await D({
|
|
2900
2886
|
provider: x,
|
|
2901
2887
|
providerOptions: v,
|
|
2902
|
-
schema:
|
|
2903
|
-
}),
|
|
2904
|
-
!
|
|
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 ${
|
|
2908
|
-
}),
|
|
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
|
|
2922
|
-
!
|
|
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
|
-
}),
|
|
2927
|
-
let
|
|
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
|
-
|
|
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
|
|
2939
|
-
if (
|
|
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
|
|
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
|
-
}),
|
|
2956
|
+
}), oe = sn(h), { prompt: se, betas: U } = await Ht({
|
|
2971
2957
|
prompt: r,
|
|
2972
|
-
sendReasoning:
|
|
2958
|
+
sendReasoning: T?.sendReasoning ?? !0,
|
|
2973
2959
|
warnings: b,
|
|
2974
|
-
cacheControlValidator:
|
|
2975
|
-
toolNameMapping:
|
|
2976
|
-
toolsetNames:
|
|
2960
|
+
cacheControlValidator: H,
|
|
2961
|
+
toolNameMapping: ae,
|
|
2962
|
+
toolsetNames: oe
|
|
2977
2963
|
});
|
|
2978
|
-
if (
|
|
2979
|
-
let t =
|
|
2964
|
+
if (ee(_) && T?.effort == null) {
|
|
2965
|
+
let t = pn({
|
|
2980
2966
|
reasoning: _,
|
|
2981
2967
|
modelId: e,
|
|
2982
|
-
supportsAdaptiveThinking:
|
|
2983
|
-
supportsXhighEffort:
|
|
2984
|
-
rejectsThinkingDisabled:
|
|
2985
|
-
supportsBetweenToolsThinking:
|
|
2986
|
-
maxOutputTokensForModel:
|
|
2968
|
+
supportsAdaptiveThinking: O,
|
|
2969
|
+
supportsXhighEffort: re,
|
|
2970
|
+
rejectsThinkingDisabled: j,
|
|
2971
|
+
supportsBetweenToolsThinking: N,
|
|
2972
|
+
maxOutputTokensForModel: E,
|
|
2987
2973
|
warnings: b
|
|
2988
2974
|
});
|
|
2989
|
-
t != null && (
|
|
2975
|
+
t != null && (T.thinking ??= t.thinking, t.effort != null && T.thinking?.type !== "disabled" && (T.effort = t.effort));
|
|
2990
2976
|
}
|
|
2991
|
-
if (
|
|
2992
|
-
let t =
|
|
2993
|
-
t.type === "disabled" &&
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
2991
|
+
}), T.thinking = { type: "adaptive" });
|
|
3006
2992
|
}
|
|
3007
|
-
|
|
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 '${
|
|
3011
|
-
}),
|
|
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 '${
|
|
3015
|
-
}),
|
|
3016
|
-
let
|
|
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
|
-
...
|
|
3010
|
+
...W != null && { type: W },
|
|
3025
3011
|
...q != null && { budget_tokens: q },
|
|
3026
3012
|
...J != null && { display: J },
|
|
3027
|
-
...
|
|
3013
|
+
...G != null && { block_binding: { prefix_mismatch_behavior: G.prefixMismatchBehavior } }
|
|
3028
3014
|
} },
|
|
3029
|
-
...(
|
|
3030
|
-
...
|
|
3031
|
-
...
|
|
3032
|
-
type:
|
|
3033
|
-
total:
|
|
3034
|
-
...
|
|
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
|
-
...
|
|
3022
|
+
...R && f?.type === "json" && f.schema != null && { format: {
|
|
3037
3023
|
type: "json_schema",
|
|
3038
|
-
schema:
|
|
3024
|
+
schema: Zt(f.schema)
|
|
3039
3025
|
} }
|
|
3040
3026
|
} },
|
|
3041
|
-
...
|
|
3042
|
-
...
|
|
3043
|
-
...
|
|
3044
|
-
...
|
|
3045
|
-
...
|
|
3046
|
-
...
|
|
3047
|
-
...
|
|
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
|
-
...
|
|
3058
|
-
id:
|
|
3059
|
-
skills:
|
|
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
|
-
} :
|
|
3068
|
-
system:
|
|
3069
|
-
messages:
|
|
3070
|
-
...
|
|
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
|
-
...
|
|
3075
|
-
type:
|
|
3076
|
-
...
|
|
3060
|
+
...V && { compaction: {
|
|
3061
|
+
type: V.type,
|
|
3062
|
+
...V.instructions !== void 0 && { instructions: V.instructions }
|
|
3077
3063
|
} },
|
|
3078
|
-
...
|
|
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
|
-
|
|
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)) :
|
|
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),
|
|
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} ${
|
|
3135
|
-
}), Y.max_tokens =
|
|
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
|
-
})),
|
|
3139
|
-
let ue = y && (
|
|
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:
|
|
3143
|
-
cacheControlValidator:
|
|
3144
|
-
supportsStructuredOutput:
|
|
3145
|
-
supportsStrictTools:
|
|
3128
|
+
disableParallelToolUse: T?.disableParallelToolUse,
|
|
3129
|
+
cacheControlValidator: H,
|
|
3130
|
+
supportsStructuredOutput: F,
|
|
3131
|
+
supportsStrictTools: I,
|
|
3146
3132
|
defaultEagerInputStreaming: ue,
|
|
3147
|
-
rejectsForcedToolUse:
|
|
3133
|
+
rejectsForcedToolUse: M
|
|
3148
3134
|
} : {
|
|
3149
|
-
tools: [...h ?? [],
|
|
3135
|
+
tools: [...h ?? [], z],
|
|
3150
3136
|
toolChoice: { type: "required" },
|
|
3151
3137
|
disableParallelToolUse: !0,
|
|
3152
|
-
cacheControlValidator:
|
|
3138
|
+
cacheControlValidator: H,
|
|
3153
3139
|
supportsStructuredOutput: !1,
|
|
3154
|
-
supportsStrictTools:
|
|
3140
|
+
supportsStrictTools: I,
|
|
3155
3141
|
defaultEagerInputStreaming: ue,
|
|
3156
|
-
rejectsForcedToolUse:
|
|
3157
|
-
}), he =
|
|
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
|
|
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
|
-
...
|
|
3157
|
+
...U,
|
|
3172
3158
|
...me,
|
|
3173
3159
|
...n,
|
|
3174
|
-
...
|
|
3160
|
+
...T?.anthropicBeta ?? []
|
|
3175
3161
|
]),
|
|
3176
|
-
usesJsonResponseTool:
|
|
3177
|
-
toolNameMapping:
|
|
3162
|
+
usesJsonResponseTool: z != null,
|
|
3163
|
+
toolNameMapping: ae,
|
|
3178
3164
|
providerOptionsName: x,
|
|
3179
|
-
usedCustomProviderKey:
|
|
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
|
|
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 =
|
|
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(
|
|
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 =
|
|
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(
|
|
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:
|
|
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:
|
|
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 =
|
|
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:
|
|
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 =
|
|
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: _(
|
|
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
|
|
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 (
|
|
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 (
|
|
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")
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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:
|
|
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 (
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
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
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
})
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
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 =
|
|
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 (
|
|
4124
|
-
if (
|
|
4125
|
-
|
|
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(
|
|
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 (
|
|
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:
|
|
4122
|
+
unified: Jt({
|
|
4140
4123
|
finishReason: i.message.stop_reason,
|
|
4141
|
-
isJsonResponseFromTool:
|
|
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 =
|
|
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:
|
|
4160
|
+
unified: Jt({
|
|
4178
4161
|
finishReason: i.delta.stop_reason,
|
|
4179
|
-
isJsonResponseFromTool:
|
|
4162
|
+
isJsonResponseFromTool: D
|
|
4180
4163
|
}),
|
|
4181
4164
|
raw: i.delta.stop_reason ?? void 0
|
|
4182
|
-
}, C = i.delta.stop_sequence ?? 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 =
|
|
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
|
-
|
|
4179
|
+
O = !1, k = void 0;
|
|
4197
4180
|
let e = {
|
|
4198
4181
|
usage: S ?? null,
|
|
4199
4182
|
stopSequence: C,
|
|
4200
|
-
...
|
|
4201
|
-
...
|
|
4202
|
-
...
|
|
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:
|
|
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:
|
|
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:
|
|
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(),
|
|
4217
|
+
})).tee(), P = M.getReader();
|
|
4235
4218
|
try {
|
|
4236
|
-
await
|
|
4237
|
-
let e = await
|
|
4238
|
-
if (e.value?.type === "raw" && (e = await
|
|
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
|
|
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
|
-
|
|
4234
|
+
P.cancel().catch(() => {}), P.releaseLock();
|
|
4252
4235
|
}
|
|
4253
4236
|
return {
|
|
4254
|
-
stream:
|
|
4237
|
+
stream: N,
|
|
4255
4238
|
request: { body: t },
|
|
4256
4239
|
response: { headers: f }
|
|
4257
4240
|
};
|
|
4258
4241
|
}
|
|
4259
4242
|
};
|
|
4260
|
-
function
|
|
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
|
|
4411
|
+
function fn(e) {
|
|
4429
4412
|
if (!e) return !1;
|
|
4430
4413
|
let t = !1, n = !1;
|
|
4431
|
-
for (let r of e)
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
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
|
|
4444
|
-
if (!
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
4504
|
-
id:
|
|
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:
|
|
4507
|
-
request_counts:
|
|
4508
|
-
processing:
|
|
4509
|
-
succeeded:
|
|
4510
|
-
errored:
|
|
4511
|
-
canceled:
|
|
4512
|
-
expired:
|
|
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:
|
|
4515
|
-
expires_at:
|
|
4516
|
-
archived_at:
|
|
4517
|
-
cancel_initiated_at:
|
|
4518
|
-
ended_at:
|
|
4519
|
-
results_url:
|
|
4520
|
-
}),
|
|
4521
|
-
data: d(
|
|
4522
|
-
has_more:
|
|
4523
|
-
last_id:
|
|
4524
|
-
}))),
|
|
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
|
-
]),
|
|
4543
|
-
|
|
4520
|
+
]), Sn = W(() => r(T("type", [
|
|
4521
|
+
O({
|
|
4544
4522
|
type: J("succeeded"),
|
|
4545
|
-
message:
|
|
4523
|
+
message: N()
|
|
4546
4524
|
}),
|
|
4547
|
-
|
|
4525
|
+
O({
|
|
4548
4526
|
type: J("errored"),
|
|
4549
|
-
error:
|
|
4527
|
+
error: O({
|
|
4550
4528
|
type: J("error"),
|
|
4551
|
-
error:
|
|
4552
|
-
type:
|
|
4553
|
-
message:
|
|
4529
|
+
error: O({
|
|
4530
|
+
type: V(),
|
|
4531
|
+
message: V()
|
|
4554
4532
|
}),
|
|
4555
|
-
request_id:
|
|
4533
|
+
request_id: V().nullish()
|
|
4556
4534
|
})
|
|
4557
4535
|
}),
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
]))),
|
|
4561
|
-
custom_id:
|
|
4562
|
-
result:
|
|
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
|
|
4542
|
+
function wn(e) {
|
|
4565
4543
|
for (let t of e) {
|
|
4566
4544
|
let e = t.type;
|
|
4567
|
-
if (e !== "text") throw new
|
|
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
|
|
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
|
-
|
|
4579
|
-
let o = new Set(await
|
|
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
|
|
4566
|
+
if ((await En({
|
|
4589
4567
|
provider: this.options.config.provider,
|
|
4590
4568
|
providerOptions: t.options.providerOptions
|
|
4591
|
-
})).length > 0) throw new
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
-
...
|
|
4619
|
+
...kn(u),
|
|
4642
4620
|
warnings: l
|
|
4643
4621
|
};
|
|
4644
4622
|
}
|
|
4645
4623
|
async doGetBatchStatus(e) {
|
|
4646
|
-
return
|
|
4624
|
+
return kn(await this.retrieveBatch(e));
|
|
4647
4625
|
}
|
|
4648
4626
|
async doCancelBatch(e) {
|
|
4649
|
-
return await
|
|
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(
|
|
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(
|
|
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
|
-
...
|
|
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 (
|
|
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
|
|
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(
|
|
4678
|
+
successfulResponseHandler: y(Cn),
|
|
4701
4679
|
abortSignal: e.abortSignal,
|
|
4702
4680
|
fetch: this.options.config.fetch
|
|
4703
4681
|
});
|
|
4704
|
-
return
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
4706
|
+
return M(this.options.config.headers ? await fe(this.options.config.headers) : void 0, e);
|
|
4729
4707
|
}
|
|
4730
4708
|
};
|
|
4731
|
-
async function
|
|
4732
|
-
let n = e.split(".")[0], r = await
|
|
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:
|
|
4736
|
-
}), i = n === "anthropic" ? void 0 : await
|
|
4713
|
+
schema: _n
|
|
4714
|
+
}), i = n === "anthropic" ? void 0 : await D({
|
|
4737
4715
|
provider: n,
|
|
4738
4716
|
providerOptions: t,
|
|
4739
|
-
schema:
|
|
4717
|
+
schema: _n
|
|
4740
4718
|
});
|
|
4741
4719
|
return Object.assign({}, r ?? {}, i ?? {}).anthropicBeta ?? [];
|
|
4742
4720
|
}
|
|
4743
|
-
function
|
|
4721
|
+
function Dn(e) {
|
|
4744
4722
|
let t = /* @__PURE__ */ new Set();
|
|
4745
4723
|
for (let n of e) {
|
|
4746
|
-
if (!
|
|
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
|
|
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
|
|
4758
|
-
if (e.speed != null) throw new
|
|
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
|
|
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
|
|
4768
|
-
let t =
|
|
4745
|
+
function kn(e) {
|
|
4746
|
+
let t = jn(e.request_counts);
|
|
4769
4747
|
return {
|
|
4770
|
-
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
|
|
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
|
|
4791
|
-
return
|
|
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
|
|
4799
|
-
let n = await
|
|
4776
|
+
async function Mn(e, t) {
|
|
4777
|
+
let n = await B({
|
|
4800
4778
|
value: e.result,
|
|
4801
|
-
schema:
|
|
4779
|
+
schema: Sn
|
|
4802
4780
|
});
|
|
4803
|
-
if (!n.success) return
|
|
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
|
|
4831
|
-
return n == null ?
|
|
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:
|
|
4813
|
+
result: Fn(n, t)
|
|
4836
4814
|
};
|
|
4837
4815
|
}
|
|
4838
4816
|
}
|
|
4839
4817
|
}
|
|
4840
|
-
function
|
|
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
|
|
4852
|
-
let t = await
|
|
4829
|
+
async function Pn(e) {
|
|
4830
|
+
let t = await B({
|
|
4853
4831
|
value: e,
|
|
4854
|
-
schema:
|
|
4832
|
+
schema: we
|
|
4855
4833
|
});
|
|
4856
4834
|
if (t.success) return t.value;
|
|
4857
|
-
if (!
|
|
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
|
|
4838
|
+
let r = await B({
|
|
4861
4839
|
value: {
|
|
4862
4840
|
...e,
|
|
4863
4841
|
content: [t]
|
|
4864
4842
|
},
|
|
4865
|
-
schema:
|
|
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 (!
|
|
4848
|
+
} else if (!se(t) || typeof t.type != "string" || xn.has(t.type)) return;
|
|
4871
4849
|
}
|
|
4872
|
-
let r = await
|
|
4850
|
+
let r = await B({
|
|
4873
4851
|
value: {
|
|
4874
4852
|
...e,
|
|
4875
4853
|
content: n
|
|
4876
4854
|
},
|
|
4877
|
-
schema:
|
|
4855
|
+
schema: we
|
|
4878
4856
|
});
|
|
4879
4857
|
return r.success ? r.value : void 0;
|
|
4880
4858
|
}
|
|
4881
|
-
function
|
|
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 =
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
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:
|
|
5094
|
+
unified: Jt({ finishReason: e.stop_reason }),
|
|
5120
5095
|
raw: e.stop_reason ?? void 0
|
|
5121
5096
|
},
|
|
5122
|
-
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:
|
|
5103
|
+
providerMetadata: { anthropic: Ln(e) }
|
|
5129
5104
|
};
|
|
5130
5105
|
}
|
|
5131
|
-
function
|
|
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
|
|
5138
|
-
let t =
|
|
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:
|
|
5137
|
+
contextManagement: Rn(e.context_management)
|
|
5163
5138
|
};
|
|
5164
5139
|
}
|
|
5165
|
-
function
|
|
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
|
|
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
|
|
5165
|
+
var Bn = W(() => r(O({
|
|
5166
|
+
command: V(),
|
|
5167
|
+
restart: w().optional()
|
|
5168
|
+
}))), Vn = z({
|
|
5191
5169
|
id: "anthropic.bash_20241022",
|
|
5192
|
-
inputSchema:
|
|
5193
|
-
command: H(),
|
|
5194
|
-
restart: T().optional()
|
|
5195
|
-
})))
|
|
5170
|
+
inputSchema: Bn
|
|
5196
5171
|
});
|
|
5197
|
-
function
|
|
5172
|
+
function Hn(e = {}) {
|
|
5198
5173
|
let { execute: t, ...n } = e;
|
|
5199
|
-
return
|
|
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
|
|
5188
|
+
var Un = W(() => r(O({
|
|
5189
|
+
command: V(),
|
|
5190
|
+
restart: w().optional()
|
|
5191
|
+
}))), Wn = z({
|
|
5214
5192
|
id: "anthropic.bash_20250124",
|
|
5215
|
-
inputSchema:
|
|
5216
|
-
command: H(),
|
|
5217
|
-
restart: T().optional()
|
|
5218
|
-
})))
|
|
5193
|
+
inputSchema: Un
|
|
5219
5194
|
});
|
|
5220
|
-
function
|
|
5195
|
+
function Gn(e = {}) {
|
|
5221
5196
|
let { execute: t, ...n } = e;
|
|
5222
|
-
return
|
|
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
|
|
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:
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
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:
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
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:
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
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:
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
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:
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
}),
|
|
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:
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
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:
|
|
5401
|
-
|
|
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:
|
|
5418
|
-
})))),
|
|
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:
|
|
5421
|
-
|
|
5422
|
-
limit: I().optional()
|
|
5423
|
-
}))),
|
|
5424
|
-
outputSchema: Rn,
|
|
5398
|
+
inputSchema: sr,
|
|
5399
|
+
outputSchema: or,
|
|
5425
5400
|
supportsDeferredResults: !0
|
|
5426
|
-
}),
|
|
5427
|
-
advisor_20260301:
|
|
5428
|
-
bash_20241022:
|
|
5429
|
-
bash_20250124:
|
|
5430
|
-
codeExecution_20250522:
|
|
5431
|
-
codeExecution_20250825:
|
|
5432
|
-
codeExecution_20260120:
|
|
5433
|
-
computer_20241022:
|
|
5434
|
-
computer_20250124:
|
|
5435
|
-
computer_20251124:
|
|
5436
|
-
computerToolset_20260801:
|
|
5437
|
-
memory_20250818:
|
|
5438
|
-
textEditor_20241022:
|
|
5439
|
-
textEditor_20250124:
|
|
5440
|
-
textEditor_20250429:
|
|
5441
|
-
textEditor_20250728:
|
|
5442
|
-
webFetch_20250910:
|
|
5443
|
-
webFetch_20260209:
|
|
5444
|
-
webFetch_20260318:
|
|
5445
|
-
webSearch_20250305:
|
|
5446
|
-
webSearch_20260209:
|
|
5447
|
-
webSearch_20260318:
|
|
5448
|
-
toolSearchRegex_20251119:
|
|
5449
|
-
toolSearchBm25_20251119: (e = {}) =>
|
|
5450
|
-
},
|
|
5451
|
-
id:
|
|
5452
|
-
display_title:
|
|
5453
|
-
name:
|
|
5454
|
-
description:
|
|
5455
|
-
latest_version:
|
|
5456
|
-
source:
|
|
5457
|
-
created_at:
|
|
5458
|
-
updated_at:
|
|
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
|
-
|
|
5461
|
-
var
|
|
5462
|
-
type:
|
|
5463
|
-
skill_id:
|
|
5464
|
-
name:
|
|
5465
|
-
description:
|
|
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
|
|
5442
|
+
function fr(e) {
|
|
5468
5443
|
let t = encodeURIComponent(e);
|
|
5469
5444
|
return t === "." ? "%252E" : t === ".." ? "%252E%252E" : t;
|
|
5470
5445
|
}
|
|
5471
|
-
var
|
|
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
|
|
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/${
|
|
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(
|
|
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 =
|
|
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(
|
|
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
|
-
},
|
|
5529
|
-
function
|
|
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 ===
|
|
5506
|
+
return t === hr ? gr : t;
|
|
5532
5507
|
}
|
|
5533
|
-
function
|
|
5534
|
-
let t =
|
|
5508
|
+
function vr(e = {}) {
|
|
5509
|
+
let t = _r(re({
|
|
5535
5510
|
settingValue: e.baseURL,
|
|
5536
5511
|
environmentVariableName: "ANTHROPIC_BASE_URL"
|
|
5537
|
-
})) ??
|
|
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
|
|
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/${
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
5569
|
+
}), d.skills = u, d.tools = lr, d;
|
|
5595
5570
|
}
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
export { Yn as createAnthropic };
|
|
5571
|
+
vr();
|
|
5572
|
+
export { vr as createAnthropic };
|