@junando/worker 0.16.2 → 0.16.3
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/dist/dist-cjs-ChKmbyib.cjs +100 -0
- package/dist/event-streams-D0peAKGF.cjs +1676 -0
- package/dist/handler.cjs +3956 -2068
- package/dist/{node-DdUjbr7d.cjs → node-BZLMCJ1t.cjs} +9 -9
- package/dist/{node-CaH-Nh2c.cjs → node-DTI7Tj9K.cjs} +1 -1
- package/dist/{sdk-DKBOmAd5.cjs → sdk-DUcZIewE.cjs} +166 -162
- package/dist/serde-BKDOXNkW.cjs +6890 -0
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-BDXX5GFZ.cjs');
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
|
|
4
4
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
5
5
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
6
6
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -14,23 +14,7 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
18
|
-
/**
|
|
19
|
-
* https://stackoverflow.com/a/2117523
|
|
20
|
-
*/
|
|
21
|
-
let uuid4 = function() {
|
|
22
|
-
const { crypto } = globalThis;
|
|
23
|
-
if (crypto?.randomUUID) {
|
|
24
|
-
uuid4 = crypto.randomUUID.bind(crypto);
|
|
25
|
-
return crypto.randomUUID();
|
|
26
|
-
}
|
|
27
|
-
const u8 = new Uint8Array(1);
|
|
28
|
-
const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => Math.random() * 255 & 255;
|
|
29
|
-
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.124.0_zod@4.5.4/node_modules/@anthropic-ai/sdk/internal/errors.mjs
|
|
17
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/errors.mjs
|
|
34
18
|
function isAbortError(err) {
|
|
35
19
|
return typeof err === "object" && err !== null && ("name" in err && err.name === "AbortError" || "message" in err && String(err.message).includes("FetchRequestCanceledException"));
|
|
36
20
|
}
|
|
@@ -55,7 +39,7 @@ const castToError = (err) => {
|
|
|
55
39
|
};
|
|
56
40
|
|
|
57
41
|
//#endregion
|
|
58
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
42
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/error.mjs
|
|
59
43
|
var AnthropicError = class extends Error {};
|
|
60
44
|
var APIError = class APIError extends AnthropicError {
|
|
61
45
|
constructor(status, error, message, headers, type) {
|
|
@@ -154,7 +138,7 @@ var RateLimitError = class extends APIError {};
|
|
|
154
138
|
var InternalServerError = class extends APIError {};
|
|
155
139
|
|
|
156
140
|
//#endregion
|
|
157
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
141
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs
|
|
158
142
|
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
159
143
|
const isAbsoluteURL = (url) => {
|
|
160
144
|
return startsWithSchemeRegexp.test(url);
|
|
@@ -247,7 +231,7 @@ const pop = (obj, key) => {
|
|
|
247
231
|
function checkNever(_value) {}
|
|
248
232
|
|
|
249
233
|
//#endregion
|
|
250
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
234
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs
|
|
251
235
|
/**
|
|
252
236
|
* Resolve after `ms`, or immediately when `signal` aborts.
|
|
253
237
|
*
|
|
@@ -270,11 +254,11 @@ const sleep = (ms, signal) => new Promise((resolve) => {
|
|
|
270
254
|
});
|
|
271
255
|
|
|
272
256
|
//#endregion
|
|
273
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
274
|
-
const VERSION = "0.
|
|
257
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/version.mjs
|
|
258
|
+
const VERSION = "0.125.0";
|
|
275
259
|
|
|
276
260
|
//#endregion
|
|
277
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
261
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs
|
|
278
262
|
const isRunningInBrowser = () => {
|
|
279
263
|
return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof navigator !== "undefined";
|
|
280
264
|
};
|
|
@@ -415,7 +399,7 @@ const getPlatformHeaders = () => {
|
|
|
415
399
|
};
|
|
416
400
|
|
|
417
401
|
//#endregion
|
|
418
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
402
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs
|
|
419
403
|
/**
|
|
420
404
|
* Tracks the removal of the per-request abort listener that
|
|
421
405
|
* `fetchWithTimeout` attaches to a caller-provided signal, so the listener's
|
|
@@ -451,7 +435,13 @@ function releaseRequestSignal(controller) {
|
|
|
451
435
|
}
|
|
452
436
|
|
|
453
437
|
//#endregion
|
|
454
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
438
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/shims.mjs
|
|
439
|
+
/**
|
|
440
|
+
* This module provides internal shims and utility functions for environments where certain Node.js or global types may not be available.
|
|
441
|
+
*
|
|
442
|
+
* These are used to ensure we can provide a consistent behaviour between different JavaScript environments and good error
|
|
443
|
+
* messages in cases where an environment isn't fully supported.
|
|
444
|
+
*/
|
|
455
445
|
function getDefaultFetch() {
|
|
456
446
|
if (typeof fetch !== "undefined") {
|
|
457
447
|
return fetch;
|
|
@@ -533,7 +523,7 @@ async function CancelReadableStream(stream) {
|
|
|
533
523
|
}
|
|
534
524
|
|
|
535
525
|
//#endregion
|
|
536
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
526
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/request-options.mjs
|
|
537
527
|
/**
|
|
538
528
|
* Tracks which fallback a sequence of requests is pinned to.
|
|
539
529
|
*
|
|
@@ -551,7 +541,7 @@ const FallbackEncoder = ({ headers, body }) => {
|
|
|
551
541
|
};
|
|
552
542
|
|
|
553
543
|
//#endregion
|
|
554
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
544
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs
|
|
555
545
|
const default_format = "RFC3986";
|
|
556
546
|
const default_formatter = (v) => String(v);
|
|
557
547
|
const formatters = {
|
|
@@ -562,7 +552,7 @@ const RFC1738 = "RFC1738";
|
|
|
562
552
|
const RFC3986 = "RFC3986";
|
|
563
553
|
|
|
564
554
|
//#endregion
|
|
565
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
555
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs
|
|
566
556
|
let has = (obj, key) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj, key));
|
|
567
557
|
const hex_table = /* @__PURE__ */ (() => {
|
|
568
558
|
const array = [];
|
|
@@ -756,7 +746,7 @@ function maybe_map(val, fn) {
|
|
|
756
746
|
}
|
|
757
747
|
|
|
758
748
|
//#endregion
|
|
759
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
749
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs
|
|
760
750
|
const array_prefix_generators = {
|
|
761
751
|
brackets(prefix) {
|
|
762
752
|
return String(prefix) + "[]";
|
|
@@ -984,13 +974,13 @@ function stringify(object, opts = {}) {
|
|
|
984
974
|
}
|
|
985
975
|
|
|
986
976
|
//#endregion
|
|
987
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
977
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs
|
|
988
978
|
function stringifyQuery(query) {
|
|
989
979
|
return stringify(query, { arrayFormat: "brackets" });
|
|
990
980
|
}
|
|
991
981
|
|
|
992
982
|
//#endregion
|
|
993
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
983
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs
|
|
994
984
|
const GRANT_TYPE_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer";
|
|
995
985
|
const GRANT_TYPE_REFRESH_TOKEN = "refresh_token";
|
|
996
986
|
const TOKEN_ENDPOINT = "/v1/oauth/token";
|
|
@@ -1093,7 +1083,7 @@ function redactSensitive(body) {
|
|
|
1093
1083
|
*/
|
|
1094
1084
|
async function checkCredentialsFileSafety(path, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) {
|
|
1095
1085
|
if (typeof process === "undefined" || process.platform === "win32") return;
|
|
1096
|
-
const { fs } = await Promise.resolve().then(() => require("./node-
|
|
1086
|
+
const { fs } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1097
1087
|
let resolved = path;
|
|
1098
1088
|
let st;
|
|
1099
1089
|
try {
|
|
@@ -1119,7 +1109,7 @@ async function checkCredentialsFileSafety(path, onWarn = (m) => console.warn(`an
|
|
|
1119
1109
|
* Creates the parent directory with mode 0700 and the file with mode 0600.
|
|
1120
1110
|
*/
|
|
1121
1111
|
async function writeCredentialsFileAtomic(targetPath, data) {
|
|
1122
|
-
const { fs, path } = await Promise.resolve().then(() => require("./node-
|
|
1112
|
+
const { fs, path } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1123
1113
|
const dir = path.dirname(targetPath);
|
|
1124
1114
|
await fs.promises.mkdir(dir, {
|
|
1125
1115
|
recursive: true,
|
|
@@ -1190,14 +1180,14 @@ var WorkloadIdentityError = class extends AnthropicError {
|
|
|
1190
1180
|
};
|
|
1191
1181
|
|
|
1192
1182
|
//#endregion
|
|
1193
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1183
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs
|
|
1194
1184
|
/** Current time as unix epoch seconds. */
|
|
1195
1185
|
function nowAsSeconds() {
|
|
1196
1186
|
return Math.floor(Date.now() / 1e3);
|
|
1197
1187
|
}
|
|
1198
1188
|
|
|
1199
1189
|
//#endregion
|
|
1200
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1190
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs
|
|
1201
1191
|
/**
|
|
1202
1192
|
* Wraps an {@link AccessTokenProvider} with two-tier proactive refresh
|
|
1203
1193
|
* and concurrent deduplication.
|
|
@@ -1303,7 +1293,7 @@ var TokenCache = class {
|
|
|
1303
1293
|
};
|
|
1304
1294
|
|
|
1305
1295
|
//#endregion
|
|
1306
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1296
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs
|
|
1307
1297
|
/**
|
|
1308
1298
|
* Read an environment variable.
|
|
1309
1299
|
*
|
|
@@ -1322,7 +1312,7 @@ const readEnv = (env) => {
|
|
|
1322
1312
|
};
|
|
1323
1313
|
|
|
1324
1314
|
//#endregion
|
|
1325
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1315
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs
|
|
1326
1316
|
function concatBytes(buffers) {
|
|
1327
1317
|
let length = 0;
|
|
1328
1318
|
for (const buffer of buffers) {
|
|
@@ -1348,7 +1338,7 @@ function decodeUTF8(bytes) {
|
|
|
1348
1338
|
}
|
|
1349
1339
|
|
|
1350
1340
|
//#endregion
|
|
1351
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1341
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs
|
|
1352
1342
|
const toBase64 = (data) => {
|
|
1353
1343
|
if (!data) return "";
|
|
1354
1344
|
if (typeof globalThis.Buffer !== "undefined") {
|
|
@@ -1379,7 +1369,7 @@ const fromBase64 = (str) => {
|
|
|
1379
1369
|
};
|
|
1380
1370
|
|
|
1381
1371
|
//#endregion
|
|
1382
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1372
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs
|
|
1383
1373
|
const defaultLogLevel = "warn";
|
|
1384
1374
|
const levelNumbers = {
|
|
1385
1375
|
off: 0,
|
|
@@ -1471,7 +1461,23 @@ const formatRequestDetails = (details) => {
|
|
|
1471
1461
|
};
|
|
1472
1462
|
|
|
1473
1463
|
//#endregion
|
|
1474
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1464
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs
|
|
1465
|
+
/**
|
|
1466
|
+
* https://stackoverflow.com/a/2117523
|
|
1467
|
+
*/
|
|
1468
|
+
let uuid4 = function() {
|
|
1469
|
+
const { crypto } = globalThis;
|
|
1470
|
+
if (crypto?.randomUUID) {
|
|
1471
|
+
uuid4 = crypto.randomUUID.bind(crypto);
|
|
1472
|
+
return crypto.randomUUID();
|
|
1473
|
+
}
|
|
1474
|
+
const u8 = new Uint8Array(1);
|
|
1475
|
+
const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => Math.random() * 255 & 255;
|
|
1476
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/credentials.mjs
|
|
1475
1481
|
/** Current schema version written to `configs/<profile>.json`. Absent on read ⇒ "1.0". */
|
|
1476
1482
|
const CONFIG_FILE_VERSION = "1.0";
|
|
1477
1483
|
/** Current schema version written to `credentials/<profile>.json`. Absent on read ⇒ "1.0". */
|
|
@@ -1537,7 +1543,7 @@ const loadConfigWithSource = async (profile) => {
|
|
|
1537
1543
|
return null;
|
|
1538
1544
|
}
|
|
1539
1545
|
validateProfileName(profileName);
|
|
1540
|
-
const { fs, path } = await Promise.resolve().then(() => require("./node-
|
|
1546
|
+
const { fs, path } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1541
1547
|
const configPath = path.join(rootConfigPath, "configs", `${profileName}.json`);
|
|
1542
1548
|
let configRaw;
|
|
1543
1549
|
try {
|
|
@@ -1632,7 +1638,7 @@ const loadCredentials = async () => {
|
|
|
1632
1638
|
if (!credentialsPath) {
|
|
1633
1639
|
return null;
|
|
1634
1640
|
}
|
|
1635
|
-
const { fs } = await Promise.resolve().then(() => require("./node-
|
|
1641
|
+
const { fs } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1636
1642
|
let raw;
|
|
1637
1643
|
try {
|
|
1638
1644
|
raw = await fs.promises.readFile(credentialsPath, "utf-8");
|
|
@@ -1674,14 +1680,14 @@ const getCredentialsPath = async (config, profile) => {
|
|
|
1674
1680
|
return null;
|
|
1675
1681
|
}
|
|
1676
1682
|
validateProfileName(profileName);
|
|
1677
|
-
const { path } = await Promise.resolve().then(() => require("./node-
|
|
1683
|
+
const { path } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1678
1684
|
return path.join(rootConfigPath, "credentials", `${profileName}.json`);
|
|
1679
1685
|
};
|
|
1680
1686
|
const getRootConfigPath = async () => {
|
|
1681
1687
|
if (!supportsLocalConfigFiles()) {
|
|
1682
1688
|
return null;
|
|
1683
1689
|
}
|
|
1684
|
-
const { path } = await Promise.resolve().then(() => require("./node-
|
|
1690
|
+
const { path } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1685
1691
|
const configDir = readEnv("ANTHROPIC_CONFIG_DIR");
|
|
1686
1692
|
if (configDir) {
|
|
1687
1693
|
return configDir;
|
|
@@ -1721,7 +1727,7 @@ const getActiveProfileName = async () => {
|
|
|
1721
1727
|
if (profileName) {
|
|
1722
1728
|
return profileName;
|
|
1723
1729
|
}
|
|
1724
|
-
const { fs, path } = await Promise.resolve().then(() => require("./node-
|
|
1730
|
+
const { fs, path } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1725
1731
|
const filePath = path.join(rootConfigPath, "active_config");
|
|
1726
1732
|
try {
|
|
1727
1733
|
return (await fs.promises.readFile(filePath, "utf-8")).trim() || "default";
|
|
@@ -1734,7 +1740,7 @@ const getActiveProfileName = async () => {
|
|
|
1734
1740
|
};
|
|
1735
1741
|
|
|
1736
1742
|
//#endregion
|
|
1737
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1743
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs
|
|
1738
1744
|
/**
|
|
1739
1745
|
* Reads a JWT from a file on every call. Supports automatic rotation
|
|
1740
1746
|
* (e.g. Kubernetes projected service-account tokens).
|
|
@@ -1744,7 +1750,7 @@ function identityTokenFromFile(path) {
|
|
|
1744
1750
|
throw new AnthropicError("Identity token file path is empty");
|
|
1745
1751
|
}
|
|
1746
1752
|
return async () => {
|
|
1747
|
-
const { fs } = await Promise.resolve().then(() => require("./node-
|
|
1753
|
+
const { fs } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1748
1754
|
let content;
|
|
1749
1755
|
try {
|
|
1750
1756
|
content = await fs.promises.readFile(path, "utf-8");
|
|
@@ -1769,7 +1775,7 @@ function identityTokenFromValue(token) {
|
|
|
1769
1775
|
}
|
|
1770
1776
|
|
|
1771
1777
|
//#endregion
|
|
1772
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1778
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs
|
|
1773
1779
|
/**
|
|
1774
1780
|
* Exchanges an external OIDC JWT for an Anthropic access token via the
|
|
1775
1781
|
* RFC 7523 jwt-bearer grant.
|
|
@@ -1807,7 +1813,7 @@ function oidcFederationProvider(config) {
|
|
|
1807
1813
|
headers: {
|
|
1808
1814
|
"Content-Type": "application/json",
|
|
1809
1815
|
"anthropic-beta": `${OAUTH_API_BETA_HEADER},${FEDERATION_BETA_HEADER}`,
|
|
1810
|
-
"User-Agent": config.userAgent || `anthropic-sdk-typescript/${"0.
|
|
1816
|
+
"User-Agent": config.userAgent || `anthropic-sdk-typescript/${"0.125.0"} oidcFederationProvider`
|
|
1811
1817
|
},
|
|
1812
1818
|
body: JSON.stringify(body)
|
|
1813
1819
|
});
|
|
@@ -1838,7 +1844,7 @@ function oidcFederationProvider(config) {
|
|
|
1838
1844
|
}
|
|
1839
1845
|
|
|
1840
1846
|
//#endregion
|
|
1841
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1847
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs
|
|
1842
1848
|
/**
|
|
1843
1849
|
* Reads a user-oauth credential file. Returns the cached access token while
|
|
1844
1850
|
* fresh; on expiry performs a `refresh_token` grant and writes the new
|
|
@@ -1850,7 +1856,7 @@ function oidcFederationProvider(config) {
|
|
|
1850
1856
|
*/
|
|
1851
1857
|
function userOAuthProvider(config) {
|
|
1852
1858
|
return async (opts) => {
|
|
1853
|
-
const { fs } = await Promise.resolve().then(() => require("./node-
|
|
1859
|
+
const { fs } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
1854
1860
|
await checkCredentialsFileSafety(config.credentialsPath, config.onSafetyWarning);
|
|
1855
1861
|
let raw;
|
|
1856
1862
|
try {
|
|
@@ -1893,7 +1899,7 @@ function userOAuthProvider(config) {
|
|
|
1893
1899
|
headers: {
|
|
1894
1900
|
"Content-Type": "application/json",
|
|
1895
1901
|
"anthropic-beta": OAUTH_API_BETA_HEADER,
|
|
1896
|
-
"User-Agent": config.userAgent || `anthropic-sdk-typescript/${"0.
|
|
1902
|
+
"User-Agent": config.userAgent || `anthropic-sdk-typescript/${"0.125.0"} userOAuthProvider`
|
|
1897
1903
|
},
|
|
1898
1904
|
body: JSON.stringify(body)
|
|
1899
1905
|
});
|
|
@@ -1928,7 +1934,7 @@ function userOAuthProvider(config) {
|
|
|
1928
1934
|
}
|
|
1929
1935
|
|
|
1930
1936
|
//#endregion
|
|
1931
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
1937
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs
|
|
1932
1938
|
function resolveCredentialsFromConfig(config, options) {
|
|
1933
1939
|
const credentialsPath = config.authentication.credentials_path ?? null;
|
|
1934
1940
|
const effectiveBaseURL = (config.base_url || options.baseURL).replace(/\/+$/, "");
|
|
@@ -2062,7 +2068,7 @@ function resolveIdentityTokenProvider(auth) {
|
|
|
2062
2068
|
*/
|
|
2063
2069
|
function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) {
|
|
2064
2070
|
return async (opts) => {
|
|
2065
|
-
const { fs } = await Promise.resolve().then(() => require("./node-
|
|
2071
|
+
const { fs } = await Promise.resolve().then(() => require("./node-DTI7Tj9K.cjs")).then((n) => n.node_exports);
|
|
2066
2072
|
await checkCredentialsFileSafety(credentialsPath, onSafetyWarning);
|
|
2067
2073
|
let existing;
|
|
2068
2074
|
try {
|
|
@@ -2101,7 +2107,7 @@ function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, on
|
|
|
2101
2107
|
}
|
|
2102
2108
|
|
|
2103
2109
|
//#endregion
|
|
2104
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2110
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs
|
|
2105
2111
|
var _LineDecoder_buffer;
|
|
2106
2112
|
var _LineDecoder_carriageReturnIndex;
|
|
2107
2113
|
/**
|
|
@@ -2202,7 +2208,7 @@ function findDoubleNewlineIndex(buffer) {
|
|
|
2202
2208
|
}
|
|
2203
2209
|
|
|
2204
2210
|
//#endregion
|
|
2205
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2211
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/streaming.mjs
|
|
2206
2212
|
var _Stream_client;
|
|
2207
2213
|
var Stream = class Stream {
|
|
2208
2214
|
constructor(iterator, controller, client) {
|
|
@@ -2464,7 +2470,7 @@ function partition(str, delimiter) {
|
|
|
2464
2470
|
}
|
|
2465
2471
|
|
|
2466
2472
|
//#endregion
|
|
2467
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2473
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/parse.mjs
|
|
2468
2474
|
async function defaultParseResponse(client, props) {
|
|
2469
2475
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
2470
2476
|
const body = await (async () => {
|
|
@@ -2522,7 +2528,7 @@ function addResponseIDs(value, response) {
|
|
|
2522
2528
|
}
|
|
2523
2529
|
|
|
2524
2530
|
//#endregion
|
|
2525
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2531
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/middleware.mjs
|
|
2526
2532
|
/**
|
|
2527
2533
|
* Errors thrown by the underlying `fetch`, as opposed to by a middleware.
|
|
2528
2534
|
*
|
|
@@ -2658,7 +2664,7 @@ function applyMiddleware(fetchFn, middleware, options, client) {
|
|
|
2658
2664
|
}
|
|
2659
2665
|
|
|
2660
2666
|
//#endregion
|
|
2661
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2667
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/api-promise.mjs
|
|
2662
2668
|
var _APIPromise_client;
|
|
2663
2669
|
/**
|
|
2664
2670
|
* A subclass of `Promise` providing additional helper methods
|
|
@@ -2731,7 +2737,7 @@ var APIPromise = class APIPromise extends Promise {
|
|
|
2731
2737
|
_APIPromise_client = new WeakMap();
|
|
2732
2738
|
|
|
2733
2739
|
//#endregion
|
|
2734
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2740
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/pagination.mjs
|
|
2735
2741
|
var _AbstractPage_client;
|
|
2736
2742
|
var AbstractPage = class {
|
|
2737
2743
|
constructor(client, response, body, options) {
|
|
@@ -2919,7 +2925,7 @@ var BidirectionalPageCursor = class extends AbstractPage {
|
|
|
2919
2925
|
};
|
|
2920
2926
|
|
|
2921
2927
|
//#endregion
|
|
2922
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
2928
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/uploads.mjs
|
|
2923
2929
|
const checkFileSupport = () => {
|
|
2924
2930
|
if (typeof File === "undefined") {
|
|
2925
2931
|
const { process } = globalThis;
|
|
@@ -3034,7 +3040,7 @@ const addFormValue = async (form, key, value, stripFilenames) => {
|
|
|
3034
3040
|
};
|
|
3035
3041
|
|
|
3036
3042
|
//#endregion
|
|
3037
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3043
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/to-file.mjs
|
|
3038
3044
|
/**
|
|
3039
3045
|
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
3040
3046
|
*/
|
|
@@ -3107,7 +3113,7 @@ function propsForError(value) {
|
|
|
3107
3113
|
}
|
|
3108
3114
|
|
|
3109
3115
|
//#endregion
|
|
3110
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3116
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/core/resource.mjs
|
|
3111
3117
|
var APIResource = class {
|
|
3112
3118
|
constructor(client) {
|
|
3113
3119
|
this._client = client;
|
|
@@ -3115,7 +3121,7 @@ var APIResource = class {
|
|
|
3115
3121
|
};
|
|
3116
3122
|
|
|
3117
3123
|
//#endregion
|
|
3118
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3124
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/headers.mjs
|
|
3119
3125
|
const brand_privateNullableHeaders = Symbol.for("brand.privateNullableHeaders");
|
|
3120
3126
|
function* iterateHeaders(headers) {
|
|
3121
3127
|
if (!headers) return;
|
|
@@ -3211,7 +3217,7 @@ const isEmptyHeaders = (headers) => {
|
|
|
3211
3217
|
};
|
|
3212
3218
|
|
|
3213
3219
|
//#endregion
|
|
3214
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3220
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs
|
|
3215
3221
|
/**
|
|
3216
3222
|
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
3217
3223
|
*
|
|
@@ -3273,7 +3279,7 @@ const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(sta
|
|
|
3273
3279
|
const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
3274
3280
|
|
|
3275
3281
|
//#endregion
|
|
3276
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3282
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs
|
|
3277
3283
|
var DeploymentRuns = class extends APIResource {
|
|
3278
3284
|
/**
|
|
3279
3285
|
* Get Deployment Run
|
|
@@ -3321,7 +3327,7 @@ var DeploymentRuns = class extends APIResource {
|
|
|
3321
3327
|
};
|
|
3322
3328
|
|
|
3323
3329
|
//#endregion
|
|
3324
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3330
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs
|
|
3325
3331
|
var Deployments = class extends APIResource {
|
|
3326
3332
|
/**
|
|
3327
3333
|
* Create Deployment
|
|
@@ -3510,7 +3516,7 @@ var Deployments = class extends APIResource {
|
|
|
3510
3516
|
};
|
|
3511
3517
|
|
|
3512
3518
|
//#endregion
|
|
3513
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3519
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs
|
|
3514
3520
|
var Dreams = class extends APIResource {
|
|
3515
3521
|
/**
|
|
3516
3522
|
* Create a Dream
|
|
@@ -3619,7 +3625,7 @@ var Dreams = class extends APIResource {
|
|
|
3619
3625
|
};
|
|
3620
3626
|
|
|
3621
3627
|
//#endregion
|
|
3622
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3628
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs
|
|
3623
3629
|
/**
|
|
3624
3630
|
* Single source of truth for the `x-stainless-helper` telemetry header — the
|
|
3625
3631
|
* key, the closed value vocabulary, and per-object helper tagging. The
|
|
@@ -3701,7 +3707,7 @@ function stainlessHelperHeaderFromFile(file) {
|
|
|
3701
3707
|
}
|
|
3702
3708
|
|
|
3703
3709
|
//#endregion
|
|
3704
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3710
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs
|
|
3705
3711
|
var Files$1 = class extends APIResource {
|
|
3706
3712
|
/**
|
|
3707
3713
|
* List Files
|
|
@@ -3817,7 +3823,7 @@ var Files$1 = class extends APIResource {
|
|
|
3817
3823
|
};
|
|
3818
3824
|
|
|
3819
3825
|
//#endregion
|
|
3820
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3826
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs
|
|
3821
3827
|
var Models$1 = class extends APIResource {
|
|
3822
3828
|
/**
|
|
3823
3829
|
* Get a specific model.
|
|
@@ -3870,7 +3876,7 @@ var Models$1 = class extends APIResource {
|
|
|
3870
3876
|
};
|
|
3871
3877
|
|
|
3872
3878
|
//#endregion
|
|
3873
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
3879
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs
|
|
3874
3880
|
var UserProfiles = class extends APIResource {
|
|
3875
3881
|
/**
|
|
3876
3882
|
* Create User Profile
|
|
@@ -4748,7 +4754,7 @@ var require_dist = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((expo
|
|
|
4748
4754
|
}));
|
|
4749
4755
|
|
|
4750
4756
|
//#endregion
|
|
4751
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
4757
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs
|
|
4752
4758
|
var import_dist = require_dist();
|
|
4753
4759
|
var Webhooks = class extends APIResource {
|
|
4754
4760
|
/**
|
|
@@ -4775,7 +4781,7 @@ var Webhooks = class extends APIResource {
|
|
|
4775
4781
|
};
|
|
4776
4782
|
|
|
4777
4783
|
//#endregion
|
|
4778
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
4784
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs
|
|
4779
4785
|
var Versions$2 = class extends APIResource {
|
|
4780
4786
|
/**
|
|
4781
4787
|
* List Agent Versions
|
|
@@ -4804,7 +4810,7 @@ var Versions$2 = class extends APIResource {
|
|
|
4804
4810
|
};
|
|
4805
4811
|
|
|
4806
4812
|
//#endregion
|
|
4807
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
4813
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs
|
|
4808
4814
|
var Agents = class extends APIResource {
|
|
4809
4815
|
constructor() {
|
|
4810
4816
|
super(...arguments);
|
|
@@ -4925,7 +4931,7 @@ var Agents = class extends APIResource {
|
|
|
4925
4931
|
Agents.Versions = Versions$2;
|
|
4926
4932
|
|
|
4927
4933
|
//#endregion
|
|
4928
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
4934
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs
|
|
4929
4935
|
/**
|
|
4930
4936
|
* Chain an external {@link AbortSignal} into a local {@link AbortController}:
|
|
4931
4937
|
* the controller aborts whenever `external` aborts (synchronously if it is
|
|
@@ -4949,7 +4955,7 @@ function linkAbort(external, controller) {
|
|
|
4949
4955
|
}
|
|
4950
4956
|
|
|
4951
4957
|
//#endregion
|
|
4952
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
4958
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs
|
|
4953
4959
|
/** True when `e` is an {@link APIError} whose HTTP status equals `code`. */
|
|
4954
4960
|
function isStatus(e, code) {
|
|
4955
4961
|
return e instanceof APIError && e.status === code;
|
|
@@ -4986,7 +4992,7 @@ function applyJitter(ms) {
|
|
|
4986
4992
|
}
|
|
4987
4993
|
|
|
4988
4994
|
//#endregion
|
|
4989
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
4995
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs
|
|
4990
4996
|
/**
|
|
4991
4997
|
* Return a `withOptions()` clone of `client` set up for use *by* one of the
|
|
4992
4998
|
* runner helpers: authenticated with `authToken` as Bearer credentials, with
|
|
@@ -5037,7 +5043,7 @@ function copyClientForHelper(client, { authToken, helper }) {
|
|
|
5037
5043
|
}
|
|
5038
5044
|
|
|
5039
5045
|
//#endregion
|
|
5040
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
5046
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs
|
|
5041
5047
|
var _WorkPoller_runnerClient;
|
|
5042
5048
|
var _WorkPoller_consumed;
|
|
5043
5049
|
var _WorkPoller_controller;
|
|
@@ -5243,7 +5249,7 @@ function defaultWorkerId() {
|
|
|
5243
5249
|
}
|
|
5244
5250
|
|
|
5245
5251
|
//#endregion
|
|
5246
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
5252
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs
|
|
5247
5253
|
var _AsyncQueue_items;
|
|
5248
5254
|
var _AsyncQueue_waiters;
|
|
5249
5255
|
var _AsyncQueue_closed;
|
|
@@ -5327,7 +5333,7 @@ var AsyncQueue = class {
|
|
|
5327
5333
|
_AsyncQueue_items = new WeakMap(), _AsyncQueue_waiters = new WeakMap(), _AsyncQueue_closed = new WeakMap();
|
|
5328
5334
|
|
|
5329
5335
|
//#endregion
|
|
5330
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
5336
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs
|
|
5331
5337
|
/**
|
|
5332
5338
|
* An error that can be thrown from a tool's `run` method to return structured
|
|
5333
5339
|
* content blocks as the error result, rather than just a string message.
|
|
@@ -5364,7 +5370,7 @@ var ToolError = class extends Error {
|
|
|
5364
5370
|
};
|
|
5365
5371
|
|
|
5366
5372
|
//#endregion
|
|
5367
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
5373
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs
|
|
5368
5374
|
/**
|
|
5369
5375
|
* The name the model calls a tool by: `mcp_server_name` for MCP toolsets, `type` for nameless server
|
|
5370
5376
|
* toolsets (browser/computer), `name` for everything else.
|
|
@@ -5394,7 +5400,7 @@ async function runRunnableTool(tool, rawInput, context) {
|
|
|
5394
5400
|
}
|
|
5395
5401
|
|
|
5396
5402
|
//#endregion
|
|
5397
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
5403
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs
|
|
5398
5404
|
var _IdleClock_maxIdleMs;
|
|
5399
5405
|
var _IdleClock_onExpire;
|
|
5400
5406
|
var _IdleClock_blockers;
|
|
@@ -5988,7 +5994,7 @@ function toSessionContent(content) {
|
|
|
5988
5994
|
}
|
|
5989
5995
|
|
|
5990
5996
|
//#endregion
|
|
5991
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
5997
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs
|
|
5992
5998
|
/**
|
|
5993
5999
|
* The memory sync cadence, split out of `memories.ts` so runtime-agnostic
|
|
5994
6000
|
* callers (the environment worker) can validate an interval up front without
|
|
@@ -6013,7 +6019,7 @@ function checkMemorySyncInterval(ms, option) {
|
|
|
6013
6019
|
}
|
|
6014
6020
|
|
|
6015
6021
|
//#endregion
|
|
6016
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
6022
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs
|
|
6017
6023
|
var _EnvironmentWorker_instances;
|
|
6018
6024
|
var _EnvironmentWorker_signal;
|
|
6019
6025
|
var _EnvironmentWorker_handleItem;
|
|
@@ -6161,9 +6167,13 @@ var EnvironmentWorker = class {
|
|
|
6161
6167
|
* `ANTHROPIC_ENVIRONMENT_ID` / `ANTHROPIC_SESSION_ID` (the env vars that
|
|
6162
6168
|
* command sets) when not passed; the environment key resolves from this
|
|
6163
6169
|
* option, then the worker's own `environmentKey`, then
|
|
6164
|
-
* `ANTHROPIC_ENVIRONMENT_KEY
|
|
6165
|
-
*
|
|
6166
|
-
*
|
|
6170
|
+
* `ANTHROPIC_ENVIRONMENT_KEY`, and is needed only when the work item's
|
|
6171
|
+
* `secret` yields no sessions token — a host that receives only the
|
|
6172
|
+
* per-item secret runs without ever holding the key. With no arguments
|
|
6173
|
+
* inside that command it just works. Throws a clear error naming the first
|
|
6174
|
+
* required value still missing after resolution, and — rather than ever
|
|
6175
|
+
* running unauthenticated — when neither a sessions token nor an
|
|
6176
|
+
* environment key resolved. Throws `SessionMemoryError` when the
|
|
6167
6177
|
* session has memory stores attached but they cannot be mounted — the work
|
|
6168
6178
|
* item carried no sessions token (unless `memorySyncIntervalMs` turned
|
|
6169
6179
|
* memory off), or a store failed to download.
|
|
@@ -6178,7 +6188,7 @@ var EnvironmentWorker = class {
|
|
|
6178
6188
|
const workId = opts?.workId ?? readEnv("ANTHROPIC_WORK_ID");
|
|
6179
6189
|
const environmentId = opts?.environmentId ?? readEnv("ANTHROPIC_ENVIRONMENT_ID");
|
|
6180
6190
|
const sessionId = opts?.sessionId ?? readEnv("ANTHROPIC_SESSION_ID");
|
|
6181
|
-
const environmentKey = opts?.environmentKey ?? this.environmentKey ?? readEnv("ANTHROPIC_ENVIRONMENT_KEY");
|
|
6191
|
+
const environmentKey = (opts?.environmentKey ?? this.environmentKey ?? readEnv("ANTHROPIC_ENVIRONMENT_KEY")) || undefined;
|
|
6182
6192
|
const workSecret = opts?.workSecret || readEnv("ANTHROPIC_WORK_SECRET") || null;
|
|
6183
6193
|
if (!workId) {
|
|
6184
6194
|
throw new AnthropicError("handleItem: workId is required — pass it or set ANTHROPIC_WORK_ID");
|
|
@@ -6189,8 +6199,8 @@ var EnvironmentWorker = class {
|
|
|
6189
6199
|
if (!sessionId) {
|
|
6190
6200
|
throw new AnthropicError("handleItem: sessionId is required — pass it or set ANTHROPIC_SESSION_ID");
|
|
6191
6201
|
}
|
|
6192
|
-
if (!environmentKey) {
|
|
6193
|
-
throw new AnthropicError("handleItem: environmentKey is required — pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");
|
|
6202
|
+
if (!environmentKey && !workSecret) {
|
|
6203
|
+
throw new AnthropicError("handleItem: environmentKey is required when there is no work secret — pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");
|
|
6194
6204
|
}
|
|
6195
6205
|
const work = {
|
|
6196
6206
|
id: workId,
|
|
@@ -6207,10 +6217,13 @@ var EnvironmentWorker = class {
|
|
|
6207
6217
|
_EnvironmentWorker_signal = new WeakMap(), _EnvironmentWorker_instances = new WeakSet(), _EnvironmentWorker_handleItem = async function _EnvironmentWorker_handleItem(work, environmentKey, externalSignal) {
|
|
6208
6218
|
const log = loggerFor(this.client);
|
|
6209
6219
|
const sessionsToken = sessionsTokenFromSecret(work.secret);
|
|
6220
|
+
const itemCredential = sessionsToken ?? environmentKey;
|
|
6221
|
+
if (itemCredential === undefined) {
|
|
6222
|
+
throw new AnthropicError("handleItem: the work item carried a secret payload but no sessions token could be extracted, " + "and there is no environment key to fall back to; the poller must issue a secret whose " + "payload carries `sessions_token`, or provide the environment key (pass it, construct the " + "worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");
|
|
6223
|
+
}
|
|
6210
6224
|
if (work.secret && sessionsToken === null) {
|
|
6211
6225
|
log.warn("work item carried a secret payload but no sessions token could be extracted; " + "falling back to the environment key", { work_id: work.id });
|
|
6212
6226
|
}
|
|
6213
|
-
const itemCredential = sessionsToken ?? environmentKey;
|
|
6214
6227
|
const sessionClient = copyClientForHelper(this.client, {
|
|
6215
6228
|
authToken: itemCredential,
|
|
6216
6229
|
helper: "environments-worker"
|
|
@@ -6219,7 +6232,7 @@ _EnvironmentWorker_signal = new WeakMap(), _EnvironmentWorker_instances = new We
|
|
|
6219
6232
|
const ctrl = new AbortController();
|
|
6220
6233
|
const detachExternal = linkAbort(externalSignal, ctrl);
|
|
6221
6234
|
const lease = new Lease(ctrl);
|
|
6222
|
-
const agentToolset = await Promise.resolve().then(() => require("./node-
|
|
6235
|
+
const agentToolset = await Promise.resolve().then(() => require("./node-BZLMCJ1t.cjs"));
|
|
6223
6236
|
let leaseTtlMs;
|
|
6224
6237
|
let runner;
|
|
6225
6238
|
const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => {
|
|
@@ -6504,7 +6517,7 @@ async function heartbeatLoop(client, work, lease, logger, requestOptions, onLeas
|
|
|
6504
6517
|
}
|
|
6505
6518
|
|
|
6506
6519
|
//#endregion
|
|
6507
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
6520
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs
|
|
6508
6521
|
var Work = class extends APIResource {
|
|
6509
6522
|
/**
|
|
6510
6523
|
* Note: these endpoints are called automatically by the pre-built environment
|
|
@@ -6745,7 +6758,7 @@ Work.WorkPoller = WorkPoller;
|
|
|
6745
6758
|
Work.EnvironmentWorker = EnvironmentWorker;
|
|
6746
6759
|
|
|
6747
6760
|
//#endregion
|
|
6748
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
6761
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs
|
|
6749
6762
|
var Environments = class extends APIResource {
|
|
6750
6763
|
constructor() {
|
|
6751
6764
|
super(...arguments);
|
|
@@ -6885,7 +6898,7 @@ var Environments = class extends APIResource {
|
|
|
6885
6898
|
Environments.Work = Work;
|
|
6886
6899
|
|
|
6887
6900
|
//#endregion
|
|
6888
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
6901
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs
|
|
6889
6902
|
var Memories = class extends APIResource {
|
|
6890
6903
|
/**
|
|
6891
6904
|
* Create a memory
|
|
@@ -7008,7 +7021,7 @@ var Memories = class extends APIResource {
|
|
|
7008
7021
|
};
|
|
7009
7022
|
|
|
7010
7023
|
//#endregion
|
|
7011
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7024
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs
|
|
7012
7025
|
var MemoryVersions = class extends APIResource {
|
|
7013
7026
|
/**
|
|
7014
7027
|
* Retrieve a memory version
|
|
@@ -7082,7 +7095,7 @@ var MemoryVersions = class extends APIResource {
|
|
|
7082
7095
|
};
|
|
7083
7096
|
|
|
7084
7097
|
//#endregion
|
|
7085
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7098
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs
|
|
7086
7099
|
var MemoryStores = class extends APIResource {
|
|
7087
7100
|
constructor() {
|
|
7088
7101
|
super(...arguments);
|
|
@@ -7215,7 +7228,7 @@ MemoryStores.Memories = Memories;
|
|
|
7215
7228
|
MemoryStores.MemoryVersions = MemoryVersions;
|
|
7216
7229
|
|
|
7217
7230
|
//#endregion
|
|
7218
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7231
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs
|
|
7219
7232
|
var JSONLDecoder = class JSONLDecoder {
|
|
7220
7233
|
constructor(iterator, controller) {
|
|
7221
7234
|
this.iterator = iterator;
|
|
@@ -7248,7 +7261,7 @@ var JSONLDecoder = class JSONLDecoder {
|
|
|
7248
7261
|
};
|
|
7249
7262
|
|
|
7250
7263
|
//#endregion
|
|
7251
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7264
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs
|
|
7252
7265
|
var Batches$1 = class extends APIResource {
|
|
7253
7266
|
/**
|
|
7254
7267
|
* Send a batch of Message creation requests.
|
|
@@ -7440,7 +7453,7 @@ var Batches$1 = class extends APIResource {
|
|
|
7440
7453
|
};
|
|
7441
7454
|
|
|
7442
7455
|
//#endregion
|
|
7443
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7456
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/constants.mjs
|
|
7444
7457
|
/**
|
|
7445
7458
|
* Model-specific timeout constraints for non-streaming requests
|
|
7446
7459
|
*/
|
|
@@ -7451,7 +7464,7 @@ const MODEL_NONSTREAMING_TOKENS = {
|
|
|
7451
7464
|
};
|
|
7452
7465
|
|
|
7453
7466
|
//#endregion
|
|
7454
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7467
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs
|
|
7455
7468
|
function getOutputFormat$1(params) {
|
|
7456
7469
|
return params?.output_format ?? params?.output_config?.format;
|
|
7457
7470
|
}
|
|
@@ -7525,7 +7538,7 @@ function parseBetaOutputFormat(params, content) {
|
|
|
7525
7538
|
}
|
|
7526
7539
|
|
|
7527
7540
|
//#endregion
|
|
7528
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7541
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs
|
|
7529
7542
|
const tokenize = (input) => {
|
|
7530
7543
|
let current = 0;
|
|
7531
7544
|
let tokens = [];
|
|
@@ -7746,7 +7759,7 @@ const generate = (tokens) => {
|
|
|
7746
7759
|
const partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input)))));
|
|
7747
7760
|
|
|
7748
7761
|
//#endregion
|
|
7749
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7762
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs
|
|
7750
7763
|
const JSON_BUF_PROPERTY = "__json_buf";
|
|
7751
7764
|
/**
|
|
7752
7765
|
* Copies a tool-use block with an updated `__json_buf`, installing `.input` as
|
|
@@ -7780,7 +7793,7 @@ function withLazyInput(prev, jsonBuf) {
|
|
|
7780
7793
|
}
|
|
7781
7794
|
|
|
7782
7795
|
//#endregion
|
|
7783
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
7796
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs
|
|
7784
7797
|
var _BetaMessageStream_instances;
|
|
7785
7798
|
var _BetaMessageStream_currentMessageSnapshot;
|
|
7786
7799
|
var _BetaMessageStream_params;
|
|
@@ -8451,7 +8464,7 @@ var BetaMessageStream = class BetaMessageStream {
|
|
|
8451
8464
|
};
|
|
8452
8465
|
|
|
8453
8466
|
//#endregion
|
|
8454
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
8467
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs
|
|
8455
8468
|
/**
|
|
8456
8469
|
* A deferred: a `Promise` together with its `resolve` / `reject` functions.
|
|
8457
8470
|
* This is `Promise.withResolvers()`, which is not available in all supported
|
|
@@ -8472,7 +8485,7 @@ function promiseWithResolvers() {
|
|
|
8472
8485
|
}
|
|
8473
8486
|
|
|
8474
8487
|
//#endregion
|
|
8475
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
8488
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.mjs
|
|
8476
8489
|
const DEFAULT_TOKEN_THRESHOLD = 1e5;
|
|
8477
8490
|
const DEFAULT_SUMMARY_PROMPT = `You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
8478
8491
|
1. Task Overview
|
|
@@ -8499,7 +8512,7 @@ Be concise but complete—err on the side of including information that would pr
|
|
|
8499
8512
|
Wrap your summary in <summary></summary> tags.`;
|
|
8500
8513
|
|
|
8501
8514
|
//#endregion
|
|
8502
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
8515
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs
|
|
8503
8516
|
var _BetaToolRunner_instances;
|
|
8504
8517
|
var _BetaToolRunner_consumed;
|
|
8505
8518
|
var _BetaToolRunner_mutated;
|
|
@@ -8946,7 +8959,7 @@ function determineNextStepFromStopReason(stopReason) {
|
|
|
8946
8959
|
}
|
|
8947
8960
|
|
|
8948
8961
|
//#endregion
|
|
8949
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
8962
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs
|
|
8950
8963
|
const DEPRECATED_MODELS$1 = {};
|
|
8951
8964
|
const MODELS_TO_WARN_WITH_THINKING_ENABLED$1 = ["claude-mythos-preview", "claude-opus-4-6"];
|
|
8952
8965
|
var Messages$1 = class extends APIResource {
|
|
@@ -9074,7 +9087,7 @@ Messages$1.BetaToolRunner = BetaToolRunner;
|
|
|
9074
9087
|
Messages$1.ToolError = ToolError;
|
|
9075
9088
|
|
|
9076
9089
|
//#endregion
|
|
9077
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9090
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs
|
|
9078
9091
|
var APIKeys = class extends APIResource {
|
|
9079
9092
|
/**
|
|
9080
9093
|
* Get API Key
|
|
@@ -9127,7 +9140,7 @@ var APIKeys = class extends APIResource {
|
|
|
9127
9140
|
};
|
|
9128
9141
|
|
|
9129
9142
|
//#endregion
|
|
9130
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9143
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs
|
|
9131
9144
|
var ComplianceSettings = class extends APIResource {
|
|
9132
9145
|
/**
|
|
9133
9146
|
* Retrieve your organization's Compliance Settings.
|
|
@@ -9178,7 +9191,7 @@ var ComplianceSettings = class extends APIResource {
|
|
|
9178
9191
|
};
|
|
9179
9192
|
|
|
9180
9193
|
//#endregion
|
|
9181
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9194
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs
|
|
9182
9195
|
var ExternalKeys = class extends APIResource {
|
|
9183
9196
|
/**
|
|
9184
9197
|
* Create an external key config owned by the caller's organization.
|
|
@@ -9294,7 +9307,7 @@ var ExternalKeys = class extends APIResource {
|
|
|
9294
9307
|
};
|
|
9295
9308
|
|
|
9296
9309
|
//#endregion
|
|
9297
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9310
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs
|
|
9298
9311
|
var Invites = class extends APIResource {
|
|
9299
9312
|
/**
|
|
9300
9313
|
* Invite a user to join the organization by email.
|
|
@@ -9367,7 +9380,7 @@ var Invites = class extends APIResource {
|
|
|
9367
9380
|
};
|
|
9368
9381
|
|
|
9369
9382
|
//#endregion
|
|
9370
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9383
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs
|
|
9371
9384
|
var RateLimits$1 = class extends APIResource {
|
|
9372
9385
|
/**
|
|
9373
9386
|
* List Messages API rate limits for your organization.
|
|
@@ -9396,7 +9409,7 @@ var RateLimits$1 = class extends APIResource {
|
|
|
9396
9409
|
};
|
|
9397
9410
|
|
|
9398
9411
|
//#endregion
|
|
9399
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9412
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs
|
|
9400
9413
|
var Users = class extends APIResource {
|
|
9401
9414
|
/**
|
|
9402
9415
|
* Retrieve a member of the organization by user ID.
|
|
@@ -9460,7 +9473,7 @@ var Users = class extends APIResource {
|
|
|
9460
9473
|
};
|
|
9461
9474
|
|
|
9462
9475
|
//#endregion
|
|
9463
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9476
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs
|
|
9464
9477
|
var Issuers = class extends APIResource {
|
|
9465
9478
|
/**
|
|
9466
9479
|
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
@@ -9607,7 +9620,7 @@ var Issuers = class extends APIResource {
|
|
|
9607
9620
|
};
|
|
9608
9621
|
|
|
9609
9622
|
//#endregion
|
|
9610
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9623
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs
|
|
9611
9624
|
var Workspaces$2 = class extends APIResource {
|
|
9612
9625
|
/**
|
|
9613
9626
|
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
@@ -9705,7 +9718,7 @@ var Workspaces$2 = class extends APIResource {
|
|
|
9705
9718
|
};
|
|
9706
9719
|
|
|
9707
9720
|
//#endregion
|
|
9708
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9721
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs
|
|
9709
9722
|
var Rules = class extends APIResource {
|
|
9710
9723
|
constructor() {
|
|
9711
9724
|
super(...arguments);
|
|
@@ -9878,7 +9891,7 @@ var Rules = class extends APIResource {
|
|
|
9878
9891
|
Rules.Workspaces = Workspaces$2;
|
|
9879
9892
|
|
|
9880
9893
|
//#endregion
|
|
9881
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9894
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs
|
|
9882
9895
|
var Federation = class extends APIResource {
|
|
9883
9896
|
constructor() {
|
|
9884
9897
|
super(...arguments);
|
|
@@ -9890,7 +9903,7 @@ Federation.Issuers = Issuers;
|
|
|
9890
9903
|
Federation.Rules = Rules;
|
|
9891
9904
|
|
|
9892
9905
|
//#endregion
|
|
9893
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
9906
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs
|
|
9894
9907
|
var Workspaces$1 = class extends APIResource {
|
|
9895
9908
|
/**
|
|
9896
9909
|
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
@@ -9999,7 +10012,7 @@ var Workspaces$1 = class extends APIResource {
|
|
|
9999
10012
|
};
|
|
10000
10013
|
|
|
10001
10014
|
//#endregion
|
|
10002
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10015
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs
|
|
10003
10016
|
var ServiceAccounts$1 = class extends APIResource {
|
|
10004
10017
|
constructor() {
|
|
10005
10018
|
super(...arguments);
|
|
@@ -10148,7 +10161,7 @@ var ServiceAccounts$1 = class extends APIResource {
|
|
|
10148
10161
|
ServiceAccounts$1.Workspaces = Workspaces$1;
|
|
10149
10162
|
|
|
10150
10163
|
//#endregion
|
|
10151
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10164
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs
|
|
10152
10165
|
var Members = class extends APIResource {
|
|
10153
10166
|
/**
|
|
10154
10167
|
* Get Workspace Member
|
|
@@ -10247,7 +10260,7 @@ var Members = class extends APIResource {
|
|
|
10247
10260
|
};
|
|
10248
10261
|
|
|
10249
10262
|
//#endregion
|
|
10250
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10263
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs
|
|
10251
10264
|
var RateLimits = class extends APIResource {
|
|
10252
10265
|
/**
|
|
10253
10266
|
* List rate-limit overrides configured for a workspace.
|
|
@@ -10278,7 +10291,7 @@ var RateLimits = class extends APIResource {
|
|
|
10278
10291
|
};
|
|
10279
10292
|
|
|
10280
10293
|
//#endregion
|
|
10281
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10294
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs
|
|
10282
10295
|
var ServiceAccounts = class extends APIResource {
|
|
10283
10296
|
/**
|
|
10284
10297
|
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
@@ -10445,7 +10458,7 @@ var ServiceAccounts = class extends APIResource {
|
|
|
10445
10458
|
};
|
|
10446
10459
|
|
|
10447
10460
|
//#endregion
|
|
10448
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10461
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs
|
|
10449
10462
|
var Workspaces = class extends APIResource {
|
|
10450
10463
|
constructor() {
|
|
10451
10464
|
super(...arguments);
|
|
@@ -10540,7 +10553,7 @@ Workspaces.Members = Members;
|
|
|
10540
10553
|
Workspaces.ServiceAccounts = ServiceAccounts;
|
|
10541
10554
|
|
|
10542
10555
|
//#endregion
|
|
10543
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10556
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs
|
|
10544
10557
|
var Organization = class extends APIResource {
|
|
10545
10558
|
constructor() {
|
|
10546
10559
|
super(...arguments);
|
|
@@ -10579,7 +10592,7 @@ Organization.RateLimits = RateLimits$1;
|
|
|
10579
10592
|
Organization.ComplianceSettings = ComplianceSettings;
|
|
10580
10593
|
|
|
10581
10594
|
//#endregion
|
|
10582
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10595
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs
|
|
10583
10596
|
var Events$1 = class extends APIResource {
|
|
10584
10597
|
/**
|
|
10585
10598
|
* List Events
|
|
@@ -10692,7 +10705,7 @@ var Events$1 = class extends APIResource {
|
|
|
10692
10705
|
Events$1.SessionToolRunner = SessionToolRunner;
|
|
10693
10706
|
|
|
10694
10707
|
//#endregion
|
|
10695
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10708
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs
|
|
10696
10709
|
var Resources = class extends APIResource {
|
|
10697
10710
|
/**
|
|
10698
10711
|
* Get Session Resource
|
|
@@ -10817,7 +10830,7 @@ var Resources = class extends APIResource {
|
|
|
10817
10830
|
};
|
|
10818
10831
|
|
|
10819
10832
|
//#endregion
|
|
10820
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10833
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs
|
|
10821
10834
|
var Events = class extends APIResource {
|
|
10822
10835
|
/**
|
|
10823
10836
|
* List Session Thread Events
|
|
@@ -10871,7 +10884,7 @@ var Events = class extends APIResource {
|
|
|
10871
10884
|
};
|
|
10872
10885
|
|
|
10873
10886
|
//#endregion
|
|
10874
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10887
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs
|
|
10875
10888
|
var Threads = class extends APIResource {
|
|
10876
10889
|
constructor() {
|
|
10877
10890
|
super(...arguments);
|
|
@@ -10949,7 +10962,7 @@ var Threads = class extends APIResource {
|
|
|
10949
10962
|
Threads.Events = Events;
|
|
10950
10963
|
|
|
10951
10964
|
//#endregion
|
|
10952
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
10965
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs
|
|
10953
10966
|
var Sessions = class extends APIResource {
|
|
10954
10967
|
constructor() {
|
|
10955
10968
|
super(...arguments);
|
|
@@ -11093,7 +11106,7 @@ Sessions.Resources = Resources;
|
|
|
11093
11106
|
Sessions.Threads = Threads;
|
|
11094
11107
|
|
|
11095
11108
|
//#endregion
|
|
11096
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11109
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs
|
|
11097
11110
|
var Versions$1 = class extends APIResource {
|
|
11098
11111
|
/**
|
|
11099
11112
|
* Create Skill Version
|
|
@@ -11212,7 +11225,7 @@ var Versions$1 = class extends APIResource {
|
|
|
11212
11225
|
};
|
|
11213
11226
|
|
|
11214
11227
|
//#endregion
|
|
11215
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11228
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs
|
|
11216
11229
|
var Skills$1 = class extends APIResource {
|
|
11217
11230
|
constructor() {
|
|
11218
11231
|
super(...arguments);
|
|
@@ -11305,7 +11318,7 @@ var Skills$1 = class extends APIResource {
|
|
|
11305
11318
|
Skills$1.Versions = Versions$1;
|
|
11306
11319
|
|
|
11307
11320
|
//#endregion
|
|
11308
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11321
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs
|
|
11309
11322
|
var Certificates = class extends APIResource {
|
|
11310
11323
|
/**
|
|
11311
11324
|
* The Tunnels API is in research preview. It requires the
|
|
@@ -11427,7 +11440,7 @@ var Certificates = class extends APIResource {
|
|
|
11427
11440
|
};
|
|
11428
11441
|
|
|
11429
11442
|
//#endregion
|
|
11430
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11443
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs
|
|
11431
11444
|
var Tunnels = class extends APIResource {
|
|
11432
11445
|
constructor() {
|
|
11433
11446
|
super(...arguments);
|
|
@@ -11598,7 +11611,7 @@ var Tunnels = class extends APIResource {
|
|
|
11598
11611
|
Tunnels.Certificates = Certificates;
|
|
11599
11612
|
|
|
11600
11613
|
//#endregion
|
|
11601
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11614
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs
|
|
11602
11615
|
var Credentials = class extends APIResource {
|
|
11603
11616
|
/**
|
|
11604
11617
|
* Create Credential
|
|
@@ -11768,7 +11781,7 @@ var Credentials = class extends APIResource {
|
|
|
11768
11781
|
};
|
|
11769
11782
|
|
|
11770
11783
|
//#endregion
|
|
11771
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11784
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs
|
|
11772
11785
|
var Vaults = class extends APIResource {
|
|
11773
11786
|
constructor() {
|
|
11774
11787
|
super(...arguments);
|
|
@@ -11907,7 +11920,7 @@ var Vaults = class extends APIResource {
|
|
|
11907
11920
|
Vaults.Credentials = Credentials;
|
|
11908
11921
|
|
|
11909
11922
|
//#endregion
|
|
11910
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11923
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs
|
|
11911
11924
|
var Beta = class extends APIResource {
|
|
11912
11925
|
constructor() {
|
|
11913
11926
|
super(...arguments);
|
|
@@ -11947,7 +11960,7 @@ Beta.Tunnels = Tunnels;
|
|
|
11947
11960
|
Beta.Organization = Organization;
|
|
11948
11961
|
|
|
11949
11962
|
//#endregion
|
|
11950
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11963
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/completions.mjs
|
|
11951
11964
|
var Completions = class extends APIResource {
|
|
11952
11965
|
create(params, options) {
|
|
11953
11966
|
const { betas, workspace_id, ...body } = params;
|
|
@@ -11965,7 +11978,7 @@ var Completions = class extends APIResource {
|
|
|
11965
11978
|
};
|
|
11966
11979
|
|
|
11967
11980
|
//#endregion
|
|
11968
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
11981
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/files.mjs
|
|
11969
11982
|
var Files = class extends APIResource {
|
|
11970
11983
|
/**
|
|
11971
11984
|
* List Files
|
|
@@ -12065,7 +12078,7 @@ var Files = class extends APIResource {
|
|
|
12065
12078
|
};
|
|
12066
12079
|
|
|
12067
12080
|
//#endregion
|
|
12068
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
12081
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/parser.mjs
|
|
12069
12082
|
function getOutputFormat(params) {
|
|
12070
12083
|
return params?.output_config?.format;
|
|
12071
12084
|
}
|
|
@@ -12127,7 +12140,7 @@ function parseOutputFormat(params, content) {
|
|
|
12127
12140
|
}
|
|
12128
12141
|
|
|
12129
12142
|
//#endregion
|
|
12130
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
12143
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs
|
|
12131
12144
|
var _MessageStream_instances;
|
|
12132
12145
|
var _MessageStream_currentMessageSnapshot;
|
|
12133
12146
|
var _MessageStream_params;
|
|
@@ -12749,7 +12762,7 @@ var MessageStream = class MessageStream {
|
|
|
12749
12762
|
};
|
|
12750
12763
|
|
|
12751
12764
|
//#endregion
|
|
12752
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
12765
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs
|
|
12753
12766
|
var Batches = class extends APIResource {
|
|
12754
12767
|
/**
|
|
12755
12768
|
* Send a batch of Message creation requests.
|
|
@@ -12920,7 +12933,7 @@ var Batches = class extends APIResource {
|
|
|
12920
12933
|
};
|
|
12921
12934
|
|
|
12922
12935
|
//#endregion
|
|
12923
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
12936
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs
|
|
12924
12937
|
var Messages = class extends APIResource {
|
|
12925
12938
|
constructor() {
|
|
12926
12939
|
super(...arguments);
|
|
@@ -13035,7 +13048,7 @@ const MODELS_TO_WARN_WITH_THINKING_ENABLED = ["claude-mythos-preview", "claude-o
|
|
|
13035
13048
|
Messages.Batches = Batches;
|
|
13036
13049
|
|
|
13037
13050
|
//#endregion
|
|
13038
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
13051
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/models.mjs
|
|
13039
13052
|
var Models = class extends APIResource {
|
|
13040
13053
|
/**
|
|
13041
13054
|
* Get a specific model.
|
|
@@ -13086,7 +13099,7 @@ var Models = class extends APIResource {
|
|
|
13086
13099
|
};
|
|
13087
13100
|
|
|
13088
13101
|
//#endregion
|
|
13089
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
13102
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs
|
|
13090
13103
|
var Versions = class extends APIResource {
|
|
13091
13104
|
/**
|
|
13092
13105
|
* Create Skill Version
|
|
@@ -13167,7 +13180,7 @@ var Versions = class extends APIResource {
|
|
|
13167
13180
|
};
|
|
13168
13181
|
|
|
13169
13182
|
//#endregion
|
|
13170
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
13183
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs
|
|
13171
13184
|
var Skills = class extends APIResource {
|
|
13172
13185
|
constructor() {
|
|
13173
13186
|
super(...arguments);
|
|
@@ -13244,7 +13257,7 @@ var Skills = class extends APIResource {
|
|
|
13244
13257
|
Skills.Versions = Versions;
|
|
13245
13258
|
|
|
13246
13259
|
//#endregion
|
|
13247
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
13260
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/client.mjs
|
|
13248
13261
|
var _BaseAnthropic_instances;
|
|
13249
13262
|
var _a;
|
|
13250
13263
|
var _BaseAnthropic_encoder;
|
|
@@ -13313,7 +13326,7 @@ var BaseAnthropic = class {
|
|
|
13313
13326
|
this.logLevel = defaultLogLevel;
|
|
13314
13327
|
this.logLevel = parseLogLevel(options.logLevel, "ClientOptions.logLevel", loggerFor(this)) ?? parseLogLevel(readEnv("ANTHROPIC_LOG"), "process.env['ANTHROPIC_LOG']", loggerFor(this)) ?? "warn";
|
|
13315
13328
|
this.fetchOptions = options.fetchOptions;
|
|
13316
|
-
this.maxRetries = options.maxRetries ?? 2;
|
|
13329
|
+
this.maxRetries = validatePositiveInteger("maxRetries", options.maxRetries ?? 2);
|
|
13317
13330
|
this.fetch = options.fetch ?? getDefaultFetch();
|
|
13318
13331
|
__classPrivateFieldSet(this, _BaseAnthropic_encoder, FallbackEncoder, "f");
|
|
13319
13332
|
this.middleware = [...options.middleware ?? []];
|
|
@@ -13558,9 +13571,6 @@ var BaseAnthropic = class {
|
|
|
13558
13571
|
getUserAgent() {
|
|
13559
13572
|
return `Anthropic/JS ${VERSION}`;
|
|
13560
13573
|
}
|
|
13561
|
-
defaultIdempotencyKey() {
|
|
13562
|
-
return `stainless-node-retry-${uuid4()}`;
|
|
13563
|
-
}
|
|
13564
13574
|
makeStatusError(status, error, message, headers) {
|
|
13565
13575
|
return APIError.generate(status, error, message, headers);
|
|
13566
13576
|
}
|
|
@@ -13669,7 +13679,7 @@ var BaseAnthropic = class {
|
|
|
13669
13679
|
}
|
|
13670
13680
|
async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) {
|
|
13671
13681
|
const options = await optionsInput;
|
|
13672
|
-
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
13682
|
+
const maxRetries = validatePositiveInteger("maxRetries", options.maxRetries ?? this.maxRetries);
|
|
13673
13683
|
if (retriesRemaining == null) {
|
|
13674
13684
|
retriesRemaining = maxRetries;
|
|
13675
13685
|
this._requestAuthFlags.delete(options);
|
|
@@ -13887,7 +13897,7 @@ var BaseAnthropic = class {
|
|
|
13887
13897
|
timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
|
|
13888
13898
|
}
|
|
13889
13899
|
}
|
|
13890
|
-
if (timeoutMillis === undefined) {
|
|
13900
|
+
if (timeoutMillis === undefined || !(timeoutMillis > 0 && timeoutMillis <= 2 ** 31 - 1)) {
|
|
13891
13901
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
13892
13902
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
13893
13903
|
}
|
|
@@ -13946,13 +13956,7 @@ var BaseAnthropic = class {
|
|
|
13946
13956
|
};
|
|
13947
13957
|
}
|
|
13948
13958
|
async buildHeaders({ options, method, bodyHeaders, retryCount }) {
|
|
13949
|
-
let idempotencyHeaders = {};
|
|
13950
|
-
if (this.idempotencyHeader && method !== "get") {
|
|
13951
|
-
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
|
|
13952
|
-
idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
|
|
13953
|
-
}
|
|
13954
13959
|
const headers = buildHeaders([
|
|
13955
|
-
idempotencyHeaders,
|
|
13956
13960
|
{
|
|
13957
13961
|
Accept: "application/json",
|
|
13958
13962
|
"User-Agent": this.getUserAgent(),
|
|
@@ -14047,7 +14051,7 @@ Anthropic.Skills = Skills;
|
|
|
14047
14051
|
Anthropic.Beta = Beta;
|
|
14048
14052
|
|
|
14049
14053
|
//#endregion
|
|
14050
|
-
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.
|
|
14054
|
+
//#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.125.0_zod@4.6.4/node_modules/@anthropic-ai/sdk/lib/middleware.mjs
|
|
14051
14055
|
const encoder = new TextEncoder();
|
|
14052
14056
|
/** Betas sent by default; override with {@link BetaRefusalFallbackOptions.betas}. */
|
|
14053
14057
|
const DEFAULT_BETAS = ["fallback-credit-2026-07-01"];
|