llmz 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RB2L33ZR.js → chunk-4EWY34YA.js} +24 -24
- package/dist/{chunk-UG2GCPHF.js → chunk-4KB5WXHR.js} +3 -2
- package/dist/{chunk-YPOOKE3A.cjs → chunk-4QTK5ALH.cjs} +59 -28
- package/dist/{chunk-BKGPO722.cjs → chunk-5NVNEEYW.cjs} +55 -55
- package/dist/{chunk-DFZ6GX5C.js → chunk-5TRUJES5.js} +1 -1
- package/dist/{chunk-C2TSWGYC.cjs → chunk-6YWYCVAB.cjs} +5 -4
- package/dist/{chunk-7S3UY52U.js → chunk-7WRN4E42.js} +36 -8
- package/dist/{chunk-Q4DEJGXD.js → chunk-EFGXTO64.js} +2 -2
- package/dist/{chunk-VP6WWAE2.cjs → chunk-FIVFS4HG.cjs} +2 -2
- package/dist/{chunk-YUDUY7XW.cjs → chunk-HYVKY3W6.cjs} +23 -24
- package/dist/{chunk-PQN6HW7A.cjs → chunk-IKSIOIIP.cjs} +3 -3
- package/dist/{chunk-ZUAFUOUR.cjs → chunk-JDABP4SD.cjs} +3 -3
- package/dist/{chunk-E5W3P7EO.cjs → chunk-JK2LZW2G.cjs} +20 -2
- package/dist/{chunk-RJHDQL4C.js → chunk-JKVVQN2P.js} +1 -1
- package/dist/{chunk-MSTBEKOQ.js → chunk-JQBT7UWN.js} +3 -3
- package/dist/{chunk-BOLDQGES.cjs → chunk-KMZDFWYZ.cjs} +3 -3
- package/dist/{chunk-R2N2UUKC.cjs → chunk-LVKZYKTP.cjs} +14 -8
- package/dist/{chunk-7FIPXMZR.js → chunk-ORQP26SZ.js} +1 -1
- package/dist/{chunk-ENFB45AI.cjs → chunk-P7J2WCBB.cjs} +7 -7
- package/dist/{chunk-DILHJIMP.js → chunk-QBXIE6EY.js} +49 -18
- package/dist/{chunk-UVSOAH2H.js → chunk-QT4QF3YA.js} +1 -1
- package/dist/{chunk-6QDFMQHA.js → chunk-S6WICIDW.js} +8 -2
- package/dist/{chunk-QPSUMPLP.js → chunk-TJQVC4CE.js} +6 -6
- package/dist/{chunk-ZSRC3TN4.js → chunk-UNMKB2DA.js} +9 -10
- package/dist/{chunk-3CGLDS5T.cjs → chunk-UQOBUJIQ.cjs} +38 -10
- package/dist/{chunk-QZGFCB4T.cjs → chunk-VAF2H6UD.cjs} +22 -22
- package/dist/{chunk-E2B5DRIC.cjs → chunk-W6U2VXSF.cjs} +25 -25
- package/dist/{chunk-3T465BEW.js → chunk-ZCPQ3QOW.js} +19 -1
- package/dist/citations.d.ts +63 -0
- package/dist/component-HQ5YQNRX.cjs +14 -0
- package/dist/component-LQDU72LX.js +14 -0
- package/dist/component.d.ts +32 -10
- package/dist/component.default.d.ts +334 -8
- package/dist/context.d.ts +3 -1
- package/dist/dual-modes-QHBOFWHM.js +13 -0
- package/dist/dual-modes-YE4S2AIL.cjs +13 -0
- package/dist/exit-F6ZUL2NV.js +8 -0
- package/dist/exit-IDKGZD7M.cjs +8 -0
- package/dist/exit.d.ts +2 -0
- package/dist/index.cjs +209 -58
- package/dist/index.d.ts +3 -2
- package/dist/index.js +193 -42
- package/dist/{jsx-CJ2RBODH.js → jsx-AEHVFB3L.js} +2 -3
- package/dist/jsx-AJAXBWFE.cjs +13 -0
- package/dist/{llmz-WY74UVE3.js → llmz-AS5TGCQS.js} +98 -39
- package/dist/{llmz-EGTGPSTX.cjs → llmz-R6XZG3JQ.cjs} +129 -70
- package/dist/llmz.d.ts +3 -2
- package/dist/snapshots.d.ts +9 -1
- package/dist/tool-LY77IWV2.js +11 -0
- package/dist/tool-SWJYOR2Z.cjs +11 -0
- package/dist/tool.d.ts +34 -9
- package/dist/truncator-NYN7BGKJ.cjs +10 -0
- package/dist/truncator-WAL2GCUY.js +10 -0
- package/dist/types.d.ts +7 -1
- package/dist/typings-AIV2OASX.js +10 -0
- package/dist/typings-XR6CYHW4.cjs +10 -0
- package/dist/{utils-TS23YJPE.js → utils-L5GLCS3C.js} +2 -3
- package/dist/utils-QC4I2L6R.cjs +37 -0
- package/dist/vm-GJ5R72AP.cjs +12 -0
- package/dist/vm-ZUQOSRRM.js +12 -0
- package/dist/vm.d.ts +1 -1
- package/package.json +8 -6
- package/dist/chunk-A7BDFLAE.cjs +0 -30
- package/dist/chunk-YSQDPG26.js +0 -30
- package/dist/component-DWBRHLEN.cjs +0 -9
- package/dist/component-R3ZAVXUC.js +0 -9
- package/dist/dual-modes-2VDEOJ5D.js +0 -13
- package/dist/dual-modes-3MH5N6RY.cjs +0 -13
- package/dist/exit-GYMXZZ4I.js +0 -9
- package/dist/exit-PQHMJEOG.cjs +0 -9
- package/dist/jsx-PPLE5YTB.cjs +0 -14
- package/dist/tool-AY47ML65.cjs +0 -12
- package/dist/tool-WVIPESKN.js +0 -12
- package/dist/truncator-MTONQESU.js +0 -11
- package/dist/truncator-ZKPOW2I3.cjs +0 -11
- package/dist/typings-HTYLRNIC.js +0 -11
- package/dist/typings-QRJGGNUM.cjs +0 -11
- package/dist/utils-UR4IMUHC.cjs +0 -38
- package/dist/vm-4JFSZAMR.cjs +0 -13
- package/dist/vm-SMMA664M.js +0 -13
- package/patches/source-map-js@1.2.1.patch +0 -16
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var _chunkBOLDQGEScjs = require('./chunk-BOLDQGES.cjs');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
8
|
+
var _chunkJDABP4SDcjs = require('./chunk-JDABP4SD.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkIKSIOIIPcjs = require('./chunk-IKSIOIIP.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkKMZDFWYZcjs = require('./chunk-KMZDFWYZ.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var _chunk3CGLDS5Tcjs = require('./chunk-3CGLDS5T.cjs');
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
var _chunkA7BDFLAEcjs = require('./chunk-A7BDFLAE.cjs');
|
|
21
|
+
var _chunkUQOBUJIQcjs = require('./chunk-UQOBUJIQ.cjs');
|
|
24
22
|
|
|
25
23
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/base64.js
|
|
26
|
-
var require_base64 =
|
|
24
|
+
var require_base64 = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
27
25
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/base64.js"(exports) {
|
|
28
26
|
"use strict";
|
|
29
27
|
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
@@ -65,7 +63,7 @@ var require_base64 = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
65
63
|
});
|
|
66
64
|
|
|
67
65
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/base64-vlq.js
|
|
68
|
-
var require_base64_vlq =
|
|
66
|
+
var require_base64_vlq = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
69
67
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/base64-vlq.js"(exports) {
|
|
70
68
|
"use strict";
|
|
71
69
|
var base64 = require_base64();
|
|
@@ -120,7 +118,7 @@ var require_base64_vlq = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
120
118
|
});
|
|
121
119
|
|
|
122
120
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/util.js
|
|
123
|
-
var require_util =
|
|
121
|
+
var require_util = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
124
122
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/util.js"(exports) {
|
|
125
123
|
"use strict";
|
|
126
124
|
function getArg(aArgs, aName, aDefaultValue) {
|
|
@@ -501,7 +499,7 @@ var require_util = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
501
499
|
});
|
|
502
500
|
|
|
503
501
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/array-set.js
|
|
504
|
-
var require_array_set =
|
|
502
|
+
var require_array_set = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
505
503
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/array-set.js"(exports) {
|
|
506
504
|
"use strict";
|
|
507
505
|
var util = require_util();
|
|
@@ -572,7 +570,7 @@ var require_array_set = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
572
570
|
});
|
|
573
571
|
|
|
574
572
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/mapping-list.js
|
|
575
|
-
var require_mapping_list =
|
|
573
|
+
var require_mapping_list = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
576
574
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/mapping-list.js"(exports) {
|
|
577
575
|
"use strict";
|
|
578
576
|
var util = require_util();
|
|
@@ -612,7 +610,7 @@ var require_mapping_list = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
612
610
|
});
|
|
613
611
|
|
|
614
612
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/source-map-generator.js
|
|
615
|
-
var require_source_map_generator =
|
|
613
|
+
var require_source_map_generator = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
616
614
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/source-map-generator.js"(exports) {
|
|
617
615
|
"use strict";
|
|
618
616
|
var base64VLQ = require_base64_vlq();
|
|
@@ -906,7 +904,7 @@ var require_source_map_generator = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
906
904
|
});
|
|
907
905
|
|
|
908
906
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/binary-search.js
|
|
909
|
-
var require_binary_search =
|
|
907
|
+
var require_binary_search = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
910
908
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/binary-search.js"(exports) {
|
|
911
909
|
"use strict";
|
|
912
910
|
exports.GREATEST_LOWER_BOUND = 1;
|
|
@@ -963,7 +961,7 @@ var require_binary_search = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
963
961
|
});
|
|
964
962
|
|
|
965
963
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/quick-sort.js
|
|
966
|
-
var require_quick_sort =
|
|
964
|
+
var require_quick_sort = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
967
965
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/quick-sort.js"(exports) {
|
|
968
966
|
"use strict";
|
|
969
967
|
function SortTemplate(comparator) {
|
|
@@ -1012,7 +1010,7 @@ var require_quick_sort = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
1012
1010
|
});
|
|
1013
1011
|
|
|
1014
1012
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/source-map-consumer.js
|
|
1015
|
-
var require_source_map_consumer =
|
|
1013
|
+
var require_source_map_consumer = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
1016
1014
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/source-map-consumer.js"(exports) {
|
|
1017
1015
|
"use strict";
|
|
1018
1016
|
var util = require_util();
|
|
@@ -1660,7 +1658,7 @@ var require_source_map_consumer = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
1660
1658
|
});
|
|
1661
1659
|
|
|
1662
1660
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/source-node.js
|
|
1663
|
-
var require_source_node =
|
|
1661
|
+
var require_source_node = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
1664
1662
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/lib/source-node.js"(exports) {
|
|
1665
1663
|
"use strict";
|
|
1666
1664
|
var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
@@ -1927,7 +1925,7 @@ var require_source_node = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
1927
1925
|
});
|
|
1928
1926
|
|
|
1929
1927
|
// ../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/source-map.js
|
|
1930
|
-
var require_source_map =
|
|
1928
|
+
var require_source_map = _chunkUQOBUJIQcjs.__commonJS.call(void 0, {
|
|
1931
1929
|
"../../node_modules/.pnpm/source-map-js@1.2.1_patch_hash=h25dep36e76b3zca3v6s2554fi/node_modules/source-map-js/source-map.js"(exports) {
|
|
1932
1930
|
"use strict";
|
|
1933
1931
|
exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
@@ -1937,7 +1935,7 @@ var require_source_map = _chunkA7BDFLAEcjs.__commonJS.call(void 0, {
|
|
|
1937
1935
|
});
|
|
1938
1936
|
|
|
1939
1937
|
// src/vm.ts
|
|
1940
|
-
var import_source_map_js =
|
|
1938
|
+
var import_source_map_js = _chunkUQOBUJIQcjs.__toESM.call(void 0, require_source_map(), 1);
|
|
1941
1939
|
|
|
1942
1940
|
// src/compiler/compiler.ts
|
|
1943
1941
|
var _plugintransformreactjsx = require('@babel/plugin-transform-react-jsx'); var _plugintransformreactjsx2 = _interopRequireDefault(_plugintransformreactjsx);
|
|
@@ -2148,7 +2146,7 @@ var replaceCommentBabelPlugin = function({
|
|
|
2148
2146
|
return;
|
|
2149
2147
|
}
|
|
2150
2148
|
comments.sort((a, b) => a.start > b.start ? -1 : 1).forEach((comment) => {
|
|
2151
|
-
var
|
|
2149
|
+
var _a3;
|
|
2152
2150
|
if (processed.has(comment.loc)) {
|
|
2153
2151
|
return;
|
|
2154
2152
|
}
|
|
@@ -2156,7 +2154,7 @@ var replaceCommentBabelPlugin = function({
|
|
|
2156
2154
|
const commentCall = t.expressionStatement(
|
|
2157
2155
|
t.callExpression(t.identifier(CommentFnIdentifier), [
|
|
2158
2156
|
t.stringLiteral(comment.value.trim()),
|
|
2159
|
-
t.numericLiteral(_nullishCoalesce(((
|
|
2157
|
+
t.numericLiteral(_nullishCoalesce(((_a3 = comment.loc) == null ? void 0 : _a3.start.line), () => ( 0)))
|
|
2160
2158
|
])
|
|
2161
2159
|
);
|
|
2162
2160
|
const isInsideObjectProperty = t.isObjectProperty(node) || path2.findParent((path3) => t.isObjectProperty(path3.node));
|
|
@@ -2183,8 +2181,8 @@ var instrumentLastLinePlugin = function({
|
|
|
2183
2181
|
return {
|
|
2184
2182
|
visitor: {
|
|
2185
2183
|
FunctionDeclaration(path) {
|
|
2186
|
-
var
|
|
2187
|
-
if (((
|
|
2184
|
+
var _a3, _b;
|
|
2185
|
+
if (((_a3 = path.node.id) == null ? void 0 : _a3.name) !== "__fn__") {
|
|
2188
2186
|
return;
|
|
2189
2187
|
}
|
|
2190
2188
|
const statements = path.node.body.body;
|
|
@@ -2270,7 +2268,7 @@ var toolCallTrackingPlugin = (calls = /* @__PURE__ */ new Map()) => function({})
|
|
|
2270
2268
|
skip.clear();
|
|
2271
2269
|
},
|
|
2272
2270
|
CallExpression(path) {
|
|
2273
|
-
var
|
|
2271
|
+
var _a3;
|
|
2274
2272
|
if (skip.has(path.node) || path.findParent((p) => skip.has(p.node))) {
|
|
2275
2273
|
return;
|
|
2276
2274
|
}
|
|
@@ -2285,7 +2283,7 @@ var toolCallTrackingPlugin = (calls = /* @__PURE__ */ new Map()) => function({})
|
|
|
2285
2283
|
(p) => p.isAssignmentExpression()
|
|
2286
2284
|
);
|
|
2287
2285
|
if (declaration) {
|
|
2288
|
-
lval = (
|
|
2286
|
+
lval = (_a3 = declaration.get("declarations")[0]) == null ? void 0 : _a3.get("id");
|
|
2289
2287
|
}
|
|
2290
2288
|
if (assignment) {
|
|
2291
2289
|
const left = assignment.get("left");
|
|
@@ -2614,8 +2612,10 @@ function compile(code) {
|
|
|
2614
2612
|
|
|
2615
2613
|
// src/vm.ts
|
|
2616
2614
|
var IS_NODE = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
2615
|
+
var _a;
|
|
2616
|
+
var IS_CI = typeof process !== "undefined" && !!((_a = process == null ? void 0 : process.env) == null ? void 0 : _a.CI);
|
|
2617
|
+
var _a2;
|
|
2618
|
+
var VM_DRIVER = _nullishCoalesce((typeof process !== "undefined" && ((_a2 = process == null ? void 0 : process.env) == null ? void 0 : _a2.VM_DRIVER)), () => ( (IS_CI ? "node" : "isolated-vm")));
|
|
2619
2619
|
var USE_ISOLATED_VM = IS_NODE && VM_DRIVER === "isolated-vm";
|
|
2620
2620
|
var LINE_OFFSET = USE_ISOLATED_VM ? 3 : 1;
|
|
2621
2621
|
var MAX_VM_EXECUTION_TIME = 6e4;
|
|
@@ -2645,10 +2645,10 @@ function getCompiledCode(code, traces = []) {
|
|
|
2645
2645
|
code,
|
|
2646
2646
|
started_at: Date.now()
|
|
2647
2647
|
});
|
|
2648
|
-
throw new (0,
|
|
2648
|
+
throw new (0, _chunkJDABP4SDcjs.InvalidCodeError)(err.message, code);
|
|
2649
2649
|
}
|
|
2650
2650
|
}
|
|
2651
|
-
async function runAsyncFunction(context, code, traces = [], signal = null) {
|
|
2651
|
+
async function runAsyncFunction(context, code, traces = [], signal = null, timeout = MAX_VM_EXECUTION_TIME) {
|
|
2652
2652
|
const transformed = getCompiledCode(code, traces);
|
|
2653
2653
|
const lines_executed = /* @__PURE__ */ new Map();
|
|
2654
2654
|
const variables = {};
|
|
@@ -2669,7 +2669,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null) {
|
|
|
2669
2669
|
context[Identifiers.LineTrackingFnIdentifier] = (line) => {
|
|
2670
2670
|
lines_executed.set(line, (_nullishCoalesce(lines_executed.get(line), () => ( 0))) + 1);
|
|
2671
2671
|
};
|
|
2672
|
-
context[Identifiers.JSXFnIdentifier] = (tool, props, ...children) =>
|
|
2672
|
+
context[Identifiers.JSXFnIdentifier] = (tool, props, ...children) => _chunkKMZDFWYZcjs.createJsxComponent.call(void 0, {
|
|
2673
2673
|
type: tool,
|
|
2674
2674
|
props,
|
|
2675
2675
|
children
|
|
@@ -2692,12 +2692,12 @@ async function runAsyncFunction(context, code, traces = [], signal = null) {
|
|
|
2692
2692
|
};
|
|
2693
2693
|
let currentToolCall;
|
|
2694
2694
|
context[Identifiers.ToolCallTrackerFnIdentifier] = (callId, type, outputOrError) => {
|
|
2695
|
-
var
|
|
2696
|
-
const temp =
|
|
2697
|
-
if (type === "end" && temp instanceof
|
|
2695
|
+
var _a3;
|
|
2696
|
+
const temp = _chunkJDABP4SDcjs.Signals.maybeDeserializeError(outputOrError == null ? void 0 : outputOrError.message);
|
|
2697
|
+
if (type === "end" && temp instanceof _chunkJDABP4SDcjs.SnapshotSignal && (temp == null ? void 0 : temp.toolCall)) {
|
|
2698
2698
|
currentToolCall = {
|
|
2699
2699
|
...temp.toolCall,
|
|
2700
|
-
assignment: (
|
|
2700
|
+
assignment: (_a3 = transformed.toolCalls.get(callId)) == null ? void 0 : _a3.assignment
|
|
2701
2701
|
};
|
|
2702
2702
|
}
|
|
2703
2703
|
};
|
|
@@ -2745,11 +2745,11 @@ async function runAsyncFunction(context, code, traces = [], signal = null) {
|
|
|
2745
2745
|
await context[Identifiers.AsyncIterYieldFnIdentifier](value);
|
|
2746
2746
|
} while (true);
|
|
2747
2747
|
})().then((res) => {
|
|
2748
|
-
res =
|
|
2748
|
+
res = _chunkJDABP4SDcjs.Signals.maybeDeserializeError(res);
|
|
2749
2749
|
return {
|
|
2750
2750
|
success: true,
|
|
2751
|
-
variables:
|
|
2752
|
-
signal: res instanceof
|
|
2751
|
+
variables: _chunkUQOBUJIQcjs.mapValues_default.call(void 0, variables, (getter) => _chunkUQOBUJIQcjs.isFunction_default.call(void 0, getter) ? getter() : getter),
|
|
2752
|
+
signal: res instanceof _chunkJDABP4SDcjs.VMSignal ? res : void 0,
|
|
2753
2753
|
lines_executed: Array.from(lines_executed),
|
|
2754
2754
|
return_value: res
|
|
2755
2755
|
};
|
|
@@ -2900,7 +2900,7 @@ do {
|
|
|
2900
2900
|
try {
|
|
2901
2901
|
Object.assign(context[key], { [prop]: obj });
|
|
2902
2902
|
} catch (err) {
|
|
2903
|
-
if (err instanceof
|
|
2903
|
+
if (err instanceof _chunkJDABP4SDcjs.AssignmentError) {
|
|
2904
2904
|
traces.push({
|
|
2905
2905
|
type: "code_execution_exception",
|
|
2906
2906
|
position: [0, 0],
|
|
@@ -2925,7 +2925,7 @@ do {
|
|
|
2925
2925
|
try {
|
|
2926
2926
|
Object.assign(context, { [key]: value });
|
|
2927
2927
|
} catch (err) {
|
|
2928
|
-
if (err instanceof
|
|
2928
|
+
if (err instanceof _chunkJDABP4SDcjs.AssignmentError) {
|
|
2929
2929
|
traces.push({
|
|
2930
2930
|
type: "code_execution_exception",
|
|
2931
2931
|
position: [0, 0],
|
|
@@ -2947,22 +2947,22 @@ do {
|
|
|
2947
2947
|
// TODO: fix getRemainingTimeInMillis ...
|
|
2948
2948
|
// TODO: probably expose a "timeout" option instead
|
|
2949
2949
|
// timeout: clamp(Runtime.getRemainingTimeInMillis() - 10_000, 5_000, MAX_VM_EXECUTION_TIME),
|
|
2950
|
-
timeout
|
|
2950
|
+
timeout,
|
|
2951
2951
|
copy: true,
|
|
2952
2952
|
promise: true
|
|
2953
2953
|
}).then((res) => {
|
|
2954
2954
|
copyBackContextFromJail();
|
|
2955
2955
|
if (copyErrors.length) {
|
|
2956
|
-
throw new (0,
|
|
2956
|
+
throw new (0, _chunkJDABP4SDcjs.CodeExecutionError)(copyErrors.map((x) => x.message).join(", "), code, "");
|
|
2957
2957
|
}
|
|
2958
2958
|
return res;
|
|
2959
2959
|
}).then(
|
|
2960
2960
|
(res) => {
|
|
2961
|
-
res =
|
|
2961
|
+
res = _chunkJDABP4SDcjs.Signals.maybeDeserializeError(res);
|
|
2962
2962
|
return {
|
|
2963
2963
|
success: true,
|
|
2964
|
-
variables:
|
|
2965
|
-
signal: res instanceof
|
|
2964
|
+
variables: _chunkUQOBUJIQcjs.mapValues_default.call(void 0, variables, (getter) => _chunkUQOBUJIQcjs.isFunction_default.call(void 0, getter) ? getter() : getter),
|
|
2965
|
+
signal: res instanceof _chunkJDABP4SDcjs.VMSignal ? res : void 0,
|
|
2966
2966
|
lines_executed: Array.from(lines_executed),
|
|
2967
2967
|
return_value: res
|
|
2968
2968
|
};
|
|
@@ -2990,8 +2990,8 @@ do {
|
|
|
2990
2990
|
return final;
|
|
2991
2991
|
}
|
|
2992
2992
|
var handleError = (err, code, consumer, traces, variables, lines_executed, currentToolCall) => {
|
|
2993
|
-
var
|
|
2994
|
-
err =
|
|
2993
|
+
var _a3, _b, _c;
|
|
2994
|
+
err = _chunkJDABP4SDcjs.Signals.maybeDeserializeError(err);
|
|
2995
2995
|
const lines = code.split("\n");
|
|
2996
2996
|
const stackTrace = err.stack || "";
|
|
2997
2997
|
let regex = /\(<isolated-vm>:(\d+):(\d+)/g;
|
|
@@ -3012,7 +3012,7 @@ var handleError = (err, code, consumer, traces, variables, lines_executed, curre
|
|
|
3012
3012
|
column: Math.min(minColumn, Number(x[2]))
|
|
3013
3013
|
};
|
|
3014
3014
|
});
|
|
3015
|
-
const lastLine = _nullishCoalesce(((
|
|
3015
|
+
const lastLine = _nullishCoalesce(((_a3 = _chunkUQOBUJIQcjs.maxBy_default.call(void 0, matches, (x) => _nullishCoalesce(x.line, () => ( 0)))) == null ? void 0 : _a3.line), () => ( 0));
|
|
3016
3016
|
let debugUserCode = "";
|
|
3017
3017
|
let truncatedCode = "";
|
|
3018
3018
|
let truncated = false;
|
|
@@ -3042,12 +3042,12 @@ var handleError = (err, code, consumer, traces, variables, lines_executed, curre
|
|
|
3042
3042
|
`);
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
|
-
debugUserCode =
|
|
3046
|
-
truncatedCode =
|
|
3047
|
-
if (err instanceof
|
|
3045
|
+
debugUserCode = _chunkIKSIOIIPcjs.cleanStackTrace.call(void 0, debugUserCode).trim();
|
|
3046
|
+
truncatedCode = _chunkIKSIOIIPcjs.cleanStackTrace.call(void 0, truncatedCode).trim();
|
|
3047
|
+
if (err instanceof _chunkJDABP4SDcjs.VMSignal) {
|
|
3048
3048
|
err.stack = debugUserCode;
|
|
3049
3049
|
err.truncatedCode = truncatedCode;
|
|
3050
|
-
err.variables =
|
|
3050
|
+
err.variables = _chunkUQOBUJIQcjs.mapValues_default.call(void 0, variables, (getter) => _chunkUQOBUJIQcjs.isFunction_default.call(void 0, getter) ? getter() : getter);
|
|
3051
3051
|
err.toolCall = currentToolCall;
|
|
3052
3052
|
throw err;
|
|
3053
3053
|
} else {
|
|
@@ -3058,16 +3058,16 @@ var handleError = (err, code, consumer, traces, variables, lines_executed, curre
|
|
|
3058
3058
|
stackTrace: debugUserCode,
|
|
3059
3059
|
started_at: Date.now()
|
|
3060
3060
|
});
|
|
3061
|
-
throw new (0,
|
|
3061
|
+
throw new (0, _chunkJDABP4SDcjs.CodeExecutionError)(err.message, code, debugUserCode);
|
|
3062
3062
|
}
|
|
3063
3063
|
};
|
|
3064
3064
|
var handleCatch = (err, traces, variables, lines_executed) => {
|
|
3065
|
-
err =
|
|
3065
|
+
err = _chunkJDABP4SDcjs.Signals.maybeDeserializeError(err);
|
|
3066
3066
|
return {
|
|
3067
|
-
success: err instanceof
|
|
3068
|
-
variables:
|
|
3067
|
+
success: err instanceof _chunkJDABP4SDcjs.VMSignal ? true : false,
|
|
3068
|
+
variables: _chunkUQOBUJIQcjs.mapValues_default.call(void 0, variables, (getter) => _chunkUQOBUJIQcjs.isFunction_default.call(void 0, getter) ? getter() : getter),
|
|
3069
3069
|
error: err,
|
|
3070
|
-
signal: err instanceof
|
|
3070
|
+
signal: err instanceof _chunkJDABP4SDcjs.VMSignal ? err : void 0,
|
|
3071
3071
|
traces,
|
|
3072
3072
|
lines_executed: Array.from(lines_executed)
|
|
3073
3073
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkVAF2H6UDcjs = require('./chunk-VAF2H6UD.cjs');
|
|
5
5
|
|
|
6
6
|
// src/snapshots.ts
|
|
7
7
|
var _ulid = require('ulid');
|
|
@@ -26,10 +26,10 @@ var Snapshot = class _Snapshot {
|
|
|
26
26
|
}
|
|
27
27
|
static fromSignal(signal) {
|
|
28
28
|
const variables = Object.entries(signal.variables).map(([name, value]) => {
|
|
29
|
-
const type =
|
|
29
|
+
const type = _chunkVAF2H6UDcjs.extractType.call(void 0, value);
|
|
30
30
|
const bytes = JSON.stringify(value || "").length;
|
|
31
31
|
const truncated = bytes > MAX_SNAPSHOT_SIZE_BYTES;
|
|
32
|
-
return truncated ? { name, type, bytes, truncated: true, preview: _nullishCoalesce(
|
|
32
|
+
return truncated ? { name, type, bytes, truncated: true, preview: _nullishCoalesce(_chunkVAF2H6UDcjs.inspect.call(void 0, value, name), () => ( "N/A")) } : { name, type, bytes, truncated: false, value };
|
|
33
33
|
});
|
|
34
34
|
return new _Snapshot({
|
|
35
35
|
id: "snapshot_" + _ulid.ulid.call(void 0, ),
|
|
@@ -46,7 +46,8 @@ var Snapshot = class _Snapshot {
|
|
|
46
46
|
reason: this.reason,
|
|
47
47
|
stack: this.stack,
|
|
48
48
|
variables: this.variables,
|
|
49
|
-
toolCall: this.toolCall
|
|
49
|
+
toolCall: this.toolCall,
|
|
50
|
+
status: this.#status
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
static fromJSON(json) {
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
1
27
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
|
|
2
28
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
3
29
|
var freeGlobal_default = freeGlobal;
|
|
@@ -8,8 +34,8 @@ var root = freeGlobal_default || freeSelf || Function("return this")();
|
|
|
8
34
|
var root_default = root;
|
|
9
35
|
|
|
10
36
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
|
|
11
|
-
var
|
|
12
|
-
var Symbol_default =
|
|
37
|
+
var Symbol2 = root_default.Symbol;
|
|
38
|
+
var Symbol_default = Symbol2;
|
|
13
39
|
|
|
14
40
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
|
|
15
41
|
var objectProto = Object.prototype;
|
|
@@ -863,8 +889,8 @@ var stubFalse_default = stubFalse;
|
|
|
863
889
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
864
890
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
865
891
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
866
|
-
var
|
|
867
|
-
var nativeIsBuffer =
|
|
892
|
+
var Buffer2 = moduleExports ? root_default.Buffer : void 0;
|
|
893
|
+
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
|
|
868
894
|
var isBuffer = nativeIsBuffer || stubFalse_default;
|
|
869
895
|
var isBuffer_default = isBuffer;
|
|
870
896
|
|
|
@@ -1334,8 +1360,8 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
1334
1360
|
var equalArrays_default = equalArrays;
|
|
1335
1361
|
|
|
1336
1362
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js
|
|
1337
|
-
var
|
|
1338
|
-
var Uint8Array_default =
|
|
1363
|
+
var Uint8Array2 = root_default.Uint8Array;
|
|
1364
|
+
var Uint8Array_default = Uint8Array2;
|
|
1339
1365
|
|
|
1340
1366
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js
|
|
1341
1367
|
function mapToArray(map) {
|
|
@@ -2077,8 +2103,8 @@ var baseAssignIn_default = baseAssignIn;
|
|
|
2077
2103
|
var freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
2078
2104
|
var freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
|
|
2079
2105
|
var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
|
|
2080
|
-
var
|
|
2081
|
-
var allocUnsafe =
|
|
2106
|
+
var Buffer3 = moduleExports3 ? root_default.Buffer : void 0;
|
|
2107
|
+
var allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : void 0;
|
|
2082
2108
|
function cloneBuffer(buffer, isDeep) {
|
|
2083
2109
|
if (isDeep) {
|
|
2084
2110
|
return buffer.slice();
|
|
@@ -3020,6 +3046,8 @@ function uniqWith(array, comparator) {
|
|
|
3020
3046
|
var uniqWith_default = uniqWith;
|
|
3021
3047
|
|
|
3022
3048
|
export {
|
|
3049
|
+
__commonJS,
|
|
3050
|
+
__toESM,
|
|
3023
3051
|
isFunction_default,
|
|
3024
3052
|
isPlainObject_default,
|
|
3025
3053
|
upperFirst_default,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
escapeString,
|
|
3
3
|
getTokenizer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5TRUJES5.js";
|
|
5
5
|
import {
|
|
6
6
|
chain_default,
|
|
7
7
|
countBy_default,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
orderBy_default,
|
|
14
14
|
uniqWith_default,
|
|
15
15
|
uniq_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7WRN4E42.js";
|
|
17
17
|
|
|
18
18
|
// src/inspect.ts
|
|
19
19
|
import bytes from "bytes";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkP7J2WCBBcjs = require('./chunk-P7J2WCBB.cjs');
|
|
4
4
|
|
|
5
5
|
// src/truncator.ts
|
|
6
6
|
var DEFAULT_REMOVE_CHUNK = 250;
|
|
@@ -25,7 +25,7 @@ function truncateWrappedContent({
|
|
|
25
25
|
throwOnFailure = true
|
|
26
26
|
}) {
|
|
27
27
|
var _a, _b, _c;
|
|
28
|
-
const tokenizer =
|
|
28
|
+
const tokenizer = _chunkP7J2WCBBcjs.getTokenizer.call(void 0, );
|
|
29
29
|
const parts = [];
|
|
30
30
|
for (const msg of messages) {
|
|
31
31
|
const current = [];
|