@superblocksteam/cli 2.0.110-next.9 → 2.0.110
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/README.md +1 -1
- package/bin/run.js +1 -3
- package/dist/{acorn-3D2W2AKY.js → acorn-QRHEJZ4Y.js} +3 -3
- package/dist/{angular-HVKP5P5N.js → angular-E7FCGLEO.js} +3 -3
- package/dist/{api-LSOISICD.js → api-F7VFMVH5.js} +4 -4
- package/dist/{babel-B4WD7GLJ.js → babel-XU2VNNSQ.js} +3 -3
- package/dist/{chunk-OPB2WVVU.js → chunk-42MJC4KH.js} +4 -4
- package/dist/{chunk-CMGIU3NN.js → chunk-4N2GPPW5.js} +3 -3
- package/dist/{chunk-PFPXZXBI.js → chunk-5M7JSMKP.js} +3 -3
- package/dist/{chunk-YCNCRJYV.js → chunk-7XGJ2DPJ.js} +3 -3
- package/dist/{chunk-OMQRNPK6.js → chunk-CHRYSMMG.js} +3 -3
- package/dist/{chunk-RYM4EYRS.js → chunk-E33HPBUC.js} +2 -2
- package/dist/{chunk-KC2IY4X2.js → chunk-FAJ3NJRT.js} +3 -3
- package/dist/{chunk-QBHC6RCO.js → chunk-H427LM2L.js} +3 -3
- package/dist/{chunk-ZGOYHQFO.js → chunk-JUTJWISA.js} +6 -6
- package/dist/{chunk-XHY4LTJJ.js → chunk-QQTIZ3JW.js} +3 -3
- package/dist/{chunk-XUS66SQZ.js → chunk-SOVZ4MKE.js} +3 -3
- package/dist/{chunk-DGVDV434.js → chunk-UQQWHXCE.js} +4 -4
- package/dist/{chunk-A5WCVW6M.js → chunk-VUXGBCHS.js} +4 -4
- package/dist/{chunk-3NONMYU6.js → chunk-X2O46BBJ.js} +6 -6
- package/dist/{chunk-OSJNQX7U.js → chunk-XBQXSTNW.js} +484 -1615
- package/dist/{chunk-OSJNQX7U.js.map → chunk-XBQXSTNW.js.map} +1 -1
- package/dist/{chunk-Y3IEKQVS.js → chunk-Y5UCK4QB.js} +3 -3
- package/dist/{chunk-RC53XP2N.js → chunk-Z64OZ4VQ.js} +4 -4
- package/dist/{cli-truncate-O7Q4EDNQ.js → cli-truncate-R7BZHTWM.js} +5 -5
- package/dist/commands/dev-parent.js +2 -2
- package/dist/{dd-trace-YVZHQMJL.js → dd-trace-TMWNM5TU.js} +7 -7
- package/dist/{dist-PJIZIVLX.js → dist-QGBH4SEF.js} +13 -13
- package/dist/{embedded-playwright-mcp-server-DC37K3RU.js → embedded-playwright-mcp-server-6GY37WOF.js} +3 -3
- package/dist/{enquirer-AR4JKNOT.js → enquirer-QSA4Q3KI.js} +4 -4
- package/dist/{estree-H3LDYHUV.js → estree-M5XOW65K.js} +3 -3
- package/dist/{flow-2N5KLUPY.js → flow-L3D4WX3Z.js} +3 -3
- package/dist/{getMachineId-bsd-GDC3W6DD.js → getMachineId-bsd-I2VASQDS.js} +5 -5
- package/dist/{getMachineId-darwin-UJ6EODVH.js → getMachineId-darwin-VTQRCEUS.js} +5 -5
- package/dist/{getMachineId-linux-QR6X6UV6.js → getMachineId-linux-4IXPONMU.js} +4 -4
- package/dist/{getMachineId-unsupported-BY2Z7V36.js → getMachineId-unsupported-UAR7YCNX.js} +4 -4
- package/dist/{getMachineId-win-KHF7HTSM.js → getMachineId-win-C7XX6XLO.js} +5 -5
- package/dist/{glimmer-OQNDPJZ4.js → glimmer-LUDC5QNV.js} +3 -3
- package/dist/{graphql-E3S5HTFF.js → graphql-VIZ3REIC.js} +3 -3
- package/dist/{html-AXQOAYF5.js → html-I6EAKISS.js} +3 -3
- package/dist/{http-35CBB22T.js → http-XXFRZJNU.js} +12 -12
- package/dist/index.js +26 -298
- package/dist/index.js.map +1 -1
- package/dist/{jiti-X5L3PEDX.js → jiti-EJ36EOMK.js} +3 -3
- package/dist/{log-update-I6QEMHVE.js → log-update-53HBE7QZ.js} +6 -6
- package/dist/{markdown-T33IEMG4.js → markdown-STBGDZM6.js} +3 -3
- package/dist/{meriyah-A7KG5ICX.js → meriyah-65T7PG5O.js} +3 -3
- package/dist/{postcss-INIOIHP7.js → postcss-ASIVSSN2.js} +3 -3
- package/dist/{read-pkg-PQUM5NTS.js → read-pkg-MWZA3RU5.js} +5 -5
- package/dist/{spans-375ZPRUO.js → spans-3EJDY2PZ.js} +4 -4
- package/dist/{src-YS3I4SQA.js → src-DWCFAABS.js} +3 -3
- package/dist/{token-MAXTTCE2.js → token-YF6QEPIT.js} +5 -5
- package/dist/{token-util-7T4GL63H.js → token-util-TV464TI4.js} +5 -5
- package/dist/{typescript-IBSIENKR.js → typescript-ZZIEC5OF.js} +3 -3
- package/dist/{wrap-ansi-UZG4BL7K.js → wrap-ansi-7RMGVNIF.js} +5 -5
- package/dist/{yaml-EONXBPHY.js → yaml-P2AMYUL3.js} +3 -3
- package/oclif.manifest.json +1 -8
- package/package.json +5 -5
- /package/dist/{acorn-3D2W2AKY.js.map → acorn-QRHEJZ4Y.js.map} +0 -0
- /package/dist/{angular-HVKP5P5N.js.map → angular-E7FCGLEO.js.map} +0 -0
- /package/dist/{api-LSOISICD.js.map → api-F7VFMVH5.js.map} +0 -0
- /package/dist/{babel-B4WD7GLJ.js.map → babel-XU2VNNSQ.js.map} +0 -0
- /package/dist/{chunk-OPB2WVVU.js.map → chunk-42MJC4KH.js.map} +0 -0
- /package/dist/{chunk-CMGIU3NN.js.map → chunk-4N2GPPW5.js.map} +0 -0
- /package/dist/{chunk-PFPXZXBI.js.map → chunk-5M7JSMKP.js.map} +0 -0
- /package/dist/{chunk-YCNCRJYV.js.map → chunk-7XGJ2DPJ.js.map} +0 -0
- /package/dist/{chunk-OMQRNPK6.js.map → chunk-CHRYSMMG.js.map} +0 -0
- /package/dist/{chunk-RYM4EYRS.js.map → chunk-E33HPBUC.js.map} +0 -0
- /package/dist/{chunk-KC2IY4X2.js.map → chunk-FAJ3NJRT.js.map} +0 -0
- /package/dist/{chunk-QBHC6RCO.js.map → chunk-H427LM2L.js.map} +0 -0
- /package/dist/{chunk-ZGOYHQFO.js.map → chunk-JUTJWISA.js.map} +0 -0
- /package/dist/{chunk-XHY4LTJJ.js.map → chunk-QQTIZ3JW.js.map} +0 -0
- /package/dist/{chunk-XUS66SQZ.js.map → chunk-SOVZ4MKE.js.map} +0 -0
- /package/dist/{chunk-DGVDV434.js.map → chunk-UQQWHXCE.js.map} +0 -0
- /package/dist/{chunk-A5WCVW6M.js.map → chunk-VUXGBCHS.js.map} +0 -0
- /package/dist/{chunk-3NONMYU6.js.map → chunk-X2O46BBJ.js.map} +0 -0
- /package/dist/{chunk-Y3IEKQVS.js.map → chunk-Y5UCK4QB.js.map} +0 -0
- /package/dist/{chunk-RC53XP2N.js.map → chunk-Z64OZ4VQ.js.map} +0 -0
- /package/dist/{cli-truncate-O7Q4EDNQ.js.map → cli-truncate-R7BZHTWM.js.map} +0 -0
- /package/dist/{dd-trace-YVZHQMJL.js.map → dd-trace-TMWNM5TU.js.map} +0 -0
- /package/dist/{dist-PJIZIVLX.js.map → dist-QGBH4SEF.js.map} +0 -0
- /package/dist/{embedded-playwright-mcp-server-DC37K3RU.js.map → embedded-playwright-mcp-server-6GY37WOF.js.map} +0 -0
- /package/dist/{enquirer-AR4JKNOT.js.map → enquirer-QSA4Q3KI.js.map} +0 -0
- /package/dist/{estree-H3LDYHUV.js.map → estree-M5XOW65K.js.map} +0 -0
- /package/dist/{flow-2N5KLUPY.js.map → flow-L3D4WX3Z.js.map} +0 -0
- /package/dist/{getMachineId-bsd-GDC3W6DD.js.map → getMachineId-bsd-I2VASQDS.js.map} +0 -0
- /package/dist/{getMachineId-darwin-UJ6EODVH.js.map → getMachineId-darwin-VTQRCEUS.js.map} +0 -0
- /package/dist/{getMachineId-linux-QR6X6UV6.js.map → getMachineId-linux-4IXPONMU.js.map} +0 -0
- /package/dist/{getMachineId-unsupported-BY2Z7V36.js.map → getMachineId-unsupported-UAR7YCNX.js.map} +0 -0
- /package/dist/{getMachineId-win-KHF7HTSM.js.map → getMachineId-win-C7XX6XLO.js.map} +0 -0
- /package/dist/{glimmer-OQNDPJZ4.js.map → glimmer-LUDC5QNV.js.map} +0 -0
- /package/dist/{graphql-E3S5HTFF.js.map → graphql-VIZ3REIC.js.map} +0 -0
- /package/dist/{html-AXQOAYF5.js.map → html-I6EAKISS.js.map} +0 -0
- /package/dist/{http-35CBB22T.js.map → http-XXFRZJNU.js.map} +0 -0
- /package/dist/{jiti-X5L3PEDX.js.map → jiti-EJ36EOMK.js.map} +0 -0
- /package/dist/{log-update-I6QEMHVE.js.map → log-update-53HBE7QZ.js.map} +0 -0
- /package/dist/{markdown-T33IEMG4.js.map → markdown-STBGDZM6.js.map} +0 -0
- /package/dist/{meriyah-A7KG5ICX.js.map → meriyah-65T7PG5O.js.map} +0 -0
- /package/dist/{postcss-INIOIHP7.js.map → postcss-ASIVSSN2.js.map} +0 -0
- /package/dist/{read-pkg-PQUM5NTS.js.map → read-pkg-MWZA3RU5.js.map} +0 -0
- /package/dist/{spans-375ZPRUO.js.map → spans-3EJDY2PZ.js.map} +0 -0
- /package/dist/{src-YS3I4SQA.js.map → src-DWCFAABS.js.map} +0 -0
- /package/dist/{token-MAXTTCE2.js.map → token-YF6QEPIT.js.map} +0 -0
- /package/dist/{token-util-7T4GL63H.js.map → token-util-TV464TI4.js.map} +0 -0
- /package/dist/{typescript-IBSIENKR.js.map → typescript-ZZIEC5OF.js.map} +0 -0
- /package/dist/{wrap-ansi-UZG4BL7K.js.map → wrap-ansi-7RMGVNIF.js.map} +0 -0
- /package/dist/{yaml-EONXBPHY.js.map → yaml-P2AMYUL3.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
if (typeof process === 'object' && process !== null &&
|
|
2
2
|
process.env !== null && typeof process.env === 'object') {
|
|
3
3
|
process.env.DD_GIT_REPOSITORY_URL = 'https://token@github.com/superblocksteam/superblocks.git';
|
|
4
|
-
process.env.DD_GIT_COMMIT_SHA = '
|
|
4
|
+
process.env.DD_GIT_COMMIT_SHA = 'd6e752a2cecf8e93bafaf04dda2d5214949ae79a';
|
|
5
5
|
}
|
|
6
6
|
import { createRequire as $dd_createRequire } from 'module';
|
|
7
7
|
import { fileURLToPath as $dd_fileURLToPath } from 'url';
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
require_re,
|
|
25
25
|
require_semver,
|
|
26
26
|
require_valid
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-QQTIZ3JW.js";
|
|
28
28
|
import {
|
|
29
29
|
debounce_default,
|
|
30
30
|
get_default,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
require_lib,
|
|
42
42
|
require_slugify,
|
|
43
43
|
throttle_default
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7XGJ2DPJ.js";
|
|
45
45
|
import {
|
|
46
46
|
require_dd_trace,
|
|
47
47
|
require_import_in_the_middle,
|
|
@@ -50,16 +50,16 @@ import {
|
|
|
50
50
|
require_p_limit,
|
|
51
51
|
require_path_to_regexp,
|
|
52
52
|
require_src
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-X2O46BBJ.js";
|
|
54
54
|
import {
|
|
55
55
|
require_commonjs
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-H427LM2L.js";
|
|
57
57
|
import {
|
|
58
58
|
require_dc_polyfill
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-Y5UCK4QB.js";
|
|
60
60
|
import {
|
|
61
61
|
require_token_error
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-4N2GPPW5.js";
|
|
63
63
|
import {
|
|
64
64
|
SpanKind,
|
|
65
65
|
SpanStatusCode,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
init_esm,
|
|
69
69
|
metrics,
|
|
70
70
|
trace
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-FAJ3NJRT.js";
|
|
72
72
|
import {
|
|
73
73
|
__commonJS,
|
|
74
74
|
__esm,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
__toCommonJS,
|
|
78
78
|
__toESM,
|
|
79
79
|
init_cjs_shims
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-E33HPBUC.js";
|
|
81
81
|
|
|
82
82
|
// ../../../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
|
|
83
83
|
var require_constants3 = __commonJS({
|
|
@@ -6888,7 +6888,7 @@ var require_lodash = __commonJS({
|
|
|
6888
6888
|
var strSymbols = stringToArray(string5), start = charsStartIndex(strSymbols, stringToArray(chars));
|
|
6889
6889
|
return castSlice(strSymbols, start).join("");
|
|
6890
6890
|
}
|
|
6891
|
-
function
|
|
6891
|
+
function truncate(string5, options8) {
|
|
6892
6892
|
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
6893
6893
|
if (isObject4(options8)) {
|
|
6894
6894
|
var separator = "separator" in options8 ? options8.separator : separator;
|
|
@@ -7448,7 +7448,7 @@ var require_lodash = __commonJS({
|
|
|
7448
7448
|
lodash.trim = trim3;
|
|
7449
7449
|
lodash.trimEnd = trimEnd;
|
|
7450
7450
|
lodash.trimStart = trimStart;
|
|
7451
|
-
lodash.truncate =
|
|
7451
|
+
lodash.truncate = truncate;
|
|
7452
7452
|
lodash.unescape = unescape3;
|
|
7453
7453
|
lodash.uniqueId = uniqueId;
|
|
7454
7454
|
lodash.upperCase = upperCase;
|
|
@@ -43398,36 +43398,13 @@ var require_attachment_upload = __commonJS({
|
|
|
43398
43398
|
exports2.TEXT_LIKE_FILE_EXTENSIONS = void 0;
|
|
43399
43399
|
exports2.buildAttachmentUploadMetadata = buildAttachmentUploadMetadata;
|
|
43400
43400
|
exports2.isTextLikeMimeType = isTextLikeMimeType;
|
|
43401
|
-
exports2.isOfficeXml = isOfficeXml;
|
|
43402
43401
|
exports2.getTextAttachmentType = getTextAttachmentType;
|
|
43403
43402
|
exports2.normalizeAttachmentMimeType = normalizeAttachmentMimeType;
|
|
43404
43403
|
exports2.toAttachmentUploadDescriptor = toAttachmentUploadDescriptor2;
|
|
43405
43404
|
exports2.buildAttachmentUploadFormData = buildAttachmentUploadFormData2;
|
|
43406
43405
|
exports2.createUploadedAttachmentFromServer = createUploadedAttachmentFromServer;
|
|
43407
43406
|
exports2.uploadAttachmentToServerApi = uploadAttachmentToServerApi2;
|
|
43408
|
-
var
|
|
43409
|
-
"application/msword",
|
|
43410
|
-
"application/vnd.ms-excel",
|
|
43411
|
-
"application/vnd.ms-powerpoint",
|
|
43412
|
-
"application/vnd.openxmlformats-officedocument",
|
|
43413
|
-
"application/vnd.oasis.opendocument",
|
|
43414
|
-
"application/rtf"
|
|
43415
|
-
];
|
|
43416
|
-
var OFFICE_EXTENSIONS = [
|
|
43417
|
-
".doc",
|
|
43418
|
-
".docm",
|
|
43419
|
-
".docx",
|
|
43420
|
-
".odp",
|
|
43421
|
-
".ods",
|
|
43422
|
-
".odt",
|
|
43423
|
-
".ppt",
|
|
43424
|
-
".pptm",
|
|
43425
|
-
".pptx",
|
|
43426
|
-
".rtf",
|
|
43427
|
-
".xls",
|
|
43428
|
-
".xlsm",
|
|
43429
|
-
".xlsx"
|
|
43430
|
-
];
|
|
43407
|
+
var DEFAULT_MIME_TYPE = "application/octet-stream";
|
|
43431
43408
|
var TEXT_ATTACHMENT_MIME_TYPES2 = {
|
|
43432
43409
|
csv: "text/csv",
|
|
43433
43410
|
css: "text/css",
|
|
@@ -43511,21 +43488,7 @@ var require_attachment_upload = __commonJS({
|
|
|
43511
43488
|
const normalizedMimeType = mimeType.toLowerCase();
|
|
43512
43489
|
return normalizedMimeType.startsWith("text/") || normalizedMimeType.includes("json") || normalizedMimeType.includes("xml") || normalizedMimeType.includes("yaml") || normalizedMimeType.includes("toml") || normalizedMimeType.includes("javascript") || normalizedMimeType.includes("typescript") || normalizedMimeType.includes("ecmascript") || normalizedMimeType.includes("markdown") || normalizedMimeType.includes("shellscript") || normalizedMimeType.includes("python") || normalizedMimeType.includes("ruby") || normalizedMimeType.includes("php") || normalizedMimeType.includes("sql");
|
|
43513
43490
|
}
|
|
43514
|
-
function isOfficeXml(params) {
|
|
43515
|
-
const normalizedMimeType = normalizeNonEmptyString(params.mimeType)?.toLowerCase();
|
|
43516
|
-
if (normalizedMimeType && OFFICE_MIME_SUBSTRINGS.some((mimeType) => normalizedMimeType.includes(mimeType))) {
|
|
43517
|
-
return true;
|
|
43518
|
-
}
|
|
43519
|
-
const normalizedFileName = normalizeNonEmptyString(params.fileName)?.toLowerCase();
|
|
43520
|
-
if (!normalizedFileName) {
|
|
43521
|
-
return false;
|
|
43522
|
-
}
|
|
43523
|
-
return OFFICE_EXTENSIONS.some((extension) => normalizedFileName.endsWith(extension));
|
|
43524
|
-
}
|
|
43525
43491
|
function getTextAttachmentType(params) {
|
|
43526
|
-
if (isOfficeXml(params)) {
|
|
43527
|
-
return null;
|
|
43528
|
-
}
|
|
43529
43492
|
const normalizedFileName = normalizeNonEmptyString(params.fileName)?.toLowerCase();
|
|
43530
43493
|
const normalizedMimeType = normalizeNonEmptyString(params.mimeType)?.toLowerCase();
|
|
43531
43494
|
if (normalizedMimeType === "text/csv" || normalizedFileName?.endsWith(".csv")) {
|
|
@@ -43552,13 +43515,13 @@ var require_attachment_upload = __commonJS({
|
|
|
43552
43515
|
function normalizeAttachmentMimeType(params) {
|
|
43553
43516
|
const normalizedMimeType = normalizeNonEmptyString(params.mimeType)?.toLowerCase() ?? normalizeNonEmptyString(params.fallbackMimeType)?.toLowerCase();
|
|
43554
43517
|
const textLikeMimeType = getTextLikeMimeTypeFromFileName(params.fileName);
|
|
43555
|
-
if (
|
|
43556
|
-
return normalizedMimeType;
|
|
43518
|
+
if (!textLikeMimeType) {
|
|
43519
|
+
return normalizedMimeType ?? DEFAULT_MIME_TYPE;
|
|
43557
43520
|
}
|
|
43558
|
-
if (
|
|
43521
|
+
if (!normalizedMimeType) {
|
|
43559
43522
|
return textLikeMimeType;
|
|
43560
43523
|
}
|
|
43561
|
-
return normalizedMimeType
|
|
43524
|
+
return isTextLikeMimeType(normalizedMimeType) ? normalizedMimeType : textLikeMimeType;
|
|
43562
43525
|
}
|
|
43563
43526
|
function getDefaultFileName(mimeType) {
|
|
43564
43527
|
const normalizedMimeType = mimeType.toLowerCase();
|
|
@@ -43580,12 +43543,6 @@ var require_attachment_upload = __commonJS({
|
|
|
43580
43543
|
function decodeBase64(base64Data) {
|
|
43581
43544
|
return Uint8Array.from(atob(base64Data), (char) => char.charCodeAt(0));
|
|
43582
43545
|
}
|
|
43583
|
-
function withMimeType(blob, mimeType) {
|
|
43584
|
-
if (blob.type === mimeType) {
|
|
43585
|
-
return blob;
|
|
43586
|
-
}
|
|
43587
|
-
return new Blob([blob], { type: mimeType });
|
|
43588
|
-
}
|
|
43589
43546
|
function parseDataUrl2(data3) {
|
|
43590
43547
|
const match2 = data3.match(/^data:([^;,]+)?(?:;base64)?,(.*)$/s);
|
|
43591
43548
|
if (!match2) {
|
|
@@ -43606,11 +43563,8 @@ var require_attachment_upload = __commonJS({
|
|
|
43606
43563
|
mimeType: source2.type,
|
|
43607
43564
|
fallbackMimeType: options8?.fallbackMimeType
|
|
43608
43565
|
});
|
|
43609
|
-
if (!mimeType) {
|
|
43610
|
-
return null;
|
|
43611
|
-
}
|
|
43612
43566
|
return {
|
|
43613
|
-
blob:
|
|
43567
|
+
blob: source2,
|
|
43614
43568
|
fileName: resolveFileName({
|
|
43615
43569
|
fileName: source2.name,
|
|
43616
43570
|
fallbackFileName: options8?.fallbackFileName,
|
|
@@ -43626,11 +43580,8 @@ var require_attachment_upload = __commonJS({
|
|
|
43626
43580
|
mimeType: source2.type,
|
|
43627
43581
|
fallbackMimeType: options8?.fallbackMimeType
|
|
43628
43582
|
});
|
|
43629
|
-
if (!mimeType) {
|
|
43630
|
-
return null;
|
|
43631
|
-
}
|
|
43632
43583
|
return {
|
|
43633
|
-
blob:
|
|
43584
|
+
blob: source2,
|
|
43634
43585
|
fileName: resolveFileName({
|
|
43635
43586
|
fileName: sourceWithOptionalName.name,
|
|
43636
43587
|
fallbackFileName: options8?.fallbackFileName,
|
|
@@ -43647,9 +43598,6 @@ var require_attachment_upload = __commonJS({
|
|
|
43647
43598
|
fallbackMimeType: options8?.fallbackMimeType
|
|
43648
43599
|
});
|
|
43649
43600
|
const base64Data = parsedDataUrl?.base64Data ?? source2.data;
|
|
43650
|
-
if (!mimeType) {
|
|
43651
|
-
return null;
|
|
43652
|
-
}
|
|
43653
43601
|
return {
|
|
43654
43602
|
blob: new Blob([decodeBase64(base64Data)], { type: mimeType }),
|
|
43655
43603
|
fileName: resolveFileName({
|
|
@@ -43698,9 +43646,6 @@ var require_attachment_upload = __commonJS({
|
|
|
43698
43646
|
mimeType: source2.mimeType,
|
|
43699
43647
|
fallbackMimeType: options8?.fallbackMimeType ?? TEXT_ATTACHMENT_MIME_TYPES2[source2.type]
|
|
43700
43648
|
});
|
|
43701
|
-
if (!mimeType) {
|
|
43702
|
-
return null;
|
|
43703
|
-
}
|
|
43704
43649
|
return {
|
|
43705
43650
|
blob: new Blob([source2.content], { type: mimeType }),
|
|
43706
43651
|
fileName: resolveFileName({
|
|
@@ -70144,12 +70089,12 @@ var require_unreachable = __commonJS({
|
|
|
70144
70089
|
var require_base64 = __commonJS({
|
|
70145
70090
|
"../../../../node_modules/.pnpm/js-base64@3.7.7/node_modules/js-base64/base64.js"(exports2, module2) {
|
|
70146
70091
|
init_cjs_shims();
|
|
70147
|
-
(function(global2,
|
|
70148
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports =
|
|
70092
|
+
(function(global2, factory9) {
|
|
70093
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory9() : typeof define === "function" && define.amd ? define(factory9) : (
|
|
70149
70094
|
// cf. https://github.com/dankogai/js-base64/issues/119
|
|
70150
70095
|
(function() {
|
|
70151
70096
|
var _Base64 = global2.Base64;
|
|
70152
|
-
var gBase64 =
|
|
70097
|
+
var gBase64 = factory9();
|
|
70153
70098
|
gBase64.noConflict = function() {
|
|
70154
70099
|
global2.Base64 = _Base64;
|
|
70155
70100
|
return gBase64;
|
|
@@ -88916,8 +88861,8 @@ var require_data = __commonJS({
|
|
|
88916
88861
|
var require_uri_all = __commonJS({
|
|
88917
88862
|
"../../../../node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js"(exports2, module2) {
|
|
88918
88863
|
init_cjs_shims();
|
|
88919
|
-
(function(global2,
|
|
88920
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
88864
|
+
(function(global2, factory9) {
|
|
88865
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory9(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory9) : factory9(global2.URI = global2.URI || {});
|
|
88921
88866
|
})(exports2, (function(exports3) {
|
|
88922
88867
|
"use strict";
|
|
88923
88868
|
function merge5() {
|
|
@@ -96679,15 +96624,15 @@ var require_api_files = __commonJS({
|
|
|
96679
96624
|
exports2.readAppApiYamlFile = readAppApiYamlFile4;
|
|
96680
96625
|
exports2.resolveLanguageSpecificStepContentFromBlocks = resolveLanguageSpecificStepContentFromBlocks2;
|
|
96681
96626
|
async function writeApiFiles3(...args) {
|
|
96682
|
-
const esmFunction = await import("./api-
|
|
96627
|
+
const esmFunction = await import("./api-F7VFMVH5.js");
|
|
96683
96628
|
return esmFunction.writeApiFiles(...args);
|
|
96684
96629
|
}
|
|
96685
96630
|
async function readAppApiYamlFile4(...args) {
|
|
96686
|
-
const esmFunction = await import("./api-
|
|
96631
|
+
const esmFunction = await import("./api-F7VFMVH5.js");
|
|
96687
96632
|
return esmFunction.readAppApiYamlFile(...args);
|
|
96688
96633
|
}
|
|
96689
96634
|
async function resolveLanguageSpecificStepContentFromBlocks2(...args) {
|
|
96690
|
-
const esmFunction = await import("./api-
|
|
96635
|
+
const esmFunction = await import("./api-F7VFMVH5.js");
|
|
96691
96636
|
return esmFunction.resolveLanguageSpecificStepContentFromBlocks(...args);
|
|
96692
96637
|
}
|
|
96693
96638
|
}
|
|
@@ -109479,19 +109424,19 @@ var require_getMachineId = __commonJS({
|
|
|
109479
109424
|
if (!getMachineIdImpl) {
|
|
109480
109425
|
switch (process5.platform) {
|
|
109481
109426
|
case "darwin":
|
|
109482
|
-
getMachineIdImpl = (await import("./getMachineId-darwin-
|
|
109427
|
+
getMachineIdImpl = (await import("./getMachineId-darwin-VTQRCEUS.js")).getMachineId;
|
|
109483
109428
|
break;
|
|
109484
109429
|
case "linux":
|
|
109485
|
-
getMachineIdImpl = (await import("./getMachineId-linux-
|
|
109430
|
+
getMachineIdImpl = (await import("./getMachineId-linux-4IXPONMU.js")).getMachineId;
|
|
109486
109431
|
break;
|
|
109487
109432
|
case "freebsd":
|
|
109488
|
-
getMachineIdImpl = (await import("./getMachineId-bsd-
|
|
109433
|
+
getMachineIdImpl = (await import("./getMachineId-bsd-I2VASQDS.js")).getMachineId;
|
|
109489
109434
|
break;
|
|
109490
109435
|
case "win32":
|
|
109491
|
-
getMachineIdImpl = (await import("./getMachineId-win-
|
|
109436
|
+
getMachineIdImpl = (await import("./getMachineId-win-C7XX6XLO.js")).getMachineId;
|
|
109492
109437
|
break;
|
|
109493
109438
|
default:
|
|
109494
|
-
getMachineIdImpl = (await import("./getMachineId-unsupported-
|
|
109439
|
+
getMachineIdImpl = (await import("./getMachineId-unsupported-UAR7YCNX.js")).getMachineId;
|
|
109495
109440
|
break;
|
|
109496
109441
|
}
|
|
109497
109442
|
}
|
|
@@ -132162,8 +132107,8 @@ var require_float = __commonJS({
|
|
|
132162
132107
|
"../../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js"(exports2, module2) {
|
|
132163
132108
|
"use strict";
|
|
132164
132109
|
init_cjs_shims();
|
|
132165
|
-
module2.exports =
|
|
132166
|
-
function
|
|
132110
|
+
module2.exports = factory9(factory9);
|
|
132111
|
+
function factory9(exports3) {
|
|
132167
132112
|
if (typeof Float32Array !== "undefined") (function() {
|
|
132168
132113
|
var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128;
|
|
132169
132114
|
function writeFloat_f32_cpy(val2, buf, pos3) {
|
|
@@ -139830,23 +139775,23 @@ var require_util7 = __commonJS({
|
|
|
139830
139775
|
var require_umd = __commonJS({
|
|
139831
139776
|
"../../../../node_modules/.pnpm/long@5.3.1/node_modules/long/umd/index.js"(exports2, module2) {
|
|
139832
139777
|
init_cjs_shims();
|
|
139833
|
-
(function(global2,
|
|
139778
|
+
(function(global2, factory9) {
|
|
139834
139779
|
function unwrapDefault(exports3) {
|
|
139835
139780
|
return "default" in exports3 ? exports3.default : exports3;
|
|
139836
139781
|
}
|
|
139837
139782
|
if (typeof define === "function" && define.amd) {
|
|
139838
139783
|
define([], function() {
|
|
139839
139784
|
var exports3 = {};
|
|
139840
|
-
|
|
139785
|
+
factory9(exports3);
|
|
139841
139786
|
return unwrapDefault(exports3);
|
|
139842
139787
|
});
|
|
139843
139788
|
} else if (typeof exports2 === "object") {
|
|
139844
|
-
|
|
139789
|
+
factory9(exports2);
|
|
139845
139790
|
if (typeof module2 === "object") module2.exports = unwrapDefault(exports2);
|
|
139846
139791
|
} else {
|
|
139847
139792
|
(function() {
|
|
139848
139793
|
var exports3 = {};
|
|
139849
|
-
|
|
139794
|
+
factory9(exports3);
|
|
139850
139795
|
global2.Long = unwrapDefault(exports3);
|
|
139851
139796
|
})();
|
|
139852
139797
|
}
|
|
@@ -143557,7 +143502,7 @@ var require_filter_stack = __commonJS({
|
|
|
143557
143502
|
return new _FilterStackFactory([...this.factories]);
|
|
143558
143503
|
}
|
|
143559
143504
|
createFilter() {
|
|
143560
|
-
return new FilterStack(this.factories.map((
|
|
143505
|
+
return new FilterStack(this.factories.map((factory9) => factory9.createFilter()));
|
|
143561
143506
|
}
|
|
143562
143507
|
};
|
|
143563
143508
|
exports2.FilterStackFactory = FilterStackFactory;
|
|
@@ -154421,8 +154366,8 @@ var require_splat = __commonJS({
|
|
|
154421
154366
|
var require_fecha_umd = __commonJS({
|
|
154422
154367
|
"../../../../node_modules/.pnpm/fecha@4.2.3/node_modules/fecha/lib/fecha.umd.js"(exports2, module2) {
|
|
154423
154368
|
init_cjs_shims();
|
|
154424
|
-
(function(global2,
|
|
154425
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
154369
|
+
(function(global2, factory9) {
|
|
154370
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory9(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory9) : factory9(global2.fecha = {});
|
|
154426
154371
|
})(exports2, (function(exports3) {
|
|
154427
154372
|
"use strict";
|
|
154428
154373
|
var token2 = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
|
|
@@ -163218,7 +163163,7 @@ var require_globrex = __commonJS({
|
|
|
163218
163163
|
"../../../../node_modules/.pnpm/globrex@0.1.2/node_modules/globrex/index.js"(exports2, module2) {
|
|
163219
163164
|
init_cjs_shims();
|
|
163220
163165
|
var isWin = process.platform === "win32";
|
|
163221
|
-
var
|
|
163166
|
+
var SEP = isWin ? `\\\\+` : `\\/`;
|
|
163222
163167
|
var SEP_ESC = isWin ? `\\\\` : `/`;
|
|
163223
163168
|
var GLOBSTAR2 = `((?:[^/]*(?:/|$))*)`;
|
|
163224
163169
|
var WILDCARD = `([^/]*)`;
|
|
@@ -163234,7 +163179,7 @@ var require_globrex = __commonJS({
|
|
|
163234
163179
|
function add2(str, { split, last: last3, only } = {}) {
|
|
163235
163180
|
if (only !== "path") regex += str;
|
|
163236
163181
|
if (filepath && only !== "regex") {
|
|
163237
|
-
path77.regex += str === "\\/" ?
|
|
163182
|
+
path77.regex += str === "\\/" ? SEP : str;
|
|
163238
163183
|
if (split) {
|
|
163239
163184
|
if (last3) segment += str;
|
|
163240
163185
|
if (segment !== "") {
|
|
@@ -182777,7 +182722,7 @@ var require_dist6 = __commonJS({
|
|
|
182777
182722
|
asSchema: () => asSchema4,
|
|
182778
182723
|
combineHeaders: () => combineHeaders3,
|
|
182779
182724
|
convertAsyncIteratorToReadableStream: () => convertAsyncIteratorToReadableStream,
|
|
182780
|
-
convertBase64ToUint8Array: () =>
|
|
182725
|
+
convertBase64ToUint8Array: () => convertBase64ToUint8Array,
|
|
182781
182726
|
convertImageModelFileToDataUri: () => convertImageModelFileToDataUri,
|
|
182782
182727
|
convertToBase64: () => convertToBase642,
|
|
182783
182728
|
convertToFormData: () => convertToFormData,
|
|
@@ -182976,7 +182921,7 @@ var require_dist6 = __commonJS({
|
|
|
182976
182921
|
return Object.fromEntries([...response.headers]);
|
|
182977
182922
|
}
|
|
182978
182923
|
var { btoa: btoa4, atob: atob4 } = globalThis;
|
|
182979
|
-
function
|
|
182924
|
+
function convertBase64ToUint8Array(base64String) {
|
|
182980
182925
|
const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
|
|
182981
182926
|
const latin1string = atob4(base64Url);
|
|
182982
182927
|
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
@@ -185354,8 +185299,8 @@ var require_get_vercel_oidc_token = __commonJS({
|
|
|
185354
185299
|
}
|
|
185355
185300
|
try {
|
|
185356
185301
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
185357
|
-
await import("./token-util-
|
|
185358
|
-
await import("./token-
|
|
185302
|
+
await import("./token-util-TV464TI4.js"),
|
|
185303
|
+
await import("./token-YF6QEPIT.js")
|
|
185359
185304
|
]);
|
|
185360
185305
|
if (!token2 || isExpired(getTokenPayload(token2))) {
|
|
185361
185306
|
await refreshToken();
|
|
@@ -185458,7 +185403,7 @@ var require_dist8 = __commonJS({
|
|
|
185458
185403
|
module2.exports = __toCommonJS3(src_exports2);
|
|
185459
185404
|
var import_provider_utils112 = require_dist6();
|
|
185460
185405
|
var import_provider25 = require_dist4();
|
|
185461
|
-
var
|
|
185406
|
+
var import_v422 = require_v4();
|
|
185462
185407
|
var marker17 = "vercel.ai.gateway.error";
|
|
185463
185408
|
var symbol18 = Symbol.for(marker17);
|
|
185464
185409
|
var _a21;
|
|
@@ -185592,15 +185537,15 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185592
185537
|
return GatewayError.hasMarker(error40) && symbol42 in error40;
|
|
185593
185538
|
}
|
|
185594
185539
|
};
|
|
185595
|
-
var
|
|
185596
|
-
var
|
|
185540
|
+
var import_v423 = require_v4();
|
|
185541
|
+
var import_provider_utils27 = require_dist6();
|
|
185597
185542
|
var name42 = "GatewayModelNotFoundError";
|
|
185598
185543
|
var marker52 = `vercel.ai.gateway.error.${name42}`;
|
|
185599
185544
|
var symbol52 = Symbol.for(marker52);
|
|
185600
|
-
var modelNotFoundParamSchema = (0,
|
|
185601
|
-
() => (0,
|
|
185602
|
-
|
|
185603
|
-
modelId:
|
|
185545
|
+
var modelNotFoundParamSchema = (0, import_provider_utils27.lazySchema)(
|
|
185546
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
185547
|
+
import_v423.z.object({
|
|
185548
|
+
modelId: import_v423.z.string()
|
|
185604
185549
|
})
|
|
185605
185550
|
)
|
|
185606
185551
|
);
|
|
@@ -185670,7 +185615,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185670
185615
|
return GatewayError.hasMarker(error40) && symbol72 in error40;
|
|
185671
185616
|
}
|
|
185672
185617
|
};
|
|
185673
|
-
var
|
|
185618
|
+
var import_provider_utils28 = require_dist6();
|
|
185674
185619
|
async function createGatewayErrorFromResponse({
|
|
185675
185620
|
response,
|
|
185676
185621
|
statusCode,
|
|
@@ -185679,7 +185624,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185679
185624
|
authMethod
|
|
185680
185625
|
}) {
|
|
185681
185626
|
var _a92;
|
|
185682
|
-
const parseResult = await (0,
|
|
185627
|
+
const parseResult = await (0, import_provider_utils28.safeValidateTypes)({
|
|
185683
185628
|
value: response,
|
|
185684
185629
|
schema: gatewayErrorResponseSchema
|
|
185685
185630
|
});
|
|
@@ -185722,7 +185667,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185722
185667
|
generationId
|
|
185723
185668
|
});
|
|
185724
185669
|
case "model_not_found": {
|
|
185725
|
-
const modelResult = await (0,
|
|
185670
|
+
const modelResult = await (0, import_provider_utils28.safeValidateTypes)({
|
|
185726
185671
|
value: validatedResponse.error.param,
|
|
185727
185672
|
schema: modelNotFoundParamSchema
|
|
185728
185673
|
});
|
|
@@ -185750,16 +185695,16 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185750
185695
|
});
|
|
185751
185696
|
}
|
|
185752
185697
|
}
|
|
185753
|
-
var gatewayErrorResponseSchema = (0,
|
|
185754
|
-
() => (0,
|
|
185755
|
-
|
|
185756
|
-
error:
|
|
185757
|
-
message:
|
|
185758
|
-
type:
|
|
185759
|
-
param:
|
|
185760
|
-
code:
|
|
185698
|
+
var gatewayErrorResponseSchema = (0, import_provider_utils28.lazySchema)(
|
|
185699
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
185700
|
+
import_v422.z.object({
|
|
185701
|
+
error: import_v422.z.object({
|
|
185702
|
+
message: import_v422.z.string(),
|
|
185703
|
+
type: import_v422.z.string().nullish(),
|
|
185704
|
+
param: import_v422.z.unknown().nullish(),
|
|
185705
|
+
code: import_v422.z.union([import_v422.z.string(), import_v422.z.number()]).nullish()
|
|
185761
185706
|
}),
|
|
185762
|
-
generationId:
|
|
185707
|
+
generationId: import_v422.z.string().nullish()
|
|
185763
185708
|
})
|
|
185764
185709
|
)
|
|
185765
185710
|
);
|
|
@@ -186525,37 +186470,37 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
186525
186470
|
})
|
|
186526
186471
|
]);
|
|
186527
186472
|
var import_provider_utils92 = require_dist6();
|
|
186528
|
-
var
|
|
186473
|
+
var import_zod54 = require_zod();
|
|
186529
186474
|
var parallelSearchInputSchema = (0, import_provider_utils92.lazySchema)(
|
|
186530
186475
|
() => (0, import_provider_utils92.zodSchema)(
|
|
186531
|
-
|
|
186532
|
-
objective:
|
|
186476
|
+
import_zod54.z.object({
|
|
186477
|
+
objective: import_zod54.z.string().describe(
|
|
186533
186478
|
"Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
|
|
186534
186479
|
),
|
|
186535
|
-
search_queries:
|
|
186480
|
+
search_queries: import_zod54.z.array(import_zod54.z.string()).optional().describe(
|
|
186536
186481
|
"Optional search queries to supplement the objective. Maximum 200 characters per query."
|
|
186537
186482
|
),
|
|
186538
|
-
mode:
|
|
186483
|
+
mode: import_zod54.z.enum(["one-shot", "agentic"]).optional().describe(
|
|
186539
186484
|
'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
|
|
186540
186485
|
),
|
|
186541
|
-
max_results:
|
|
186486
|
+
max_results: import_zod54.z.number().optional().describe(
|
|
186542
186487
|
"Maximum number of results to return (1-20). Defaults to 10 if not specified."
|
|
186543
186488
|
),
|
|
186544
|
-
source_policy:
|
|
186545
|
-
include_domains:
|
|
186546
|
-
exclude_domains:
|
|
186547
|
-
after_date:
|
|
186489
|
+
source_policy: import_zod54.z.object({
|
|
186490
|
+
include_domains: import_zod54.z.array(import_zod54.z.string()).optional().describe("List of domains to include in search results."),
|
|
186491
|
+
exclude_domains: import_zod54.z.array(import_zod54.z.string()).optional().describe("List of domains to exclude from search results."),
|
|
186492
|
+
after_date: import_zod54.z.string().optional().describe(
|
|
186548
186493
|
"Only include results published after this date (ISO 8601 format)."
|
|
186549
186494
|
)
|
|
186550
186495
|
}).optional().describe(
|
|
186551
186496
|
"Source policy for controlling which domains to include/exclude and freshness."
|
|
186552
186497
|
),
|
|
186553
|
-
excerpts:
|
|
186554
|
-
max_chars_per_result:
|
|
186555
|
-
max_chars_total:
|
|
186498
|
+
excerpts: import_zod54.z.object({
|
|
186499
|
+
max_chars_per_result: import_zod54.z.number().optional().describe("Maximum characters per result."),
|
|
186500
|
+
max_chars_total: import_zod54.z.number().optional().describe("Maximum total characters across all results.")
|
|
186556
186501
|
}).optional().describe("Excerpt configuration for controlling result length."),
|
|
186557
|
-
fetch_policy:
|
|
186558
|
-
max_age_seconds:
|
|
186502
|
+
fetch_policy: import_zod54.z.object({
|
|
186503
|
+
max_age_seconds: import_zod54.z.number().optional().describe(
|
|
186559
186504
|
"Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
|
|
186560
186505
|
)
|
|
186561
186506
|
}).optional().describe("Fetch policy for controlling content freshness.")
|
|
@@ -186564,23 +186509,23 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
186564
186509
|
);
|
|
186565
186510
|
var parallelSearchOutputSchema = (0, import_provider_utils92.lazySchema)(
|
|
186566
186511
|
() => (0, import_provider_utils92.zodSchema)(
|
|
186567
|
-
|
|
186512
|
+
import_zod54.z.union([
|
|
186568
186513
|
// Success response
|
|
186569
|
-
|
|
186570
|
-
searchId:
|
|
186571
|
-
results:
|
|
186572
|
-
|
|
186573
|
-
url:
|
|
186574
|
-
title:
|
|
186575
|
-
excerpt:
|
|
186576
|
-
publishDate:
|
|
186577
|
-
relevanceScore:
|
|
186514
|
+
import_zod54.z.object({
|
|
186515
|
+
searchId: import_zod54.z.string(),
|
|
186516
|
+
results: import_zod54.z.array(
|
|
186517
|
+
import_zod54.z.object({
|
|
186518
|
+
url: import_zod54.z.string(),
|
|
186519
|
+
title: import_zod54.z.string(),
|
|
186520
|
+
excerpt: import_zod54.z.string(),
|
|
186521
|
+
publishDate: import_zod54.z.string().nullable().optional(),
|
|
186522
|
+
relevanceScore: import_zod54.z.number().optional()
|
|
186578
186523
|
})
|
|
186579
186524
|
)
|
|
186580
186525
|
}),
|
|
186581
186526
|
// Error response
|
|
186582
|
-
|
|
186583
|
-
error:
|
|
186527
|
+
import_zod54.z.object({
|
|
186528
|
+
error: import_zod54.z.enum([
|
|
186584
186529
|
"api_error",
|
|
186585
186530
|
"rate_limit",
|
|
186586
186531
|
"timeout",
|
|
@@ -186588,8 +186533,8 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
186588
186533
|
"configuration_error",
|
|
186589
186534
|
"unknown"
|
|
186590
186535
|
]),
|
|
186591
|
-
statusCode:
|
|
186592
|
-
message:
|
|
186536
|
+
statusCode: import_zod54.z.number().optional(),
|
|
186537
|
+
message: import_zod54.z.string()
|
|
186593
186538
|
})
|
|
186594
186539
|
])
|
|
186595
186540
|
)
|
|
@@ -186902,7 +186847,7 @@ var require_dist9 = __commonJS({
|
|
|
186902
186847
|
DefaultChatTransport: () => DefaultChatTransport,
|
|
186903
186848
|
DefaultGeneratedFile: () => DefaultGeneratedFile,
|
|
186904
186849
|
DirectChatTransport: () => DirectChatTransport,
|
|
186905
|
-
DownloadError: () =>
|
|
186850
|
+
DownloadError: () => import_provider_utils27.DownloadError,
|
|
186906
186851
|
EmptyResponseBodyError: () => import_provider212.EmptyResponseBodyError,
|
|
186907
186852
|
Experimental_Agent: () => ToolLoopAgent,
|
|
186908
186853
|
HttpChatTransport: () => HttpChatTransport,
|
|
@@ -186977,7 +186922,7 @@ var require_dist9 = __commonJS({
|
|
|
186977
186922
|
gateway: () => import_gateway3.gateway,
|
|
186978
186923
|
generateId: () => import_provider_utils39.generateId,
|
|
186979
186924
|
generateImage: () => generateImage,
|
|
186980
|
-
generateObject: () =>
|
|
186925
|
+
generateObject: () => generateObject6,
|
|
186981
186926
|
generateText: () => generateText2,
|
|
186982
186927
|
getStaticToolName: () => getStaticToolName,
|
|
186983
186928
|
getTextFromDataUrl: () => getTextFromDataUrl,
|
|
@@ -187429,7 +187374,7 @@ var require_dist9 = __commonJS({
|
|
|
187429
187374
|
}
|
|
187430
187375
|
};
|
|
187431
187376
|
_a182 = symbol182;
|
|
187432
|
-
var
|
|
187377
|
+
var import_provider_utils27 = require_dist6();
|
|
187433
187378
|
var import_provider202 = require_dist4();
|
|
187434
187379
|
var name19 = "AI_RetryError";
|
|
187435
187380
|
var marker19 = `vercel.ai.error.${name19}`;
|
|
@@ -187786,7 +187731,7 @@ var require_dist9 = __commonJS({
|
|
|
187786
187731
|
return timeout.chunkMs;
|
|
187787
187732
|
}
|
|
187788
187733
|
var import_provider_utils62 = require_dist6();
|
|
187789
|
-
var
|
|
187734
|
+
var import_provider_utils28 = require_dist6();
|
|
187790
187735
|
var imageMediaTypeSignatures = [
|
|
187791
187736
|
{
|
|
187792
187737
|
mediaType: "image/gif",
|
|
@@ -187984,7 +187929,7 @@ var require_dist9 = __commonJS({
|
|
|
187984
187929
|
}
|
|
187985
187930
|
];
|
|
187986
187931
|
var stripID3 = (data3) => {
|
|
187987
|
-
const bytes = typeof data3 === "string" ? (0,
|
|
187932
|
+
const bytes = typeof data3 === "string" ? (0, import_provider_utils28.convertBase64ToUint8Array)(data3) : data3;
|
|
187988
187933
|
const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
|
|
187989
187934
|
return bytes.slice(id3Size + 10);
|
|
187990
187935
|
};
|
|
@@ -187999,7 +187944,7 @@ var require_dist9 = __commonJS({
|
|
|
187999
187944
|
signatures
|
|
188000
187945
|
}) {
|
|
188001
187946
|
const processedData = stripID3TagsIfPresent(data3);
|
|
188002
|
-
const bytes = typeof processedData === "string" ? (0,
|
|
187947
|
+
const bytes = typeof processedData === "string" ? (0, import_provider_utils28.convertBase64ToUint8Array)(
|
|
188003
187948
|
processedData.substring(0, Math.min(processedData.length, 24))
|
|
188004
187949
|
) : processedData;
|
|
188005
187950
|
for (const signature of signatures) {
|
|
@@ -188060,7 +188005,7 @@ var require_dist9 = __commonJS({
|
|
|
188060
188005
|
);
|
|
188061
188006
|
var import_provider222 = require_dist4();
|
|
188062
188007
|
var import_provider_utils52 = require_dist6();
|
|
188063
|
-
var
|
|
188008
|
+
var import_v422 = require_v4();
|
|
188064
188009
|
function splitDataUrl(dataUrl) {
|
|
188065
188010
|
try {
|
|
188066
188011
|
const [header, base64Content] = dataUrl.split(",");
|
|
@@ -188075,11 +188020,11 @@ var require_dist9 = __commonJS({
|
|
|
188075
188020
|
};
|
|
188076
188021
|
}
|
|
188077
188022
|
}
|
|
188078
|
-
var dataContentSchema =
|
|
188079
|
-
|
|
188080
|
-
|
|
188081
|
-
|
|
188082
|
-
|
|
188023
|
+
var dataContentSchema = import_v422.z.union([
|
|
188024
|
+
import_v422.z.string(),
|
|
188025
|
+
import_v422.z.instanceof(Uint8Array),
|
|
188026
|
+
import_v422.z.instanceof(ArrayBuffer),
|
|
188027
|
+
import_v422.z.custom(
|
|
188083
188028
|
// Buffer might not be available in some environments such as CloudFlare:
|
|
188084
188029
|
(value2) => {
|
|
188085
188030
|
var _a212, _b17;
|
|
@@ -188674,15 +188619,15 @@ var require_dist9 = __commonJS({
|
|
|
188674
188619
|
var import_v462 = require_v4();
|
|
188675
188620
|
var import_v452 = require_v4();
|
|
188676
188621
|
var import_v432 = require_v4();
|
|
188677
|
-
var
|
|
188678
|
-
var jsonValueSchema =
|
|
188679
|
-
() =>
|
|
188680
|
-
|
|
188681
|
-
|
|
188682
|
-
|
|
188683
|
-
|
|
188684
|
-
|
|
188685
|
-
|
|
188622
|
+
var import_v423 = require_v4();
|
|
188623
|
+
var jsonValueSchema = import_v423.z.lazy(
|
|
188624
|
+
() => import_v423.z.union([
|
|
188625
|
+
import_v423.z.null(),
|
|
188626
|
+
import_v423.z.string(),
|
|
188627
|
+
import_v423.z.number(),
|
|
188628
|
+
import_v423.z.boolean(),
|
|
188629
|
+
import_v423.z.record(import_v423.z.string(), jsonValueSchema.optional()),
|
|
188630
|
+
import_v423.z.array(jsonValueSchema)
|
|
188686
188631
|
])
|
|
188687
188632
|
);
|
|
188688
188633
|
var providerMetadataSchema = import_v432.z.record(
|
|
@@ -196576,7 +196521,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196576
196521
|
}
|
|
196577
196522
|
}
|
|
196578
196523
|
var originalGenerateId3 = (0, import_provider_utils282.createIdGenerator)({ prefix: "aiobj", size: 24 });
|
|
196579
|
-
async function
|
|
196524
|
+
async function generateObject6(options8) {
|
|
196580
196525
|
const {
|
|
196581
196526
|
model: modelArg,
|
|
196582
196527
|
output = "object",
|
|
@@ -196844,7 +196789,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196844
196789
|
});
|
|
196845
196790
|
}
|
|
196846
196791
|
};
|
|
196847
|
-
var
|
|
196792
|
+
var import_provider_utils30 = require_dist6();
|
|
196848
196793
|
function cosineSimilarity(vector1, vector2) {
|
|
196849
196794
|
if (vector1.length !== vector2.length) {
|
|
196850
196795
|
throw new InvalidArgumentError2({
|
|
@@ -196947,7 +196892,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196947
196892
|
});
|
|
196948
196893
|
}
|
|
196949
196894
|
};
|
|
196950
|
-
var
|
|
196895
|
+
var import_provider_utils29 = require_dist6();
|
|
196951
196896
|
function simulateReadableStream({
|
|
196952
196897
|
chunks,
|
|
196953
196898
|
initialDelayInMs = 0,
|
|
@@ -196955,7 +196900,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196955
196900
|
_internal
|
|
196956
196901
|
}) {
|
|
196957
196902
|
var _a212;
|
|
196958
|
-
const delay22 = (_a212 = _internal == null ? void 0 : _internal.delay) != null ? _a212 :
|
|
196903
|
+
const delay22 = (_a212 = _internal == null ? void 0 : _internal.delay) != null ? _a212 : import_provider_utils29.delay;
|
|
196959
196904
|
let index2 = 0;
|
|
196960
196905
|
return new ReadableStream({
|
|
196961
196906
|
async pull(controller) {
|
|
@@ -196968,7 +196913,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196968
196913
|
}
|
|
196969
196914
|
});
|
|
196970
196915
|
}
|
|
196971
|
-
var originalGenerateId4 = (0,
|
|
196916
|
+
var originalGenerateId4 = (0, import_provider_utils30.createIdGenerator)({ prefix: "aiobj", size: 24 });
|
|
196972
196917
|
function streamObject(options8) {
|
|
196973
196918
|
const {
|
|
196974
196919
|
model,
|
|
@@ -197058,13 +197003,13 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
197058
197003
|
currentDate,
|
|
197059
197004
|
now: now2
|
|
197060
197005
|
}) {
|
|
197061
|
-
this._object = new
|
|
197062
|
-
this._usage = new
|
|
197063
|
-
this._providerMetadata = new
|
|
197064
|
-
this._warnings = new
|
|
197065
|
-
this._request = new
|
|
197066
|
-
this._response = new
|
|
197067
|
-
this._finishReason = new
|
|
197006
|
+
this._object = new import_provider_utils30.DelayedPromise();
|
|
197007
|
+
this._usage = new import_provider_utils30.DelayedPromise();
|
|
197008
|
+
this._providerMetadata = new import_provider_utils30.DelayedPromise();
|
|
197009
|
+
this._warnings = new import_provider_utils30.DelayedPromise();
|
|
197010
|
+
this._request = new import_provider_utils30.DelayedPromise();
|
|
197011
|
+
this._response = new import_provider_utils30.DelayedPromise();
|
|
197012
|
+
this._finishReason = new import_provider_utils30.DelayedPromise();
|
|
197068
197013
|
const model = resolveLanguageModel(modelArg);
|
|
197069
197014
|
const { maxRetries, retry } = prepareRetries({
|
|
197070
197015
|
maxRetries: maxRetriesArg,
|
|
@@ -234035,15 +233980,15 @@ var require_lib9 = __commonJS({
|
|
|
234035
233980
|
var require_esprima = __commonJS({
|
|
234036
233981
|
"../../../../node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.js"(exports2, module2) {
|
|
234037
233982
|
init_cjs_shims();
|
|
234038
|
-
(function webpackUniversalModuleDefinition(root3,
|
|
233983
|
+
(function webpackUniversalModuleDefinition(root3, factory9) {
|
|
234039
233984
|
if (typeof exports2 === "object" && typeof module2 === "object")
|
|
234040
|
-
module2.exports =
|
|
233985
|
+
module2.exports = factory9();
|
|
234041
233986
|
else if (typeof define === "function" && define.amd)
|
|
234042
|
-
define([],
|
|
233987
|
+
define([], factory9);
|
|
234043
233988
|
else if (typeof exports2 === "object")
|
|
234044
|
-
exports2["esprima"] =
|
|
233989
|
+
exports2["esprima"] = factory9();
|
|
234045
233990
|
else
|
|
234046
|
-
root3["esprima"] =
|
|
233991
|
+
root3["esprima"] = factory9();
|
|
234047
233992
|
})(exports2, function() {
|
|
234048
233993
|
return (
|
|
234049
233994
|
/******/
|
|
@@ -255801,18 +255746,18 @@ var require_scope2 = __commonJS({
|
|
|
255801
255746
|
var require_sourcemap_codec_umd = __commonJS({
|
|
255802
255747
|
"../../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports2, module2) {
|
|
255803
255748
|
init_cjs_shims();
|
|
255804
|
-
(function(global2,
|
|
255749
|
+
(function(global2, factory9) {
|
|
255805
255750
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
255806
|
-
|
|
255751
|
+
factory9(module2);
|
|
255807
255752
|
module2.exports = def(module2);
|
|
255808
255753
|
} else if (typeof define === "function" && define.amd) {
|
|
255809
255754
|
define(["module"], function(mod2) {
|
|
255810
|
-
|
|
255755
|
+
factory9.apply(this, arguments);
|
|
255811
255756
|
mod2.exports = def(mod2);
|
|
255812
255757
|
});
|
|
255813
255758
|
} else {
|
|
255814
255759
|
const mod2 = { exports: {} };
|
|
255815
|
-
|
|
255760
|
+
factory9(mod2);
|
|
255816
255761
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
255817
255762
|
global2.sourcemapCodec = def(mod2);
|
|
255818
255763
|
}
|
|
@@ -256263,8 +256208,8 @@ var require_sourcemap_codec_umd = __commonJS({
|
|
|
256263
256208
|
var require_resolve_uri_umd = __commonJS({
|
|
256264
256209
|
"../../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports2, module2) {
|
|
256265
256210
|
init_cjs_shims();
|
|
256266
|
-
(function(global2,
|
|
256267
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports =
|
|
256211
|
+
(function(global2, factory9) {
|
|
256212
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory9() : typeof define === "function" && define.amd ? define(factory9) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.resolveURI = factory9());
|
|
256268
256213
|
})(exports2, (function() {
|
|
256269
256214
|
"use strict";
|
|
256270
256215
|
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
@@ -256443,18 +256388,18 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
256443
256388
|
var require_trace_mapping_umd = __commonJS({
|
|
256444
256389
|
"../../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
|
|
256445
256390
|
init_cjs_shims();
|
|
256446
|
-
(function(global2,
|
|
256391
|
+
(function(global2, factory9) {
|
|
256447
256392
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
256448
|
-
|
|
256393
|
+
factory9(module2, require_resolve_uri_umd(), require_sourcemap_codec_umd());
|
|
256449
256394
|
module2.exports = def(module2);
|
|
256450
256395
|
} else if (typeof define === "function" && define.amd) {
|
|
256451
256396
|
define(["module", "@jridgewell/resolve-uri", "@jridgewell/sourcemap-codec"], function(mod2) {
|
|
256452
|
-
|
|
256397
|
+
factory9.apply(this, arguments);
|
|
256453
256398
|
mod2.exports = def(mod2);
|
|
256454
256399
|
});
|
|
256455
256400
|
} else {
|
|
256456
256401
|
const mod2 = { exports: {} };
|
|
256457
|
-
|
|
256402
|
+
factory9(mod2, global2.resolveURI, global2.sourcemapCodec);
|
|
256458
256403
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
256459
256404
|
global2.traceMapping = def(mod2);
|
|
256460
256405
|
}
|
|
@@ -256984,18 +256929,18 @@ var require_trace_mapping_umd = __commonJS({
|
|
|
256984
256929
|
var require_gen_mapping_umd = __commonJS({
|
|
256985
256930
|
"../../../../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"(exports2, module2) {
|
|
256986
256931
|
init_cjs_shims();
|
|
256987
|
-
(function(global2,
|
|
256932
|
+
(function(global2, factory9) {
|
|
256988
256933
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
256989
|
-
|
|
256934
|
+
factory9(module2, require_sourcemap_codec_umd(), require_trace_mapping_umd());
|
|
256990
256935
|
module2.exports = def(module2);
|
|
256991
256936
|
} else if (typeof define === "function" && define.amd) {
|
|
256992
256937
|
define(["module", "@jridgewell/sourcemap-codec", "@jridgewell/trace-mapping"], function(mod2) {
|
|
256993
|
-
|
|
256938
|
+
factory9.apply(this, arguments);
|
|
256994
256939
|
mod2.exports = def(mod2);
|
|
256995
256940
|
});
|
|
256996
256941
|
} else {
|
|
256997
256942
|
const mod2 = { exports: {} };
|
|
256998
|
-
|
|
256943
|
+
factory9(mod2, global2.sourcemapCodec, global2.traceMapping);
|
|
256999
256944
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
257000
256945
|
global2.genMapping = def(mod2);
|
|
257001
256946
|
}
|
|
@@ -257336,18 +257281,18 @@ var require_gen_mapping_umd = __commonJS({
|
|
|
257336
257281
|
var require_trace_mapping_umd2 = __commonJS({
|
|
257337
257282
|
"../../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.30/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
|
|
257338
257283
|
init_cjs_shims();
|
|
257339
|
-
(function(global2,
|
|
257284
|
+
(function(global2, factory9) {
|
|
257340
257285
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
257341
|
-
|
|
257286
|
+
factory9(module2, require_resolve_uri_umd(), require_sourcemap_codec_umd());
|
|
257342
257287
|
module2.exports = def(module2);
|
|
257343
257288
|
} else if (typeof define === "function" && define.amd) {
|
|
257344
257289
|
define(["module", "@jridgewell/resolve-uri", "@jridgewell/sourcemap-codec"], function(mod2) {
|
|
257345
|
-
|
|
257290
|
+
factory9.apply(this, arguments);
|
|
257346
257291
|
mod2.exports = def(mod2);
|
|
257347
257292
|
});
|
|
257348
257293
|
} else {
|
|
257349
257294
|
const mod2 = { exports: {} };
|
|
257350
|
-
|
|
257295
|
+
factory9(mod2, global2.resolveURI, global2.sourcemapCodec);
|
|
257351
257296
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
257352
257297
|
global2.traceMapping = def(mod2);
|
|
257353
257298
|
}
|
|
@@ -292530,8 +292475,8 @@ var require_utils24 = __commonJS({
|
|
|
292530
292475
|
var require_acorn = __commonJS({
|
|
292531
292476
|
"../../../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.js"(exports2, module2) {
|
|
292532
292477
|
init_cjs_shims();
|
|
292533
|
-
(function(global2,
|
|
292534
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
292478
|
+
(function(global2, factory9) {
|
|
292479
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory9(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory9) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory9(global2.acorn = {}));
|
|
292535
292480
|
})(exports2, (function(exports3) {
|
|
292536
292481
|
"use strict";
|
|
292537
292482
|
var astralIdentifierCodes2 = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
@@ -332687,11 +332632,11 @@ var require_ignore = __commonJS({
|
|
|
332687
332632
|
return this._test(path77, this._testCache, true);
|
|
332688
332633
|
}
|
|
332689
332634
|
};
|
|
332690
|
-
var
|
|
332635
|
+
var factory9 = (options8) => new Ignore2(options8);
|
|
332691
332636
|
var isPathValid = (path77) => checkPath(path77 && checkPath.convert(path77), path77, RETURN_FALSE);
|
|
332692
|
-
|
|
332693
|
-
|
|
332694
|
-
module2.exports =
|
|
332637
|
+
factory9.isPathValid = isPathValid;
|
|
332638
|
+
factory9.default = factory9;
|
|
332639
|
+
module2.exports = factory9;
|
|
332695
332640
|
if (
|
|
332696
332641
|
// Detect `process` so that it can run in browsers.
|
|
332697
332642
|
typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
|
|
@@ -351640,7 +351585,7 @@ var require_token_store = __commonJS({
|
|
|
351640
351585
|
}
|
|
351641
351586
|
return map3;
|
|
351642
351587
|
}
|
|
351643
|
-
function createCursorWithSkip(
|
|
351588
|
+
function createCursorWithSkip(factory9, tokens, comments, indexMap, startLoc, endLoc, opts) {
|
|
351644
351589
|
let includeComments = false;
|
|
351645
351590
|
let skip2 = 0;
|
|
351646
351591
|
let filter9 = null;
|
|
@@ -351658,7 +351603,7 @@ var require_token_store = __commonJS({
|
|
|
351658
351603
|
!filter9 || typeof filter9 === "function",
|
|
351659
351604
|
"options.filter should be a function."
|
|
351660
351605
|
);
|
|
351661
|
-
return
|
|
351606
|
+
return factory9.createCursor(
|
|
351662
351607
|
tokens,
|
|
351663
351608
|
comments,
|
|
351664
351609
|
indexMap,
|
|
@@ -351670,7 +351615,7 @@ var require_token_store = __commonJS({
|
|
|
351670
351615
|
-1
|
|
351671
351616
|
);
|
|
351672
351617
|
}
|
|
351673
|
-
function createCursorWithCount(
|
|
351618
|
+
function createCursorWithCount(factory9, tokens, comments, indexMap, startLoc, endLoc, opts) {
|
|
351674
351619
|
let includeComments = false;
|
|
351675
351620
|
let count = 0;
|
|
351676
351621
|
let countExists = false;
|
|
@@ -351691,7 +351636,7 @@ var require_token_store = __commonJS({
|
|
|
351691
351636
|
!filter9 || typeof filter9 === "function",
|
|
351692
351637
|
"options.filter should be a function."
|
|
351693
351638
|
);
|
|
351694
|
-
return
|
|
351639
|
+
return factory9.createCursor(
|
|
351695
351640
|
tokens,
|
|
351696
351641
|
comments,
|
|
351697
351642
|
indexMap,
|
|
@@ -355771,7 +355716,7 @@ var require_Num = __commonJS({
|
|
|
355771
355716
|
var acos;
|
|
355772
355717
|
var atan;
|
|
355773
355718
|
var atan2;
|
|
355774
|
-
var
|
|
355719
|
+
var truncate;
|
|
355775
355720
|
var round;
|
|
355776
355721
|
var ceiling;
|
|
355777
355722
|
var floor;
|
|
@@ -355832,7 +355777,7 @@ var require_Num = __commonJS({
|
|
|
355832
355777
|
atan2 = curry$(function(x, y) {
|
|
355833
355778
|
return Math.atan2(x, y);
|
|
355834
355779
|
});
|
|
355835
|
-
|
|
355780
|
+
truncate = function(x) {
|
|
355836
355781
|
return ~~x;
|
|
355837
355782
|
};
|
|
355838
355783
|
round = Math.round;
|
|
@@ -355885,7 +355830,7 @@ var require_Num = __commonJS({
|
|
|
355885
355830
|
asin,
|
|
355886
355831
|
atan,
|
|
355887
355832
|
atan2,
|
|
355888
|
-
truncate
|
|
355833
|
+
truncate,
|
|
355889
355834
|
round,
|
|
355890
355835
|
ceiling,
|
|
355891
355836
|
floor,
|
|
@@ -381237,7 +381182,7 @@ var require_config_loader = __commonJS({
|
|
|
381237
381182
|
* @returns {Promise<{createJiti: Function|undefined, version: string;}>} A promise that fulfills with an object containing the jiti module's createJiti function and version.
|
|
381238
381183
|
*/
|
|
381239
381184
|
static async loadJiti() {
|
|
381240
|
-
const { createJiti } = await import("./jiti-
|
|
381185
|
+
const { createJiti } = await import("./jiti-EJ36EOMK.js");
|
|
381241
381186
|
const version5 = require_package6().version;
|
|
381242
381187
|
return { createJiti, version: version5 };
|
|
381243
381188
|
}
|
|
@@ -381566,7 +381511,7 @@ var require_eslint_helpers = __commonJS({
|
|
|
381566
381511
|
}
|
|
381567
381512
|
async function globMatch({ basePath, pattern }) {
|
|
381568
381513
|
let found = false;
|
|
381569
|
-
const { hfs } = await import("./src-
|
|
381514
|
+
const { hfs } = await import("./src-DWCFAABS.js");
|
|
381570
381515
|
const patternToUse = normalizeToPosix(path77.relative(basePath, pattern));
|
|
381571
381516
|
const matcher = new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
|
|
381572
381517
|
const walkSettings = {
|
|
@@ -381606,7 +381551,7 @@ var require_eslint_helpers = __commonJS({
|
|
|
381606
381551
|
return new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
|
|
381607
381552
|
});
|
|
381608
381553
|
const unmatchedPatterns = /* @__PURE__ */ new Set([...relativeToPatterns.keys()]);
|
|
381609
|
-
const { hfs } = await import("./src-
|
|
381554
|
+
const { hfs } = await import("./src-DWCFAABS.js");
|
|
381610
381555
|
const walk2 = hfs.walk(basePath, {
|
|
381611
381556
|
async directoryFilter(entry) {
|
|
381612
381557
|
if (!matchers.some((matcher) => matcher.match(entry.path, true))) {
|
|
@@ -382629,7 +382574,7 @@ var require_eslint = __commonJS({
|
|
|
382629
382574
|
"../../../../node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules/eslint/lib/eslint/eslint.js"(exports2, module2) {
|
|
382630
382575
|
"use strict";
|
|
382631
382576
|
init_cjs_shims();
|
|
382632
|
-
var { existsSync:
|
|
382577
|
+
var { existsSync: existsSync5 } = __require("node:fs");
|
|
382633
382578
|
var fs44 = __require("node:fs/promises");
|
|
382634
382579
|
var os8 = __require("node:os");
|
|
382635
382580
|
var path77 = __require("node:path");
|
|
@@ -383037,7 +382982,7 @@ var require_eslint = __commonJS({
|
|
|
383037
382982
|
configLoader: this.#configLoader,
|
|
383038
382983
|
warningService
|
|
383039
382984
|
});
|
|
383040
|
-
if (
|
|
382985
|
+
if (existsSync5(path77.resolve(processedOptions.cwd, ".eslintignore"))) {
|
|
383041
382986
|
warningService.emitESLintIgnoreWarning();
|
|
383042
382987
|
}
|
|
383043
382988
|
}
|
|
@@ -383205,11 +383150,11 @@ var require_eslint = __commonJS({
|
|
|
383205
383150
|
if (!lintResultCache && cacheFilePath) {
|
|
383206
383151
|
debug3(`Deleting cache file at ${cacheFilePath}`);
|
|
383207
383152
|
try {
|
|
383208
|
-
if (
|
|
383153
|
+
if (existsSync5(cacheFilePath)) {
|
|
383209
383154
|
await fs44.unlink(cacheFilePath);
|
|
383210
383155
|
}
|
|
383211
383156
|
} catch (error40) {
|
|
383212
|
-
if (
|
|
383157
|
+
if (existsSync5(cacheFilePath)) {
|
|
383213
383158
|
throw error40;
|
|
383214
383159
|
}
|
|
383215
383160
|
}
|
|
@@ -390585,8 +390530,8 @@ var require_readdir_glob = __commonJS({
|
|
|
390585
390530
|
var require_async9 = __commonJS({
|
|
390586
390531
|
"../../../../node_modules/.pnpm/async@3.2.6/node_modules/async/dist/async.js"(exports2, module2) {
|
|
390587
390532
|
init_cjs_shims();
|
|
390588
|
-
(function(global2,
|
|
390589
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
390533
|
+
(function(global2, factory9) {
|
|
390534
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory9(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory9) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory9(global2.async = {}));
|
|
390590
390535
|
})(exports2, (function(exports3) {
|
|
390591
390536
|
"use strict";
|
|
390592
390537
|
function apply(fn, ...args) {
|
|
@@ -408918,21 +408863,21 @@ var require_crc32 = __commonJS({
|
|
|
408918
408863
|
"../../../../node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/crc32.js"(exports2) {
|
|
408919
408864
|
init_cjs_shims();
|
|
408920
408865
|
var CRC32;
|
|
408921
|
-
(function(
|
|
408866
|
+
(function(factory9) {
|
|
408922
408867
|
if (typeof DO_NOT_EXPORT_CRC === "undefined") {
|
|
408923
408868
|
if ("object" === typeof exports2) {
|
|
408924
|
-
|
|
408869
|
+
factory9(exports2);
|
|
408925
408870
|
} else if ("function" === typeof define && define.amd) {
|
|
408926
408871
|
define(function() {
|
|
408927
408872
|
var module3 = {};
|
|
408928
|
-
|
|
408873
|
+
factory9(module3);
|
|
408929
408874
|
return module3;
|
|
408930
408875
|
});
|
|
408931
408876
|
} else {
|
|
408932
|
-
|
|
408877
|
+
factory9(CRC32 = {});
|
|
408933
408878
|
}
|
|
408934
408879
|
} else {
|
|
408935
|
-
|
|
408880
|
+
factory9(CRC32 = {});
|
|
408936
408881
|
}
|
|
408937
408882
|
})(function(CRC322) {
|
|
408938
408883
|
CRC322.version = "1.2.2";
|
|
@@ -444660,7 +444605,7 @@ var require_pool2 = __commonJS({
|
|
|
444660
444605
|
var Pool = class extends PoolBase {
|
|
444661
444606
|
constructor(origin2, {
|
|
444662
444607
|
connections,
|
|
444663
|
-
factory:
|
|
444608
|
+
factory: factory9 = defaultFactory,
|
|
444664
444609
|
connect,
|
|
444665
444610
|
connectTimeout,
|
|
444666
444611
|
tls,
|
|
@@ -444675,7 +444620,7 @@ var require_pool2 = __commonJS({
|
|
|
444675
444620
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
|
|
444676
444621
|
throw new InvalidArgumentError2("invalid connections");
|
|
444677
444622
|
}
|
|
444678
|
-
if (typeof
|
|
444623
|
+
if (typeof factory9 !== "function") {
|
|
444679
444624
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444680
444625
|
}
|
|
444681
444626
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
@@ -444697,7 +444642,7 @@ var require_pool2 = __commonJS({
|
|
|
444697
444642
|
this[kUrl] = util5.parseOrigin(origin2);
|
|
444698
444643
|
this[kOptions] = { ...util5.deepClone(options8), connect, allowH2, clientTtl };
|
|
444699
444644
|
this[kOptions].interceptors = options8.interceptors ? { ...options8.interceptors } : void 0;
|
|
444700
|
-
this[kFactory] =
|
|
444645
|
+
this[kFactory] = factory9;
|
|
444701
444646
|
this.on("connect", (origin3, targets) => {
|
|
444702
444647
|
if (clientTtl != null && clientTtl > 0) {
|
|
444703
444648
|
for (const target of targets) {
|
|
@@ -444775,8 +444720,8 @@ var require_balanced_pool = __commonJS({
|
|
|
444775
444720
|
return new Pool(origin2, opts);
|
|
444776
444721
|
}
|
|
444777
444722
|
var BalancedPool = class extends PoolBase {
|
|
444778
|
-
constructor(upstreams = [], { factory:
|
|
444779
|
-
if (typeof
|
|
444723
|
+
constructor(upstreams = [], { factory: factory9 = defaultFactory, ...opts } = {}) {
|
|
444724
|
+
if (typeof factory9 !== "function") {
|
|
444780
444725
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444781
444726
|
}
|
|
444782
444727
|
super();
|
|
@@ -444788,7 +444733,7 @@ var require_balanced_pool = __commonJS({
|
|
|
444788
444733
|
if (!Array.isArray(upstreams)) {
|
|
444789
444734
|
upstreams = [upstreams];
|
|
444790
444735
|
}
|
|
444791
|
-
this[kFactory] =
|
|
444736
|
+
this[kFactory] = factory9;
|
|
444792
444737
|
for (const upstream of upstreams) {
|
|
444793
444738
|
this.addUpstream(upstream);
|
|
444794
444739
|
}
|
|
@@ -444912,7 +444857,7 @@ var require_round_robin_pool = __commonJS({
|
|
|
444912
444857
|
var RoundRobinPool = class extends PoolBase {
|
|
444913
444858
|
constructor(origin2, {
|
|
444914
444859
|
connections,
|
|
444915
|
-
factory:
|
|
444860
|
+
factory: factory9 = defaultFactory,
|
|
444916
444861
|
connect,
|
|
444917
444862
|
connectTimeout,
|
|
444918
444863
|
tls,
|
|
@@ -444927,7 +444872,7 @@ var require_round_robin_pool = __commonJS({
|
|
|
444927
444872
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
|
|
444928
444873
|
throw new InvalidArgumentError2("invalid connections");
|
|
444929
444874
|
}
|
|
444930
|
-
if (typeof
|
|
444875
|
+
if (typeof factory9 !== "function") {
|
|
444931
444876
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444932
444877
|
}
|
|
444933
444878
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
@@ -444949,7 +444894,7 @@ var require_round_robin_pool = __commonJS({
|
|
|
444949
444894
|
this[kUrl] = util5.parseOrigin(origin2);
|
|
444950
444895
|
this[kOptions] = { ...util5.deepClone(options8), connect, allowH2, clientTtl };
|
|
444951
444896
|
this[kOptions].interceptors = options8.interceptors ? { ...options8.interceptors } : void 0;
|
|
444952
|
-
this[kFactory] =
|
|
444897
|
+
this[kFactory] = factory9;
|
|
444953
444898
|
this[kIndex] = -1;
|
|
444954
444899
|
this.on("connect", (origin3, targets) => {
|
|
444955
444900
|
if (clientTtl != null && clientTtl > 0) {
|
|
@@ -445022,8 +444967,8 @@ var require_agent4 = __commonJS({
|
|
|
445022
444967
|
return opts && opts.connections === 1 ? new Client2(origin2, opts) : new Pool(origin2, opts);
|
|
445023
444968
|
}
|
|
445024
444969
|
var Agent3 = class extends DispatcherBase {
|
|
445025
|
-
constructor({ factory:
|
|
445026
|
-
if (typeof
|
|
444970
|
+
constructor({ factory: factory9 = defaultFactory, maxOrigins = Infinity, connect, ...options8 } = {}) {
|
|
444971
|
+
if (typeof factory9 !== "function") {
|
|
445027
444972
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
445028
444973
|
}
|
|
445029
444974
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
@@ -445037,7 +444982,7 @@ var require_agent4 = __commonJS({
|
|
|
445037
444982
|
connect = { ...connect };
|
|
445038
444983
|
}
|
|
445039
444984
|
this[kOptions] = { ...util5.deepClone(options8), maxOrigins, connect };
|
|
445040
|
-
this[kFactory] =
|
|
444985
|
+
this[kFactory] = factory9;
|
|
445041
444986
|
this[kClients] = /* @__PURE__ */ new Map();
|
|
445042
444987
|
this[kOrigins] = /* @__PURE__ */ new Set();
|
|
445043
444988
|
this[kOnDrain] = (origin2, targets) => {
|
|
@@ -445168,14 +445113,14 @@ var require_proxy_agent = __commonJS({
|
|
|
445168
445113
|
}
|
|
445169
445114
|
var Http1ProxyWrapper = class extends DispatcherBase {
|
|
445170
445115
|
#client;
|
|
445171
|
-
constructor(proxyUrl, { headers = {}, connect, factory:
|
|
445116
|
+
constructor(proxyUrl, { headers = {}, connect, factory: factory9 }) {
|
|
445172
445117
|
if (!proxyUrl) {
|
|
445173
445118
|
throw new InvalidArgumentError2("Proxy URL is mandatory");
|
|
445174
445119
|
}
|
|
445175
445120
|
super();
|
|
445176
445121
|
this[kProxyHeaders] = headers;
|
|
445177
|
-
if (
|
|
445178
|
-
this.#client =
|
|
445122
|
+
if (factory9) {
|
|
445123
|
+
this.#client = factory9(proxyUrl, { connect });
|
|
445179
445124
|
} else {
|
|
445180
445125
|
this.#client = new Client2(proxyUrl, { connect });
|
|
445181
445126
|
}
|
|
@@ -445241,7 +445186,7 @@ var require_proxy_agent = __commonJS({
|
|
|
445241
445186
|
const connect = buildConnector({ ...opts.proxyTls });
|
|
445242
445187
|
this[kConnectEndpoint] = buildConnector({ ...opts.requestTls });
|
|
445243
445188
|
const agentFactory = opts.factory || defaultAgentFactory;
|
|
445244
|
-
const
|
|
445189
|
+
const factory9 = (origin3, options8) => {
|
|
445245
445190
|
const { protocol: protocol2 } = new URL(origin3);
|
|
445246
445191
|
if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") {
|
|
445247
445192
|
return new Http1ProxyWrapper(this[kProxy].uri, {
|
|
@@ -445255,7 +445200,7 @@ var require_proxy_agent = __commonJS({
|
|
|
445255
445200
|
this[kClient] = clientFactory(url4, { connect });
|
|
445256
445201
|
this[kAgent] = new Agent3({
|
|
445257
445202
|
...opts,
|
|
445258
|
-
factory:
|
|
445203
|
+
factory: factory9,
|
|
445259
445204
|
connect: async (opts2, callback) => {
|
|
445260
445205
|
let requestedPath = opts2.host;
|
|
445261
445206
|
if (!opts2.port) {
|
|
@@ -446532,7 +446477,7 @@ var require_api_stream = __commonJS({
|
|
|
446532
446477
|
function noop7() {
|
|
446533
446478
|
}
|
|
446534
446479
|
var StreamHandler = class extends AsyncResource {
|
|
446535
|
-
constructor(opts,
|
|
446480
|
+
constructor(opts, factory9, callback) {
|
|
446536
446481
|
if (!opts || typeof opts !== "object") {
|
|
446537
446482
|
throw new InvalidArgumentError2("invalid opts");
|
|
446538
446483
|
}
|
|
@@ -446541,7 +446486,7 @@ var require_api_stream = __commonJS({
|
|
|
446541
446486
|
if (typeof callback !== "function") {
|
|
446542
446487
|
throw new InvalidArgumentError2("invalid callback");
|
|
446543
446488
|
}
|
|
446544
|
-
if (typeof
|
|
446489
|
+
if (typeof factory9 !== "function") {
|
|
446545
446490
|
throw new InvalidArgumentError2("invalid factory");
|
|
446546
446491
|
}
|
|
446547
446492
|
if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
|
|
@@ -446562,7 +446507,7 @@ var require_api_stream = __commonJS({
|
|
|
446562
446507
|
}
|
|
446563
446508
|
this.responseHeaders = responseHeaders || null;
|
|
446564
446509
|
this.opaque = opaque || null;
|
|
446565
|
-
this.factory =
|
|
446510
|
+
this.factory = factory9;
|
|
446566
446511
|
this.callback = callback;
|
|
446567
446512
|
this.res = null;
|
|
446568
446513
|
this.abort = null;
|
|
@@ -446587,7 +446532,7 @@ var require_api_stream = __commonJS({
|
|
|
446587
446532
|
this.context = context;
|
|
446588
446533
|
}
|
|
446589
446534
|
onHeaders(statusCode, rawHeaders, resume, statusMessage) {
|
|
446590
|
-
const { factory:
|
|
446535
|
+
const { factory: factory9, opaque, context, responseHeaders } = this;
|
|
446591
446536
|
const headers = responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
|
|
446592
446537
|
if (statusCode < 200) {
|
|
446593
446538
|
if (this.onInfo) {
|
|
@@ -446596,10 +446541,10 @@ var require_api_stream = __commonJS({
|
|
|
446596
446541
|
return;
|
|
446597
446542
|
}
|
|
446598
446543
|
this.factory = null;
|
|
446599
|
-
if (
|
|
446544
|
+
if (factory9 === null) {
|
|
446600
446545
|
return;
|
|
446601
446546
|
}
|
|
446602
|
-
const res = this.runInAsyncScope(
|
|
446547
|
+
const res = this.runInAsyncScope(factory9, null, {
|
|
446603
446548
|
statusCode,
|
|
446604
446549
|
headers,
|
|
446605
446550
|
opaque,
|
|
@@ -446657,16 +446602,16 @@ var require_api_stream = __commonJS({
|
|
|
446657
446602
|
}
|
|
446658
446603
|
}
|
|
446659
446604
|
};
|
|
446660
|
-
function stream5(opts,
|
|
446605
|
+
function stream5(opts, factory9, callback) {
|
|
446661
446606
|
if (callback === void 0) {
|
|
446662
446607
|
return new Promise((resolve9, reject) => {
|
|
446663
|
-
stream5.call(this, opts,
|
|
446608
|
+
stream5.call(this, opts, factory9, (err, data3) => {
|
|
446664
446609
|
return err ? reject(err) : resolve9(data3);
|
|
446665
446610
|
});
|
|
446666
446611
|
});
|
|
446667
446612
|
}
|
|
446668
446613
|
try {
|
|
446669
|
-
const handler = new StreamHandler(opts,
|
|
446614
|
+
const handler = new StreamHandler(opts, factory9, callback);
|
|
446670
446615
|
this.dispatch(opts, handler);
|
|
446671
446616
|
} catch (err) {
|
|
446672
446617
|
if (typeof callback !== "function") {
|
|
@@ -484024,10 +483969,10 @@ var require_full = __commonJS({
|
|
|
484024
483969
|
const externalDependencies = [];
|
|
484025
483970
|
let item = value2;
|
|
484026
483971
|
if (typeof value2 === "function") {
|
|
484027
|
-
const
|
|
483972
|
+
const factory9 = (0, _async.maybeAsync)(value2, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
|
|
484028
483973
|
const api = Object.assign({}, context, apiFactory(cache3, externalDependencies));
|
|
484029
483974
|
try {
|
|
484030
|
-
item = yield*
|
|
483975
|
+
item = yield* factory9(api, options8, dirname19);
|
|
484031
483976
|
} catch (e) {
|
|
484032
483977
|
if (alias) {
|
|
484033
483978
|
e.message += ` (While processing: ${JSON.stringify(alias)})`;
|
|
@@ -485243,8 +485188,8 @@ var require_normalize_file = __commonJS({
|
|
|
485243
485188
|
var require_remapping_umd = __commonJS({
|
|
485244
485189
|
"../../../../node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/dist/remapping.umd.js"(exports2, module2) {
|
|
485245
485190
|
init_cjs_shims();
|
|
485246
|
-
(function(global2,
|
|
485247
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports =
|
|
485191
|
+
(function(global2, factory9) {
|
|
485192
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory9(require_trace_mapping_umd(), require_gen_mapping_umd()) : typeof define === "function" && define.amd ? define(["@jridgewell/trace-mapping", "@jridgewell/gen-mapping"], factory9) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.remapping = factory9(global2.traceMapping, global2.genMapping));
|
|
485248
485193
|
})(exports2, (function(traceMapping, genMapping) {
|
|
485249
485194
|
"use strict";
|
|
485250
485195
|
const SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
|
|
@@ -511748,7 +511693,7 @@ var require_axios = __commonJS({
|
|
|
511748
511693
|
return false;
|
|
511749
511694
|
}
|
|
511750
511695
|
};
|
|
511751
|
-
var
|
|
511696
|
+
var factory9 = (env2) => {
|
|
511752
511697
|
env2 = utils$1.merge.call({
|
|
511753
511698
|
skipUndefined: true
|
|
511754
511699
|
}, globalFetchAPI2, env2);
|
|
@@ -511932,7 +511877,7 @@ var require_axios = __commonJS({
|
|
|
511932
511877
|
while (i--) {
|
|
511933
511878
|
seed = seeds[i];
|
|
511934
511879
|
target = map3.get(seed);
|
|
511935
|
-
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() :
|
|
511880
|
+
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() : factory9(env2));
|
|
511936
511881
|
map3 = target;
|
|
511937
511882
|
}
|
|
511938
511883
|
return target;
|
|
@@ -520579,7 +520524,7 @@ init_cjs_shims();
|
|
|
520579
520524
|
// ../sdk/package.json
|
|
520580
520525
|
var package_default = {
|
|
520581
520526
|
name: "@superblocksteam/sdk",
|
|
520582
|
-
version: "2.0.110
|
|
520527
|
+
version: "2.0.110",
|
|
520583
520528
|
description: "Superblocks JS SDK",
|
|
520584
520529
|
homepage: "https://www.superblocks.com",
|
|
520585
520530
|
license: "Superblocks Community Software License",
|
|
@@ -520933,7 +520878,7 @@ var config = void 0;
|
|
|
520933
520878
|
var configured = false;
|
|
520934
520879
|
var ddTracePromise = void 0;
|
|
520935
520880
|
async function getDdTrace() {
|
|
520936
|
-
ddTracePromise ??= import("./dd-trace-
|
|
520881
|
+
ddTracePromise ??= import("./dd-trace-TMWNM5TU.js").then((module2) => module2.default);
|
|
520937
520882
|
return await ddTracePromise;
|
|
520938
520883
|
}
|
|
520939
520884
|
var deploymentType = (() => {
|
|
@@ -524974,7 +524919,7 @@ init_cjs_shims();
|
|
|
524974
524919
|
|
|
524975
524920
|
// ../../../vite-plugin-file-sync/dist/ai-service/index.js
|
|
524976
524921
|
init_cjs_shims();
|
|
524977
|
-
var
|
|
524922
|
+
var import_ai16 = __toESM(require_dist9(), 1);
|
|
524978
524923
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
524979
524924
|
import os5 from "node:os";
|
|
524980
524925
|
import path51 from "node:path";
|
|
@@ -529069,12 +529014,11 @@ var AiEntityType;
|
|
|
529069
529014
|
AiEntityType2["BLOCK"] = "block";
|
|
529070
529015
|
})(AiEntityType || (AiEntityType = {}));
|
|
529071
529016
|
var MODEL_CAPABILITIES = {
|
|
529072
|
-
"claude-
|
|
529017
|
+
"claude-sonnet-4-5": { maxOutputTokens: 64e3 },
|
|
529018
|
+
"claude-sonnet-4-6": { maxOutputTokens: 128e3 },
|
|
529073
529019
|
"claude-opus-4-5": { maxOutputTokens: 64e3 },
|
|
529074
529020
|
"claude-opus-4-6": { maxOutputTokens: 128e3 },
|
|
529075
|
-
"claude-
|
|
529076
|
-
"claude-sonnet-4-5": { maxOutputTokens: 64e3 },
|
|
529077
|
-
"claude-sonnet-4-6": { maxOutputTokens: 128e3 }
|
|
529021
|
+
"claude-haiku-4-5": { maxOutputTokens: 64e3 }
|
|
529078
529022
|
};
|
|
529079
529023
|
var MAX_OUTPUT_TOKENS = 48e3;
|
|
529080
529024
|
var DEFAULT_CONTEXT_OPTIONS_V2 = {
|
|
@@ -529104,83 +529048,6 @@ var EXCLUDED_MESSAGE_TYPES = [
|
|
|
529104
529048
|
"commitRestoring",
|
|
529105
529049
|
"git_setup_required"
|
|
529106
529050
|
];
|
|
529107
|
-
var NEXT_STEPS_ICON_NAMES = [
|
|
529108
|
-
"alert-triangle",
|
|
529109
|
-
"arrow-right-left",
|
|
529110
|
-
"arrow-up-down",
|
|
529111
|
-
"bar-chart-3",
|
|
529112
|
-
"bell",
|
|
529113
|
-
"bookmark",
|
|
529114
|
-
"calendar",
|
|
529115
|
-
"check",
|
|
529116
|
-
"check-circle",
|
|
529117
|
-
"circle-user",
|
|
529118
|
-
"clipboard",
|
|
529119
|
-
"clock",
|
|
529120
|
-
"cloud",
|
|
529121
|
-
"code",
|
|
529122
|
-
"copy",
|
|
529123
|
-
"database",
|
|
529124
|
-
"download",
|
|
529125
|
-
"external-link",
|
|
529126
|
-
"eye",
|
|
529127
|
-
"file-down",
|
|
529128
|
-
"file-plus",
|
|
529129
|
-
"file-text",
|
|
529130
|
-
"filter",
|
|
529131
|
-
"folder",
|
|
529132
|
-
"git-branch",
|
|
529133
|
-
"globe",
|
|
529134
|
-
"grip-vertical",
|
|
529135
|
-
"hard-drive",
|
|
529136
|
-
"heart",
|
|
529137
|
-
"home",
|
|
529138
|
-
"image",
|
|
529139
|
-
"info",
|
|
529140
|
-
"key",
|
|
529141
|
-
"layers",
|
|
529142
|
-
"layout-grid",
|
|
529143
|
-
"line-chart",
|
|
529144
|
-
"link",
|
|
529145
|
-
"list",
|
|
529146
|
-
"lock",
|
|
529147
|
-
"log-out",
|
|
529148
|
-
"mail",
|
|
529149
|
-
"map",
|
|
529150
|
-
"message-square",
|
|
529151
|
-
"monitor",
|
|
529152
|
-
"moon",
|
|
529153
|
-
"package",
|
|
529154
|
-
"palette",
|
|
529155
|
-
"pencil",
|
|
529156
|
-
"pie-chart",
|
|
529157
|
-
"plus",
|
|
529158
|
-
"printer",
|
|
529159
|
-
"puzzle",
|
|
529160
|
-
"refresh-cw",
|
|
529161
|
-
"repeat",
|
|
529162
|
-
"rocket",
|
|
529163
|
-
"save",
|
|
529164
|
-
"search",
|
|
529165
|
-
"server",
|
|
529166
|
-
"settings",
|
|
529167
|
-
"share-2",
|
|
529168
|
-
"shield",
|
|
529169
|
-
"sliders",
|
|
529170
|
-
"smartphone",
|
|
529171
|
-
"sparkles",
|
|
529172
|
-
"star",
|
|
529173
|
-
"table",
|
|
529174
|
-
"tag",
|
|
529175
|
-
"thumbs-up",
|
|
529176
|
-
"toggle-left",
|
|
529177
|
-
"trash-2",
|
|
529178
|
-
"upload",
|
|
529179
|
-
"user-plus",
|
|
529180
|
-
"users",
|
|
529181
|
-
"wand-2",
|
|
529182
|
-
"zap"
|
|
529183
|
-
];
|
|
529184
529051
|
var DEFAULT_ATTACHMENT_FILE_NAME = "Attachment";
|
|
529185
529052
|
function fallbackFileNameForImageMime(mtLower) {
|
|
529186
529053
|
const match2 = /^image\/([^;\s]+)/i.exec(mtLower);
|
|
@@ -529406,10 +529273,10 @@ var PermissionLevel;
|
|
|
529406
529273
|
PermissionLevel2["PROMPT"] = "prompt";
|
|
529407
529274
|
PermissionLevel2["BLOCK"] = "block";
|
|
529408
529275
|
})(PermissionLevel || (PermissionLevel = {}));
|
|
529409
|
-
function createToolFactory(name17,
|
|
529276
|
+
function createToolFactory(name17, factory9) {
|
|
529410
529277
|
return {
|
|
529411
529278
|
name: name17,
|
|
529412
|
-
create: (deps) => ({ ...
|
|
529279
|
+
create: (deps) => ({ ...factory9(deps), name: name17 })
|
|
529413
529280
|
};
|
|
529414
529281
|
}
|
|
529415
529282
|
var ToolExecutionError = class _ToolExecutionError extends Error {
|
|
@@ -529895,9 +529762,6 @@ function getTotalInputTokens(usage) {
|
|
|
529895
529762
|
}
|
|
529896
529763
|
return usage.inputTokens ?? nonCached;
|
|
529897
529764
|
}
|
|
529898
|
-
function computeContextUsed(usage) {
|
|
529899
|
-
return getTotalInputTokens(usage);
|
|
529900
|
-
}
|
|
529901
529765
|
function getTotalTokens(usage) {
|
|
529902
529766
|
const recomputedTotal = getTotalInputTokens(usage) + (usage.outputTokens ?? 0);
|
|
529903
529767
|
const hasDetailedBreakdown = usage.inputTokenDetails?.noCacheTokens !== void 0 || usage.inputTokenDetails?.cacheReadTokens !== void 0 || usage.inputTokenDetails?.cacheWriteTokens !== void 0;
|
|
@@ -529959,59 +529823,15 @@ function getActiveContext(clark, services) {
|
|
|
529959
529823
|
|
|
529960
529824
|
// ../../../vite-plugin-file-sync/dist/ai-service/util/llm-config-utils.js
|
|
529961
529825
|
init_cjs_shims();
|
|
529962
|
-
var INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
|
|
529963
|
-
var EFFORT_BETA = "effort-2025-11-24";
|
|
529964
|
-
var ADAPTIVE_EFFORT_MODELS = /* @__PURE__ */ new Set(["claude-opus-4-7"]);
|
|
529965
|
-
var HARDCODED_EFFORT = "high";
|
|
529966
|
-
function usesAdaptiveEffort(coreModel) {
|
|
529967
|
-
return coreModel !== void 0 && ADAPTIVE_EFFORT_MODELS.has(coreModel);
|
|
529968
|
-
}
|
|
529969
|
-
function buildThinkingProviderOptions(coreModel, params) {
|
|
529970
|
-
const { thinkingEnabled, thinkingBudgetTokens, interleavedThinking } = params;
|
|
529971
|
-
if (usesAdaptiveEffort(coreModel)) {
|
|
529972
|
-
const anthropic3 = {
|
|
529973
|
-
thinking: { type: "adaptive", display: "summarized" },
|
|
529974
|
-
effort: HARDCODED_EFFORT
|
|
529975
|
-
};
|
|
529976
|
-
const bedrockBetas = [EFFORT_BETA];
|
|
529977
|
-
if (interleavedThinking) {
|
|
529978
|
-
bedrockBetas.push(INTERLEAVED_THINKING_BETA);
|
|
529979
|
-
}
|
|
529980
|
-
const bedrock2 = {
|
|
529981
|
-
additionalModelRequestFields: {
|
|
529982
|
-
thinking: { type: "adaptive", display: "summarized" },
|
|
529983
|
-
output_config: { effort: HARDCODED_EFFORT },
|
|
529984
|
-
anthropic_beta: bedrockBetas
|
|
529985
|
-
}
|
|
529986
|
-
};
|
|
529987
|
-
const headers2 = interleavedThinking ? { "anthropic-beta": INTERLEAVED_THINKING_BETA } : {};
|
|
529988
|
-
return { anthropic: anthropic3, bedrock: bedrock2, headers: headers2 };
|
|
529989
|
-
}
|
|
529990
|
-
if (!thinkingEnabled) {
|
|
529991
|
-
return { headers: {} };
|
|
529992
|
-
}
|
|
529993
|
-
const anthropic2 = {
|
|
529994
|
-
thinking: { type: "enabled", budgetTokens: thinkingBudgetTokens }
|
|
529995
|
-
};
|
|
529996
|
-
const bedrock = {
|
|
529997
|
-
additionalModelRequestFields: {
|
|
529998
|
-
thinking: { type: "enabled", budget_tokens: thinkingBudgetTokens },
|
|
529999
|
-
anthropic_beta: [INTERLEAVED_THINKING_BETA]
|
|
530000
|
-
}
|
|
530001
|
-
};
|
|
530002
|
-
const headers = interleavedThinking ? { "anthropic-beta": INTERLEAVED_THINKING_BETA } : {};
|
|
530003
|
-
return { anthropic: anthropic2, bedrock, headers };
|
|
530004
|
-
}
|
|
530005
529826
|
function processLLMConfig(llmConfig, defaultBudgetTokens = 5e3, logContext) {
|
|
530006
529827
|
const logger15 = getLogger3();
|
|
530007
529828
|
const thinkingEnabled = llmConfig?.thinkingEnabled ?? true;
|
|
530008
529829
|
let thinkingBudgetTokens = llmConfig?.thinkingBudgetTokens ? parseInt(llmConfig.thinkingBudgetTokens) : defaultBudgetTokens;
|
|
530009
529830
|
const interleavedThinking = llmConfig?.interleavedThinking ?? true;
|
|
530010
529831
|
const maxOutputTokens = MAX_OUTPUT_TOKENS;
|
|
530011
|
-
|
|
530012
|
-
|
|
530013
|
-
const
|
|
530014
|
-
const modelCaps = MODEL_CAPABILITIES[modelKey];
|
|
529832
|
+
if (thinkingEnabled) {
|
|
529833
|
+
const coreModel = llmConfig?.coreModel ?? "claude-sonnet-4-5";
|
|
529834
|
+
const modelCaps = MODEL_CAPABILITIES[coreModel];
|
|
530015
529835
|
const modelMaxOutput = modelCaps?.maxOutputTokens ?? 64e3;
|
|
530016
529836
|
const total = maxOutputTokens + thinkingBudgetTokens;
|
|
530017
529837
|
if (total > modelMaxOutput) {
|
|
@@ -530021,24 +529841,29 @@ function processLLMConfig(llmConfig, defaultBudgetTokens = 5e3, logContext) {
|
|
|
530021
529841
|
}
|
|
530022
529842
|
}
|
|
530023
529843
|
if (logContext) {
|
|
530024
|
-
getLogger3().info(`${logContext} LLM Provider Config: provider=${llmConfig?.provider || "bedrock (default)"},
|
|
529844
|
+
getLogger3().info(`${logContext} LLM Provider Config: provider=${llmConfig?.provider || "bedrock (default)"}, thinking=${thinkingEnabled}, budget=${thinkingBudgetTokens}, interleaved=${interleavedThinking}`);
|
|
530025
529845
|
}
|
|
530026
|
-
const
|
|
530027
|
-
|
|
530028
|
-
|
|
530029
|
-
|
|
530030
|
-
|
|
530031
|
-
|
|
530032
|
-
|
|
530033
|
-
|
|
529846
|
+
const providerOptions = thinkingEnabled ? {
|
|
529847
|
+
anthropic: {
|
|
529848
|
+
thinking: { type: "enabled", budgetTokens: thinkingBudgetTokens }
|
|
529849
|
+
},
|
|
529850
|
+
bedrock: {
|
|
529851
|
+
additionalModelRequestFields: {
|
|
529852
|
+
thinking: { type: "enabled", budget_tokens: thinkingBudgetTokens },
|
|
529853
|
+
anthropic_beta: ["interleaved-thinking-2025-05-14"]
|
|
529854
|
+
}
|
|
529855
|
+
}
|
|
530034
529856
|
} : void 0;
|
|
529857
|
+
const headers = thinkingEnabled && interleavedThinking ? {
|
|
529858
|
+
"anthropic-beta": "interleaved-thinking-2025-05-14"
|
|
529859
|
+
} : {};
|
|
530035
529860
|
return {
|
|
530036
529861
|
thinkingEnabled,
|
|
530037
529862
|
thinkingBudgetTokens,
|
|
530038
529863
|
interleavedThinking,
|
|
530039
529864
|
maxOutputTokens,
|
|
530040
529865
|
providerOptions,
|
|
530041
|
-
headers
|
|
529866
|
+
headers
|
|
530042
529867
|
};
|
|
530043
529868
|
}
|
|
530044
529869
|
|
|
@@ -530109,7 +529934,7 @@ var sendInteractiveMessageChannel = (clark, chatSessionStore) => {
|
|
|
530109
529934
|
};
|
|
530110
529935
|
var sendUserMessageChannel = (clark, chatSessionStore) => {
|
|
530111
529936
|
const queue = peerQueue(clark);
|
|
530112
|
-
return async (payload, delay3 = 0, immediate = false
|
|
529937
|
+
return async (payload, delay3 = 0, immediate = false) => {
|
|
530113
529938
|
const messageId = payload.id ?? crypto.randomUUID();
|
|
530114
529939
|
const payloadWithId = { ...payload, id: messageId };
|
|
530115
529940
|
if (immediate) {
|
|
@@ -530121,15 +529946,7 @@ var sendUserMessageChannel = (clark, chatSessionStore) => {
|
|
|
530121
529946
|
return clark.context.peer.call.aiPushMessage(payloadWithId);
|
|
530122
529947
|
}
|
|
530123
529948
|
return queue(async () => {
|
|
530124
|
-
|
|
530125
|
-
try {
|
|
530126
|
-
await chatSessionStore.recordAssistant(payloadWithId);
|
|
530127
|
-
} catch (err) {
|
|
530128
|
-
getLogger3().warn(`[ai-service] recordAssistant failed; continuing with peer delivery. type=${payloadWithId.type}`, err);
|
|
530129
|
-
}
|
|
530130
|
-
} else {
|
|
530131
|
-
void chatSessionStore.recordAssistant(payloadWithId);
|
|
530132
|
-
}
|
|
529949
|
+
void chatSessionStore.recordAssistant(payloadWithId);
|
|
530133
529950
|
if (!clark.context.peer) {
|
|
530134
529951
|
getLogger3().warn(`[ai-service] Cannot send message: no peer. type=${payloadWithId.type}, state=${clark.state}`);
|
|
530135
529952
|
return;
|
|
@@ -530209,7 +530026,7 @@ var MAX_ATTRIBUTE_LENGTH = 64e3;
|
|
|
530209
530026
|
var LLMObsSpanWriter = null;
|
|
530210
530027
|
async function loadLLMObsSpanWriter() {
|
|
530211
530028
|
if (!LLMObsSpanWriter) {
|
|
530212
|
-
const module2 = await import("./spans-
|
|
530029
|
+
const module2 = await import("./spans-3EJDY2PZ.js");
|
|
530213
530030
|
LLMObsSpanWriter = module2.default;
|
|
530214
530031
|
}
|
|
530215
530032
|
return LLMObsSpanWriter;
|
|
@@ -531463,7 +531280,7 @@ var Clark = class _Clark extends TracedFSM {
|
|
|
531463
531280
|
async streamText(services, options8) {
|
|
531464
531281
|
const { model: providedModel, context: contextConfig, logging: loggingConfig, enableFallback: enableFallbackOverride, ...streamOptions } = options8;
|
|
531465
531282
|
const model = providedModel ?? services.llmProvider.modelForTask("generateBroadEdit");
|
|
531466
|
-
const { thinkingEnabled, thinkingBudgetTokens,
|
|
531283
|
+
const { thinkingEnabled, thinkingBudgetTokens, maxOutputTokens, headers, providerOptions } = processLLMConfig(this.context.llmConfig);
|
|
531467
531284
|
const logging = loggingConfig !== false ? {
|
|
531468
531285
|
conversationId: loggingConfig?.conversationId ?? String(Date.now()),
|
|
531469
531286
|
runTimestamp: this.context.runTimestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -531535,11 +531352,6 @@ var Clark = class _Clark extends TracedFSM {
|
|
|
531535
531352
|
logging,
|
|
531536
531353
|
retry: streamOptions.retry,
|
|
531537
531354
|
providerConfig,
|
|
531538
|
-
thinking: {
|
|
531539
|
-
enabled: thinkingEnabled,
|
|
531540
|
-
budgetTokens: thinkingBudgetTokens,
|
|
531541
|
-
interleaved: interleavedThinking
|
|
531542
|
-
},
|
|
531543
531355
|
enableFallback,
|
|
531544
531356
|
fallbackStrategy,
|
|
531545
531357
|
peer: this.context.peer,
|
|
@@ -531600,7 +531412,8 @@ var Clark = class _Clark extends TracedFSM {
|
|
|
531600
531412
|
}
|
|
531601
531413
|
}
|
|
531602
531414
|
pushContextUsed(usage) {
|
|
531603
|
-
const
|
|
531415
|
+
const normalizedInputTokens = getTotalInputTokens(usage);
|
|
531416
|
+
const contextUsed = normalizedInputTokens + (usage.reasoningTokens ?? 0) + (usage.outputTokens ?? 0);
|
|
531604
531417
|
const formatTokens = (n) => n >= 1e3 ? `${(n / 1e3).toFixed(1)}k` : `${n}`;
|
|
531605
531418
|
this.logger.info(`Context used: ${formatTokens(contextUsed)} tokens`);
|
|
531606
531419
|
void this.context.peer?.call.aiPushContextUsed({ contextUsed }).catch((err) => {
|
|
@@ -562165,17 +561978,17 @@ var ToolRegistry = class {
|
|
|
562165
561978
|
* @param deps - Optional dependencies to instantiate the tool immediately
|
|
562166
561979
|
* @throws Error if tool with same name already registered
|
|
562167
561980
|
*/
|
|
562168
|
-
register(
|
|
562169
|
-
if (this.factories.has(
|
|
562170
|
-
throw new Error(`Tool "${
|
|
561981
|
+
register(factory9, deps) {
|
|
561982
|
+
if (this.factories.has(factory9.name) || this.instances.has(factory9.name)) {
|
|
561983
|
+
throw new Error(`Tool "${factory9.name}" already registered`);
|
|
562171
561984
|
}
|
|
562172
|
-
this.factories.set(
|
|
561985
|
+
this.factories.set(factory9.name, factory9);
|
|
562173
561986
|
if (deps !== void 0) {
|
|
562174
|
-
const instance3 =
|
|
562175
|
-
if (instance3.name !==
|
|
562176
|
-
throw new Error(`Tool name mismatch: factory.name="${
|
|
561987
|
+
const instance3 = factory9.create(deps);
|
|
561988
|
+
if (instance3.name !== factory9.name) {
|
|
561989
|
+
throw new Error(`Tool name mismatch: factory.name="${factory9.name}" but tool.name="${instance3.name}"`);
|
|
562177
561990
|
}
|
|
562178
|
-
this.instances.set(
|
|
561991
|
+
this.instances.set(factory9.name, instance3);
|
|
562179
561992
|
}
|
|
562180
561993
|
}
|
|
562181
561994
|
/**
|
|
@@ -562207,8 +562020,8 @@ var ToolRegistry = class {
|
|
|
562207
562020
|
* @param factories - Array of tool factories to register
|
|
562208
562021
|
*/
|
|
562209
562022
|
registerAll(factories) {
|
|
562210
|
-
for (const
|
|
562211
|
-
this.register(
|
|
562023
|
+
for (const factory9 of factories) {
|
|
562024
|
+
this.register(factory9);
|
|
562212
562025
|
}
|
|
562213
562026
|
}
|
|
562214
562027
|
/**
|
|
@@ -566033,63 +565846,43 @@ const ProductsPage = () => {
|
|
|
566033
565846
|
|
|
566034
565847
|
### Loading States
|
|
566035
565848
|
|
|
566036
|
-
|
|
566037
|
-
|
|
566038
|
-
**Initial load (no data yet):** Show skeleton shimmers that mirror the shape of the final content. Never show a blank screen or a generic spinner.
|
|
565849
|
+
**Always represent initial loading with skeletons (shimmers), not spinners or empty screens.**
|
|
566039
565850
|
|
|
566040
|
-
**
|
|
566041
|
-
|
|
566042
|
-
Use \`loading\` and \`fetching\` from \`useApiData\` to distinguish these states:
|
|
565851
|
+
**Always show a loading indicator when refetching data** (e.g. after filter/search changes). Use \`fetching\` from \`useApiData\` to visually indicate that fresh data is being fetched while keeping the current data visible.
|
|
566043
565852
|
|
|
566044
565853
|
\`\`\`tsx
|
|
565854
|
+
// \u2705 CORRECT \u2014 skeleton for first load, overlay for refetch
|
|
566045
565855
|
const { data, loading, fetching, isError, error } = useApiData("GetOrders", {
|
|
566046
565856
|
status: statusFilter,
|
|
566047
565857
|
search,
|
|
566048
565858
|
});
|
|
566049
565859
|
|
|
566050
|
-
|
|
566051
|
-
if (loading) {
|
|
566052
|
-
return <OrderTableSkeleton />;
|
|
566053
|
-
}
|
|
566054
|
-
|
|
565860
|
+
if (loading) return <Skeleton />;
|
|
566055
565861
|
if (isError) return <ErrorBanner error={error} />;
|
|
566056
|
-
|
|
566057
|
-
// Refetch \u2014 data exists \u2192 subtle opacity + indicator, table stays interactive
|
|
566058
565862
|
return (
|
|
566059
|
-
<div>
|
|
566060
|
-
|
|
566061
|
-
<div className={fetching ? "opacity-70" : ""}>
|
|
566062
|
-
<OrderTable orders={data.orders} />
|
|
566063
|
-
</div>
|
|
565863
|
+
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
565864
|
+
<OrderTable orders={data.orders} />
|
|
566064
565865
|
</div>
|
|
566065
565866
|
);
|
|
566066
565867
|
\`\`\`
|
|
566067
565868
|
|
|
566068
565869
|
\`\`\`tsx
|
|
566069
|
-
// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken
|
|
566070
|
-
return (
|
|
566071
|
-
<div className={fetching ? "pointer-events-none" : ""}>
|
|
566072
|
-
<OrderTable orders={data.orders} />
|
|
566073
|
-
</div>
|
|
566074
|
-
);
|
|
566075
|
-
|
|
566076
565870
|
// \u274C WRONG \u2014 no loading feedback when filters change
|
|
565871
|
+
const { data, loading } = useApiData("GetOrders", {
|
|
565872
|
+
status: statusFilter,
|
|
565873
|
+
search,
|
|
565874
|
+
});
|
|
565875
|
+
|
|
566077
565876
|
if (loading) return <Skeleton />;
|
|
566078
565877
|
return <OrderTable orders={data.orders} />;
|
|
566079
565878
|
\`\`\`
|
|
566080
565879
|
|
|
566081
|
-
#### Table Loading Rules
|
|
566082
|
-
|
|
566083
|
-
- **Do not** use \`pointer-events-none\` on a table during loading \u2014 this disables interaction and makes the UI feel broken. During refetch, apply a subtle opacity (e.g. \`opacity-70\`) plus a non-blocking indicator (e.g., an "Updating\u2026" label or a thin progress bar). The table must remain clickable, sortable, and scrollable.
|
|
566084
|
-
- **Do not** replace a populated table with a full skeleton on refetch \u2014 this causes disorienting content flashes.
|
|
566085
|
-
- **Skeleton tables are only for initial load** (\`loading\` is true) when there is no data to display yet. Build them to match the real table's column structure (header + a few placeholder rows).
|
|
566086
|
-
|
|
566087
565880
|
### Efficient Loading Patterns
|
|
566088
565881
|
|
|
566089
|
-
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a
|
|
565882
|
+
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a visual loading indicator while new data loads. Use \`fetching\` from useApiData.
|
|
566090
565883
|
2. **Loading State Hierarchy**:
|
|
566091
565884
|
- No data yet (\`loading\`) \u2192 Full skeleton placeholder
|
|
566092
|
-
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a
|
|
565885
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a loading overlay (e.g. reduced opacity, inline spinner)
|
|
566093
565886
|
- Error state (\`isError\`) \u2192 Show error with retry option, optionally keep stale data visible
|
|
566094
565887
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
566095
565888
|
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, \`refetchOnReconnect\`, \`refetchInterval\`, and \`retry\` options.
|
|
@@ -569299,15 +569092,6 @@ var ChatSessionStore = (() => {
|
|
|
569299
569092
|
responseToMessageId: typeof msg.responseToMessageId === "string" ? msg.responseToMessageId : void 0,
|
|
569300
569093
|
savedFacts: Array.isArray(msg.savedFacts) ? msg.savedFacts : void 0
|
|
569301
569094
|
};
|
|
569302
|
-
} else if (msg.type === "next_steps") {
|
|
569303
|
-
return {
|
|
569304
|
-
role: msg.role,
|
|
569305
|
-
content: msg.content,
|
|
569306
|
-
type: "next_steps",
|
|
569307
|
-
id: typeof msg.id === "string" ? msg.id : void 0,
|
|
569308
|
-
timestamp,
|
|
569309
|
-
nextSteps: Array.isArray(msg.nextSteps) ? msg.nextSteps : []
|
|
569310
|
-
};
|
|
569311
569095
|
}
|
|
569312
569096
|
const baseMessage = {
|
|
569313
569097
|
role: msg.role,
|
|
@@ -569737,15 +569521,6 @@ var ChatSessionStore = (() => {
|
|
|
569737
569521
|
responseToMessageId: payload.responseToMessageId,
|
|
569738
569522
|
savedFacts: payload.savedFacts
|
|
569739
569523
|
};
|
|
569740
|
-
} else if (payload.type === "next_steps") {
|
|
569741
|
-
message = {
|
|
569742
|
-
role: "assistant",
|
|
569743
|
-
content: payload.text,
|
|
569744
|
-
type: "next_steps",
|
|
569745
|
-
id: messageId,
|
|
569746
|
-
timestamp: Date.now(),
|
|
569747
|
-
nextSteps: payload.nextSteps ?? []
|
|
569748
|
-
};
|
|
569749
569524
|
} else {
|
|
569750
569525
|
message = {
|
|
569751
569526
|
role: "assistant",
|
|
@@ -584282,13 +584057,6 @@ var ClarkChatLanguageModel = class {
|
|
|
584282
584057
|
});
|
|
584283
584058
|
break;
|
|
584284
584059
|
}
|
|
584285
|
-
case "raw": {
|
|
584286
|
-
controller.enqueue({
|
|
584287
|
-
type: "raw",
|
|
584288
|
-
rawValue: value2.rawValue ?? value2
|
|
584289
|
-
});
|
|
584290
|
-
break;
|
|
584291
|
-
}
|
|
584292
584060
|
case "object": {
|
|
584293
584061
|
const id2 = asString(value2.id);
|
|
584294
584062
|
if (id2 == null) {
|
|
@@ -589046,13 +588814,11 @@ var StreamConfig = class _StreamConfig {
|
|
|
589046
588814
|
_provider;
|
|
589047
588815
|
_fallback;
|
|
589048
588816
|
_logging;
|
|
589049
|
-
|
|
589050
|
-
constructor(retry, provider, fallback, logging, thinking) {
|
|
588817
|
+
constructor(retry, provider, fallback, logging) {
|
|
589051
588818
|
this._retry = Object.freeze(retry);
|
|
589052
588819
|
this._provider = Object.freeze(provider);
|
|
589053
588820
|
this._fallback = Object.freeze(fallback);
|
|
589054
588821
|
this._logging = Object.freeze(logging);
|
|
589055
|
-
this._thinking = thinking ? Object.freeze({ ...thinking }) : void 0;
|
|
589056
588822
|
}
|
|
589057
588823
|
static create(options8) {
|
|
589058
588824
|
if (!options8.provider || !options8.model) {
|
|
@@ -589082,7 +588848,7 @@ var StreamConfig = class _StreamConfig {
|
|
|
589082
588848
|
saveArtifact: options8.logging?.saveArtifact,
|
|
589083
588849
|
metadata: options8.logging?.metadata ?? {}
|
|
589084
588850
|
};
|
|
589085
|
-
return new _StreamConfig(retry, provider, fallback, logging
|
|
588851
|
+
return new _StreamConfig(retry, provider, fallback, logging);
|
|
589086
588852
|
}
|
|
589087
588853
|
get retry() {
|
|
589088
588854
|
return this._retry;
|
|
@@ -589096,9 +588862,6 @@ var StreamConfig = class _StreamConfig {
|
|
|
589096
588862
|
get logging() {
|
|
589097
588863
|
return this._logging;
|
|
589098
588864
|
}
|
|
589099
|
-
get thinking() {
|
|
589100
|
-
return this._thinking;
|
|
589101
|
-
}
|
|
589102
588865
|
};
|
|
589103
588866
|
|
|
589104
588867
|
// ../../../vite-plugin-file-sync/dist/ai-service/llm/stream/orchestrator.js
|
|
@@ -589874,15 +589637,10 @@ var StreamOrchestrator = class {
|
|
|
589874
589637
|
}
|
|
589875
589638
|
}
|
|
589876
589639
|
} : options8;
|
|
589877
|
-
const thinkingRebuilt = this.rebuildThinkingOptions(baseOptions, provider);
|
|
589878
589640
|
return {
|
|
589879
|
-
...
|
|
589880
|
-
headers: {
|
|
589881
|
-
...options8.headers,
|
|
589882
|
-
...thinkingRebuilt.headers
|
|
589883
|
-
},
|
|
589641
|
+
...baseOptions,
|
|
589884
589642
|
providerOptions: {
|
|
589885
|
-
...
|
|
589643
|
+
...baseOptions.providerOptions,
|
|
589886
589644
|
billing: {
|
|
589887
589645
|
retry_count: session.metrics.retryCount,
|
|
589888
589646
|
workflow_failed: session.outcome === "error"
|
|
@@ -589890,50 +589648,6 @@ var StreamOrchestrator = class {
|
|
|
589890
589648
|
}
|
|
589891
589649
|
};
|
|
589892
589650
|
}
|
|
589893
|
-
/**
|
|
589894
|
-
* Replaces the thinking-related fields on `providerOptions.anthropic` and
|
|
589895
|
-
* `providerOptions.bedrock.additionalModelRequestFields` with the shape
|
|
589896
|
-
* the given model accepts. Any stale thinking keys (e.g. `budgetTokens`
|
|
589897
|
-
* from a previous opus-4-6 attempt, or `effort` from a previous 4-7
|
|
589898
|
-
* attempt) are dropped so the new shape isn't polluted.
|
|
589899
|
-
*/
|
|
589900
|
-
rebuildThinkingOptions(options8, provider) {
|
|
589901
|
-
const thinkingConfig = this.config.thinking;
|
|
589902
|
-
if (!thinkingConfig) {
|
|
589903
|
-
return options8;
|
|
589904
|
-
}
|
|
589905
|
-
const fresh = buildThinkingProviderOptions(provider.model, {
|
|
589906
|
-
thinkingEnabled: thinkingConfig.enabled,
|
|
589907
|
-
thinkingBudgetTokens: thinkingConfig.budgetTokens,
|
|
589908
|
-
interleavedThinking: thinkingConfig.interleaved
|
|
589909
|
-
});
|
|
589910
|
-
const existing = options8.providerOptions ?? {};
|
|
589911
|
-
const existingAnthropic = existing.anthropic ?? {};
|
|
589912
|
-
const existingBedrock = existing.bedrock ?? {};
|
|
589913
|
-
const existingBedrockFields = existingBedrock.additionalModelRequestFields ?? {};
|
|
589914
|
-
const { thinking: _a21, effort: _b17, ...anthropicRest } = existingAnthropic;
|
|
589915
|
-
const { thinking: _c, output_config: _d, anthropic_beta: _e, budget_tokens: _f, ...bedrockFieldsRest } = existingBedrockFields;
|
|
589916
|
-
const anthropic2 = fresh.anthropic ? { ...anthropicRest, ...fresh.anthropic } : anthropicRest;
|
|
589917
|
-
const bedrock = fresh.bedrock ? {
|
|
589918
|
-
...existingBedrock,
|
|
589919
|
-
additionalModelRequestFields: {
|
|
589920
|
-
...bedrockFieldsRest,
|
|
589921
|
-
...fresh.bedrock.additionalModelRequestFields
|
|
589922
|
-
}
|
|
589923
|
-
} : Object.keys(bedrockFieldsRest).length > 0 ? {
|
|
589924
|
-
...existingBedrock,
|
|
589925
|
-
additionalModelRequestFields: bedrockFieldsRest
|
|
589926
|
-
} : { ...existingBedrock, additionalModelRequestFields: {} };
|
|
589927
|
-
return {
|
|
589928
|
-
...options8,
|
|
589929
|
-
headers: { ...options8.headers, ...fresh.headers },
|
|
589930
|
-
providerOptions: {
|
|
589931
|
-
...existing,
|
|
589932
|
-
anthropic: anthropic2,
|
|
589933
|
-
bedrock
|
|
589934
|
-
}
|
|
589935
|
-
};
|
|
589936
|
-
}
|
|
589937
589651
|
getFallbackReason(error40) {
|
|
589938
589652
|
if (error40 && typeof error40 === "object" && "type" in error40) {
|
|
589939
589653
|
const errorType = error40.type;
|
|
@@ -591396,7 +591110,7 @@ var LLMClient = class {
|
|
|
591396
591110
|
}
|
|
591397
591111
|
}
|
|
591398
591112
|
async streamText(options8, logger15 = getLogger3(), tracer4 = LLMObsTracer.instance) {
|
|
591399
|
-
const { model, user, system, context: contextConfig, logging: loggingConfig, retry: retryConfig, providerConfig,
|
|
591113
|
+
const { model, user, system, context: contextConfig, logging: loggingConfig, retry: retryConfig, providerConfig, enableFallback, fallbackStrategy, peer, chatSessionStore, observers: customObservers, prepareStep, onStepFinish, onFinish, onChunk, onError: onError2, summarizationModel, safety: safetyConfig, ...streamOptions } = options8;
|
|
591400
591114
|
if (!user) {
|
|
591401
591115
|
throw new Error("user message is required");
|
|
591402
591116
|
}
|
|
@@ -591493,15 +591207,11 @@ var LLMClient = class {
|
|
|
591493
591207
|
try {
|
|
591494
591208
|
const fallbackEnabled = this.unifiedProviderEnabled && (enableFallback ?? false);
|
|
591495
591209
|
logger15.info(`[llm-client] provider=${providerConfig.provider} model=${providerConfig.model} unifiedProvider=${this.unifiedProviderEnabled} fallback=${fallbackEnabled} retry=${safeJsonStringify(retryConfig)}`);
|
|
591496
|
-
const adaptiveEffortCapable = usesAdaptiveEffort(providerConfig.model);
|
|
591497
|
-
const defaultMaxTotalTimeMs = adaptiveEffortCapable ? 5 * 60 * 1e3 : 2 * 60 * 1e3;
|
|
591498
|
-
const defaultIdleTimeoutMs = adaptiveEffortCapable ? 18e4 : 9e4;
|
|
591499
591210
|
const config4 = StreamConfig.create({
|
|
591500
591211
|
retry: {
|
|
591501
591212
|
...this.retryOptions,
|
|
591502
591213
|
...retryConfig,
|
|
591503
|
-
maxTotalTimeMs: retryConfig?.maxTotalTimeMs ?? this.retryOptions?.maxTotalTimeMs ??
|
|
591504
|
-
idleTimeoutMs: retryConfig?.idleTimeoutMs ?? this.retryOptions?.idleTimeoutMs ?? defaultIdleTimeoutMs
|
|
591214
|
+
maxTotalTimeMs: retryConfig?.maxTotalTimeMs ?? this.retryOptions?.maxTotalTimeMs ?? 2 * 60 * 1e3
|
|
591505
591215
|
},
|
|
591506
591216
|
provider: providerConfig.provider,
|
|
591507
591217
|
model: providerConfig.model,
|
|
@@ -591509,7 +591219,6 @@ var LLMClient = class {
|
|
|
591509
591219
|
enabled: fallbackEnabled,
|
|
591510
591220
|
strategy: fallbackStrategy
|
|
591511
591221
|
},
|
|
591512
|
-
thinking: thinkingConfig,
|
|
591513
591222
|
logging: loggingConfig !== false ? {
|
|
591514
591223
|
enabled: true,
|
|
591515
591224
|
conversationId: loggingConfig?.conversationId,
|
|
@@ -591688,10 +591397,10 @@ init_cjs_shims();
|
|
|
591688
591397
|
// ../../../vite-plugin-file-sync/dist/ai-service/llm/impl/anthropic.js
|
|
591689
591398
|
init_cjs_shims();
|
|
591690
591399
|
|
|
591691
|
-
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.
|
|
591400
|
+
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.46_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
591692
591401
|
init_cjs_shims();
|
|
591693
591402
|
|
|
591694
|
-
// ../../../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.
|
|
591403
|
+
// ../../../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.15_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
591695
591404
|
init_cjs_shims();
|
|
591696
591405
|
function combineHeaders2(...headers) {
|
|
591697
591406
|
return headers.reduce(
|
|
@@ -591704,30 +591413,25 @@ function combineHeaders2(...headers) {
|
|
|
591704
591413
|
}
|
|
591705
591414
|
function createToolNameMapping({
|
|
591706
591415
|
tools = [],
|
|
591707
|
-
providerToolNames
|
|
591708
|
-
resolveProviderToolName
|
|
591416
|
+
providerToolNames
|
|
591709
591417
|
}) {
|
|
591710
|
-
var _a22;
|
|
591711
591418
|
const customToolNameToProviderToolName = {};
|
|
591712
591419
|
const providerToolNameToCustomToolName = {};
|
|
591713
591420
|
for (const tool22 of tools) {
|
|
591714
|
-
if (tool22.type === "provider") {
|
|
591715
|
-
const providerToolName =
|
|
591716
|
-
if (providerToolName == null) {
|
|
591717
|
-
continue;
|
|
591718
|
-
}
|
|
591421
|
+
if (tool22.type === "provider" && tool22.id in providerToolNames) {
|
|
591422
|
+
const providerToolName = providerToolNames[tool22.id];
|
|
591719
591423
|
customToolNameToProviderToolName[tool22.name] = providerToolName;
|
|
591720
591424
|
providerToolNameToCustomToolName[providerToolName] = tool22.name;
|
|
591721
591425
|
}
|
|
591722
591426
|
}
|
|
591723
591427
|
return {
|
|
591724
591428
|
toProviderToolName: (customToolName) => {
|
|
591725
|
-
var
|
|
591726
|
-
return (
|
|
591429
|
+
var _a22;
|
|
591430
|
+
return (_a22 = customToolNameToProviderToolName[customToolName]) != null ? _a22 : customToolName;
|
|
591727
591431
|
},
|
|
591728
591432
|
toCustomToolName: (providerToolName) => {
|
|
591729
|
-
var
|
|
591730
|
-
return (
|
|
591433
|
+
var _a22;
|
|
591434
|
+
return (_a22 = providerToolNameToCustomToolName[providerToolName]) != null ? _a22 : providerToolName;
|
|
591731
591435
|
}
|
|
591732
591436
|
};
|
|
591733
591437
|
}
|
|
@@ -591735,11 +591439,6 @@ function extractResponseHeaders2(response) {
|
|
|
591735
591439
|
return Object.fromEntries([...response.headers]);
|
|
591736
591440
|
}
|
|
591737
591441
|
var { btoa: btoa3, atob: atob3 } = globalThis;
|
|
591738
|
-
function convertBase64ToUint8Array(base64String) {
|
|
591739
|
-
const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
|
|
591740
|
-
const latin1string = atob3(base64Url);
|
|
591741
|
-
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
591742
|
-
}
|
|
591743
591442
|
function convertUint8ArrayToBase64(array3) {
|
|
591744
591443
|
let latin1string = "";
|
|
591745
591444
|
for (let i = 0; i < array3.length; i++) {
|
|
@@ -591902,7 +591601,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
|
|
|
591902
591601
|
);
|
|
591903
591602
|
return Object.fromEntries(normalizedHeaders.entries());
|
|
591904
591603
|
}
|
|
591905
|
-
var VERSION2 = true ? "4.0.
|
|
591604
|
+
var VERSION2 = true ? "4.0.15" : "0.0.0-test";
|
|
591906
591605
|
function isNonNullable(value2) {
|
|
591907
591606
|
return value2 != null;
|
|
591908
591607
|
}
|
|
@@ -591922,7 +591621,7 @@ function loadApiKey({
|
|
|
591922
591621
|
}
|
|
591923
591622
|
if (typeof process === "undefined") {
|
|
591924
591623
|
throw new LoadAPIKeyError2({
|
|
591925
|
-
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables
|
|
591624
|
+
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`
|
|
591926
591625
|
});
|
|
591927
591626
|
}
|
|
591928
591627
|
apiKey = process.env[environmentVariableName];
|
|
@@ -591954,8 +591653,8 @@ function loadOptionalSetting({
|
|
|
591954
591653
|
}
|
|
591955
591654
|
return settingValue;
|
|
591956
591655
|
}
|
|
591957
|
-
var suspectProtoRx2 = /"
|
|
591958
|
-
var suspectConstructorRx2 = /"
|
|
591656
|
+
var suspectProtoRx2 = /"__proto__"\s*:/;
|
|
591657
|
+
var suspectConstructorRx2 = /"constructor"\s*:/;
|
|
591959
591658
|
function _parse3(text3) {
|
|
591960
591659
|
const obj = JSON.parse(text3);
|
|
591961
591660
|
if (obj === null || typeof obj !== "object") {
|
|
@@ -591975,7 +591674,7 @@ function filter3(obj) {
|
|
|
591975
591674
|
if (Object.prototype.hasOwnProperty.call(node, "__proto__")) {
|
|
591976
591675
|
throw new SyntaxError("Object contains forbidden prototype property");
|
|
591977
591676
|
}
|
|
591978
|
-
if (Object.prototype.hasOwnProperty.call(node, "constructor") &&
|
|
591677
|
+
if (Object.prototype.hasOwnProperty.call(node, "constructor") && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
|
|
591979
591678
|
throw new SyntaxError("Object contains forbidden prototype property");
|
|
591980
591679
|
}
|
|
591981
591680
|
for (const key2 in node) {
|
|
@@ -592035,7 +591734,7 @@ function visit2(def) {
|
|
|
592035
591734
|
if (typeof def === "boolean") return def;
|
|
592036
591735
|
return addAdditionalPropertiesToJsonSchema2(def);
|
|
592037
591736
|
}
|
|
592038
|
-
var ignoreOverride2 =
|
|
591737
|
+
var ignoreOverride2 = Symbol(
|
|
592039
591738
|
"Let zodToJsonSchema decide on which parser to use"
|
|
592040
591739
|
);
|
|
592041
591740
|
var defaultOptions3 = {
|
|
@@ -593134,7 +592833,7 @@ var zod3ToJsonSchema2 = (schema, options8) => {
|
|
|
593134
592833
|
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
593135
592834
|
return combined;
|
|
593136
592835
|
};
|
|
593137
|
-
var schemaSymbol2 =
|
|
592836
|
+
var schemaSymbol2 = Symbol.for("vercel.ai.schema");
|
|
593138
592837
|
function lazySchema(createSchema2) {
|
|
593139
592838
|
let schema;
|
|
593140
592839
|
return () => {
|
|
@@ -593595,8 +593294,8 @@ function withoutTrailingSlash2(url4) {
|
|
|
593595
593294
|
return url4 == null ? void 0 : url4.replace(/\/$/, "");
|
|
593596
593295
|
}
|
|
593597
593296
|
|
|
593598
|
-
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.
|
|
593599
|
-
var VERSION3 = true ? "3.0.
|
|
593297
|
+
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.46_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
593298
|
+
var VERSION3 = true ? "3.0.46" : "0.0.0-test";
|
|
593600
593299
|
var anthropicErrorDataSchema = lazySchema(
|
|
593601
593300
|
() => zodSchema3(
|
|
593602
593301
|
external_exports2.object({
|
|
@@ -593675,10 +593374,6 @@ var anthropicMessagesResponseSchema = lazySchema(
|
|
|
593675
593374
|
type: external_exports2.literal("code_execution_20250825"),
|
|
593676
593375
|
tool_id: external_exports2.string()
|
|
593677
593376
|
}),
|
|
593678
|
-
external_exports2.object({
|
|
593679
|
-
type: external_exports2.literal("code_execution_20260120"),
|
|
593680
|
-
tool_id: external_exports2.string()
|
|
593681
|
-
}),
|
|
593682
593377
|
external_exports2.object({
|
|
593683
593378
|
type: external_exports2.literal("direct")
|
|
593684
593379
|
})
|
|
@@ -593688,16 +593383,7 @@ var anthropicMessagesResponseSchema = lazySchema(
|
|
|
593688
593383
|
type: external_exports2.literal("server_tool_use"),
|
|
593689
593384
|
id: external_exports2.string(),
|
|
593690
593385
|
name: external_exports2.string(),
|
|
593691
|
-
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish()
|
|
593692
|
-
caller: external_exports2.union([
|
|
593693
|
-
external_exports2.object({
|
|
593694
|
-
type: external_exports2.literal("code_execution_20260120"),
|
|
593695
|
-
tool_id: external_exports2.string()
|
|
593696
|
-
}),
|
|
593697
|
-
external_exports2.object({
|
|
593698
|
-
type: external_exports2.literal("direct")
|
|
593699
|
-
})
|
|
593700
|
-
]).optional()
|
|
593386
|
+
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish()
|
|
593701
593387
|
}),
|
|
593702
593388
|
external_exports2.object({
|
|
593703
593389
|
type: external_exports2.literal("mcp_tool_use"),
|
|
@@ -593785,18 +593471,6 @@ var anthropicMessagesResponseSchema = lazySchema(
|
|
|
593785
593471
|
})
|
|
593786
593472
|
).optional().default([])
|
|
593787
593473
|
}),
|
|
593788
|
-
external_exports2.object({
|
|
593789
|
-
type: external_exports2.literal("encrypted_code_execution_result"),
|
|
593790
|
-
encrypted_stdout: external_exports2.string(),
|
|
593791
|
-
stderr: external_exports2.string(),
|
|
593792
|
-
return_code: external_exports2.number(),
|
|
593793
|
-
content: external_exports2.array(
|
|
593794
|
-
external_exports2.object({
|
|
593795
|
-
type: external_exports2.literal("code_execution_output"),
|
|
593796
|
-
file_id: external_exports2.string()
|
|
593797
|
-
})
|
|
593798
|
-
).optional().default([])
|
|
593799
|
-
}),
|
|
593800
593474
|
external_exports2.object({
|
|
593801
593475
|
type: external_exports2.literal("code_execution_tool_result_error"),
|
|
593802
593476
|
error_code: external_exports2.string()
|
|
@@ -593956,10 +593630,6 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
593956
593630
|
type: external_exports2.literal("code_execution_20250825"),
|
|
593957
593631
|
tool_id: external_exports2.string()
|
|
593958
593632
|
}),
|
|
593959
|
-
external_exports2.object({
|
|
593960
|
-
type: external_exports2.literal("code_execution_20260120"),
|
|
593961
|
-
tool_id: external_exports2.string()
|
|
593962
|
-
}),
|
|
593963
593633
|
external_exports2.object({
|
|
593964
593634
|
type: external_exports2.literal("direct")
|
|
593965
593635
|
})
|
|
@@ -593998,10 +593668,6 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
593998
593668
|
type: external_exports2.literal("code_execution_20250825"),
|
|
593999
593669
|
tool_id: external_exports2.string()
|
|
594000
593670
|
}),
|
|
594001
|
-
external_exports2.object({
|
|
594002
|
-
type: external_exports2.literal("code_execution_20260120"),
|
|
594003
|
-
tool_id: external_exports2.string()
|
|
594004
|
-
}),
|
|
594005
593671
|
external_exports2.object({
|
|
594006
593672
|
type: external_exports2.literal("direct")
|
|
594007
593673
|
})
|
|
@@ -594019,16 +593685,7 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
594019
593685
|
type: external_exports2.literal("server_tool_use"),
|
|
594020
593686
|
id: external_exports2.string(),
|
|
594021
593687
|
name: external_exports2.string(),
|
|
594022
|
-
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish()
|
|
594023
|
-
caller: external_exports2.union([
|
|
594024
|
-
external_exports2.object({
|
|
594025
|
-
type: external_exports2.literal("code_execution_20260120"),
|
|
594026
|
-
tool_id: external_exports2.string()
|
|
594027
|
-
}),
|
|
594028
|
-
external_exports2.object({
|
|
594029
|
-
type: external_exports2.literal("direct")
|
|
594030
|
-
})
|
|
594031
|
-
]).optional()
|
|
593688
|
+
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish()
|
|
594032
593689
|
}),
|
|
594033
593690
|
external_exports2.object({
|
|
594034
593691
|
type: external_exports2.literal("mcp_tool_use"),
|
|
@@ -594116,18 +593773,6 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
594116
593773
|
})
|
|
594117
593774
|
).optional().default([])
|
|
594118
593775
|
}),
|
|
594119
|
-
external_exports2.object({
|
|
594120
|
-
type: external_exports2.literal("encrypted_code_execution_result"),
|
|
594121
|
-
encrypted_stdout: external_exports2.string(),
|
|
594122
|
-
stderr: external_exports2.string(),
|
|
594123
|
-
return_code: external_exports2.number(),
|
|
594124
|
-
content: external_exports2.array(
|
|
594125
|
-
external_exports2.object({
|
|
594126
|
-
type: external_exports2.literal("code_execution_output"),
|
|
594127
|
-
file_id: external_exports2.string()
|
|
594128
|
-
})
|
|
594129
|
-
).optional().default([])
|
|
594130
|
-
}),
|
|
594131
593776
|
external_exports2.object({
|
|
594132
593777
|
type: external_exports2.literal("code_execution_tool_result_error"),
|
|
594133
593778
|
error_code: external_exports2.string()
|
|
@@ -594380,7 +594025,7 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594380
594025
|
/**
|
|
594381
594026
|
* Determines how structured outputs are generated.
|
|
594382
594027
|
*
|
|
594383
|
-
* - `outputFormat`: Use the `
|
|
594028
|
+
* - `outputFormat`: Use the `output_format` parameter to specify the structured output format.
|
|
594384
594029
|
* - `jsonTool`: Use a special 'json' tool to specify the structured output format.
|
|
594385
594030
|
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).
|
|
594386
594031
|
*/
|
|
@@ -594394,13 +594039,7 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594394
594039
|
thinking: external_exports2.discriminatedUnion("type", [
|
|
594395
594040
|
external_exports2.object({
|
|
594396
594041
|
/** for Sonnet 4.6, Opus 4.6, and newer models */
|
|
594397
|
-
type: external_exports2.literal("adaptive")
|
|
594398
|
-
/**
|
|
594399
|
-
* Controls whether thinking content is included in the response.
|
|
594400
|
-
* - `"omitted"`: Thinking blocks are present but text is empty (default for Opus 4.7+).
|
|
594401
|
-
* - `"summarized"`: Thinking content is returned. Required to see reasoning output.
|
|
594402
|
-
*/
|
|
594403
|
-
display: external_exports2.enum(["omitted", "summarized"]).optional()
|
|
594042
|
+
type: external_exports2.literal("adaptive")
|
|
594404
594043
|
}),
|
|
594405
594044
|
external_exports2.object({
|
|
594406
594045
|
/** for models before Opus 4.6, except Sonnet 4.6 still supports it */
|
|
@@ -594424,20 +594063,6 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594424
594063
|
type: external_exports2.literal("ephemeral"),
|
|
594425
594064
|
ttl: external_exports2.union([external_exports2.literal("5m"), external_exports2.literal("1h")]).optional()
|
|
594426
594065
|
}).optional(),
|
|
594427
|
-
/**
|
|
594428
|
-
* Metadata to include with the request.
|
|
594429
|
-
*
|
|
594430
|
-
* See https://platform.claude.com/docs/en/api/messages/create for details.
|
|
594431
|
-
*/
|
|
594432
|
-
metadata: external_exports2.object({
|
|
594433
|
-
/**
|
|
594434
|
-
* An external identifier for the user associated with the request.
|
|
594435
|
-
*
|
|
594436
|
-
* Should be a UUID, hash value, or other opaque identifier.
|
|
594437
|
-
* Must not contain PII (name, email, phone number, etc.).
|
|
594438
|
-
*/
|
|
594439
|
-
userId: external_exports2.string().optional()
|
|
594440
|
-
}).optional(),
|
|
594441
594066
|
/**
|
|
594442
594067
|
* MCP servers to be utilized in this request.
|
|
594443
594068
|
*/
|
|
@@ -594469,11 +594094,10 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594469
594094
|
).optional()
|
|
594470
594095
|
}).optional(),
|
|
594471
594096
|
/**
|
|
594472
|
-
* Whether to enable
|
|
594473
|
-
*
|
|
594474
|
-
*
|
|
594475
|
-
*
|
|
594476
|
-
* `providerOptions.anthropic.eagerInputStreaming`.
|
|
594097
|
+
* Whether to enable tool streaming (and structured output streaming).
|
|
594098
|
+
*
|
|
594099
|
+
* When set to false, the model will return all tool calls and results
|
|
594100
|
+
* at once after a delay.
|
|
594477
594101
|
*
|
|
594478
594102
|
* @default true
|
|
594479
594103
|
*/
|
|
@@ -594481,38 +594105,12 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594481
594105
|
/**
|
|
594482
594106
|
* @default 'high'
|
|
594483
594107
|
*/
|
|
594484
|
-
effort: external_exports2.enum(["low", "medium", "high", "
|
|
594485
|
-
/**
|
|
594486
|
-
* Task budget for agentic turns. Informs the model of the total token budget
|
|
594487
|
-
* available for the current task, allowing it to prioritize work and wind down
|
|
594488
|
-
* gracefully as the budget is consumed.
|
|
594489
|
-
*
|
|
594490
|
-
* Advisory only — does not enforce a hard token limit.
|
|
594491
|
-
*/
|
|
594492
|
-
taskBudget: external_exports2.object({
|
|
594493
|
-
type: external_exports2.literal("tokens"),
|
|
594494
|
-
total: external_exports2.number().int().min(2e4),
|
|
594495
|
-
remaining: external_exports2.number().int().min(0).optional()
|
|
594496
|
-
}).optional(),
|
|
594108
|
+
effort: external_exports2.enum(["low", "medium", "high", "max"]).optional(),
|
|
594497
594109
|
/**
|
|
594498
594110
|
* Enable fast mode for faster inference (2.5x faster output token speeds).
|
|
594499
594111
|
* Only supported with claude-opus-4-6.
|
|
594500
594112
|
*/
|
|
594501
594113
|
speed: external_exports2.enum(["fast", "standard"]).optional(),
|
|
594502
|
-
/**
|
|
594503
|
-
* Controls where model inference runs for this request.
|
|
594504
|
-
*
|
|
594505
|
-
* - `"global"`: Inference may run in any available geography (default).
|
|
594506
|
-
* - `"us"`: Inference runs only in US-based infrastructure.
|
|
594507
|
-
*
|
|
594508
|
-
* See https://platform.claude.com/docs/en/build-with-claude/data-residency
|
|
594509
|
-
*/
|
|
594510
|
-
inferenceGeo: external_exports2.enum(["us", "global"]).optional(),
|
|
594511
|
-
/**
|
|
594512
|
-
* A set of beta features to enable.
|
|
594513
|
-
* Allow a provider to receive the full `betas` set if it needs it.
|
|
594514
|
-
*/
|
|
594515
|
-
anthropicBeta: external_exports2.array(external_exports2.string()).optional(),
|
|
594516
594114
|
contextManagement: external_exports2.object({
|
|
594517
594115
|
edits: external_exports2.array(
|
|
594518
594116
|
external_exports2.discriminatedUnion("type", [
|
|
@@ -594630,51 +594228,6 @@ var factory = createProviderToolFactory({
|
|
|
594630
594228
|
var textEditor_20250728 = (args = {}) => {
|
|
594631
594229
|
return factory(args);
|
|
594632
594230
|
};
|
|
594633
|
-
var webSearch_20260209ArgsSchema = lazySchema(
|
|
594634
|
-
() => zodSchema3(
|
|
594635
|
-
external_exports2.object({
|
|
594636
|
-
maxUses: external_exports2.number().optional(),
|
|
594637
|
-
allowedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594638
|
-
blockedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594639
|
-
userLocation: external_exports2.object({
|
|
594640
|
-
type: external_exports2.literal("approximate"),
|
|
594641
|
-
city: external_exports2.string().optional(),
|
|
594642
|
-
region: external_exports2.string().optional(),
|
|
594643
|
-
country: external_exports2.string().optional(),
|
|
594644
|
-
timezone: external_exports2.string().optional()
|
|
594645
|
-
}).optional()
|
|
594646
|
-
})
|
|
594647
|
-
)
|
|
594648
|
-
);
|
|
594649
|
-
var webSearch_20260209OutputSchema = lazySchema(
|
|
594650
|
-
() => zodSchema3(
|
|
594651
|
-
external_exports2.array(
|
|
594652
|
-
external_exports2.object({
|
|
594653
|
-
url: external_exports2.string(),
|
|
594654
|
-
title: external_exports2.string().nullable(),
|
|
594655
|
-
pageAge: external_exports2.string().nullable(),
|
|
594656
|
-
encryptedContent: external_exports2.string(),
|
|
594657
|
-
type: external_exports2.literal("web_search_result")
|
|
594658
|
-
})
|
|
594659
|
-
)
|
|
594660
|
-
)
|
|
594661
|
-
);
|
|
594662
|
-
var webSearch_20260209InputSchema = lazySchema(
|
|
594663
|
-
() => zodSchema3(
|
|
594664
|
-
external_exports2.object({
|
|
594665
|
-
query: external_exports2.string()
|
|
594666
|
-
})
|
|
594667
|
-
)
|
|
594668
|
-
);
|
|
594669
|
-
var factory2 = createProviderToolFactoryWithOutputSchema({
|
|
594670
|
-
id: "anthropic.web_search_20260209",
|
|
594671
|
-
inputSchema: webSearch_20260209InputSchema,
|
|
594672
|
-
outputSchema: webSearch_20260209OutputSchema,
|
|
594673
|
-
supportsDeferredResults: true
|
|
594674
|
-
});
|
|
594675
|
-
var webSearch_20260209 = (args = {}) => {
|
|
594676
|
-
return factory2(args);
|
|
594677
|
-
};
|
|
594678
594231
|
var webSearch_20250305ArgsSchema = lazySchema(
|
|
594679
594232
|
() => zodSchema3(
|
|
594680
594233
|
external_exports2.object({
|
|
@@ -594711,67 +594264,14 @@ var webSearch_20250305InputSchema = lazySchema(
|
|
|
594711
594264
|
})
|
|
594712
594265
|
)
|
|
594713
594266
|
);
|
|
594714
|
-
var
|
|
594267
|
+
var factory2 = createProviderToolFactoryWithOutputSchema({
|
|
594715
594268
|
id: "anthropic.web_search_20250305",
|
|
594716
594269
|
inputSchema: webSearch_20250305InputSchema,
|
|
594717
594270
|
outputSchema: webSearch_20250305OutputSchema,
|
|
594718
594271
|
supportsDeferredResults: true
|
|
594719
594272
|
});
|
|
594720
594273
|
var webSearch_20250305 = (args = {}) => {
|
|
594721
|
-
return
|
|
594722
|
-
};
|
|
594723
|
-
var webFetch_20260209ArgsSchema = lazySchema(
|
|
594724
|
-
() => zodSchema3(
|
|
594725
|
-
external_exports2.object({
|
|
594726
|
-
maxUses: external_exports2.number().optional(),
|
|
594727
|
-
allowedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594728
|
-
blockedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594729
|
-
citations: external_exports2.object({ enabled: external_exports2.boolean() }).optional(),
|
|
594730
|
-
maxContentTokens: external_exports2.number().optional()
|
|
594731
|
-
})
|
|
594732
|
-
)
|
|
594733
|
-
);
|
|
594734
|
-
var webFetch_20260209OutputSchema = lazySchema(
|
|
594735
|
-
() => zodSchema3(
|
|
594736
|
-
external_exports2.object({
|
|
594737
|
-
type: external_exports2.literal("web_fetch_result"),
|
|
594738
|
-
url: external_exports2.string(),
|
|
594739
|
-
content: external_exports2.object({
|
|
594740
|
-
type: external_exports2.literal("document"),
|
|
594741
|
-
title: external_exports2.string().nullable(),
|
|
594742
|
-
citations: external_exports2.object({ enabled: external_exports2.boolean() }).optional(),
|
|
594743
|
-
source: external_exports2.union([
|
|
594744
|
-
external_exports2.object({
|
|
594745
|
-
type: external_exports2.literal("base64"),
|
|
594746
|
-
mediaType: external_exports2.literal("application/pdf"),
|
|
594747
|
-
data: external_exports2.string()
|
|
594748
|
-
}),
|
|
594749
|
-
external_exports2.object({
|
|
594750
|
-
type: external_exports2.literal("text"),
|
|
594751
|
-
mediaType: external_exports2.literal("text/plain"),
|
|
594752
|
-
data: external_exports2.string()
|
|
594753
|
-
})
|
|
594754
|
-
])
|
|
594755
|
-
}),
|
|
594756
|
-
retrievedAt: external_exports2.string().nullable()
|
|
594757
|
-
})
|
|
594758
|
-
)
|
|
594759
|
-
);
|
|
594760
|
-
var webFetch_20260209InputSchema = lazySchema(
|
|
594761
|
-
() => zodSchema3(
|
|
594762
|
-
external_exports2.object({
|
|
594763
|
-
url: external_exports2.string()
|
|
594764
|
-
})
|
|
594765
|
-
)
|
|
594766
|
-
);
|
|
594767
|
-
var factory4 = createProviderToolFactoryWithOutputSchema({
|
|
594768
|
-
id: "anthropic.web_fetch_20260209",
|
|
594769
|
-
inputSchema: webFetch_20260209InputSchema,
|
|
594770
|
-
outputSchema: webFetch_20260209OutputSchema,
|
|
594771
|
-
supportsDeferredResults: true
|
|
594772
|
-
});
|
|
594773
|
-
var webFetch_20260209 = (args = {}) => {
|
|
594774
|
-
return factory4(args);
|
|
594274
|
+
return factory2(args);
|
|
594775
594275
|
};
|
|
594776
594276
|
var webFetch_20250910ArgsSchema = lazySchema(
|
|
594777
594277
|
() => zodSchema3(
|
|
@@ -594817,25 +594317,23 @@ var webFetch_20250910InputSchema = lazySchema(
|
|
|
594817
594317
|
})
|
|
594818
594318
|
)
|
|
594819
594319
|
);
|
|
594820
|
-
var
|
|
594320
|
+
var factory3 = createProviderToolFactoryWithOutputSchema({
|
|
594821
594321
|
id: "anthropic.web_fetch_20250910",
|
|
594822
594322
|
inputSchema: webFetch_20250910InputSchema,
|
|
594823
594323
|
outputSchema: webFetch_20250910OutputSchema,
|
|
594824
594324
|
supportsDeferredResults: true
|
|
594825
594325
|
});
|
|
594826
594326
|
var webFetch_20250910 = (args = {}) => {
|
|
594827
|
-
return
|
|
594327
|
+
return factory3(args);
|
|
594828
594328
|
};
|
|
594829
594329
|
async function prepareTools({
|
|
594830
594330
|
tools,
|
|
594831
594331
|
toolChoice,
|
|
594832
594332
|
disableParallelToolUse,
|
|
594833
594333
|
cacheControlValidator,
|
|
594834
|
-
supportsStructuredOutput
|
|
594835
|
-
supportsStrictTools,
|
|
594836
|
-
defaultEagerInputStreaming = false
|
|
594334
|
+
supportsStructuredOutput
|
|
594837
594335
|
}) {
|
|
594838
|
-
var _a21
|
|
594336
|
+
var _a21;
|
|
594839
594337
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
594840
594338
|
const toolWarnings = [];
|
|
594841
594339
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -594852,23 +594350,14 @@ async function prepareTools({
|
|
|
594852
594350
|
canCache: true
|
|
594853
594351
|
});
|
|
594854
594352
|
const anthropicOptions = (_a21 = tool3.providerOptions) == null ? void 0 : _a21.anthropic;
|
|
594855
|
-
const eagerInputStreaming = (_b17 = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b17 : defaultEagerInputStreaming;
|
|
594856
594353
|
const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
|
|
594857
594354
|
const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;
|
|
594858
|
-
if (!supportsStrictTools && tool3.strict != null) {
|
|
594859
|
-
toolWarnings.push({
|
|
594860
|
-
type: "unsupported",
|
|
594861
|
-
feature: "strict",
|
|
594862
|
-
details: `Tool '${tool3.name}' has strict: ${tool3.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`
|
|
594863
|
-
});
|
|
594864
|
-
}
|
|
594865
594355
|
anthropicTools2.push({
|
|
594866
594356
|
name: tool3.name,
|
|
594867
594357
|
description: tool3.description,
|
|
594868
594358
|
input_schema: tool3.inputSchema,
|
|
594869
594359
|
cache_control: cacheControl,
|
|
594870
|
-
...
|
|
594871
|
-
...supportsStrictTools === true && tool3.strict != null ? { strict: tool3.strict } : {},
|
|
594360
|
+
...supportsStructuredOutput === true && tool3.strict != null ? { strict: tool3.strict } : {},
|
|
594872
594361
|
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
594873
594362
|
...allowedCallers != null ? { allowed_callers: allowedCallers } : {},
|
|
594874
594363
|
...tool3.inputExamples != null ? {
|
|
@@ -594904,13 +594393,6 @@ async function prepareTools({
|
|
|
594904
594393
|
});
|
|
594905
594394
|
break;
|
|
594906
594395
|
}
|
|
594907
|
-
case "anthropic.code_execution_20260120": {
|
|
594908
|
-
anthropicTools2.push({
|
|
594909
|
-
type: "code_execution_20260120",
|
|
594910
|
-
name: "code_execution"
|
|
594911
|
-
});
|
|
594912
|
-
break;
|
|
594913
|
-
}
|
|
594914
594396
|
case "anthropic.computer_20250124": {
|
|
594915
594397
|
betas.add("computer-use-2025-01-24");
|
|
594916
594398
|
anthropicTools2.push({
|
|
@@ -595032,24 +594514,6 @@ async function prepareTools({
|
|
|
595032
594514
|
});
|
|
595033
594515
|
break;
|
|
595034
594516
|
}
|
|
595035
|
-
case "anthropic.web_fetch_20260209": {
|
|
595036
|
-
betas.add("code-execution-web-tools-2026-02-09");
|
|
595037
|
-
const args = await validateTypes2({
|
|
595038
|
-
value: tool3.args,
|
|
595039
|
-
schema: webFetch_20260209ArgsSchema
|
|
595040
|
-
});
|
|
595041
|
-
anthropicTools2.push({
|
|
595042
|
-
type: "web_fetch_20260209",
|
|
595043
|
-
name: "web_fetch",
|
|
595044
|
-
max_uses: args.maxUses,
|
|
595045
|
-
allowed_domains: args.allowedDomains,
|
|
595046
|
-
blocked_domains: args.blockedDomains,
|
|
595047
|
-
citations: args.citations,
|
|
595048
|
-
max_content_tokens: args.maxContentTokens,
|
|
595049
|
-
cache_control: void 0
|
|
595050
|
-
});
|
|
595051
|
-
break;
|
|
595052
|
-
}
|
|
595053
594517
|
case "anthropic.web_search_20250305": {
|
|
595054
594518
|
const args = await validateTypes2({
|
|
595055
594519
|
value: tool3.args,
|
|
@@ -595066,24 +594530,8 @@ async function prepareTools({
|
|
|
595066
594530
|
});
|
|
595067
594531
|
break;
|
|
595068
594532
|
}
|
|
595069
|
-
case "anthropic.web_search_20260209": {
|
|
595070
|
-
betas.add("code-execution-web-tools-2026-02-09");
|
|
595071
|
-
const args = await validateTypes2({
|
|
595072
|
-
value: tool3.args,
|
|
595073
|
-
schema: webSearch_20260209ArgsSchema
|
|
595074
|
-
});
|
|
595075
|
-
anthropicTools2.push({
|
|
595076
|
-
type: "web_search_20260209",
|
|
595077
|
-
name: "web_search",
|
|
595078
|
-
max_uses: args.maxUses,
|
|
595079
|
-
allowed_domains: args.allowedDomains,
|
|
595080
|
-
blocked_domains: args.blockedDomains,
|
|
595081
|
-
user_location: args.userLocation,
|
|
595082
|
-
cache_control: void 0
|
|
595083
|
-
});
|
|
595084
|
-
break;
|
|
595085
|
-
}
|
|
595086
594533
|
case "anthropic.tool_search_regex_20251119": {
|
|
594534
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
595087
594535
|
anthropicTools2.push({
|
|
595088
594536
|
type: "tool_search_tool_regex_20251119",
|
|
595089
594537
|
name: "tool_search_tool_regex"
|
|
@@ -595091,6 +594539,7 @@ async function prepareTools({
|
|
|
595091
594539
|
break;
|
|
595092
594540
|
}
|
|
595093
594541
|
case "anthropic.tool_search_bm25_20251119": {
|
|
594542
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
595094
594543
|
anthropicTools2.push({
|
|
595095
594544
|
type: "tool_search_tool_bm25_20251119",
|
|
595096
594545
|
name: "tool_search_tool_bm25"
|
|
@@ -595228,13 +594677,13 @@ var codeExecution_20250522InputSchema = lazySchema(
|
|
|
595228
594677
|
})
|
|
595229
594678
|
)
|
|
595230
594679
|
);
|
|
595231
|
-
var
|
|
594680
|
+
var factory4 = createProviderToolFactoryWithOutputSchema({
|
|
595232
594681
|
id: "anthropic.code_execution_20250522",
|
|
595233
594682
|
inputSchema: codeExecution_20250522InputSchema,
|
|
595234
594683
|
outputSchema: codeExecution_20250522OutputSchema
|
|
595235
594684
|
});
|
|
595236
594685
|
var codeExecution_20250522 = (args = {}) => {
|
|
595237
|
-
return
|
|
594686
|
+
return factory4(args);
|
|
595238
594687
|
};
|
|
595239
594688
|
var codeExecution_20250825OutputSchema = lazySchema(
|
|
595240
594689
|
() => zodSchema3(
|
|
@@ -595329,7 +594778,7 @@ var codeExecution_20250825InputSchema = lazySchema(
|
|
|
595329
594778
|
])
|
|
595330
594779
|
)
|
|
595331
594780
|
);
|
|
595332
|
-
var
|
|
594781
|
+
var factory5 = createProviderToolFactoryWithOutputSchema({
|
|
595333
594782
|
id: "anthropic.code_execution_20250825",
|
|
595334
594783
|
inputSchema: codeExecution_20250825InputSchema,
|
|
595335
594784
|
outputSchema: codeExecution_20250825OutputSchema,
|
|
@@ -595339,120 +594788,7 @@ var factory7 = createProviderToolFactoryWithOutputSchema({
|
|
|
595339
594788
|
supportsDeferredResults: true
|
|
595340
594789
|
});
|
|
595341
594790
|
var codeExecution_20250825 = (args = {}) => {
|
|
595342
|
-
return
|
|
595343
|
-
};
|
|
595344
|
-
var codeExecution_20260120OutputSchema = lazySchema(
|
|
595345
|
-
() => zodSchema3(
|
|
595346
|
-
external_exports2.discriminatedUnion("type", [
|
|
595347
|
-
external_exports2.object({
|
|
595348
|
-
type: external_exports2.literal("code_execution_result"),
|
|
595349
|
-
stdout: external_exports2.string(),
|
|
595350
|
-
stderr: external_exports2.string(),
|
|
595351
|
-
return_code: external_exports2.number(),
|
|
595352
|
-
content: external_exports2.array(
|
|
595353
|
-
external_exports2.object({
|
|
595354
|
-
type: external_exports2.literal("code_execution_output"),
|
|
595355
|
-
file_id: external_exports2.string()
|
|
595356
|
-
})
|
|
595357
|
-
).optional().default([])
|
|
595358
|
-
}),
|
|
595359
|
-
external_exports2.object({
|
|
595360
|
-
type: external_exports2.literal("encrypted_code_execution_result"),
|
|
595361
|
-
encrypted_stdout: external_exports2.string(),
|
|
595362
|
-
stderr: external_exports2.string(),
|
|
595363
|
-
return_code: external_exports2.number(),
|
|
595364
|
-
content: external_exports2.array(
|
|
595365
|
-
external_exports2.object({
|
|
595366
|
-
type: external_exports2.literal("code_execution_output"),
|
|
595367
|
-
file_id: external_exports2.string()
|
|
595368
|
-
})
|
|
595369
|
-
).optional().default([])
|
|
595370
|
-
}),
|
|
595371
|
-
external_exports2.object({
|
|
595372
|
-
type: external_exports2.literal("bash_code_execution_result"),
|
|
595373
|
-
content: external_exports2.array(
|
|
595374
|
-
external_exports2.object({
|
|
595375
|
-
type: external_exports2.literal("bash_code_execution_output"),
|
|
595376
|
-
file_id: external_exports2.string()
|
|
595377
|
-
})
|
|
595378
|
-
),
|
|
595379
|
-
stdout: external_exports2.string(),
|
|
595380
|
-
stderr: external_exports2.string(),
|
|
595381
|
-
return_code: external_exports2.number()
|
|
595382
|
-
}),
|
|
595383
|
-
external_exports2.object({
|
|
595384
|
-
type: external_exports2.literal("bash_code_execution_tool_result_error"),
|
|
595385
|
-
error_code: external_exports2.string()
|
|
595386
|
-
}),
|
|
595387
|
-
external_exports2.object({
|
|
595388
|
-
type: external_exports2.literal("text_editor_code_execution_tool_result_error"),
|
|
595389
|
-
error_code: external_exports2.string()
|
|
595390
|
-
}),
|
|
595391
|
-
external_exports2.object({
|
|
595392
|
-
type: external_exports2.literal("text_editor_code_execution_view_result"),
|
|
595393
|
-
content: external_exports2.string(),
|
|
595394
|
-
file_type: external_exports2.string(),
|
|
595395
|
-
num_lines: external_exports2.number().nullable(),
|
|
595396
|
-
start_line: external_exports2.number().nullable(),
|
|
595397
|
-
total_lines: external_exports2.number().nullable()
|
|
595398
|
-
}),
|
|
595399
|
-
external_exports2.object({
|
|
595400
|
-
type: external_exports2.literal("text_editor_code_execution_create_result"),
|
|
595401
|
-
is_file_update: external_exports2.boolean()
|
|
595402
|
-
}),
|
|
595403
|
-
external_exports2.object({
|
|
595404
|
-
type: external_exports2.literal("text_editor_code_execution_str_replace_result"),
|
|
595405
|
-
lines: external_exports2.array(external_exports2.string()).nullable(),
|
|
595406
|
-
new_lines: external_exports2.number().nullable(),
|
|
595407
|
-
new_start: external_exports2.number().nullable(),
|
|
595408
|
-
old_lines: external_exports2.number().nullable(),
|
|
595409
|
-
old_start: external_exports2.number().nullable()
|
|
595410
|
-
})
|
|
595411
|
-
])
|
|
595412
|
-
)
|
|
595413
|
-
);
|
|
595414
|
-
var codeExecution_20260120InputSchema = lazySchema(
|
|
595415
|
-
() => zodSchema3(
|
|
595416
|
-
external_exports2.discriminatedUnion("type", [
|
|
595417
|
-
external_exports2.object({
|
|
595418
|
-
type: external_exports2.literal("programmatic-tool-call"),
|
|
595419
|
-
code: external_exports2.string()
|
|
595420
|
-
}),
|
|
595421
|
-
external_exports2.object({
|
|
595422
|
-
type: external_exports2.literal("bash_code_execution"),
|
|
595423
|
-
command: external_exports2.string()
|
|
595424
|
-
}),
|
|
595425
|
-
external_exports2.discriminatedUnion("command", [
|
|
595426
|
-
external_exports2.object({
|
|
595427
|
-
type: external_exports2.literal("text_editor_code_execution"),
|
|
595428
|
-
command: external_exports2.literal("view"),
|
|
595429
|
-
path: external_exports2.string()
|
|
595430
|
-
}),
|
|
595431
|
-
external_exports2.object({
|
|
595432
|
-
type: external_exports2.literal("text_editor_code_execution"),
|
|
595433
|
-
command: external_exports2.literal("create"),
|
|
595434
|
-
path: external_exports2.string(),
|
|
595435
|
-
file_text: external_exports2.string().nullish()
|
|
595436
|
-
}),
|
|
595437
|
-
external_exports2.object({
|
|
595438
|
-
type: external_exports2.literal("text_editor_code_execution"),
|
|
595439
|
-
command: external_exports2.literal("str_replace"),
|
|
595440
|
-
path: external_exports2.string(),
|
|
595441
|
-
old_str: external_exports2.string(),
|
|
595442
|
-
new_str: external_exports2.string()
|
|
595443
|
-
})
|
|
595444
|
-
])
|
|
595445
|
-
])
|
|
595446
|
-
)
|
|
595447
|
-
);
|
|
595448
|
-
var factory8 = createProviderToolFactoryWithOutputSchema({
|
|
595449
|
-
id: "anthropic.code_execution_20260120",
|
|
595450
|
-
inputSchema: codeExecution_20260120InputSchema,
|
|
595451
|
-
outputSchema: codeExecution_20260120OutputSchema,
|
|
595452
|
-
supportsDeferredResults: true
|
|
595453
|
-
});
|
|
595454
|
-
var codeExecution_20260120 = (args = {}) => {
|
|
595455
|
-
return factory8(args);
|
|
594791
|
+
return factory5(args);
|
|
595456
594792
|
};
|
|
595457
594793
|
var toolSearchRegex_20251119OutputSchema = lazySchema(
|
|
595458
594794
|
() => zodSchema3(
|
|
@@ -595485,18 +594821,18 @@ var toolSearchRegex_20251119InputSchema = lazySchema(
|
|
|
595485
594821
|
})
|
|
595486
594822
|
)
|
|
595487
594823
|
);
|
|
595488
|
-
var
|
|
594824
|
+
var factory6 = createProviderToolFactoryWithOutputSchema({
|
|
595489
594825
|
id: "anthropic.tool_search_regex_20251119",
|
|
595490
594826
|
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
595491
594827
|
outputSchema: toolSearchRegex_20251119OutputSchema,
|
|
595492
594828
|
supportsDeferredResults: true
|
|
595493
594829
|
});
|
|
595494
594830
|
var toolSearchRegex_20251119 = (args = {}) => {
|
|
595495
|
-
return
|
|
594831
|
+
return factory6(args);
|
|
595496
594832
|
};
|
|
595497
594833
|
function convertToString(data3) {
|
|
595498
594834
|
if (typeof data3 === "string") {
|
|
595499
|
-
return
|
|
594835
|
+
return Buffer.from(data3, "base64").toString("utf-8");
|
|
595500
594836
|
}
|
|
595501
594837
|
if (data3 instanceof Uint8Array) {
|
|
595502
594838
|
return new TextDecoder().decode(data3);
|
|
@@ -595526,7 +594862,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595526
594862
|
cacheControlValidator,
|
|
595527
594863
|
toolNameMapping
|
|
595528
594864
|
}) {
|
|
595529
|
-
var _a21, _b17, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r
|
|
594865
|
+
var _a21, _b17, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
595530
594866
|
const betas = /* @__PURE__ */ new Set();
|
|
595531
594867
|
const blocks = groupIntoBlocks(prompt);
|
|
595532
594868
|
const validator = cacheControlValidator || new CacheControlValidator();
|
|
@@ -595964,8 +595300,8 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595964
595300
|
break;
|
|
595965
595301
|
}
|
|
595966
595302
|
const callerOptions = (_l = part.providerOptions) == null ? void 0 : _l.anthropic;
|
|
595967
|
-
const caller = (callerOptions == null ? void 0 : callerOptions.caller) ?
|
|
595968
|
-
type:
|
|
595303
|
+
const caller = (callerOptions == null ? void 0 : callerOptions.caller) ? callerOptions.caller.type === "code_execution_20250825" && callerOptions.caller.toolId ? {
|
|
595304
|
+
type: "code_execution_20250825",
|
|
595969
595305
|
tool_id: callerOptions.caller.toolId
|
|
595970
595306
|
} : callerOptions.caller.type === "direct" ? { type: "direct" } : void 0 : void 0;
|
|
595971
595307
|
anthropicContent.push({
|
|
@@ -596064,25 +595400,6 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
596064
595400
|
},
|
|
596065
595401
|
cache_control: cacheControl
|
|
596066
595402
|
});
|
|
596067
|
-
} else if (output.value.type === "encrypted_code_execution_result") {
|
|
596068
|
-
const codeExecutionOutput = await validateTypes2({
|
|
596069
|
-
value: output.value,
|
|
596070
|
-
schema: codeExecution_20260120OutputSchema
|
|
596071
|
-
});
|
|
596072
|
-
if (codeExecutionOutput.type === "encrypted_code_execution_result") {
|
|
596073
|
-
anthropicContent.push({
|
|
596074
|
-
type: "code_execution_tool_result",
|
|
596075
|
-
tool_use_id: part.toolCallId,
|
|
596076
|
-
content: {
|
|
596077
|
-
type: codeExecutionOutput.type,
|
|
596078
|
-
encrypted_stdout: codeExecutionOutput.encrypted_stdout,
|
|
596079
|
-
stderr: codeExecutionOutput.stderr,
|
|
596080
|
-
return_code: codeExecutionOutput.return_code,
|
|
596081
|
-
content: (_p = codeExecutionOutput.content) != null ? _p : []
|
|
596082
|
-
},
|
|
596083
|
-
cache_control: cacheControl
|
|
596084
|
-
});
|
|
596085
|
-
}
|
|
596086
595403
|
} else {
|
|
596087
595404
|
const codeExecutionOutput = await validateTypes2({
|
|
596088
595405
|
value: output.value,
|
|
@@ -596097,7 +595414,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
596097
595414
|
stdout: codeExecutionOutput.stdout,
|
|
596098
595415
|
stderr: codeExecutionOutput.stderr,
|
|
596099
595416
|
return_code: codeExecutionOutput.return_code,
|
|
596100
|
-
content: (
|
|
595417
|
+
content: (_p = codeExecutionOutput.content) != null ? _p : []
|
|
596101
595418
|
},
|
|
596102
595419
|
cache_control: cacheControl
|
|
596103
595420
|
});
|
|
@@ -596130,9 +595447,9 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
596130
595447
|
errorValue = output.value;
|
|
596131
595448
|
}
|
|
596132
595449
|
} catch (e) {
|
|
596133
|
-
const extractedErrorCode = (
|
|
595450
|
+
const extractedErrorCode = (_q = output.value) == null ? void 0 : _q.errorCode;
|
|
596134
595451
|
errorValue = {
|
|
596135
|
-
errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "
|
|
595452
|
+
errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "unknown"
|
|
596136
595453
|
};
|
|
596137
595454
|
}
|
|
596138
595455
|
anthropicContent.push({
|
|
@@ -596140,7 +595457,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
596140
595457
|
tool_use_id: part.toolCallId,
|
|
596141
595458
|
content: {
|
|
596142
595459
|
type: "web_fetch_tool_result_error",
|
|
596143
|
-
error_code: (
|
|
595460
|
+
error_code: (_r = errorValue.errorCode) != null ? _r : "unknown"
|
|
596144
595461
|
},
|
|
596145
595462
|
cache_control: cacheControl
|
|
596146
595463
|
});
|
|
@@ -596413,7 +595730,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596413
595730
|
providerOptions,
|
|
596414
595731
|
stream: stream5
|
|
596415
595732
|
}) {
|
|
596416
|
-
var _a21, _b17, _c, _d, _e, _f
|
|
595733
|
+
var _a21, _b17, _c, _d, _e, _f;
|
|
596417
595734
|
const warnings = [];
|
|
596418
595735
|
if (frequencyPenalty != null) {
|
|
596419
595736
|
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
@@ -596468,39 +595785,10 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596468
595785
|
const {
|
|
596469
595786
|
maxOutputTokens: maxOutputTokensForModel,
|
|
596470
595787
|
supportsStructuredOutput: modelSupportsStructuredOutput,
|
|
596471
|
-
rejectsSamplingParameters,
|
|
596472
595788
|
isKnownModel
|
|
596473
595789
|
} = getModelCapabilities(this.modelId);
|
|
596474
|
-
if (rejectsSamplingParameters) {
|
|
596475
|
-
if (temperature != null) {
|
|
596476
|
-
warnings.push({
|
|
596477
|
-
type: "unsupported",
|
|
596478
|
-
feature: "temperature",
|
|
596479
|
-
details: `temperature is not supported by ${this.modelId} and will be ignored`
|
|
596480
|
-
});
|
|
596481
|
-
temperature = void 0;
|
|
596482
|
-
}
|
|
596483
|
-
if (topK != null) {
|
|
596484
|
-
warnings.push({
|
|
596485
|
-
type: "unsupported",
|
|
596486
|
-
feature: "topK",
|
|
596487
|
-
details: `topK is not supported by ${this.modelId} and will be ignored`
|
|
596488
|
-
});
|
|
596489
|
-
topK = void 0;
|
|
596490
|
-
}
|
|
596491
|
-
if (topP != null) {
|
|
596492
|
-
warnings.push({
|
|
596493
|
-
type: "unsupported",
|
|
596494
|
-
feature: "topP",
|
|
596495
|
-
details: `topP is not supported by ${this.modelId} and will be ignored`
|
|
596496
|
-
});
|
|
596497
|
-
topP = void 0;
|
|
596498
|
-
}
|
|
596499
|
-
}
|
|
596500
|
-
const isAnthropicModel = isKnownModel || this.modelId.startsWith("claude-");
|
|
596501
595790
|
const supportsStructuredOutput = ((_a21 = this.config.supportsNativeStructuredOutput) != null ? _a21 : true) && modelSupportsStructuredOutput;
|
|
596502
|
-
const
|
|
596503
|
-
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
595791
|
+
const structureOutputMode = (_b17 = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _b17 : "auto";
|
|
596504
595792
|
const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
596505
595793
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
596506
595794
|
type: "function",
|
|
@@ -596515,7 +595803,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596515
595803
|
providerToolNames: {
|
|
596516
595804
|
"anthropic.code_execution_20250522": "code_execution",
|
|
596517
595805
|
"anthropic.code_execution_20250825": "code_execution",
|
|
596518
|
-
"anthropic.code_execution_20260120": "code_execution",
|
|
596519
595806
|
"anthropic.computer_20241022": "computer",
|
|
596520
595807
|
"anthropic.computer_20250124": "computer",
|
|
596521
595808
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
@@ -596526,24 +595813,21 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596526
595813
|
"anthropic.bash_20250124": "bash",
|
|
596527
595814
|
"anthropic.memory_20250818": "memory",
|
|
596528
595815
|
"anthropic.web_search_20250305": "web_search",
|
|
596529
|
-
"anthropic.web_search_20260209": "web_search",
|
|
596530
595816
|
"anthropic.web_fetch_20250910": "web_fetch",
|
|
596531
|
-
"anthropic.web_fetch_20260209": "web_fetch",
|
|
596532
595817
|
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
596533
595818
|
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25"
|
|
596534
595819
|
}
|
|
596535
595820
|
});
|
|
596536
595821
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
|
|
596537
595822
|
prompt,
|
|
596538
|
-
sendReasoning: (
|
|
595823
|
+
sendReasoning: (_c = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _c : true,
|
|
596539
595824
|
warnings,
|
|
596540
595825
|
cacheControlValidator,
|
|
596541
595826
|
toolNameMapping
|
|
596542
595827
|
});
|
|
596543
|
-
const thinkingType = (
|
|
595828
|
+
const thinkingType = (_d = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _d.type;
|
|
596544
595829
|
const isThinking = thinkingType === "enabled" || thinkingType === "adaptive";
|
|
596545
|
-
let thinkingBudget = thinkingType === "enabled" ? (
|
|
596546
|
-
const thinkingDisplay = thinkingType === "adaptive" ? (_g = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _g.display : void 0;
|
|
595830
|
+
let thinkingBudget = thinkingType === "enabled" ? (_e = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _e.budgetTokens : void 0;
|
|
596547
595831
|
const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
|
|
596548
595832
|
const baseArgs = {
|
|
596549
595833
|
// model id:
|
|
@@ -596558,43 +595842,21 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596558
595842
|
...isThinking && {
|
|
596559
595843
|
thinking: {
|
|
596560
595844
|
type: thinkingType,
|
|
596561
|
-
...thinkingBudget != null && { budget_tokens: thinkingBudget }
|
|
596562
|
-
...thinkingDisplay != null && { display: thinkingDisplay }
|
|
595845
|
+
...thinkingBudget != null && { budget_tokens: thinkingBudget }
|
|
596563
595846
|
}
|
|
596564
595847
|
},
|
|
596565
|
-
...(
|
|
596566
|
-
output_config: {
|
|
596567
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
596568
|
-
effort: anthropicOptions.effort
|
|
596569
|
-
},
|
|
596570
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) && {
|
|
596571
|
-
task_budget: {
|
|
596572
|
-
type: anthropicOptions.taskBudget.type,
|
|
596573
|
-
total: anthropicOptions.taskBudget.total,
|
|
596574
|
-
...anthropicOptions.taskBudget.remaining != null && {
|
|
596575
|
-
remaining: anthropicOptions.taskBudget.remaining
|
|
596576
|
-
}
|
|
596577
|
-
}
|
|
596578
|
-
},
|
|
596579
|
-
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
596580
|
-
format: {
|
|
596581
|
-
type: "json_schema",
|
|
596582
|
-
schema: responseFormat.schema
|
|
596583
|
-
}
|
|
596584
|
-
}
|
|
596585
|
-
}
|
|
595848
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
595849
|
+
output_config: { effort: anthropicOptions.effort }
|
|
596586
595850
|
},
|
|
596587
595851
|
...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
|
|
596588
595852
|
speed: anthropicOptions.speed
|
|
596589
595853
|
},
|
|
596590
|
-
|
|
596591
|
-
|
|
596592
|
-
|
|
596593
|
-
|
|
596594
|
-
|
|
596595
|
-
|
|
596596
|
-
...((_h = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _h.userId) != null && {
|
|
596597
|
-
metadata: { user_id: anthropicOptions.metadata.userId }
|
|
595854
|
+
// structured output:
|
|
595855
|
+
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
595856
|
+
output_format: {
|
|
595857
|
+
type: "json_schema",
|
|
595858
|
+
schema: responseFormat.schema
|
|
595859
|
+
}
|
|
596598
595860
|
},
|
|
596599
595861
|
// mcp servers:
|
|
596600
595862
|
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && {
|
|
@@ -596719,7 +595981,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596719
595981
|
}
|
|
596720
595982
|
baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0);
|
|
596721
595983
|
} else {
|
|
596722
|
-
if (
|
|
595984
|
+
if (topP != null && temperature != null) {
|
|
596723
595985
|
warnings.push({
|
|
596724
595986
|
type: "unsupported",
|
|
596725
595987
|
feature: "topP",
|
|
@@ -596752,7 +596014,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596752
596014
|
betas.add("skills-2025-10-02");
|
|
596753
596015
|
betas.add("files-api-2025-04-14");
|
|
596754
596016
|
if (!(tools == null ? void 0 : tools.some(
|
|
596755
|
-
(tool3) => tool3.type === "provider" &&
|
|
596017
|
+
(tool3) => tool3.type === "provider" && tool3.id === "anthropic.code_execution_20250825"
|
|
596756
596018
|
))) {
|
|
596757
596019
|
warnings.push({
|
|
596758
596020
|
type: "other",
|
|
@@ -596763,13 +596025,16 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596763
596025
|
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
596764
596026
|
betas.add("effort-2025-11-24");
|
|
596765
596027
|
}
|
|
596766
|
-
if (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) {
|
|
596767
|
-
betas.add("task-budgets-2026-03-13");
|
|
596768
|
-
}
|
|
596769
596028
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
|
|
596770
596029
|
betas.add("fast-mode-2026-02-01");
|
|
596771
596030
|
}
|
|
596772
|
-
|
|
596031
|
+
if (stream5 && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _f : true)) {
|
|
596032
|
+
betas.add("fine-grained-tool-streaming-2025-05-14");
|
|
596033
|
+
}
|
|
596034
|
+
const usingNativeOutputFormat = useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
|
|
596035
|
+
if (usingNativeOutputFormat) {
|
|
596036
|
+
betas.add("structured-outputs-2025-11-13");
|
|
596037
|
+
}
|
|
596773
596038
|
const {
|
|
596774
596039
|
tools: anthropicTools2,
|
|
596775
596040
|
toolChoice: anthropicToolChoice,
|
|
@@ -596781,17 +596046,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596781
596046
|
toolChoice: { type: "required" },
|
|
596782
596047
|
disableParallelToolUse: true,
|
|
596783
596048
|
cacheControlValidator,
|
|
596784
|
-
supportsStructuredOutput: false
|
|
596785
|
-
supportsStrictTools,
|
|
596786
|
-
defaultEagerInputStreaming
|
|
596049
|
+
supportsStructuredOutput: false
|
|
596787
596050
|
} : {
|
|
596788
596051
|
tools: tools != null ? tools : [],
|
|
596789
596052
|
toolChoice,
|
|
596790
596053
|
disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,
|
|
596791
596054
|
cacheControlValidator,
|
|
596792
|
-
supportsStructuredOutput
|
|
596793
|
-
supportsStrictTools,
|
|
596794
|
-
defaultEagerInputStreaming
|
|
596055
|
+
supportsStructuredOutput
|
|
596795
596056
|
}
|
|
596796
596057
|
);
|
|
596797
596058
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -596804,12 +596065,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596804
596065
|
// do not send when not streaming
|
|
596805
596066
|
},
|
|
596806
596067
|
warnings: [...warnings, ...toolWarnings, ...cacheWarnings],
|
|
596807
|
-
betas: /* @__PURE__ */ new Set([
|
|
596808
|
-
...betas,
|
|
596809
|
-
...toolsBetas,
|
|
596810
|
-
...userSuppliedBetas,
|
|
596811
|
-
...(_j = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _j : []
|
|
596812
|
-
]),
|
|
596068
|
+
betas: /* @__PURE__ */ new Set([...betas, ...toolsBetas, ...userSuppliedBetas]),
|
|
596813
596069
|
usesJsonResponseTool: jsonResponseTool != null,
|
|
596814
596070
|
toolNameMapping,
|
|
596815
596071
|
providerOptionsName,
|
|
@@ -596842,9 +596098,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596842
596098
|
var _a21, _b17, _c;
|
|
596843
596099
|
return (_c = (_b17 = (_a21 = this.config).buildRequestUrl) == null ? void 0 : _b17.call(_a21, this.config.baseURL, isStreaming)) != null ? _c : `${this.config.baseURL}/messages`;
|
|
596844
596100
|
}
|
|
596845
|
-
transformRequestBody(args
|
|
596101
|
+
transformRequestBody(args) {
|
|
596846
596102
|
var _a21, _b17, _c;
|
|
596847
|
-
return (_c = (_b17 = (_a21 = this.config).transformRequestBody) == null ? void 0 : _b17.call(_a21, args
|
|
596103
|
+
return (_c = (_b17 = (_a21 = this.config).transformRequestBody) == null ? void 0 : _b17.call(_a21, args)) != null ? _c : args;
|
|
596848
596104
|
}
|
|
596849
596105
|
extractCitationDocuments(prompt) {
|
|
596850
596106
|
const isCitationPart = (part) => {
|
|
@@ -596870,7 +596126,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596870
596126
|
});
|
|
596871
596127
|
}
|
|
596872
596128
|
async doGenerate(options8) {
|
|
596873
|
-
var _a21, _b17, _c, _d, _e, _f
|
|
596129
|
+
var _a21, _b17, _c, _d, _e, _f;
|
|
596874
596130
|
const {
|
|
596875
596131
|
args,
|
|
596876
596132
|
warnings,
|
|
@@ -596887,9 +596143,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596887
596143
|
const citationDocuments = [
|
|
596888
596144
|
...this.extractCitationDocuments(options8.prompt)
|
|
596889
596145
|
];
|
|
596890
|
-
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(
|
|
596891
|
-
args.tools
|
|
596892
|
-
);
|
|
596893
596146
|
const {
|
|
596894
596147
|
responseHeaders,
|
|
596895
596148
|
value: response,
|
|
@@ -596897,7 +596150,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596897
596150
|
} = await postJsonToApi2({
|
|
596898
596151
|
url: this.buildRequestUrl(false),
|
|
596899
596152
|
headers: await this.getHeaders({ betas, headers: options8.headers }),
|
|
596900
|
-
body: this.transformRequestBody(args
|
|
596153
|
+
body: this.transformRequestBody(args),
|
|
596901
596154
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
596902
596155
|
successfulResponseHandler: createJsonResponseHandler(
|
|
596903
596156
|
anthropicMessagesResponseSchema
|
|
@@ -597011,10 +596264,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597011
596264
|
toolCallId: part.id,
|
|
597012
596265
|
toolName: toolNameMapping.toCustomToolName(part.name),
|
|
597013
596266
|
input: JSON.stringify(inputToSerialize),
|
|
597014
|
-
providerExecuted: true
|
|
597015
|
-
// We want this 'code_execution' tool call to be allowed even if the tool is not explicitly provided.
|
|
597016
|
-
// Since the validation generally bypasses dynamic tools, we mark this specific tool as dynamic.
|
|
597017
|
-
...markCodeExecutionDynamic && part.name === "code_execution" ? { dynamic: true } : {}
|
|
596267
|
+
providerExecuted: true
|
|
597018
596268
|
});
|
|
597019
596269
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
597020
596270
|
serverToolCalls[part.id] = part.name;
|
|
@@ -597158,19 +596408,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597158
596408
|
content: (_c = part.content.content) != null ? _c : []
|
|
597159
596409
|
}
|
|
597160
596410
|
});
|
|
597161
|
-
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
597162
|
-
content9.push({
|
|
597163
|
-
type: "tool-result",
|
|
597164
|
-
toolCallId: part.tool_use_id,
|
|
597165
|
-
toolName: toolNameMapping.toCustomToolName("code_execution"),
|
|
597166
|
-
result: {
|
|
597167
|
-
type: part.content.type,
|
|
597168
|
-
encrypted_stdout: part.content.encrypted_stdout,
|
|
597169
|
-
stderr: part.content.stderr,
|
|
597170
|
-
return_code: part.content.return_code,
|
|
597171
|
-
content: (_d = part.content.content) != null ? _d : []
|
|
597172
|
-
}
|
|
597173
|
-
});
|
|
597174
596411
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
597175
596412
|
content9.push({
|
|
597176
596413
|
type: "tool-result",
|
|
@@ -597247,13 +596484,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597247
596484
|
finishReason: response.stop_reason,
|
|
597248
596485
|
isJsonResponseFromTool
|
|
597249
596486
|
}),
|
|
597250
|
-
raw: (
|
|
596487
|
+
raw: (_d = response.stop_reason) != null ? _d : void 0
|
|
597251
596488
|
},
|
|
597252
596489
|
usage: convertAnthropicMessagesUsage({ usage: response.usage }),
|
|
597253
596490
|
request: { body: args },
|
|
597254
596491
|
response: {
|
|
597255
|
-
id: (
|
|
597256
|
-
modelId: (
|
|
596492
|
+
id: (_e = response.id) != null ? _e : void 0,
|
|
596493
|
+
modelId: (_f = response.model) != null ? _f : void 0,
|
|
597257
596494
|
headers: responseHeaders,
|
|
597258
596495
|
body: rawResponse
|
|
597259
596496
|
},
|
|
@@ -597310,14 +596547,11 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597310
596547
|
const citationDocuments = [
|
|
597311
596548
|
...this.extractCitationDocuments(options8.prompt)
|
|
597312
596549
|
];
|
|
597313
|
-
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(
|
|
597314
|
-
body.tools
|
|
597315
|
-
);
|
|
597316
596550
|
const url4 = this.buildRequestUrl(true);
|
|
597317
596551
|
const { responseHeaders, value: response } = await postJsonToApi2({
|
|
597318
596552
|
url: url4,
|
|
597319
596553
|
headers: await this.getHeaders({ betas, headers: options8.headers }),
|
|
597320
|
-
body: this.transformRequestBody(body
|
|
596554
|
+
body: this.transformRequestBody(body),
|
|
597321
596555
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
597322
596556
|
successfulResponseHandler: createEventSourceResponseHandler(
|
|
597323
596557
|
anthropicMessagesChunkSchema
|
|
@@ -597353,7 +596587,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597353
596587
|
controller.enqueue({ type: "stream-start", warnings });
|
|
597354
596588
|
},
|
|
597355
596589
|
transform(chunk, controller) {
|
|
597356
|
-
var _a22, _b22, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
596590
|
+
var _a22, _b22, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
597357
596591
|
if (options8.includeRawChunks) {
|
|
597358
596592
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
597359
596593
|
}
|
|
@@ -597462,14 +596696,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597462
596696
|
].includes(part.name)) {
|
|
597463
596697
|
const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
|
|
597464
596698
|
const customToolName = toolNameMapping.toCustomToolName(providerToolName);
|
|
597465
|
-
const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
|
|
597466
596699
|
contentBlocks[value2.index] = {
|
|
597467
596700
|
type: "tool-call",
|
|
597468
596701
|
toolCallId: part.id,
|
|
597469
596702
|
toolName: customToolName,
|
|
597470
|
-
input:
|
|
596703
|
+
input: "",
|
|
597471
596704
|
providerExecuted: true,
|
|
597472
|
-
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
597473
596705
|
firstDelta: true,
|
|
597474
596706
|
providerToolName: part.name
|
|
597475
596707
|
};
|
|
@@ -597477,8 +596709,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597477
596709
|
type: "tool-input-start",
|
|
597478
596710
|
id: part.id,
|
|
597479
596711
|
toolName: customToolName,
|
|
597480
|
-
providerExecuted: true
|
|
597481
|
-
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {}
|
|
596712
|
+
providerExecuted: true
|
|
597482
596713
|
});
|
|
597483
596714
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
597484
596715
|
serverToolCalls[part.id] = part.name;
|
|
@@ -597603,19 +596834,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597603
596834
|
content: (_c = part.content.content) != null ? _c : []
|
|
597604
596835
|
}
|
|
597605
596836
|
});
|
|
597606
|
-
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
597607
|
-
controller.enqueue({
|
|
597608
|
-
type: "tool-result",
|
|
597609
|
-
toolCallId: part.tool_use_id,
|
|
597610
|
-
toolName: toolNameMapping.toCustomToolName("code_execution"),
|
|
597611
|
-
result: {
|
|
597612
|
-
type: part.content.type,
|
|
597613
|
-
encrypted_stdout: part.content.encrypted_stdout,
|
|
597614
|
-
stderr: part.content.stderr,
|
|
597615
|
-
return_code: part.content.return_code,
|
|
597616
|
-
content: (_d = part.content.content) != null ? _d : []
|
|
597617
|
-
}
|
|
597618
|
-
});
|
|
597619
596837
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
597620
596838
|
controller.enqueue({
|
|
597621
596839
|
type: "tool-result",
|
|
@@ -597765,7 +596983,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597765
596983
|
toolName: contentBlock.toolName,
|
|
597766
596984
|
input: finalInput,
|
|
597767
596985
|
providerExecuted: contentBlock.providerExecuted,
|
|
597768
|
-
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
597769
596986
|
...contentBlock.caller && {
|
|
597770
596987
|
providerMetadata: {
|
|
597771
596988
|
anthropic: {
|
|
@@ -597883,12 +597100,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597883
597100
|
}
|
|
597884
597101
|
case "message_start": {
|
|
597885
597102
|
usage.input_tokens = value2.message.usage.input_tokens;
|
|
597886
|
-
usage.cache_read_input_tokens = (
|
|
597887
|
-
usage.cache_creation_input_tokens = (
|
|
597103
|
+
usage.cache_read_input_tokens = (_d = value2.message.usage.cache_read_input_tokens) != null ? _d : 0;
|
|
597104
|
+
usage.cache_creation_input_tokens = (_e = value2.message.usage.cache_creation_input_tokens) != null ? _e : 0;
|
|
597888
597105
|
rawUsage = {
|
|
597889
597106
|
...value2.message.usage
|
|
597890
597107
|
};
|
|
597891
|
-
cacheCreationInputTokens = (
|
|
597108
|
+
cacheCreationInputTokens = (_f = value2.message.usage.cache_creation_input_tokens) != null ? _f : null;
|
|
597892
597109
|
if (value2.message.container != null) {
|
|
597893
597110
|
container = {
|
|
597894
597111
|
expiresAt: value2.message.container.expires_at,
|
|
@@ -597907,8 +597124,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597907
597124
|
}
|
|
597908
597125
|
controller.enqueue({
|
|
597909
597126
|
type: "response-metadata",
|
|
597910
|
-
id: (
|
|
597911
|
-
modelId: (
|
|
597127
|
+
id: (_g = value2.message.id) != null ? _g : void 0,
|
|
597128
|
+
modelId: (_h = value2.message.model) != null ? _h : void 0
|
|
597912
597129
|
});
|
|
597913
597130
|
if (value2.message.content != null) {
|
|
597914
597131
|
for (let contentIndex = 0; contentIndex < value2.message.content.length; contentIndex++) {
|
|
@@ -597924,7 +597141,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597924
597141
|
id: part.id,
|
|
597925
597142
|
toolName: part.name
|
|
597926
597143
|
});
|
|
597927
|
-
const inputStr = JSON.stringify((
|
|
597144
|
+
const inputStr = JSON.stringify((_i = part.input) != null ? _i : {});
|
|
597928
597145
|
controller.enqueue({
|
|
597929
597146
|
type: "tool-input-delta",
|
|
597930
597147
|
id: part.id,
|
|
@@ -597972,17 +597189,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597972
597189
|
finishReason: value2.delta.stop_reason,
|
|
597973
597190
|
isJsonResponseFromTool
|
|
597974
597191
|
}),
|
|
597975
|
-
raw: (
|
|
597192
|
+
raw: (_j = value2.delta.stop_reason) != null ? _j : void 0
|
|
597976
597193
|
};
|
|
597977
|
-
stopSequence = (
|
|
597194
|
+
stopSequence = (_k = value2.delta.stop_sequence) != null ? _k : null;
|
|
597978
597195
|
container = value2.delta.container != null ? {
|
|
597979
597196
|
expiresAt: value2.delta.container.expires_at,
|
|
597980
597197
|
id: value2.delta.container.id,
|
|
597981
|
-
skills: (
|
|
597198
|
+
skills: (_m = (_l = value2.delta.container.skills) == null ? void 0 : _l.map((skill) => ({
|
|
597982
597199
|
type: skill.type,
|
|
597983
597200
|
skillId: skill.skill_id,
|
|
597984
597201
|
version: skill.version
|
|
597985
|
-
}))) != null ?
|
|
597202
|
+
}))) != null ? _m : null
|
|
597986
597203
|
} : null;
|
|
597987
597204
|
if (value2.context_management) {
|
|
597988
597205
|
contextManagement = mapAnthropicResponseContextManagement(
|
|
@@ -598067,82 +597284,56 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
598067
597284
|
}
|
|
598068
597285
|
};
|
|
598069
597286
|
function getModelCapabilities(modelId) {
|
|
598070
|
-
if (modelId.includes("claude-opus-4-
|
|
597287
|
+
if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
598071
597288
|
return {
|
|
598072
597289
|
maxOutputTokens: 128e3,
|
|
598073
597290
|
supportsStructuredOutput: true,
|
|
598074
|
-
rejectsSamplingParameters: true,
|
|
598075
|
-
isKnownModel: true
|
|
598076
|
-
};
|
|
598077
|
-
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
598078
|
-
return {
|
|
598079
|
-
maxOutputTokens: 128e3,
|
|
598080
|
-
supportsStructuredOutput: true,
|
|
598081
|
-
rejectsSamplingParameters: false,
|
|
598082
597291
|
isKnownModel: true
|
|
598083
597292
|
};
|
|
598084
597293
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
598085
597294
|
return {
|
|
598086
597295
|
maxOutputTokens: 64e3,
|
|
598087
597296
|
supportsStructuredOutput: true,
|
|
598088
|
-
rejectsSamplingParameters: false,
|
|
598089
597297
|
isKnownModel: true
|
|
598090
597298
|
};
|
|
598091
597299
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
598092
597300
|
return {
|
|
598093
597301
|
maxOutputTokens: 32e3,
|
|
598094
597302
|
supportsStructuredOutput: true,
|
|
598095
|
-
rejectsSamplingParameters: false,
|
|
598096
597303
|
isKnownModel: true
|
|
598097
597304
|
};
|
|
598098
|
-
} else if (modelId.includes("claude-sonnet-4-")) {
|
|
597305
|
+
} else if (modelId.includes("claude-sonnet-4-") || modelId.includes("claude-3-7-sonnet")) {
|
|
598099
597306
|
return {
|
|
598100
597307
|
maxOutputTokens: 64e3,
|
|
598101
597308
|
supportsStructuredOutput: false,
|
|
598102
|
-
rejectsSamplingParameters: false,
|
|
598103
597309
|
isKnownModel: true
|
|
598104
597310
|
};
|
|
598105
597311
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
598106
597312
|
return {
|
|
598107
597313
|
maxOutputTokens: 32e3,
|
|
598108
597314
|
supportsStructuredOutput: false,
|
|
598109
|
-
|
|
597315
|
+
isKnownModel: true
|
|
597316
|
+
};
|
|
597317
|
+
} else if (modelId.includes("claude-3-5-haiku")) {
|
|
597318
|
+
return {
|
|
597319
|
+
maxOutputTokens: 8192,
|
|
597320
|
+
supportsStructuredOutput: false,
|
|
598110
597321
|
isKnownModel: true
|
|
598111
597322
|
};
|
|
598112
597323
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
598113
597324
|
return {
|
|
598114
597325
|
maxOutputTokens: 4096,
|
|
598115
597326
|
supportsStructuredOutput: false,
|
|
598116
|
-
rejectsSamplingParameters: false,
|
|
598117
597327
|
isKnownModel: true
|
|
598118
597328
|
};
|
|
598119
597329
|
} else {
|
|
598120
597330
|
return {
|
|
598121
597331
|
maxOutputTokens: 4096,
|
|
598122
597332
|
supportsStructuredOutput: false,
|
|
598123
|
-
rejectsSamplingParameters: false,
|
|
598124
597333
|
isKnownModel: false
|
|
598125
597334
|
};
|
|
598126
597335
|
}
|
|
598127
597336
|
}
|
|
598128
|
-
function hasWebTool20260209WithoutCodeExecution(tools) {
|
|
598129
|
-
if (!tools) {
|
|
598130
|
-
return false;
|
|
598131
|
-
}
|
|
598132
|
-
let hasWebTool20260209 = false;
|
|
598133
|
-
let hasCodeExecutionTool = false;
|
|
598134
|
-
for (const tool3 of tools) {
|
|
598135
|
-
if ("type" in tool3 && (tool3.type === "web_fetch_20260209" || tool3.type === "web_search_20260209")) {
|
|
598136
|
-
hasWebTool20260209 = true;
|
|
598137
|
-
continue;
|
|
598138
|
-
}
|
|
598139
|
-
if (tool3.name === "code_execution") {
|
|
598140
|
-
hasCodeExecutionTool = true;
|
|
598141
|
-
break;
|
|
598142
|
-
}
|
|
598143
|
-
}
|
|
598144
|
-
return hasWebTool20260209 && !hasCodeExecutionTool;
|
|
598145
|
-
}
|
|
598146
597337
|
function mapAnthropicResponseContextManagement(contextManagement) {
|
|
598147
597338
|
return contextManagement ? {
|
|
598148
597339
|
appliedEdits: contextManagement.applied_edits.map((edit) => {
|
|
@@ -598411,14 +597602,14 @@ var toolSearchBm25_20251119InputSchema = lazySchema(
|
|
|
598411
597602
|
})
|
|
598412
597603
|
)
|
|
598413
597604
|
);
|
|
598414
|
-
var
|
|
597605
|
+
var factory7 = createProviderToolFactoryWithOutputSchema({
|
|
598415
597606
|
id: "anthropic.tool_search_bm25_20251119",
|
|
598416
597607
|
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
598417
597608
|
outputSchema: toolSearchBm25_20251119OutputSchema,
|
|
598418
597609
|
supportsDeferredResults: true
|
|
598419
597610
|
});
|
|
598420
597611
|
var toolSearchBm25_20251119 = (args = {}) => {
|
|
598421
|
-
return
|
|
597612
|
+
return factory7(args);
|
|
598422
597613
|
};
|
|
598423
597614
|
var anthropicTools = {
|
|
598424
597615
|
/**
|
|
@@ -598455,19 +597646,6 @@ var anthropicTools = {
|
|
|
598455
597646
|
* This is the latest version with enhanced Bash support and file operations.
|
|
598456
597647
|
*/
|
|
598457
597648
|
codeExecution_20250825,
|
|
598458
|
-
/**
|
|
598459
|
-
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
598460
|
-
* run system commands, create and edit files, and process uploaded files directly within
|
|
598461
|
-
* the API conversation.
|
|
598462
|
-
*
|
|
598463
|
-
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
598464
|
-
* including writing code, in a secure, sandboxed environment.
|
|
598465
|
-
*
|
|
598466
|
-
* This is the recommended version. Does not require a beta header.
|
|
598467
|
-
*
|
|
598468
|
-
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
598469
|
-
*/
|
|
598470
|
-
codeExecution_20260120,
|
|
598471
597649
|
/**
|
|
598472
597650
|
* Claude can interact with computer environments through the computer use tool, which
|
|
598473
597651
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -598563,16 +597741,6 @@ var anthropicTools = {
|
|
|
598563
597741
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
598564
597742
|
*/
|
|
598565
597743
|
webFetch_20250910,
|
|
598566
|
-
/**
|
|
598567
|
-
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
598568
|
-
*
|
|
598569
|
-
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
598570
|
-
* @param allowedDomains - Only fetch from these domains
|
|
598571
|
-
* @param blockedDomains - Never fetch from these domains
|
|
598572
|
-
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
598573
|
-
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
598574
|
-
*/
|
|
598575
|
-
webFetch_20260209,
|
|
598576
597744
|
/**
|
|
598577
597745
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
598578
597746
|
*
|
|
@@ -598582,15 +597750,6 @@ var anthropicTools = {
|
|
|
598582
597750
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
598583
597751
|
*/
|
|
598584
597752
|
webSearch_20250305,
|
|
598585
|
-
/**
|
|
598586
|
-
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
598587
|
-
*
|
|
598588
|
-
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
598589
|
-
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
598590
|
-
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
598591
|
-
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
598592
|
-
*/
|
|
598593
|
-
webSearch_20260209,
|
|
598594
597753
|
/**
|
|
598595
597754
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
598596
597755
|
*
|
|
@@ -598693,13 +597852,12 @@ var anthropic = createAnthropic();
|
|
|
598693
597852
|
// ../../../vite-plugin-file-sync/dist/ai-service/llm/impl/anthropic.js
|
|
598694
597853
|
var anthropicImpl = (settings) => {
|
|
598695
597854
|
const anthropic2 = createAnthropic(settings.anthropic);
|
|
598696
|
-
const generateBroadEditModelId = process.env.SUPERBLOCKS_EVAL_ANTHROPIC_MODEL_ID ?? "claude-sonnet-4-6";
|
|
598697
597855
|
return {
|
|
598698
|
-
explain: anthropic2("claude-
|
|
598699
|
-
classifyPrompt: anthropic2("claude-
|
|
597856
|
+
explain: anthropic2("claude-3-5-haiku-20241022"),
|
|
597857
|
+
classifyPrompt: anthropic2("claude-3-5-haiku-20241022"),
|
|
598700
597858
|
summarizeMessages: anthropic2("claude-sonnet-4-6"),
|
|
598701
597859
|
fast: anthropic2("claude-haiku-4-5-20251001"),
|
|
598702
|
-
generateBroadEdit: anthropic2(
|
|
597860
|
+
generateBroadEdit: anthropic2("claude-sonnet-4-5-20250929")
|
|
598703
597861
|
};
|
|
598704
597862
|
};
|
|
598705
597863
|
|
|
@@ -598814,7 +597972,7 @@ var PlaywrightMcpServerManager = class {
|
|
|
598814
597972
|
this.logger.info(`Starting embedded Playwright MCP server: browser=${options8?.browser || "chromium"}, headless=${options8?.headless !== false}`);
|
|
598815
597973
|
}
|
|
598816
597974
|
try {
|
|
598817
|
-
const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-
|
|
597975
|
+
const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-6GY37WOF.js");
|
|
598818
597976
|
this.server = await startEmbeddedPlaywrightMcpServer({
|
|
598819
597977
|
storageStatePath: options8?.storageStatePath,
|
|
598820
597978
|
jwt: options8?.jwt,
|
|
@@ -607118,69 +606276,7 @@ ${error40.stack ?? error40.message}
|
|
|
607118
606276
|
|
|
607119
606277
|
// ../../../vite-plugin-file-sync/dist/ai-service/state-machine/handlers/awaiting-user.js
|
|
607120
606278
|
init_cjs_shims();
|
|
607121
|
-
var import_ai15 = __toESM(require_dist9());
|
|
607122
|
-
|
|
607123
|
-
// ../../../vite-plugin-file-sync/dist/ai-service/state-machine/handlers/next-steps.js
|
|
607124
|
-
init_cjs_shims();
|
|
607125
606279
|
var import_ai14 = __toESM(require_dist9());
|
|
607126
|
-
var MAX_NEXT_STEPS = 3;
|
|
607127
|
-
var ICON_LIST = NEXT_STEPS_ICON_NAMES.join(", ");
|
|
607128
|
-
var SUMMARY_CHAR_CAP = 4e3;
|
|
607129
|
-
var truncate = (s) => s.length <= SUMMARY_CHAR_CAP ? s : `${s.slice(0, SUMMARY_CHAR_CAP)}\u2026[truncated]`;
|
|
607130
|
-
var NextStepSchema = external_exports.object({
|
|
607131
|
-
label: external_exports.string().describe("Short action title, max 6 words, starts with a verb (e.g. 'Add search and filtering')"),
|
|
607132
|
-
prompt: external_exports.string().describe("Detailed 1-2 sentence prompt that Clark would receive to build this enhancement"),
|
|
607133
|
-
icon: external_exports.enum([...NEXT_STEPS_ICON_NAMES]).optional().describe(`Lucide icon name in kebab-case from: ${ICON_LIST}`)
|
|
607134
|
-
});
|
|
607135
|
-
var NextStepsSchema = external_exports.object({
|
|
607136
|
-
nextSteps: external_exports.array(NextStepSchema).min(1).max(MAX_NEXT_STEPS).describe("3 follow-up next steps for what the user should build next")
|
|
607137
|
-
});
|
|
607138
|
-
async function getNextSteps({ model, chatSessionStore, logger: logger15, abortSignal }) {
|
|
607139
|
-
const summary = await chatSessionStore.getLatestSummary();
|
|
607140
|
-
if (!summary) {
|
|
607141
|
-
logger15?.info("[next-steps] No build summary found; skipping generation");
|
|
607142
|
-
return [];
|
|
607143
|
-
}
|
|
607144
|
-
const systemPrompt = `You are helping suggest what a user should build next with Clark (an AI app builder) after they just finished building something.
|
|
607145
|
-
|
|
607146
|
-
Suggest exactly 3 follow-up things the user could ask Clark to do next. These should be specific, actionable enhancements to the app that was just built.
|
|
607147
|
-
|
|
607148
|
-
Focus on:
|
|
607149
|
-
- New features that complement what was built (e.g. "Add search and filtering", "Add an export to CSV button")
|
|
607150
|
-
- Performance and UX improvements (e.g. "Add loading states and pagination", "Add dark mode support")
|
|
607151
|
-
- Data and workflow enhancements (e.g. "Add edit and delete functionality", "Add role-based access control")
|
|
607152
|
-
|
|
607153
|
-
Do NOT suggest generic improvements \u2014 be specific to the app that was built.
|
|
607154
|
-
Every suggestion must be different from each other. Vary the categories.
|
|
607155
|
-
|
|
607156
|
-
For each suggestion, pick ONE icon from this list: ${ICON_LIST}`;
|
|
607157
|
-
const prompt = `WHAT CLARK JUST BUILT:
|
|
607158
|
-
${truncate(summary.summary)}`;
|
|
607159
|
-
logger15?.info("[next-steps] Starting next-steps LLM generation");
|
|
607160
|
-
let nextSteps = [];
|
|
607161
|
-
try {
|
|
607162
|
-
const { object: result } = await llmobs_default.trace({ name: "nextSteps.generate", kind: "llm" }, async () => {
|
|
607163
|
-
return await (0, import_ai14.generateObject)({
|
|
607164
|
-
model,
|
|
607165
|
-
schema: NextStepsSchema,
|
|
607166
|
-
system: systemPrompt,
|
|
607167
|
-
prompt,
|
|
607168
|
-
abortSignal
|
|
607169
|
-
});
|
|
607170
|
-
});
|
|
607171
|
-
nextSteps = result.nextSteps;
|
|
607172
|
-
logger15?.info("[next-steps] Next-steps LLM generation succeeded", {
|
|
607173
|
-
count: nextSteps.length
|
|
607174
|
-
});
|
|
607175
|
-
} catch (error40) {
|
|
607176
|
-
logger15?.warn("[next-steps] Next-steps LLM generation failed; returning empty", {
|
|
607177
|
-
error: error40 instanceof Error ? error40.message : String(error40)
|
|
607178
|
-
});
|
|
607179
|
-
}
|
|
607180
|
-
return nextSteps.slice(0, MAX_NEXT_STEPS);
|
|
607181
|
-
}
|
|
607182
|
-
|
|
607183
|
-
// ../../../vite-plugin-file-sync/dist/ai-service/state-machine/handlers/awaiting-user.js
|
|
607184
606280
|
function createWorkflowSummary(promptId, workflowMetrics) {
|
|
607185
606281
|
const completedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
607186
606282
|
const startedAt = workflowMetrics.workflowStartedAt;
|
|
@@ -607223,53 +606319,6 @@ async function checkPromptCost(promptId, workflowMetrics, chatSessionStore, prom
|
|
|
607223
606319
|
var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProfiler, features }) => {
|
|
607224
606320
|
const sendUsergenerationState = sendUserGenerationStateChannel(clark);
|
|
607225
606321
|
const sendUserMessage = sendUserMessageChannel(clark, chatSessionStore);
|
|
607226
|
-
const emitNextSteps = async () => {
|
|
607227
|
-
const abortSignal = clark.context.abortController?.signal;
|
|
607228
|
-
const startedAt = performance.now();
|
|
607229
|
-
let stepCount = 0;
|
|
607230
|
-
let caughtError;
|
|
607231
|
-
try {
|
|
607232
|
-
if (abortSignal?.aborted)
|
|
607233
|
-
return;
|
|
607234
|
-
clark.logger.info("[awaiting-user] emitNextSteps starting");
|
|
607235
|
-
const model = llmProvider.modelForTask("summarizeMessages");
|
|
607236
|
-
const nextSteps = await getNextSteps({
|
|
607237
|
-
model,
|
|
607238
|
-
chatSessionStore,
|
|
607239
|
-
logger: clark.logger,
|
|
607240
|
-
abortSignal
|
|
607241
|
-
});
|
|
607242
|
-
stepCount = nextSteps.length;
|
|
607243
|
-
if (abortSignal?.aborted)
|
|
607244
|
-
return;
|
|
607245
|
-
if (nextSteps.length > 0) {
|
|
607246
|
-
await sendUserMessage({
|
|
607247
|
-
type: "next_steps",
|
|
607248
|
-
text: "",
|
|
607249
|
-
nextSteps
|
|
607250
|
-
}, 0, false, { persistBeforeDeliver: true });
|
|
607251
|
-
}
|
|
607252
|
-
} catch (err) {
|
|
607253
|
-
caughtError = err;
|
|
607254
|
-
} finally {
|
|
607255
|
-
const durationMs = Math.round((performance.now() - startedAt) * 100) / 100;
|
|
607256
|
-
const aborted2 = abortSignal?.aborted === true;
|
|
607257
|
-
if (caughtError) {
|
|
607258
|
-
clark.logger.warn("[awaiting-user] Next steps generation failed; skipping", {
|
|
607259
|
-
durationMs,
|
|
607260
|
-
stepCount,
|
|
607261
|
-
aborted: aborted2,
|
|
607262
|
-
error: caughtError instanceof Error ? { name: caughtError.name, message: caughtError.message } : String(caughtError)
|
|
607263
|
-
});
|
|
607264
|
-
} else {
|
|
607265
|
-
clark.logger.info("[awaiting-user] emitNextSteps completed", {
|
|
607266
|
-
durationMs,
|
|
607267
|
-
stepCount,
|
|
607268
|
-
aborted: aborted2
|
|
607269
|
-
});
|
|
607270
|
-
}
|
|
607271
|
-
}
|
|
607272
|
-
};
|
|
607273
606322
|
return async ({ event }) => {
|
|
607274
606323
|
switch (event.type) {
|
|
607275
606324
|
case AGENT_NEEDS_USER_INPUT: {
|
|
@@ -607323,16 +606372,13 @@ var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProf
|
|
|
607323
606372
|
willTriggerUpload: hasSuggestions,
|
|
607324
606373
|
currentMode: clark.context.currentMode
|
|
607325
606374
|
});
|
|
606375
|
+
signals.emit("generationCompleted", hasSuggestions);
|
|
607326
606376
|
await clarkProfiler?.endSession();
|
|
607327
606377
|
const { promptId, workflowMetrics } = clark.context;
|
|
607328
606378
|
if (promptId && workflowMetrics) {
|
|
607329
606379
|
await checkPromptCost(promptId, workflowMetrics, chatSessionStore, features.promptUsageAlarmThreshold, clark.logger);
|
|
607330
606380
|
await chatSessionStore.submitWorkflowSummary(createWorkflowSummary(promptId, workflowMetrics));
|
|
607331
606381
|
}
|
|
607332
|
-
if (features.suggestWhatsNext) {
|
|
607333
|
-
await emitNextSteps();
|
|
607334
|
-
}
|
|
607335
|
-
signals.emit("generationCompleted", hasSuggestions);
|
|
607336
606382
|
void sendUsergenerationState({
|
|
607337
606383
|
state: AiGenerationState.COMPLETED,
|
|
607338
606384
|
hasSuggestions: true
|
|
@@ -607345,6 +606391,7 @@ var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProf
|
|
|
607345
606391
|
hasSuggestions,
|
|
607346
606392
|
willTriggerUpload: hasSuggestions
|
|
607347
606393
|
});
|
|
606394
|
+
signals.emit("generationCompleted", hasSuggestions);
|
|
607348
606395
|
await clarkProfiler?.endSession();
|
|
607349
606396
|
const { promptId, workflowMetrics } = clark.context;
|
|
607350
606397
|
if (promptId && workflowMetrics) {
|
|
@@ -607383,10 +606430,6 @@ var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProf
|
|
|
607383
606430
|
}
|
|
607384
606431
|
}
|
|
607385
606432
|
}
|
|
607386
|
-
if (features.suggestWhatsNext) {
|
|
607387
|
-
await emitNextSteps();
|
|
607388
|
-
}
|
|
607389
|
-
signals.emit("generationCompleted", hasSuggestions);
|
|
607390
606433
|
void sendUsergenerationState({
|
|
607391
606434
|
state: AiGenerationState.COMPLETED,
|
|
607392
606435
|
hasSuggestions
|
|
@@ -607431,7 +606474,7 @@ Please create a BRIEF summary that:
|
|
|
607431
606474
|
Create a summary of what was accomplished:`;
|
|
607432
606475
|
const model = llmProvider.modelForTask("summarizeMessages");
|
|
607433
606476
|
const summary = await traceLLM("getFinalSummary", model.modelId, model.provider, async () => {
|
|
607434
|
-
return (0,
|
|
606477
|
+
return (0, import_ai14.generateText)({
|
|
607435
606478
|
model,
|
|
607436
606479
|
prompt,
|
|
607437
606480
|
abortSignal
|
|
@@ -607715,35 +606758,25 @@ Here are some examples (not exhaustive) that you should consider when building a
|
|
|
607715
606758
|
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a visual loading indicator while new data loads. Use \`fetching\` from useApiData.
|
|
607716
606759
|
2. **Loading State Hierarchy**:
|
|
607717
606760
|
- No data yet (\`loading\`) \u2192 Full skeleton placeholder
|
|
607718
|
-
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a
|
|
606761
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a loading overlay (e.g. reduced opacity, inline spinner)
|
|
607719
606762
|
- Error state (\`isError\`) \u2192 Show error with retry option, optionally keep stale data visible
|
|
607720
606763
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
607721
606764
|
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, and \`refetchOnReconnect\` options.
|
|
607722
606765
|
|
|
607723
606766
|
\`\`\`tsx
|
|
607724
|
-
// \u2705 CORRECT \u2014
|
|
606767
|
+
// \u2705 CORRECT \u2014 loading indicator when filters change
|
|
607725
606768
|
const { data, loading, fetching, isError, error } = useApiData("GetOrders", { status: statusFilter, search });
|
|
607726
606769
|
|
|
607727
606770
|
if (loading) return <Skeleton />; // First load: full skeleton
|
|
607728
606771
|
if (isError) return <ErrorBanner error={error} />;
|
|
607729
606772
|
return (
|
|
607730
|
-
<div>
|
|
607731
|
-
{
|
|
607732
|
-
<div className={fetching ? "opacity-70" : ""}>
|
|
607733
|
-
<OrderTable orders={data.orders} /> {/* Dimmed but still interactive */}
|
|
607734
|
-
</div>
|
|
606773
|
+
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
606774
|
+
<OrderTable orders={data.orders} /> {/* Keep showing data during refetch */}
|
|
607735
606775
|
</div>
|
|
607736
606776
|
);
|
|
607737
606777
|
\`\`\`
|
|
607738
606778
|
|
|
607739
606779
|
\`\`\`tsx
|
|
607740
|
-
// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken
|
|
607741
|
-
return (
|
|
607742
|
-
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
607743
|
-
<OrderTable orders={data.orders} />
|
|
607744
|
-
</div>
|
|
607745
|
-
);
|
|
607746
|
-
|
|
607747
606780
|
// \u274C WRONG \u2014 no loading indicator when filters change. User sees stale data with no feedback.
|
|
607748
606781
|
const { data, loading } = useApiData("GetOrders", { status: statusFilter, search });
|
|
607749
606782
|
|
|
@@ -608212,35 +607245,25 @@ Here are some examples (not exhaustive) that you should consider when building a
|
|
|
608212
607245
|
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a visual loading indicator while new data loads. Use \`fetching\` from useApiData.
|
|
608213
607246
|
2. **Loading State Hierarchy**:
|
|
608214
607247
|
- No data yet (\`loading\`) \u2192 Full skeleton placeholder
|
|
608215
|
-
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a
|
|
607248
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a loading overlay (e.g. reduced opacity, inline spinner)
|
|
608216
607249
|
- Error state (\`isError\`) \u2192 Show error with retry option, optionally keep stale data visible
|
|
608217
607250
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
608218
607251
|
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, and \`refetchOnReconnect\` options.
|
|
608219
607252
|
|
|
608220
607253
|
\`\`\`tsx
|
|
608221
|
-
// \u2705 CORRECT \u2014
|
|
607254
|
+
// \u2705 CORRECT \u2014 loading indicator when filters change
|
|
608222
607255
|
const { data, loading, fetching, isError, error } = useApiData("GetOrders", { status: statusFilter, search });
|
|
608223
607256
|
|
|
608224
607257
|
if (loading) return <Skeleton />; // First load: full skeleton
|
|
608225
607258
|
if (isError) return <ErrorBanner error={error} />;
|
|
608226
607259
|
return (
|
|
608227
|
-
<div>
|
|
608228
|
-
{
|
|
608229
|
-
<div className={fetching ? "opacity-70" : ""}>
|
|
608230
|
-
<OrderTable orders={data.orders} /> {/* Dimmed but still interactive */}
|
|
608231
|
-
</div>
|
|
607260
|
+
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
607261
|
+
<OrderTable orders={data.orders} /> {/* Keep showing data during refetch */}
|
|
608232
607262
|
</div>
|
|
608233
607263
|
);
|
|
608234
607264
|
\`\`\`
|
|
608235
607265
|
|
|
608236
607266
|
\`\`\`tsx
|
|
608237
|
-
// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken
|
|
608238
|
-
return (
|
|
608239
|
-
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
608240
|
-
<OrderTable orders={data.orders} />
|
|
608241
|
-
</div>
|
|
608242
|
-
);
|
|
608243
|
-
|
|
608244
607267
|
// \u274C WRONG \u2014 no loading indicator when filters change. User sees stale data with no feedback.
|
|
608245
607268
|
const { data, loading } = useApiData("GetOrders", { status: statusFilter, search });
|
|
608246
607269
|
|
|
@@ -611312,7 +610335,7 @@ ${diagnostics.join("\n")}`);
|
|
|
611312
610335
|
|
|
611313
610336
|
// ../../../vite-plugin-file-sync/dist/ai-service/agent/tools2/tools/web-fetch.js
|
|
611314
610337
|
init_cjs_shims();
|
|
611315
|
-
var
|
|
610338
|
+
var import_ai15 = __toESM(require_dist9());
|
|
611316
610339
|
var import_turndown = __toESM(require_turndown_cjs());
|
|
611317
610340
|
var WebFetchResponseSchema = external_exports.object({
|
|
611318
610341
|
content: external_exports.string().describe("The extracted information as plain markdown text (NOT JSON). Use markdown formatting for headers, lists, bold, etc.")
|
|
@@ -611463,7 +610486,7 @@ Examples:
|
|
|
611463
610486
|
}
|
|
611464
610487
|
const truncatedContent = truncateContent(markdown, MAX_CONTENT_LENGTH);
|
|
611465
610488
|
const model = llmProvider.modelForTask("fast");
|
|
611466
|
-
const { object: result } = await (0,
|
|
610489
|
+
const { object: result } = await (0, import_ai15.generateObject)({
|
|
611467
610490
|
model,
|
|
611468
610491
|
schema: WebFetchResponseSchema,
|
|
611469
610492
|
system: WEB_FETCH_SYSTEM_PROMPT,
|
|
@@ -632786,7 +631809,7 @@ var buildTools = async (clark, services) => {
|
|
|
632786
631809
|
init_cjs_shims();
|
|
632787
631810
|
function hasToolSuccess(toolName, maxAttempts = 5) {
|
|
632788
631811
|
return ({ steps }) => {
|
|
632789
|
-
const hasSuccess = steps[steps.length - 1]?.toolResults?.some((toolResult) => toolResult.toolName === toolName
|
|
631812
|
+
const hasSuccess = steps[steps.length - 1]?.toolResults?.some((toolResult) => toolResult.toolName === toolName) ?? false;
|
|
632790
631813
|
if (hasSuccess) {
|
|
632791
631814
|
return true;
|
|
632792
631815
|
}
|
|
@@ -633382,14 +632405,13 @@ var doLLMGenerating = (clark, services) => {
|
|
|
633382
632405
|
if (chunk.type === "tool-result") {
|
|
633383
632406
|
const isOpenIntegrationTool = chunk.toolName === "openExistingIntegration" || chunk.toolName === "openIntegrationSetup";
|
|
633384
632407
|
const isUpdateIntegrationTool = chunk.toolName === "updateIntegrationFields";
|
|
633385
|
-
if (chunk.toolName === "askMultiChoice" || chunk.toolName === "askSearchableDropdown") {
|
|
632408
|
+
if (chunk.toolName === "askMultiChoice" || chunk.toolName === "askSearchableDropdown" || isOpenIntegrationTool || isUpdateIntegrationTool) {
|
|
633386
632409
|
shouldTransitionToAwaitingUser = true;
|
|
633387
632410
|
}
|
|
633388
632411
|
if (isOpenIntegrationTool || isUpdateIntegrationTool) {
|
|
633389
632412
|
const output = getToolResultOutputObject(chunk.output);
|
|
633390
632413
|
const success2 = output?.success === true;
|
|
633391
632414
|
if (success2) {
|
|
633392
|
-
shouldTransitionToAwaitingUser = true;
|
|
633393
632415
|
const sendInteractiveMessage = sendInteractiveMessageChannel(clark, services.chatSessionStore);
|
|
633394
632416
|
const payload = {
|
|
633395
632417
|
type: "multi_choice",
|
|
@@ -636118,10 +635140,6 @@ var FLAG_DEFINITIONS = {
|
|
|
636118
635140
|
key: "ai.clark-delete-package-lock.enabled",
|
|
636119
635141
|
schema: zod_default.boolean()
|
|
636120
635142
|
},
|
|
636121
|
-
suggestWhatsNext: {
|
|
636122
|
-
key: "ai.suggest-whats-next",
|
|
636123
|
-
schema: zod_default.boolean()
|
|
636124
|
-
},
|
|
636125
635143
|
integrationSetupEnabled: {
|
|
636126
635144
|
key: "clark.integration-setup.enabled",
|
|
636127
635145
|
schema: zod_default.boolean()
|
|
@@ -636773,7 +635791,7 @@ var AiService = class extends import_shared40.TracedEventEmitter {
|
|
|
636773
635791
|
try {
|
|
636774
635792
|
const streamResult = await this.llmClient.streamText({
|
|
636775
635793
|
model,
|
|
636776
|
-
stopWhen: (0,
|
|
635794
|
+
stopWhen: (0, import_ai16.hasToolCall)(explainCodeFinalize.name),
|
|
636777
635795
|
tools: {
|
|
636778
635796
|
build_readFile,
|
|
636779
635797
|
explainCodeFinalize
|
|
@@ -637091,7 +636109,7 @@ ${apiSourceCode.slice(0, 2e3)}
|
|
|
637091
636109
|
const timeoutId = setTimeout(() => timeoutController.abort(), timeout);
|
|
637092
636110
|
try {
|
|
637093
636111
|
const contentPart = this.attachmentToContentPart(attachment);
|
|
637094
|
-
const { object: result } = await (0,
|
|
636112
|
+
const { object: result } = await (0, import_ai16.generateObject)({
|
|
637095
636113
|
model,
|
|
637096
636114
|
schema: LabelAttachmentSchema,
|
|
637097
636115
|
messages: [
|
|
@@ -640500,26 +639518,6 @@ function createSocketRecordingMiddleware(recorder) {
|
|
|
640500
639518
|
};
|
|
640501
639519
|
}
|
|
640502
639520
|
|
|
640503
|
-
// ../../../vite-plugin-file-sync/dist/git-log.js
|
|
640504
|
-
init_cjs_shims();
|
|
640505
|
-
var SEP = "<<SEP>>";
|
|
640506
|
-
var GIT_LOG_FORMAT = ["%H", "%P", "%s", "%an", "%aI"].join(SEP);
|
|
640507
|
-
function parseGitLog(raw2) {
|
|
640508
|
-
if (!raw2.trim())
|
|
640509
|
-
return [];
|
|
640510
|
-
return raw2.trimEnd().split("\n").map((line3) => {
|
|
640511
|
-
const parts = line3.split(SEP);
|
|
640512
|
-
const parents2 = (parts[1] ?? "").split(" ").filter((sha) => sha.length > 0);
|
|
640513
|
-
return {
|
|
640514
|
-
sha: parts[0] ?? "",
|
|
640515
|
-
parents: parents2,
|
|
640516
|
-
message: parts[2] ?? "",
|
|
640517
|
-
author: parts[3] ?? "",
|
|
640518
|
-
date: parts[4] ?? ""
|
|
640519
|
-
};
|
|
640520
|
-
});
|
|
640521
|
-
}
|
|
640522
|
-
|
|
640523
639521
|
// ../../../vite-plugin-file-sync/dist/git-service/azure-devops-workflow.js
|
|
640524
639522
|
init_cjs_shims();
|
|
640525
639523
|
var import_shared53 = __toESM(require_dist2());
|
|
@@ -641522,14 +640520,26 @@ var SocketManager = class extends import_shared58.TracedEventEmitter {
|
|
|
641522
640520
|
});
|
|
641523
640521
|
}
|
|
641524
640522
|
}
|
|
640523
|
+
const SEP = "<<SEP>>";
|
|
640524
|
+
const format4 = ["%H", "%s", "%an", "%aI"].join(SEP);
|
|
641525
640525
|
const raw2 = await readyGitService.raw([
|
|
641526
640526
|
"log",
|
|
641527
640527
|
logRef,
|
|
641528
|
-
`--format=${
|
|
640528
|
+
`--format=${format4}`,
|
|
641529
640529
|
`-n`,
|
|
641530
640530
|
String(limit)
|
|
641531
640531
|
]);
|
|
641532
|
-
|
|
640532
|
+
if (!raw2.trim())
|
|
640533
|
+
return [];
|
|
640534
|
+
return raw2.trimEnd().split("\n").map((line3) => {
|
|
640535
|
+
const parts = line3.split(SEP);
|
|
640536
|
+
return {
|
|
640537
|
+
sha: parts[0] ?? "",
|
|
640538
|
+
message: parts[1] ?? "",
|
|
640539
|
+
author: parts[2] ?? "",
|
|
640540
|
+
date: parts[3] ?? ""
|
|
640541
|
+
};
|
|
640542
|
+
});
|
|
641533
640543
|
}
|
|
641534
640544
|
],
|
|
641535
640545
|
gitPrepareMainCommit: [
|
|
@@ -659744,7 +658754,7 @@ var require_ignore3 = __commonJS3({
|
|
|
659744
658754
|
return this._test(path152, this._testCache, true);
|
|
659745
658755
|
}
|
|
659746
658756
|
};
|
|
659747
|
-
var
|
|
658757
|
+
var factory9 = (options8) => new Ignore2(options8);
|
|
659748
658758
|
var isPathValid = (path152) => checkPath(path152 && checkPath.convert(path152), path152, RETURN_FALSE);
|
|
659749
658759
|
var setupWindows = () => {
|
|
659750
658760
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
@@ -659758,8 +658768,8 @@ var require_ignore3 = __commonJS3({
|
|
|
659758
658768
|
) {
|
|
659759
658769
|
setupWindows();
|
|
659760
658770
|
}
|
|
659761
|
-
module2.exports =
|
|
659762
|
-
|
|
658771
|
+
module2.exports = factory9;
|
|
658772
|
+
factory9.default = factory9;
|
|
659763
658773
|
module2.exports.isPathValid = isPathValid;
|
|
659764
658774
|
define2(module2.exports, Symbol.for("setupWindows"), setupWindows);
|
|
659765
658775
|
}
|
|
@@ -663153,7 +662163,7 @@ var parseYaml3;
|
|
|
663153
662163
|
async function loadYaml(file2) {
|
|
663154
662164
|
const content9 = await read_file_default(file2);
|
|
663155
662165
|
if (!parseYaml3) {
|
|
663156
|
-
({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-
|
|
662166
|
+
({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-P2AMYUL3.js"));
|
|
663157
662167
|
}
|
|
663158
662168
|
try {
|
|
663159
662169
|
return parseYaml3(content9);
|
|
@@ -668547,7 +667557,7 @@ function createParsersAndPrinters(modules) {
|
|
|
668547
667557
|
}
|
|
668548
667558
|
var estreePlugin = createParsersAndPrinters([
|
|
668549
667559
|
{
|
|
668550
|
-
importPlugin: () => import("./estree-
|
|
667560
|
+
importPlugin: () => import("./estree-M5XOW65K.js"),
|
|
668551
667561
|
printers: ["estree", "estree-json"]
|
|
668552
667562
|
}
|
|
668553
667563
|
]);
|
|
@@ -668571,11 +667581,11 @@ var languages = [
|
|
|
668571
667581
|
];
|
|
668572
667582
|
var { parsers: parsers12, printers } = createParsersAndPrinters([
|
|
668573
667583
|
{
|
|
668574
|
-
importPlugin: () => import("./acorn-
|
|
667584
|
+
importPlugin: () => import("./acorn-QRHEJZ4Y.js"),
|
|
668575
667585
|
parsers: ["acorn", "espree"]
|
|
668576
667586
|
},
|
|
668577
667587
|
{
|
|
668578
|
-
importPlugin: () => import("./angular-
|
|
667588
|
+
importPlugin: () => import("./angular-E7FCGLEO.js"),
|
|
668579
667589
|
parsers: [
|
|
668580
667590
|
"__ng_action",
|
|
668581
667591
|
"__ng_binding",
|
|
@@ -668584,7 +667594,7 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
|
|
|
668584
667594
|
]
|
|
668585
667595
|
},
|
|
668586
667596
|
{
|
|
668587
|
-
importPlugin: () => import("./babel-
|
|
667597
|
+
importPlugin: () => import("./babel-XU2VNNSQ.js"),
|
|
668588
667598
|
parsers: [
|
|
668589
667599
|
"babel",
|
|
668590
667600
|
"babel-flow",
|
|
@@ -668603,44 +667613,44 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
|
|
|
668603
667613
|
]
|
|
668604
667614
|
},
|
|
668605
667615
|
{
|
|
668606
|
-
importPlugin: () => import("./flow-
|
|
667616
|
+
importPlugin: () => import("./flow-L3D4WX3Z.js"),
|
|
668607
667617
|
parsers: ["flow"]
|
|
668608
667618
|
},
|
|
668609
667619
|
{
|
|
668610
|
-
importPlugin: () => import("./glimmer-
|
|
667620
|
+
importPlugin: () => import("./glimmer-LUDC5QNV.js"),
|
|
668611
667621
|
parsers: ["glimmer"],
|
|
668612
667622
|
printers: ["glimmer"]
|
|
668613
667623
|
},
|
|
668614
667624
|
{
|
|
668615
|
-
importPlugin: () => import("./graphql-
|
|
667625
|
+
importPlugin: () => import("./graphql-VIZ3REIC.js"),
|
|
668616
667626
|
parsers: ["graphql"],
|
|
668617
667627
|
printers: ["graphql"]
|
|
668618
667628
|
},
|
|
668619
667629
|
{
|
|
668620
|
-
importPlugin: () => import("./html-
|
|
667630
|
+
importPlugin: () => import("./html-I6EAKISS.js"),
|
|
668621
667631
|
parsers: ["html", "angular", "vue", "lwc", "mjml"],
|
|
668622
667632
|
printers: ["html"]
|
|
668623
667633
|
},
|
|
668624
667634
|
{
|
|
668625
|
-
importPlugin: () => import("./markdown-
|
|
667635
|
+
importPlugin: () => import("./markdown-STBGDZM6.js"),
|
|
668626
667636
|
parsers: ["markdown", "mdx", "remark"],
|
|
668627
667637
|
printers: ["mdast"]
|
|
668628
667638
|
},
|
|
668629
667639
|
{
|
|
668630
|
-
importPlugin: () => import("./meriyah-
|
|
667640
|
+
importPlugin: () => import("./meriyah-65T7PG5O.js"),
|
|
668631
667641
|
parsers: ["meriyah"]
|
|
668632
667642
|
},
|
|
668633
667643
|
{
|
|
668634
|
-
importPlugin: () => import("./postcss-
|
|
667644
|
+
importPlugin: () => import("./postcss-ASIVSSN2.js"),
|
|
668635
667645
|
parsers: ["css", "less", "scss"],
|
|
668636
667646
|
printers: ["postcss"]
|
|
668637
667647
|
},
|
|
668638
667648
|
{
|
|
668639
|
-
importPlugin: () => import("./typescript-
|
|
667649
|
+
importPlugin: () => import("./typescript-ZZIEC5OF.js"),
|
|
668640
667650
|
parsers: ["typescript"]
|
|
668641
667651
|
},
|
|
668642
667652
|
{
|
|
668643
|
-
importPlugin: () => import("./yaml-
|
|
667653
|
+
importPlugin: () => import("./yaml-P2AMYUL3.js"),
|
|
668644
667654
|
parsers: ["yaml"],
|
|
668645
667655
|
printers: ["yaml"]
|
|
668646
667656
|
}
|
|
@@ -676045,7 +675055,7 @@ var test = (fn, ...args) => {
|
|
|
676045
675055
|
return false;
|
|
676046
675056
|
}
|
|
676047
675057
|
};
|
|
676048
|
-
var
|
|
675058
|
+
var factory8 = (env2) => {
|
|
676049
675059
|
env2 = utils_default.merge.call({
|
|
676050
675060
|
skipUndefined: true
|
|
676051
675061
|
}, globalFetchAPI, env2);
|
|
@@ -676229,7 +675239,7 @@ var getFetch = (config4) => {
|
|
|
676229
675239
|
while (i--) {
|
|
676230
675240
|
seed = seeds[i];
|
|
676231
675241
|
target = map3.get(seed);
|
|
676232
|
-
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() :
|
|
675242
|
+
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() : factory8(env2));
|
|
676233
675243
|
map3 = target;
|
|
676234
675244
|
}
|
|
676235
675245
|
return target;
|
|
@@ -680470,7 +679480,7 @@ async function upgradeCliWithPackageManager(pm, targetVersion, alias) {
|
|
|
680470
679480
|
clearCliVersionCache({ version: targetVersion, alias });
|
|
680471
679481
|
logger14.info(`Successfully upgraded packages to ${targetVersion}`);
|
|
680472
679482
|
}
|
|
680473
|
-
async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgrade = false
|
|
679483
|
+
async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgrade = false) {
|
|
680474
679484
|
let cliUpdated = false;
|
|
680475
679485
|
let hasFailedToUpgrade = false;
|
|
680476
679486
|
const upgradePromises = [];
|
|
@@ -680532,7 +679542,7 @@ async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgra
|
|
|
680532
679542
|
return;
|
|
680533
679543
|
}
|
|
680534
679544
|
try {
|
|
680535
|
-
if (
|
|
679545
|
+
if ((cliNeedsUpgrade || forceUpgrade) && currentCliInfo) {
|
|
680536
679546
|
const cliUpgradePromise = (0, import_shared70.traceFunction)({
|
|
680537
679547
|
name: "upgradeCli",
|
|
680538
679548
|
tracer: tracer2,
|
|
@@ -680592,8 +679602,6 @@ async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgra
|
|
|
680592
679602
|
init_cjs_shims();
|
|
680593
679603
|
var import_cors = __toESM(require_lib51(), 1);
|
|
680594
679604
|
var import_express = __toESM(require_express2(), 1);
|
|
680595
|
-
import * as child_process3 from "node:child_process";
|
|
680596
|
-
import { existsSync as existsSync4 } from "node:fs";
|
|
680597
679605
|
import net from "node:net";
|
|
680598
679606
|
import os6 from "node:os";
|
|
680599
679607
|
import path73 from "node:path";
|
|
@@ -680662,7 +679670,7 @@ function getJwksUriWithBaseUrl(superblocksBaseUrl) {
|
|
|
680662
679670
|
return jwksUri;
|
|
680663
679671
|
}
|
|
680664
679672
|
var httpServer;
|
|
680665
|
-
async function createDevServer({ root: root3, mode, fsOperationQueue, syncService, lockService, aiService, gitService, activateGitService, snapshotManager, logger: loggerOverride, port, sdk, superblocksBaseUrl: explicitBaseUrl
|
|
679673
|
+
async function createDevServer({ root: root3, mode, fsOperationQueue, syncService, lockService, aiService, gitService, activateGitService, snapshotManager, logger: loggerOverride, port, sdk, superblocksBaseUrl: explicitBaseUrl }) {
|
|
680666
679674
|
const logger15 = getLogger2(loggerOverride);
|
|
680667
679675
|
if (httpServer) {
|
|
680668
679676
|
logger15.debug("Dev server already running");
|
|
@@ -680689,8 +679697,6 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
680689
679697
|
viteResolve = resolve9;
|
|
680690
679698
|
viteReject = reject;
|
|
680691
679699
|
});
|
|
680692
|
-
vitePromise.catch(() => {
|
|
680693
|
-
});
|
|
680694
679700
|
async function gracefulShutdown({ logger: logger16, serverInitiated, switchingTo, initiatedByEmail }) {
|
|
680695
679701
|
try {
|
|
680696
679702
|
await lockService?.shutdown({
|
|
@@ -680837,14 +679843,43 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
680837
679843
|
return;
|
|
680838
679844
|
}
|
|
680839
679845
|
}
|
|
680840
|
-
logger15.info("
|
|
680841
|
-
|
|
680842
|
-
|
|
679846
|
+
logger15.info("Initializing dev server...");
|
|
679847
|
+
if (isViteServerInitialized) {
|
|
679848
|
+
logger15.info("Dev server already initialized");
|
|
680843
679849
|
res.send(JSON.stringify(healthResponse));
|
|
680844
|
-
|
|
680845
|
-
logger15.error("Vite server failed to initialize", getErrorMeta(e));
|
|
680846
|
-
res.status(500).send(JSON.stringify({ error: "Dev server failed to initialize" }));
|
|
679850
|
+
return;
|
|
680847
679851
|
}
|
|
679852
|
+
logger15.info("Starting dev server");
|
|
679853
|
+
isViteServerInitialized = true;
|
|
679854
|
+
const featureFlags = await sdk?.getFeatureFlagsForCurrentUser();
|
|
679855
|
+
startVite({
|
|
679856
|
+
port,
|
|
679857
|
+
app,
|
|
679858
|
+
root: root3,
|
|
679859
|
+
mode,
|
|
679860
|
+
fsOperationQueue,
|
|
679861
|
+
syncService,
|
|
679862
|
+
lockService,
|
|
679863
|
+
aiService,
|
|
679864
|
+
gitService,
|
|
679865
|
+
activateGitService,
|
|
679866
|
+
snapshotManager,
|
|
679867
|
+
checkAuthorization,
|
|
679868
|
+
logger: loggerOverride,
|
|
679869
|
+
httpServer,
|
|
679870
|
+
superblocksBaseUrl: explicitBaseUrl || localToken?.superblocksBaseUrl,
|
|
679871
|
+
features: {
|
|
679872
|
+
enableSessionRecording: featureFlags?.enableSessionRecording() ?? false
|
|
679873
|
+
}
|
|
679874
|
+
}).then((result) => {
|
|
679875
|
+
logger15.info("Dev server initialized");
|
|
679876
|
+
viteResolve();
|
|
679877
|
+
viteCreationResults = result;
|
|
679878
|
+
res.send(JSON.stringify(healthResponse));
|
|
679879
|
+
}, (e) => {
|
|
679880
|
+
logger15.error("Error initializing dev server", getErrorMeta(e));
|
|
679881
|
+
viteReject(e);
|
|
679882
|
+
});
|
|
680848
679883
|
});
|
|
680849
679884
|
app.post("/_sb_disconnect", authHandler, async (req, res) => {
|
|
680850
679885
|
logger15.info("Disconnecting dev server...");
|
|
@@ -680867,8 +679902,6 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
680867
679902
|
viteResolve = resolve9;
|
|
680868
679903
|
viteReject = reject;
|
|
680869
679904
|
});
|
|
680870
|
-
vitePromise.catch(() => {
|
|
680871
|
-
});
|
|
680872
679905
|
isViteServerInitialized = false;
|
|
680873
679906
|
}
|
|
680874
679907
|
res.send("ok");
|
|
@@ -680909,95 +679942,8 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
680909
679942
|
timeSinceLastActivityMs: lockService.timeSinceLastActivity
|
|
680910
679943
|
});
|
|
680911
679944
|
} else {
|
|
680912
|
-
|
|
680913
|
-
|
|
680914
|
-
connectedUsers: [],
|
|
680915
|
-
timeSinceLastActivityMs: Number.MAX_SAFE_INTEGER
|
|
680916
|
-
});
|
|
680917
|
-
}
|
|
680918
|
-
});
|
|
680919
|
-
let persistInProgress = false;
|
|
680920
|
-
app.post("/_sb_persist", authHandler, async (req, res) => {
|
|
680921
|
-
if (persistInProgress) {
|
|
680922
|
-
res.status(409).json({ error: "persist already in progress" });
|
|
680923
|
-
return;
|
|
680924
|
-
}
|
|
680925
|
-
persistInProgress = true;
|
|
680926
|
-
const persistStart = Date.now();
|
|
680927
|
-
try {
|
|
680928
|
-
const { uploadURL } = req.body;
|
|
680929
|
-
if (!uploadURL) {
|
|
680930
|
-
res.status(400).json({ error: "uploadURL required" });
|
|
680931
|
-
return;
|
|
680932
|
-
}
|
|
680933
|
-
logger15.info("/_sb_persist: archiving and uploading workspace to S3...");
|
|
680934
|
-
const archive = await new Promise((resolveArchive, rejectArchive) => {
|
|
680935
|
-
const tarProc = child_process3.spawn("tar", [
|
|
680936
|
-
"cf",
|
|
680937
|
-
"-",
|
|
680938
|
-
"--exclude",
|
|
680939
|
-
".git",
|
|
680940
|
-
"--exclude",
|
|
680941
|
-
"node_modules/.cache",
|
|
680942
|
-
"--exclude",
|
|
680943
|
-
".superblocks",
|
|
680944
|
-
"-C",
|
|
680945
|
-
process.cwd(),
|
|
680946
|
-
"."
|
|
680947
|
-
], { stdio: ["ignore", "pipe", "pipe"] });
|
|
680948
|
-
const zstdProc = child_process3.spawn("zstd", ["-1", "--no-progress"], {
|
|
680949
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
680950
|
-
});
|
|
680951
|
-
tarProc.stdout.pipe(zstdProc.stdin);
|
|
680952
|
-
zstdProc.stdin.on("error", (err) => {
|
|
680953
|
-
rejectArchive(new Error(`zstd stdin stream error: ${err.message}`));
|
|
680954
|
-
});
|
|
680955
|
-
const chunks = [];
|
|
680956
|
-
zstdProc.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
680957
|
-
let stderr = "";
|
|
680958
|
-
tarProc.stderr.on("data", (chunk) => {
|
|
680959
|
-
stderr += chunk.toString();
|
|
680960
|
-
});
|
|
680961
|
-
zstdProc.stderr.on("data", (chunk) => {
|
|
680962
|
-
stderr += chunk.toString();
|
|
680963
|
-
});
|
|
680964
|
-
let tarExitCode = null;
|
|
680965
|
-
tarProc.on("close", (code2) => {
|
|
680966
|
-
tarExitCode = code2;
|
|
680967
|
-
});
|
|
680968
|
-
zstdProc.on("close", (code2) => {
|
|
680969
|
-
if (code2 !== 0) {
|
|
680970
|
-
rejectArchive(new Error(`zstd compression failed (code ${code2}): ${stderr}`));
|
|
680971
|
-
} else if (tarExitCode !== null && tarExitCode !== 0) {
|
|
680972
|
-
rejectArchive(new Error(`tar archival failed (code ${tarExitCode}): ${stderr}`));
|
|
680973
|
-
} else {
|
|
680974
|
-
resolveArchive(Buffer.concat(chunks));
|
|
680975
|
-
}
|
|
680976
|
-
});
|
|
680977
|
-
tarProc.on("error", rejectArchive);
|
|
680978
|
-
zstdProc.on("error", rejectArchive);
|
|
680979
|
-
});
|
|
680980
|
-
logger15.info(`/_sb_persist: archive created (${(archive.length / 1024 / 1024).toFixed(1)}MB) in ${Date.now() - persistStart}ms, uploading...`);
|
|
680981
|
-
const uploadStart = Date.now();
|
|
680982
|
-
const uploadResp = await fetch(uploadURL, {
|
|
680983
|
-
method: "PUT",
|
|
680984
|
-
body: archive,
|
|
680985
|
-
headers: {
|
|
680986
|
-
"Content-Type": "application/zstd",
|
|
680987
|
-
"Content-Length": String(archive.length)
|
|
680988
|
-
},
|
|
680989
|
-
signal: AbortSignal.timeout(3e4)
|
|
680990
|
-
});
|
|
680991
|
-
if (!uploadResp.ok) {
|
|
680992
|
-
throw new Error(`S3 upload failed: ${uploadResp.status} ${uploadResp.statusText}`);
|
|
680993
|
-
}
|
|
680994
|
-
logger15.info(`/_sb_persist: uploaded in ${Date.now() - uploadStart}ms (total ${Date.now() - persistStart}ms)`);
|
|
680995
|
-
res.status(200).json({ status: "uploaded" });
|
|
680996
|
-
} catch (error40) {
|
|
680997
|
-
logger15.error(`/_sb_persist failed: ${error40}`);
|
|
680998
|
-
res.status(500).json({ error: String(error40) });
|
|
680999
|
-
} finally {
|
|
681000
|
-
persistInProgress = false;
|
|
679945
|
+
logger15.error("Lock service not found, rejecting request");
|
|
679946
|
+
viteReject(new Error("Lock service not found, rejecting request"));
|
|
681001
679947
|
}
|
|
681002
679948
|
});
|
|
681003
679949
|
process.on("SIGINT", async () => {
|
|
@@ -681019,52 +679965,9 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
681019
679965
|
process.exit(1);
|
|
681020
679966
|
});
|
|
681021
679967
|
});
|
|
681022
|
-
|
|
681023
|
-
|
|
681024
|
-
|
|
681025
|
-
httpServer = existingServer;
|
|
681026
|
-
logger15.info(`Attached full dev server to existing HTTP server on port ${port}`);
|
|
681027
|
-
} else {
|
|
681028
|
-
logger15.info(`Starting HTTP server on port ${port}`);
|
|
681029
|
-
httpServer = await app.listen(port);
|
|
681030
|
-
logger15.info(`HTTP server started successfully on port ${port}`);
|
|
681031
|
-
}
|
|
681032
|
-
if (!isViteServerInitialized) {
|
|
681033
|
-
isViteServerInitialized = true;
|
|
681034
|
-
logger15.info("Eagerly starting vite server...");
|
|
681035
|
-
const featureFlags = await sdk?.getFeatureFlagsForCurrentUser().catch((err) => {
|
|
681036
|
-
logger15.warn(`Failed to fetch feature flags, using defaults: ${err}`);
|
|
681037
|
-
return void 0;
|
|
681038
|
-
});
|
|
681039
|
-
const viteStartPromise = startVite({
|
|
681040
|
-
port,
|
|
681041
|
-
app,
|
|
681042
|
-
root: root3,
|
|
681043
|
-
mode,
|
|
681044
|
-
fsOperationQueue,
|
|
681045
|
-
syncService,
|
|
681046
|
-
lockService,
|
|
681047
|
-
aiService,
|
|
681048
|
-
gitService,
|
|
681049
|
-
activateGitService,
|
|
681050
|
-
snapshotManager,
|
|
681051
|
-
checkAuthorization,
|
|
681052
|
-
logger: loggerOverride,
|
|
681053
|
-
httpServer,
|
|
681054
|
-
superblocksBaseUrl: explicitBaseUrl || localToken?.superblocksBaseUrl,
|
|
681055
|
-
features: {
|
|
681056
|
-
enableSessionRecording: featureFlags?.enableSessionRecording() ?? false
|
|
681057
|
-
}
|
|
681058
|
-
});
|
|
681059
|
-
viteStartPromise.then((result) => {
|
|
681060
|
-
logger15.info("Vite server initialized eagerly");
|
|
681061
|
-
viteResolve();
|
|
681062
|
-
viteCreationResults = result;
|
|
681063
|
-
}, (e) => {
|
|
681064
|
-
logger15.error("Error initializing vite server", getErrorMeta(e));
|
|
681065
|
-
viteReject(e);
|
|
681066
|
-
});
|
|
681067
|
-
}
|
|
679968
|
+
logger15.info(`Starting HTTP server on port ${port}`);
|
|
679969
|
+
httpServer = await app.listen(port);
|
|
679970
|
+
logger15.info(`HTTP server started successfully on port ${port}`);
|
|
681068
679971
|
return httpServer;
|
|
681069
679972
|
}
|
|
681070
679973
|
async function startVite({ app, httpServer: httpServer2, root: root3, mode, port, fsOperationQueue, syncService, lockService, aiService, gitService, activateGitService, snapshotManager, checkAuthorization, logger: loggerOverride, superblocksBaseUrl, features }) {
|
|
@@ -681213,32 +680116,6 @@ async function startVite({ app, httpServer: httpServer2, root: root3, mode, port
|
|
|
681213
680116
|
}
|
|
681214
680117
|
});
|
|
681215
680118
|
}
|
|
681216
|
-
async function preWarmViteCache(root3) {
|
|
681217
|
-
const start = Date.now();
|
|
681218
|
-
console.log("[warm] Pre-warming Vite dependency cache...");
|
|
681219
|
-
try {
|
|
681220
|
-
const server = await createServer({
|
|
681221
|
-
root: root3,
|
|
681222
|
-
mode: "development",
|
|
681223
|
-
server: { middlewareMode: true, hmr: false },
|
|
681224
|
-
plugins: [src_default()],
|
|
681225
|
-
logLevel: "warn",
|
|
681226
|
-
optimizeDeps: { noDiscovery: true }
|
|
681227
|
-
});
|
|
681228
|
-
const depsDir = path73.join(root3, "node_modules", ".vite", "deps");
|
|
681229
|
-
const maxWaitMs = 5e3;
|
|
681230
|
-
const pollMs = 50;
|
|
681231
|
-
const deadline = Date.now() + maxWaitMs;
|
|
681232
|
-
while (!existsSync4(depsDir) && Date.now() < deadline) {
|
|
681233
|
-
await new Promise((r2) => setTimeout(r2, pollMs));
|
|
681234
|
-
}
|
|
681235
|
-
await server.close();
|
|
681236
|
-
const cached2 = existsSync4(depsDir);
|
|
681237
|
-
console.log(`[warm] Vite cache ${cached2 ? "warmed" : "not committed (timed out)"} in ${Date.now() - start}ms`);
|
|
681238
|
-
} catch (error40) {
|
|
681239
|
-
console.warn(`[warm] Vite cache pre-warm failed (non-fatal, ${Date.now() - start}ms):`, error40);
|
|
681240
|
-
}
|
|
681241
|
-
}
|
|
681242
680119
|
var DEFAULT_HMR_PORT = 24678;
|
|
681243
680120
|
function getFreePort() {
|
|
681244
680121
|
return new Promise((resolve9) => {
|
|
@@ -681378,7 +680255,7 @@ async function fetchAndWriteApplication({ resourceId, viewMode, featureFlags, pr
|
|
|
681378
680255
|
|
|
681379
680256
|
// ../sdk/dist/cli-replacement/socket-utils.mjs
|
|
681380
680257
|
init_cjs_shims();
|
|
681381
|
-
import { existsSync as
|
|
680258
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
681382
680259
|
import * as fs41 from "node:fs/promises";
|
|
681383
680260
|
import * as net2 from "node:net";
|
|
681384
680261
|
import * as os7 from "node:os";
|
|
@@ -681426,7 +680303,7 @@ async function getAllSocketFiles() {
|
|
|
681426
680303
|
}
|
|
681427
680304
|
async function getSocketFileForPid(pid) {
|
|
681428
680305
|
const socketPath = path74.join(getSocketDirectory(), `superblocks-auth-${pid}.sock`);
|
|
681429
|
-
return
|
|
680306
|
+
return existsSync4(socketPath) ? socketPath : null;
|
|
681430
680307
|
}
|
|
681431
680308
|
async function cleanupSocketFile(socketPath) {
|
|
681432
680309
|
try {
|
|
@@ -681469,7 +680346,7 @@ async function isSocketAlive(socketPath) {
|
|
|
681469
680346
|
// ../sdk/dist/cli-replacement/dev.mjs
|
|
681470
680347
|
init_cjs_shims();
|
|
681471
680348
|
init_esm();
|
|
681472
|
-
import * as
|
|
680349
|
+
import * as child_process3 from "node:child_process";
|
|
681473
680350
|
import * as nodeFs from "node:fs/promises";
|
|
681474
680351
|
import path76 from "node:path";
|
|
681475
680352
|
import * as readline2 from "node:readline";
|
|
@@ -681665,7 +680542,7 @@ async function ensureRemoteHasDefaultBranch(git, remoteUrl) {
|
|
|
681665
680542
|
}
|
|
681666
680543
|
|
|
681667
680544
|
// ../sdk/dist/cli-replacement/dev.mjs
|
|
681668
|
-
var exec10 = promisify7(
|
|
680545
|
+
var exec10 = promisify7(child_process3.exec);
|
|
681669
680546
|
var passErrorToVSCode = (message, logger15) => {
|
|
681670
680547
|
if (message && process.env.SUPERBLOCKS_VSCODE === "true") {
|
|
681671
680548
|
logger15.error(`clierr: ${JSON.stringify({ message })}`);
|
|
@@ -681755,7 +680632,7 @@ async function handleLockConflict(error40, lockSvc, span, logger15) {
|
|
|
681755
680632
|
}
|
|
681756
680633
|
async function readPkgJson(cwd) {
|
|
681757
680634
|
try {
|
|
681758
|
-
const { readPackage } = await import("./read-pkg-
|
|
680635
|
+
const { readPackage } = await import("./read-pkg-MWZA3RU5.js");
|
|
681759
680636
|
return await readPackage({ cwd });
|
|
681760
680637
|
} catch {
|
|
681761
680638
|
return null;
|
|
@@ -681797,7 +680674,6 @@ var DevServerAutoUpgradeMode;
|
|
|
681797
680674
|
(function(DevServerAutoUpgradeMode2) {
|
|
681798
680675
|
DevServerAutoUpgradeMode2["SKIP"] = "skip-upgrade";
|
|
681799
680676
|
DevServerAutoUpgradeMode2["FORCE"] = "force-upgrade";
|
|
681800
|
-
DevServerAutoUpgradeMode2["SKIP_CLI_ONLY"] = "skip-cli-only";
|
|
681801
680677
|
})(DevServerAutoUpgradeMode || (DevServerAutoUpgradeMode = {}));
|
|
681802
680678
|
async function dev(options8) {
|
|
681803
680679
|
const { cwd, tokenConfig, devServerPort, skipSync, applicationConfig, autoUpgradeMode, tokenManager, authHotReloadServer, sdk } = options8;
|
|
@@ -681812,7 +680688,6 @@ async function dev(options8) {
|
|
|
681812
680688
|
const tracer4 = getTracer();
|
|
681813
680689
|
const logger15 = getLogger2(options8.logger);
|
|
681814
680690
|
const skipAutoUpgrade = autoUpgradeMode === DevServerAutoUpgradeMode.SKIP;
|
|
681815
|
-
const skipCliUpgrade = skipAutoUpgrade || autoUpgradeMode === DevServerAutoUpgradeMode.SKIP_CLI_ONLY;
|
|
681816
680691
|
await tracer4.startActiveSpan("devServerStartup", async (startupSpan) => {
|
|
681817
680692
|
try {
|
|
681818
680693
|
if (!import_fs_extra5.default.existsSync(path76.join(cwd, "node_modules"))) {
|
|
@@ -682030,8 +680905,7 @@ async function dev(options8) {
|
|
|
682030
680905
|
let hasCliUpdated = false;
|
|
682031
680906
|
let upgradePromises = [];
|
|
682032
680907
|
const forceUpgrade = options8.autoUpgradeMode === DevServerAutoUpgradeMode.FORCE;
|
|
682033
|
-
|
|
682034
|
-
if (!skipAutoUpgrade || forceUpgrade || skipCliOnly) {
|
|
680908
|
+
if (!skipAutoUpgrade || forceUpgrade) {
|
|
682035
680909
|
await tracer4.startActiveSpan("versionCheckAndUpgrade", async (span) => {
|
|
682036
680910
|
if (lockService) {
|
|
682037
680911
|
const applicationConfigWithTokenConfigAndUserInfo = {
|
|
@@ -682043,7 +680917,7 @@ async function dev(options8) {
|
|
|
682043
680917
|
organizationId: currentUser.user.currentOrganizationId,
|
|
682044
680918
|
featureFlags: sdk.getFeatureFlagsForUser(currentUser)
|
|
682045
680919
|
};
|
|
682046
|
-
const result = await checkVersionsAndWritePackageJson(lockService, applicationConfigWithTokenConfigAndUserInfo, forceUpgrade
|
|
680920
|
+
const result = await checkVersionsAndWritePackageJson(lockService, applicationConfigWithTokenConfigAndUserInfo, forceUpgrade);
|
|
682047
680921
|
hasCliUpdated = result.cliUpdated;
|
|
682048
680922
|
upgradePromises = result.upgradePromises;
|
|
682049
680923
|
} else {
|
|
@@ -682200,11 +681074,7 @@ async function dev(options8) {
|
|
|
682200
681074
|
snapshotManager,
|
|
682201
681075
|
logger: options8.logger,
|
|
682202
681076
|
sdk,
|
|
682203
|
-
superblocksBaseUrl: tokenConfig.superblocksBaseUrl
|
|
682204
|
-
existingServer: options8.existingServer
|
|
682205
|
-
// TODO: Remove this cast — build the options object to match
|
|
682206
|
-
// CreateDevServerOptions directly so new required fields cause a
|
|
682207
|
-
// compile error instead of silently passing undefined.
|
|
681077
|
+
superblocksBaseUrl: tokenConfig.superblocksBaseUrl
|
|
682208
681078
|
};
|
|
682209
681079
|
const result = await createDevServer(createDevServerOptions);
|
|
682210
681080
|
span.end();
|
|
@@ -682551,7 +681421,6 @@ export {
|
|
|
682551
681421
|
SuperblocksSdk,
|
|
682552
681422
|
AUTO_UPGRADE_EXIT_CODE,
|
|
682553
681423
|
RESTART_EXIT_CODE,
|
|
682554
|
-
preWarmViteCache,
|
|
682555
681424
|
TokenManager,
|
|
682556
681425
|
tryDecodeJwtToken,
|
|
682557
681426
|
fetchAndWriteApplication,
|
|
@@ -683103,4 +681972,4 @@ serve-static/index.js:
|
|
|
683103
681972
|
chokidar/esm/index.js:
|
|
683104
681973
|
(*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
|
|
683105
681974
|
*/
|
|
683106
|
-
//# sourceMappingURL=chunk-
|
|
681975
|
+
//# sourceMappingURL=chunk-XBQXSTNW.js.map
|