llmz 0.9.7 → 0.9.9
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/{execute-DBhDYqtu.js → execute-BKGctPpH.js} +1 -1
- package/dist/{execute-Bwl_L33k.cjs → execute-C2-Hwyj2.cjs} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/index.workerd.js +8 -3
- package/dist/{vm-X0uTj5Aa.cjs → vm-Cfo2RhZ9.cjs} +7 -2
- package/dist/{vm-Cn3jvZ00.js → vm-VNqvqKN9.js} +7 -2
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@ import { t as cleanStackTrace } from "./stack-traces-BIE_5Xwf.js";
|
|
|
7
7
|
import { a as InvalidCodeError, c as SnapshotSignal, i as CognitiveError, l as ThinkSignal, n as CodeExecutionError, o as LoopExceededError, s as Signals, t as AssignmentError } from "./errors-Cg1G0Awu.js";
|
|
8
8
|
import { n as truncateWrappedContent } from "./truncator-CD7QtE84.js";
|
|
9
9
|
import { r as hasTopLevelReturn } from "./compiler-BPl-5CXh.js";
|
|
10
|
-
import { runAsyncFunction, warmupVM } from "./vm-
|
|
10
|
+
import { runAsyncFunction, warmupVM } from "./vm-VNqvqKN9.js";
|
|
11
11
|
import { z } from "@bpinternal/zui";
|
|
12
12
|
import { ulid } from "ulid";
|
|
13
13
|
import { Client } from "@botpress/client";
|
|
@@ -7,7 +7,7 @@ const require_jsx = require("./jsx-BJ6GWXI2.cjs");
|
|
|
7
7
|
const require_stack_traces = require("./stack-traces-ntw_qhoy.cjs");
|
|
8
8
|
const require_errors = require("./errors-C962uJdS.cjs");
|
|
9
9
|
const require_truncator = require("./truncator-DmCu9M4m.cjs");
|
|
10
|
-
const require_vm = require("./vm-
|
|
10
|
+
const require_vm = require("./vm-Cfo2RhZ9.cjs");
|
|
11
11
|
let _bpinternal_zui = require("@bpinternal/zui");
|
|
12
12
|
let ulid = require("ulid");
|
|
13
13
|
let _botpress_client = require("@botpress/client");
|
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const require_truncator = require("./truncator-DmCu9M4m.cjs");
|
|
|
12
12
|
const require_quickjs_variant = require("./quickjs-variant-CsIwTVFC.cjs");
|
|
13
13
|
let _bpinternal_zui = require("@bpinternal/zui");
|
|
14
14
|
//#region package.json
|
|
15
|
-
var version = "0.9.
|
|
15
|
+
var version = "0.9.9";
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/hoist.ts
|
|
18
18
|
/**
|
|
@@ -1693,7 +1693,7 @@ const utils = {
|
|
|
1693
1693
|
* })
|
|
1694
1694
|
*/
|
|
1695
1695
|
const execute = async (props) => {
|
|
1696
|
-
const { executeContext } = await Promise.resolve().then(() => require("./execute-
|
|
1696
|
+
const { executeContext } = await Promise.resolve().then(() => require("./execute-C2-Hwyj2.cjs"));
|
|
1697
1697
|
return executeContext(props);
|
|
1698
1698
|
};
|
|
1699
1699
|
/**
|
|
@@ -1702,12 +1702,12 @@ const execute = async (props) => {
|
|
|
1702
1702
|
* It's recommended to call this function at the beginning of your application without awaiting it (void init())
|
|
1703
1703
|
*/
|
|
1704
1704
|
const init = async () => {
|
|
1705
|
-
await Promise.resolve().then(() => require("./execute-
|
|
1705
|
+
await Promise.resolve().then(() => require("./execute-C2-Hwyj2.cjs"));
|
|
1706
1706
|
await Promise.resolve().then(() => require("./component-CPKXe6Ca.cjs")).then((n) => n.component_exports);
|
|
1707
1707
|
await Promise.resolve().then(() => require("./tool-BLTrA-sL.cjs")).then((n) => n.tool_exports);
|
|
1708
1708
|
await Promise.resolve().then(() => require("./exit-CGLXI0BH.cjs")).then((n) => n.exit_exports);
|
|
1709
1709
|
await Promise.resolve().then(() => require("./jsx-BJ6GWXI2.cjs")).then((n) => n.jsx_exports);
|
|
1710
|
-
await Promise.resolve().then(() => require("./vm-
|
|
1710
|
+
await Promise.resolve().then(() => require("./vm-Cfo2RhZ9.cjs"));
|
|
1711
1711
|
await Promise.resolve().then(() => require("./utils-DGQ4sRke.cjs")).then((n) => n.utils_exports);
|
|
1712
1712
|
await Promise.resolve().then(() => require("./truncator-DmCu9M4m.cjs")).then((n) => n.truncator_exports);
|
|
1713
1713
|
await Promise.resolve().then(() => require("./typings-DXJMu59O.cjs")).then((n) => n.typings_exports);
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { i as wrapContent, n as truncateWrappedContent, t as stripTruncationTags
|
|
|
11
11
|
import { t as configureQuickJS } from "./quickjs-variant-BYhMBpwU.js";
|
|
12
12
|
import { transforms, z } from "@bpinternal/zui";
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "0.9.
|
|
14
|
+
var version = "0.9.9";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/hoist.ts
|
|
17
17
|
/**
|
|
@@ -1692,7 +1692,7 @@ const utils = {
|
|
|
1692
1692
|
* })
|
|
1693
1693
|
*/
|
|
1694
1694
|
const execute = async (props) => {
|
|
1695
|
-
const { executeContext } = await import("./execute-
|
|
1695
|
+
const { executeContext } = await import("./execute-BKGctPpH.js");
|
|
1696
1696
|
return executeContext(props);
|
|
1697
1697
|
};
|
|
1698
1698
|
/**
|
|
@@ -1701,12 +1701,12 @@ const execute = async (props) => {
|
|
|
1701
1701
|
* It's recommended to call this function at the beginning of your application without awaiting it (void init())
|
|
1702
1702
|
*/
|
|
1703
1703
|
const init = async () => {
|
|
1704
|
-
await import("./execute-
|
|
1704
|
+
await import("./execute-BKGctPpH.js");
|
|
1705
1705
|
await import("./component-DGG7d_Mz.js").then((n) => n.r);
|
|
1706
1706
|
await import("./tool-B6Pmuk6K.js").then((n) => n.n);
|
|
1707
1707
|
await import("./exit-CDdxDBRT.js").then((n) => n.n);
|
|
1708
1708
|
await import("./jsx-CIgdGGVs.js").then((n) => n.i);
|
|
1709
|
-
await import("./vm-
|
|
1709
|
+
await import("./vm-VNqvqKN9.js");
|
|
1710
1710
|
await import("./utils-UBeAFeEI.js").then((n) => n.h);
|
|
1711
1711
|
await import("./truncator-CD7QtE84.js").then((n) => n.r);
|
|
1712
1712
|
await import("./typings-CrBa7Tyy.js").then((n) => n.n);
|
package/dist/index.workerd.js
CHANGED
|
@@ -52,7 +52,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
52
|
}) : target, mod));
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region package.json
|
|
55
|
-
var version = "0.9.
|
|
55
|
+
var version = "0.9.9", quoteExample, quotePartialExample, exampleBoundaryInstructions, quoteResponseExample;
|
|
56
56
|
var init_example_format = __esmMin((() => {
|
|
57
57
|
quoteExample = (output) => `"""\n${output}\n"""`;
|
|
58
58
|
quotePartialExample = (output) => quoteExample(`(...)\n${output}\n(...)`);
|
|
@@ -17793,10 +17793,13 @@ var init_quickjs = __esmMin((() => {
|
|
|
17793
17793
|
const runtime = (await loadQuickJSModule()).newRuntime();
|
|
17794
17794
|
runtime.setMemoryLimit(134217728);
|
|
17795
17795
|
const timeoutHandler = shouldInterruptAfterDeadline(Date.now() + timeout);
|
|
17796
|
+
let timedOut = false;
|
|
17796
17797
|
runtime.setInterruptHandler(() => {
|
|
17797
17798
|
if (signal?.aborted) return true;
|
|
17798
|
-
|
|
17799
|
+
if (timeoutHandler(runtime)) timedOut = true;
|
|
17800
|
+
return timedOut;
|
|
17799
17801
|
});
|
|
17802
|
+
const timeoutError = () => /* @__PURE__ */ new Error(`Code execution timed out after ${timeout}ms`);
|
|
17800
17803
|
const vm = runtime.newContext();
|
|
17801
17804
|
const trackedProperties = /* @__PURE__ */ new Set();
|
|
17802
17805
|
const referenceProperties = /* @__PURE__ */ new Set();
|
|
@@ -17897,6 +17900,7 @@ var init_quickjs = __esmMin((() => {
|
|
|
17897
17900
|
}
|
|
17898
17901
|
execResult.value.dispose();
|
|
17899
17902
|
await this._pumpEventLoop(runtime, vm, pendingPromises, signal, toVmValue, disposeIfNeeded);
|
|
17903
|
+
const codeTimedOut = timedOut;
|
|
17900
17904
|
const errorResult = vm.evalCode("globalThis.__llmz_error");
|
|
17901
17905
|
const errorValue = vm.dump(errorResult.unwrap());
|
|
17902
17906
|
errorResult.unwrap().dispose();
|
|
@@ -17922,6 +17926,7 @@ var init_quickjs = __esmMin((() => {
|
|
|
17922
17926
|
throw error;
|
|
17923
17927
|
}
|
|
17924
17928
|
copyBackContextFromVM();
|
|
17929
|
+
if (codeTimedOut) throw timeoutError();
|
|
17925
17930
|
const resultSetResult = vm.evalCode("globalThis.__llmz_result_set");
|
|
17926
17931
|
const resultSet = vm.dump(resultSetResult.unwrap());
|
|
17927
17932
|
resultSetResult.unwrap().dispose();
|
|
@@ -17958,7 +17963,7 @@ var init_quickjs = __esmMin((() => {
|
|
|
17958
17963
|
errValue.dispose();
|
|
17959
17964
|
}
|
|
17960
17965
|
})).catch(() => {});
|
|
17961
|
-
return handleErrorQuickJS(err, code, consumer, traces, variables, lines_executed, userCodeStartLine, ctx.currentToolCall ?? state.currentToolCall);
|
|
17966
|
+
return handleErrorQuickJS(timedOut ? timeoutError() : err, code, consumer, traces, variables, lines_executed, userCodeStartLine, ctx.currentToolCall ?? state.currentToolCall);
|
|
17962
17967
|
} finally {
|
|
17963
17968
|
for (const getter of variableGetters.values()) getter.dispose();
|
|
17964
17969
|
freezeFunction.dispose();
|
|
@@ -2472,10 +2472,13 @@ var QuickJSDriver = class {
|
|
|
2472
2472
|
const runtime = (await loadQuickJSModule()).newRuntime();
|
|
2473
2473
|
runtime.setMemoryLimit(134217728);
|
|
2474
2474
|
const timeoutHandler = (0, quickjs_emscripten_core.shouldInterruptAfterDeadline)(Date.now() + timeout);
|
|
2475
|
+
let timedOut = false;
|
|
2475
2476
|
runtime.setInterruptHandler(() => {
|
|
2476
2477
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) return true;
|
|
2477
|
-
|
|
2478
|
+
if (timeoutHandler(runtime)) timedOut = true;
|
|
2479
|
+
return timedOut;
|
|
2478
2480
|
});
|
|
2481
|
+
const timeoutError = () => /* @__PURE__ */ new Error(`Code execution timed out after ${timeout}ms`);
|
|
2479
2482
|
const vm = runtime.newContext();
|
|
2480
2483
|
const trackedProperties = /* @__PURE__ */ new Set();
|
|
2481
2484
|
const referenceProperties = /* @__PURE__ */ new Set();
|
|
@@ -2576,6 +2579,7 @@ var QuickJSDriver = class {
|
|
|
2576
2579
|
}
|
|
2577
2580
|
execResult.value.dispose();
|
|
2578
2581
|
await this._pumpEventLoop(runtime, vm, pendingPromises, signal, toVmValue, disposeIfNeeded);
|
|
2582
|
+
const codeTimedOut = timedOut;
|
|
2579
2583
|
const errorResult = vm.evalCode("globalThis.__llmz_error");
|
|
2580
2584
|
const errorValue = vm.dump(errorResult.unwrap());
|
|
2581
2585
|
errorResult.unwrap().dispose();
|
|
@@ -2601,6 +2605,7 @@ var QuickJSDriver = class {
|
|
|
2601
2605
|
throw error;
|
|
2602
2606
|
}
|
|
2603
2607
|
copyBackContextFromVM();
|
|
2608
|
+
if (codeTimedOut) throw timeoutError();
|
|
2604
2609
|
const resultSetResult = vm.evalCode("globalThis.__llmz_result_set");
|
|
2605
2610
|
const resultSet = vm.dump(resultSetResult.unwrap());
|
|
2606
2611
|
resultSetResult.unwrap().dispose();
|
|
@@ -2637,7 +2642,7 @@ var QuickJSDriver = class {
|
|
|
2637
2642
|
errValue.dispose();
|
|
2638
2643
|
}
|
|
2639
2644
|
})).catch(() => {});
|
|
2640
|
-
return handleErrorQuickJS(err, code, consumer, traces, variables, lines_executed, userCodeStartLine, ctx.currentToolCall ?? state.currentToolCall);
|
|
2645
|
+
return handleErrorQuickJS(timedOut ? timeoutError() : err, code, consumer, traces, variables, lines_executed, userCodeStartLine, ctx.currentToolCall ?? state.currentToolCall);
|
|
2641
2646
|
} finally {
|
|
2642
2647
|
for (const getter of variableGetters.values()) getter.dispose();
|
|
2643
2648
|
freezeFunction.dispose();
|
|
@@ -2473,10 +2473,13 @@ var QuickJSDriver = class {
|
|
|
2473
2473
|
const runtime = (await loadQuickJSModule()).newRuntime();
|
|
2474
2474
|
runtime.setMemoryLimit(134217728);
|
|
2475
2475
|
const timeoutHandler = shouldInterruptAfterDeadline(Date.now() + timeout);
|
|
2476
|
+
let timedOut = false;
|
|
2476
2477
|
runtime.setInterruptHandler(() => {
|
|
2477
2478
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) return true;
|
|
2478
|
-
|
|
2479
|
+
if (timeoutHandler(runtime)) timedOut = true;
|
|
2480
|
+
return timedOut;
|
|
2479
2481
|
});
|
|
2482
|
+
const timeoutError = () => /* @__PURE__ */ new Error(`Code execution timed out after ${timeout}ms`);
|
|
2480
2483
|
const vm = runtime.newContext();
|
|
2481
2484
|
const trackedProperties = /* @__PURE__ */ new Set();
|
|
2482
2485
|
const referenceProperties = /* @__PURE__ */ new Set();
|
|
@@ -2577,6 +2580,7 @@ var QuickJSDriver = class {
|
|
|
2577
2580
|
}
|
|
2578
2581
|
execResult.value.dispose();
|
|
2579
2582
|
await this._pumpEventLoop(runtime, vm, pendingPromises, signal, toVmValue, disposeIfNeeded);
|
|
2583
|
+
const codeTimedOut = timedOut;
|
|
2580
2584
|
const errorResult = vm.evalCode("globalThis.__llmz_error");
|
|
2581
2585
|
const errorValue = vm.dump(errorResult.unwrap());
|
|
2582
2586
|
errorResult.unwrap().dispose();
|
|
@@ -2602,6 +2606,7 @@ var QuickJSDriver = class {
|
|
|
2602
2606
|
throw error;
|
|
2603
2607
|
}
|
|
2604
2608
|
copyBackContextFromVM();
|
|
2609
|
+
if (codeTimedOut) throw timeoutError();
|
|
2605
2610
|
const resultSetResult = vm.evalCode("globalThis.__llmz_result_set");
|
|
2606
2611
|
const resultSet = vm.dump(resultSetResult.unwrap());
|
|
2607
2612
|
resultSetResult.unwrap().dispose();
|
|
@@ -2638,7 +2643,7 @@ var QuickJSDriver = class {
|
|
|
2638
2643
|
errValue.dispose();
|
|
2639
2644
|
}
|
|
2640
2645
|
})).catch(() => {});
|
|
2641
|
-
return handleErrorQuickJS(err, code, consumer, traces, variables, lines_executed, userCodeStartLine, ctx.currentToolCall ?? state.currentToolCall);
|
|
2646
|
+
return handleErrorQuickJS(timedOut ? timeoutError() : err, code, consumer, traces, variables, lines_executed, userCodeStartLine, ctx.currentToolCall ?? state.currentToolCall);
|
|
2642
2647
|
} finally {
|
|
2643
2648
|
for (const getter of variableGetters.values()) getter.dispose();
|
|
2644
2649
|
freezeFunction.dispose();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "llmz",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "LLMz - An LLM-native Typescript VM built on top of Zui",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.9",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
8
8
|
"DOCS.md"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tsx": "^4.19.2"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@botpress/client": "2.
|
|
71
|
+
"@botpress/client": "2.11.0",
|
|
72
72
|
"@botpress/cognitive": "1.2.2",
|
|
73
73
|
"@bpinternal/thicktoken": "^3.1.0",
|
|
74
74
|
"@bpinternal/zui": "^2.4.1"
|