@superblocksteam/cli 2.0.110 → 2.0.111
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 +3 -1
- package/dist/{acorn-QRHEJZ4Y.js → acorn-SLEBXOPM.js} +3 -3
- package/dist/{angular-E7FCGLEO.js → angular-6RC4UUQO.js} +3 -3
- package/dist/{api-F7VFMVH5.js → api-SNLSSH3U.js} +4 -4
- package/dist/{babel-XU2VNNSQ.js → babel-ASTIWI3P.js} +3 -3
- package/dist/{chunk-XBQXSTNW.js → chunk-2S46UIQP.js} +1736 -522
- package/dist/{chunk-XBQXSTNW.js.map → chunk-2S46UIQP.js.map} +1 -1
- package/dist/{chunk-X2O46BBJ.js → chunk-2X5VDGUL.js} +6 -6
- package/dist/{chunk-JUTJWISA.js → chunk-4AZV7VD2.js} +6 -6
- package/dist/{chunk-VUXGBCHS.js → chunk-5QM3EEXH.js} +4 -4
- package/dist/{chunk-42MJC4KH.js → chunk-634XQVTI.js} +4 -4
- package/dist/{chunk-H427LM2L.js → chunk-6XMCVOST.js} +3 -3
- package/dist/{chunk-Y5UCK4QB.js → chunk-AYW7EDEX.js} +3 -3
- package/dist/{chunk-Z64OZ4VQ.js → chunk-E4SP3S63.js} +4 -4
- package/dist/{chunk-UQQWHXCE.js → chunk-E7KUQ4FE.js} +4 -4
- package/dist/{chunk-QQTIZ3JW.js → chunk-HY7UBGMX.js} +3 -3
- package/dist/{chunk-E33HPBUC.js → chunk-MNJJSKHZ.js} +2 -2
- package/dist/{chunk-SOVZ4MKE.js → chunk-SKMNWLPY.js} +3 -3
- package/dist/{chunk-CHRYSMMG.js → chunk-VL5WAV6F.js} +3 -3
- package/dist/{chunk-4N2GPPW5.js → chunk-WL7QOS6J.js} +3 -3
- package/dist/{chunk-7XGJ2DPJ.js → chunk-ZCWTYMYZ.js} +3 -3
- package/dist/{chunk-FAJ3NJRT.js → chunk-ZLXTKRU5.js} +3 -3
- package/dist/{chunk-5M7JSMKP.js → chunk-ZMBAL5QJ.js} +3 -3
- package/dist/{cli-truncate-R7BZHTWM.js → cli-truncate-7VBORESD.js} +5 -5
- package/dist/commands/dev-parent.js +2 -2
- package/dist/{dd-trace-TMWNM5TU.js → dd-trace-5BYOFB5K.js} +7 -7
- package/dist/{dist-QGBH4SEF.js → dist-4BRFYTBL.js} +13 -13
- package/dist/{embedded-playwright-mcp-server-6GY37WOF.js → embedded-playwright-mcp-server-WWPWW4DO.js} +3 -3
- package/dist/{enquirer-QSA4Q3KI.js → enquirer-APO5ZWFR.js} +4 -4
- package/dist/{estree-M5XOW65K.js → estree-AMTSACNT.js} +3 -3
- package/dist/{flow-L3D4WX3Z.js → flow-AEXGDJ6G.js} +3 -3
- package/dist/{getMachineId-bsd-I2VASQDS.js → getMachineId-bsd-JKUN5SSP.js} +5 -5
- package/dist/{getMachineId-darwin-VTQRCEUS.js → getMachineId-darwin-HAXIZ4SF.js} +5 -5
- package/dist/{getMachineId-linux-4IXPONMU.js → getMachineId-linux-QJ34RVXE.js} +4 -4
- package/dist/{getMachineId-unsupported-UAR7YCNX.js → getMachineId-unsupported-RNQUGZ5J.js} +4 -4
- package/dist/{getMachineId-win-C7XX6XLO.js → getMachineId-win-VVNK5ZBD.js} +5 -5
- package/dist/{glimmer-LUDC5QNV.js → glimmer-RDX5SMUW.js} +3 -3
- package/dist/{graphql-VIZ3REIC.js → graphql-BZRHZUYU.js} +3 -3
- package/dist/{html-I6EAKISS.js → html-BYTKDYRN.js} +3 -3
- package/dist/{http-XXFRZJNU.js → http-M2HMWHM6.js} +12 -12
- package/dist/index.js +307 -26
- package/dist/index.js.map +1 -1
- package/dist/{jiti-EJ36EOMK.js → jiti-X73LQAEX.js} +3 -3
- package/dist/{log-update-53HBE7QZ.js → log-update-NHJG4C4W.js} +6 -6
- package/dist/{markdown-STBGDZM6.js → markdown-EMBWCYGU.js} +3 -3
- package/dist/{meriyah-65T7PG5O.js → meriyah-JGF6IOPU.js} +3 -3
- package/dist/{postcss-ASIVSSN2.js → postcss-AWH3AW63.js} +3 -3
- package/dist/{read-pkg-MWZA3RU5.js → read-pkg-N6NFQVTC.js} +5 -5
- package/dist/{spans-3EJDY2PZ.js → spans-OCSVIZ33.js} +4 -4
- package/dist/{src-DWCFAABS.js → src-67P7IHOU.js} +3 -3
- package/dist/{token-YF6QEPIT.js → token-HO5IGIIO.js} +5 -5
- package/dist/{token-util-TV464TI4.js → token-util-SLK3VTG6.js} +5 -5
- package/dist/{typescript-ZZIEC5OF.js → typescript-6MCB7LTV.js} +3 -3
- package/dist/{wrap-ansi-7RMGVNIF.js → wrap-ansi-L4S3BRNZ.js} +5 -5
- package/dist/{yaml-P2AMYUL3.js → yaml-WJS33RAV.js} +3 -3
- package/oclif.manifest.json +8 -1
- package/package.json +5 -5
- /package/dist/{acorn-QRHEJZ4Y.js.map → acorn-SLEBXOPM.js.map} +0 -0
- /package/dist/{angular-E7FCGLEO.js.map → angular-6RC4UUQO.js.map} +0 -0
- /package/dist/{api-F7VFMVH5.js.map → api-SNLSSH3U.js.map} +0 -0
- /package/dist/{babel-XU2VNNSQ.js.map → babel-ASTIWI3P.js.map} +0 -0
- /package/dist/{chunk-X2O46BBJ.js.map → chunk-2X5VDGUL.js.map} +0 -0
- /package/dist/{chunk-JUTJWISA.js.map → chunk-4AZV7VD2.js.map} +0 -0
- /package/dist/{chunk-VUXGBCHS.js.map → chunk-5QM3EEXH.js.map} +0 -0
- /package/dist/{chunk-42MJC4KH.js.map → chunk-634XQVTI.js.map} +0 -0
- /package/dist/{chunk-H427LM2L.js.map → chunk-6XMCVOST.js.map} +0 -0
- /package/dist/{chunk-Y5UCK4QB.js.map → chunk-AYW7EDEX.js.map} +0 -0
- /package/dist/{chunk-Z64OZ4VQ.js.map → chunk-E4SP3S63.js.map} +0 -0
- /package/dist/{chunk-UQQWHXCE.js.map → chunk-E7KUQ4FE.js.map} +0 -0
- /package/dist/{chunk-QQTIZ3JW.js.map → chunk-HY7UBGMX.js.map} +0 -0
- /package/dist/{chunk-E33HPBUC.js.map → chunk-MNJJSKHZ.js.map} +0 -0
- /package/dist/{chunk-SOVZ4MKE.js.map → chunk-SKMNWLPY.js.map} +0 -0
- /package/dist/{chunk-CHRYSMMG.js.map → chunk-VL5WAV6F.js.map} +0 -0
- /package/dist/{chunk-4N2GPPW5.js.map → chunk-WL7QOS6J.js.map} +0 -0
- /package/dist/{chunk-7XGJ2DPJ.js.map → chunk-ZCWTYMYZ.js.map} +0 -0
- /package/dist/{chunk-FAJ3NJRT.js.map → chunk-ZLXTKRU5.js.map} +0 -0
- /package/dist/{chunk-5M7JSMKP.js.map → chunk-ZMBAL5QJ.js.map} +0 -0
- /package/dist/{cli-truncate-R7BZHTWM.js.map → cli-truncate-7VBORESD.js.map} +0 -0
- /package/dist/{dd-trace-TMWNM5TU.js.map → dd-trace-5BYOFB5K.js.map} +0 -0
- /package/dist/{dist-QGBH4SEF.js.map → dist-4BRFYTBL.js.map} +0 -0
- /package/dist/{embedded-playwright-mcp-server-6GY37WOF.js.map → embedded-playwright-mcp-server-WWPWW4DO.js.map} +0 -0
- /package/dist/{enquirer-QSA4Q3KI.js.map → enquirer-APO5ZWFR.js.map} +0 -0
- /package/dist/{estree-M5XOW65K.js.map → estree-AMTSACNT.js.map} +0 -0
- /package/dist/{flow-L3D4WX3Z.js.map → flow-AEXGDJ6G.js.map} +0 -0
- /package/dist/{getMachineId-bsd-I2VASQDS.js.map → getMachineId-bsd-JKUN5SSP.js.map} +0 -0
- /package/dist/{getMachineId-darwin-VTQRCEUS.js.map → getMachineId-darwin-HAXIZ4SF.js.map} +0 -0
- /package/dist/{getMachineId-linux-4IXPONMU.js.map → getMachineId-linux-QJ34RVXE.js.map} +0 -0
- /package/dist/{getMachineId-unsupported-UAR7YCNX.js.map → getMachineId-unsupported-RNQUGZ5J.js.map} +0 -0
- /package/dist/{getMachineId-win-C7XX6XLO.js.map → getMachineId-win-VVNK5ZBD.js.map} +0 -0
- /package/dist/{glimmer-LUDC5QNV.js.map → glimmer-RDX5SMUW.js.map} +0 -0
- /package/dist/{graphql-VIZ3REIC.js.map → graphql-BZRHZUYU.js.map} +0 -0
- /package/dist/{html-I6EAKISS.js.map → html-BYTKDYRN.js.map} +0 -0
- /package/dist/{http-XXFRZJNU.js.map → http-M2HMWHM6.js.map} +0 -0
- /package/dist/{jiti-EJ36EOMK.js.map → jiti-X73LQAEX.js.map} +0 -0
- /package/dist/{log-update-53HBE7QZ.js.map → log-update-NHJG4C4W.js.map} +0 -0
- /package/dist/{markdown-STBGDZM6.js.map → markdown-EMBWCYGU.js.map} +0 -0
- /package/dist/{meriyah-65T7PG5O.js.map → meriyah-JGF6IOPU.js.map} +0 -0
- /package/dist/{postcss-ASIVSSN2.js.map → postcss-AWH3AW63.js.map} +0 -0
- /package/dist/{read-pkg-MWZA3RU5.js.map → read-pkg-N6NFQVTC.js.map} +0 -0
- /package/dist/{spans-3EJDY2PZ.js.map → spans-OCSVIZ33.js.map} +0 -0
- /package/dist/{src-DWCFAABS.js.map → src-67P7IHOU.js.map} +0 -0
- /package/dist/{token-YF6QEPIT.js.map → token-HO5IGIIO.js.map} +0 -0
- /package/dist/{token-util-TV464TI4.js.map → token-util-SLK3VTG6.js.map} +0 -0
- /package/dist/{typescript-ZZIEC5OF.js.map → typescript-6MCB7LTV.js.map} +0 -0
- /package/dist/{wrap-ansi-7RMGVNIF.js.map → wrap-ansi-L4S3BRNZ.js.map} +0 -0
- /package/dist/{yaml-P2AMYUL3.js.map → yaml-WJS33RAV.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 = '8c829e0a3a1ea9ec89ca751d0ae49a4b1db165e2';
|
|
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-HY7UBGMX.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-ZCWTYMYZ.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-2X5VDGUL.js";
|
|
54
54
|
import {
|
|
55
55
|
require_commonjs
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-6XMCVOST.js";
|
|
57
57
|
import {
|
|
58
58
|
require_dc_polyfill
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-AYW7EDEX.js";
|
|
60
60
|
import {
|
|
61
61
|
require_token_error
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-WL7QOS6J.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-ZLXTKRU5.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-MNJJSKHZ.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 truncate2(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 = truncate2;
|
|
7452
7452
|
lodash.unescape = unescape3;
|
|
7453
7453
|
lodash.uniqueId = uniqueId;
|
|
7454
7454
|
lodash.upperCase = upperCase;
|
|
@@ -43398,13 +43398,36 @@ 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;
|
|
43401
43402
|
exports2.getTextAttachmentType = getTextAttachmentType;
|
|
43402
43403
|
exports2.normalizeAttachmentMimeType = normalizeAttachmentMimeType;
|
|
43403
43404
|
exports2.toAttachmentUploadDescriptor = toAttachmentUploadDescriptor2;
|
|
43404
43405
|
exports2.buildAttachmentUploadFormData = buildAttachmentUploadFormData2;
|
|
43405
43406
|
exports2.createUploadedAttachmentFromServer = createUploadedAttachmentFromServer;
|
|
43406
43407
|
exports2.uploadAttachmentToServerApi = uploadAttachmentToServerApi2;
|
|
43407
|
-
var
|
|
43408
|
+
var OFFICE_MIME_SUBSTRINGS = [
|
|
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
|
+
];
|
|
43408
43431
|
var TEXT_ATTACHMENT_MIME_TYPES2 = {
|
|
43409
43432
|
csv: "text/csv",
|
|
43410
43433
|
css: "text/css",
|
|
@@ -43488,7 +43511,21 @@ var require_attachment_upload = __commonJS({
|
|
|
43488
43511
|
const normalizedMimeType = mimeType.toLowerCase();
|
|
43489
43512
|
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");
|
|
43490
43513
|
}
|
|
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
|
+
}
|
|
43491
43525
|
function getTextAttachmentType(params) {
|
|
43526
|
+
if (isOfficeXml(params)) {
|
|
43527
|
+
return null;
|
|
43528
|
+
}
|
|
43492
43529
|
const normalizedFileName = normalizeNonEmptyString(params.fileName)?.toLowerCase();
|
|
43493
43530
|
const normalizedMimeType = normalizeNonEmptyString(params.mimeType)?.toLowerCase();
|
|
43494
43531
|
if (normalizedMimeType === "text/csv" || normalizedFileName?.endsWith(".csv")) {
|
|
@@ -43515,13 +43552,13 @@ var require_attachment_upload = __commonJS({
|
|
|
43515
43552
|
function normalizeAttachmentMimeType(params) {
|
|
43516
43553
|
const normalizedMimeType = normalizeNonEmptyString(params.mimeType)?.toLowerCase() ?? normalizeNonEmptyString(params.fallbackMimeType)?.toLowerCase();
|
|
43517
43554
|
const textLikeMimeType = getTextLikeMimeTypeFromFileName(params.fileName);
|
|
43518
|
-
if (
|
|
43519
|
-
return normalizedMimeType
|
|
43555
|
+
if (normalizedMimeType && isTextLikeMimeType(normalizedMimeType)) {
|
|
43556
|
+
return normalizedMimeType;
|
|
43520
43557
|
}
|
|
43521
|
-
if (
|
|
43558
|
+
if (textLikeMimeType) {
|
|
43522
43559
|
return textLikeMimeType;
|
|
43523
43560
|
}
|
|
43524
|
-
return
|
|
43561
|
+
return normalizedMimeType ?? void 0;
|
|
43525
43562
|
}
|
|
43526
43563
|
function getDefaultFileName(mimeType) {
|
|
43527
43564
|
const normalizedMimeType = mimeType.toLowerCase();
|
|
@@ -43543,6 +43580,12 @@ var require_attachment_upload = __commonJS({
|
|
|
43543
43580
|
function decodeBase64(base64Data) {
|
|
43544
43581
|
return Uint8Array.from(atob(base64Data), (char) => char.charCodeAt(0));
|
|
43545
43582
|
}
|
|
43583
|
+
function withMimeType(blob, mimeType) {
|
|
43584
|
+
if (blob.type === mimeType) {
|
|
43585
|
+
return blob;
|
|
43586
|
+
}
|
|
43587
|
+
return new Blob([blob], { type: mimeType });
|
|
43588
|
+
}
|
|
43546
43589
|
function parseDataUrl2(data3) {
|
|
43547
43590
|
const match2 = data3.match(/^data:([^;,]+)?(?:;base64)?,(.*)$/s);
|
|
43548
43591
|
if (!match2) {
|
|
@@ -43563,8 +43606,11 @@ var require_attachment_upload = __commonJS({
|
|
|
43563
43606
|
mimeType: source2.type,
|
|
43564
43607
|
fallbackMimeType: options8?.fallbackMimeType
|
|
43565
43608
|
});
|
|
43609
|
+
if (!mimeType) {
|
|
43610
|
+
return null;
|
|
43611
|
+
}
|
|
43566
43612
|
return {
|
|
43567
|
-
blob: source2,
|
|
43613
|
+
blob: withMimeType(source2, mimeType),
|
|
43568
43614
|
fileName: resolveFileName({
|
|
43569
43615
|
fileName: source2.name,
|
|
43570
43616
|
fallbackFileName: options8?.fallbackFileName,
|
|
@@ -43580,8 +43626,11 @@ var require_attachment_upload = __commonJS({
|
|
|
43580
43626
|
mimeType: source2.type,
|
|
43581
43627
|
fallbackMimeType: options8?.fallbackMimeType
|
|
43582
43628
|
});
|
|
43629
|
+
if (!mimeType) {
|
|
43630
|
+
return null;
|
|
43631
|
+
}
|
|
43583
43632
|
return {
|
|
43584
|
-
blob: source2,
|
|
43633
|
+
blob: withMimeType(source2, mimeType),
|
|
43585
43634
|
fileName: resolveFileName({
|
|
43586
43635
|
fileName: sourceWithOptionalName.name,
|
|
43587
43636
|
fallbackFileName: options8?.fallbackFileName,
|
|
@@ -43598,6 +43647,9 @@ var require_attachment_upload = __commonJS({
|
|
|
43598
43647
|
fallbackMimeType: options8?.fallbackMimeType
|
|
43599
43648
|
});
|
|
43600
43649
|
const base64Data = parsedDataUrl?.base64Data ?? source2.data;
|
|
43650
|
+
if (!mimeType) {
|
|
43651
|
+
return null;
|
|
43652
|
+
}
|
|
43601
43653
|
return {
|
|
43602
43654
|
blob: new Blob([decodeBase64(base64Data)], { type: mimeType }),
|
|
43603
43655
|
fileName: resolveFileName({
|
|
@@ -43646,6 +43698,9 @@ var require_attachment_upload = __commonJS({
|
|
|
43646
43698
|
mimeType: source2.mimeType,
|
|
43647
43699
|
fallbackMimeType: options8?.fallbackMimeType ?? TEXT_ATTACHMENT_MIME_TYPES2[source2.type]
|
|
43648
43700
|
});
|
|
43701
|
+
if (!mimeType) {
|
|
43702
|
+
return null;
|
|
43703
|
+
}
|
|
43649
43704
|
return {
|
|
43650
43705
|
blob: new Blob([source2.content], { type: mimeType }),
|
|
43651
43706
|
fileName: resolveFileName({
|
|
@@ -43826,6 +43881,7 @@ var require_git_url = __commonJS({
|
|
|
43826
43881
|
exports2.detectGitProvider = detectGitProvider;
|
|
43827
43882
|
exports2.isGitCommitHash = isGitCommitHash;
|
|
43828
43883
|
exports2.getCommitUrlForHash = getCommitUrlForHash2;
|
|
43884
|
+
exports2.sshGitUrlToHttps = sshGitUrlToHttps;
|
|
43829
43885
|
exports2.isCommitUrlForHash = isCommitUrlForHash;
|
|
43830
43886
|
var HTTPS_GIT_URL_RE = /^https?:\/\/[^\s/$.?#]+(?:\.[^\s/$.?#]+)+\/[^\s/$.?#]+(\/[^\s/$.?#]+)+(\.git)?\/?$/i;
|
|
43831
43887
|
var SSH_GIT_URL_RE = /^[\w-]+@[\w.-]+:[\w./-]+(\.git)?$/;
|
|
@@ -43952,6 +44008,47 @@ var require_git_url = __commonJS({
|
|
|
43952
44008
|
provider
|
|
43953
44009
|
})}`;
|
|
43954
44010
|
}
|
|
44011
|
+
function sshGitUrlToHttps(url4) {
|
|
44012
|
+
const trimmed2 = url4.trim();
|
|
44013
|
+
try {
|
|
44014
|
+
const parsed = new URL(trimmed2);
|
|
44015
|
+
if (parsed.protocol === "https:" || parsed.protocol === "http:") {
|
|
44016
|
+
if (parsed.hostname === "dev.azure.com" && parsed.pathname.includes("/_git/")) {
|
|
44017
|
+
return trimmed2.replace(/\/+$/, "");
|
|
44018
|
+
}
|
|
44019
|
+
return ensureGitSuffix(trimmed2);
|
|
44020
|
+
}
|
|
44021
|
+
if (parsed.protocol === "ssh:") {
|
|
44022
|
+
const host = parsed.hostname;
|
|
44023
|
+
const path77 = parsed.pathname;
|
|
44024
|
+
if (host === "ssh.dev.azure.com") {
|
|
44025
|
+
const azureMatch = path77.match(/^\/v3\/([^/]+)\/([^/]+)\/(.+?)(?:\.git)?\/?$/);
|
|
44026
|
+
if (azureMatch) {
|
|
44027
|
+
return `https://dev.azure.com/${azureMatch[1]}/${azureMatch[2]}/_git/${azureMatch[3]}`;
|
|
44028
|
+
}
|
|
44029
|
+
}
|
|
44030
|
+
return ensureGitSuffix(`https://${host}${path77}`);
|
|
44031
|
+
}
|
|
44032
|
+
} catch {
|
|
44033
|
+
}
|
|
44034
|
+
const sshMatch = trimmed2.match(/^[\w-]+@([\w.-]+):(.+?)(?:\.git)?\s*$/);
|
|
44035
|
+
if (sshMatch?.[1] && sshMatch[2]) {
|
|
44036
|
+
const host = sshMatch[1];
|
|
44037
|
+
const path77 = sshMatch[2];
|
|
44038
|
+
if (host === "ssh.dev.azure.com") {
|
|
44039
|
+
const azureMatch = path77.match(/^v3\/([^/]+)\/([^/]+)\/(.+)$/);
|
|
44040
|
+
if (azureMatch) {
|
|
44041
|
+
return `https://dev.azure.com/${azureMatch[1]}/${azureMatch[2]}/_git/${azureMatch[3]}`;
|
|
44042
|
+
}
|
|
44043
|
+
}
|
|
44044
|
+
return `https://${host}/${path77}.git`;
|
|
44045
|
+
}
|
|
44046
|
+
return null;
|
|
44047
|
+
}
|
|
44048
|
+
function ensureGitSuffix(url4) {
|
|
44049
|
+
const cleaned = url4.replace(/\/+$/, "");
|
|
44050
|
+
return cleaned.endsWith(".git") ? cleaned : `${cleaned}.git`;
|
|
44051
|
+
}
|
|
43955
44052
|
function isCommitUrlForHash(params) {
|
|
43956
44053
|
const { hash: hash2, url: url4 } = params;
|
|
43957
44054
|
const trimmedHash = hash2.trim();
|
|
@@ -70089,12 +70186,12 @@ var require_unreachable = __commonJS({
|
|
|
70089
70186
|
var require_base64 = __commonJS({
|
|
70090
70187
|
"../../../../node_modules/.pnpm/js-base64@3.7.7/node_modules/js-base64/base64.js"(exports2, module2) {
|
|
70091
70188
|
init_cjs_shims();
|
|
70092
|
-
(function(global2,
|
|
70093
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports =
|
|
70189
|
+
(function(global2, factory12) {
|
|
70190
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory12() : typeof define === "function" && define.amd ? define(factory12) : (
|
|
70094
70191
|
// cf. https://github.com/dankogai/js-base64/issues/119
|
|
70095
70192
|
(function() {
|
|
70096
70193
|
var _Base64 = global2.Base64;
|
|
70097
|
-
var gBase64 =
|
|
70194
|
+
var gBase64 = factory12();
|
|
70098
70195
|
gBase64.noConflict = function() {
|
|
70099
70196
|
global2.Base64 = _Base64;
|
|
70100
70197
|
return gBase64;
|
|
@@ -88861,8 +88958,8 @@ var require_data = __commonJS({
|
|
|
88861
88958
|
var require_uri_all = __commonJS({
|
|
88862
88959
|
"../../../../node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js"(exports2, module2) {
|
|
88863
88960
|
init_cjs_shims();
|
|
88864
|
-
(function(global2,
|
|
88865
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
88961
|
+
(function(global2, factory12) {
|
|
88962
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory12(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory12) : factory12(global2.URI = global2.URI || {});
|
|
88866
88963
|
})(exports2, (function(exports3) {
|
|
88867
88964
|
"use strict";
|
|
88868
88965
|
function merge5() {
|
|
@@ -96624,15 +96721,15 @@ var require_api_files = __commonJS({
|
|
|
96624
96721
|
exports2.readAppApiYamlFile = readAppApiYamlFile4;
|
|
96625
96722
|
exports2.resolveLanguageSpecificStepContentFromBlocks = resolveLanguageSpecificStepContentFromBlocks2;
|
|
96626
96723
|
async function writeApiFiles3(...args) {
|
|
96627
|
-
const esmFunction = await import("./api-
|
|
96724
|
+
const esmFunction = await import("./api-SNLSSH3U.js");
|
|
96628
96725
|
return esmFunction.writeApiFiles(...args);
|
|
96629
96726
|
}
|
|
96630
96727
|
async function readAppApiYamlFile4(...args) {
|
|
96631
|
-
const esmFunction = await import("./api-
|
|
96728
|
+
const esmFunction = await import("./api-SNLSSH3U.js");
|
|
96632
96729
|
return esmFunction.readAppApiYamlFile(...args);
|
|
96633
96730
|
}
|
|
96634
96731
|
async function resolveLanguageSpecificStepContentFromBlocks2(...args) {
|
|
96635
|
-
const esmFunction = await import("./api-
|
|
96732
|
+
const esmFunction = await import("./api-SNLSSH3U.js");
|
|
96636
96733
|
return esmFunction.resolveLanguageSpecificStepContentFromBlocks(...args);
|
|
96637
96734
|
}
|
|
96638
96735
|
}
|
|
@@ -109424,19 +109521,19 @@ var require_getMachineId = __commonJS({
|
|
|
109424
109521
|
if (!getMachineIdImpl) {
|
|
109425
109522
|
switch (process5.platform) {
|
|
109426
109523
|
case "darwin":
|
|
109427
|
-
getMachineIdImpl = (await import("./getMachineId-darwin-
|
|
109524
|
+
getMachineIdImpl = (await import("./getMachineId-darwin-HAXIZ4SF.js")).getMachineId;
|
|
109428
109525
|
break;
|
|
109429
109526
|
case "linux":
|
|
109430
|
-
getMachineIdImpl = (await import("./getMachineId-linux-
|
|
109527
|
+
getMachineIdImpl = (await import("./getMachineId-linux-QJ34RVXE.js")).getMachineId;
|
|
109431
109528
|
break;
|
|
109432
109529
|
case "freebsd":
|
|
109433
|
-
getMachineIdImpl = (await import("./getMachineId-bsd-
|
|
109530
|
+
getMachineIdImpl = (await import("./getMachineId-bsd-JKUN5SSP.js")).getMachineId;
|
|
109434
109531
|
break;
|
|
109435
109532
|
case "win32":
|
|
109436
|
-
getMachineIdImpl = (await import("./getMachineId-win-
|
|
109533
|
+
getMachineIdImpl = (await import("./getMachineId-win-VVNK5ZBD.js")).getMachineId;
|
|
109437
109534
|
break;
|
|
109438
109535
|
default:
|
|
109439
|
-
getMachineIdImpl = (await import("./getMachineId-unsupported-
|
|
109536
|
+
getMachineIdImpl = (await import("./getMachineId-unsupported-RNQUGZ5J.js")).getMachineId;
|
|
109440
109537
|
break;
|
|
109441
109538
|
}
|
|
109442
109539
|
}
|
|
@@ -132107,8 +132204,8 @@ var require_float = __commonJS({
|
|
|
132107
132204
|
"../../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js"(exports2, module2) {
|
|
132108
132205
|
"use strict";
|
|
132109
132206
|
init_cjs_shims();
|
|
132110
|
-
module2.exports =
|
|
132111
|
-
function
|
|
132207
|
+
module2.exports = factory12(factory12);
|
|
132208
|
+
function factory12(exports3) {
|
|
132112
132209
|
if (typeof Float32Array !== "undefined") (function() {
|
|
132113
132210
|
var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128;
|
|
132114
132211
|
function writeFloat_f32_cpy(val2, buf, pos3) {
|
|
@@ -139775,23 +139872,23 @@ var require_util7 = __commonJS({
|
|
|
139775
139872
|
var require_umd = __commonJS({
|
|
139776
139873
|
"../../../../node_modules/.pnpm/long@5.3.1/node_modules/long/umd/index.js"(exports2, module2) {
|
|
139777
139874
|
init_cjs_shims();
|
|
139778
|
-
(function(global2,
|
|
139875
|
+
(function(global2, factory12) {
|
|
139779
139876
|
function unwrapDefault(exports3) {
|
|
139780
139877
|
return "default" in exports3 ? exports3.default : exports3;
|
|
139781
139878
|
}
|
|
139782
139879
|
if (typeof define === "function" && define.amd) {
|
|
139783
139880
|
define([], function() {
|
|
139784
139881
|
var exports3 = {};
|
|
139785
|
-
|
|
139882
|
+
factory12(exports3);
|
|
139786
139883
|
return unwrapDefault(exports3);
|
|
139787
139884
|
});
|
|
139788
139885
|
} else if (typeof exports2 === "object") {
|
|
139789
|
-
|
|
139886
|
+
factory12(exports2);
|
|
139790
139887
|
if (typeof module2 === "object") module2.exports = unwrapDefault(exports2);
|
|
139791
139888
|
} else {
|
|
139792
139889
|
(function() {
|
|
139793
139890
|
var exports3 = {};
|
|
139794
|
-
|
|
139891
|
+
factory12(exports3);
|
|
139795
139892
|
global2.Long = unwrapDefault(exports3);
|
|
139796
139893
|
})();
|
|
139797
139894
|
}
|
|
@@ -143502,7 +143599,7 @@ var require_filter_stack = __commonJS({
|
|
|
143502
143599
|
return new _FilterStackFactory([...this.factories]);
|
|
143503
143600
|
}
|
|
143504
143601
|
createFilter() {
|
|
143505
|
-
return new FilterStack(this.factories.map((
|
|
143602
|
+
return new FilterStack(this.factories.map((factory12) => factory12.createFilter()));
|
|
143506
143603
|
}
|
|
143507
143604
|
};
|
|
143508
143605
|
exports2.FilterStackFactory = FilterStackFactory;
|
|
@@ -154366,8 +154463,8 @@ var require_splat = __commonJS({
|
|
|
154366
154463
|
var require_fecha_umd = __commonJS({
|
|
154367
154464
|
"../../../../node_modules/.pnpm/fecha@4.2.3/node_modules/fecha/lib/fecha.umd.js"(exports2, module2) {
|
|
154368
154465
|
init_cjs_shims();
|
|
154369
|
-
(function(global2,
|
|
154370
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
154466
|
+
(function(global2, factory12) {
|
|
154467
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory12(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory12) : factory12(global2.fecha = {});
|
|
154371
154468
|
})(exports2, (function(exports3) {
|
|
154372
154469
|
"use strict";
|
|
154373
154470
|
var token2 = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
|
|
@@ -163163,7 +163260,7 @@ var require_globrex = __commonJS({
|
|
|
163163
163260
|
"../../../../node_modules/.pnpm/globrex@0.1.2/node_modules/globrex/index.js"(exports2, module2) {
|
|
163164
163261
|
init_cjs_shims();
|
|
163165
163262
|
var isWin = process.platform === "win32";
|
|
163166
|
-
var
|
|
163263
|
+
var SEP2 = isWin ? `\\\\+` : `\\/`;
|
|
163167
163264
|
var SEP_ESC = isWin ? `\\\\` : `/`;
|
|
163168
163265
|
var GLOBSTAR2 = `((?:[^/]*(?:/|$))*)`;
|
|
163169
163266
|
var WILDCARD = `([^/]*)`;
|
|
@@ -163179,7 +163276,7 @@ var require_globrex = __commonJS({
|
|
|
163179
163276
|
function add2(str, { split, last: last3, only } = {}) {
|
|
163180
163277
|
if (only !== "path") regex += str;
|
|
163181
163278
|
if (filepath && only !== "regex") {
|
|
163182
|
-
path77.regex += str === "\\/" ?
|
|
163279
|
+
path77.regex += str === "\\/" ? SEP2 : str;
|
|
163183
163280
|
if (split) {
|
|
163184
163281
|
if (last3) segment += str;
|
|
163185
163282
|
if (segment !== "") {
|
|
@@ -182722,7 +182819,7 @@ var require_dist6 = __commonJS({
|
|
|
182722
182819
|
asSchema: () => asSchema4,
|
|
182723
182820
|
combineHeaders: () => combineHeaders3,
|
|
182724
182821
|
convertAsyncIteratorToReadableStream: () => convertAsyncIteratorToReadableStream,
|
|
182725
|
-
convertBase64ToUint8Array: () =>
|
|
182822
|
+
convertBase64ToUint8Array: () => convertBase64ToUint8Array2,
|
|
182726
182823
|
convertImageModelFileToDataUri: () => convertImageModelFileToDataUri,
|
|
182727
182824
|
convertToBase64: () => convertToBase642,
|
|
182728
182825
|
convertToFormData: () => convertToFormData,
|
|
@@ -182921,7 +183018,7 @@ var require_dist6 = __commonJS({
|
|
|
182921
183018
|
return Object.fromEntries([...response.headers]);
|
|
182922
183019
|
}
|
|
182923
183020
|
var { btoa: btoa4, atob: atob4 } = globalThis;
|
|
182924
|
-
function
|
|
183021
|
+
function convertBase64ToUint8Array2(base64String) {
|
|
182925
183022
|
const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
|
|
182926
183023
|
const latin1string = atob4(base64Url);
|
|
182927
183024
|
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
@@ -185299,8 +185396,8 @@ var require_get_vercel_oidc_token = __commonJS({
|
|
|
185299
185396
|
}
|
|
185300
185397
|
try {
|
|
185301
185398
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
185302
|
-
await import("./token-util-
|
|
185303
|
-
await import("./token-
|
|
185399
|
+
await import("./token-util-SLK3VTG6.js"),
|
|
185400
|
+
await import("./token-HO5IGIIO.js")
|
|
185304
185401
|
]);
|
|
185305
185402
|
if (!token2 || isExpired(getTokenPayload(token2))) {
|
|
185306
185403
|
await refreshToken();
|
|
@@ -185403,7 +185500,7 @@ var require_dist8 = __commonJS({
|
|
|
185403
185500
|
module2.exports = __toCommonJS3(src_exports2);
|
|
185404
185501
|
var import_provider_utils112 = require_dist6();
|
|
185405
185502
|
var import_provider25 = require_dist4();
|
|
185406
|
-
var
|
|
185503
|
+
var import_v425 = require_v4();
|
|
185407
185504
|
var marker17 = "vercel.ai.gateway.error";
|
|
185408
185505
|
var symbol18 = Symbol.for(marker17);
|
|
185409
185506
|
var _a21;
|
|
@@ -185537,15 +185634,15 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185537
185634
|
return GatewayError.hasMarker(error40) && symbol42 in error40;
|
|
185538
185635
|
}
|
|
185539
185636
|
};
|
|
185540
|
-
var
|
|
185541
|
-
var
|
|
185637
|
+
var import_v426 = require_v4();
|
|
185638
|
+
var import_provider_utils30 = require_dist6();
|
|
185542
185639
|
var name42 = "GatewayModelNotFoundError";
|
|
185543
185640
|
var marker52 = `vercel.ai.gateway.error.${name42}`;
|
|
185544
185641
|
var symbol52 = Symbol.for(marker52);
|
|
185545
|
-
var modelNotFoundParamSchema = (0,
|
|
185546
|
-
() => (0,
|
|
185547
|
-
|
|
185548
|
-
modelId:
|
|
185642
|
+
var modelNotFoundParamSchema = (0, import_provider_utils30.lazySchema)(
|
|
185643
|
+
() => (0, import_provider_utils30.zodSchema)(
|
|
185644
|
+
import_v426.z.object({
|
|
185645
|
+
modelId: import_v426.z.string()
|
|
185549
185646
|
})
|
|
185550
185647
|
)
|
|
185551
185648
|
);
|
|
@@ -185615,7 +185712,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185615
185712
|
return GatewayError.hasMarker(error40) && symbol72 in error40;
|
|
185616
185713
|
}
|
|
185617
185714
|
};
|
|
185618
|
-
var
|
|
185715
|
+
var import_provider_utils210 = require_dist6();
|
|
185619
185716
|
async function createGatewayErrorFromResponse({
|
|
185620
185717
|
response,
|
|
185621
185718
|
statusCode,
|
|
@@ -185624,7 +185721,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185624
185721
|
authMethod
|
|
185625
185722
|
}) {
|
|
185626
185723
|
var _a92;
|
|
185627
|
-
const parseResult = await (0,
|
|
185724
|
+
const parseResult = await (0, import_provider_utils210.safeValidateTypes)({
|
|
185628
185725
|
value: response,
|
|
185629
185726
|
schema: gatewayErrorResponseSchema
|
|
185630
185727
|
});
|
|
@@ -185667,7 +185764,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185667
185764
|
generationId
|
|
185668
185765
|
});
|
|
185669
185766
|
case "model_not_found": {
|
|
185670
|
-
const modelResult = await (0,
|
|
185767
|
+
const modelResult = await (0, import_provider_utils210.safeValidateTypes)({
|
|
185671
185768
|
value: validatedResponse.error.param,
|
|
185672
185769
|
schema: modelNotFoundParamSchema
|
|
185673
185770
|
});
|
|
@@ -185695,16 +185792,16 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
185695
185792
|
});
|
|
185696
185793
|
}
|
|
185697
185794
|
}
|
|
185698
|
-
var gatewayErrorResponseSchema = (0,
|
|
185699
|
-
() => (0,
|
|
185700
|
-
|
|
185701
|
-
error:
|
|
185702
|
-
message:
|
|
185703
|
-
type:
|
|
185704
|
-
param:
|
|
185705
|
-
code:
|
|
185795
|
+
var gatewayErrorResponseSchema = (0, import_provider_utils210.lazySchema)(
|
|
185796
|
+
() => (0, import_provider_utils210.zodSchema)(
|
|
185797
|
+
import_v425.z.object({
|
|
185798
|
+
error: import_v425.z.object({
|
|
185799
|
+
message: import_v425.z.string(),
|
|
185800
|
+
type: import_v425.z.string().nullish(),
|
|
185801
|
+
param: import_v425.z.unknown().nullish(),
|
|
185802
|
+
code: import_v425.z.union([import_v425.z.string(), import_v425.z.number()]).nullish()
|
|
185706
185803
|
}),
|
|
185707
|
-
generationId:
|
|
185804
|
+
generationId: import_v425.z.string().nullish()
|
|
185708
185805
|
})
|
|
185709
185806
|
)
|
|
185710
185807
|
);
|
|
@@ -186470,37 +186567,37 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
186470
186567
|
})
|
|
186471
186568
|
]);
|
|
186472
186569
|
var import_provider_utils92 = require_dist6();
|
|
186473
|
-
var
|
|
186570
|
+
var import_zod55 = require_zod();
|
|
186474
186571
|
var parallelSearchInputSchema = (0, import_provider_utils92.lazySchema)(
|
|
186475
186572
|
() => (0, import_provider_utils92.zodSchema)(
|
|
186476
|
-
|
|
186477
|
-
objective:
|
|
186573
|
+
import_zod55.z.object({
|
|
186574
|
+
objective: import_zod55.z.string().describe(
|
|
186478
186575
|
"Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
|
|
186479
186576
|
),
|
|
186480
|
-
search_queries:
|
|
186577
|
+
search_queries: import_zod55.z.array(import_zod55.z.string()).optional().describe(
|
|
186481
186578
|
"Optional search queries to supplement the objective. Maximum 200 characters per query."
|
|
186482
186579
|
),
|
|
186483
|
-
mode:
|
|
186580
|
+
mode: import_zod55.z.enum(["one-shot", "agentic"]).optional().describe(
|
|
186484
186581
|
'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
|
|
186485
186582
|
),
|
|
186486
|
-
max_results:
|
|
186583
|
+
max_results: import_zod55.z.number().optional().describe(
|
|
186487
186584
|
"Maximum number of results to return (1-20). Defaults to 10 if not specified."
|
|
186488
186585
|
),
|
|
186489
|
-
source_policy:
|
|
186490
|
-
include_domains:
|
|
186491
|
-
exclude_domains:
|
|
186492
|
-
after_date:
|
|
186586
|
+
source_policy: import_zod55.z.object({
|
|
186587
|
+
include_domains: import_zod55.z.array(import_zod55.z.string()).optional().describe("List of domains to include in search results."),
|
|
186588
|
+
exclude_domains: import_zod55.z.array(import_zod55.z.string()).optional().describe("List of domains to exclude from search results."),
|
|
186589
|
+
after_date: import_zod55.z.string().optional().describe(
|
|
186493
186590
|
"Only include results published after this date (ISO 8601 format)."
|
|
186494
186591
|
)
|
|
186495
186592
|
}).optional().describe(
|
|
186496
186593
|
"Source policy for controlling which domains to include/exclude and freshness."
|
|
186497
186594
|
),
|
|
186498
|
-
excerpts:
|
|
186499
|
-
max_chars_per_result:
|
|
186500
|
-
max_chars_total:
|
|
186595
|
+
excerpts: import_zod55.z.object({
|
|
186596
|
+
max_chars_per_result: import_zod55.z.number().optional().describe("Maximum characters per result."),
|
|
186597
|
+
max_chars_total: import_zod55.z.number().optional().describe("Maximum total characters across all results.")
|
|
186501
186598
|
}).optional().describe("Excerpt configuration for controlling result length."),
|
|
186502
|
-
fetch_policy:
|
|
186503
|
-
max_age_seconds:
|
|
186599
|
+
fetch_policy: import_zod55.z.object({
|
|
186600
|
+
max_age_seconds: import_zod55.z.number().optional().describe(
|
|
186504
186601
|
"Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
|
|
186505
186602
|
)
|
|
186506
186603
|
}).optional().describe("Fetch policy for controlling content freshness.")
|
|
@@ -186509,23 +186606,23 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
186509
186606
|
);
|
|
186510
186607
|
var parallelSearchOutputSchema = (0, import_provider_utils92.lazySchema)(
|
|
186511
186608
|
() => (0, import_provider_utils92.zodSchema)(
|
|
186512
|
-
|
|
186609
|
+
import_zod55.z.union([
|
|
186513
186610
|
// Success response
|
|
186514
|
-
|
|
186515
|
-
searchId:
|
|
186516
|
-
results:
|
|
186517
|
-
|
|
186518
|
-
url:
|
|
186519
|
-
title:
|
|
186520
|
-
excerpt:
|
|
186521
|
-
publishDate:
|
|
186522
|
-
relevanceScore:
|
|
186611
|
+
import_zod55.z.object({
|
|
186612
|
+
searchId: import_zod55.z.string(),
|
|
186613
|
+
results: import_zod55.z.array(
|
|
186614
|
+
import_zod55.z.object({
|
|
186615
|
+
url: import_zod55.z.string(),
|
|
186616
|
+
title: import_zod55.z.string(),
|
|
186617
|
+
excerpt: import_zod55.z.string(),
|
|
186618
|
+
publishDate: import_zod55.z.string().nullable().optional(),
|
|
186619
|
+
relevanceScore: import_zod55.z.number().optional()
|
|
186523
186620
|
})
|
|
186524
186621
|
)
|
|
186525
186622
|
}),
|
|
186526
186623
|
// Error response
|
|
186527
|
-
|
|
186528
|
-
error:
|
|
186624
|
+
import_zod55.z.object({
|
|
186625
|
+
error: import_zod55.z.enum([
|
|
186529
186626
|
"api_error",
|
|
186530
186627
|
"rate_limit",
|
|
186531
186628
|
"timeout",
|
|
@@ -186533,8 +186630,8 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
186533
186630
|
"configuration_error",
|
|
186534
186631
|
"unknown"
|
|
186535
186632
|
]),
|
|
186536
|
-
statusCode:
|
|
186537
|
-
message:
|
|
186633
|
+
statusCode: import_zod55.z.number().optional(),
|
|
186634
|
+
message: import_zod55.z.string()
|
|
186538
186635
|
})
|
|
186539
186636
|
])
|
|
186540
186637
|
)
|
|
@@ -186847,7 +186944,7 @@ var require_dist9 = __commonJS({
|
|
|
186847
186944
|
DefaultChatTransport: () => DefaultChatTransport,
|
|
186848
186945
|
DefaultGeneratedFile: () => DefaultGeneratedFile,
|
|
186849
186946
|
DirectChatTransport: () => DirectChatTransport,
|
|
186850
|
-
DownloadError: () =>
|
|
186947
|
+
DownloadError: () => import_provider_utils30.DownloadError,
|
|
186851
186948
|
EmptyResponseBodyError: () => import_provider212.EmptyResponseBodyError,
|
|
186852
186949
|
Experimental_Agent: () => ToolLoopAgent,
|
|
186853
186950
|
HttpChatTransport: () => HttpChatTransport,
|
|
@@ -186922,7 +187019,7 @@ var require_dist9 = __commonJS({
|
|
|
186922
187019
|
gateway: () => import_gateway3.gateway,
|
|
186923
187020
|
generateId: () => import_provider_utils39.generateId,
|
|
186924
187021
|
generateImage: () => generateImage,
|
|
186925
|
-
generateObject: () =>
|
|
187022
|
+
generateObject: () => generateObject7,
|
|
186926
187023
|
generateText: () => generateText2,
|
|
186927
187024
|
getStaticToolName: () => getStaticToolName,
|
|
186928
187025
|
getTextFromDataUrl: () => getTextFromDataUrl,
|
|
@@ -187374,7 +187471,7 @@ var require_dist9 = __commonJS({
|
|
|
187374
187471
|
}
|
|
187375
187472
|
};
|
|
187376
187473
|
_a182 = symbol182;
|
|
187377
|
-
var
|
|
187474
|
+
var import_provider_utils30 = require_dist6();
|
|
187378
187475
|
var import_provider202 = require_dist4();
|
|
187379
187476
|
var name19 = "AI_RetryError";
|
|
187380
187477
|
var marker19 = `vercel.ai.error.${name19}`;
|
|
@@ -187731,7 +187828,7 @@ var require_dist9 = __commonJS({
|
|
|
187731
187828
|
return timeout.chunkMs;
|
|
187732
187829
|
}
|
|
187733
187830
|
var import_provider_utils62 = require_dist6();
|
|
187734
|
-
var
|
|
187831
|
+
var import_provider_utils210 = require_dist6();
|
|
187735
187832
|
var imageMediaTypeSignatures = [
|
|
187736
187833
|
{
|
|
187737
187834
|
mediaType: "image/gif",
|
|
@@ -187929,7 +188026,7 @@ var require_dist9 = __commonJS({
|
|
|
187929
188026
|
}
|
|
187930
188027
|
];
|
|
187931
188028
|
var stripID3 = (data3) => {
|
|
187932
|
-
const bytes = typeof data3 === "string" ? (0,
|
|
188029
|
+
const bytes = typeof data3 === "string" ? (0, import_provider_utils210.convertBase64ToUint8Array)(data3) : data3;
|
|
187933
188030
|
const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
|
|
187934
188031
|
return bytes.slice(id3Size + 10);
|
|
187935
188032
|
};
|
|
@@ -187944,7 +188041,7 @@ var require_dist9 = __commonJS({
|
|
|
187944
188041
|
signatures
|
|
187945
188042
|
}) {
|
|
187946
188043
|
const processedData = stripID3TagsIfPresent(data3);
|
|
187947
|
-
const bytes = typeof processedData === "string" ? (0,
|
|
188044
|
+
const bytes = typeof processedData === "string" ? (0, import_provider_utils210.convertBase64ToUint8Array)(
|
|
187948
188045
|
processedData.substring(0, Math.min(processedData.length, 24))
|
|
187949
188046
|
) : processedData;
|
|
187950
188047
|
for (const signature of signatures) {
|
|
@@ -188005,7 +188102,7 @@ var require_dist9 = __commonJS({
|
|
|
188005
188102
|
);
|
|
188006
188103
|
var import_provider222 = require_dist4();
|
|
188007
188104
|
var import_provider_utils52 = require_dist6();
|
|
188008
|
-
var
|
|
188105
|
+
var import_v425 = require_v4();
|
|
188009
188106
|
function splitDataUrl(dataUrl) {
|
|
188010
188107
|
try {
|
|
188011
188108
|
const [header, base64Content] = dataUrl.split(",");
|
|
@@ -188020,11 +188117,11 @@ var require_dist9 = __commonJS({
|
|
|
188020
188117
|
};
|
|
188021
188118
|
}
|
|
188022
188119
|
}
|
|
188023
|
-
var dataContentSchema =
|
|
188024
|
-
|
|
188025
|
-
|
|
188026
|
-
|
|
188027
|
-
|
|
188120
|
+
var dataContentSchema = import_v425.z.union([
|
|
188121
|
+
import_v425.z.string(),
|
|
188122
|
+
import_v425.z.instanceof(Uint8Array),
|
|
188123
|
+
import_v425.z.instanceof(ArrayBuffer),
|
|
188124
|
+
import_v425.z.custom(
|
|
188028
188125
|
// Buffer might not be available in some environments such as CloudFlare:
|
|
188029
188126
|
(value2) => {
|
|
188030
188127
|
var _a212, _b17;
|
|
@@ -188619,15 +188716,15 @@ var require_dist9 = __commonJS({
|
|
|
188619
188716
|
var import_v462 = require_v4();
|
|
188620
188717
|
var import_v452 = require_v4();
|
|
188621
188718
|
var import_v432 = require_v4();
|
|
188622
|
-
var
|
|
188623
|
-
var jsonValueSchema =
|
|
188624
|
-
() =>
|
|
188625
|
-
|
|
188626
|
-
|
|
188627
|
-
|
|
188628
|
-
|
|
188629
|
-
|
|
188630
|
-
|
|
188719
|
+
var import_v426 = require_v4();
|
|
188720
|
+
var jsonValueSchema = import_v426.z.lazy(
|
|
188721
|
+
() => import_v426.z.union([
|
|
188722
|
+
import_v426.z.null(),
|
|
188723
|
+
import_v426.z.string(),
|
|
188724
|
+
import_v426.z.number(),
|
|
188725
|
+
import_v426.z.boolean(),
|
|
188726
|
+
import_v426.z.record(import_v426.z.string(), jsonValueSchema.optional()),
|
|
188727
|
+
import_v426.z.array(jsonValueSchema)
|
|
188631
188728
|
])
|
|
188632
188729
|
);
|
|
188633
188730
|
var providerMetadataSchema = import_v432.z.record(
|
|
@@ -196521,7 +196618,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196521
196618
|
}
|
|
196522
196619
|
}
|
|
196523
196620
|
var originalGenerateId3 = (0, import_provider_utils282.createIdGenerator)({ prefix: "aiobj", size: 24 });
|
|
196524
|
-
async function
|
|
196621
|
+
async function generateObject7(options8) {
|
|
196525
196622
|
const {
|
|
196526
196623
|
model: modelArg,
|
|
196527
196624
|
output = "object",
|
|
@@ -196789,7 +196886,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196789
196886
|
});
|
|
196790
196887
|
}
|
|
196791
196888
|
};
|
|
196792
|
-
var
|
|
196889
|
+
var import_provider_utils302 = require_dist6();
|
|
196793
196890
|
function cosineSimilarity(vector1, vector2) {
|
|
196794
196891
|
if (vector1.length !== vector2.length) {
|
|
196795
196892
|
throw new InvalidArgumentError2({
|
|
@@ -196892,7 +196989,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196892
196989
|
});
|
|
196893
196990
|
}
|
|
196894
196991
|
};
|
|
196895
|
-
var
|
|
196992
|
+
var import_provider_utils292 = require_dist6();
|
|
196896
196993
|
function simulateReadableStream({
|
|
196897
196994
|
chunks,
|
|
196898
196995
|
initialDelayInMs = 0,
|
|
@@ -196900,7 +196997,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196900
196997
|
_internal
|
|
196901
196998
|
}) {
|
|
196902
196999
|
var _a212;
|
|
196903
|
-
const delay22 = (_a212 = _internal == null ? void 0 : _internal.delay) != null ? _a212 :
|
|
197000
|
+
const delay22 = (_a212 = _internal == null ? void 0 : _internal.delay) != null ? _a212 : import_provider_utils292.delay;
|
|
196904
197001
|
let index2 = 0;
|
|
196905
197002
|
return new ReadableStream({
|
|
196906
197003
|
async pull(controller) {
|
|
@@ -196913,7 +197010,7 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
196913
197010
|
}
|
|
196914
197011
|
});
|
|
196915
197012
|
}
|
|
196916
|
-
var originalGenerateId4 = (0,
|
|
197013
|
+
var originalGenerateId4 = (0, import_provider_utils302.createIdGenerator)({ prefix: "aiobj", size: 24 });
|
|
196917
197014
|
function streamObject(options8) {
|
|
196918
197015
|
const {
|
|
196919
197016
|
model,
|
|
@@ -197003,13 +197100,13 @@ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
|
197003
197100
|
currentDate,
|
|
197004
197101
|
now: now2
|
|
197005
197102
|
}) {
|
|
197006
|
-
this._object = new
|
|
197007
|
-
this._usage = new
|
|
197008
|
-
this._providerMetadata = new
|
|
197009
|
-
this._warnings = new
|
|
197010
|
-
this._request = new
|
|
197011
|
-
this._response = new
|
|
197012
|
-
this._finishReason = new
|
|
197103
|
+
this._object = new import_provider_utils302.DelayedPromise();
|
|
197104
|
+
this._usage = new import_provider_utils302.DelayedPromise();
|
|
197105
|
+
this._providerMetadata = new import_provider_utils302.DelayedPromise();
|
|
197106
|
+
this._warnings = new import_provider_utils302.DelayedPromise();
|
|
197107
|
+
this._request = new import_provider_utils302.DelayedPromise();
|
|
197108
|
+
this._response = new import_provider_utils302.DelayedPromise();
|
|
197109
|
+
this._finishReason = new import_provider_utils302.DelayedPromise();
|
|
197013
197110
|
const model = resolveLanguageModel(modelArg);
|
|
197014
197111
|
const { maxRetries, retry } = prepareRetries({
|
|
197015
197112
|
maxRetries: maxRetriesArg,
|
|
@@ -233980,15 +234077,15 @@ var require_lib9 = __commonJS({
|
|
|
233980
234077
|
var require_esprima = __commonJS({
|
|
233981
234078
|
"../../../../node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.js"(exports2, module2) {
|
|
233982
234079
|
init_cjs_shims();
|
|
233983
|
-
(function webpackUniversalModuleDefinition(root3,
|
|
234080
|
+
(function webpackUniversalModuleDefinition(root3, factory12) {
|
|
233984
234081
|
if (typeof exports2 === "object" && typeof module2 === "object")
|
|
233985
|
-
module2.exports =
|
|
234082
|
+
module2.exports = factory12();
|
|
233986
234083
|
else if (typeof define === "function" && define.amd)
|
|
233987
|
-
define([],
|
|
234084
|
+
define([], factory12);
|
|
233988
234085
|
else if (typeof exports2 === "object")
|
|
233989
|
-
exports2["esprima"] =
|
|
234086
|
+
exports2["esprima"] = factory12();
|
|
233990
234087
|
else
|
|
233991
|
-
root3["esprima"] =
|
|
234088
|
+
root3["esprima"] = factory12();
|
|
233992
234089
|
})(exports2, function() {
|
|
233993
234090
|
return (
|
|
233994
234091
|
/******/
|
|
@@ -255746,18 +255843,18 @@ var require_scope2 = __commonJS({
|
|
|
255746
255843
|
var require_sourcemap_codec_umd = __commonJS({
|
|
255747
255844
|
"../../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports2, module2) {
|
|
255748
255845
|
init_cjs_shims();
|
|
255749
|
-
(function(global2,
|
|
255846
|
+
(function(global2, factory12) {
|
|
255750
255847
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
255751
|
-
|
|
255848
|
+
factory12(module2);
|
|
255752
255849
|
module2.exports = def(module2);
|
|
255753
255850
|
} else if (typeof define === "function" && define.amd) {
|
|
255754
255851
|
define(["module"], function(mod2) {
|
|
255755
|
-
|
|
255852
|
+
factory12.apply(this, arguments);
|
|
255756
255853
|
mod2.exports = def(mod2);
|
|
255757
255854
|
});
|
|
255758
255855
|
} else {
|
|
255759
255856
|
const mod2 = { exports: {} };
|
|
255760
|
-
|
|
255857
|
+
factory12(mod2);
|
|
255761
255858
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
255762
255859
|
global2.sourcemapCodec = def(mod2);
|
|
255763
255860
|
}
|
|
@@ -256208,8 +256305,8 @@ var require_sourcemap_codec_umd = __commonJS({
|
|
|
256208
256305
|
var require_resolve_uri_umd = __commonJS({
|
|
256209
256306
|
"../../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports2, module2) {
|
|
256210
256307
|
init_cjs_shims();
|
|
256211
|
-
(function(global2,
|
|
256212
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports =
|
|
256308
|
+
(function(global2, factory12) {
|
|
256309
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory12() : typeof define === "function" && define.amd ? define(factory12) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.resolveURI = factory12());
|
|
256213
256310
|
})(exports2, (function() {
|
|
256214
256311
|
"use strict";
|
|
256215
256312
|
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
@@ -256388,18 +256485,18 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
256388
256485
|
var require_trace_mapping_umd = __commonJS({
|
|
256389
256486
|
"../../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
|
|
256390
256487
|
init_cjs_shims();
|
|
256391
|
-
(function(global2,
|
|
256488
|
+
(function(global2, factory12) {
|
|
256392
256489
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
256393
|
-
|
|
256490
|
+
factory12(module2, require_resolve_uri_umd(), require_sourcemap_codec_umd());
|
|
256394
256491
|
module2.exports = def(module2);
|
|
256395
256492
|
} else if (typeof define === "function" && define.amd) {
|
|
256396
256493
|
define(["module", "@jridgewell/resolve-uri", "@jridgewell/sourcemap-codec"], function(mod2) {
|
|
256397
|
-
|
|
256494
|
+
factory12.apply(this, arguments);
|
|
256398
256495
|
mod2.exports = def(mod2);
|
|
256399
256496
|
});
|
|
256400
256497
|
} else {
|
|
256401
256498
|
const mod2 = { exports: {} };
|
|
256402
|
-
|
|
256499
|
+
factory12(mod2, global2.resolveURI, global2.sourcemapCodec);
|
|
256403
256500
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
256404
256501
|
global2.traceMapping = def(mod2);
|
|
256405
256502
|
}
|
|
@@ -256929,18 +257026,18 @@ var require_trace_mapping_umd = __commonJS({
|
|
|
256929
257026
|
var require_gen_mapping_umd = __commonJS({
|
|
256930
257027
|
"../../../../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"(exports2, module2) {
|
|
256931
257028
|
init_cjs_shims();
|
|
256932
|
-
(function(global2,
|
|
257029
|
+
(function(global2, factory12) {
|
|
256933
257030
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
256934
|
-
|
|
257031
|
+
factory12(module2, require_sourcemap_codec_umd(), require_trace_mapping_umd());
|
|
256935
257032
|
module2.exports = def(module2);
|
|
256936
257033
|
} else if (typeof define === "function" && define.amd) {
|
|
256937
257034
|
define(["module", "@jridgewell/sourcemap-codec", "@jridgewell/trace-mapping"], function(mod2) {
|
|
256938
|
-
|
|
257035
|
+
factory12.apply(this, arguments);
|
|
256939
257036
|
mod2.exports = def(mod2);
|
|
256940
257037
|
});
|
|
256941
257038
|
} else {
|
|
256942
257039
|
const mod2 = { exports: {} };
|
|
256943
|
-
|
|
257040
|
+
factory12(mod2, global2.sourcemapCodec, global2.traceMapping);
|
|
256944
257041
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
256945
257042
|
global2.genMapping = def(mod2);
|
|
256946
257043
|
}
|
|
@@ -257281,18 +257378,18 @@ var require_gen_mapping_umd = __commonJS({
|
|
|
257281
257378
|
var require_trace_mapping_umd2 = __commonJS({
|
|
257282
257379
|
"../../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.30/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
|
|
257283
257380
|
init_cjs_shims();
|
|
257284
|
-
(function(global2,
|
|
257381
|
+
(function(global2, factory12) {
|
|
257285
257382
|
if (typeof exports2 === "object" && typeof module2 !== "undefined") {
|
|
257286
|
-
|
|
257383
|
+
factory12(module2, require_resolve_uri_umd(), require_sourcemap_codec_umd());
|
|
257287
257384
|
module2.exports = def(module2);
|
|
257288
257385
|
} else if (typeof define === "function" && define.amd) {
|
|
257289
257386
|
define(["module", "@jridgewell/resolve-uri", "@jridgewell/sourcemap-codec"], function(mod2) {
|
|
257290
|
-
|
|
257387
|
+
factory12.apply(this, arguments);
|
|
257291
257388
|
mod2.exports = def(mod2);
|
|
257292
257389
|
});
|
|
257293
257390
|
} else {
|
|
257294
257391
|
const mod2 = { exports: {} };
|
|
257295
|
-
|
|
257392
|
+
factory12(mod2, global2.resolveURI, global2.sourcemapCodec);
|
|
257296
257393
|
global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
|
|
257297
257394
|
global2.traceMapping = def(mod2);
|
|
257298
257395
|
}
|
|
@@ -292475,8 +292572,8 @@ var require_utils24 = __commonJS({
|
|
|
292475
292572
|
var require_acorn = __commonJS({
|
|
292476
292573
|
"../../../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.js"(exports2, module2) {
|
|
292477
292574
|
init_cjs_shims();
|
|
292478
|
-
(function(global2,
|
|
292479
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
292575
|
+
(function(global2, factory12) {
|
|
292576
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory12(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory12) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory12(global2.acorn = {}));
|
|
292480
292577
|
})(exports2, (function(exports3) {
|
|
292481
292578
|
"use strict";
|
|
292482
292579
|
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];
|
|
@@ -332632,11 +332729,11 @@ var require_ignore = __commonJS({
|
|
|
332632
332729
|
return this._test(path77, this._testCache, true);
|
|
332633
332730
|
}
|
|
332634
332731
|
};
|
|
332635
|
-
var
|
|
332732
|
+
var factory12 = (options8) => new Ignore2(options8);
|
|
332636
332733
|
var isPathValid = (path77) => checkPath(path77 && checkPath.convert(path77), path77, RETURN_FALSE);
|
|
332637
|
-
|
|
332638
|
-
|
|
332639
|
-
module2.exports =
|
|
332734
|
+
factory12.isPathValid = isPathValid;
|
|
332735
|
+
factory12.default = factory12;
|
|
332736
|
+
module2.exports = factory12;
|
|
332640
332737
|
if (
|
|
332641
332738
|
// Detect `process` so that it can run in browsers.
|
|
332642
332739
|
typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
|
|
@@ -351585,7 +351682,7 @@ var require_token_store = __commonJS({
|
|
|
351585
351682
|
}
|
|
351586
351683
|
return map3;
|
|
351587
351684
|
}
|
|
351588
|
-
function createCursorWithSkip(
|
|
351685
|
+
function createCursorWithSkip(factory12, tokens, comments, indexMap, startLoc, endLoc, opts) {
|
|
351589
351686
|
let includeComments = false;
|
|
351590
351687
|
let skip2 = 0;
|
|
351591
351688
|
let filter9 = null;
|
|
@@ -351603,7 +351700,7 @@ var require_token_store = __commonJS({
|
|
|
351603
351700
|
!filter9 || typeof filter9 === "function",
|
|
351604
351701
|
"options.filter should be a function."
|
|
351605
351702
|
);
|
|
351606
|
-
return
|
|
351703
|
+
return factory12.createCursor(
|
|
351607
351704
|
tokens,
|
|
351608
351705
|
comments,
|
|
351609
351706
|
indexMap,
|
|
@@ -351615,7 +351712,7 @@ var require_token_store = __commonJS({
|
|
|
351615
351712
|
-1
|
|
351616
351713
|
);
|
|
351617
351714
|
}
|
|
351618
|
-
function createCursorWithCount(
|
|
351715
|
+
function createCursorWithCount(factory12, tokens, comments, indexMap, startLoc, endLoc, opts) {
|
|
351619
351716
|
let includeComments = false;
|
|
351620
351717
|
let count = 0;
|
|
351621
351718
|
let countExists = false;
|
|
@@ -351636,7 +351733,7 @@ var require_token_store = __commonJS({
|
|
|
351636
351733
|
!filter9 || typeof filter9 === "function",
|
|
351637
351734
|
"options.filter should be a function."
|
|
351638
351735
|
);
|
|
351639
|
-
return
|
|
351736
|
+
return factory12.createCursor(
|
|
351640
351737
|
tokens,
|
|
351641
351738
|
comments,
|
|
351642
351739
|
indexMap,
|
|
@@ -355716,7 +355813,7 @@ var require_Num = __commonJS({
|
|
|
355716
355813
|
var acos;
|
|
355717
355814
|
var atan;
|
|
355718
355815
|
var atan2;
|
|
355719
|
-
var
|
|
355816
|
+
var truncate2;
|
|
355720
355817
|
var round;
|
|
355721
355818
|
var ceiling;
|
|
355722
355819
|
var floor;
|
|
@@ -355777,7 +355874,7 @@ var require_Num = __commonJS({
|
|
|
355777
355874
|
atan2 = curry$(function(x, y) {
|
|
355778
355875
|
return Math.atan2(x, y);
|
|
355779
355876
|
});
|
|
355780
|
-
|
|
355877
|
+
truncate2 = function(x) {
|
|
355781
355878
|
return ~~x;
|
|
355782
355879
|
};
|
|
355783
355880
|
round = Math.round;
|
|
@@ -355830,7 +355927,7 @@ var require_Num = __commonJS({
|
|
|
355830
355927
|
asin,
|
|
355831
355928
|
atan,
|
|
355832
355929
|
atan2,
|
|
355833
|
-
truncate,
|
|
355930
|
+
truncate: truncate2,
|
|
355834
355931
|
round,
|
|
355835
355932
|
ceiling,
|
|
355836
355933
|
floor,
|
|
@@ -381182,7 +381279,7 @@ var require_config_loader = __commonJS({
|
|
|
381182
381279
|
* @returns {Promise<{createJiti: Function|undefined, version: string;}>} A promise that fulfills with an object containing the jiti module's createJiti function and version.
|
|
381183
381280
|
*/
|
|
381184
381281
|
static async loadJiti() {
|
|
381185
|
-
const { createJiti } = await import("./jiti-
|
|
381282
|
+
const { createJiti } = await import("./jiti-X73LQAEX.js");
|
|
381186
381283
|
const version5 = require_package6().version;
|
|
381187
381284
|
return { createJiti, version: version5 };
|
|
381188
381285
|
}
|
|
@@ -381511,7 +381608,7 @@ var require_eslint_helpers = __commonJS({
|
|
|
381511
381608
|
}
|
|
381512
381609
|
async function globMatch({ basePath, pattern }) {
|
|
381513
381610
|
let found = false;
|
|
381514
|
-
const { hfs } = await import("./src-
|
|
381611
|
+
const { hfs } = await import("./src-67P7IHOU.js");
|
|
381515
381612
|
const patternToUse = normalizeToPosix(path77.relative(basePath, pattern));
|
|
381516
381613
|
const matcher = new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
|
|
381517
381614
|
const walkSettings = {
|
|
@@ -381551,7 +381648,7 @@ var require_eslint_helpers = __commonJS({
|
|
|
381551
381648
|
return new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
|
|
381552
381649
|
});
|
|
381553
381650
|
const unmatchedPatterns = /* @__PURE__ */ new Set([...relativeToPatterns.keys()]);
|
|
381554
|
-
const { hfs } = await import("./src-
|
|
381651
|
+
const { hfs } = await import("./src-67P7IHOU.js");
|
|
381555
381652
|
const walk2 = hfs.walk(basePath, {
|
|
381556
381653
|
async directoryFilter(entry) {
|
|
381557
381654
|
if (!matchers.some((matcher) => matcher.match(entry.path, true))) {
|
|
@@ -382574,7 +382671,7 @@ var require_eslint = __commonJS({
|
|
|
382574
382671
|
"../../../../node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules/eslint/lib/eslint/eslint.js"(exports2, module2) {
|
|
382575
382672
|
"use strict";
|
|
382576
382673
|
init_cjs_shims();
|
|
382577
|
-
var { existsSync:
|
|
382674
|
+
var { existsSync: existsSync6 } = __require("node:fs");
|
|
382578
382675
|
var fs44 = __require("node:fs/promises");
|
|
382579
382676
|
var os8 = __require("node:os");
|
|
382580
382677
|
var path77 = __require("node:path");
|
|
@@ -382982,7 +383079,7 @@ var require_eslint = __commonJS({
|
|
|
382982
383079
|
configLoader: this.#configLoader,
|
|
382983
383080
|
warningService
|
|
382984
383081
|
});
|
|
382985
|
-
if (
|
|
383082
|
+
if (existsSync6(path77.resolve(processedOptions.cwd, ".eslintignore"))) {
|
|
382986
383083
|
warningService.emitESLintIgnoreWarning();
|
|
382987
383084
|
}
|
|
382988
383085
|
}
|
|
@@ -383150,11 +383247,11 @@ var require_eslint = __commonJS({
|
|
|
383150
383247
|
if (!lintResultCache && cacheFilePath) {
|
|
383151
383248
|
debug3(`Deleting cache file at ${cacheFilePath}`);
|
|
383152
383249
|
try {
|
|
383153
|
-
if (
|
|
383250
|
+
if (existsSync6(cacheFilePath)) {
|
|
383154
383251
|
await fs44.unlink(cacheFilePath);
|
|
383155
383252
|
}
|
|
383156
383253
|
} catch (error40) {
|
|
383157
|
-
if (
|
|
383254
|
+
if (existsSync6(cacheFilePath)) {
|
|
383158
383255
|
throw error40;
|
|
383159
383256
|
}
|
|
383160
383257
|
}
|
|
@@ -390530,8 +390627,8 @@ var require_readdir_glob = __commonJS({
|
|
|
390530
390627
|
var require_async9 = __commonJS({
|
|
390531
390628
|
"../../../../node_modules/.pnpm/async@3.2.6/node_modules/async/dist/async.js"(exports2, module2) {
|
|
390532
390629
|
init_cjs_shims();
|
|
390533
|
-
(function(global2,
|
|
390534
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ?
|
|
390630
|
+
(function(global2, factory12) {
|
|
390631
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory12(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory12) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory12(global2.async = {}));
|
|
390535
390632
|
})(exports2, (function(exports3) {
|
|
390536
390633
|
"use strict";
|
|
390537
390634
|
function apply(fn, ...args) {
|
|
@@ -408863,21 +408960,21 @@ var require_crc32 = __commonJS({
|
|
|
408863
408960
|
"../../../../node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/crc32.js"(exports2) {
|
|
408864
408961
|
init_cjs_shims();
|
|
408865
408962
|
var CRC32;
|
|
408866
|
-
(function(
|
|
408963
|
+
(function(factory12) {
|
|
408867
408964
|
if (typeof DO_NOT_EXPORT_CRC === "undefined") {
|
|
408868
408965
|
if ("object" === typeof exports2) {
|
|
408869
|
-
|
|
408966
|
+
factory12(exports2);
|
|
408870
408967
|
} else if ("function" === typeof define && define.amd) {
|
|
408871
408968
|
define(function() {
|
|
408872
408969
|
var module3 = {};
|
|
408873
|
-
|
|
408970
|
+
factory12(module3);
|
|
408874
408971
|
return module3;
|
|
408875
408972
|
});
|
|
408876
408973
|
} else {
|
|
408877
|
-
|
|
408974
|
+
factory12(CRC32 = {});
|
|
408878
408975
|
}
|
|
408879
408976
|
} else {
|
|
408880
|
-
|
|
408977
|
+
factory12(CRC32 = {});
|
|
408881
408978
|
}
|
|
408882
408979
|
})(function(CRC322) {
|
|
408883
408980
|
CRC322.version = "1.2.2";
|
|
@@ -444605,7 +444702,7 @@ var require_pool2 = __commonJS({
|
|
|
444605
444702
|
var Pool = class extends PoolBase {
|
|
444606
444703
|
constructor(origin2, {
|
|
444607
444704
|
connections,
|
|
444608
|
-
factory:
|
|
444705
|
+
factory: factory12 = defaultFactory,
|
|
444609
444706
|
connect,
|
|
444610
444707
|
connectTimeout,
|
|
444611
444708
|
tls,
|
|
@@ -444620,7 +444717,7 @@ var require_pool2 = __commonJS({
|
|
|
444620
444717
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
|
|
444621
444718
|
throw new InvalidArgumentError2("invalid connections");
|
|
444622
444719
|
}
|
|
444623
|
-
if (typeof
|
|
444720
|
+
if (typeof factory12 !== "function") {
|
|
444624
444721
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444625
444722
|
}
|
|
444626
444723
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
@@ -444642,7 +444739,7 @@ var require_pool2 = __commonJS({
|
|
|
444642
444739
|
this[kUrl] = util5.parseOrigin(origin2);
|
|
444643
444740
|
this[kOptions] = { ...util5.deepClone(options8), connect, allowH2, clientTtl };
|
|
444644
444741
|
this[kOptions].interceptors = options8.interceptors ? { ...options8.interceptors } : void 0;
|
|
444645
|
-
this[kFactory] =
|
|
444742
|
+
this[kFactory] = factory12;
|
|
444646
444743
|
this.on("connect", (origin3, targets) => {
|
|
444647
444744
|
if (clientTtl != null && clientTtl > 0) {
|
|
444648
444745
|
for (const target of targets) {
|
|
@@ -444720,8 +444817,8 @@ var require_balanced_pool = __commonJS({
|
|
|
444720
444817
|
return new Pool(origin2, opts);
|
|
444721
444818
|
}
|
|
444722
444819
|
var BalancedPool = class extends PoolBase {
|
|
444723
|
-
constructor(upstreams = [], { factory:
|
|
444724
|
-
if (typeof
|
|
444820
|
+
constructor(upstreams = [], { factory: factory12 = defaultFactory, ...opts } = {}) {
|
|
444821
|
+
if (typeof factory12 !== "function") {
|
|
444725
444822
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444726
444823
|
}
|
|
444727
444824
|
super();
|
|
@@ -444733,7 +444830,7 @@ var require_balanced_pool = __commonJS({
|
|
|
444733
444830
|
if (!Array.isArray(upstreams)) {
|
|
444734
444831
|
upstreams = [upstreams];
|
|
444735
444832
|
}
|
|
444736
|
-
this[kFactory] =
|
|
444833
|
+
this[kFactory] = factory12;
|
|
444737
444834
|
for (const upstream of upstreams) {
|
|
444738
444835
|
this.addUpstream(upstream);
|
|
444739
444836
|
}
|
|
@@ -444857,7 +444954,7 @@ var require_round_robin_pool = __commonJS({
|
|
|
444857
444954
|
var RoundRobinPool = class extends PoolBase {
|
|
444858
444955
|
constructor(origin2, {
|
|
444859
444956
|
connections,
|
|
444860
|
-
factory:
|
|
444957
|
+
factory: factory12 = defaultFactory,
|
|
444861
444958
|
connect,
|
|
444862
444959
|
connectTimeout,
|
|
444863
444960
|
tls,
|
|
@@ -444872,7 +444969,7 @@ var require_round_robin_pool = __commonJS({
|
|
|
444872
444969
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
|
|
444873
444970
|
throw new InvalidArgumentError2("invalid connections");
|
|
444874
444971
|
}
|
|
444875
|
-
if (typeof
|
|
444972
|
+
if (typeof factory12 !== "function") {
|
|
444876
444973
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444877
444974
|
}
|
|
444878
444975
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
@@ -444894,7 +444991,7 @@ var require_round_robin_pool = __commonJS({
|
|
|
444894
444991
|
this[kUrl] = util5.parseOrigin(origin2);
|
|
444895
444992
|
this[kOptions] = { ...util5.deepClone(options8), connect, allowH2, clientTtl };
|
|
444896
444993
|
this[kOptions].interceptors = options8.interceptors ? { ...options8.interceptors } : void 0;
|
|
444897
|
-
this[kFactory] =
|
|
444994
|
+
this[kFactory] = factory12;
|
|
444898
444995
|
this[kIndex] = -1;
|
|
444899
444996
|
this.on("connect", (origin3, targets) => {
|
|
444900
444997
|
if (clientTtl != null && clientTtl > 0) {
|
|
@@ -444967,8 +445064,8 @@ var require_agent4 = __commonJS({
|
|
|
444967
445064
|
return opts && opts.connections === 1 ? new Client2(origin2, opts) : new Pool(origin2, opts);
|
|
444968
445065
|
}
|
|
444969
445066
|
var Agent3 = class extends DispatcherBase {
|
|
444970
|
-
constructor({ factory:
|
|
444971
|
-
if (typeof
|
|
445067
|
+
constructor({ factory: factory12 = defaultFactory, maxOrigins = Infinity, connect, ...options8 } = {}) {
|
|
445068
|
+
if (typeof factory12 !== "function") {
|
|
444972
445069
|
throw new InvalidArgumentError2("factory must be a function.");
|
|
444973
445070
|
}
|
|
444974
445071
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
@@ -444982,7 +445079,7 @@ var require_agent4 = __commonJS({
|
|
|
444982
445079
|
connect = { ...connect };
|
|
444983
445080
|
}
|
|
444984
445081
|
this[kOptions] = { ...util5.deepClone(options8), maxOrigins, connect };
|
|
444985
|
-
this[kFactory] =
|
|
445082
|
+
this[kFactory] = factory12;
|
|
444986
445083
|
this[kClients] = /* @__PURE__ */ new Map();
|
|
444987
445084
|
this[kOrigins] = /* @__PURE__ */ new Set();
|
|
444988
445085
|
this[kOnDrain] = (origin2, targets) => {
|
|
@@ -445113,14 +445210,14 @@ var require_proxy_agent = __commonJS({
|
|
|
445113
445210
|
}
|
|
445114
445211
|
var Http1ProxyWrapper = class extends DispatcherBase {
|
|
445115
445212
|
#client;
|
|
445116
|
-
constructor(proxyUrl, { headers = {}, connect, factory:
|
|
445213
|
+
constructor(proxyUrl, { headers = {}, connect, factory: factory12 }) {
|
|
445117
445214
|
if (!proxyUrl) {
|
|
445118
445215
|
throw new InvalidArgumentError2("Proxy URL is mandatory");
|
|
445119
445216
|
}
|
|
445120
445217
|
super();
|
|
445121
445218
|
this[kProxyHeaders] = headers;
|
|
445122
|
-
if (
|
|
445123
|
-
this.#client =
|
|
445219
|
+
if (factory12) {
|
|
445220
|
+
this.#client = factory12(proxyUrl, { connect });
|
|
445124
445221
|
} else {
|
|
445125
445222
|
this.#client = new Client2(proxyUrl, { connect });
|
|
445126
445223
|
}
|
|
@@ -445186,7 +445283,7 @@ var require_proxy_agent = __commonJS({
|
|
|
445186
445283
|
const connect = buildConnector({ ...opts.proxyTls });
|
|
445187
445284
|
this[kConnectEndpoint] = buildConnector({ ...opts.requestTls });
|
|
445188
445285
|
const agentFactory = opts.factory || defaultAgentFactory;
|
|
445189
|
-
const
|
|
445286
|
+
const factory12 = (origin3, options8) => {
|
|
445190
445287
|
const { protocol: protocol2 } = new URL(origin3);
|
|
445191
445288
|
if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") {
|
|
445192
445289
|
return new Http1ProxyWrapper(this[kProxy].uri, {
|
|
@@ -445200,7 +445297,7 @@ var require_proxy_agent = __commonJS({
|
|
|
445200
445297
|
this[kClient] = clientFactory(url4, { connect });
|
|
445201
445298
|
this[kAgent] = new Agent3({
|
|
445202
445299
|
...opts,
|
|
445203
|
-
factory:
|
|
445300
|
+
factory: factory12,
|
|
445204
445301
|
connect: async (opts2, callback) => {
|
|
445205
445302
|
let requestedPath = opts2.host;
|
|
445206
445303
|
if (!opts2.port) {
|
|
@@ -446477,7 +446574,7 @@ var require_api_stream = __commonJS({
|
|
|
446477
446574
|
function noop7() {
|
|
446478
446575
|
}
|
|
446479
446576
|
var StreamHandler = class extends AsyncResource {
|
|
446480
|
-
constructor(opts,
|
|
446577
|
+
constructor(opts, factory12, callback) {
|
|
446481
446578
|
if (!opts || typeof opts !== "object") {
|
|
446482
446579
|
throw new InvalidArgumentError2("invalid opts");
|
|
446483
446580
|
}
|
|
@@ -446486,7 +446583,7 @@ var require_api_stream = __commonJS({
|
|
|
446486
446583
|
if (typeof callback !== "function") {
|
|
446487
446584
|
throw new InvalidArgumentError2("invalid callback");
|
|
446488
446585
|
}
|
|
446489
|
-
if (typeof
|
|
446586
|
+
if (typeof factory12 !== "function") {
|
|
446490
446587
|
throw new InvalidArgumentError2("invalid factory");
|
|
446491
446588
|
}
|
|
446492
446589
|
if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") {
|
|
@@ -446507,7 +446604,7 @@ var require_api_stream = __commonJS({
|
|
|
446507
446604
|
}
|
|
446508
446605
|
this.responseHeaders = responseHeaders || null;
|
|
446509
446606
|
this.opaque = opaque || null;
|
|
446510
|
-
this.factory =
|
|
446607
|
+
this.factory = factory12;
|
|
446511
446608
|
this.callback = callback;
|
|
446512
446609
|
this.res = null;
|
|
446513
446610
|
this.abort = null;
|
|
@@ -446532,7 +446629,7 @@ var require_api_stream = __commonJS({
|
|
|
446532
446629
|
this.context = context;
|
|
446533
446630
|
}
|
|
446534
446631
|
onHeaders(statusCode, rawHeaders, resume, statusMessage) {
|
|
446535
|
-
const { factory:
|
|
446632
|
+
const { factory: factory12, opaque, context, responseHeaders } = this;
|
|
446536
446633
|
const headers = responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
|
|
446537
446634
|
if (statusCode < 200) {
|
|
446538
446635
|
if (this.onInfo) {
|
|
@@ -446541,10 +446638,10 @@ var require_api_stream = __commonJS({
|
|
|
446541
446638
|
return;
|
|
446542
446639
|
}
|
|
446543
446640
|
this.factory = null;
|
|
446544
|
-
if (
|
|
446641
|
+
if (factory12 === null) {
|
|
446545
446642
|
return;
|
|
446546
446643
|
}
|
|
446547
|
-
const res = this.runInAsyncScope(
|
|
446644
|
+
const res = this.runInAsyncScope(factory12, null, {
|
|
446548
446645
|
statusCode,
|
|
446549
446646
|
headers,
|
|
446550
446647
|
opaque,
|
|
@@ -446602,16 +446699,16 @@ var require_api_stream = __commonJS({
|
|
|
446602
446699
|
}
|
|
446603
446700
|
}
|
|
446604
446701
|
};
|
|
446605
|
-
function stream5(opts,
|
|
446702
|
+
function stream5(opts, factory12, callback) {
|
|
446606
446703
|
if (callback === void 0) {
|
|
446607
446704
|
return new Promise((resolve9, reject) => {
|
|
446608
|
-
stream5.call(this, opts,
|
|
446705
|
+
stream5.call(this, opts, factory12, (err, data3) => {
|
|
446609
446706
|
return err ? reject(err) : resolve9(data3);
|
|
446610
446707
|
});
|
|
446611
446708
|
});
|
|
446612
446709
|
}
|
|
446613
446710
|
try {
|
|
446614
|
-
const handler = new StreamHandler(opts,
|
|
446711
|
+
const handler = new StreamHandler(opts, factory12, callback);
|
|
446615
446712
|
this.dispatch(opts, handler);
|
|
446616
446713
|
} catch (err) {
|
|
446617
446714
|
if (typeof callback !== "function") {
|
|
@@ -483969,10 +484066,10 @@ var require_full = __commonJS({
|
|
|
483969
484066
|
const externalDependencies = [];
|
|
483970
484067
|
let item = value2;
|
|
483971
484068
|
if (typeof value2 === "function") {
|
|
483972
|
-
const
|
|
484069
|
+
const factory12 = (0, _async.maybeAsync)(value2, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
|
|
483973
484070
|
const api = Object.assign({}, context, apiFactory(cache3, externalDependencies));
|
|
483974
484071
|
try {
|
|
483975
|
-
item = yield*
|
|
484072
|
+
item = yield* factory12(api, options8, dirname19);
|
|
483976
484073
|
} catch (e) {
|
|
483977
484074
|
if (alias) {
|
|
483978
484075
|
e.message += ` (While processing: ${JSON.stringify(alias)})`;
|
|
@@ -485188,8 +485285,8 @@ var require_normalize_file = __commonJS({
|
|
|
485188
485285
|
var require_remapping_umd = __commonJS({
|
|
485189
485286
|
"../../../../node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/dist/remapping.umd.js"(exports2, module2) {
|
|
485190
485287
|
init_cjs_shims();
|
|
485191
|
-
(function(global2,
|
|
485192
|
-
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports =
|
|
485288
|
+
(function(global2, factory12) {
|
|
485289
|
+
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory12(require_trace_mapping_umd(), require_gen_mapping_umd()) : typeof define === "function" && define.amd ? define(["@jridgewell/trace-mapping", "@jridgewell/gen-mapping"], factory12) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.remapping = factory12(global2.traceMapping, global2.genMapping));
|
|
485193
485290
|
})(exports2, (function(traceMapping, genMapping) {
|
|
485194
485291
|
"use strict";
|
|
485195
485292
|
const SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
|
|
@@ -511693,7 +511790,7 @@ var require_axios = __commonJS({
|
|
|
511693
511790
|
return false;
|
|
511694
511791
|
}
|
|
511695
511792
|
};
|
|
511696
|
-
var
|
|
511793
|
+
var factory12 = (env2) => {
|
|
511697
511794
|
env2 = utils$1.merge.call({
|
|
511698
511795
|
skipUndefined: true
|
|
511699
511796
|
}, globalFetchAPI2, env2);
|
|
@@ -511877,7 +511974,7 @@ var require_axios = __commonJS({
|
|
|
511877
511974
|
while (i--) {
|
|
511878
511975
|
seed = seeds[i];
|
|
511879
511976
|
target = map3.get(seed);
|
|
511880
|
-
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() :
|
|
511977
|
+
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() : factory12(env2));
|
|
511881
511978
|
map3 = target;
|
|
511882
511979
|
}
|
|
511883
511980
|
return target;
|
|
@@ -520524,7 +520621,7 @@ init_cjs_shims();
|
|
|
520524
520621
|
// ../sdk/package.json
|
|
520525
520622
|
var package_default = {
|
|
520526
520623
|
name: "@superblocksteam/sdk",
|
|
520527
|
-
version: "2.0.
|
|
520624
|
+
version: "2.0.111",
|
|
520528
520625
|
description: "Superblocks JS SDK",
|
|
520529
520626
|
homepage: "https://www.superblocks.com",
|
|
520530
520627
|
license: "Superblocks Community Software License",
|
|
@@ -520878,7 +520975,7 @@ var config = void 0;
|
|
|
520878
520975
|
var configured = false;
|
|
520879
520976
|
var ddTracePromise = void 0;
|
|
520880
520977
|
async function getDdTrace() {
|
|
520881
|
-
ddTracePromise ??= import("./dd-trace-
|
|
520978
|
+
ddTracePromise ??= import("./dd-trace-5BYOFB5K.js").then((module2) => module2.default);
|
|
520882
520979
|
return await ddTracePromise;
|
|
520883
520980
|
}
|
|
520884
520981
|
var deploymentType = (() => {
|
|
@@ -524919,7 +525016,7 @@ init_cjs_shims();
|
|
|
524919
525016
|
|
|
524920
525017
|
// ../../../vite-plugin-file-sync/dist/ai-service/index.js
|
|
524921
525018
|
init_cjs_shims();
|
|
524922
|
-
var
|
|
525019
|
+
var import_ai17 = __toESM(require_dist9(), 1);
|
|
524923
525020
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
524924
525021
|
import os5 from "node:os";
|
|
524925
525022
|
import path51 from "node:path";
|
|
@@ -529014,11 +529111,12 @@ var AiEntityType;
|
|
|
529014
529111
|
AiEntityType2["BLOCK"] = "block";
|
|
529015
529112
|
})(AiEntityType || (AiEntityType = {}));
|
|
529016
529113
|
var MODEL_CAPABILITIES = {
|
|
529017
|
-
"claude-
|
|
529018
|
-
"claude-sonnet-4-6": { maxOutputTokens: 128e3 },
|
|
529114
|
+
"claude-haiku-4-5": { maxOutputTokens: 64e3 },
|
|
529019
529115
|
"claude-opus-4-5": { maxOutputTokens: 64e3 },
|
|
529020
529116
|
"claude-opus-4-6": { maxOutputTokens: 128e3 },
|
|
529021
|
-
"claude-
|
|
529117
|
+
"claude-opus-4-7": { maxOutputTokens: 128e3 },
|
|
529118
|
+
"claude-sonnet-4-5": { maxOutputTokens: 64e3 },
|
|
529119
|
+
"claude-sonnet-4-6": { maxOutputTokens: 128e3 }
|
|
529022
529120
|
};
|
|
529023
529121
|
var MAX_OUTPUT_TOKENS = 48e3;
|
|
529024
529122
|
var DEFAULT_CONTEXT_OPTIONS_V2 = {
|
|
@@ -529048,6 +529146,83 @@ var EXCLUDED_MESSAGE_TYPES = [
|
|
|
529048
529146
|
"commitRestoring",
|
|
529049
529147
|
"git_setup_required"
|
|
529050
529148
|
];
|
|
529149
|
+
var NEXT_STEPS_ICON_NAMES = [
|
|
529150
|
+
"alert-triangle",
|
|
529151
|
+
"arrow-right-left",
|
|
529152
|
+
"arrow-up-down",
|
|
529153
|
+
"bar-chart-3",
|
|
529154
|
+
"bell",
|
|
529155
|
+
"bookmark",
|
|
529156
|
+
"calendar",
|
|
529157
|
+
"check",
|
|
529158
|
+
"check-circle",
|
|
529159
|
+
"circle-user",
|
|
529160
|
+
"clipboard",
|
|
529161
|
+
"clock",
|
|
529162
|
+
"cloud",
|
|
529163
|
+
"code",
|
|
529164
|
+
"copy",
|
|
529165
|
+
"database",
|
|
529166
|
+
"download",
|
|
529167
|
+
"external-link",
|
|
529168
|
+
"eye",
|
|
529169
|
+
"file-down",
|
|
529170
|
+
"file-plus",
|
|
529171
|
+
"file-text",
|
|
529172
|
+
"filter",
|
|
529173
|
+
"folder",
|
|
529174
|
+
"git-branch",
|
|
529175
|
+
"globe",
|
|
529176
|
+
"grip-vertical",
|
|
529177
|
+
"hard-drive",
|
|
529178
|
+
"heart",
|
|
529179
|
+
"home",
|
|
529180
|
+
"image",
|
|
529181
|
+
"info",
|
|
529182
|
+
"key",
|
|
529183
|
+
"layers",
|
|
529184
|
+
"layout-grid",
|
|
529185
|
+
"line-chart",
|
|
529186
|
+
"link",
|
|
529187
|
+
"list",
|
|
529188
|
+
"lock",
|
|
529189
|
+
"log-out",
|
|
529190
|
+
"mail",
|
|
529191
|
+
"map",
|
|
529192
|
+
"message-square",
|
|
529193
|
+
"monitor",
|
|
529194
|
+
"moon",
|
|
529195
|
+
"package",
|
|
529196
|
+
"palette",
|
|
529197
|
+
"pencil",
|
|
529198
|
+
"pie-chart",
|
|
529199
|
+
"plus",
|
|
529200
|
+
"printer",
|
|
529201
|
+
"puzzle",
|
|
529202
|
+
"refresh-cw",
|
|
529203
|
+
"repeat",
|
|
529204
|
+
"rocket",
|
|
529205
|
+
"save",
|
|
529206
|
+
"search",
|
|
529207
|
+
"server",
|
|
529208
|
+
"settings",
|
|
529209
|
+
"share-2",
|
|
529210
|
+
"shield",
|
|
529211
|
+
"sliders",
|
|
529212
|
+
"smartphone",
|
|
529213
|
+
"sparkles",
|
|
529214
|
+
"star",
|
|
529215
|
+
"table",
|
|
529216
|
+
"tag",
|
|
529217
|
+
"thumbs-up",
|
|
529218
|
+
"toggle-left",
|
|
529219
|
+
"trash-2",
|
|
529220
|
+
"upload",
|
|
529221
|
+
"user-plus",
|
|
529222
|
+
"users",
|
|
529223
|
+
"wand-2",
|
|
529224
|
+
"zap"
|
|
529225
|
+
];
|
|
529051
529226
|
var DEFAULT_ATTACHMENT_FILE_NAME = "Attachment";
|
|
529052
529227
|
function fallbackFileNameForImageMime(mtLower) {
|
|
529053
529228
|
const match2 = /^image\/([^;\s]+)/i.exec(mtLower);
|
|
@@ -529273,10 +529448,10 @@ var PermissionLevel;
|
|
|
529273
529448
|
PermissionLevel2["PROMPT"] = "prompt";
|
|
529274
529449
|
PermissionLevel2["BLOCK"] = "block";
|
|
529275
529450
|
})(PermissionLevel || (PermissionLevel = {}));
|
|
529276
|
-
function createToolFactory(name17,
|
|
529451
|
+
function createToolFactory(name17, factory12) {
|
|
529277
529452
|
return {
|
|
529278
529453
|
name: name17,
|
|
529279
|
-
create: (deps) => ({ ...
|
|
529454
|
+
create: (deps) => ({ ...factory12(deps), name: name17 })
|
|
529280
529455
|
};
|
|
529281
529456
|
}
|
|
529282
529457
|
var ToolExecutionError = class _ToolExecutionError extends Error {
|
|
@@ -529762,6 +529937,9 @@ function getTotalInputTokens(usage) {
|
|
|
529762
529937
|
}
|
|
529763
529938
|
return usage.inputTokens ?? nonCached;
|
|
529764
529939
|
}
|
|
529940
|
+
function computeContextUsed(usage) {
|
|
529941
|
+
return getTotalInputTokens(usage);
|
|
529942
|
+
}
|
|
529765
529943
|
function getTotalTokens(usage) {
|
|
529766
529944
|
const recomputedTotal = getTotalInputTokens(usage) + (usage.outputTokens ?? 0);
|
|
529767
529945
|
const hasDetailedBreakdown = usage.inputTokenDetails?.noCacheTokens !== void 0 || usage.inputTokenDetails?.cacheReadTokens !== void 0 || usage.inputTokenDetails?.cacheWriteTokens !== void 0;
|
|
@@ -529823,15 +530001,59 @@ function getActiveContext(clark, services) {
|
|
|
529823
530001
|
|
|
529824
530002
|
// ../../../vite-plugin-file-sync/dist/ai-service/util/llm-config-utils.js
|
|
529825
530003
|
init_cjs_shims();
|
|
530004
|
+
var INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
|
|
530005
|
+
var EFFORT_BETA = "effort-2025-11-24";
|
|
530006
|
+
var ADAPTIVE_EFFORT_MODELS = /* @__PURE__ */ new Set(["claude-opus-4-7"]);
|
|
530007
|
+
var HARDCODED_EFFORT = "high";
|
|
530008
|
+
function usesAdaptiveEffort(coreModel) {
|
|
530009
|
+
return coreModel !== void 0 && ADAPTIVE_EFFORT_MODELS.has(coreModel);
|
|
530010
|
+
}
|
|
530011
|
+
function buildThinkingProviderOptions(coreModel, params) {
|
|
530012
|
+
const { thinkingEnabled, thinkingBudgetTokens, interleavedThinking } = params;
|
|
530013
|
+
if (usesAdaptiveEffort(coreModel)) {
|
|
530014
|
+
const anthropic3 = {
|
|
530015
|
+
thinking: { type: "adaptive", display: "summarized" },
|
|
530016
|
+
effort: HARDCODED_EFFORT
|
|
530017
|
+
};
|
|
530018
|
+
const bedrockBetas = [EFFORT_BETA];
|
|
530019
|
+
if (interleavedThinking) {
|
|
530020
|
+
bedrockBetas.push(INTERLEAVED_THINKING_BETA);
|
|
530021
|
+
}
|
|
530022
|
+
const bedrock2 = {
|
|
530023
|
+
additionalModelRequestFields: {
|
|
530024
|
+
thinking: { type: "adaptive", display: "summarized" },
|
|
530025
|
+
output_config: { effort: HARDCODED_EFFORT },
|
|
530026
|
+
anthropic_beta: bedrockBetas
|
|
530027
|
+
}
|
|
530028
|
+
};
|
|
530029
|
+
const headers2 = interleavedThinking ? { "anthropic-beta": INTERLEAVED_THINKING_BETA } : {};
|
|
530030
|
+
return { anthropic: anthropic3, bedrock: bedrock2, headers: headers2 };
|
|
530031
|
+
}
|
|
530032
|
+
if (!thinkingEnabled) {
|
|
530033
|
+
return { headers: {} };
|
|
530034
|
+
}
|
|
530035
|
+
const anthropic2 = {
|
|
530036
|
+
thinking: { type: "enabled", budgetTokens: thinkingBudgetTokens }
|
|
530037
|
+
};
|
|
530038
|
+
const bedrock = {
|
|
530039
|
+
additionalModelRequestFields: {
|
|
530040
|
+
thinking: { type: "enabled", budget_tokens: thinkingBudgetTokens },
|
|
530041
|
+
anthropic_beta: [INTERLEAVED_THINKING_BETA]
|
|
530042
|
+
}
|
|
530043
|
+
};
|
|
530044
|
+
const headers = interleavedThinking ? { "anthropic-beta": INTERLEAVED_THINKING_BETA } : {};
|
|
530045
|
+
return { anthropic: anthropic2, bedrock, headers };
|
|
530046
|
+
}
|
|
529826
530047
|
function processLLMConfig(llmConfig, defaultBudgetTokens = 5e3, logContext) {
|
|
529827
530048
|
const logger15 = getLogger3();
|
|
529828
530049
|
const thinkingEnabled = llmConfig?.thinkingEnabled ?? true;
|
|
529829
530050
|
let thinkingBudgetTokens = llmConfig?.thinkingBudgetTokens ? parseInt(llmConfig.thinkingBudgetTokens) : defaultBudgetTokens;
|
|
529830
530051
|
const interleavedThinking = llmConfig?.interleavedThinking ?? true;
|
|
529831
530052
|
const maxOutputTokens = MAX_OUTPUT_TOKENS;
|
|
529832
|
-
|
|
529833
|
-
|
|
529834
|
-
const
|
|
530053
|
+
const coreModel = llmConfig?.coreModel;
|
|
530054
|
+
if (thinkingEnabled && !usesAdaptiveEffort(coreModel)) {
|
|
530055
|
+
const modelKey = coreModel ?? "claude-sonnet-4-5";
|
|
530056
|
+
const modelCaps = MODEL_CAPABILITIES[modelKey];
|
|
529835
530057
|
const modelMaxOutput = modelCaps?.maxOutputTokens ?? 64e3;
|
|
529836
530058
|
const total = maxOutputTokens + thinkingBudgetTokens;
|
|
529837
530059
|
if (total > modelMaxOutput) {
|
|
@@ -529841,29 +530063,24 @@ function processLLMConfig(llmConfig, defaultBudgetTokens = 5e3, logContext) {
|
|
|
529841
530063
|
}
|
|
529842
530064
|
}
|
|
529843
530065
|
if (logContext) {
|
|
529844
|
-
getLogger3().info(`${logContext} LLM Provider Config: provider=${llmConfig?.provider || "bedrock (default)"}, thinking=${thinkingEnabled}, budget=${thinkingBudgetTokens}, interleaved=${interleavedThinking}`);
|
|
530066
|
+
getLogger3().info(`${logContext} LLM Provider Config: provider=${llmConfig?.provider || "bedrock (default)"}, coreModel=${coreModel ?? "unset"}, thinking=${thinkingEnabled}, budget=${thinkingBudgetTokens}, interleaved=${interleavedThinking}`);
|
|
529845
530067
|
}
|
|
529846
|
-
const
|
|
529847
|
-
|
|
529848
|
-
|
|
529849
|
-
|
|
529850
|
-
|
|
529851
|
-
|
|
529852
|
-
|
|
529853
|
-
|
|
529854
|
-
}
|
|
529855
|
-
}
|
|
530068
|
+
const thinkingOptions = buildThinkingProviderOptions(coreModel, {
|
|
530069
|
+
thinkingEnabled,
|
|
530070
|
+
thinkingBudgetTokens,
|
|
530071
|
+
interleavedThinking
|
|
530072
|
+
});
|
|
530073
|
+
const providerOptions = thinkingOptions.anthropic && thinkingOptions.bedrock ? {
|
|
530074
|
+
anthropic: thinkingOptions.anthropic,
|
|
530075
|
+
bedrock: thinkingOptions.bedrock
|
|
529856
530076
|
} : void 0;
|
|
529857
|
-
const headers = thinkingEnabled && interleavedThinking ? {
|
|
529858
|
-
"anthropic-beta": "interleaved-thinking-2025-05-14"
|
|
529859
|
-
} : {};
|
|
529860
530077
|
return {
|
|
529861
530078
|
thinkingEnabled,
|
|
529862
530079
|
thinkingBudgetTokens,
|
|
529863
530080
|
interleavedThinking,
|
|
529864
530081
|
maxOutputTokens,
|
|
529865
530082
|
providerOptions,
|
|
529866
|
-
headers
|
|
530083
|
+
headers: thinkingOptions.headers
|
|
529867
530084
|
};
|
|
529868
530085
|
}
|
|
529869
530086
|
|
|
@@ -529934,7 +530151,7 @@ var sendInteractiveMessageChannel = (clark, chatSessionStore) => {
|
|
|
529934
530151
|
};
|
|
529935
530152
|
var sendUserMessageChannel = (clark, chatSessionStore) => {
|
|
529936
530153
|
const queue = peerQueue(clark);
|
|
529937
|
-
return async (payload, delay3 = 0, immediate = false) => {
|
|
530154
|
+
return async (payload, delay3 = 0, immediate = false, { persistBeforeDeliver = false } = {}) => {
|
|
529938
530155
|
const messageId = payload.id ?? crypto.randomUUID();
|
|
529939
530156
|
const payloadWithId = { ...payload, id: messageId };
|
|
529940
530157
|
if (immediate) {
|
|
@@ -529946,7 +530163,15 @@ var sendUserMessageChannel = (clark, chatSessionStore) => {
|
|
|
529946
530163
|
return clark.context.peer.call.aiPushMessage(payloadWithId);
|
|
529947
530164
|
}
|
|
529948
530165
|
return queue(async () => {
|
|
529949
|
-
|
|
530166
|
+
if (persistBeforeDeliver) {
|
|
530167
|
+
try {
|
|
530168
|
+
await chatSessionStore.recordAssistant(payloadWithId);
|
|
530169
|
+
} catch (err) {
|
|
530170
|
+
getLogger3().warn(`[ai-service] recordAssistant failed; continuing with peer delivery. type=${payloadWithId.type}`, err);
|
|
530171
|
+
}
|
|
530172
|
+
} else {
|
|
530173
|
+
void chatSessionStore.recordAssistant(payloadWithId);
|
|
530174
|
+
}
|
|
529950
530175
|
if (!clark.context.peer) {
|
|
529951
530176
|
getLogger3().warn(`[ai-service] Cannot send message: no peer. type=${payloadWithId.type}, state=${clark.state}`);
|
|
529952
530177
|
return;
|
|
@@ -530026,7 +530251,7 @@ var MAX_ATTRIBUTE_LENGTH = 64e3;
|
|
|
530026
530251
|
var LLMObsSpanWriter = null;
|
|
530027
530252
|
async function loadLLMObsSpanWriter() {
|
|
530028
530253
|
if (!LLMObsSpanWriter) {
|
|
530029
|
-
const module2 = await import("./spans-
|
|
530254
|
+
const module2 = await import("./spans-OCSVIZ33.js");
|
|
530030
530255
|
LLMObsSpanWriter = module2.default;
|
|
530031
530256
|
}
|
|
530032
530257
|
return LLMObsSpanWriter;
|
|
@@ -531280,7 +531505,7 @@ var Clark = class _Clark extends TracedFSM {
|
|
|
531280
531505
|
async streamText(services, options8) {
|
|
531281
531506
|
const { model: providedModel, context: contextConfig, logging: loggingConfig, enableFallback: enableFallbackOverride, ...streamOptions } = options8;
|
|
531282
531507
|
const model = providedModel ?? services.llmProvider.modelForTask("generateBroadEdit");
|
|
531283
|
-
const { thinkingEnabled, thinkingBudgetTokens, maxOutputTokens, headers, providerOptions } = processLLMConfig(this.context.llmConfig);
|
|
531508
|
+
const { thinkingEnabled, thinkingBudgetTokens, interleavedThinking, maxOutputTokens, headers, providerOptions } = processLLMConfig(this.context.llmConfig);
|
|
531284
531509
|
const logging = loggingConfig !== false ? {
|
|
531285
531510
|
conversationId: loggingConfig?.conversationId ?? String(Date.now()),
|
|
531286
531511
|
runTimestamp: this.context.runTimestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -531352,6 +531577,11 @@ var Clark = class _Clark extends TracedFSM {
|
|
|
531352
531577
|
logging,
|
|
531353
531578
|
retry: streamOptions.retry,
|
|
531354
531579
|
providerConfig,
|
|
531580
|
+
thinking: {
|
|
531581
|
+
enabled: thinkingEnabled,
|
|
531582
|
+
budgetTokens: thinkingBudgetTokens,
|
|
531583
|
+
interleaved: interleavedThinking
|
|
531584
|
+
},
|
|
531355
531585
|
enableFallback,
|
|
531356
531586
|
fallbackStrategy,
|
|
531357
531587
|
peer: this.context.peer,
|
|
@@ -531412,8 +531642,7 @@ var Clark = class _Clark extends TracedFSM {
|
|
|
531412
531642
|
}
|
|
531413
531643
|
}
|
|
531414
531644
|
pushContextUsed(usage) {
|
|
531415
|
-
const
|
|
531416
|
-
const contextUsed = normalizedInputTokens + (usage.reasoningTokens ?? 0) + (usage.outputTokens ?? 0);
|
|
531645
|
+
const contextUsed = computeContextUsed(usage);
|
|
531417
531646
|
const formatTokens = (n) => n >= 1e3 ? `${(n / 1e3).toFixed(1)}k` : `${n}`;
|
|
531418
531647
|
this.logger.info(`Context used: ${formatTokens(contextUsed)} tokens`);
|
|
531419
531648
|
void this.context.peer?.call.aiPushContextUsed({ contextUsed }).catch((err) => {
|
|
@@ -561978,17 +562207,17 @@ var ToolRegistry = class {
|
|
|
561978
562207
|
* @param deps - Optional dependencies to instantiate the tool immediately
|
|
561979
562208
|
* @throws Error if tool with same name already registered
|
|
561980
562209
|
*/
|
|
561981
|
-
register(
|
|
561982
|
-
if (this.factories.has(
|
|
561983
|
-
throw new Error(`Tool "${
|
|
562210
|
+
register(factory12, deps) {
|
|
562211
|
+
if (this.factories.has(factory12.name) || this.instances.has(factory12.name)) {
|
|
562212
|
+
throw new Error(`Tool "${factory12.name}" already registered`);
|
|
561984
562213
|
}
|
|
561985
|
-
this.factories.set(
|
|
562214
|
+
this.factories.set(factory12.name, factory12);
|
|
561986
562215
|
if (deps !== void 0) {
|
|
561987
|
-
const instance3 =
|
|
561988
|
-
if (instance3.name !==
|
|
561989
|
-
throw new Error(`Tool name mismatch: factory.name="${
|
|
562216
|
+
const instance3 = factory12.create(deps);
|
|
562217
|
+
if (instance3.name !== factory12.name) {
|
|
562218
|
+
throw new Error(`Tool name mismatch: factory.name="${factory12.name}" but tool.name="${instance3.name}"`);
|
|
561990
562219
|
}
|
|
561991
|
-
this.instances.set(
|
|
562220
|
+
this.instances.set(factory12.name, instance3);
|
|
561992
562221
|
}
|
|
561993
562222
|
}
|
|
561994
562223
|
/**
|
|
@@ -562020,8 +562249,8 @@ var ToolRegistry = class {
|
|
|
562020
562249
|
* @param factories - Array of tool factories to register
|
|
562021
562250
|
*/
|
|
562022
562251
|
registerAll(factories) {
|
|
562023
|
-
for (const
|
|
562024
|
-
this.register(
|
|
562252
|
+
for (const factory12 of factories) {
|
|
562253
|
+
this.register(factory12);
|
|
562025
562254
|
}
|
|
562026
562255
|
}
|
|
562027
562256
|
/**
|
|
@@ -565846,43 +566075,63 @@ const ProductsPage = () => {
|
|
|
565846
566075
|
|
|
565847
566076
|
### Loading States
|
|
565848
566077
|
|
|
565849
|
-
|
|
566078
|
+
Loading behavior must differ based on whether data has already been fetched:
|
|
565850
566079
|
|
|
565851
|
-
**
|
|
566080
|
+
**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.
|
|
566081
|
+
|
|
566082
|
+
**Refetch / background refresh (data already exists):** Keep showing the existing data. Use \`fetching\` from \`useApiData\` to apply a subtle visual indicator: light opacity (e.g. \`opacity-70\`) to signal a refresh is in progress, plus a non-blocking label such as a small inline spinner, a thin progress bar, or an "Updating\u2026" label. **Do not** use \`pointer-events-none\` or otherwise disable the content \u2014 it must remain fully interactive during refetch.
|
|
566083
|
+
|
|
566084
|
+
Use \`loading\` and \`fetching\` from \`useApiData\` to distinguish these states:
|
|
565852
566085
|
|
|
565853
566086
|
\`\`\`tsx
|
|
565854
|
-
// \u2705 CORRECT \u2014 skeleton for first load, overlay for refetch
|
|
565855
566087
|
const { data, loading, fetching, isError, error } = useApiData("GetOrders", {
|
|
565856
566088
|
status: statusFilter,
|
|
565857
566089
|
search,
|
|
565858
566090
|
});
|
|
565859
566091
|
|
|
565860
|
-
|
|
566092
|
+
// Initial load \u2014 no data yet \u2192 show skeleton placeholder
|
|
566093
|
+
if (loading) {
|
|
566094
|
+
return <OrderTableSkeleton />;
|
|
566095
|
+
}
|
|
566096
|
+
|
|
565861
566097
|
if (isError) return <ErrorBanner error={error} />;
|
|
566098
|
+
|
|
566099
|
+
// Refetch \u2014 data exists \u2192 subtle opacity + indicator, table stays interactive
|
|
565862
566100
|
return (
|
|
565863
|
-
<div
|
|
565864
|
-
<
|
|
566101
|
+
<div>
|
|
566102
|
+
{fetching && <div className="text-xs text-muted-foreground">Updating\u2026</div>}
|
|
566103
|
+
<div className={fetching ? "opacity-70" : ""}>
|
|
566104
|
+
<OrderTable orders={data.orders} />
|
|
566105
|
+
</div>
|
|
565865
566106
|
</div>
|
|
565866
566107
|
);
|
|
565867
566108
|
\`\`\`
|
|
565868
566109
|
|
|
565869
566110
|
\`\`\`tsx
|
|
565870
|
-
// \u274C WRONG \u2014
|
|
565871
|
-
|
|
565872
|
-
|
|
565873
|
-
|
|
565874
|
-
|
|
566111
|
+
// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken
|
|
566112
|
+
return (
|
|
566113
|
+
<div className={fetching ? "pointer-events-none" : ""}>
|
|
566114
|
+
<OrderTable orders={data.orders} />
|
|
566115
|
+
</div>
|
|
566116
|
+
);
|
|
565875
566117
|
|
|
566118
|
+
// \u274C WRONG \u2014 no loading feedback when filters change
|
|
565876
566119
|
if (loading) return <Skeleton />;
|
|
565877
566120
|
return <OrderTable orders={data.orders} />;
|
|
565878
566121
|
\`\`\`
|
|
565879
566122
|
|
|
566123
|
+
#### Table Loading Rules
|
|
566124
|
+
|
|
566125
|
+
- **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.
|
|
566126
|
+
- **Do not** replace a populated table with a full skeleton on refetch \u2014 this causes disorienting content flashes.
|
|
566127
|
+
- **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).
|
|
566128
|
+
|
|
565880
566129
|
### Efficient Loading Patterns
|
|
565881
566130
|
|
|
565882
|
-
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a visual
|
|
566131
|
+
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a non-blocking visual indicator while new data loads. Use \`fetching\` from \`useApiData\`.
|
|
565883
566132
|
2. **Loading State Hierarchy**:
|
|
565884
566133
|
- No data yet (\`loading\`) \u2192 Full skeleton placeholder
|
|
565885
|
-
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a
|
|
566134
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a subtle visual indicator: light opacity (e.g. \`opacity-70\`) plus a non-blocking label (e.g. "Updating\u2026" text, thin progress bar, inline spinner). Do not use \`pointer-events-none\` \u2014 the content must remain fully interactive.
|
|
565886
566135
|
- Error state (\`isError\`) \u2192 Show error with retry option, optionally keep stale data visible
|
|
565887
566136
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
565888
566137
|
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, \`refetchOnReconnect\`, \`refetchInterval\`, and \`retry\` options.
|
|
@@ -569092,6 +569341,15 @@ var ChatSessionStore = (() => {
|
|
|
569092
569341
|
responseToMessageId: typeof msg.responseToMessageId === "string" ? msg.responseToMessageId : void 0,
|
|
569093
569342
|
savedFacts: Array.isArray(msg.savedFacts) ? msg.savedFacts : void 0
|
|
569094
569343
|
};
|
|
569344
|
+
} else if (msg.type === "next_steps") {
|
|
569345
|
+
return {
|
|
569346
|
+
role: msg.role,
|
|
569347
|
+
content: msg.content,
|
|
569348
|
+
type: "next_steps",
|
|
569349
|
+
id: typeof msg.id === "string" ? msg.id : void 0,
|
|
569350
|
+
timestamp,
|
|
569351
|
+
nextSteps: Array.isArray(msg.nextSteps) ? msg.nextSteps : []
|
|
569352
|
+
};
|
|
569095
569353
|
}
|
|
569096
569354
|
const baseMessage = {
|
|
569097
569355
|
role: msg.role,
|
|
@@ -569521,6 +569779,15 @@ var ChatSessionStore = (() => {
|
|
|
569521
569779
|
responseToMessageId: payload.responseToMessageId,
|
|
569522
569780
|
savedFacts: payload.savedFacts
|
|
569523
569781
|
};
|
|
569782
|
+
} else if (payload.type === "next_steps") {
|
|
569783
|
+
message = {
|
|
569784
|
+
role: "assistant",
|
|
569785
|
+
content: payload.text,
|
|
569786
|
+
type: "next_steps",
|
|
569787
|
+
id: messageId,
|
|
569788
|
+
timestamp: Date.now(),
|
|
569789
|
+
nextSteps: payload.nextSteps ?? []
|
|
569790
|
+
};
|
|
569524
569791
|
} else {
|
|
569525
569792
|
message = {
|
|
569526
569793
|
role: "assistant",
|
|
@@ -584057,6 +584324,13 @@ var ClarkChatLanguageModel = class {
|
|
|
584057
584324
|
});
|
|
584058
584325
|
break;
|
|
584059
584326
|
}
|
|
584327
|
+
case "raw": {
|
|
584328
|
+
controller.enqueue({
|
|
584329
|
+
type: "raw",
|
|
584330
|
+
rawValue: value2.rawValue ?? value2
|
|
584331
|
+
});
|
|
584332
|
+
break;
|
|
584333
|
+
}
|
|
584060
584334
|
case "object": {
|
|
584061
584335
|
const id2 = asString(value2.id);
|
|
584062
584336
|
if (id2 == null) {
|
|
@@ -588814,11 +589088,13 @@ var StreamConfig = class _StreamConfig {
|
|
|
588814
589088
|
_provider;
|
|
588815
589089
|
_fallback;
|
|
588816
589090
|
_logging;
|
|
588817
|
-
|
|
589091
|
+
_thinking;
|
|
589092
|
+
constructor(retry, provider, fallback, logging, thinking) {
|
|
588818
589093
|
this._retry = Object.freeze(retry);
|
|
588819
589094
|
this._provider = Object.freeze(provider);
|
|
588820
589095
|
this._fallback = Object.freeze(fallback);
|
|
588821
589096
|
this._logging = Object.freeze(logging);
|
|
589097
|
+
this._thinking = thinking ? Object.freeze({ ...thinking }) : void 0;
|
|
588822
589098
|
}
|
|
588823
589099
|
static create(options8) {
|
|
588824
589100
|
if (!options8.provider || !options8.model) {
|
|
@@ -588848,7 +589124,7 @@ var StreamConfig = class _StreamConfig {
|
|
|
588848
589124
|
saveArtifact: options8.logging?.saveArtifact,
|
|
588849
589125
|
metadata: options8.logging?.metadata ?? {}
|
|
588850
589126
|
};
|
|
588851
|
-
return new _StreamConfig(retry, provider, fallback, logging);
|
|
589127
|
+
return new _StreamConfig(retry, provider, fallback, logging, options8.thinking);
|
|
588852
589128
|
}
|
|
588853
589129
|
get retry() {
|
|
588854
589130
|
return this._retry;
|
|
@@ -588862,6 +589138,9 @@ var StreamConfig = class _StreamConfig {
|
|
|
588862
589138
|
get logging() {
|
|
588863
589139
|
return this._logging;
|
|
588864
589140
|
}
|
|
589141
|
+
get thinking() {
|
|
589142
|
+
return this._thinking;
|
|
589143
|
+
}
|
|
588865
589144
|
};
|
|
588866
589145
|
|
|
588867
589146
|
// ../../../vite-plugin-file-sync/dist/ai-service/llm/stream/orchestrator.js
|
|
@@ -589637,10 +589916,15 @@ var StreamOrchestrator = class {
|
|
|
589637
589916
|
}
|
|
589638
589917
|
}
|
|
589639
589918
|
} : options8;
|
|
589919
|
+
const thinkingRebuilt = this.rebuildThinkingOptions(baseOptions, provider);
|
|
589640
589920
|
return {
|
|
589641
|
-
...
|
|
589921
|
+
...thinkingRebuilt,
|
|
589922
|
+
headers: {
|
|
589923
|
+
...options8.headers,
|
|
589924
|
+
...thinkingRebuilt.headers
|
|
589925
|
+
},
|
|
589642
589926
|
providerOptions: {
|
|
589643
|
-
...
|
|
589927
|
+
...thinkingRebuilt.providerOptions,
|
|
589644
589928
|
billing: {
|
|
589645
589929
|
retry_count: session.metrics.retryCount,
|
|
589646
589930
|
workflow_failed: session.outcome === "error"
|
|
@@ -589648,6 +589932,50 @@ var StreamOrchestrator = class {
|
|
|
589648
589932
|
}
|
|
589649
589933
|
};
|
|
589650
589934
|
}
|
|
589935
|
+
/**
|
|
589936
|
+
* Replaces the thinking-related fields on `providerOptions.anthropic` and
|
|
589937
|
+
* `providerOptions.bedrock.additionalModelRequestFields` with the shape
|
|
589938
|
+
* the given model accepts. Any stale thinking keys (e.g. `budgetTokens`
|
|
589939
|
+
* from a previous opus-4-6 attempt, or `effort` from a previous 4-7
|
|
589940
|
+
* attempt) are dropped so the new shape isn't polluted.
|
|
589941
|
+
*/
|
|
589942
|
+
rebuildThinkingOptions(options8, provider) {
|
|
589943
|
+
const thinkingConfig = this.config.thinking;
|
|
589944
|
+
if (!thinkingConfig) {
|
|
589945
|
+
return options8;
|
|
589946
|
+
}
|
|
589947
|
+
const fresh = buildThinkingProviderOptions(provider.model, {
|
|
589948
|
+
thinkingEnabled: thinkingConfig.enabled,
|
|
589949
|
+
thinkingBudgetTokens: thinkingConfig.budgetTokens,
|
|
589950
|
+
interleavedThinking: thinkingConfig.interleaved
|
|
589951
|
+
});
|
|
589952
|
+
const existing = options8.providerOptions ?? {};
|
|
589953
|
+
const existingAnthropic = existing.anthropic ?? {};
|
|
589954
|
+
const existingBedrock = existing.bedrock ?? {};
|
|
589955
|
+
const existingBedrockFields = existingBedrock.additionalModelRequestFields ?? {};
|
|
589956
|
+
const { thinking: _a21, effort: _b17, ...anthropicRest } = existingAnthropic;
|
|
589957
|
+
const { thinking: _c, output_config: _d, anthropic_beta: _e, budget_tokens: _f, ...bedrockFieldsRest } = existingBedrockFields;
|
|
589958
|
+
const anthropic2 = fresh.anthropic ? { ...anthropicRest, ...fresh.anthropic } : anthropicRest;
|
|
589959
|
+
const bedrock = fresh.bedrock ? {
|
|
589960
|
+
...existingBedrock,
|
|
589961
|
+
additionalModelRequestFields: {
|
|
589962
|
+
...bedrockFieldsRest,
|
|
589963
|
+
...fresh.bedrock.additionalModelRequestFields
|
|
589964
|
+
}
|
|
589965
|
+
} : Object.keys(bedrockFieldsRest).length > 0 ? {
|
|
589966
|
+
...existingBedrock,
|
|
589967
|
+
additionalModelRequestFields: bedrockFieldsRest
|
|
589968
|
+
} : { ...existingBedrock, additionalModelRequestFields: {} };
|
|
589969
|
+
return {
|
|
589970
|
+
...options8,
|
|
589971
|
+
headers: { ...options8.headers, ...fresh.headers },
|
|
589972
|
+
providerOptions: {
|
|
589973
|
+
...existing,
|
|
589974
|
+
anthropic: anthropic2,
|
|
589975
|
+
bedrock
|
|
589976
|
+
}
|
|
589977
|
+
};
|
|
589978
|
+
}
|
|
589651
589979
|
getFallbackReason(error40) {
|
|
589652
589980
|
if (error40 && typeof error40 === "object" && "type" in error40) {
|
|
589653
589981
|
const errorType = error40.type;
|
|
@@ -591110,7 +591438,7 @@ var LLMClient = class {
|
|
|
591110
591438
|
}
|
|
591111
591439
|
}
|
|
591112
591440
|
async streamText(options8, logger15 = getLogger3(), tracer4 = LLMObsTracer.instance) {
|
|
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;
|
|
591441
|
+
const { model, user, system, context: contextConfig, logging: loggingConfig, retry: retryConfig, providerConfig, thinking: thinkingConfig, enableFallback, fallbackStrategy, peer, chatSessionStore, observers: customObservers, prepareStep, onStepFinish, onFinish, onChunk, onError: onError2, summarizationModel, safety: safetyConfig, ...streamOptions } = options8;
|
|
591114
591442
|
if (!user) {
|
|
591115
591443
|
throw new Error("user message is required");
|
|
591116
591444
|
}
|
|
@@ -591207,11 +591535,15 @@ var LLMClient = class {
|
|
|
591207
591535
|
try {
|
|
591208
591536
|
const fallbackEnabled = this.unifiedProviderEnabled && (enableFallback ?? false);
|
|
591209
591537
|
logger15.info(`[llm-client] provider=${providerConfig.provider} model=${providerConfig.model} unifiedProvider=${this.unifiedProviderEnabled} fallback=${fallbackEnabled} retry=${safeJsonStringify(retryConfig)}`);
|
|
591538
|
+
const adaptiveEffortCapable = usesAdaptiveEffort(providerConfig.model);
|
|
591539
|
+
const defaultMaxTotalTimeMs = adaptiveEffortCapable ? 5 * 60 * 1e3 : 2 * 60 * 1e3;
|
|
591540
|
+
const defaultIdleTimeoutMs = adaptiveEffortCapable ? 18e4 : 9e4;
|
|
591210
591541
|
const config4 = StreamConfig.create({
|
|
591211
591542
|
retry: {
|
|
591212
591543
|
...this.retryOptions,
|
|
591213
591544
|
...retryConfig,
|
|
591214
|
-
maxTotalTimeMs: retryConfig?.maxTotalTimeMs ?? this.retryOptions?.maxTotalTimeMs ??
|
|
591545
|
+
maxTotalTimeMs: retryConfig?.maxTotalTimeMs ?? this.retryOptions?.maxTotalTimeMs ?? defaultMaxTotalTimeMs,
|
|
591546
|
+
idleTimeoutMs: retryConfig?.idleTimeoutMs ?? this.retryOptions?.idleTimeoutMs ?? defaultIdleTimeoutMs
|
|
591215
591547
|
},
|
|
591216
591548
|
provider: providerConfig.provider,
|
|
591217
591549
|
model: providerConfig.model,
|
|
@@ -591219,6 +591551,7 @@ var LLMClient = class {
|
|
|
591219
591551
|
enabled: fallbackEnabled,
|
|
591220
591552
|
strategy: fallbackStrategy
|
|
591221
591553
|
},
|
|
591554
|
+
thinking: thinkingConfig,
|
|
591222
591555
|
logging: loggingConfig !== false ? {
|
|
591223
591556
|
enabled: true,
|
|
591224
591557
|
conversationId: loggingConfig?.conversationId,
|
|
@@ -591397,10 +591730,10 @@ init_cjs_shims();
|
|
|
591397
591730
|
// ../../../vite-plugin-file-sync/dist/ai-service/llm/impl/anthropic.js
|
|
591398
591731
|
init_cjs_shims();
|
|
591399
591732
|
|
|
591400
|
-
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.
|
|
591733
|
+
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.71_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
591401
591734
|
init_cjs_shims();
|
|
591402
591735
|
|
|
591403
|
-
// ../../../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.
|
|
591736
|
+
// ../../../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.23_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
591404
591737
|
init_cjs_shims();
|
|
591405
591738
|
function combineHeaders2(...headers) {
|
|
591406
591739
|
return headers.reduce(
|
|
@@ -591413,25 +591746,30 @@ function combineHeaders2(...headers) {
|
|
|
591413
591746
|
}
|
|
591414
591747
|
function createToolNameMapping({
|
|
591415
591748
|
tools = [],
|
|
591416
|
-
providerToolNames
|
|
591749
|
+
providerToolNames,
|
|
591750
|
+
resolveProviderToolName
|
|
591417
591751
|
}) {
|
|
591752
|
+
var _a22;
|
|
591418
591753
|
const customToolNameToProviderToolName = {};
|
|
591419
591754
|
const providerToolNameToCustomToolName = {};
|
|
591420
591755
|
for (const tool22 of tools) {
|
|
591421
|
-
if (tool22.type === "provider"
|
|
591422
|
-
const providerToolName = providerToolNames[tool22.id];
|
|
591756
|
+
if (tool22.type === "provider") {
|
|
591757
|
+
const providerToolName = (_a22 = resolveProviderToolName == null ? void 0 : resolveProviderToolName(tool22)) != null ? _a22 : tool22.id in providerToolNames ? providerToolNames[tool22.id] : void 0;
|
|
591758
|
+
if (providerToolName == null) {
|
|
591759
|
+
continue;
|
|
591760
|
+
}
|
|
591423
591761
|
customToolNameToProviderToolName[tool22.name] = providerToolName;
|
|
591424
591762
|
providerToolNameToCustomToolName[providerToolName] = tool22.name;
|
|
591425
591763
|
}
|
|
591426
591764
|
}
|
|
591427
591765
|
return {
|
|
591428
591766
|
toProviderToolName: (customToolName) => {
|
|
591429
|
-
var
|
|
591430
|
-
return (
|
|
591767
|
+
var _a32;
|
|
591768
|
+
return (_a32 = customToolNameToProviderToolName[customToolName]) != null ? _a32 : customToolName;
|
|
591431
591769
|
},
|
|
591432
591770
|
toCustomToolName: (providerToolName) => {
|
|
591433
|
-
var
|
|
591434
|
-
return (
|
|
591771
|
+
var _a32;
|
|
591772
|
+
return (_a32 = providerToolNameToCustomToolName[providerToolName]) != null ? _a32 : providerToolName;
|
|
591435
591773
|
}
|
|
591436
591774
|
};
|
|
591437
591775
|
}
|
|
@@ -591439,6 +591777,11 @@ function extractResponseHeaders2(response) {
|
|
|
591439
591777
|
return Object.fromEntries([...response.headers]);
|
|
591440
591778
|
}
|
|
591441
591779
|
var { btoa: btoa3, atob: atob3 } = globalThis;
|
|
591780
|
+
function convertBase64ToUint8Array(base64String) {
|
|
591781
|
+
const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
|
|
591782
|
+
const latin1string = atob3(base64Url);
|
|
591783
|
+
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
591784
|
+
}
|
|
591442
591785
|
function convertUint8ArrayToBase64(array3) {
|
|
591443
591786
|
let latin1string = "";
|
|
591444
591787
|
for (let i = 0; i < array3.length; i++) {
|
|
@@ -591601,7 +591944,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
|
|
|
591601
591944
|
);
|
|
591602
591945
|
return Object.fromEntries(normalizedHeaders.entries());
|
|
591603
591946
|
}
|
|
591604
|
-
var VERSION2 = true ? "4.0.
|
|
591947
|
+
var VERSION2 = true ? "4.0.23" : "0.0.0-test";
|
|
591605
591948
|
function isNonNullable(value2) {
|
|
591606
591949
|
return value2 != null;
|
|
591607
591950
|
}
|
|
@@ -591621,7 +591964,7 @@ function loadApiKey({
|
|
|
591621
591964
|
}
|
|
591622
591965
|
if (typeof process === "undefined") {
|
|
591623
591966
|
throw new LoadAPIKeyError2({
|
|
591624
|
-
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables
|
|
591967
|
+
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`
|
|
591625
591968
|
});
|
|
591626
591969
|
}
|
|
591627
591970
|
apiKey = process.env[environmentVariableName];
|
|
@@ -591653,8 +591996,8 @@ function loadOptionalSetting({
|
|
|
591653
591996
|
}
|
|
591654
591997
|
return settingValue;
|
|
591655
591998
|
}
|
|
591656
|
-
var suspectProtoRx2 = /"
|
|
591657
|
-
var suspectConstructorRx2 = /"
|
|
591999
|
+
var suspectProtoRx2 = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
592000
|
+
var suspectConstructorRx2 = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
591658
592001
|
function _parse3(text3) {
|
|
591659
592002
|
const obj = JSON.parse(text3);
|
|
591660
592003
|
if (obj === null || typeof obj !== "object") {
|
|
@@ -591674,7 +592017,7 @@ function filter3(obj) {
|
|
|
591674
592017
|
if (Object.prototype.hasOwnProperty.call(node, "__proto__")) {
|
|
591675
592018
|
throw new SyntaxError("Object contains forbidden prototype property");
|
|
591676
592019
|
}
|
|
591677
|
-
if (Object.prototype.hasOwnProperty.call(node, "constructor") && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
|
|
592020
|
+
if (Object.prototype.hasOwnProperty.call(node, "constructor") && node.constructor !== null && typeof node.constructor === "object" && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) {
|
|
591678
592021
|
throw new SyntaxError("Object contains forbidden prototype property");
|
|
591679
592022
|
}
|
|
591680
592023
|
for (const key2 in node) {
|
|
@@ -591734,7 +592077,7 @@ function visit2(def) {
|
|
|
591734
592077
|
if (typeof def === "boolean") return def;
|
|
591735
592078
|
return addAdditionalPropertiesToJsonSchema2(def);
|
|
591736
592079
|
}
|
|
591737
|
-
var ignoreOverride2 = Symbol(
|
|
592080
|
+
var ignoreOverride2 = /* @__PURE__ */ Symbol(
|
|
591738
592081
|
"Let zodToJsonSchema decide on which parser to use"
|
|
591739
592082
|
);
|
|
591740
592083
|
var defaultOptions3 = {
|
|
@@ -592833,7 +593176,7 @@ var zod3ToJsonSchema2 = (schema, options8) => {
|
|
|
592833
593176
|
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
592834
593177
|
return combined;
|
|
592835
593178
|
};
|
|
592836
|
-
var schemaSymbol2 = Symbol.for("vercel.ai.schema");
|
|
593179
|
+
var schemaSymbol2 = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
592837
593180
|
function lazySchema(createSchema2) {
|
|
592838
593181
|
let schema;
|
|
592839
593182
|
return () => {
|
|
@@ -593294,8 +593637,8 @@ function withoutTrailingSlash2(url4) {
|
|
|
593294
593637
|
return url4 == null ? void 0 : url4.replace(/\/$/, "");
|
|
593295
593638
|
}
|
|
593296
593639
|
|
|
593297
|
-
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.
|
|
593298
|
-
var VERSION3 = true ? "3.0.
|
|
593640
|
+
// ../../../../node_modules/.pnpm/@ai-sdk+anthropic@3.0.71_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
593641
|
+
var VERSION3 = true ? "3.0.71" : "0.0.0-test";
|
|
593299
593642
|
var anthropicErrorDataSchema = lazySchema(
|
|
593300
593643
|
() => zodSchema3(
|
|
593301
593644
|
external_exports2.object({
|
|
@@ -593374,6 +593717,10 @@ var anthropicMessagesResponseSchema = lazySchema(
|
|
|
593374
593717
|
type: external_exports2.literal("code_execution_20250825"),
|
|
593375
593718
|
tool_id: external_exports2.string()
|
|
593376
593719
|
}),
|
|
593720
|
+
external_exports2.object({
|
|
593721
|
+
type: external_exports2.literal("code_execution_20260120"),
|
|
593722
|
+
tool_id: external_exports2.string()
|
|
593723
|
+
}),
|
|
593377
593724
|
external_exports2.object({
|
|
593378
593725
|
type: external_exports2.literal("direct")
|
|
593379
593726
|
})
|
|
@@ -593383,7 +593730,16 @@ var anthropicMessagesResponseSchema = lazySchema(
|
|
|
593383
593730
|
type: external_exports2.literal("server_tool_use"),
|
|
593384
593731
|
id: external_exports2.string(),
|
|
593385
593732
|
name: external_exports2.string(),
|
|
593386
|
-
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish()
|
|
593733
|
+
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish(),
|
|
593734
|
+
caller: external_exports2.union([
|
|
593735
|
+
external_exports2.object({
|
|
593736
|
+
type: external_exports2.literal("code_execution_20260120"),
|
|
593737
|
+
tool_id: external_exports2.string()
|
|
593738
|
+
}),
|
|
593739
|
+
external_exports2.object({
|
|
593740
|
+
type: external_exports2.literal("direct")
|
|
593741
|
+
})
|
|
593742
|
+
]).optional()
|
|
593387
593743
|
}),
|
|
593388
593744
|
external_exports2.object({
|
|
593389
593745
|
type: external_exports2.literal("mcp_tool_use"),
|
|
@@ -593471,6 +593827,18 @@ var anthropicMessagesResponseSchema = lazySchema(
|
|
|
593471
593827
|
})
|
|
593472
593828
|
).optional().default([])
|
|
593473
593829
|
}),
|
|
593830
|
+
external_exports2.object({
|
|
593831
|
+
type: external_exports2.literal("encrypted_code_execution_result"),
|
|
593832
|
+
encrypted_stdout: external_exports2.string(),
|
|
593833
|
+
stderr: external_exports2.string(),
|
|
593834
|
+
return_code: external_exports2.number(),
|
|
593835
|
+
content: external_exports2.array(
|
|
593836
|
+
external_exports2.object({
|
|
593837
|
+
type: external_exports2.literal("code_execution_output"),
|
|
593838
|
+
file_id: external_exports2.string()
|
|
593839
|
+
})
|
|
593840
|
+
).optional().default([])
|
|
593841
|
+
}),
|
|
593474
593842
|
external_exports2.object({
|
|
593475
593843
|
type: external_exports2.literal("code_execution_tool_result_error"),
|
|
593476
593844
|
error_code: external_exports2.string()
|
|
@@ -593630,6 +593998,10 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
593630
593998
|
type: external_exports2.literal("code_execution_20250825"),
|
|
593631
593999
|
tool_id: external_exports2.string()
|
|
593632
594000
|
}),
|
|
594001
|
+
external_exports2.object({
|
|
594002
|
+
type: external_exports2.literal("code_execution_20260120"),
|
|
594003
|
+
tool_id: external_exports2.string()
|
|
594004
|
+
}),
|
|
593633
594005
|
external_exports2.object({
|
|
593634
594006
|
type: external_exports2.literal("direct")
|
|
593635
594007
|
})
|
|
@@ -593668,6 +594040,10 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
593668
594040
|
type: external_exports2.literal("code_execution_20250825"),
|
|
593669
594041
|
tool_id: external_exports2.string()
|
|
593670
594042
|
}),
|
|
594043
|
+
external_exports2.object({
|
|
594044
|
+
type: external_exports2.literal("code_execution_20260120"),
|
|
594045
|
+
tool_id: external_exports2.string()
|
|
594046
|
+
}),
|
|
593671
594047
|
external_exports2.object({
|
|
593672
594048
|
type: external_exports2.literal("direct")
|
|
593673
594049
|
})
|
|
@@ -593685,7 +594061,16 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
593685
594061
|
type: external_exports2.literal("server_tool_use"),
|
|
593686
594062
|
id: external_exports2.string(),
|
|
593687
594063
|
name: external_exports2.string(),
|
|
593688
|
-
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish()
|
|
594064
|
+
input: external_exports2.record(external_exports2.string(), external_exports2.unknown()).nullish(),
|
|
594065
|
+
caller: external_exports2.union([
|
|
594066
|
+
external_exports2.object({
|
|
594067
|
+
type: external_exports2.literal("code_execution_20260120"),
|
|
594068
|
+
tool_id: external_exports2.string()
|
|
594069
|
+
}),
|
|
594070
|
+
external_exports2.object({
|
|
594071
|
+
type: external_exports2.literal("direct")
|
|
594072
|
+
})
|
|
594073
|
+
]).optional()
|
|
593689
594074
|
}),
|
|
593690
594075
|
external_exports2.object({
|
|
593691
594076
|
type: external_exports2.literal("mcp_tool_use"),
|
|
@@ -593773,6 +594158,18 @@ var anthropicMessagesChunkSchema = lazySchema(
|
|
|
593773
594158
|
})
|
|
593774
594159
|
).optional().default([])
|
|
593775
594160
|
}),
|
|
594161
|
+
external_exports2.object({
|
|
594162
|
+
type: external_exports2.literal("encrypted_code_execution_result"),
|
|
594163
|
+
encrypted_stdout: external_exports2.string(),
|
|
594164
|
+
stderr: external_exports2.string(),
|
|
594165
|
+
return_code: external_exports2.number(),
|
|
594166
|
+
content: external_exports2.array(
|
|
594167
|
+
external_exports2.object({
|
|
594168
|
+
type: external_exports2.literal("code_execution_output"),
|
|
594169
|
+
file_id: external_exports2.string()
|
|
594170
|
+
})
|
|
594171
|
+
).optional().default([])
|
|
594172
|
+
}),
|
|
593776
594173
|
external_exports2.object({
|
|
593777
594174
|
type: external_exports2.literal("code_execution_tool_result_error"),
|
|
593778
594175
|
error_code: external_exports2.string()
|
|
@@ -594025,7 +594422,7 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594025
594422
|
/**
|
|
594026
594423
|
* Determines how structured outputs are generated.
|
|
594027
594424
|
*
|
|
594028
|
-
* - `outputFormat`: Use the `
|
|
594425
|
+
* - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.
|
|
594029
594426
|
* - `jsonTool`: Use a special 'json' tool to specify the structured output format.
|
|
594030
594427
|
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).
|
|
594031
594428
|
*/
|
|
@@ -594039,7 +594436,13 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594039
594436
|
thinking: external_exports2.discriminatedUnion("type", [
|
|
594040
594437
|
external_exports2.object({
|
|
594041
594438
|
/** for Sonnet 4.6, Opus 4.6, and newer models */
|
|
594042
|
-
type: external_exports2.literal("adaptive")
|
|
594439
|
+
type: external_exports2.literal("adaptive"),
|
|
594440
|
+
/**
|
|
594441
|
+
* Controls whether thinking content is included in the response.
|
|
594442
|
+
* - `"omitted"`: Thinking blocks are present but text is empty (default for Opus 4.7+).
|
|
594443
|
+
* - `"summarized"`: Thinking content is returned. Required to see reasoning output.
|
|
594444
|
+
*/
|
|
594445
|
+
display: external_exports2.enum(["omitted", "summarized"]).optional()
|
|
594043
594446
|
}),
|
|
594044
594447
|
external_exports2.object({
|
|
594045
594448
|
/** for models before Opus 4.6, except Sonnet 4.6 still supports it */
|
|
@@ -594063,6 +594466,20 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594063
594466
|
type: external_exports2.literal("ephemeral"),
|
|
594064
594467
|
ttl: external_exports2.union([external_exports2.literal("5m"), external_exports2.literal("1h")]).optional()
|
|
594065
594468
|
}).optional(),
|
|
594469
|
+
/**
|
|
594470
|
+
* Metadata to include with the request.
|
|
594471
|
+
*
|
|
594472
|
+
* See https://platform.claude.com/docs/en/api/messages/create for details.
|
|
594473
|
+
*/
|
|
594474
|
+
metadata: external_exports2.object({
|
|
594475
|
+
/**
|
|
594476
|
+
* An external identifier for the user associated with the request.
|
|
594477
|
+
*
|
|
594478
|
+
* Should be a UUID, hash value, or other opaque identifier.
|
|
594479
|
+
* Must not contain PII (name, email, phone number, etc.).
|
|
594480
|
+
*/
|
|
594481
|
+
userId: external_exports2.string().optional()
|
|
594482
|
+
}).optional(),
|
|
594066
594483
|
/**
|
|
594067
594484
|
* MCP servers to be utilized in this request.
|
|
594068
594485
|
*/
|
|
@@ -594094,10 +594511,11 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594094
594511
|
).optional()
|
|
594095
594512
|
}).optional(),
|
|
594096
594513
|
/**
|
|
594097
|
-
* Whether to enable
|
|
594098
|
-
*
|
|
594099
|
-
*
|
|
594100
|
-
*
|
|
594514
|
+
* Whether to enable fine-grained (eager) streaming of tool call inputs
|
|
594515
|
+
* and structured outputs for every function tool in the request. When
|
|
594516
|
+
* true (the default), each function tool receives a default of
|
|
594517
|
+
* `eager_input_streaming: true` unless it explicitly sets
|
|
594518
|
+
* `providerOptions.anthropic.eagerInputStreaming`.
|
|
594101
594519
|
*
|
|
594102
594520
|
* @default true
|
|
594103
594521
|
*/
|
|
@@ -594105,12 +594523,38 @@ var anthropicLanguageModelOptions = external_exports2.object({
|
|
|
594105
594523
|
/**
|
|
594106
594524
|
* @default 'high'
|
|
594107
594525
|
*/
|
|
594108
|
-
effort: external_exports2.enum(["low", "medium", "high", "max"]).optional(),
|
|
594526
|
+
effort: external_exports2.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
594527
|
+
/**
|
|
594528
|
+
* Task budget for agentic turns. Informs the model of the total token budget
|
|
594529
|
+
* available for the current task, allowing it to prioritize work and wind down
|
|
594530
|
+
* gracefully as the budget is consumed.
|
|
594531
|
+
*
|
|
594532
|
+
* Advisory only — does not enforce a hard token limit.
|
|
594533
|
+
*/
|
|
594534
|
+
taskBudget: external_exports2.object({
|
|
594535
|
+
type: external_exports2.literal("tokens"),
|
|
594536
|
+
total: external_exports2.number().int().min(2e4),
|
|
594537
|
+
remaining: external_exports2.number().int().min(0).optional()
|
|
594538
|
+
}).optional(),
|
|
594109
594539
|
/**
|
|
594110
594540
|
* Enable fast mode for faster inference (2.5x faster output token speeds).
|
|
594111
594541
|
* Only supported with claude-opus-4-6.
|
|
594112
594542
|
*/
|
|
594113
594543
|
speed: external_exports2.enum(["fast", "standard"]).optional(),
|
|
594544
|
+
/**
|
|
594545
|
+
* Controls where model inference runs for this request.
|
|
594546
|
+
*
|
|
594547
|
+
* - `"global"`: Inference may run in any available geography (default).
|
|
594548
|
+
* - `"us"`: Inference runs only in US-based infrastructure.
|
|
594549
|
+
*
|
|
594550
|
+
* See https://platform.claude.com/docs/en/build-with-claude/data-residency
|
|
594551
|
+
*/
|
|
594552
|
+
inferenceGeo: external_exports2.enum(["us", "global"]).optional(),
|
|
594553
|
+
/**
|
|
594554
|
+
* A set of beta features to enable.
|
|
594555
|
+
* Allow a provider to receive the full `betas` set if it needs it.
|
|
594556
|
+
*/
|
|
594557
|
+
anthropicBeta: external_exports2.array(external_exports2.string()).optional(),
|
|
594114
594558
|
contextManagement: external_exports2.object({
|
|
594115
594559
|
edits: external_exports2.array(
|
|
594116
594560
|
external_exports2.discriminatedUnion("type", [
|
|
@@ -594228,6 +594672,51 @@ var factory = createProviderToolFactory({
|
|
|
594228
594672
|
var textEditor_20250728 = (args = {}) => {
|
|
594229
594673
|
return factory(args);
|
|
594230
594674
|
};
|
|
594675
|
+
var webSearch_20260209ArgsSchema = lazySchema(
|
|
594676
|
+
() => zodSchema3(
|
|
594677
|
+
external_exports2.object({
|
|
594678
|
+
maxUses: external_exports2.number().optional(),
|
|
594679
|
+
allowedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594680
|
+
blockedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594681
|
+
userLocation: external_exports2.object({
|
|
594682
|
+
type: external_exports2.literal("approximate"),
|
|
594683
|
+
city: external_exports2.string().optional(),
|
|
594684
|
+
region: external_exports2.string().optional(),
|
|
594685
|
+
country: external_exports2.string().optional(),
|
|
594686
|
+
timezone: external_exports2.string().optional()
|
|
594687
|
+
}).optional()
|
|
594688
|
+
})
|
|
594689
|
+
)
|
|
594690
|
+
);
|
|
594691
|
+
var webSearch_20260209OutputSchema = lazySchema(
|
|
594692
|
+
() => zodSchema3(
|
|
594693
|
+
external_exports2.array(
|
|
594694
|
+
external_exports2.object({
|
|
594695
|
+
url: external_exports2.string(),
|
|
594696
|
+
title: external_exports2.string().nullable(),
|
|
594697
|
+
pageAge: external_exports2.string().nullable(),
|
|
594698
|
+
encryptedContent: external_exports2.string(),
|
|
594699
|
+
type: external_exports2.literal("web_search_result")
|
|
594700
|
+
})
|
|
594701
|
+
)
|
|
594702
|
+
)
|
|
594703
|
+
);
|
|
594704
|
+
var webSearch_20260209InputSchema = lazySchema(
|
|
594705
|
+
() => zodSchema3(
|
|
594706
|
+
external_exports2.object({
|
|
594707
|
+
query: external_exports2.string()
|
|
594708
|
+
})
|
|
594709
|
+
)
|
|
594710
|
+
);
|
|
594711
|
+
var factory2 = createProviderToolFactoryWithOutputSchema({
|
|
594712
|
+
id: "anthropic.web_search_20260209",
|
|
594713
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
594714
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
594715
|
+
supportsDeferredResults: true
|
|
594716
|
+
});
|
|
594717
|
+
var webSearch_20260209 = (args = {}) => {
|
|
594718
|
+
return factory2(args);
|
|
594719
|
+
};
|
|
594231
594720
|
var webSearch_20250305ArgsSchema = lazySchema(
|
|
594232
594721
|
() => zodSchema3(
|
|
594233
594722
|
external_exports2.object({
|
|
@@ -594264,16 +594753,16 @@ var webSearch_20250305InputSchema = lazySchema(
|
|
|
594264
594753
|
})
|
|
594265
594754
|
)
|
|
594266
594755
|
);
|
|
594267
|
-
var
|
|
594756
|
+
var factory3 = createProviderToolFactoryWithOutputSchema({
|
|
594268
594757
|
id: "anthropic.web_search_20250305",
|
|
594269
594758
|
inputSchema: webSearch_20250305InputSchema,
|
|
594270
594759
|
outputSchema: webSearch_20250305OutputSchema,
|
|
594271
594760
|
supportsDeferredResults: true
|
|
594272
594761
|
});
|
|
594273
594762
|
var webSearch_20250305 = (args = {}) => {
|
|
594274
|
-
return
|
|
594763
|
+
return factory3(args);
|
|
594275
594764
|
};
|
|
594276
|
-
var
|
|
594765
|
+
var webFetch_20260209ArgsSchema = lazySchema(
|
|
594277
594766
|
() => zodSchema3(
|
|
594278
594767
|
external_exports2.object({
|
|
594279
594768
|
maxUses: external_exports2.number().optional(),
|
|
@@ -594284,7 +594773,60 @@ var webFetch_20250910ArgsSchema = lazySchema(
|
|
|
594284
594773
|
})
|
|
594285
594774
|
)
|
|
594286
594775
|
);
|
|
594287
|
-
var
|
|
594776
|
+
var webFetch_20260209OutputSchema = lazySchema(
|
|
594777
|
+
() => zodSchema3(
|
|
594778
|
+
external_exports2.object({
|
|
594779
|
+
type: external_exports2.literal("web_fetch_result"),
|
|
594780
|
+
url: external_exports2.string(),
|
|
594781
|
+
content: external_exports2.object({
|
|
594782
|
+
type: external_exports2.literal("document"),
|
|
594783
|
+
title: external_exports2.string().nullable(),
|
|
594784
|
+
citations: external_exports2.object({ enabled: external_exports2.boolean() }).optional(),
|
|
594785
|
+
source: external_exports2.union([
|
|
594786
|
+
external_exports2.object({
|
|
594787
|
+
type: external_exports2.literal("base64"),
|
|
594788
|
+
mediaType: external_exports2.literal("application/pdf"),
|
|
594789
|
+
data: external_exports2.string()
|
|
594790
|
+
}),
|
|
594791
|
+
external_exports2.object({
|
|
594792
|
+
type: external_exports2.literal("text"),
|
|
594793
|
+
mediaType: external_exports2.literal("text/plain"),
|
|
594794
|
+
data: external_exports2.string()
|
|
594795
|
+
})
|
|
594796
|
+
])
|
|
594797
|
+
}),
|
|
594798
|
+
retrievedAt: external_exports2.string().nullable()
|
|
594799
|
+
})
|
|
594800
|
+
)
|
|
594801
|
+
);
|
|
594802
|
+
var webFetch_20260209InputSchema = lazySchema(
|
|
594803
|
+
() => zodSchema3(
|
|
594804
|
+
external_exports2.object({
|
|
594805
|
+
url: external_exports2.string()
|
|
594806
|
+
})
|
|
594807
|
+
)
|
|
594808
|
+
);
|
|
594809
|
+
var factory4 = createProviderToolFactoryWithOutputSchema({
|
|
594810
|
+
id: "anthropic.web_fetch_20260209",
|
|
594811
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
594812
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
594813
|
+
supportsDeferredResults: true
|
|
594814
|
+
});
|
|
594815
|
+
var webFetch_20260209 = (args = {}) => {
|
|
594816
|
+
return factory4(args);
|
|
594817
|
+
};
|
|
594818
|
+
var webFetch_20250910ArgsSchema = lazySchema(
|
|
594819
|
+
() => zodSchema3(
|
|
594820
|
+
external_exports2.object({
|
|
594821
|
+
maxUses: external_exports2.number().optional(),
|
|
594822
|
+
allowedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594823
|
+
blockedDomains: external_exports2.array(external_exports2.string()).optional(),
|
|
594824
|
+
citations: external_exports2.object({ enabled: external_exports2.boolean() }).optional(),
|
|
594825
|
+
maxContentTokens: external_exports2.number().optional()
|
|
594826
|
+
})
|
|
594827
|
+
)
|
|
594828
|
+
);
|
|
594829
|
+
var webFetch_20250910OutputSchema = lazySchema(
|
|
594288
594830
|
() => zodSchema3(
|
|
594289
594831
|
external_exports2.object({
|
|
594290
594832
|
type: external_exports2.literal("web_fetch_result"),
|
|
@@ -594317,23 +594859,25 @@ var webFetch_20250910InputSchema = lazySchema(
|
|
|
594317
594859
|
})
|
|
594318
594860
|
)
|
|
594319
594861
|
);
|
|
594320
|
-
var
|
|
594862
|
+
var factory5 = createProviderToolFactoryWithOutputSchema({
|
|
594321
594863
|
id: "anthropic.web_fetch_20250910",
|
|
594322
594864
|
inputSchema: webFetch_20250910InputSchema,
|
|
594323
594865
|
outputSchema: webFetch_20250910OutputSchema,
|
|
594324
594866
|
supportsDeferredResults: true
|
|
594325
594867
|
});
|
|
594326
594868
|
var webFetch_20250910 = (args = {}) => {
|
|
594327
|
-
return
|
|
594869
|
+
return factory5(args);
|
|
594328
594870
|
};
|
|
594329
594871
|
async function prepareTools({
|
|
594330
594872
|
tools,
|
|
594331
594873
|
toolChoice,
|
|
594332
594874
|
disableParallelToolUse,
|
|
594333
594875
|
cacheControlValidator,
|
|
594334
|
-
supportsStructuredOutput
|
|
594876
|
+
supportsStructuredOutput,
|
|
594877
|
+
supportsStrictTools,
|
|
594878
|
+
defaultEagerInputStreaming = false
|
|
594335
594879
|
}) {
|
|
594336
|
-
var _a21;
|
|
594880
|
+
var _a21, _b17;
|
|
594337
594881
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
594338
594882
|
const toolWarnings = [];
|
|
594339
594883
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -594350,14 +594894,23 @@ async function prepareTools({
|
|
|
594350
594894
|
canCache: true
|
|
594351
594895
|
});
|
|
594352
594896
|
const anthropicOptions = (_a21 = tool3.providerOptions) == null ? void 0 : _a21.anthropic;
|
|
594897
|
+
const eagerInputStreaming = (_b17 = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b17 : defaultEagerInputStreaming;
|
|
594353
594898
|
const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
|
|
594354
594899
|
const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;
|
|
594900
|
+
if (!supportsStrictTools && tool3.strict != null) {
|
|
594901
|
+
toolWarnings.push({
|
|
594902
|
+
type: "unsupported",
|
|
594903
|
+
feature: "strict",
|
|
594904
|
+
details: `Tool '${tool3.name}' has strict: ${tool3.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`
|
|
594905
|
+
});
|
|
594906
|
+
}
|
|
594355
594907
|
anthropicTools2.push({
|
|
594356
594908
|
name: tool3.name,
|
|
594357
594909
|
description: tool3.description,
|
|
594358
594910
|
input_schema: tool3.inputSchema,
|
|
594359
594911
|
cache_control: cacheControl,
|
|
594360
|
-
...
|
|
594912
|
+
...eagerInputStreaming ? { eager_input_streaming: true } : {},
|
|
594913
|
+
...supportsStrictTools === true && tool3.strict != null ? { strict: tool3.strict } : {},
|
|
594361
594914
|
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
594362
594915
|
...allowedCallers != null ? { allowed_callers: allowedCallers } : {},
|
|
594363
594916
|
...tool3.inputExamples != null ? {
|
|
@@ -594393,6 +594946,13 @@ async function prepareTools({
|
|
|
594393
594946
|
});
|
|
594394
594947
|
break;
|
|
594395
594948
|
}
|
|
594949
|
+
case "anthropic.code_execution_20260120": {
|
|
594950
|
+
anthropicTools2.push({
|
|
594951
|
+
type: "code_execution_20260120",
|
|
594952
|
+
name: "code_execution"
|
|
594953
|
+
});
|
|
594954
|
+
break;
|
|
594955
|
+
}
|
|
594396
594956
|
case "anthropic.computer_20250124": {
|
|
594397
594957
|
betas.add("computer-use-2025-01-24");
|
|
594398
594958
|
anthropicTools2.push({
|
|
@@ -594514,6 +595074,24 @@ async function prepareTools({
|
|
|
594514
595074
|
});
|
|
594515
595075
|
break;
|
|
594516
595076
|
}
|
|
595077
|
+
case "anthropic.web_fetch_20260209": {
|
|
595078
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
595079
|
+
const args = await validateTypes2({
|
|
595080
|
+
value: tool3.args,
|
|
595081
|
+
schema: webFetch_20260209ArgsSchema
|
|
595082
|
+
});
|
|
595083
|
+
anthropicTools2.push({
|
|
595084
|
+
type: "web_fetch_20260209",
|
|
595085
|
+
name: "web_fetch",
|
|
595086
|
+
max_uses: args.maxUses,
|
|
595087
|
+
allowed_domains: args.allowedDomains,
|
|
595088
|
+
blocked_domains: args.blockedDomains,
|
|
595089
|
+
citations: args.citations,
|
|
595090
|
+
max_content_tokens: args.maxContentTokens,
|
|
595091
|
+
cache_control: void 0
|
|
595092
|
+
});
|
|
595093
|
+
break;
|
|
595094
|
+
}
|
|
594517
595095
|
case "anthropic.web_search_20250305": {
|
|
594518
595096
|
const args = await validateTypes2({
|
|
594519
595097
|
value: tool3.args,
|
|
@@ -594530,8 +595108,24 @@ async function prepareTools({
|
|
|
594530
595108
|
});
|
|
594531
595109
|
break;
|
|
594532
595110
|
}
|
|
595111
|
+
case "anthropic.web_search_20260209": {
|
|
595112
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
595113
|
+
const args = await validateTypes2({
|
|
595114
|
+
value: tool3.args,
|
|
595115
|
+
schema: webSearch_20260209ArgsSchema
|
|
595116
|
+
});
|
|
595117
|
+
anthropicTools2.push({
|
|
595118
|
+
type: "web_search_20260209",
|
|
595119
|
+
name: "web_search",
|
|
595120
|
+
max_uses: args.maxUses,
|
|
595121
|
+
allowed_domains: args.allowedDomains,
|
|
595122
|
+
blocked_domains: args.blockedDomains,
|
|
595123
|
+
user_location: args.userLocation,
|
|
595124
|
+
cache_control: void 0
|
|
595125
|
+
});
|
|
595126
|
+
break;
|
|
595127
|
+
}
|
|
594533
595128
|
case "anthropic.tool_search_regex_20251119": {
|
|
594534
|
-
betas.add("advanced-tool-use-2025-11-20");
|
|
594535
595129
|
anthropicTools2.push({
|
|
594536
595130
|
type: "tool_search_tool_regex_20251119",
|
|
594537
595131
|
name: "tool_search_tool_regex"
|
|
@@ -594539,7 +595133,6 @@ async function prepareTools({
|
|
|
594539
595133
|
break;
|
|
594540
595134
|
}
|
|
594541
595135
|
case "anthropic.tool_search_bm25_20251119": {
|
|
594542
|
-
betas.add("advanced-tool-use-2025-11-20");
|
|
594543
595136
|
anthropicTools2.push({
|
|
594544
595137
|
type: "tool_search_tool_bm25_20251119",
|
|
594545
595138
|
name: "tool_search_tool_bm25"
|
|
@@ -594677,13 +595270,13 @@ var codeExecution_20250522InputSchema = lazySchema(
|
|
|
594677
595270
|
})
|
|
594678
595271
|
)
|
|
594679
595272
|
);
|
|
594680
|
-
var
|
|
595273
|
+
var factory6 = createProviderToolFactoryWithOutputSchema({
|
|
594681
595274
|
id: "anthropic.code_execution_20250522",
|
|
594682
595275
|
inputSchema: codeExecution_20250522InputSchema,
|
|
594683
595276
|
outputSchema: codeExecution_20250522OutputSchema
|
|
594684
595277
|
});
|
|
594685
595278
|
var codeExecution_20250522 = (args = {}) => {
|
|
594686
|
-
return
|
|
595279
|
+
return factory6(args);
|
|
594687
595280
|
};
|
|
594688
595281
|
var codeExecution_20250825OutputSchema = lazySchema(
|
|
594689
595282
|
() => zodSchema3(
|
|
@@ -594778,7 +595371,7 @@ var codeExecution_20250825InputSchema = lazySchema(
|
|
|
594778
595371
|
])
|
|
594779
595372
|
)
|
|
594780
595373
|
);
|
|
594781
|
-
var
|
|
595374
|
+
var factory7 = createProviderToolFactoryWithOutputSchema({
|
|
594782
595375
|
id: "anthropic.code_execution_20250825",
|
|
594783
595376
|
inputSchema: codeExecution_20250825InputSchema,
|
|
594784
595377
|
outputSchema: codeExecution_20250825OutputSchema,
|
|
@@ -594788,7 +595381,120 @@ var factory5 = createProviderToolFactoryWithOutputSchema({
|
|
|
594788
595381
|
supportsDeferredResults: true
|
|
594789
595382
|
});
|
|
594790
595383
|
var codeExecution_20250825 = (args = {}) => {
|
|
594791
|
-
return
|
|
595384
|
+
return factory7(args);
|
|
595385
|
+
};
|
|
595386
|
+
var codeExecution_20260120OutputSchema = lazySchema(
|
|
595387
|
+
() => zodSchema3(
|
|
595388
|
+
external_exports2.discriminatedUnion("type", [
|
|
595389
|
+
external_exports2.object({
|
|
595390
|
+
type: external_exports2.literal("code_execution_result"),
|
|
595391
|
+
stdout: external_exports2.string(),
|
|
595392
|
+
stderr: external_exports2.string(),
|
|
595393
|
+
return_code: external_exports2.number(),
|
|
595394
|
+
content: external_exports2.array(
|
|
595395
|
+
external_exports2.object({
|
|
595396
|
+
type: external_exports2.literal("code_execution_output"),
|
|
595397
|
+
file_id: external_exports2.string()
|
|
595398
|
+
})
|
|
595399
|
+
).optional().default([])
|
|
595400
|
+
}),
|
|
595401
|
+
external_exports2.object({
|
|
595402
|
+
type: external_exports2.literal("encrypted_code_execution_result"),
|
|
595403
|
+
encrypted_stdout: external_exports2.string(),
|
|
595404
|
+
stderr: external_exports2.string(),
|
|
595405
|
+
return_code: external_exports2.number(),
|
|
595406
|
+
content: external_exports2.array(
|
|
595407
|
+
external_exports2.object({
|
|
595408
|
+
type: external_exports2.literal("code_execution_output"),
|
|
595409
|
+
file_id: external_exports2.string()
|
|
595410
|
+
})
|
|
595411
|
+
).optional().default([])
|
|
595412
|
+
}),
|
|
595413
|
+
external_exports2.object({
|
|
595414
|
+
type: external_exports2.literal("bash_code_execution_result"),
|
|
595415
|
+
content: external_exports2.array(
|
|
595416
|
+
external_exports2.object({
|
|
595417
|
+
type: external_exports2.literal("bash_code_execution_output"),
|
|
595418
|
+
file_id: external_exports2.string()
|
|
595419
|
+
})
|
|
595420
|
+
),
|
|
595421
|
+
stdout: external_exports2.string(),
|
|
595422
|
+
stderr: external_exports2.string(),
|
|
595423
|
+
return_code: external_exports2.number()
|
|
595424
|
+
}),
|
|
595425
|
+
external_exports2.object({
|
|
595426
|
+
type: external_exports2.literal("bash_code_execution_tool_result_error"),
|
|
595427
|
+
error_code: external_exports2.string()
|
|
595428
|
+
}),
|
|
595429
|
+
external_exports2.object({
|
|
595430
|
+
type: external_exports2.literal("text_editor_code_execution_tool_result_error"),
|
|
595431
|
+
error_code: external_exports2.string()
|
|
595432
|
+
}),
|
|
595433
|
+
external_exports2.object({
|
|
595434
|
+
type: external_exports2.literal("text_editor_code_execution_view_result"),
|
|
595435
|
+
content: external_exports2.string(),
|
|
595436
|
+
file_type: external_exports2.string(),
|
|
595437
|
+
num_lines: external_exports2.number().nullable(),
|
|
595438
|
+
start_line: external_exports2.number().nullable(),
|
|
595439
|
+
total_lines: external_exports2.number().nullable()
|
|
595440
|
+
}),
|
|
595441
|
+
external_exports2.object({
|
|
595442
|
+
type: external_exports2.literal("text_editor_code_execution_create_result"),
|
|
595443
|
+
is_file_update: external_exports2.boolean()
|
|
595444
|
+
}),
|
|
595445
|
+
external_exports2.object({
|
|
595446
|
+
type: external_exports2.literal("text_editor_code_execution_str_replace_result"),
|
|
595447
|
+
lines: external_exports2.array(external_exports2.string()).nullable(),
|
|
595448
|
+
new_lines: external_exports2.number().nullable(),
|
|
595449
|
+
new_start: external_exports2.number().nullable(),
|
|
595450
|
+
old_lines: external_exports2.number().nullable(),
|
|
595451
|
+
old_start: external_exports2.number().nullable()
|
|
595452
|
+
})
|
|
595453
|
+
])
|
|
595454
|
+
)
|
|
595455
|
+
);
|
|
595456
|
+
var codeExecution_20260120InputSchema = lazySchema(
|
|
595457
|
+
() => zodSchema3(
|
|
595458
|
+
external_exports2.discriminatedUnion("type", [
|
|
595459
|
+
external_exports2.object({
|
|
595460
|
+
type: external_exports2.literal("programmatic-tool-call"),
|
|
595461
|
+
code: external_exports2.string()
|
|
595462
|
+
}),
|
|
595463
|
+
external_exports2.object({
|
|
595464
|
+
type: external_exports2.literal("bash_code_execution"),
|
|
595465
|
+
command: external_exports2.string()
|
|
595466
|
+
}),
|
|
595467
|
+
external_exports2.discriminatedUnion("command", [
|
|
595468
|
+
external_exports2.object({
|
|
595469
|
+
type: external_exports2.literal("text_editor_code_execution"),
|
|
595470
|
+
command: external_exports2.literal("view"),
|
|
595471
|
+
path: external_exports2.string()
|
|
595472
|
+
}),
|
|
595473
|
+
external_exports2.object({
|
|
595474
|
+
type: external_exports2.literal("text_editor_code_execution"),
|
|
595475
|
+
command: external_exports2.literal("create"),
|
|
595476
|
+
path: external_exports2.string(),
|
|
595477
|
+
file_text: external_exports2.string().nullish()
|
|
595478
|
+
}),
|
|
595479
|
+
external_exports2.object({
|
|
595480
|
+
type: external_exports2.literal("text_editor_code_execution"),
|
|
595481
|
+
command: external_exports2.literal("str_replace"),
|
|
595482
|
+
path: external_exports2.string(),
|
|
595483
|
+
old_str: external_exports2.string(),
|
|
595484
|
+
new_str: external_exports2.string()
|
|
595485
|
+
})
|
|
595486
|
+
])
|
|
595487
|
+
])
|
|
595488
|
+
)
|
|
595489
|
+
);
|
|
595490
|
+
var factory8 = createProviderToolFactoryWithOutputSchema({
|
|
595491
|
+
id: "anthropic.code_execution_20260120",
|
|
595492
|
+
inputSchema: codeExecution_20260120InputSchema,
|
|
595493
|
+
outputSchema: codeExecution_20260120OutputSchema,
|
|
595494
|
+
supportsDeferredResults: true
|
|
595495
|
+
});
|
|
595496
|
+
var codeExecution_20260120 = (args = {}) => {
|
|
595497
|
+
return factory8(args);
|
|
594792
595498
|
};
|
|
594793
595499
|
var toolSearchRegex_20251119OutputSchema = lazySchema(
|
|
594794
595500
|
() => zodSchema3(
|
|
@@ -594821,18 +595527,18 @@ var toolSearchRegex_20251119InputSchema = lazySchema(
|
|
|
594821
595527
|
})
|
|
594822
595528
|
)
|
|
594823
595529
|
);
|
|
594824
|
-
var
|
|
595530
|
+
var factory9 = createProviderToolFactoryWithOutputSchema({
|
|
594825
595531
|
id: "anthropic.tool_search_regex_20251119",
|
|
594826
595532
|
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
594827
595533
|
outputSchema: toolSearchRegex_20251119OutputSchema,
|
|
594828
595534
|
supportsDeferredResults: true
|
|
594829
595535
|
});
|
|
594830
595536
|
var toolSearchRegex_20251119 = (args = {}) => {
|
|
594831
|
-
return
|
|
595537
|
+
return factory9(args);
|
|
594832
595538
|
};
|
|
594833
595539
|
function convertToString(data3) {
|
|
594834
595540
|
if (typeof data3 === "string") {
|
|
594835
|
-
return
|
|
595541
|
+
return new TextDecoder().decode(convertBase64ToUint8Array(data3));
|
|
594836
595542
|
}
|
|
594837
595543
|
if (data3 instanceof Uint8Array) {
|
|
594838
595544
|
return new TextDecoder().decode(data3);
|
|
@@ -594862,7 +595568,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
594862
595568
|
cacheControlValidator,
|
|
594863
595569
|
toolNameMapping
|
|
594864
595570
|
}) {
|
|
594865
|
-
var _a21, _b17, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
595571
|
+
var _a21, _b17, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
594866
595572
|
const betas = /* @__PURE__ */ new Set();
|
|
594867
595573
|
const blocks = groupIntoBlocks(prompt);
|
|
594868
595574
|
const validator = cacheControlValidator || new CacheControlValidator();
|
|
@@ -595300,8 +596006,8 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595300
596006
|
break;
|
|
595301
596007
|
}
|
|
595302
596008
|
const callerOptions = (_l = part.providerOptions) == null ? void 0 : _l.anthropic;
|
|
595303
|
-
const caller = (callerOptions == null ? void 0 : callerOptions.caller) ? callerOptions.caller.type === "code_execution_20250825" && callerOptions.caller.toolId ? {
|
|
595304
|
-
type:
|
|
596009
|
+
const caller = (callerOptions == null ? void 0 : callerOptions.caller) ? (callerOptions.caller.type === "code_execution_20250825" || callerOptions.caller.type === "code_execution_20260120") && callerOptions.caller.toolId ? {
|
|
596010
|
+
type: callerOptions.caller.type,
|
|
595305
596011
|
tool_id: callerOptions.caller.toolId
|
|
595306
596012
|
} : callerOptions.caller.type === "direct" ? { type: "direct" } : void 0 : void 0;
|
|
595307
596013
|
anthropicContent.push({
|
|
@@ -595400,6 +596106,25 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595400
596106
|
},
|
|
595401
596107
|
cache_control: cacheControl
|
|
595402
596108
|
});
|
|
596109
|
+
} else if (output.value.type === "encrypted_code_execution_result") {
|
|
596110
|
+
const codeExecutionOutput = await validateTypes2({
|
|
596111
|
+
value: output.value,
|
|
596112
|
+
schema: codeExecution_20260120OutputSchema
|
|
596113
|
+
});
|
|
596114
|
+
if (codeExecutionOutput.type === "encrypted_code_execution_result") {
|
|
596115
|
+
anthropicContent.push({
|
|
596116
|
+
type: "code_execution_tool_result",
|
|
596117
|
+
tool_use_id: part.toolCallId,
|
|
596118
|
+
content: {
|
|
596119
|
+
type: codeExecutionOutput.type,
|
|
596120
|
+
encrypted_stdout: codeExecutionOutput.encrypted_stdout,
|
|
596121
|
+
stderr: codeExecutionOutput.stderr,
|
|
596122
|
+
return_code: codeExecutionOutput.return_code,
|
|
596123
|
+
content: (_p = codeExecutionOutput.content) != null ? _p : []
|
|
596124
|
+
},
|
|
596125
|
+
cache_control: cacheControl
|
|
596126
|
+
});
|
|
596127
|
+
}
|
|
595403
596128
|
} else {
|
|
595404
596129
|
const codeExecutionOutput = await validateTypes2({
|
|
595405
596130
|
value: output.value,
|
|
@@ -595414,7 +596139,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595414
596139
|
stdout: codeExecutionOutput.stdout,
|
|
595415
596140
|
stderr: codeExecutionOutput.stderr,
|
|
595416
596141
|
return_code: codeExecutionOutput.return_code,
|
|
595417
|
-
content: (
|
|
596142
|
+
content: (_q = codeExecutionOutput.content) != null ? _q : []
|
|
595418
596143
|
},
|
|
595419
596144
|
cache_control: cacheControl
|
|
595420
596145
|
});
|
|
@@ -595447,9 +596172,9 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595447
596172
|
errorValue = output.value;
|
|
595448
596173
|
}
|
|
595449
596174
|
} catch (e) {
|
|
595450
|
-
const extractedErrorCode = (
|
|
596175
|
+
const extractedErrorCode = (_r = output.value) == null ? void 0 : _r.errorCode;
|
|
595451
596176
|
errorValue = {
|
|
595452
|
-
errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "
|
|
596177
|
+
errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "unavailable"
|
|
595453
596178
|
};
|
|
595454
596179
|
}
|
|
595455
596180
|
anthropicContent.push({
|
|
@@ -595457,7 +596182,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
595457
596182
|
tool_use_id: part.toolCallId,
|
|
595458
596183
|
content: {
|
|
595459
596184
|
type: "web_fetch_tool_result_error",
|
|
595460
|
-
error_code: (
|
|
596185
|
+
error_code: (_s = errorValue.errorCode) != null ? _s : "unavailable"
|
|
595461
596186
|
},
|
|
595462
596187
|
cache_control: cacheControl
|
|
595463
596188
|
});
|
|
@@ -595730,7 +596455,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
595730
596455
|
providerOptions,
|
|
595731
596456
|
stream: stream5
|
|
595732
596457
|
}) {
|
|
595733
|
-
var _a21, _b17, _c, _d, _e, _f;
|
|
596458
|
+
var _a21, _b17, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
595734
596459
|
const warnings = [];
|
|
595735
596460
|
if (frequencyPenalty != null) {
|
|
595736
596461
|
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
@@ -595785,10 +596510,39 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
595785
596510
|
const {
|
|
595786
596511
|
maxOutputTokens: maxOutputTokensForModel,
|
|
595787
596512
|
supportsStructuredOutput: modelSupportsStructuredOutput,
|
|
596513
|
+
rejectsSamplingParameters,
|
|
595788
596514
|
isKnownModel
|
|
595789
596515
|
} = getModelCapabilities(this.modelId);
|
|
596516
|
+
if (rejectsSamplingParameters) {
|
|
596517
|
+
if (temperature != null) {
|
|
596518
|
+
warnings.push({
|
|
596519
|
+
type: "unsupported",
|
|
596520
|
+
feature: "temperature",
|
|
596521
|
+
details: `temperature is not supported by ${this.modelId} and will be ignored`
|
|
596522
|
+
});
|
|
596523
|
+
temperature = void 0;
|
|
596524
|
+
}
|
|
596525
|
+
if (topK != null) {
|
|
596526
|
+
warnings.push({
|
|
596527
|
+
type: "unsupported",
|
|
596528
|
+
feature: "topK",
|
|
596529
|
+
details: `topK is not supported by ${this.modelId} and will be ignored`
|
|
596530
|
+
});
|
|
596531
|
+
topK = void 0;
|
|
596532
|
+
}
|
|
596533
|
+
if (topP != null) {
|
|
596534
|
+
warnings.push({
|
|
596535
|
+
type: "unsupported",
|
|
596536
|
+
feature: "topP",
|
|
596537
|
+
details: `topP is not supported by ${this.modelId} and will be ignored`
|
|
596538
|
+
});
|
|
596539
|
+
topP = void 0;
|
|
596540
|
+
}
|
|
596541
|
+
}
|
|
596542
|
+
const isAnthropicModel = isKnownModel || this.modelId.startsWith("claude-");
|
|
595790
596543
|
const supportsStructuredOutput = ((_a21 = this.config.supportsNativeStructuredOutput) != null ? _a21 : true) && modelSupportsStructuredOutput;
|
|
595791
|
-
const
|
|
596544
|
+
const supportsStrictTools = ((_b17 = this.config.supportsStrictTools) != null ? _b17 : true) && modelSupportsStructuredOutput;
|
|
596545
|
+
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
595792
596546
|
const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
595793
596547
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
595794
596548
|
type: "function",
|
|
@@ -595803,6 +596557,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
595803
596557
|
providerToolNames: {
|
|
595804
596558
|
"anthropic.code_execution_20250522": "code_execution",
|
|
595805
596559
|
"anthropic.code_execution_20250825": "code_execution",
|
|
596560
|
+
"anthropic.code_execution_20260120": "code_execution",
|
|
595806
596561
|
"anthropic.computer_20241022": "computer",
|
|
595807
596562
|
"anthropic.computer_20250124": "computer",
|
|
595808
596563
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
@@ -595813,21 +596568,24 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
595813
596568
|
"anthropic.bash_20250124": "bash",
|
|
595814
596569
|
"anthropic.memory_20250818": "memory",
|
|
595815
596570
|
"anthropic.web_search_20250305": "web_search",
|
|
596571
|
+
"anthropic.web_search_20260209": "web_search",
|
|
595816
596572
|
"anthropic.web_fetch_20250910": "web_fetch",
|
|
596573
|
+
"anthropic.web_fetch_20260209": "web_fetch",
|
|
595817
596574
|
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
595818
596575
|
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25"
|
|
595819
596576
|
}
|
|
595820
596577
|
});
|
|
595821
596578
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
|
|
595822
596579
|
prompt,
|
|
595823
|
-
sendReasoning: (
|
|
596580
|
+
sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
|
|
595824
596581
|
warnings,
|
|
595825
596582
|
cacheControlValidator,
|
|
595826
596583
|
toolNameMapping
|
|
595827
596584
|
});
|
|
595828
|
-
const thinkingType = (
|
|
596585
|
+
const thinkingType = (_e = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _e.type;
|
|
595829
596586
|
const isThinking = thinkingType === "enabled" || thinkingType === "adaptive";
|
|
595830
|
-
let thinkingBudget = thinkingType === "enabled" ? (
|
|
596587
|
+
let thinkingBudget = thinkingType === "enabled" ? (_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.budgetTokens : void 0;
|
|
596588
|
+
const thinkingDisplay = thinkingType === "adaptive" ? (_g = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _g.display : void 0;
|
|
595831
596589
|
const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
|
|
595832
596590
|
const baseArgs = {
|
|
595833
596591
|
// model id:
|
|
@@ -595842,21 +596600,43 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
595842
596600
|
...isThinking && {
|
|
595843
596601
|
thinking: {
|
|
595844
596602
|
type: thinkingType,
|
|
595845
|
-
...thinkingBudget != null && { budget_tokens: thinkingBudget }
|
|
596603
|
+
...thinkingBudget != null && { budget_tokens: thinkingBudget },
|
|
596604
|
+
...thinkingDisplay != null && { display: thinkingDisplay }
|
|
595846
596605
|
}
|
|
595847
596606
|
},
|
|
595848
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
595849
|
-
output_config: {
|
|
596607
|
+
...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) && {
|
|
596608
|
+
output_config: {
|
|
596609
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
596610
|
+
effort: anthropicOptions.effort
|
|
596611
|
+
},
|
|
596612
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) && {
|
|
596613
|
+
task_budget: {
|
|
596614
|
+
type: anthropicOptions.taskBudget.type,
|
|
596615
|
+
total: anthropicOptions.taskBudget.total,
|
|
596616
|
+
...anthropicOptions.taskBudget.remaining != null && {
|
|
596617
|
+
remaining: anthropicOptions.taskBudget.remaining
|
|
596618
|
+
}
|
|
596619
|
+
}
|
|
596620
|
+
},
|
|
596621
|
+
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
596622
|
+
format: {
|
|
596623
|
+
type: "json_schema",
|
|
596624
|
+
schema: responseFormat.schema
|
|
596625
|
+
}
|
|
596626
|
+
}
|
|
596627
|
+
}
|
|
595850
596628
|
},
|
|
595851
596629
|
...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
|
|
595852
596630
|
speed: anthropicOptions.speed
|
|
595853
596631
|
},
|
|
595854
|
-
|
|
595855
|
-
|
|
595856
|
-
|
|
595857
|
-
|
|
595858
|
-
|
|
595859
|
-
|
|
596632
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.inferenceGeo) && {
|
|
596633
|
+
inference_geo: anthropicOptions.inferenceGeo
|
|
596634
|
+
},
|
|
596635
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
|
|
596636
|
+
cache_control: anthropicOptions.cacheControl
|
|
596637
|
+
},
|
|
596638
|
+
...((_h = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _h.userId) != null && {
|
|
596639
|
+
metadata: { user_id: anthropicOptions.metadata.userId }
|
|
595860
596640
|
},
|
|
595861
596641
|
// mcp servers:
|
|
595862
596642
|
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && {
|
|
@@ -595981,7 +596761,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
595981
596761
|
}
|
|
595982
596762
|
baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0);
|
|
595983
596763
|
} else {
|
|
595984
|
-
if (topP != null && temperature != null) {
|
|
596764
|
+
if (isAnthropicModel && topP != null && temperature != null) {
|
|
595985
596765
|
warnings.push({
|
|
595986
596766
|
type: "unsupported",
|
|
595987
596767
|
feature: "topP",
|
|
@@ -596014,7 +596794,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596014
596794
|
betas.add("skills-2025-10-02");
|
|
596015
596795
|
betas.add("files-api-2025-04-14");
|
|
596016
596796
|
if (!(tools == null ? void 0 : tools.some(
|
|
596017
|
-
(tool3) => tool3.type === "provider" && tool3.id === "anthropic.code_execution_20250825"
|
|
596797
|
+
(tool3) => tool3.type === "provider" && (tool3.id === "anthropic.code_execution_20250825" || tool3.id === "anthropic.code_execution_20260120")
|
|
596018
596798
|
))) {
|
|
596019
596799
|
warnings.push({
|
|
596020
596800
|
type: "other",
|
|
@@ -596025,16 +596805,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596025
596805
|
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
596026
596806
|
betas.add("effort-2025-11-24");
|
|
596027
596807
|
}
|
|
596808
|
+
if (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) {
|
|
596809
|
+
betas.add("task-budgets-2026-03-13");
|
|
596810
|
+
}
|
|
596028
596811
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
|
|
596029
596812
|
betas.add("fast-mode-2026-02-01");
|
|
596030
596813
|
}
|
|
596031
|
-
|
|
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
|
-
}
|
|
596814
|
+
const defaultEagerInputStreaming = stream5 && ((_i = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _i : true);
|
|
596038
596815
|
const {
|
|
596039
596816
|
tools: anthropicTools2,
|
|
596040
596817
|
toolChoice: anthropicToolChoice,
|
|
@@ -596046,13 +596823,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596046
596823
|
toolChoice: { type: "required" },
|
|
596047
596824
|
disableParallelToolUse: true,
|
|
596048
596825
|
cacheControlValidator,
|
|
596049
|
-
supportsStructuredOutput: false
|
|
596826
|
+
supportsStructuredOutput: false,
|
|
596827
|
+
supportsStrictTools,
|
|
596828
|
+
defaultEagerInputStreaming
|
|
596050
596829
|
} : {
|
|
596051
596830
|
tools: tools != null ? tools : [],
|
|
596052
596831
|
toolChoice,
|
|
596053
596832
|
disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,
|
|
596054
596833
|
cacheControlValidator,
|
|
596055
|
-
supportsStructuredOutput
|
|
596834
|
+
supportsStructuredOutput,
|
|
596835
|
+
supportsStrictTools,
|
|
596836
|
+
defaultEagerInputStreaming
|
|
596056
596837
|
}
|
|
596057
596838
|
);
|
|
596058
596839
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -596065,7 +596846,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596065
596846
|
// do not send when not streaming
|
|
596066
596847
|
},
|
|
596067
596848
|
warnings: [...warnings, ...toolWarnings, ...cacheWarnings],
|
|
596068
|
-
betas: /* @__PURE__ */ new Set([
|
|
596849
|
+
betas: /* @__PURE__ */ new Set([
|
|
596850
|
+
...betas,
|
|
596851
|
+
...toolsBetas,
|
|
596852
|
+
...userSuppliedBetas,
|
|
596853
|
+
...(_j = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _j : []
|
|
596854
|
+
]),
|
|
596069
596855
|
usesJsonResponseTool: jsonResponseTool != null,
|
|
596070
596856
|
toolNameMapping,
|
|
596071
596857
|
providerOptionsName,
|
|
@@ -596098,9 +596884,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596098
596884
|
var _a21, _b17, _c;
|
|
596099
596885
|
return (_c = (_b17 = (_a21 = this.config).buildRequestUrl) == null ? void 0 : _b17.call(_a21, this.config.baseURL, isStreaming)) != null ? _c : `${this.config.baseURL}/messages`;
|
|
596100
596886
|
}
|
|
596101
|
-
transformRequestBody(args) {
|
|
596887
|
+
transformRequestBody(args, betas) {
|
|
596102
596888
|
var _a21, _b17, _c;
|
|
596103
|
-
return (_c = (_b17 = (_a21 = this.config).transformRequestBody) == null ? void 0 : _b17.call(_a21, args)) != null ? _c : args;
|
|
596889
|
+
return (_c = (_b17 = (_a21 = this.config).transformRequestBody) == null ? void 0 : _b17.call(_a21, args, betas)) != null ? _c : args;
|
|
596104
596890
|
}
|
|
596105
596891
|
extractCitationDocuments(prompt) {
|
|
596106
596892
|
const isCitationPart = (part) => {
|
|
@@ -596126,7 +596912,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596126
596912
|
});
|
|
596127
596913
|
}
|
|
596128
596914
|
async doGenerate(options8) {
|
|
596129
|
-
var _a21, _b17, _c, _d, _e, _f;
|
|
596915
|
+
var _a21, _b17, _c, _d, _e, _f, _g;
|
|
596130
596916
|
const {
|
|
596131
596917
|
args,
|
|
596132
596918
|
warnings,
|
|
@@ -596143,6 +596929,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596143
596929
|
const citationDocuments = [
|
|
596144
596930
|
...this.extractCitationDocuments(options8.prompt)
|
|
596145
596931
|
];
|
|
596932
|
+
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(
|
|
596933
|
+
args.tools
|
|
596934
|
+
);
|
|
596146
596935
|
const {
|
|
596147
596936
|
responseHeaders,
|
|
596148
596937
|
value: response,
|
|
@@ -596150,7 +596939,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596150
596939
|
} = await postJsonToApi2({
|
|
596151
596940
|
url: this.buildRequestUrl(false),
|
|
596152
596941
|
headers: await this.getHeaders({ betas, headers: options8.headers }),
|
|
596153
|
-
body: this.transformRequestBody(args),
|
|
596942
|
+
body: this.transformRequestBody(args, betas),
|
|
596154
596943
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
596155
596944
|
successfulResponseHandler: createJsonResponseHandler(
|
|
596156
596945
|
anthropicMessagesResponseSchema
|
|
@@ -596264,7 +597053,10 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596264
597053
|
toolCallId: part.id,
|
|
596265
597054
|
toolName: toolNameMapping.toCustomToolName(part.name),
|
|
596266
597055
|
input: JSON.stringify(inputToSerialize),
|
|
596267
|
-
providerExecuted: true
|
|
597056
|
+
providerExecuted: true,
|
|
597057
|
+
// We want this 'code_execution' tool call to be allowed even if the tool is not explicitly provided.
|
|
597058
|
+
// Since the validation generally bypasses dynamic tools, we mark this specific tool as dynamic.
|
|
597059
|
+
...markCodeExecutionDynamic && part.name === "code_execution" ? { dynamic: true } : {}
|
|
596268
597060
|
});
|
|
596269
597061
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
596270
597062
|
serverToolCalls[part.id] = part.name;
|
|
@@ -596408,6 +597200,19 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596408
597200
|
content: (_c = part.content.content) != null ? _c : []
|
|
596409
597201
|
}
|
|
596410
597202
|
});
|
|
597203
|
+
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
597204
|
+
content9.push({
|
|
597205
|
+
type: "tool-result",
|
|
597206
|
+
toolCallId: part.tool_use_id,
|
|
597207
|
+
toolName: toolNameMapping.toCustomToolName("code_execution"),
|
|
597208
|
+
result: {
|
|
597209
|
+
type: part.content.type,
|
|
597210
|
+
encrypted_stdout: part.content.encrypted_stdout,
|
|
597211
|
+
stderr: part.content.stderr,
|
|
597212
|
+
return_code: part.content.return_code,
|
|
597213
|
+
content: (_d = part.content.content) != null ? _d : []
|
|
597214
|
+
}
|
|
597215
|
+
});
|
|
596411
597216
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
596412
597217
|
content9.push({
|
|
596413
597218
|
type: "tool-result",
|
|
@@ -596484,13 +597289,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596484
597289
|
finishReason: response.stop_reason,
|
|
596485
597290
|
isJsonResponseFromTool
|
|
596486
597291
|
}),
|
|
596487
|
-
raw: (
|
|
597292
|
+
raw: (_e = response.stop_reason) != null ? _e : void 0
|
|
596488
597293
|
},
|
|
596489
597294
|
usage: convertAnthropicMessagesUsage({ usage: response.usage }),
|
|
596490
597295
|
request: { body: args },
|
|
596491
597296
|
response: {
|
|
596492
|
-
id: (
|
|
596493
|
-
modelId: (
|
|
597297
|
+
id: (_f = response.id) != null ? _f : void 0,
|
|
597298
|
+
modelId: (_g = response.model) != null ? _g : void 0,
|
|
596494
597299
|
headers: responseHeaders,
|
|
596495
597300
|
body: rawResponse
|
|
596496
597301
|
},
|
|
@@ -596547,11 +597352,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596547
597352
|
const citationDocuments = [
|
|
596548
597353
|
...this.extractCitationDocuments(options8.prompt)
|
|
596549
597354
|
];
|
|
597355
|
+
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(
|
|
597356
|
+
body.tools
|
|
597357
|
+
);
|
|
596550
597358
|
const url4 = this.buildRequestUrl(true);
|
|
596551
597359
|
const { responseHeaders, value: response } = await postJsonToApi2({
|
|
596552
597360
|
url: url4,
|
|
596553
597361
|
headers: await this.getHeaders({ betas, headers: options8.headers }),
|
|
596554
|
-
body: this.transformRequestBody(body),
|
|
597362
|
+
body: this.transformRequestBody(body, betas),
|
|
596555
597363
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
596556
597364
|
successfulResponseHandler: createEventSourceResponseHandler(
|
|
596557
597365
|
anthropicMessagesChunkSchema
|
|
@@ -596587,7 +597395,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596587
597395
|
controller.enqueue({ type: "stream-start", warnings });
|
|
596588
597396
|
},
|
|
596589
597397
|
transform(chunk, controller) {
|
|
596590
|
-
var _a22, _b22, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
597398
|
+
var _a22, _b22, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
596591
597399
|
if (options8.includeRawChunks) {
|
|
596592
597400
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
596593
597401
|
}
|
|
@@ -596696,12 +597504,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596696
597504
|
].includes(part.name)) {
|
|
596697
597505
|
const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
|
|
596698
597506
|
const customToolName = toolNameMapping.toCustomToolName(providerToolName);
|
|
597507
|
+
const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
|
|
596699
597508
|
contentBlocks[value2.index] = {
|
|
596700
597509
|
type: "tool-call",
|
|
596701
597510
|
toolCallId: part.id,
|
|
596702
597511
|
toolName: customToolName,
|
|
596703
|
-
input:
|
|
597512
|
+
input: finalInput,
|
|
596704
597513
|
providerExecuted: true,
|
|
597514
|
+
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
596705
597515
|
firstDelta: true,
|
|
596706
597516
|
providerToolName: part.name
|
|
596707
597517
|
};
|
|
@@ -596709,7 +597519,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596709
597519
|
type: "tool-input-start",
|
|
596710
597520
|
id: part.id,
|
|
596711
597521
|
toolName: customToolName,
|
|
596712
|
-
providerExecuted: true
|
|
597522
|
+
providerExecuted: true,
|
|
597523
|
+
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {}
|
|
596713
597524
|
});
|
|
596714
597525
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
596715
597526
|
serverToolCalls[part.id] = part.name;
|
|
@@ -596834,6 +597645,19 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596834
597645
|
content: (_c = part.content.content) != null ? _c : []
|
|
596835
597646
|
}
|
|
596836
597647
|
});
|
|
597648
|
+
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
597649
|
+
controller.enqueue({
|
|
597650
|
+
type: "tool-result",
|
|
597651
|
+
toolCallId: part.tool_use_id,
|
|
597652
|
+
toolName: toolNameMapping.toCustomToolName("code_execution"),
|
|
597653
|
+
result: {
|
|
597654
|
+
type: part.content.type,
|
|
597655
|
+
encrypted_stdout: part.content.encrypted_stdout,
|
|
597656
|
+
stderr: part.content.stderr,
|
|
597657
|
+
return_code: part.content.return_code,
|
|
597658
|
+
content: (_d = part.content.content) != null ? _d : []
|
|
597659
|
+
}
|
|
597660
|
+
});
|
|
596837
597661
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
596838
597662
|
controller.enqueue({
|
|
596839
597663
|
type: "tool-result",
|
|
@@ -596983,6 +597807,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
596983
597807
|
toolName: contentBlock.toolName,
|
|
596984
597808
|
input: finalInput,
|
|
596985
597809
|
providerExecuted: contentBlock.providerExecuted,
|
|
597810
|
+
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
596986
597811
|
...contentBlock.caller && {
|
|
596987
597812
|
providerMetadata: {
|
|
596988
597813
|
anthropic: {
|
|
@@ -597100,12 +597925,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597100
597925
|
}
|
|
597101
597926
|
case "message_start": {
|
|
597102
597927
|
usage.input_tokens = value2.message.usage.input_tokens;
|
|
597103
|
-
usage.cache_read_input_tokens = (
|
|
597104
|
-
usage.cache_creation_input_tokens = (
|
|
597928
|
+
usage.cache_read_input_tokens = (_e = value2.message.usage.cache_read_input_tokens) != null ? _e : 0;
|
|
597929
|
+
usage.cache_creation_input_tokens = (_f = value2.message.usage.cache_creation_input_tokens) != null ? _f : 0;
|
|
597105
597930
|
rawUsage = {
|
|
597106
597931
|
...value2.message.usage
|
|
597107
597932
|
};
|
|
597108
|
-
cacheCreationInputTokens = (
|
|
597933
|
+
cacheCreationInputTokens = (_g = value2.message.usage.cache_creation_input_tokens) != null ? _g : null;
|
|
597109
597934
|
if (value2.message.container != null) {
|
|
597110
597935
|
container = {
|
|
597111
597936
|
expiresAt: value2.message.container.expires_at,
|
|
@@ -597124,8 +597949,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597124
597949
|
}
|
|
597125
597950
|
controller.enqueue({
|
|
597126
597951
|
type: "response-metadata",
|
|
597127
|
-
id: (
|
|
597128
|
-
modelId: (
|
|
597952
|
+
id: (_h = value2.message.id) != null ? _h : void 0,
|
|
597953
|
+
modelId: (_i = value2.message.model) != null ? _i : void 0
|
|
597129
597954
|
});
|
|
597130
597955
|
if (value2.message.content != null) {
|
|
597131
597956
|
for (let contentIndex = 0; contentIndex < value2.message.content.length; contentIndex++) {
|
|
@@ -597141,7 +597966,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597141
597966
|
id: part.id,
|
|
597142
597967
|
toolName: part.name
|
|
597143
597968
|
});
|
|
597144
|
-
const inputStr = JSON.stringify((
|
|
597969
|
+
const inputStr = JSON.stringify((_j = part.input) != null ? _j : {});
|
|
597145
597970
|
controller.enqueue({
|
|
597146
597971
|
type: "tool-input-delta",
|
|
597147
597972
|
id: part.id,
|
|
@@ -597189,17 +598014,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597189
598014
|
finishReason: value2.delta.stop_reason,
|
|
597190
598015
|
isJsonResponseFromTool
|
|
597191
598016
|
}),
|
|
597192
|
-
raw: (
|
|
598017
|
+
raw: (_k = value2.delta.stop_reason) != null ? _k : void 0
|
|
597193
598018
|
};
|
|
597194
|
-
stopSequence = (
|
|
598019
|
+
stopSequence = (_l = value2.delta.stop_sequence) != null ? _l : null;
|
|
597195
598020
|
container = value2.delta.container != null ? {
|
|
597196
598021
|
expiresAt: value2.delta.container.expires_at,
|
|
597197
598022
|
id: value2.delta.container.id,
|
|
597198
|
-
skills: (
|
|
598023
|
+
skills: (_n = (_m = value2.delta.container.skills) == null ? void 0 : _m.map((skill) => ({
|
|
597199
598024
|
type: skill.type,
|
|
597200
598025
|
skillId: skill.skill_id,
|
|
597201
598026
|
version: skill.version
|
|
597202
|
-
}))) != null ?
|
|
598027
|
+
}))) != null ? _n : null
|
|
597203
598028
|
} : null;
|
|
597204
598029
|
if (value2.context_management) {
|
|
597205
598030
|
contextManagement = mapAnthropicResponseContextManagement(
|
|
@@ -597284,56 +598109,82 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
597284
598109
|
}
|
|
597285
598110
|
};
|
|
597286
598111
|
function getModelCapabilities(modelId) {
|
|
597287
|
-
if (modelId.includes("claude-
|
|
598112
|
+
if (modelId.includes("claude-opus-4-7")) {
|
|
598113
|
+
return {
|
|
598114
|
+
maxOutputTokens: 128e3,
|
|
598115
|
+
supportsStructuredOutput: true,
|
|
598116
|
+
rejectsSamplingParameters: true,
|
|
598117
|
+
isKnownModel: true
|
|
598118
|
+
};
|
|
598119
|
+
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
597288
598120
|
return {
|
|
597289
598121
|
maxOutputTokens: 128e3,
|
|
597290
598122
|
supportsStructuredOutput: true,
|
|
598123
|
+
rejectsSamplingParameters: false,
|
|
597291
598124
|
isKnownModel: true
|
|
597292
598125
|
};
|
|
597293
598126
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
597294
598127
|
return {
|
|
597295
598128
|
maxOutputTokens: 64e3,
|
|
597296
598129
|
supportsStructuredOutput: true,
|
|
598130
|
+
rejectsSamplingParameters: false,
|
|
597297
598131
|
isKnownModel: true
|
|
597298
598132
|
};
|
|
597299
598133
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
597300
598134
|
return {
|
|
597301
598135
|
maxOutputTokens: 32e3,
|
|
597302
598136
|
supportsStructuredOutput: true,
|
|
598137
|
+
rejectsSamplingParameters: false,
|
|
597303
598138
|
isKnownModel: true
|
|
597304
598139
|
};
|
|
597305
|
-
} else if (modelId.includes("claude-sonnet-4-")
|
|
598140
|
+
} else if (modelId.includes("claude-sonnet-4-")) {
|
|
597306
598141
|
return {
|
|
597307
598142
|
maxOutputTokens: 64e3,
|
|
597308
598143
|
supportsStructuredOutput: false,
|
|
598144
|
+
rejectsSamplingParameters: false,
|
|
597309
598145
|
isKnownModel: true
|
|
597310
598146
|
};
|
|
597311
598147
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
597312
598148
|
return {
|
|
597313
598149
|
maxOutputTokens: 32e3,
|
|
597314
598150
|
supportsStructuredOutput: false,
|
|
597315
|
-
|
|
597316
|
-
};
|
|
597317
|
-
} else if (modelId.includes("claude-3-5-haiku")) {
|
|
597318
|
-
return {
|
|
597319
|
-
maxOutputTokens: 8192,
|
|
597320
|
-
supportsStructuredOutput: false,
|
|
598151
|
+
rejectsSamplingParameters: false,
|
|
597321
598152
|
isKnownModel: true
|
|
597322
598153
|
};
|
|
597323
598154
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
597324
598155
|
return {
|
|
597325
598156
|
maxOutputTokens: 4096,
|
|
597326
598157
|
supportsStructuredOutput: false,
|
|
598158
|
+
rejectsSamplingParameters: false,
|
|
597327
598159
|
isKnownModel: true
|
|
597328
598160
|
};
|
|
597329
598161
|
} else {
|
|
597330
598162
|
return {
|
|
597331
598163
|
maxOutputTokens: 4096,
|
|
597332
598164
|
supportsStructuredOutput: false,
|
|
598165
|
+
rejectsSamplingParameters: false,
|
|
597333
598166
|
isKnownModel: false
|
|
597334
598167
|
};
|
|
597335
598168
|
}
|
|
597336
598169
|
}
|
|
598170
|
+
function hasWebTool20260209WithoutCodeExecution(tools) {
|
|
598171
|
+
if (!tools) {
|
|
598172
|
+
return false;
|
|
598173
|
+
}
|
|
598174
|
+
let hasWebTool20260209 = false;
|
|
598175
|
+
let hasCodeExecutionTool = false;
|
|
598176
|
+
for (const tool3 of tools) {
|
|
598177
|
+
if ("type" in tool3 && (tool3.type === "web_fetch_20260209" || tool3.type === "web_search_20260209")) {
|
|
598178
|
+
hasWebTool20260209 = true;
|
|
598179
|
+
continue;
|
|
598180
|
+
}
|
|
598181
|
+
if (tool3.name === "code_execution") {
|
|
598182
|
+
hasCodeExecutionTool = true;
|
|
598183
|
+
break;
|
|
598184
|
+
}
|
|
598185
|
+
}
|
|
598186
|
+
return hasWebTool20260209 && !hasCodeExecutionTool;
|
|
598187
|
+
}
|
|
597337
598188
|
function mapAnthropicResponseContextManagement(contextManagement) {
|
|
597338
598189
|
return contextManagement ? {
|
|
597339
598190
|
appliedEdits: contextManagement.applied_edits.map((edit) => {
|
|
@@ -597602,14 +598453,14 @@ var toolSearchBm25_20251119InputSchema = lazySchema(
|
|
|
597602
598453
|
})
|
|
597603
598454
|
)
|
|
597604
598455
|
);
|
|
597605
|
-
var
|
|
598456
|
+
var factory10 = createProviderToolFactoryWithOutputSchema({
|
|
597606
598457
|
id: "anthropic.tool_search_bm25_20251119",
|
|
597607
598458
|
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
597608
598459
|
outputSchema: toolSearchBm25_20251119OutputSchema,
|
|
597609
598460
|
supportsDeferredResults: true
|
|
597610
598461
|
});
|
|
597611
598462
|
var toolSearchBm25_20251119 = (args = {}) => {
|
|
597612
|
-
return
|
|
598463
|
+
return factory10(args);
|
|
597613
598464
|
};
|
|
597614
598465
|
var anthropicTools = {
|
|
597615
598466
|
/**
|
|
@@ -597646,6 +598497,19 @@ var anthropicTools = {
|
|
|
597646
598497
|
* This is the latest version with enhanced Bash support and file operations.
|
|
597647
598498
|
*/
|
|
597648
598499
|
codeExecution_20250825,
|
|
598500
|
+
/**
|
|
598501
|
+
* Claude can analyze data, create visualizations, perform complex calculations,
|
|
598502
|
+
* run system commands, create and edit files, and process uploaded files directly within
|
|
598503
|
+
* the API conversation.
|
|
598504
|
+
*
|
|
598505
|
+
* The code execution tool allows Claude to run both Python and Bash commands and manipulate files,
|
|
598506
|
+
* including writing code, in a secure, sandboxed environment.
|
|
598507
|
+
*
|
|
598508
|
+
* This is the recommended version. Does not require a beta header.
|
|
598509
|
+
*
|
|
598510
|
+
* Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5
|
|
598511
|
+
*/
|
|
598512
|
+
codeExecution_20260120,
|
|
597649
598513
|
/**
|
|
597650
598514
|
* Claude can interact with computer environments through the computer use tool, which
|
|
597651
598515
|
* provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
|
|
@@ -597741,6 +598605,16 @@ var anthropicTools = {
|
|
|
597741
598605
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
597742
598606
|
*/
|
|
597743
598607
|
webFetch_20250910,
|
|
598608
|
+
/**
|
|
598609
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
598610
|
+
*
|
|
598611
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
598612
|
+
* @param allowedDomains - Only fetch from these domains
|
|
598613
|
+
* @param blockedDomains - Never fetch from these domains
|
|
598614
|
+
* @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.
|
|
598615
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
598616
|
+
*/
|
|
598617
|
+
webFetch_20260209,
|
|
597744
598618
|
/**
|
|
597745
598619
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
597746
598620
|
*
|
|
@@ -597750,6 +598624,15 @@ var anthropicTools = {
|
|
|
597750
598624
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
597751
598625
|
*/
|
|
597752
598626
|
webSearch_20250305,
|
|
598627
|
+
/**
|
|
598628
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
598629
|
+
*
|
|
598630
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
598631
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
598632
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
598633
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
598634
|
+
*/
|
|
598635
|
+
webSearch_20260209,
|
|
597753
598636
|
/**
|
|
597754
598637
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
597755
598638
|
*
|
|
@@ -597852,12 +598735,13 @@ var anthropic = createAnthropic();
|
|
|
597852
598735
|
// ../../../vite-plugin-file-sync/dist/ai-service/llm/impl/anthropic.js
|
|
597853
598736
|
var anthropicImpl = (settings) => {
|
|
597854
598737
|
const anthropic2 = createAnthropic(settings.anthropic);
|
|
598738
|
+
const generateBroadEditModelId = process.env.SUPERBLOCKS_EVAL_ANTHROPIC_MODEL_ID ?? "claude-sonnet-4-6";
|
|
597855
598739
|
return {
|
|
597856
|
-
explain: anthropic2("claude-
|
|
597857
|
-
classifyPrompt: anthropic2("claude-
|
|
598740
|
+
explain: anthropic2("claude-haiku-4-5-20251001"),
|
|
598741
|
+
classifyPrompt: anthropic2("claude-haiku-4-5-20251001"),
|
|
597858
598742
|
summarizeMessages: anthropic2("claude-sonnet-4-6"),
|
|
597859
598743
|
fast: anthropic2("claude-haiku-4-5-20251001"),
|
|
597860
|
-
generateBroadEdit: anthropic2(
|
|
598744
|
+
generateBroadEdit: anthropic2(generateBroadEditModelId)
|
|
597861
598745
|
};
|
|
597862
598746
|
};
|
|
597863
598747
|
|
|
@@ -597972,7 +598856,7 @@ var PlaywrightMcpServerManager = class {
|
|
|
597972
598856
|
this.logger.info(`Starting embedded Playwright MCP server: browser=${options8?.browser || "chromium"}, headless=${options8?.headless !== false}`);
|
|
597973
598857
|
}
|
|
597974
598858
|
try {
|
|
597975
|
-
const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-
|
|
598859
|
+
const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-WWPWW4DO.js");
|
|
597976
598860
|
this.server = await startEmbeddedPlaywrightMcpServer({
|
|
597977
598861
|
storageStatePath: options8?.storageStatePath,
|
|
597978
598862
|
jwt: options8?.jwt,
|
|
@@ -606276,7 +607160,69 @@ ${error40.stack ?? error40.message}
|
|
|
606276
607160
|
|
|
606277
607161
|
// ../../../vite-plugin-file-sync/dist/ai-service/state-machine/handlers/awaiting-user.js
|
|
606278
607162
|
init_cjs_shims();
|
|
607163
|
+
var import_ai15 = __toESM(require_dist9());
|
|
607164
|
+
|
|
607165
|
+
// ../../../vite-plugin-file-sync/dist/ai-service/state-machine/handlers/next-steps.js
|
|
607166
|
+
init_cjs_shims();
|
|
606279
607167
|
var import_ai14 = __toESM(require_dist9());
|
|
607168
|
+
var MAX_NEXT_STEPS = 3;
|
|
607169
|
+
var ICON_LIST = NEXT_STEPS_ICON_NAMES.join(", ");
|
|
607170
|
+
var SUMMARY_CHAR_CAP = 4e3;
|
|
607171
|
+
var truncate = (s) => s.length <= SUMMARY_CHAR_CAP ? s : `${s.slice(0, SUMMARY_CHAR_CAP)}\u2026[truncated]`;
|
|
607172
|
+
var NextStepSchema = external_exports.object({
|
|
607173
|
+
label: external_exports.string().describe("Short action title, max 6 words, starts with a verb (e.g. 'Add search and filtering')"),
|
|
607174
|
+
prompt: external_exports.string().describe("Detailed 1-2 sentence prompt that Clark would receive to build this enhancement"),
|
|
607175
|
+
icon: external_exports.enum([...NEXT_STEPS_ICON_NAMES]).optional().describe(`Lucide icon name in kebab-case from: ${ICON_LIST}`)
|
|
607176
|
+
});
|
|
607177
|
+
var NextStepsSchema = external_exports.object({
|
|
607178
|
+
nextSteps: external_exports.array(NextStepSchema).describe("3 follow-up next steps for what the user should build next")
|
|
607179
|
+
});
|
|
607180
|
+
async function getNextSteps({ model, chatSessionStore, logger: logger15, abortSignal }) {
|
|
607181
|
+
const summary = await chatSessionStore.getLatestSummary();
|
|
607182
|
+
if (!summary) {
|
|
607183
|
+
logger15?.info("[next-steps] No build summary found; skipping generation");
|
|
607184
|
+
return [];
|
|
607185
|
+
}
|
|
607186
|
+
const systemPrompt = `You are helping suggest what a user should build next with Clark (an AI app builder) after they just finished building something.
|
|
607187
|
+
|
|
607188
|
+
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.
|
|
607189
|
+
|
|
607190
|
+
Focus on:
|
|
607191
|
+
- New features that complement what was built (e.g. "Add search and filtering", "Add an export to CSV button")
|
|
607192
|
+
- Performance and UX improvements (e.g. "Add loading states and pagination", "Add dark mode support")
|
|
607193
|
+
- Data and workflow enhancements (e.g. "Add edit and delete functionality", "Add role-based access control")
|
|
607194
|
+
|
|
607195
|
+
Do NOT suggest generic improvements \u2014 be specific to the app that was built.
|
|
607196
|
+
Every suggestion must be different from each other. Vary the categories.
|
|
607197
|
+
|
|
607198
|
+
For each suggestion, pick ONE icon from this list: ${ICON_LIST}`;
|
|
607199
|
+
const prompt = `WHAT CLARK JUST BUILT:
|
|
607200
|
+
${truncate(summary.summary)}`;
|
|
607201
|
+
logger15?.info("[next-steps] Starting next-steps LLM generation");
|
|
607202
|
+
let nextSteps = [];
|
|
607203
|
+
try {
|
|
607204
|
+
const { object: result } = await llmobs_default.trace({ name: "nextSteps.generate", kind: "llm" }, async () => {
|
|
607205
|
+
return await (0, import_ai14.generateObject)({
|
|
607206
|
+
model,
|
|
607207
|
+
schema: NextStepsSchema,
|
|
607208
|
+
system: systemPrompt,
|
|
607209
|
+
prompt,
|
|
607210
|
+
abortSignal
|
|
607211
|
+
});
|
|
607212
|
+
});
|
|
607213
|
+
nextSteps = result.nextSteps;
|
|
607214
|
+
logger15?.info("[next-steps] Next-steps LLM generation succeeded", {
|
|
607215
|
+
count: nextSteps.length
|
|
607216
|
+
});
|
|
607217
|
+
} catch (error40) {
|
|
607218
|
+
logger15?.warn("[next-steps] Next-steps LLM generation failed; returning empty", {
|
|
607219
|
+
error: error40 instanceof Error ? error40.message : String(error40)
|
|
607220
|
+
});
|
|
607221
|
+
}
|
|
607222
|
+
return nextSteps.slice(0, MAX_NEXT_STEPS);
|
|
607223
|
+
}
|
|
607224
|
+
|
|
607225
|
+
// ../../../vite-plugin-file-sync/dist/ai-service/state-machine/handlers/awaiting-user.js
|
|
606280
607226
|
function createWorkflowSummary(promptId, workflowMetrics) {
|
|
606281
607227
|
const completedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
606282
607228
|
const startedAt = workflowMetrics.workflowStartedAt;
|
|
@@ -606319,6 +607265,53 @@ async function checkPromptCost(promptId, workflowMetrics, chatSessionStore, prom
|
|
|
606319
607265
|
var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProfiler, features }) => {
|
|
606320
607266
|
const sendUsergenerationState = sendUserGenerationStateChannel(clark);
|
|
606321
607267
|
const sendUserMessage = sendUserMessageChannel(clark, chatSessionStore);
|
|
607268
|
+
const emitNextSteps = async () => {
|
|
607269
|
+
const abortSignal = clark.context.abortController?.signal;
|
|
607270
|
+
const startedAt = performance.now();
|
|
607271
|
+
let stepCount = 0;
|
|
607272
|
+
let caughtError;
|
|
607273
|
+
try {
|
|
607274
|
+
if (abortSignal?.aborted)
|
|
607275
|
+
return;
|
|
607276
|
+
clark.logger.info("[awaiting-user] emitNextSteps starting");
|
|
607277
|
+
const model = llmProvider.modelForTask("summarizeMessages");
|
|
607278
|
+
const nextSteps = await getNextSteps({
|
|
607279
|
+
model,
|
|
607280
|
+
chatSessionStore,
|
|
607281
|
+
logger: clark.logger,
|
|
607282
|
+
abortSignal
|
|
607283
|
+
});
|
|
607284
|
+
stepCount = nextSteps.length;
|
|
607285
|
+
if (abortSignal?.aborted)
|
|
607286
|
+
return;
|
|
607287
|
+
if (nextSteps.length > 0) {
|
|
607288
|
+
await sendUserMessage({
|
|
607289
|
+
type: "next_steps",
|
|
607290
|
+
text: "",
|
|
607291
|
+
nextSteps
|
|
607292
|
+
}, 0, false, { persistBeforeDeliver: true });
|
|
607293
|
+
}
|
|
607294
|
+
} catch (err) {
|
|
607295
|
+
caughtError = err;
|
|
607296
|
+
} finally {
|
|
607297
|
+
const durationMs = Math.round((performance.now() - startedAt) * 100) / 100;
|
|
607298
|
+
const aborted2 = abortSignal?.aborted === true;
|
|
607299
|
+
if (caughtError) {
|
|
607300
|
+
clark.logger.warn("[awaiting-user] Next steps generation failed; skipping", {
|
|
607301
|
+
durationMs,
|
|
607302
|
+
stepCount,
|
|
607303
|
+
aborted: aborted2,
|
|
607304
|
+
error: caughtError instanceof Error ? { name: caughtError.name, message: caughtError.message } : String(caughtError)
|
|
607305
|
+
});
|
|
607306
|
+
} else {
|
|
607307
|
+
clark.logger.info("[awaiting-user] emitNextSteps completed", {
|
|
607308
|
+
durationMs,
|
|
607309
|
+
stepCount,
|
|
607310
|
+
aborted: aborted2
|
|
607311
|
+
});
|
|
607312
|
+
}
|
|
607313
|
+
}
|
|
607314
|
+
};
|
|
606322
607315
|
return async ({ event }) => {
|
|
606323
607316
|
switch (event.type) {
|
|
606324
607317
|
case AGENT_NEEDS_USER_INPUT: {
|
|
@@ -606372,13 +607365,16 @@ var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProf
|
|
|
606372
607365
|
willTriggerUpload: hasSuggestions,
|
|
606373
607366
|
currentMode: clark.context.currentMode
|
|
606374
607367
|
});
|
|
606375
|
-
signals.emit("generationCompleted", hasSuggestions);
|
|
606376
607368
|
await clarkProfiler?.endSession();
|
|
606377
607369
|
const { promptId, workflowMetrics } = clark.context;
|
|
606378
607370
|
if (promptId && workflowMetrics) {
|
|
606379
607371
|
await checkPromptCost(promptId, workflowMetrics, chatSessionStore, features.promptUsageAlarmThreshold, clark.logger);
|
|
606380
607372
|
await chatSessionStore.submitWorkflowSummary(createWorkflowSummary(promptId, workflowMetrics));
|
|
606381
607373
|
}
|
|
607374
|
+
if (features.suggestWhatsNext) {
|
|
607375
|
+
await emitNextSteps();
|
|
607376
|
+
}
|
|
607377
|
+
signals.emit("generationCompleted", hasSuggestions);
|
|
606382
607378
|
void sendUsergenerationState({
|
|
606383
607379
|
state: AiGenerationState.COMPLETED,
|
|
606384
607380
|
hasSuggestions: true
|
|
@@ -606391,7 +607387,6 @@ var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProf
|
|
|
606391
607387
|
hasSuggestions,
|
|
606392
607388
|
willTriggerUpload: hasSuggestions
|
|
606393
607389
|
});
|
|
606394
|
-
signals.emit("generationCompleted", hasSuggestions);
|
|
606395
607390
|
await clarkProfiler?.endSession();
|
|
606396
607391
|
const { promptId, workflowMetrics } = clark.context;
|
|
606397
607392
|
if (promptId && workflowMetrics) {
|
|
@@ -606430,6 +607425,10 @@ var doAwaitingUser = (clark, { signals, chatSessionStore, llmProvider, clarkProf
|
|
|
606430
607425
|
}
|
|
606431
607426
|
}
|
|
606432
607427
|
}
|
|
607428
|
+
if (features.suggestWhatsNext) {
|
|
607429
|
+
await emitNextSteps();
|
|
607430
|
+
}
|
|
607431
|
+
signals.emit("generationCompleted", hasSuggestions);
|
|
606433
607432
|
void sendUsergenerationState({
|
|
606434
607433
|
state: AiGenerationState.COMPLETED,
|
|
606435
607434
|
hasSuggestions
|
|
@@ -606474,7 +607473,7 @@ Please create a BRIEF summary that:
|
|
|
606474
607473
|
Create a summary of what was accomplished:`;
|
|
606475
607474
|
const model = llmProvider.modelForTask("summarizeMessages");
|
|
606476
607475
|
const summary = await traceLLM("getFinalSummary", model.modelId, model.provider, async () => {
|
|
606477
|
-
return (0,
|
|
607476
|
+
return (0, import_ai15.generateText)({
|
|
606478
607477
|
model,
|
|
606479
607478
|
prompt,
|
|
606480
607479
|
abortSignal
|
|
@@ -606758,25 +607757,35 @@ Here are some examples (not exhaustive) that you should consider when building a
|
|
|
606758
607757
|
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.
|
|
606759
607758
|
2. **Loading State Hierarchy**:
|
|
606760
607759
|
- No data yet (\`loading\`) \u2192 Full skeleton placeholder
|
|
606761
|
-
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a
|
|
607760
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a subtle visual indicator: apply light opacity (e.g. \`opacity-70\`) to signal a refresh is in progress, plus a non-blocking label (e.g. "Updating\u2026" text, small spinner, or thin progress bar). Do not use \`pointer-events-none\` \u2014 the content must remain fully interactive during refetch.
|
|
606762
607761
|
- Error state (\`isError\`) \u2192 Show error with retry option, optionally keep stale data visible
|
|
606763
607762
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
606764
607763
|
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, and \`refetchOnReconnect\` options.
|
|
606765
607764
|
|
|
606766
607765
|
\`\`\`tsx
|
|
606767
|
-
// \u2705 CORRECT \u2014
|
|
607766
|
+
// \u2705 CORRECT \u2014 subtle opacity + indicator, table stays interactive
|
|
606768
607767
|
const { data, loading, fetching, isError, error } = useApiData("GetOrders", { status: statusFilter, search });
|
|
606769
607768
|
|
|
606770
607769
|
if (loading) return <Skeleton />; // First load: full skeleton
|
|
606771
607770
|
if (isError) return <ErrorBanner error={error} />;
|
|
606772
607771
|
return (
|
|
606773
|
-
<div
|
|
606774
|
-
|
|
607772
|
+
<div>
|
|
607773
|
+
{fetching && <div className="text-xs text-muted-foreground">Updating\u2026</div>}
|
|
607774
|
+
<div className={fetching ? "opacity-70" : ""}>
|
|
607775
|
+
<OrderTable orders={data.orders} /> {/* Dimmed but still interactive */}
|
|
607776
|
+
</div>
|
|
606775
607777
|
</div>
|
|
606776
607778
|
);
|
|
606777
607779
|
\`\`\`
|
|
606778
607780
|
|
|
606779
607781
|
\`\`\`tsx
|
|
607782
|
+
// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken
|
|
607783
|
+
return (
|
|
607784
|
+
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
607785
|
+
<OrderTable orders={data.orders} />
|
|
607786
|
+
</div>
|
|
607787
|
+
);
|
|
607788
|
+
|
|
606780
607789
|
// \u274C WRONG \u2014 no loading indicator when filters change. User sees stale data with no feedback.
|
|
606781
607790
|
const { data, loading } = useApiData("GetOrders", { status: statusFilter, search });
|
|
606782
607791
|
|
|
@@ -607245,25 +608254,35 @@ Here are some examples (not exhaustive) that you should consider when building a
|
|
|
607245
608254
|
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.
|
|
607246
608255
|
2. **Loading State Hierarchy**:
|
|
607247
608256
|
- No data yet (\`loading\`) \u2192 Full skeleton placeholder
|
|
607248
|
-
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a
|
|
608257
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) \u2192 Keep showing current data with a subtle visual indicator: apply light opacity (e.g. \`opacity-70\`) to signal a refresh is in progress, plus a non-blocking label (e.g. "Updating\u2026" text, small spinner, or thin progress bar). Do not use \`pointer-events-none\` \u2014 the content must remain fully interactive during refetch.
|
|
607249
608258
|
- Error state (\`isError\`) \u2192 Show error with retry option, optionally keep stale data visible
|
|
607250
608259
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
607251
608260
|
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, and \`refetchOnReconnect\` options.
|
|
607252
608261
|
|
|
607253
608262
|
\`\`\`tsx
|
|
607254
|
-
// \u2705 CORRECT \u2014
|
|
608263
|
+
// \u2705 CORRECT \u2014 subtle opacity + indicator, table stays interactive
|
|
607255
608264
|
const { data, loading, fetching, isError, error } = useApiData("GetOrders", { status: statusFilter, search });
|
|
607256
608265
|
|
|
607257
608266
|
if (loading) return <Skeleton />; // First load: full skeleton
|
|
607258
608267
|
if (isError) return <ErrorBanner error={error} />;
|
|
607259
608268
|
return (
|
|
607260
|
-
<div
|
|
607261
|
-
|
|
608269
|
+
<div>
|
|
608270
|
+
{fetching && <div className="text-xs text-muted-foreground">Updating\u2026</div>}
|
|
608271
|
+
<div className={fetching ? "opacity-70" : ""}>
|
|
608272
|
+
<OrderTable orders={data.orders} /> {/* Dimmed but still interactive */}
|
|
608273
|
+
</div>
|
|
607262
608274
|
</div>
|
|
607263
608275
|
);
|
|
607264
608276
|
\`\`\`
|
|
607265
608277
|
|
|
607266
608278
|
\`\`\`tsx
|
|
608279
|
+
// \u274C WRONG \u2014 pointer-events-none disables the table, making it feel broken
|
|
608280
|
+
return (
|
|
608281
|
+
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
608282
|
+
<OrderTable orders={data.orders} />
|
|
608283
|
+
</div>
|
|
608284
|
+
);
|
|
608285
|
+
|
|
607267
608286
|
// \u274C WRONG \u2014 no loading indicator when filters change. User sees stale data with no feedback.
|
|
607268
608287
|
const { data, loading } = useApiData("GetOrders", { status: statusFilter, search });
|
|
607269
608288
|
|
|
@@ -610335,7 +611354,7 @@ ${diagnostics.join("\n")}`);
|
|
|
610335
611354
|
|
|
610336
611355
|
// ../../../vite-plugin-file-sync/dist/ai-service/agent/tools2/tools/web-fetch.js
|
|
610337
611356
|
init_cjs_shims();
|
|
610338
|
-
var
|
|
611357
|
+
var import_ai16 = __toESM(require_dist9());
|
|
610339
611358
|
var import_turndown = __toESM(require_turndown_cjs());
|
|
610340
611359
|
var WebFetchResponseSchema = external_exports.object({
|
|
610341
611360
|
content: external_exports.string().describe("The extracted information as plain markdown text (NOT JSON). Use markdown formatting for headers, lists, bold, etc.")
|
|
@@ -610486,7 +611505,7 @@ Examples:
|
|
|
610486
611505
|
}
|
|
610487
611506
|
const truncatedContent = truncateContent(markdown, MAX_CONTENT_LENGTH);
|
|
610488
611507
|
const model = llmProvider.modelForTask("fast");
|
|
610489
|
-
const { object: result } = await (0,
|
|
611508
|
+
const { object: result } = await (0, import_ai16.generateObject)({
|
|
610490
611509
|
model,
|
|
610491
611510
|
schema: WebFetchResponseSchema,
|
|
610492
611511
|
system: WEB_FETCH_SYSTEM_PROMPT,
|
|
@@ -631809,7 +632828,7 @@ var buildTools = async (clark, services) => {
|
|
|
631809
632828
|
init_cjs_shims();
|
|
631810
632829
|
function hasToolSuccess(toolName, maxAttempts = 5) {
|
|
631811
632830
|
return ({ steps }) => {
|
|
631812
|
-
const hasSuccess = steps[steps.length - 1]?.toolResults?.some((toolResult) => toolResult.toolName === toolName) ?? false;
|
|
632831
|
+
const hasSuccess = steps[steps.length - 1]?.toolResults?.some((toolResult) => toolResult.toolName === toolName && toolResult.output?.success !== false) ?? false;
|
|
631813
632832
|
if (hasSuccess) {
|
|
631814
632833
|
return true;
|
|
631815
632834
|
}
|
|
@@ -632405,13 +633424,14 @@ var doLLMGenerating = (clark, services) => {
|
|
|
632405
633424
|
if (chunk.type === "tool-result") {
|
|
632406
633425
|
const isOpenIntegrationTool = chunk.toolName === "openExistingIntegration" || chunk.toolName === "openIntegrationSetup";
|
|
632407
633426
|
const isUpdateIntegrationTool = chunk.toolName === "updateIntegrationFields";
|
|
632408
|
-
if (chunk.toolName === "askMultiChoice" || chunk.toolName === "askSearchableDropdown"
|
|
633427
|
+
if (chunk.toolName === "askMultiChoice" || chunk.toolName === "askSearchableDropdown") {
|
|
632409
633428
|
shouldTransitionToAwaitingUser = true;
|
|
632410
633429
|
}
|
|
632411
633430
|
if (isOpenIntegrationTool || isUpdateIntegrationTool) {
|
|
632412
633431
|
const output = getToolResultOutputObject(chunk.output);
|
|
632413
633432
|
const success2 = output?.success === true;
|
|
632414
633433
|
if (success2) {
|
|
633434
|
+
shouldTransitionToAwaitingUser = true;
|
|
632415
633435
|
const sendInteractiveMessage = sendInteractiveMessageChannel(clark, services.chatSessionStore);
|
|
632416
633436
|
const payload = {
|
|
632417
633437
|
type: "multi_choice",
|
|
@@ -635140,6 +636160,10 @@ var FLAG_DEFINITIONS = {
|
|
|
635140
636160
|
key: "ai.clark-delete-package-lock.enabled",
|
|
635141
636161
|
schema: zod_default.boolean()
|
|
635142
636162
|
},
|
|
636163
|
+
suggestWhatsNext: {
|
|
636164
|
+
key: "ai.suggest-whats-next",
|
|
636165
|
+
schema: zod_default.boolean()
|
|
636166
|
+
},
|
|
635143
636167
|
integrationSetupEnabled: {
|
|
635144
636168
|
key: "clark.integration-setup.enabled",
|
|
635145
636169
|
schema: zod_default.boolean()
|
|
@@ -635791,7 +636815,7 @@ var AiService = class extends import_shared40.TracedEventEmitter {
|
|
|
635791
636815
|
try {
|
|
635792
636816
|
const streamResult = await this.llmClient.streamText({
|
|
635793
636817
|
model,
|
|
635794
|
-
stopWhen: (0,
|
|
636818
|
+
stopWhen: (0, import_ai17.hasToolCall)(explainCodeFinalize.name),
|
|
635795
636819
|
tools: {
|
|
635796
636820
|
build_readFile,
|
|
635797
636821
|
explainCodeFinalize
|
|
@@ -636109,7 +637133,7 @@ ${apiSourceCode.slice(0, 2e3)}
|
|
|
636109
637133
|
const timeoutId = setTimeout(() => timeoutController.abort(), timeout);
|
|
636110
637134
|
try {
|
|
636111
637135
|
const contentPart = this.attachmentToContentPart(attachment);
|
|
636112
|
-
const { object: result } = await (0,
|
|
637136
|
+
const { object: result } = await (0, import_ai17.generateObject)({
|
|
636113
637137
|
model,
|
|
636114
637138
|
schema: LabelAttachmentSchema,
|
|
636115
637139
|
messages: [
|
|
@@ -639518,6 +640542,26 @@ function createSocketRecordingMiddleware(recorder) {
|
|
|
639518
640542
|
};
|
|
639519
640543
|
}
|
|
639520
640544
|
|
|
640545
|
+
// ../../../vite-plugin-file-sync/dist/git-log.js
|
|
640546
|
+
init_cjs_shims();
|
|
640547
|
+
var SEP = "<<SEP>>";
|
|
640548
|
+
var GIT_LOG_FORMAT = ["%H", "%P", "%s", "%an", "%aI"].join(SEP);
|
|
640549
|
+
function parseGitLog(raw2) {
|
|
640550
|
+
if (!raw2.trim())
|
|
640551
|
+
return [];
|
|
640552
|
+
return raw2.trimEnd().split("\n").map((line3) => {
|
|
640553
|
+
const parts = line3.split(SEP);
|
|
640554
|
+
const parents2 = (parts[1] ?? "").split(" ").filter((sha) => sha.length > 0);
|
|
640555
|
+
return {
|
|
640556
|
+
sha: parts[0] ?? "",
|
|
640557
|
+
parents: parents2,
|
|
640558
|
+
message: parts[2] ?? "",
|
|
640559
|
+
author: parts[3] ?? "",
|
|
640560
|
+
date: parts[4] ?? ""
|
|
640561
|
+
};
|
|
640562
|
+
});
|
|
640563
|
+
}
|
|
640564
|
+
|
|
639521
640565
|
// ../../../vite-plugin-file-sync/dist/git-service/azure-devops-workflow.js
|
|
639522
640566
|
init_cjs_shims();
|
|
639523
640567
|
var import_shared53 = __toESM(require_dist2());
|
|
@@ -639634,6 +640678,21 @@ async function ensureLiveBranchCheckedOut(gitService) {
|
|
|
639634
640678
|
currentBranch: currentBranch || "(detached)",
|
|
639635
640679
|
targetBranch: import_shared57.SUPERBLOCKS_LIVE_GIT_BRANCH
|
|
639636
640680
|
});
|
|
640681
|
+
try {
|
|
640682
|
+
await gitService.fetch("origin", import_shared57.SUPERBLOCKS_LIVE_GIT_BRANCH);
|
|
640683
|
+
} catch (fetchErr) {
|
|
640684
|
+
const classified = classifyGitError(fetchErr);
|
|
640685
|
+
if (classified instanceof GitAuthError || classified instanceof GitPermissionError) {
|
|
640686
|
+
throw classified;
|
|
640687
|
+
}
|
|
640688
|
+
logger15.warn("[git] live branch fetch failed, proceeding with local ref", {
|
|
640689
|
+
gitCategory: "branch",
|
|
640690
|
+
gitOperation: "checkout-live-branch",
|
|
640691
|
+
gitOutcome: "fetch_failed",
|
|
640692
|
+
branch: import_shared57.SUPERBLOCKS_LIVE_GIT_BRANCH,
|
|
640693
|
+
...getErrorMeta2(fetchErr)
|
|
640694
|
+
});
|
|
640695
|
+
}
|
|
639637
640696
|
try {
|
|
639638
640697
|
await gitService.revparse(`origin/${import_shared57.SUPERBLOCKS_LIVE_GIT_BRANCH}`);
|
|
639639
640698
|
await gitService.checkoutOrCreate(import_shared57.SUPERBLOCKS_LIVE_GIT_BRANCH, `origin/${import_shared57.SUPERBLOCKS_LIVE_GIT_BRANCH}`);
|
|
@@ -639993,6 +641052,7 @@ var SocketManager = class extends import_shared58.TracedEventEmitter {
|
|
|
639993
641052
|
aiCancel: [
|
|
639994
641053
|
async () => {
|
|
639995
641054
|
await aiService?.handleUserCanceled();
|
|
641055
|
+
await syncService?.reportDraftStateToServer(false);
|
|
639996
641056
|
}
|
|
639997
641057
|
],
|
|
639998
641058
|
aiNotifyIntegrationSetupClosed: [
|
|
@@ -640520,26 +641580,14 @@ var SocketManager = class extends import_shared58.TracedEventEmitter {
|
|
|
640520
641580
|
});
|
|
640521
641581
|
}
|
|
640522
641582
|
}
|
|
640523
|
-
const SEP = "<<SEP>>";
|
|
640524
|
-
const format4 = ["%H", "%s", "%an", "%aI"].join(SEP);
|
|
640525
641583
|
const raw2 = await readyGitService.raw([
|
|
640526
641584
|
"log",
|
|
640527
641585
|
logRef,
|
|
640528
|
-
`--format=${
|
|
641586
|
+
`--format=${GIT_LOG_FORMAT}`,
|
|
640529
641587
|
`-n`,
|
|
640530
641588
|
String(limit)
|
|
640531
641589
|
]);
|
|
640532
|
-
|
|
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
|
-
});
|
|
641590
|
+
return parseGitLog(raw2);
|
|
640543
641591
|
}
|
|
640544
641592
|
],
|
|
640545
641593
|
gitPrepareMainCommit: [
|
|
@@ -658754,7 +659802,7 @@ var require_ignore3 = __commonJS3({
|
|
|
658754
659802
|
return this._test(path152, this._testCache, true);
|
|
658755
659803
|
}
|
|
658756
659804
|
};
|
|
658757
|
-
var
|
|
659805
|
+
var factory12 = (options8) => new Ignore2(options8);
|
|
658758
659806
|
var isPathValid = (path152) => checkPath(path152 && checkPath.convert(path152), path152, RETURN_FALSE);
|
|
658759
659807
|
var setupWindows = () => {
|
|
658760
659808
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
@@ -658768,8 +659816,8 @@ var require_ignore3 = __commonJS3({
|
|
|
658768
659816
|
) {
|
|
658769
659817
|
setupWindows();
|
|
658770
659818
|
}
|
|
658771
|
-
module2.exports =
|
|
658772
|
-
|
|
659819
|
+
module2.exports = factory12;
|
|
659820
|
+
factory12.default = factory12;
|
|
658773
659821
|
module2.exports.isPathValid = isPathValid;
|
|
658774
659822
|
define2(module2.exports, Symbol.for("setupWindows"), setupWindows);
|
|
658775
659823
|
}
|
|
@@ -662163,7 +663211,7 @@ var parseYaml3;
|
|
|
662163
663211
|
async function loadYaml(file2) {
|
|
662164
663212
|
const content9 = await read_file_default(file2);
|
|
662165
663213
|
if (!parseYaml3) {
|
|
662166
|
-
({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-
|
|
663214
|
+
({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-WJS33RAV.js"));
|
|
662167
663215
|
}
|
|
662168
663216
|
try {
|
|
662169
663217
|
return parseYaml3(content9);
|
|
@@ -667557,7 +668605,7 @@ function createParsersAndPrinters(modules) {
|
|
|
667557
668605
|
}
|
|
667558
668606
|
var estreePlugin = createParsersAndPrinters([
|
|
667559
668607
|
{
|
|
667560
|
-
importPlugin: () => import("./estree-
|
|
668608
|
+
importPlugin: () => import("./estree-AMTSACNT.js"),
|
|
667561
668609
|
printers: ["estree", "estree-json"]
|
|
667562
668610
|
}
|
|
667563
668611
|
]);
|
|
@@ -667581,11 +668629,11 @@ var languages = [
|
|
|
667581
668629
|
];
|
|
667582
668630
|
var { parsers: parsers12, printers } = createParsersAndPrinters([
|
|
667583
668631
|
{
|
|
667584
|
-
importPlugin: () => import("./acorn-
|
|
668632
|
+
importPlugin: () => import("./acorn-SLEBXOPM.js"),
|
|
667585
668633
|
parsers: ["acorn", "espree"]
|
|
667586
668634
|
},
|
|
667587
668635
|
{
|
|
667588
|
-
importPlugin: () => import("./angular-
|
|
668636
|
+
importPlugin: () => import("./angular-6RC4UUQO.js"),
|
|
667589
668637
|
parsers: [
|
|
667590
668638
|
"__ng_action",
|
|
667591
668639
|
"__ng_binding",
|
|
@@ -667594,7 +668642,7 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
|
|
|
667594
668642
|
]
|
|
667595
668643
|
},
|
|
667596
668644
|
{
|
|
667597
|
-
importPlugin: () => import("./babel-
|
|
668645
|
+
importPlugin: () => import("./babel-ASTIWI3P.js"),
|
|
667598
668646
|
parsers: [
|
|
667599
668647
|
"babel",
|
|
667600
668648
|
"babel-flow",
|
|
@@ -667613,44 +668661,44 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
|
|
|
667613
668661
|
]
|
|
667614
668662
|
},
|
|
667615
668663
|
{
|
|
667616
|
-
importPlugin: () => import("./flow-
|
|
668664
|
+
importPlugin: () => import("./flow-AEXGDJ6G.js"),
|
|
667617
668665
|
parsers: ["flow"]
|
|
667618
668666
|
},
|
|
667619
668667
|
{
|
|
667620
|
-
importPlugin: () => import("./glimmer-
|
|
668668
|
+
importPlugin: () => import("./glimmer-RDX5SMUW.js"),
|
|
667621
668669
|
parsers: ["glimmer"],
|
|
667622
668670
|
printers: ["glimmer"]
|
|
667623
668671
|
},
|
|
667624
668672
|
{
|
|
667625
|
-
importPlugin: () => import("./graphql-
|
|
668673
|
+
importPlugin: () => import("./graphql-BZRHZUYU.js"),
|
|
667626
668674
|
parsers: ["graphql"],
|
|
667627
668675
|
printers: ["graphql"]
|
|
667628
668676
|
},
|
|
667629
668677
|
{
|
|
667630
|
-
importPlugin: () => import("./html-
|
|
668678
|
+
importPlugin: () => import("./html-BYTKDYRN.js"),
|
|
667631
668679
|
parsers: ["html", "angular", "vue", "lwc", "mjml"],
|
|
667632
668680
|
printers: ["html"]
|
|
667633
668681
|
},
|
|
667634
668682
|
{
|
|
667635
|
-
importPlugin: () => import("./markdown-
|
|
668683
|
+
importPlugin: () => import("./markdown-EMBWCYGU.js"),
|
|
667636
668684
|
parsers: ["markdown", "mdx", "remark"],
|
|
667637
668685
|
printers: ["mdast"]
|
|
667638
668686
|
},
|
|
667639
668687
|
{
|
|
667640
|
-
importPlugin: () => import("./meriyah-
|
|
668688
|
+
importPlugin: () => import("./meriyah-JGF6IOPU.js"),
|
|
667641
668689
|
parsers: ["meriyah"]
|
|
667642
668690
|
},
|
|
667643
668691
|
{
|
|
667644
|
-
importPlugin: () => import("./postcss-
|
|
668692
|
+
importPlugin: () => import("./postcss-AWH3AW63.js"),
|
|
667645
668693
|
parsers: ["css", "less", "scss"],
|
|
667646
668694
|
printers: ["postcss"]
|
|
667647
668695
|
},
|
|
667648
668696
|
{
|
|
667649
|
-
importPlugin: () => import("./typescript-
|
|
668697
|
+
importPlugin: () => import("./typescript-6MCB7LTV.js"),
|
|
667650
668698
|
parsers: ["typescript"]
|
|
667651
668699
|
},
|
|
667652
668700
|
{
|
|
667653
|
-
importPlugin: () => import("./yaml-
|
|
668701
|
+
importPlugin: () => import("./yaml-WJS33RAV.js"),
|
|
667654
668702
|
parsers: ["yaml"],
|
|
667655
668703
|
printers: ["yaml"]
|
|
667656
668704
|
}
|
|
@@ -670481,6 +671529,7 @@ var resolvedVirtualRegisteredComponentsId = `\0${virtualRegisteredComponentsId}`
|
|
|
670481
671529
|
init_cjs_shims();
|
|
670482
671530
|
import { readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
670483
671531
|
import path60 from "node:path";
|
|
671532
|
+
var YAML_TYPES_PLUGIN_NAME = "sb-yaml-api-types";
|
|
670484
671533
|
var SUPERBLOCKS_TYPE_FILE_NAME = "superblocks.d.ts";
|
|
670485
671534
|
var SUPERBLOCKS_REGISTRY_ENTRY_REGEX = /^\s*"([^"]+)":\s*\{\s*input:\s*([^;]+);\s*output:\s*(.+?)\s*\};\s*$/gm;
|
|
670486
671535
|
function loadApiTypes(rootDir, apiName) {
|
|
@@ -670619,7 +671668,7 @@ var yamlApiTypesPlugin = (syncService, aiService) => {
|
|
|
670619
671668
|
}
|
|
670620
671669
|
};
|
|
670621
671670
|
return {
|
|
670622
|
-
name:
|
|
671671
|
+
name: YAML_TYPES_PLUGIN_NAME,
|
|
670623
671672
|
enforce: "pre",
|
|
670624
671673
|
configResolved(resolvedConfig) {
|
|
670625
671674
|
config4 = resolvedConfig;
|
|
@@ -670648,7 +671697,18 @@ var isInitialized = false;
|
|
|
670648
671697
|
var config3;
|
|
670649
671698
|
var pendingFileTransformError = null;
|
|
670650
671699
|
var loggedViteErrors = [];
|
|
670651
|
-
var
|
|
671700
|
+
var PLUGIN_NAME = "sb-file-sync";
|
|
671701
|
+
function fileSyncVitePlugin(pluginParams, options8) {
|
|
671702
|
+
if (!pluginParams) {
|
|
671703
|
+
return {
|
|
671704
|
+
plugin: [
|
|
671705
|
+
{ name: PLUGIN_NAME, apply: "serve", enforce: "pre" },
|
|
671706
|
+
{ name: YAML_TYPES_PLUGIN_NAME, enforce: "pre" }
|
|
671707
|
+
],
|
|
671708
|
+
dispose: () => {
|
|
671709
|
+
}
|
|
671710
|
+
};
|
|
671711
|
+
}
|
|
670652
671712
|
const logger15 = pluginParams.logger;
|
|
670653
671713
|
setDefaultLogger(logger15);
|
|
670654
671714
|
setOptions(options8 ?? {
|
|
@@ -670705,7 +671765,7 @@ var fileSyncVitePlugin = (pluginParams, options8) => {
|
|
|
670705
671765
|
pendingFileTransformError = { filePath, error: error40 };
|
|
670706
671766
|
};
|
|
670707
671767
|
const plugin = {
|
|
670708
|
-
name:
|
|
671768
|
+
name: PLUGIN_NAME,
|
|
670709
671769
|
apply: "serve",
|
|
670710
671770
|
enforce: "pre",
|
|
670711
671771
|
config() {
|
|
@@ -671712,7 +672772,7 @@ ${fileContents}`,
|
|
|
671712
672772
|
disposeSocketManager();
|
|
671713
672773
|
}
|
|
671714
672774
|
};
|
|
671715
|
-
}
|
|
672775
|
+
}
|
|
671716
672776
|
async function getAppScope(fileSyncManager) {
|
|
671717
672777
|
const pageContents = await getAllPages({
|
|
671718
672778
|
rootDir: config3.root
|
|
@@ -675055,7 +676115,7 @@ var test = (fn, ...args) => {
|
|
|
675055
676115
|
return false;
|
|
675056
676116
|
}
|
|
675057
676117
|
};
|
|
675058
|
-
var
|
|
676118
|
+
var factory11 = (env2) => {
|
|
675059
676119
|
env2 = utils_default.merge.call({
|
|
675060
676120
|
skipUndefined: true
|
|
675061
676121
|
}, globalFetchAPI, env2);
|
|
@@ -675239,7 +676299,7 @@ var getFetch = (config4) => {
|
|
|
675239
676299
|
while (i--) {
|
|
675240
676300
|
seed = seeds[i];
|
|
675241
676301
|
target = map3.get(seed);
|
|
675242
|
-
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() :
|
|
676302
|
+
target === void 0 && map3.set(seed, target = i ? /* @__PURE__ */ new Map() : factory11(env2));
|
|
675243
676303
|
map3 = target;
|
|
675244
676304
|
}
|
|
675245
676305
|
return target;
|
|
@@ -679480,7 +680540,7 @@ async function upgradeCliWithPackageManager(pm, targetVersion, alias) {
|
|
|
679480
680540
|
clearCliVersionCache({ version: targetVersion, alias });
|
|
679481
680541
|
logger14.info(`Successfully upgraded packages to ${targetVersion}`);
|
|
679482
680542
|
}
|
|
679483
|
-
async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgrade = false) {
|
|
680543
|
+
async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgrade = false, skipCliUpgrade = false) {
|
|
679484
680544
|
let cliUpdated = false;
|
|
679485
680545
|
let hasFailedToUpgrade = false;
|
|
679486
680546
|
const upgradePromises = [];
|
|
@@ -679542,7 +680602,7 @@ async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgra
|
|
|
679542
680602
|
return;
|
|
679543
680603
|
}
|
|
679544
680604
|
try {
|
|
679545
|
-
if ((cliNeedsUpgrade || forceUpgrade) && currentCliInfo) {
|
|
680605
|
+
if (!skipCliUpgrade && (cliNeedsUpgrade || forceUpgrade) && currentCliInfo) {
|
|
679546
680606
|
const cliUpgradePromise = (0, import_shared70.traceFunction)({
|
|
679547
680607
|
name: "upgradeCli",
|
|
679548
680608
|
tracer: tracer2,
|
|
@@ -679602,6 +680662,8 @@ async function checkVersionsAndWritePackageJson(lockService, config4, forceUpgra
|
|
|
679602
680662
|
init_cjs_shims();
|
|
679603
680663
|
var import_cors = __toESM(require_lib51(), 1);
|
|
679604
680664
|
var import_express = __toESM(require_express2(), 1);
|
|
680665
|
+
import * as child_process3 from "node:child_process";
|
|
680666
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
679605
680667
|
import net from "node:net";
|
|
679606
680668
|
import os6 from "node:os";
|
|
679607
680669
|
import path73 from "node:path";
|
|
@@ -679639,6 +680701,42 @@ var buildManifestStubPlugin = () => {
|
|
|
679639
680701
|
|
|
679640
680702
|
// ../sdk/dist/dev-utils/dev-server.mjs
|
|
679641
680703
|
var tracer3 = getTracer();
|
|
680704
|
+
function reactPlugin() {
|
|
680705
|
+
return react3({
|
|
680706
|
+
babel: {
|
|
680707
|
+
plugins: [
|
|
680708
|
+
[
|
|
680709
|
+
import.meta.resolve("@babel/plugin-proposal-decorators"),
|
|
680710
|
+
{ version: "2023-11" }
|
|
680711
|
+
]
|
|
680712
|
+
]
|
|
680713
|
+
}
|
|
680714
|
+
});
|
|
680715
|
+
}
|
|
680716
|
+
var OPTIMIZE_DEPS_CONFIG = {
|
|
680717
|
+
esbuildOptions: {
|
|
680718
|
+
supported: {
|
|
680719
|
+
destructuring: true
|
|
680720
|
+
}
|
|
680721
|
+
}
|
|
680722
|
+
};
|
|
680723
|
+
function vitePlugins(root3, opts) {
|
|
680724
|
+
return [
|
|
680725
|
+
src_default(),
|
|
680726
|
+
sdkApiEntryPointPlugin(root3),
|
|
680727
|
+
customComponentsPlugin(),
|
|
680728
|
+
opts.fileSync,
|
|
680729
|
+
buildManifestStubPlugin(),
|
|
680730
|
+
reactPlugin(),
|
|
680731
|
+
vite_plugin_optimize_lucide_imports_default(),
|
|
680732
|
+
ddRumPlugin(opts.ddRum ?? {
|
|
680733
|
+
clientToken: "",
|
|
680734
|
+
applicationId: "",
|
|
680735
|
+
env: "",
|
|
680736
|
+
version: ""
|
|
680737
|
+
})
|
|
680738
|
+
];
|
|
680739
|
+
}
|
|
679642
680740
|
var RESTART_EXIT_CODE = 98;
|
|
679643
680741
|
function getJwksUriWithBaseUrl(superblocksBaseUrl) {
|
|
679644
680742
|
if (process.env.SUPERBLOCKS_JWKS_URI) {
|
|
@@ -679670,7 +680768,7 @@ function getJwksUriWithBaseUrl(superblocksBaseUrl) {
|
|
|
679670
680768
|
return jwksUri;
|
|
679671
680769
|
}
|
|
679672
680770
|
var httpServer;
|
|
679673
|
-
async function createDevServer({ root: root3, mode, fsOperationQueue, syncService, lockService, aiService, gitService, activateGitService, snapshotManager, logger: loggerOverride, port, sdk, superblocksBaseUrl: explicitBaseUrl }) {
|
|
680771
|
+
async function createDevServer({ root: root3, mode, fsOperationQueue, syncService, lockService, aiService, gitService, activateGitService, snapshotManager, logger: loggerOverride, port, sdk, superblocksBaseUrl: explicitBaseUrl, existingServer }) {
|
|
679674
680772
|
const logger15 = getLogger2(loggerOverride);
|
|
679675
680773
|
if (httpServer) {
|
|
679676
680774
|
logger15.debug("Dev server already running");
|
|
@@ -679697,6 +680795,8 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
679697
680795
|
viteResolve = resolve9;
|
|
679698
680796
|
viteReject = reject;
|
|
679699
680797
|
});
|
|
680798
|
+
vitePromise.catch(() => {
|
|
680799
|
+
});
|
|
679700
680800
|
async function gracefulShutdown({ logger: logger16, serverInitiated, switchingTo, initiatedByEmail }) {
|
|
679701
680801
|
try {
|
|
679702
680802
|
await lockService?.shutdown({
|
|
@@ -679843,43 +680943,14 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
679843
680943
|
return;
|
|
679844
680944
|
}
|
|
679845
680945
|
}
|
|
679846
|
-
logger15.info("
|
|
679847
|
-
|
|
679848
|
-
|
|
680946
|
+
logger15.info("Received connect request, waiting for vite server...");
|
|
680947
|
+
try {
|
|
680948
|
+
await vitePromise;
|
|
679849
680949
|
res.send(JSON.stringify(healthResponse));
|
|
679850
|
-
|
|
680950
|
+
} catch (e) {
|
|
680951
|
+
logger15.error("Vite server failed to initialize", getErrorMeta(e));
|
|
680952
|
+
res.status(500).send(JSON.stringify({ error: "Dev server failed to initialize" }));
|
|
679851
680953
|
}
|
|
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
|
-
});
|
|
679883
680954
|
});
|
|
679884
680955
|
app.post("/_sb_disconnect", authHandler, async (req, res) => {
|
|
679885
680956
|
logger15.info("Disconnecting dev server...");
|
|
@@ -679902,6 +680973,8 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
679902
680973
|
viteResolve = resolve9;
|
|
679903
680974
|
viteReject = reject;
|
|
679904
680975
|
});
|
|
680976
|
+
vitePromise.catch(() => {
|
|
680977
|
+
});
|
|
679905
680978
|
isViteServerInitialized = false;
|
|
679906
680979
|
}
|
|
679907
680980
|
res.send("ok");
|
|
@@ -679942,8 +681015,95 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
679942
681015
|
timeSinceLastActivityMs: lockService.timeSinceLastActivity
|
|
679943
681016
|
});
|
|
679944
681017
|
} else {
|
|
679945
|
-
|
|
679946
|
-
|
|
681018
|
+
res.json({
|
|
681019
|
+
isUserActive: false,
|
|
681020
|
+
connectedUsers: [],
|
|
681021
|
+
timeSinceLastActivityMs: Number.MAX_SAFE_INTEGER
|
|
681022
|
+
});
|
|
681023
|
+
}
|
|
681024
|
+
});
|
|
681025
|
+
let persistInProgress = false;
|
|
681026
|
+
app.post("/_sb_persist", authHandler, async (req, res) => {
|
|
681027
|
+
if (persistInProgress) {
|
|
681028
|
+
res.status(409).json({ error: "persist already in progress" });
|
|
681029
|
+
return;
|
|
681030
|
+
}
|
|
681031
|
+
persistInProgress = true;
|
|
681032
|
+
const persistStart = Date.now();
|
|
681033
|
+
try {
|
|
681034
|
+
const { uploadURL } = req.body;
|
|
681035
|
+
if (!uploadURL) {
|
|
681036
|
+
res.status(400).json({ error: "uploadURL required" });
|
|
681037
|
+
return;
|
|
681038
|
+
}
|
|
681039
|
+
logger15.info("/_sb_persist: archiving and uploading workspace to S3...");
|
|
681040
|
+
const archive = await new Promise((resolveArchive, rejectArchive) => {
|
|
681041
|
+
const tarProc = child_process3.spawn("tar", [
|
|
681042
|
+
"cf",
|
|
681043
|
+
"-",
|
|
681044
|
+
"--exclude",
|
|
681045
|
+
".git",
|
|
681046
|
+
"--exclude",
|
|
681047
|
+
"node_modules/.cache",
|
|
681048
|
+
"--exclude",
|
|
681049
|
+
".superblocks",
|
|
681050
|
+
"-C",
|
|
681051
|
+
process.cwd(),
|
|
681052
|
+
"."
|
|
681053
|
+
], { stdio: ["ignore", "pipe", "pipe"] });
|
|
681054
|
+
const zstdProc = child_process3.spawn("zstd", ["-1", "--no-progress"], {
|
|
681055
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
681056
|
+
});
|
|
681057
|
+
tarProc.stdout.pipe(zstdProc.stdin);
|
|
681058
|
+
zstdProc.stdin.on("error", (err) => {
|
|
681059
|
+
rejectArchive(new Error(`zstd stdin stream error: ${err.message}`));
|
|
681060
|
+
});
|
|
681061
|
+
const chunks = [];
|
|
681062
|
+
zstdProc.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
681063
|
+
let stderr = "";
|
|
681064
|
+
tarProc.stderr.on("data", (chunk) => {
|
|
681065
|
+
stderr += chunk.toString();
|
|
681066
|
+
});
|
|
681067
|
+
zstdProc.stderr.on("data", (chunk) => {
|
|
681068
|
+
stderr += chunk.toString();
|
|
681069
|
+
});
|
|
681070
|
+
let tarExitCode = null;
|
|
681071
|
+
tarProc.on("close", (code2) => {
|
|
681072
|
+
tarExitCode = code2;
|
|
681073
|
+
});
|
|
681074
|
+
zstdProc.on("close", (code2) => {
|
|
681075
|
+
if (code2 !== 0) {
|
|
681076
|
+
rejectArchive(new Error(`zstd compression failed (code ${code2}): ${stderr}`));
|
|
681077
|
+
} else if (tarExitCode !== null && tarExitCode !== 0) {
|
|
681078
|
+
rejectArchive(new Error(`tar archival failed (code ${tarExitCode}): ${stderr}`));
|
|
681079
|
+
} else {
|
|
681080
|
+
resolveArchive(Buffer.concat(chunks));
|
|
681081
|
+
}
|
|
681082
|
+
});
|
|
681083
|
+
tarProc.on("error", rejectArchive);
|
|
681084
|
+
zstdProc.on("error", rejectArchive);
|
|
681085
|
+
});
|
|
681086
|
+
logger15.info(`/_sb_persist: archive created (${(archive.length / 1024 / 1024).toFixed(1)}MB) in ${Date.now() - persistStart}ms, uploading...`);
|
|
681087
|
+
const uploadStart = Date.now();
|
|
681088
|
+
const uploadResp = await fetch(uploadURL, {
|
|
681089
|
+
method: "PUT",
|
|
681090
|
+
body: archive,
|
|
681091
|
+
headers: {
|
|
681092
|
+
"Content-Type": "application/zstd",
|
|
681093
|
+
"Content-Length": String(archive.length)
|
|
681094
|
+
},
|
|
681095
|
+
signal: AbortSignal.timeout(3e4)
|
|
681096
|
+
});
|
|
681097
|
+
if (!uploadResp.ok) {
|
|
681098
|
+
throw new Error(`S3 upload failed: ${uploadResp.status} ${uploadResp.statusText}`);
|
|
681099
|
+
}
|
|
681100
|
+
logger15.info(`/_sb_persist: uploaded in ${Date.now() - uploadStart}ms (total ${Date.now() - persistStart}ms)`);
|
|
681101
|
+
res.status(200).json({ status: "uploaded" });
|
|
681102
|
+
} catch (error40) {
|
|
681103
|
+
logger15.error(`/_sb_persist failed: ${error40}`);
|
|
681104
|
+
res.status(500).json({ error: String(error40) });
|
|
681105
|
+
} finally {
|
|
681106
|
+
persistInProgress = false;
|
|
679947
681107
|
}
|
|
679948
681108
|
});
|
|
679949
681109
|
process.on("SIGINT", async () => {
|
|
@@ -679965,9 +681125,52 @@ async function createDevServer({ root: root3, mode, fsOperationQueue, syncServic
|
|
|
679965
681125
|
process.exit(1);
|
|
679966
681126
|
});
|
|
679967
681127
|
});
|
|
679968
|
-
|
|
679969
|
-
|
|
679970
|
-
|
|
681128
|
+
if (existingServer) {
|
|
681129
|
+
existingServer.removeAllListeners("request");
|
|
681130
|
+
existingServer.on("request", app);
|
|
681131
|
+
httpServer = existingServer;
|
|
681132
|
+
logger15.info(`Attached full dev server to existing HTTP server on port ${port}`);
|
|
681133
|
+
} else {
|
|
681134
|
+
logger15.info(`Starting HTTP server on port ${port}`);
|
|
681135
|
+
httpServer = await app.listen(port);
|
|
681136
|
+
logger15.info(`HTTP server started successfully on port ${port}`);
|
|
681137
|
+
}
|
|
681138
|
+
if (!isViteServerInitialized) {
|
|
681139
|
+
isViteServerInitialized = true;
|
|
681140
|
+
logger15.info("Eagerly starting vite server...");
|
|
681141
|
+
const featureFlags = await sdk?.getFeatureFlagsForCurrentUser().catch((err) => {
|
|
681142
|
+
logger15.warn(`Failed to fetch feature flags, using defaults: ${err}`);
|
|
681143
|
+
return void 0;
|
|
681144
|
+
});
|
|
681145
|
+
const viteStartPromise = startVite({
|
|
681146
|
+
port,
|
|
681147
|
+
app,
|
|
681148
|
+
root: root3,
|
|
681149
|
+
mode,
|
|
681150
|
+
fsOperationQueue,
|
|
681151
|
+
syncService,
|
|
681152
|
+
lockService,
|
|
681153
|
+
aiService,
|
|
681154
|
+
gitService,
|
|
681155
|
+
activateGitService,
|
|
681156
|
+
snapshotManager,
|
|
681157
|
+
checkAuthorization,
|
|
681158
|
+
logger: loggerOverride,
|
|
681159
|
+
httpServer,
|
|
681160
|
+
superblocksBaseUrl: explicitBaseUrl || localToken?.superblocksBaseUrl,
|
|
681161
|
+
features: {
|
|
681162
|
+
enableSessionRecording: featureFlags?.enableSessionRecording() ?? false
|
|
681163
|
+
}
|
|
681164
|
+
});
|
|
681165
|
+
viteStartPromise.then((result) => {
|
|
681166
|
+
logger15.info("Vite server initialized eagerly");
|
|
681167
|
+
viteResolve();
|
|
681168
|
+
viteCreationResults = result;
|
|
681169
|
+
}, (e) => {
|
|
681170
|
+
logger15.error("Error initializing vite server", getErrorMeta(e));
|
|
681171
|
+
viteReject(e);
|
|
681172
|
+
});
|
|
681173
|
+
}
|
|
679971
681174
|
return httpServer;
|
|
679972
681175
|
}
|
|
679973
681176
|
async function startVite({ app, httpServer: httpServer2, root: root3, mode, port, fsOperationQueue, syncService, lockService, aiService, gitService, activateGitService, snapshotManager, checkAuthorization, logger: loggerOverride, superblocksBaseUrl, features }) {
|
|
@@ -680036,13 +681239,7 @@ async function startVite({ app, httpServer: httpServer2, root: root3, mode, port
|
|
|
680036
681239
|
mode,
|
|
680037
681240
|
clearScreen: process.env.SUPERBLOCKS_CLI_ENV !== "local",
|
|
680038
681241
|
customLogger: viteLogger,
|
|
680039
|
-
optimizeDeps:
|
|
680040
|
-
esbuildOptions: {
|
|
680041
|
-
supported: {
|
|
680042
|
-
destructuring: true
|
|
680043
|
-
}
|
|
680044
|
-
}
|
|
680045
|
-
},
|
|
681242
|
+
optimizeDeps: OPTIMIZE_DEPS_CONFIG,
|
|
680046
681243
|
server: {
|
|
680047
681244
|
middlewareMode: true,
|
|
680048
681245
|
watch: {
|
|
@@ -680063,29 +681260,9 @@ async function startVite({ app, httpServer: httpServer2, root: root3, mode, port
|
|
|
680063
681260
|
// this replaces a string in @superblocksteam/shared
|
|
680064
681261
|
"process.env.SUPERBLOCKS_PUBLIC_INTEGRATIONS_CDN_URL": process.env.SUPERBLOCKS_PUBLIC_INTEGRATIONS_CDN_URL ? JSON.stringify(process.env.SUPERBLOCKS_PUBLIC_INTEGRATIONS_CDN_URL) : "undefined"
|
|
680065
681262
|
},
|
|
680066
|
-
plugins:
|
|
680067
|
-
|
|
680068
|
-
|
|
680069
|
-
customComponentsPlugin(),
|
|
680070
|
-
fileSyncPluginCreator.plugin,
|
|
680071
|
-
// Add a virtual "stub" module for the build manifest
|
|
680072
|
-
buildManifestStubPlugin(),
|
|
680073
|
-
react3({
|
|
680074
|
-
babel: {
|
|
680075
|
-
plugins: [
|
|
680076
|
-
// We will bring this back later
|
|
680077
|
-
// "babel-plugin-react-compiler",
|
|
680078
|
-
[
|
|
680079
|
-
import.meta.resolve("@babel/plugin-proposal-decorators"),
|
|
680080
|
-
{
|
|
680081
|
-
version: "2023-11"
|
|
680082
|
-
}
|
|
680083
|
-
]
|
|
680084
|
-
]
|
|
680085
|
-
}
|
|
680086
|
-
}),
|
|
680087
|
-
vite_plugin_optimize_lucide_imports_default(),
|
|
680088
|
-
ddRumPlugin({
|
|
681263
|
+
plugins: vitePlugins(root3, {
|
|
681264
|
+
fileSync: fileSyncPluginCreator.plugin,
|
|
681265
|
+
ddRum: {
|
|
680089
681266
|
clientToken: env2.SUPERBLOCKS_LIBRARY_DD_CLIENT_TOKEN ?? "",
|
|
680090
681267
|
applicationId: env2.SUPERBLOCKS_LIBRARY_DD_APPLICATION_ID ?? "",
|
|
680091
681268
|
env: env2.SUPERBLOCKS_LIBRARY_ENV ?? "prod",
|
|
@@ -680093,8 +681270,8 @@ async function startVite({ app, httpServer: httpServer2, root: root3, mode, port
|
|
|
680093
681270
|
// CLI auto-upgrade still works - the caching changes in this PR only affect detection speed.
|
|
680094
681271
|
// Replace with dynamic library version injection once available.
|
|
680095
681272
|
version: "1.0.0"
|
|
680096
|
-
}
|
|
680097
|
-
|
|
681273
|
+
}
|
|
681274
|
+
})
|
|
680098
681275
|
});
|
|
680099
681276
|
return server;
|
|
680100
681277
|
} finally {
|
|
@@ -680116,6 +681293,35 @@ async function startVite({ app, httpServer: httpServer2, root: root3, mode, port
|
|
|
680116
681293
|
}
|
|
680117
681294
|
});
|
|
680118
681295
|
}
|
|
681296
|
+
var PRE_WARM_TIMEOUT_MS = 6e4;
|
|
681297
|
+
async function preWarmViteCache(root3) {
|
|
681298
|
+
const start = Date.now();
|
|
681299
|
+
console.log("[warm] Pre-warming Vite dependency cache...");
|
|
681300
|
+
try {
|
|
681301
|
+
const server = await createServer({
|
|
681302
|
+
root: root3,
|
|
681303
|
+
mode: "development",
|
|
681304
|
+
server: { middlewareMode: true, hmr: false },
|
|
681305
|
+
plugins: vitePlugins(root3, { fileSync: fileSyncVitePlugin().plugin }),
|
|
681306
|
+
logLevel: "warn",
|
|
681307
|
+
optimizeDeps: OPTIMIZE_DEPS_CONFIG
|
|
681308
|
+
});
|
|
681309
|
+
const depsDir = path73.join(root3, "node_modules", ".vite", "deps");
|
|
681310
|
+
const pollMs = 100;
|
|
681311
|
+
const deadline = Date.now() + PRE_WARM_TIMEOUT_MS;
|
|
681312
|
+
while (!existsSync4(depsDir)) {
|
|
681313
|
+
if (Date.now() > deadline) {
|
|
681314
|
+
throw new Error(`Vite dep cache not created after ${PRE_WARM_TIMEOUT_MS}ms; optimizer likely hung`);
|
|
681315
|
+
}
|
|
681316
|
+
await new Promise((r2) => setTimeout(r2, pollMs));
|
|
681317
|
+
}
|
|
681318
|
+
await server.close();
|
|
681319
|
+
console.log(`[warm] Vite cache warmed in ${Date.now() - start}ms`);
|
|
681320
|
+
} catch (error40) {
|
|
681321
|
+
console.error(`[warm] Vite cache pre-warm failed (${Date.now() - start}ms) \u2014 exiting for fast pod recycle:`, error40);
|
|
681322
|
+
process.exit(1);
|
|
681323
|
+
}
|
|
681324
|
+
}
|
|
680119
681325
|
var DEFAULT_HMR_PORT = 24678;
|
|
680120
681326
|
function getFreePort() {
|
|
680121
681327
|
return new Promise((resolve9) => {
|
|
@@ -680255,7 +681461,7 @@ async function fetchAndWriteApplication({ resourceId, viewMode, featureFlags, pr
|
|
|
680255
681461
|
|
|
680256
681462
|
// ../sdk/dist/cli-replacement/socket-utils.mjs
|
|
680257
681463
|
init_cjs_shims();
|
|
680258
|
-
import { existsSync as
|
|
681464
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
680259
681465
|
import * as fs41 from "node:fs/promises";
|
|
680260
681466
|
import * as net2 from "node:net";
|
|
680261
681467
|
import * as os7 from "node:os";
|
|
@@ -680303,7 +681509,7 @@ async function getAllSocketFiles() {
|
|
|
680303
681509
|
}
|
|
680304
681510
|
async function getSocketFileForPid(pid) {
|
|
680305
681511
|
const socketPath = path74.join(getSocketDirectory(), `superblocks-auth-${pid}.sock`);
|
|
680306
|
-
return
|
|
681512
|
+
return existsSync5(socketPath) ? socketPath : null;
|
|
680307
681513
|
}
|
|
680308
681514
|
async function cleanupSocketFile(socketPath) {
|
|
680309
681515
|
try {
|
|
@@ -680346,7 +681552,7 @@ async function isSocketAlive(socketPath) {
|
|
|
680346
681552
|
// ../sdk/dist/cli-replacement/dev.mjs
|
|
680347
681553
|
init_cjs_shims();
|
|
680348
681554
|
init_esm();
|
|
680349
|
-
import * as
|
|
681555
|
+
import * as child_process4 from "node:child_process";
|
|
680350
681556
|
import * as nodeFs from "node:fs/promises";
|
|
680351
681557
|
import path76 from "node:path";
|
|
680352
681558
|
import * as readline2 from "node:readline";
|
|
@@ -680542,7 +681748,7 @@ async function ensureRemoteHasDefaultBranch(git, remoteUrl) {
|
|
|
680542
681748
|
}
|
|
680543
681749
|
|
|
680544
681750
|
// ../sdk/dist/cli-replacement/dev.mjs
|
|
680545
|
-
var exec10 = promisify7(
|
|
681751
|
+
var exec10 = promisify7(child_process4.exec);
|
|
680546
681752
|
var passErrorToVSCode = (message, logger15) => {
|
|
680547
681753
|
if (message && process.env.SUPERBLOCKS_VSCODE === "true") {
|
|
680548
681754
|
logger15.error(`clierr: ${JSON.stringify({ message })}`);
|
|
@@ -680632,7 +681838,7 @@ async function handleLockConflict(error40, lockSvc, span, logger15) {
|
|
|
680632
681838
|
}
|
|
680633
681839
|
async function readPkgJson(cwd) {
|
|
680634
681840
|
try {
|
|
680635
|
-
const { readPackage } = await import("./read-pkg-
|
|
681841
|
+
const { readPackage } = await import("./read-pkg-N6NFQVTC.js");
|
|
680636
681842
|
return await readPackage({ cwd });
|
|
680637
681843
|
} catch {
|
|
680638
681844
|
return null;
|
|
@@ -680674,6 +681880,7 @@ var DevServerAutoUpgradeMode;
|
|
|
680674
681880
|
(function(DevServerAutoUpgradeMode2) {
|
|
680675
681881
|
DevServerAutoUpgradeMode2["SKIP"] = "skip-upgrade";
|
|
680676
681882
|
DevServerAutoUpgradeMode2["FORCE"] = "force-upgrade";
|
|
681883
|
+
DevServerAutoUpgradeMode2["SKIP_CLI_ONLY"] = "skip-cli-only";
|
|
680677
681884
|
})(DevServerAutoUpgradeMode || (DevServerAutoUpgradeMode = {}));
|
|
680678
681885
|
async function dev(options8) {
|
|
680679
681886
|
const { cwd, tokenConfig, devServerPort, skipSync, applicationConfig, autoUpgradeMode, tokenManager, authHotReloadServer, sdk } = options8;
|
|
@@ -680688,6 +681895,7 @@ async function dev(options8) {
|
|
|
680688
681895
|
const tracer4 = getTracer();
|
|
680689
681896
|
const logger15 = getLogger2(options8.logger);
|
|
680690
681897
|
const skipAutoUpgrade = autoUpgradeMode === DevServerAutoUpgradeMode.SKIP;
|
|
681898
|
+
const skipCliUpgrade = skipAutoUpgrade || autoUpgradeMode === DevServerAutoUpgradeMode.SKIP_CLI_ONLY;
|
|
680691
681899
|
await tracer4.startActiveSpan("devServerStartup", async (startupSpan) => {
|
|
680692
681900
|
try {
|
|
680693
681901
|
if (!import_fs_extra5.default.existsSync(path76.join(cwd, "node_modules"))) {
|
|
@@ -680905,7 +682113,8 @@ async function dev(options8) {
|
|
|
680905
682113
|
let hasCliUpdated = false;
|
|
680906
682114
|
let upgradePromises = [];
|
|
680907
682115
|
const forceUpgrade = options8.autoUpgradeMode === DevServerAutoUpgradeMode.FORCE;
|
|
680908
|
-
|
|
682116
|
+
const skipCliOnly = options8.autoUpgradeMode === DevServerAutoUpgradeMode.SKIP_CLI_ONLY;
|
|
682117
|
+
if (!skipAutoUpgrade || forceUpgrade || skipCliOnly) {
|
|
680909
682118
|
await tracer4.startActiveSpan("versionCheckAndUpgrade", async (span) => {
|
|
680910
682119
|
if (lockService) {
|
|
680911
682120
|
const applicationConfigWithTokenConfigAndUserInfo = {
|
|
@@ -680917,7 +682126,7 @@ async function dev(options8) {
|
|
|
680917
682126
|
organizationId: currentUser.user.currentOrganizationId,
|
|
680918
682127
|
featureFlags: sdk.getFeatureFlagsForUser(currentUser)
|
|
680919
682128
|
};
|
|
680920
|
-
const result = await checkVersionsAndWritePackageJson(lockService, applicationConfigWithTokenConfigAndUserInfo, forceUpgrade);
|
|
682129
|
+
const result = await checkVersionsAndWritePackageJson(lockService, applicationConfigWithTokenConfigAndUserInfo, forceUpgrade, skipCliUpgrade);
|
|
680921
682130
|
hasCliUpdated = result.cliUpdated;
|
|
680922
682131
|
upgradePromises = result.upgradePromises;
|
|
680923
682132
|
} else {
|
|
@@ -681074,7 +682283,11 @@ async function dev(options8) {
|
|
|
681074
682283
|
snapshotManager,
|
|
681075
682284
|
logger: options8.logger,
|
|
681076
682285
|
sdk,
|
|
681077
|
-
superblocksBaseUrl: tokenConfig.superblocksBaseUrl
|
|
682286
|
+
superblocksBaseUrl: tokenConfig.superblocksBaseUrl,
|
|
682287
|
+
existingServer: options8.existingServer
|
|
682288
|
+
// TODO: Remove this cast — build the options object to match
|
|
682289
|
+
// CreateDevServerOptions directly so new required fields cause a
|
|
682290
|
+
// compile error instead of silently passing undefined.
|
|
681078
682291
|
};
|
|
681079
682292
|
const result = await createDevServer(createDevServerOptions);
|
|
681080
682293
|
span.end();
|
|
@@ -681421,6 +682634,7 @@ export {
|
|
|
681421
682634
|
SuperblocksSdk,
|
|
681422
682635
|
AUTO_UPGRADE_EXIT_CODE,
|
|
681423
682636
|
RESTART_EXIT_CODE,
|
|
682637
|
+
preWarmViteCache,
|
|
681424
682638
|
TokenManager,
|
|
681425
682639
|
tryDecodeJwtToken,
|
|
681426
682640
|
fetchAndWriteApplication,
|
|
@@ -681972,4 +683186,4 @@ serve-static/index.js:
|
|
|
681972
683186
|
chokidar/esm/index.js:
|
|
681973
683187
|
(*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
|
|
681974
683188
|
*/
|
|
681975
|
-
//# sourceMappingURL=chunk-
|
|
683189
|
+
//# sourceMappingURL=chunk-2S46UIQP.js.map
|