llmz 0.0.29 → 0.0.30

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.
@@ -14,6 +14,7 @@ export declare const Identifiers: {
14
14
  export type CompiledCode = ReturnType<typeof compile>;
15
15
  export declare function compile(code: string): {
16
16
  code: string;
17
+ codeWithMarkers: string;
17
18
  map: {
18
19
  version: number;
19
20
  sources: string[];
@@ -1,3 +1,5 @@
1
+ export declare const USER_CODE_START_MARKER = "/* __LLMZ_USER_CODE_START__ */";
2
+ export declare const USER_CODE_END_MARKER = "/* __LLMZ_USER_CODE_END__ */";
1
3
  export declare const AsyncIterator: {
2
4
  preProcessing: (code: string) => string;
3
5
  postProcessing: (code: string) => string;
package/dist/index.cjs CHANGED
@@ -1103,16 +1103,16 @@ var utils = {
1103
1103
  truncateWrappedContent: _chunkGZPN7RGHcjs.truncateWrappedContent
1104
1104
  };
1105
1105
  var execute = async (props) => {
1106
- const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-RZUY2RT4.cjs")));
1106
+ const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-DYB74G5C.cjs")));
1107
1107
  return executeContext(props);
1108
1108
  };
1109
1109
  var init = async () => {
1110
- await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-RZUY2RT4.cjs")));
1110
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-DYB74G5C.cjs")));
1111
1111
  await Promise.resolve().then(() => _interopRequireWildcard(require("./component-R4WTW6DZ.cjs")));
1112
1112
  await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-GMYMVXUK.cjs")));
1113
1113
  await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-XAYKJ6TR.cjs")));
1114
1114
  await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-AJAXBWFE.cjs")));
1115
- await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-5SJN3OJI.cjs")));
1115
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-NGQ6DRS3.cjs")));
1116
1116
  await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-L5QAQXV2.cjs")));
1117
1117
  await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-W3NXBLYJ.cjs")));
1118
1118
  await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-2RAAZ2YP.cjs")));
package/dist/index.js CHANGED
@@ -1103,16 +1103,16 @@ var utils = {
1103
1103
  truncateWrappedContent
1104
1104
  };
1105
1105
  var execute = async (props) => {
1106
- const { executeContext } = await import("./llmz-QUBEO7EF.js");
1106
+ const { executeContext } = await import("./llmz-N6KWKJ2Q.js");
1107
1107
  return executeContext(props);
1108
1108
  };
1109
1109
  var init = async () => {
1110
- await import("./llmz-QUBEO7EF.js");
1110
+ await import("./llmz-N6KWKJ2Q.js");
1111
1111
  await import("./component-WFVDVSDK.js");
1112
1112
  await import("./tool-GEBXW6AQ.js");
1113
1113
  await import("./exit-YLO7BY7Z.js");
1114
1114
  await import("./jsx-AEHVFB3L.js");
1115
- await import("./vm-SQHETBVH.js");
1115
+ await import("./vm-J6UNJGIN.js");
1116
1116
  await import("./utils-RQHQ2KOG.js");
1117
1117
  await import("./truncator-BSP6PQPC.js");
1118
1118
  await import("./typings-3VYUEACY.js");
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkFMOTPO76cjs = require('./chunk-FMOTPO76.cjs');
3
+ var _chunkR3LXNE5Ncjs = require('./chunk-R3LXNE5N.cjs');
4
4
 
5
5
 
6
6
 
@@ -362,7 +362,7 @@ var executeIteration = async ({
362
362
  });
363
363
  }
364
364
  startedAt = Date.now();
365
- const result = await _chunkFMOTPO76cjs.runAsyncFunction.call(void 0,
365
+ const result = await _chunkR3LXNE5Ncjs.runAsyncFunction.call(void 0,
366
366
  vmContext,
367
367
  iteration.code,
368
368
  traces,
@@ -391,6 +391,14 @@ var executeIteration = async ({
391
391
  started_at: startedAt,
392
392
  ended_at: Date.now()
393
393
  });
394
+ if (controller.signal.aborted) {
395
+ return iteration.end({
396
+ type: "aborted",
397
+ aborted: {
398
+ reason: _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted"))
399
+ }
400
+ });
401
+ }
394
402
  if (result.error && result.error instanceof _chunkT63Y6GTWcjs.CodeExecutionError) {
395
403
  return iteration.end({
396
404
  type: "execution_error",
@@ -400,14 +408,6 @@ var executeIteration = async ({
400
408
  }
401
409
  });
402
410
  }
403
- if (controller.signal.aborted) {
404
- return iteration.end({
405
- type: "aborted",
406
- aborted: {
407
- reason: _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted"))
408
- }
409
- });
410
- }
411
411
  if (!result.success) {
412
412
  return iteration.end({
413
413
  type: "execution_error",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runAsyncFunction
3
- } from "./chunk-ERK3MOZF.js";
3
+ } from "./chunk-DCYSCVQM.js";
4
4
  import {
5
5
  Context,
6
6
  ErrorExecutionResult,
@@ -391,6 +391,14 @@ var executeIteration = async ({
391
391
  started_at: startedAt,
392
392
  ended_at: Date.now()
393
393
  });
394
+ if (controller.signal.aborted) {
395
+ return iteration.end({
396
+ type: "aborted",
397
+ aborted: {
398
+ reason: controller.signal.reason ?? "The operation was aborted"
399
+ }
400
+ });
401
+ }
394
402
  if (result.error && result.error instanceof CodeExecutionError) {
395
403
  return iteration.end({
396
404
  type: "execution_error",
@@ -400,14 +408,6 @@ var executeIteration = async ({
400
408
  }
401
409
  });
402
410
  }
403
- if (controller.signal.aborted) {
404
- return iteration.end({
405
- type: "aborted",
406
- aborted: {
407
- reason: controller.signal.reason ?? "The operation was aborted"
408
- }
409
- });
410
- }
411
411
  if (!result.success) {
412
412
  return iteration.end({
413
413
  type: "execution_error",
@@ -0,0 +1,2 @@
1
+ import type { QuickJSSyncVariant } from 'quickjs-emscripten-core';
2
+ export declare const BundledReleaseSyncVariant: QuickJSSyncVariant;
@@ -1,12 +1,10 @@
1
1
  import {
2
- CAN_USE_ISOLATED_VM,
3
2
  runAsyncFunction
4
- } from "./chunk-ERK3MOZF.js";
3
+ } from "./chunk-DCYSCVQM.js";
5
4
  import "./chunk-MYLTD5WT.js";
6
5
  import "./chunk-YEAWWJSJ.js";
7
6
  import "./chunk-ORQP26SZ.js";
8
7
  import "./chunk-7WRN4E42.js";
9
8
  export {
10
- CAN_USE_ISOLATED_VM,
11
9
  runAsyncFunction
12
10
  };
@@ -1,12 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
- var _chunkFMOTPO76cjs = require('./chunk-FMOTPO76.cjs');
3
+ var _chunkR3LXNE5Ncjs = require('./chunk-R3LXNE5N.cjs');
5
4
  require('./chunk-T63Y6GTW.cjs');
6
5
  require('./chunk-KIN7Y247.cjs');
7
6
  require('./chunk-KMZDFWYZ.cjs');
8
7
  require('./chunk-UQOBUJIQ.cjs');
9
8
 
10
9
 
11
-
12
- exports.CAN_USE_ISOLATED_VM = _chunkFMOTPO76cjs.CAN_USE_ISOLATED_VM; exports.runAsyncFunction = _chunkFMOTPO76cjs.runAsyncFunction;
10
+ exports.runAsyncFunction = _chunkR3LXNE5Ncjs.runAsyncFunction;
package/dist/vm.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * LLMz VM Implementation
3
+ *
4
+ * Supports two execution drivers:
5
+ * 1. QuickJS (quickjs-emscripten) - Sandboxed execution with memory limits and timeout
6
+ * 2. Node (native) - Direct execution without sandbox, for environments where QuickJS is not available
7
+ */
1
8
  import { Trace, VMExecutionResult } from './types.js';
2
- export declare const CAN_USE_ISOLATED_VM: boolean;
3
9
  export declare function runAsyncFunction(context: any, code: string, traces?: Trace[], signal?: AbortSignal | null, timeout?: number): Promise<VMExecutionResult>;
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.0.29",
5
+ "version": "0.0.30",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.cjs",
8
8
  "module": "./dist/index.js",
@@ -37,14 +37,15 @@
37
37
  "@babel/standalone": "^7.26.4",
38
38
  "@babel/traverse": "^7.26.4",
39
39
  "@babel/types": "^7.26.3",
40
+ "@jitl/quickjs-singlefile-browser-release-sync": "^0.31.0",
40
41
  "bytes": "^3.1.2",
41
42
  "exponential-backoff": "^3.1.1",
42
43
  "handlebars": "^4.7.8",
43
- "isolated-vm": "^5.0.3",
44
44
  "lodash-es": "^4.17.21",
45
45
  "lru-cache": "^11.0.2",
46
46
  "ms": "^2.1.3",
47
47
  "prettier": "^3.4.2",
48
+ "quickjs-emscripten-core": "^0.31.0",
48
49
  "ulid": "^2.3.0"
49
50
  },
50
51
  "devDependencies": {