@execbox/quickjs 0.1.2 → 0.2.0

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 CHANGED
@@ -63,3 +63,5 @@ const result = await executor.execute("await codemode.echo({ ok: true })", [
63
63
  ```
64
64
 
65
65
  Each execution runs in a fresh QuickJS runtime with timeout handling, captured logs, and JSON-only result and tool boundaries.
66
+
67
+ `QuickJsExecutor` intentionally stays ephemeral. Every `execute()` call creates a fresh QuickJS runtime/context, and the package does not expose a pooling API.
package/dist/index.cjs CHANGED
@@ -1,14 +1,14 @@
1
- const require_runner = require('./runner-9_N9h2rp.cjs');
1
+ const require_runner = require('./runner-DhOZH9xz.cjs');
2
2
  let __execbox_core = require("@execbox/core");
3
3
 
4
4
  //#region src/quickjsExecutor.ts
5
5
  /**
6
- * QuickJS-backed executor for one-shot sandboxed JavaScript runs.
6
+ * QuickJS-backed executor for ephemeral sandboxed JavaScript runs.
7
7
  */
8
8
  var QuickJsExecutor = class {
9
9
  options;
10
10
  /**
11
- * Creates a QuickJS executor with one-shot runtime limits and host bridging configuration.
11
+ * Creates a QuickJS executor with ephemeral runtime limits and host bridging configuration.
12
12
  */
13
13
  constructor(options = {}) {
14
14
  this.options = options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["runQuickJsSession"],"sources":["../src/quickjsExecutor.ts"],"sourcesContent":["import {\n createTimeoutExecuteResult,\n createToolCallDispatcher,\n extractProviderManifests,\n type ExecutionOptions,\n type ExecuteResult,\n type Executor,\n type ResolvedToolProvider,\n} from \"@execbox/core\";\n\nimport { runQuickJsSession } from \"./runner/index\";\nimport type { QuickJsExecutorOptions } from \"./types\";\n\n/**\n * QuickJS-backed executor for one-shot sandboxed JavaScript runs.\n */\nexport class QuickJsExecutor implements Executor {\n private readonly options: QuickJsExecutorOptions;\n\n /**\n * Creates a QuickJS executor with one-shot runtime limits and host bridging configuration.\n */\n constructor(options: QuickJsExecutorOptions = {}) {\n this.options = options;\n }\n\n /**\n * Executes JavaScript against the provided tool namespaces in a fresh QuickJS runtime.\n */\n async execute(\n code: string,\n providers: ResolvedToolProvider[],\n options: ExecutionOptions = {},\n ): Promise<ExecuteResult> {\n if (options.signal?.aborted) {\n return createTimeoutExecuteResult();\n }\n\n const abortController = new AbortController();\n const onToolCall = createToolCallDispatcher(\n providers,\n abortController.signal,\n );\n const onAbort = () => {\n abortController.abort();\n };\n\n options.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n try {\n return await runQuickJsSession(\n {\n abortController,\n code,\n onToolCall,\n providers: extractProviderManifests(providers),\n },\n {\n ...this.options,\n ...options,\n },\n );\n } finally {\n options.signal?.removeEventListener(\"abort\", onAbort);\n abortController.abort();\n }\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,kBAAb,MAAiD;CAC/C,AAAiB;;;;CAKjB,YAAY,UAAkC,EAAE,EAAE;AAChD,OAAK,UAAU;;;;;CAMjB,MAAM,QACJ,MACA,WACA,UAA4B,EAAE,EACN;AACxB,MAAI,QAAQ,QAAQ,QAClB,wDAAmC;EAGrC,MAAM,kBAAkB,IAAI,iBAAiB;EAC7C,MAAM,0DACJ,WACA,gBAAgB,OACjB;EACD,MAAM,gBAAgB;AACpB,mBAAgB,OAAO;;AAGzB,UAAQ,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,MAAM,CAAC;AAElE,MAAI;AACF,UAAO,MAAMA,iCACX;IACE;IACA;IACA;IACA,wDAAoC,UAAU;IAC/C,EACD;IACE,GAAG,KAAK;IACR,GAAG;IACJ,CACF;YACO;AACR,WAAQ,QAAQ,oBAAoB,SAAS,QAAQ;AACrD,mBAAgB,OAAO"}
1
+ {"version":3,"file":"index.cjs","names":["runQuickJsSession"],"sources":["../src/quickjsExecutor.ts"],"sourcesContent":["import {\n createTimeoutExecuteResult,\n createToolCallDispatcher,\n extractProviderManifests,\n type ExecutionOptions,\n type ExecuteResult,\n type Executor,\n type ResolvedToolProvider,\n} from \"@execbox/core\";\n\nimport { runQuickJsSession } from \"./runner/index\";\nimport type { QuickJsExecutorOptions } from \"./types\";\n\n/**\n * QuickJS-backed executor for ephemeral sandboxed JavaScript runs.\n */\nexport class QuickJsExecutor implements Executor {\n private readonly options: QuickJsExecutorOptions;\n\n /**\n * Creates a QuickJS executor with ephemeral runtime limits and host bridging configuration.\n */\n constructor(options: QuickJsExecutorOptions = {}) {\n this.options = options;\n }\n\n /**\n * Executes JavaScript against the provided tool namespaces in a fresh QuickJS runtime.\n */\n async execute(\n code: string,\n providers: ResolvedToolProvider[],\n options: ExecutionOptions = {},\n ): Promise<ExecuteResult> {\n if (options.signal?.aborted) {\n return createTimeoutExecuteResult();\n }\n\n const abortController = new AbortController();\n const onToolCall = createToolCallDispatcher(\n providers,\n abortController.signal,\n );\n const onAbort = () => {\n abortController.abort();\n };\n\n options.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n try {\n return await runQuickJsSession(\n {\n abortController,\n code,\n onToolCall,\n providers: extractProviderManifests(providers),\n },\n {\n ...this.options,\n ...options,\n },\n );\n } finally {\n options.signal?.removeEventListener(\"abort\", onAbort);\n abortController.abort();\n }\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,kBAAb,MAAiD;CAC/C,AAAiB;;;;CAKjB,YAAY,UAAkC,EAAE,EAAE;AAChD,OAAK,UAAU;;;;;CAMjB,MAAM,QACJ,MACA,WACA,UAA4B,EAAE,EACN;AACxB,MAAI,QAAQ,QAAQ,QAClB,wDAAmC;EAGrC,MAAM,kBAAkB,IAAI,iBAAiB;EAC7C,MAAM,0DACJ,WACA,gBAAgB,OACjB;EACD,MAAM,gBAAgB;AACpB,mBAAgB,OAAO;;AAGzB,UAAQ,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,MAAM,CAAC;AAElE,MAAI;AACF,UAAO,MAAMA,iCACX;IACE;IACA;IACA;IACA,wDAAoC,UAAU;IAC/C,EACD;IACE,GAAG,KAAK;IACR,GAAG;IACJ,CACF;YACO;AACR,WAAQ,QAAQ,oBAAoB,SAAS,QAAQ;AACrD,mBAAgB,OAAO"}
package/dist/index.d.cts CHANGED
@@ -4,12 +4,12 @@ import { ExecuteResult, ExecutionOptions, Executor, ResolvedToolProvider } from
4
4
  //#region src/quickjsExecutor.d.ts
5
5
 
6
6
  /**
7
- * QuickJS-backed executor for one-shot sandboxed JavaScript runs.
7
+ * QuickJS-backed executor for ephemeral sandboxed JavaScript runs.
8
8
  */
9
9
  declare class QuickJsExecutor implements Executor {
10
10
  private readonly options;
11
11
  /**
12
- * Creates a QuickJS executor with one-shot runtime limits and host bridging configuration.
12
+ * Creates a QuickJS executor with ephemeral runtime limits and host bridging configuration.
13
13
  */
14
14
  constructor(options?: QuickJsExecutorOptions);
15
15
  /**
package/dist/index.d.ts CHANGED
@@ -4,12 +4,12 @@ import { ExecuteResult, ExecutionOptions, Executor, ResolvedToolProvider } from
4
4
  //#region src/quickjsExecutor.d.ts
5
5
 
6
6
  /**
7
- * QuickJS-backed executor for one-shot sandboxed JavaScript runs.
7
+ * QuickJS-backed executor for ephemeral sandboxed JavaScript runs.
8
8
  */
9
9
  declare class QuickJsExecutor implements Executor {
10
10
  private readonly options;
11
11
  /**
12
- * Creates a QuickJS executor with one-shot runtime limits and host bridging configuration.
12
+ * Creates a QuickJS executor with ephemeral runtime limits and host bridging configuration.
13
13
  */
14
14
  constructor(options?: QuickJsExecutorOptions);
15
15
  /**
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { t as runQuickJsSession } from "./runner-O4f_FOhI.js";
1
+ import { t as runQuickJsSession } from "./runner-B4UG88h1.js";
2
2
  import { createTimeoutExecuteResult, createToolCallDispatcher, extractProviderManifests } from "@execbox/core";
3
3
 
4
4
  //#region src/quickjsExecutor.ts
5
5
  /**
6
- * QuickJS-backed executor for one-shot sandboxed JavaScript runs.
6
+ * QuickJS-backed executor for ephemeral sandboxed JavaScript runs.
7
7
  */
8
8
  var QuickJsExecutor = class {
9
9
  options;
10
10
  /**
11
- * Creates a QuickJS executor with one-shot runtime limits and host bridging configuration.
11
+ * Creates a QuickJS executor with ephemeral runtime limits and host bridging configuration.
12
12
  */
13
13
  constructor(options = {}) {
14
14
  this.options = options;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/quickjsExecutor.ts"],"sourcesContent":["import {\n createTimeoutExecuteResult,\n createToolCallDispatcher,\n extractProviderManifests,\n type ExecutionOptions,\n type ExecuteResult,\n type Executor,\n type ResolvedToolProvider,\n} from \"@execbox/core\";\n\nimport { runQuickJsSession } from \"./runner/index\";\nimport type { QuickJsExecutorOptions } from \"./types\";\n\n/**\n * QuickJS-backed executor for one-shot sandboxed JavaScript runs.\n */\nexport class QuickJsExecutor implements Executor {\n private readonly options: QuickJsExecutorOptions;\n\n /**\n * Creates a QuickJS executor with one-shot runtime limits and host bridging configuration.\n */\n constructor(options: QuickJsExecutorOptions = {}) {\n this.options = options;\n }\n\n /**\n * Executes JavaScript against the provided tool namespaces in a fresh QuickJS runtime.\n */\n async execute(\n code: string,\n providers: ResolvedToolProvider[],\n options: ExecutionOptions = {},\n ): Promise<ExecuteResult> {\n if (options.signal?.aborted) {\n return createTimeoutExecuteResult();\n }\n\n const abortController = new AbortController();\n const onToolCall = createToolCallDispatcher(\n providers,\n abortController.signal,\n );\n const onAbort = () => {\n abortController.abort();\n };\n\n options.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n try {\n return await runQuickJsSession(\n {\n abortController,\n code,\n onToolCall,\n providers: extractProviderManifests(providers),\n },\n {\n ...this.options,\n ...options,\n },\n );\n } finally {\n options.signal?.removeEventListener(\"abort\", onAbort);\n abortController.abort();\n }\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,kBAAb,MAAiD;CAC/C,AAAiB;;;;CAKjB,YAAY,UAAkC,EAAE,EAAE;AAChD,OAAK,UAAU;;;;;CAMjB,MAAM,QACJ,MACA,WACA,UAA4B,EAAE,EACN;AACxB,MAAI,QAAQ,QAAQ,QAClB,QAAO,4BAA4B;EAGrC,MAAM,kBAAkB,IAAI,iBAAiB;EAC7C,MAAM,aAAa,yBACjB,WACA,gBAAgB,OACjB;EACD,MAAM,gBAAgB;AACpB,mBAAgB,OAAO;;AAGzB,UAAQ,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,MAAM,CAAC;AAElE,MAAI;AACF,UAAO,MAAM,kBACX;IACE;IACA;IACA;IACA,WAAW,yBAAyB,UAAU;IAC/C,EACD;IACE,GAAG,KAAK;IACR,GAAG;IACJ,CACF;YACO;AACR,WAAQ,QAAQ,oBAAoB,SAAS,QAAQ;AACrD,mBAAgB,OAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/quickjsExecutor.ts"],"sourcesContent":["import {\n createTimeoutExecuteResult,\n createToolCallDispatcher,\n extractProviderManifests,\n type ExecutionOptions,\n type ExecuteResult,\n type Executor,\n type ResolvedToolProvider,\n} from \"@execbox/core\";\n\nimport { runQuickJsSession } from \"./runner/index\";\nimport type { QuickJsExecutorOptions } from \"./types\";\n\n/**\n * QuickJS-backed executor for ephemeral sandboxed JavaScript runs.\n */\nexport class QuickJsExecutor implements Executor {\n private readonly options: QuickJsExecutorOptions;\n\n /**\n * Creates a QuickJS executor with ephemeral runtime limits and host bridging configuration.\n */\n constructor(options: QuickJsExecutorOptions = {}) {\n this.options = options;\n }\n\n /**\n * Executes JavaScript against the provided tool namespaces in a fresh QuickJS runtime.\n */\n async execute(\n code: string,\n providers: ResolvedToolProvider[],\n options: ExecutionOptions = {},\n ): Promise<ExecuteResult> {\n if (options.signal?.aborted) {\n return createTimeoutExecuteResult();\n }\n\n const abortController = new AbortController();\n const onToolCall = createToolCallDispatcher(\n providers,\n abortController.signal,\n );\n const onAbort = () => {\n abortController.abort();\n };\n\n options.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n try {\n return await runQuickJsSession(\n {\n abortController,\n code,\n onToolCall,\n providers: extractProviderManifests(providers),\n },\n {\n ...this.options,\n ...options,\n },\n );\n } finally {\n options.signal?.removeEventListener(\"abort\", onAbort);\n abortController.abort();\n }\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,kBAAb,MAAiD;CAC/C,AAAiB;;;;CAKjB,YAAY,UAAkC,EAAE,EAAE;AAChD,OAAK,UAAU;;;;;CAMjB,MAAM,QACJ,MACA,WACA,UAA4B,EAAE,EACN;AACxB,MAAI,QAAQ,QAAQ,QAClB,QAAO,4BAA4B;EAGrC,MAAM,kBAAkB,IAAI,iBAAiB;EAC7C,MAAM,aAAa,yBACjB,WACA,gBAAgB,OACjB;EACD,MAAM,gBAAgB;AACpB,mBAAgB,OAAO;;AAGzB,UAAQ,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,MAAM,CAAC;AAElE,MAAI;AACF,UAAO,MAAM,kBACX;IACE;IACA;IACA;IACA,WAAW,yBAAyB,UAAU;IAC/C,EACD;IACE,GAAG,KAAK;IACR,GAAG;IACJ,CACF;YACO;AACR,WAAQ,QAAQ,oBAAoB,SAAS,QAAQ;AACrD,mBAAgB,OAAO"}
@@ -1,3 +1,3 @@
1
- const require_runner = require('../runner-9_N9h2rp.cjs');
1
+ const require_runner = require('../runner-DhOZH9xz.cjs');
2
2
 
3
3
  exports.runQuickJsSession = require_runner.runQuickJsSession;
@@ -1,4 +1,5 @@
1
1
  import { t as QuickJsExecutorOptions } from "../types-BB8mb_-T.cjs";
2
+ import { QuickJSWASMModule } from "quickjs-emscripten";
2
3
 
3
4
  //#region ../core/src/types.d.ts
4
5
 
@@ -94,7 +95,9 @@ interface QuickJsSessionRequest {
94
95
  /**
95
96
  * Options controlling one transport-backed QuickJS session.
96
97
  */
97
- type QuickJsSessionOptions = QuickJsExecutorOptions & ExecutorRuntimeOptions;
98
+ type QuickJsSessionOptions = QuickJsExecutorOptions & ExecutorRuntimeOptions & {
99
+ module?: QuickJSWASMModule;
100
+ };
98
101
  /**
99
102
  * Runs one QuickJS-backed execution session using a transport-neutral tool callback.
100
103
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../../core/src/types.ts","../../../core/src/runner.ts","../../src/runner/index.ts"],"sourcesContent":[],"mappings":";;;;ACeA;AASA;AASA;AAiBiB,KDnCL,gBAAA,GCmCa,SAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,YAAA,GAAA,eAAA,GAAA,qBAAA,GAAA,gBAAA;AASzB;;;UDhCiB,YAAA;EEuBL;EAKK,IAAA,EF1BT,gBE0BS;EACG;EAEC,OAAA,EAAA,MAAA;;;;;AAGV,KFxBC,aEwBD,CAAA,IAAA,OAAA,CAAA,GAAA;EAAW,UAAA,EAAA,MAAA;EAMV,IAAA,EAAA,MAAA,EAAA;EA4TU,EAAA,EAAA,IAAA;EACX,MAAA,EFtVG,CEsVH;CACA,GAAA;EACA,UAAA,EAAA,MAAA;EAAR,KAAA,EFpVU,YEoVV;EAAO,IAAA,EAAA,MAAA,EAAA;;;;;;;AFnXV;AAYiB,UCZA,oBAAA,CDcT;EAQI,WAAA,CAAA,EAAA,MAAa;;;;ACtBzB;AASA;AASA;AAiBiB,UA1BA,gBAAA,CA0BQ;EASb,IAAA,EAAA,MAAA;SAjCH,eAAe;;;ACwBxB;AAKA;;AAGqB,UDzBJ,sBAAA,CCyBI;EAAqB,WAAA,CAAA,EAAA,MAAA;EAAR,WAAA,CAAA,EAAA,MAAA;EAA0B,gBAAA,CAAA,EAAA,MAAA;EAE/C,SAAA,CAAA,EAAA,MAAA;;;;;UDVI,QAAA;;;;;;;;KASL,cAAA;;;;SAMC;;;;;;ADlDb;AAYA;AAUY,KEaA,sBAAA,GAAyB,QFJxB;;;;AC/BI,UCwCA,qBAAA,CDxCoB;EASpB,eAAA,CAAA,ECgCG,eD9BI;EAOP,IAAA,EAAA,MAAA;EAiBA,UAAA,EAAQ,CAAA,IAAA,ECQJ,QDRI,EAAA,GCQS,ODRT,CCQiB,cDRjB,CAAA,GCQmC,cDRnC;EASb,SAAA,CAAA,EAAA,GAAA,GAAc,IAAA;aCCb;WACF;;AAXX;AAKA;;AAGqB,KAST,qBAAA,GAAwB,sBATf,GAUnB,sBAVmB;;;;AAER,iBAmUS,iBAAA,CAnUT,OAAA,EAoUF,qBApUE,EAAA,OAAA,CAAA,EAqUF,qBArUE,CAAA,EAsUV,OAtUU,CAsUF,aAtUE,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../../core/src/types.ts","../../../core/src/runner.ts","../../src/runner/index.ts"],"sourcesContent":[],"mappings":";;;;;;ACeA;AASA;AASiB,KDlBL,gBAAA,GCkB2B,SAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,YAAA,GAAA,eAAA,GAAA,qBAAA,GAAA,gBAAA;AAiBvC;AASA;;UDhCiB,YAAA;;EEuBL,IAAA,EFrBJ,gBEqBI;EAKK;EACG,OAAA,EAAA,MAAA;;;;;AAIP,KFvBD,aEuBC,CAAA,IAAA,OAAA,CAAA,GAAA;EACF,UAAA,EAAA,MAAA;EAAW,IAAA,EAAA,MAAA,EAAA;EAMV,EAAA,EAAA,IAAA;EAAwB,MAAA,EFzBtB,CEyBsB;CAClC,GAAA;EACW,UAAA,EAAA,MAAA;EAAiB,KAAA,EFvBjB,YEuBiB;EA4TR,IAAA,EAAA,MAAA,EAAA;EACX,EAAA,EAAA,KAAA;CACA;;;;;;AFpXC,UCAK,oBAAA,CDAW;EAYX,WAAA,CAAA,EAAA,MAAY;EAUjB,YAAA,EAAA,MAAa;;;;ACtBzB;AASA;AASiB,UATA,gBAAA,CASsB;EAiBtB,IAAA,EAAA,MAAQ;EASb,KAAA,EAjCH,MAiCG,CAAA,MAAc,EAjCF,oBAuCC,CAAA;;;;ACfzB;AAKA;AACoB,UDvBH,sBAAA,CCuBG;EAEC,WAAA,CAAA,EAAA,MAAA;EAAqB,WAAA,CAAA,EAAA,MAAA;EAAR,gBAAA,CAAA,EAAA,MAAA;EAA0B,SAAA,CAAA,EAAA,MAAA;;;AAuU5D;;AAEW,UDjVM,QAAA,CCiVN;EACA,KAAA,EAAA,OAAA;EAAR,YAAA,EAAA,MAAA;EAAO,YAAA,EAAA,MAAA;;;;;KDzUE,cAAA;;;;SAMC;;;;;;ADlDb;AAYA;AAUY,KEaA,sBAAA,GAAyB,QFJxB;;;;AC/BI,UCwCA,qBAAA,CDxCoB;EASpB,eAAA,CAAA,ECgCG,eD9BI;EAOP,IAAA,EAAA,MAAA;EAiBA,UAAA,EAAQ,CAAA,IAAA,ECQJ,QDRI,EAAA,GCQS,ODRT,CCQiB,cDRjB,CAAA,GCQmC,cDRnC;EASb,SAAA,CAAA,EAAA,GAAA,GAAc,IAAA;aCCb;WACF;;AAXX;AAKA;;AAGqB,KAST,qBAAA,GAAwB,sBATf,GAUnB,sBAVmB,GAAA;EAAqB,MAAA,CAAA,EAW7B,iBAX6B;CAAR;;;;AAGZ,iBAoUA,iBAAA,CApUA,OAAA,EAqUX,qBArUW,EAAA,OAAA,CAAA,EAsUX,qBAtUW,CAAA,EAuUnB,OAvUmB,CAuUX,aAvUW,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { t as QuickJsExecutorOptions } from "../types-D7uau0GM.js";
2
+ import { QuickJSWASMModule } from "quickjs-emscripten";
2
3
 
3
4
  //#region ../core/src/types.d.ts
4
5
 
@@ -94,7 +95,9 @@ interface QuickJsSessionRequest {
94
95
  /**
95
96
  * Options controlling one transport-backed QuickJS session.
96
97
  */
97
- type QuickJsSessionOptions = QuickJsExecutorOptions & ExecutorRuntimeOptions;
98
+ type QuickJsSessionOptions = QuickJsExecutorOptions & ExecutorRuntimeOptions & {
99
+ module?: QuickJSWASMModule;
100
+ };
98
101
  /**
99
102
  * Runs one QuickJS-backed execution session using a transport-neutral tool callback.
100
103
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../core/src/types.ts","../../../core/src/runner.ts","../../src/runner/index.ts"],"sourcesContent":[],"mappings":";;;;ACeA;AASA;AASA;AAiBiB,KDnCL,gBAAA,GCmCa,SAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,YAAA,GAAA,eAAA,GAAA,qBAAA,GAAA,gBAAA;AASzB;;;UDhCiB,YAAA;EEuBL;EAKK,IAAA,EF1BT,gBE0BS;EACG;EAEC,OAAA,EAAA,MAAA;;;;;AAGV,KFxBC,aEwBD,CAAA,IAAA,OAAA,CAAA,GAAA;EAAW,UAAA,EAAA,MAAA;EAMV,IAAA,EAAA,MAAA,EAAA;EA4TU,EAAA,EAAA,IAAA;EACX,MAAA,EFtVG,CEsVH;CACA,GAAA;EACA,UAAA,EAAA,MAAA;EAAR,KAAA,EFpVU,YEoVV;EAAO,IAAA,EAAA,MAAA,EAAA;;;;;;;AFnXV;AAYiB,UCZA,oBAAA,CDcT;EAQI,WAAA,CAAA,EAAA,MAAa;;;;ACtBzB;AASA;AASA;AAiBiB,UA1BA,gBAAA,CA0BQ;EASb,IAAA,EAAA,MAAA;SAjCH,eAAe;;;ACwBxB;AAKA;;AAGqB,UDzBJ,sBAAA,CCyBI;EAAqB,WAAA,CAAA,EAAA,MAAA;EAAR,WAAA,CAAA,EAAA,MAAA;EAA0B,gBAAA,CAAA,EAAA,MAAA;EAE/C,SAAA,CAAA,EAAA,MAAA;;;;;UDVI,QAAA;;;;;;;;KASL,cAAA;;;;SAMC;;;;;;ADlDb;AAYA;AAUY,KEaA,sBAAA,GAAyB,QFJxB;;;;AC/BI,UCwCA,qBAAA,CDxCoB;EASpB,eAAA,CAAA,ECgCG,eD9BI;EAOP,IAAA,EAAA,MAAA;EAiBA,UAAA,EAAQ,CAAA,IAAA,ECQJ,QDRI,EAAA,GCQS,ODRT,CCQiB,cDRjB,CAAA,GCQmC,cDRnC;EASb,SAAA,CAAA,EAAA,GAAA,GAAc,IAAA;aCCb;WACF;;AAXX;AAKA;;AAGqB,KAST,qBAAA,GAAwB,sBATf,GAUnB,sBAVmB;;;;AAER,iBAmUS,iBAAA,CAnUT,OAAA,EAoUF,qBApUE,EAAA,OAAA,CAAA,EAqUF,qBArUE,CAAA,EAsUV,OAtUU,CAsUF,aAtUE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../core/src/types.ts","../../../core/src/runner.ts","../../src/runner/index.ts"],"sourcesContent":[],"mappings":";;;;;;ACeA;AASA;AASiB,KDlBL,gBAAA,GCkB2B,SAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,YAAA,GAAA,eAAA,GAAA,qBAAA,GAAA,gBAAA;AAiBvC;AASA;;UDhCiB,YAAA;;EEuBL,IAAA,EFrBJ,gBEqBI;EAKK;EACG,OAAA,EAAA,MAAA;;;;;AAIP,KFvBD,aEuBC,CAAA,IAAA,OAAA,CAAA,GAAA;EACF,UAAA,EAAA,MAAA;EAAW,IAAA,EAAA,MAAA,EAAA;EAMV,EAAA,EAAA,IAAA;EAAwB,MAAA,EFzBtB,CEyBsB;CAClC,GAAA;EACW,UAAA,EAAA,MAAA;EAAiB,KAAA,EFvBjB,YEuBiB;EA4TR,IAAA,EAAA,MAAA,EAAA;EACX,EAAA,EAAA,KAAA;CACA;;;;;;AFpXC,UCAK,oBAAA,CDAW;EAYX,WAAA,CAAA,EAAA,MAAY;EAUjB,YAAA,EAAA,MAAa;;;;ACtBzB;AASA;AASiB,UATA,gBAAA,CASsB;EAiBtB,IAAA,EAAA,MAAQ;EASb,KAAA,EAjCH,MAiCG,CAAA,MAAc,EAjCF,oBAuCC,CAAA;;;;ACfzB;AAKA;AACoB,UDvBH,sBAAA,CCuBG;EAEC,WAAA,CAAA,EAAA,MAAA;EAAqB,WAAA,CAAA,EAAA,MAAA;EAAR,gBAAA,CAAA,EAAA,MAAA;EAA0B,SAAA,CAAA,EAAA,MAAA;;;AAuU5D;;AAEW,UDjVM,QAAA,CCiVN;EACA,KAAA,EAAA,OAAA;EAAR,YAAA,EAAA,MAAA;EAAO,YAAA,EAAA,MAAA;;;;;KDzUE,cAAA;;;;SAMC;;;;;;ADlDb;AAYA;AAUY,KEaA,sBAAA,GAAyB,QFJxB;;;;AC/BI,UCwCA,qBAAA,CDxCoB;EASpB,eAAA,CAAA,ECgCG,eD9BI;EAOP,IAAA,EAAA,MAAA;EAiBA,UAAA,EAAQ,CAAA,IAAA,ECQJ,QDRI,EAAA,GCQS,ODRT,CCQiB,cDRjB,CAAA,GCQmC,cDRnC;EASb,SAAA,CAAA,EAAA,GAAA,GAAc,IAAA;aCCb;WACF;;AAXX;AAKA;;AAGqB,KAST,qBAAA,GAAwB,sBATf,GAUnB,sBAVmB,GAAA;EAAqB,MAAA,CAAA,EAW7B,iBAX6B;CAAR;;;;AAGZ,iBAoUA,iBAAA,CApUA,OAAA,EAqUX,qBArUW,EAAA,OAAA,CAAA,EAsUX,qBAtUW,CAAA,EAuUnB,OAvUmB,CAuUX,aAvUW,CAAA"}
@@ -1,3 +1,3 @@
1
- import { t as runQuickJsSession } from "../runner-O4f_FOhI.js";
1
+ import { t as runQuickJsSession } from "../runner-B4UG88h1.js";
2
2
 
3
3
  export { runQuickJsSession };
@@ -1,4 +1,4 @@
1
- const require_runner = require('../runner-9_N9h2rp.cjs');
1
+ const require_runner = require('../runner-DhOZH9xz.cjs');
2
2
  let node_crypto = require("node:crypto");
3
3
 
4
4
  //#region ../protocol/src/messages.ts
@@ -1,4 +1,4 @@
1
- import { t as runQuickJsSession } from "../runner-O4f_FOhI.js";
1
+ import { t as runQuickJsSession } from "../runner-B4UG88h1.js";
2
2
  import { randomUUID } from "node:crypto";
3
3
 
4
4
  //#region ../protocol/src/messages.ts
@@ -5480,6 +5480,7 @@ function createToolHandle(context, providerName, safeToolName, signal, trustedHo
5480
5480
  */
5481
5481
  async function runQuickJsSession(request, options = {}) {
5482
5482
  const loadModule = async () => {
5483
+ if (options.module) return options.module;
5483
5484
  return options.loadModule ? await options.loadModule() : await loadDefaultModule();
5484
5485
  };
5485
5486
  const maxLogChars = options.maxLogChars ?? DEFAULT_MAX_LOG_CHARS;
@@ -5567,4 +5568,4 @@ async function runQuickJsSession(request, options = {}) {
5567
5568
 
5568
5569
  //#endregion
5569
5570
  export { runQuickJsSession as t };
5570
- //# sourceMappingURL=runner-O4f_FOhI.js.map
5571
+ //# sourceMappingURL=runner-B4UG88h1.js.map