@execbox/quickjs 0.2.1 → 0.4.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 +18 -4
- package/dist/index.cjs +543 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +543 -3
- package/dist/index.js.map +1 -1
- package/dist/processEntry.cjs +17 -0
- package/dist/processEntry.cjs.map +1 -0
- package/dist/processEntry.d.cts +5 -0
- package/dist/processEntry.d.ts +5 -0
- package/dist/processEntry.js +18 -0
- package/dist/processEntry.js.map +1 -0
- package/dist/protocolEndpoint-DGOUVf6J.cjs +147 -0
- package/dist/protocolEndpoint-DGOUVf6J.cjs.map +1 -0
- package/dist/protocolEndpoint-T_JEz8YY.js +142 -0
- package/dist/protocolEndpoint-T_JEz8YY.js.map +1 -0
- package/dist/runner/index.cjs +1 -1
- package/dist/runner/index.d.cts +10 -3
- package/dist/runner/index.d.cts.map +1 -1
- package/dist/runner/index.d.ts +10 -3
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +1 -1
- package/dist/runner/protocolEndpoint.cjs +3 -141
- package/dist/runner/protocolEndpoint.d.cts +1 -1
- package/dist/runner/protocolEndpoint.d.ts +1 -1
- package/dist/runner/protocolEndpoint.js +3 -141
- package/dist/{runner-CVaY4RVQ.js → runner-CteKTaPD.js} +28 -10
- package/dist/runner-CteKTaPD.js.map +1 -0
- package/dist/{runner-BqkDnP0t.cjs → runner-DRt0kpEk.cjs} +33 -9
- package/dist/{runner-CVaY4RVQ.js.map → runner-DRt0kpEk.cjs.map} +1 -1
- package/dist/types-BeVqrcj8.d.ts +71 -0
- package/dist/types-BeVqrcj8.d.ts.map +1 -0
- package/dist/types-CnNmLawC.d.cts +71 -0
- package/dist/types-CnNmLawC.d.cts.map +1 -0
- package/dist/workerEntry.cjs +19 -0
- package/dist/workerEntry.cjs.map +1 -0
- package/dist/workerEntry.d.cts +5 -0
- package/dist/workerEntry.d.ts +5 -0
- package/dist/workerEntry.js +20 -0
- package/dist/workerEntry.js.map +1 -0
- package/package.json +3 -4
- package/dist/runner/protocolEndpoint.cjs.map +0 -1
- package/dist/runner/protocolEndpoint.js.map +0 -1
- package/dist/runner-BqkDnP0t.cjs.map +0 -1
- package/dist/types-BXi8Lqtk.d.ts +0 -18
- package/dist/types-BXi8Lqtk.d.ts.map +0 -1
- package/dist/types-CVE2n2LY.d.cts +0 -18
- package/dist/types-CVE2n2LY.d.cts.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
+
*/
|
|
5
|
+
import { ExecutorPoolOptions, ExecutorRuntimeOptions } from "@execbox/core";
|
|
6
|
+
|
|
7
|
+
//#region src/types.d.ts
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Host boundary options available to the QuickJS executor.
|
|
11
|
+
*/
|
|
12
|
+
type QuickJsExecutorHost = "inline" | "worker" | "process";
|
|
13
|
+
/**
|
|
14
|
+
* Lifecycle modes for hosted QuickJS shells.
|
|
15
|
+
*/
|
|
16
|
+
type QuickJsHostedMode = "pooled" | "ephemeral";
|
|
17
|
+
/**
|
|
18
|
+
* Optional V8 heap limits used only as a backstop for worker thread safety.
|
|
19
|
+
*/
|
|
20
|
+
interface WorkerResourceLimits {
|
|
21
|
+
/** Maximum size of the old generation heap in megabytes. */
|
|
22
|
+
maxOldGenerationSizeMb?: number;
|
|
23
|
+
/** Maximum size of the young generation heap in megabytes. */
|
|
24
|
+
maxYoungGenerationSizeMb?: number;
|
|
25
|
+
/** Maximum V8 stack size in megabytes. */
|
|
26
|
+
stackSizeMb?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options for constructing an inline QuickJS executor.
|
|
30
|
+
*/
|
|
31
|
+
interface QuickJsInlineExecutorOptions extends ExecutorRuntimeOptions {
|
|
32
|
+
/** Uses inline QuickJS execution inside the current process. */
|
|
33
|
+
host?: "inline";
|
|
34
|
+
/** Optional QuickJS module loader override for tests or custom builds. */
|
|
35
|
+
loadModule?: () => Promise<unknown> | unknown;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options for constructing a worker-backed QuickJS executor.
|
|
39
|
+
*/
|
|
40
|
+
interface QuickJsWorkerExecutorOptions extends ExecutorRuntimeOptions {
|
|
41
|
+
/** Uses a worker thread to host each QuickJS runtime. */
|
|
42
|
+
host: "worker";
|
|
43
|
+
/** Time to wait before forcefully tearing down a hung hosted shell. */
|
|
44
|
+
cancelGraceMs?: number;
|
|
45
|
+
/** Whether to reuse hosted shells or spawn a fresh one per execution. */
|
|
46
|
+
mode?: QuickJsHostedMode;
|
|
47
|
+
/** Pool sizing and idle-eviction settings for pooled hosted shells. */
|
|
48
|
+
pool?: ExecutorPoolOptions;
|
|
49
|
+
/** Optional worker thread V8 limits used as a coarse safety backstop. */
|
|
50
|
+
workerResourceLimits?: WorkerResourceLimits;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Options for constructing a process-backed QuickJS executor.
|
|
54
|
+
*/
|
|
55
|
+
interface QuickJsProcessExecutorOptions extends ExecutorRuntimeOptions {
|
|
56
|
+
/** Uses a child process to host each QuickJS runtime. */
|
|
57
|
+
host: "process";
|
|
58
|
+
/** Time to wait before forcefully tearing down a hung hosted shell. */
|
|
59
|
+
cancelGraceMs?: number;
|
|
60
|
+
/** Whether to reuse hosted shells or spawn a fresh one per execution. */
|
|
61
|
+
mode?: QuickJsHostedMode;
|
|
62
|
+
/** Pool sizing and idle-eviction settings for pooled hosted shells. */
|
|
63
|
+
pool?: ExecutorPoolOptions;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options for constructing a QuickJS executor.
|
|
67
|
+
*/
|
|
68
|
+
type QuickJsExecutorOptions = QuickJsInlineExecutorOptions | QuickJsWorkerExecutorOptions | QuickJsProcessExecutorOptions;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { QuickJsProcessExecutorOptions as a, QuickJsInlineExecutorOptions as i, QuickJsExecutorOptions as n, QuickJsWorkerExecutorOptions as o, QuickJsHostedMode as r, WorkerResourceLimits as s, QuickJsExecutorHost as t };
|
|
71
|
+
//# sourceMappingURL=types-BeVqrcj8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BeVqrcj8.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAQA,CAAA,CAAA;AAKY,IAAA,CALA,mBAAA,CAAA,CAAA,CAKiB,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA;AAK7B,CAAA,CAAA;AAYA,CAAA,CAAA,CAAA,SAAA,CAAA,KAAA,CAAA,GAAA,CAAA,MAAA,CAAA,OAAA,CAAA,MAAA;AAWA,CAAA,CAAA;AAQS,IAAA,CApCG,iBAAA,CAAA,CAAA,CAoCH,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA;;;;AARmE,SAAA,CAvB3D,oBAAA,CAuB2D;EAoB3D,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,IAAA,CAAA,EAAA,CAAA,GAAA,CAAA,GAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;EAQR,sBAAA,CAAA,CAAA,CAAA,MAAA;EAGA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,IAAA,CAAA,EAAA,CAAA,GAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;EAX8C,wBAAA,CAAA,CAAA,CAAA,MAAA;EAAsB,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,CAAA,KAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;EAiBjE,WAAA,CAAA,CAAA,CAAA,MAAA;;;;;UAhDK,4BAAA,CAAA,OAAA,CAAqC;;;;qBAKjC;;;;;UAMJ,4BAAA,CAAA,OAAA,CAAqC;;;;;;SAQ7C;;SAGA;;yBAGgB;;;;;UAMR,6BAAA,CAAA,OAAA,CAAsC;;;;;;SAQ9C;;SAGA;;;;;KAMG,sBAAA,CAAA,CAAA,CACR,+BACA,+BACA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
+
*/
|
|
5
|
+
import { ExecutorPoolOptions, ExecutorRuntimeOptions } from "@execbox/core";
|
|
6
|
+
|
|
7
|
+
//#region src/types.d.ts
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Host boundary options available to the QuickJS executor.
|
|
11
|
+
*/
|
|
12
|
+
type QuickJsExecutorHost = "inline" | "worker" | "process";
|
|
13
|
+
/**
|
|
14
|
+
* Lifecycle modes for hosted QuickJS shells.
|
|
15
|
+
*/
|
|
16
|
+
type QuickJsHostedMode = "pooled" | "ephemeral";
|
|
17
|
+
/**
|
|
18
|
+
* Optional V8 heap limits used only as a backstop for worker thread safety.
|
|
19
|
+
*/
|
|
20
|
+
interface WorkerResourceLimits {
|
|
21
|
+
/** Maximum size of the old generation heap in megabytes. */
|
|
22
|
+
maxOldGenerationSizeMb?: number;
|
|
23
|
+
/** Maximum size of the young generation heap in megabytes. */
|
|
24
|
+
maxYoungGenerationSizeMb?: number;
|
|
25
|
+
/** Maximum V8 stack size in megabytes. */
|
|
26
|
+
stackSizeMb?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options for constructing an inline QuickJS executor.
|
|
30
|
+
*/
|
|
31
|
+
interface QuickJsInlineExecutorOptions extends ExecutorRuntimeOptions {
|
|
32
|
+
/** Uses inline QuickJS execution inside the current process. */
|
|
33
|
+
host?: "inline";
|
|
34
|
+
/** Optional QuickJS module loader override for tests or custom builds. */
|
|
35
|
+
loadModule?: () => Promise<unknown> | unknown;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options for constructing a worker-backed QuickJS executor.
|
|
39
|
+
*/
|
|
40
|
+
interface QuickJsWorkerExecutorOptions extends ExecutorRuntimeOptions {
|
|
41
|
+
/** Uses a worker thread to host each QuickJS runtime. */
|
|
42
|
+
host: "worker";
|
|
43
|
+
/** Time to wait before forcefully tearing down a hung hosted shell. */
|
|
44
|
+
cancelGraceMs?: number;
|
|
45
|
+
/** Whether to reuse hosted shells or spawn a fresh one per execution. */
|
|
46
|
+
mode?: QuickJsHostedMode;
|
|
47
|
+
/** Pool sizing and idle-eviction settings for pooled hosted shells. */
|
|
48
|
+
pool?: ExecutorPoolOptions;
|
|
49
|
+
/** Optional worker thread V8 limits used as a coarse safety backstop. */
|
|
50
|
+
workerResourceLimits?: WorkerResourceLimits;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Options for constructing a process-backed QuickJS executor.
|
|
54
|
+
*/
|
|
55
|
+
interface QuickJsProcessExecutorOptions extends ExecutorRuntimeOptions {
|
|
56
|
+
/** Uses a child process to host each QuickJS runtime. */
|
|
57
|
+
host: "process";
|
|
58
|
+
/** Time to wait before forcefully tearing down a hung hosted shell. */
|
|
59
|
+
cancelGraceMs?: number;
|
|
60
|
+
/** Whether to reuse hosted shells or spawn a fresh one per execution. */
|
|
61
|
+
mode?: QuickJsHostedMode;
|
|
62
|
+
/** Pool sizing and idle-eviction settings for pooled hosted shells. */
|
|
63
|
+
pool?: ExecutorPoolOptions;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options for constructing a QuickJS executor.
|
|
67
|
+
*/
|
|
68
|
+
type QuickJsExecutorOptions = QuickJsInlineExecutorOptions | QuickJsWorkerExecutorOptions | QuickJsProcessExecutorOptions;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { QuickJsProcessExecutorOptions as a, QuickJsInlineExecutorOptions as i, QuickJsExecutorOptions as n, QuickJsWorkerExecutorOptions as o, QuickJsHostedMode as r, WorkerResourceLimits as s, QuickJsExecutorHost as t };
|
|
71
|
+
//# sourceMappingURL=types-CnNmLawC.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CnNmLawC.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAQA,CAAA,CAAA;AAKY,IAAA,CALA,mBAAA,CAAA,CAAA,CAKiB,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA;AAK7B,CAAA,CAAA;AAYA,CAAA,CAAA,CAAA,SAAA,CAAA,KAAA,CAAA,GAAA,CAAA,MAAA,CAAA,OAAA,CAAA,MAAA;AAWA,CAAA,CAAA;AAQS,IAAA,CApCG,iBAAA,CAAA,CAAA,CAoCH,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA;;;;AARmE,SAAA,CAvB3D,oBAAA,CAuB2D;EAoB3D,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,IAAA,CAAA,EAAA,CAAA,GAAA,CAAA,GAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;EAQR,sBAAA,CAAA,CAAA,CAAA,MAAA;EAGA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,IAAA,CAAA,EAAA,CAAA,GAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;EAX8C,wBAAA,CAAA,CAAA,CAAA,MAAA;EAAsB,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,CAAA,KAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;EAiBjE,WAAA,CAAA,CAAA,CAAA,MAAA;;;;;UAhDK,4BAAA,CAAA,OAAA,CAAqC;;;;qBAKjC;;;;;UAMJ,4BAAA,CAAA,OAAA,CAAqC;;;;;;SAQ7C;;SAGA;;yBAGgB;;;;;UAMR,6BAAA,CAAA,OAAA,CAAsC;;;;;;SAQ9C;;SAGA;;;;;KAMG,sBAAA,CAAA,CAAA,CACR,+BACA,+BACA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require('./runner-DRt0kpEk.cjs');
|
|
2
|
+
const require_protocolEndpoint = require('./protocolEndpoint-DGOUVf6J.cjs');
|
|
3
|
+
let node_worker_threads = require("node:worker_threads");
|
|
4
|
+
|
|
5
|
+
//#region src/workerEntry.ts
|
|
6
|
+
if (!node_worker_threads.parentPort) throw new Error("QuickJsExecutor worker host requires a worker parent port");
|
|
7
|
+
const workerPort = node_worker_threads.parentPort;
|
|
8
|
+
require_protocolEndpoint.attachQuickJsProtocolEndpoint({
|
|
9
|
+
onMessage(handler) {
|
|
10
|
+
workerPort.on("message", handler);
|
|
11
|
+
return () => workerPort.off("message", handler);
|
|
12
|
+
},
|
|
13
|
+
send(message) {
|
|
14
|
+
workerPort.postMessage(message);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=workerEntry.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerEntry.cjs","names":["parentPort","attachQuickJsProtocolEndpoint"],"sources":["../src/workerEntry.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\";\n\nimport type { DispatcherMessage, RunnerMessage } from \"@execbox/core/protocol\";\n\nimport { attachQuickJsProtocolEndpoint } from \"./runner/protocolEndpoint.ts\";\n\nif (!parentPort) {\n throw new Error(\"QuickJsExecutor worker host requires a worker parent port\");\n}\n\nconst workerPort = parentPort;\n\nattachQuickJsProtocolEndpoint({\n onMessage(handler: (message: DispatcherMessage) => void): () => void {\n workerPort.on(\"message\", handler);\n return () => workerPort.off(\"message\", handler);\n },\n send(message: RunnerMessage): void {\n workerPort.postMessage(message);\n },\n});\n"],"mappings":";;;;;AAMA,IAAI,CAACA,+BACH,OAAM,IAAI,MAAM,4DAA4D;AAG9E,MAAM,aAAaA;AAEnBC,uDAA8B;CAC5B,UAAU,SAA2D;AACnE,aAAW,GAAG,WAAW,QAAQ;AACjC,eAAa,WAAW,IAAI,WAAW,QAAQ;;CAEjD,KAAK,SAA8B;AACjC,aAAW,YAAY,QAAQ;;CAElC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./runner-CteKTaPD.js";
|
|
2
|
+
import { t as attachQuickJsProtocolEndpoint } from "./protocolEndpoint-T_JEz8YY.js";
|
|
3
|
+
import { parentPort } from "node:worker_threads";
|
|
4
|
+
|
|
5
|
+
//#region src/workerEntry.ts
|
|
6
|
+
if (!parentPort) throw new Error("QuickJsExecutor worker host requires a worker parent port");
|
|
7
|
+
const workerPort = parentPort;
|
|
8
|
+
attachQuickJsProtocolEndpoint({
|
|
9
|
+
onMessage(handler) {
|
|
10
|
+
workerPort.on("message", handler);
|
|
11
|
+
return () => workerPort.off("message", handler);
|
|
12
|
+
},
|
|
13
|
+
send(message) {
|
|
14
|
+
workerPort.postMessage(message);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { };
|
|
20
|
+
//# sourceMappingURL=workerEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerEntry.js","names":[],"sources":["../src/workerEntry.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\";\n\nimport type { DispatcherMessage, RunnerMessage } from \"@execbox/core/protocol\";\n\nimport { attachQuickJsProtocolEndpoint } from \"./runner/protocolEndpoint.ts\";\n\nif (!parentPort) {\n throw new Error(\"QuickJsExecutor worker host requires a worker parent port\");\n}\n\nconst workerPort = parentPort;\n\nattachQuickJsProtocolEndpoint({\n onMessage(handler: (message: DispatcherMessage) => void): () => void {\n workerPort.on(\"message\", handler);\n return () => workerPort.off(\"message\", handler);\n },\n send(message: RunnerMessage): void {\n workerPort.postMessage(message);\n },\n});\n"],"mappings":";;;;;AAMA,IAAI,CAAC,WACH,OAAM,IAAI,MAAM,4DAA4D;AAG9E,MAAM,aAAa;AAEnB,8BAA8B;CAC5B,UAAU,SAA2D;AACnE,aAAW,GAAG,WAAW,QAAQ;AACjC,eAAa,WAAW,IAAI,WAAW,QAAQ;;CAEjD,KAAK,SAA8B;AACjC,aAAW,YAAY,QAAQ;;CAElC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@execbox/quickjs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "QuickJS executor for the execbox core package.",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "QuickJS executor for the execbox core package across inline, worker, and process hosts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -63,8 +63,7 @@
|
|
|
63
63
|
"homepage": "https://github.com/aallam/execbox/tree/main/packages/quickjs#readme",
|
|
64
64
|
"bugs": "https://github.com/aallam/execbox/issues",
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@execbox/core": "^0.
|
|
67
|
-
"@execbox/protocol": "^0.2.1",
|
|
66
|
+
"@execbox/core": "^0.4.0",
|
|
68
67
|
"quickjs-emscripten": "^0.31.0"
|
|
69
68
|
}
|
|
70
69
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocolEndpoint.cjs","names":["activeAbortController: AbortController | undefined","activeExecutionId: string | undefined","runQuickJsSession"],"sources":["../../../protocol/src/messages.ts","../../src/runner/protocolEndpoint.ts"],"sourcesContent":["import type {\n ExecuteResult,\n ExecutorRuntimeOptions,\n ProviderManifest,\n ToolCall,\n ToolCallResult,\n} from \"@execbox/core\";\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction isFiniteNumber(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value);\n}\n\nfunction isRuntimeOptions(value: unknown): value is ExecutorRuntimeOptions {\n if (!isRecord(value)) {\n return false;\n }\n\n return (\n isFiniteNumber(value.maxLogChars) &&\n isFiniteNumber(value.maxLogLines) &&\n isFiniteNumber(value.memoryLimitBytes) &&\n isFiniteNumber(value.timeoutMs)\n );\n}\n\nfunction isProviderManifest(value: unknown): value is ProviderManifest {\n if (!isRecord(value) || typeof value.name !== \"string\") {\n return false;\n }\n\n if (!isRecord(value.tools) || typeof value.types !== \"string\") {\n return false;\n }\n\n return Object.values(value.tools).every(\n (tool) =>\n isRecord(tool) &&\n typeof tool.originalName === \"string\" &&\n typeof tool.safeName === \"string\" &&\n (tool.description === undefined || typeof tool.description === \"string\"),\n );\n}\n\nfunction isExecuteError(\n value: unknown,\n): value is { code: string; message: string } {\n return (\n isRecord(value) &&\n typeof value.code === \"string\" &&\n typeof value.message === \"string\"\n );\n}\n\nfunction isDonePayload(value: unknown): value is DoneMessage {\n if (!isRecord(value) || !isFiniteNumber(value.durationMs)) {\n return false;\n }\n\n if (\n !Array.isArray(value.logs) ||\n !value.logs.every((log) => typeof log === \"string\")\n ) {\n return false;\n }\n\n if (typeof value.ok !== \"boolean\") {\n return false;\n }\n\n return value.ok ? true : isExecuteError(value.error);\n}\n\n/**\n * Message sent from dispatcher to runner to start one execution session.\n */\nexport interface ExecuteMessage {\n code: string;\n id: string;\n options: ExecutorRuntimeOptions;\n providers: ProviderManifest[];\n type: \"execute\";\n}\n\n/**\n * Message sent from dispatcher to request prompt cancellation.\n */\nexport interface CancelMessage {\n id: string;\n type: \"cancel\";\n}\n\n/**\n * Message sent from a runner when guest code invokes a host tool.\n */\nexport interface ToolCallMessage extends ToolCall {\n callId: string;\n type: \"tool_call\";\n}\n\n/**\n * Message carrying a trusted host tool result back to the runner.\n */\nexport type ToolResultMessage = {\n callId: string;\n type: \"tool_result\";\n} & ToolCallResult;\n\n/**\n * Message indicating the runner has finished bootstrapping guest execution timing.\n */\nexport interface StartedMessage {\n id: string;\n type: \"started\";\n}\n\n/**\n * Final successful execution result returned by a runner.\n *\n * Node IPC can omit `undefined` fields during serialization, so `result`\n * remains optional at the protocol boundary and is normalized by the host.\n */\nexport type DoneSuccessMessage<T = unknown> = {\n durationMs: number;\n id: string;\n logs: string[];\n ok: true;\n result?: T;\n type: \"done\";\n};\n\n/**\n * Final failed execution result returned by a runner.\n */\nexport type DoneFailureMessage = {\n id: string;\n type: \"done\";\n} & Extract<ExecuteResult, { ok: false }>;\n\n/**\n * Final execution result returned by a runner.\n */\nexport type DoneMessage = DoneSuccessMessage | DoneFailureMessage;\n\n/**\n * Messages accepted by a runner transport endpoint.\n */\nexport type DispatcherMessage =\n | CancelMessage\n | ExecuteMessage\n | ToolResultMessage;\n\n/**\n * Messages emitted by a runner transport endpoint.\n */\nexport type RunnerMessage = DoneMessage | StartedMessage | ToolCallMessage;\n\n/**\n * Returns whether an unknown value is a dispatcher-to-runner message.\n */\nexport function isDispatcherMessage(\n value: unknown,\n): value is DispatcherMessage {\n if (!isRecord(value) || typeof value.type !== \"string\") {\n return false;\n }\n\n switch (value.type) {\n case \"cancel\":\n return typeof value.id === \"string\";\n case \"execute\":\n return (\n typeof value.code === \"string\" &&\n typeof value.id === \"string\" &&\n isRuntimeOptions(value.options) &&\n Array.isArray(value.providers) &&\n value.providers.every(isProviderManifest)\n );\n case \"tool_result\":\n if (typeof value.callId !== \"string\" || typeof value.ok !== \"boolean\") {\n return false;\n }\n\n if (value.ok) {\n return \"result\" in value;\n }\n\n return isExecuteError(value.error);\n default:\n return false;\n }\n}\n\n/**\n * Returns whether an unknown value is a runner-to-dispatcher message.\n */\nexport function isRunnerMessage(value: unknown): value is RunnerMessage {\n if (!isRecord(value) || typeof value.type !== \"string\") {\n return false;\n }\n\n switch (value.type) {\n case \"started\":\n return typeof value.id === \"string\";\n case \"tool_call\":\n return (\n typeof value.callId === \"string\" &&\n typeof value.providerName === \"string\" &&\n typeof value.safeToolName === \"string\" &&\n \"input\" in value\n );\n case \"done\":\n return typeof value.id === \"string\" && isDonePayload(value);\n default:\n return false;\n }\n}\n","/**\n * @packageDocumentation\n * Public API for the `@execbox/quickjs/runner/protocol-endpoint` entrypoint.\n */\nimport { randomUUID } from \"node:crypto\";\n\nimport type {\n DispatcherMessage,\n ExecuteMessage,\n RunnerMessage,\n ToolCallResult,\n} from \"@execbox/protocol\";\n// This entrypoint is executed directly from source in worker/process tests before\n// workspace packages are built, so its runtime validator must stay source-local.\nimport { isDispatcherMessage } from \"../../../protocol/src/messages.ts\";\n\nimport { runQuickJsSession } from \"./index.ts\";\n\n/**\n * Minimal worker/process-side port used by the shared QuickJS protocol endpoint.\n */\nexport interface QuickJsProtocolPort {\n onMessage(handler: (message: DispatcherMessage) => void): void | (() => void);\n send(message: RunnerMessage): void;\n}\n\n/**\n * Attaches the shared QuickJS protocol loop to a worker/process messaging port.\n */\nexport function attachQuickJsProtocolEndpoint(\n port: QuickJsProtocolPort,\n): () => void {\n const pendingToolCalls = new Map<string, (result: ToolCallResult) => void>();\n let activeAbortController: AbortController | undefined;\n let activeExecutionId: string | undefined;\n\n async function startExecution(message: ExecuteMessage): Promise<void> {\n if (activeExecutionId) {\n port.send({\n durationMs: 0,\n error: {\n code: \"internal_error\",\n message: \"QuickJS endpoint already has an active execution\",\n },\n id: message.id,\n logs: [],\n ok: false,\n type: \"done\",\n });\n return;\n }\n\n const abortController = new AbortController();\n activeAbortController = abortController;\n activeExecutionId = message.id;\n\n try {\n const result = await runQuickJsSession(\n {\n abortController,\n code: message.code,\n onStarted: () => {\n port.send({\n id: message.id,\n type: \"started\",\n });\n },\n onToolCall: (call) =>\n new Promise<ToolCallResult>((resolve) => {\n const callId = randomUUID();\n pendingToolCalls.set(callId, resolve);\n port.send({\n ...call,\n callId,\n type: \"tool_call\",\n });\n }),\n providers: message.providers,\n },\n message.options,\n );\n\n port.send({\n ...result,\n id: message.id,\n type: \"done\",\n });\n } catch (error) {\n port.send({\n durationMs: 0,\n error: {\n code: \"internal_error\",\n message: error instanceof Error ? error.message : String(error),\n },\n id: message.id,\n logs: [],\n ok: false,\n type: \"done\",\n });\n } finally {\n pendingToolCalls.clear();\n activeAbortController = undefined;\n activeExecutionId = undefined;\n }\n }\n\n const maybeDetach = port.onMessage((message: DispatcherMessage) => {\n if (!isDispatcherMessage(message)) {\n return;\n }\n\n switch (message.type) {\n case \"cancel\":\n if (message.id === activeExecutionId) {\n activeAbortController?.abort();\n }\n break;\n case \"execute\":\n void startExecution(message);\n break;\n case \"tool_result\": {\n const resolve = pendingToolCalls.get(message.callId);\n pendingToolCalls.delete(message.callId);\n resolve?.(message);\n break;\n }\n }\n });\n\n return () => {\n if (typeof maybeDetach === \"function\") {\n maybeDetach();\n }\n pendingToolCalls.clear();\n activeAbortController?.abort();\n activeAbortController = undefined;\n activeExecutionId = undefined;\n };\n}\n"],"mappings":";;;;AAQA,SAAS,SAAS,OAAkD;AAClE,QAAO,OAAO,UAAU,YAAY,UAAU;;AAGhD,SAAS,eAAe,OAAiC;AACvD,QAAO,OAAO,UAAU,YAAY,OAAO,SAAS,MAAM;;AAG5D,SAAS,iBAAiB,OAAiD;AACzE,KAAI,CAAC,SAAS,MAAM,CAClB,QAAO;AAGT,QACE,eAAe,MAAM,YAAY,IACjC,eAAe,MAAM,YAAY,IACjC,eAAe,MAAM,iBAAiB,IACtC,eAAe,MAAM,UAAU;;AAInC,SAAS,mBAAmB,OAA2C;AACrE,KAAI,CAAC,SAAS,MAAM,IAAI,OAAO,MAAM,SAAS,SAC5C,QAAO;AAGT,KAAI,CAAC,SAAS,MAAM,MAAM,IAAI,OAAO,MAAM,UAAU,SACnD,QAAO;AAGT,QAAO,OAAO,OAAO,MAAM,MAAM,CAAC,OAC/B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,SAAyB,YAAY;KACvC,MAAM,sCAAqB;AAC3B,sBAAiB,IAAI,QAAQ,QAAQ;AACrC,UAAK,KAAK;MACR,GAAG;MACH;MACA,MAAM;MACP,CAAC;MACF;IACJ,WAAW,QAAQ;IACpB,EACD,QAAQ,QACT;AAED,QAAK,KAAK;IACR,GAAG;IACH,IAAI,QAAQ;IACZ,MAAM;IACP,CAAC;WACK,OAAO;AACd,QAAK,KAAK;IACR,YAAY;IACZ,OAAO;KACL,MAAM;KACN,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;KAChE;IACD,IAAI,QAAQ;IACZ,MAAM,EAAE;IACR,IAAI;IACJ,MAAM;IACP,CAAC;YACM;AACR,oBAAiB,OAAO;AACxB,2BAAwB;AACxB,uBAAoB;;;CAIxB,MAAM,cAAc,KAAK,WAAW,YAA+B;AACjE,MAAI,CAAC,oBAAoB,QAAQ,CAC/B;AAGF,UAAQ,QAAQ,MAAhB;GACE,KAAK;AACH,QAAI,QAAQ,OAAO,kBACjB,wBAAuB,OAAO;AAEhC;GACF,KAAK;AACH,IAAK,eAAe,QAAQ;AAC5B;GACF,KAAK,eAAe;IAClB,MAAM,UAAU,iBAAiB,IAAI,QAAQ,OAAO;AACpD,qBAAiB,OAAO,QAAQ,OAAO;AACvC,cAAU,QAAQ;AAClB;;;GAGJ;AAEF,cAAa;AACX,MAAI,OAAO,gBAAgB,WACzB,cAAa;AAEf,mBAAiB,OAAO;AACxB,yBAAuB,OAAO;AAC9B,0BAAwB;AACxB,sBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocolEndpoint.js","names":["activeAbortController: AbortController | undefined","activeExecutionId: string | undefined"],"sources":["../../../protocol/src/messages.ts","../../src/runner/protocolEndpoint.ts"],"sourcesContent":["import type {\n ExecuteResult,\n ExecutorRuntimeOptions,\n ProviderManifest,\n ToolCall,\n ToolCallResult,\n} from \"@execbox/core\";\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction isFiniteNumber(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value);\n}\n\nfunction isRuntimeOptions(value: unknown): value is ExecutorRuntimeOptions {\n if (!isRecord(value)) {\n return false;\n }\n\n return (\n isFiniteNumber(value.maxLogChars) &&\n isFiniteNumber(value.maxLogLines) &&\n isFiniteNumber(value.memoryLimitBytes) &&\n isFiniteNumber(value.timeoutMs)\n );\n}\n\nfunction isProviderManifest(value: unknown): value is ProviderManifest {\n if (!isRecord(value) || typeof value.name !== \"string\") {\n return false;\n }\n\n if (!isRecord(value.tools) || typeof value.types !== \"string\") {\n return false;\n }\n\n return Object.values(value.tools).every(\n (tool) =>\n isRecord(tool) &&\n typeof tool.originalName === \"string\" &&\n typeof tool.safeName === \"string\" &&\n (tool.description === undefined || typeof tool.description === \"string\"),\n );\n}\n\nfunction isExecuteError(\n value: unknown,\n): value is { code: string; message: string } {\n return (\n isRecord(value) &&\n typeof value.code === \"string\" &&\n typeof value.message === \"string\"\n );\n}\n\nfunction isDonePayload(value: unknown): value is DoneMessage {\n if (!isRecord(value) || !isFiniteNumber(value.durationMs)) {\n return false;\n }\n\n if (\n !Array.isArray(value.logs) ||\n !value.logs.every((log) => typeof log === \"string\")\n ) {\n return false;\n }\n\n if (typeof value.ok !== \"boolean\") {\n return false;\n }\n\n return value.ok ? true : isExecuteError(value.error);\n}\n\n/**\n * Message sent from dispatcher to runner to start one execution session.\n */\nexport interface ExecuteMessage {\n code: string;\n id: string;\n options: ExecutorRuntimeOptions;\n providers: ProviderManifest[];\n type: \"execute\";\n}\n\n/**\n * Message sent from dispatcher to request prompt cancellation.\n */\nexport interface CancelMessage {\n id: string;\n type: \"cancel\";\n}\n\n/**\n * Message sent from a runner when guest code invokes a host tool.\n */\nexport interface ToolCallMessage extends ToolCall {\n callId: string;\n type: \"tool_call\";\n}\n\n/**\n * Message carrying a trusted host tool result back to the runner.\n */\nexport type ToolResultMessage = {\n callId: string;\n type: \"tool_result\";\n} & ToolCallResult;\n\n/**\n * Message indicating the runner has finished bootstrapping guest execution timing.\n */\nexport interface StartedMessage {\n id: string;\n type: \"started\";\n}\n\n/**\n * Final successful execution result returned by a runner.\n *\n * Node IPC can omit `undefined` fields during serialization, so `result`\n * remains optional at the protocol boundary and is normalized by the host.\n */\nexport type DoneSuccessMessage<T = unknown> = {\n durationMs: number;\n id: string;\n logs: string[];\n ok: true;\n result?: T;\n type: \"done\";\n};\n\n/**\n * Final failed execution result returned by a runner.\n */\nexport type DoneFailureMessage = {\n id: string;\n type: \"done\";\n} & Extract<ExecuteResult, { ok: false }>;\n\n/**\n * Final execution result returned by a runner.\n */\nexport type DoneMessage = DoneSuccessMessage | DoneFailureMessage;\n\n/**\n * Messages accepted by a runner transport endpoint.\n */\nexport type DispatcherMessage =\n | CancelMessage\n | ExecuteMessage\n | ToolResultMessage;\n\n/**\n * Messages emitted by a runner transport endpoint.\n */\nexport type RunnerMessage = DoneMessage | StartedMessage | ToolCallMessage;\n\n/**\n * Returns whether an unknown value is a dispatcher-to-runner message.\n */\nexport function isDispatcherMessage(\n value: unknown,\n): value is DispatcherMessage {\n if (!isRecord(value) || typeof value.type !== \"string\") {\n return false;\n }\n\n switch (value.type) {\n case \"cancel\":\n return typeof value.id === \"string\";\n case \"execute\":\n return (\n typeof value.code === \"string\" &&\n typeof value.id === \"string\" &&\n isRuntimeOptions(value.options) &&\n Array.isArray(value.providers) &&\n value.providers.every(isProviderManifest)\n );\n case \"tool_result\":\n if (typeof value.callId !== \"string\" || typeof value.ok !== \"boolean\") {\n return false;\n }\n\n if (value.ok) {\n return \"result\" in value;\n }\n\n return isExecuteError(value.error);\n default:\n return false;\n }\n}\n\n/**\n * Returns whether an unknown value is a runner-to-dispatcher message.\n */\nexport function isRunnerMessage(value: unknown): value is RunnerMessage {\n if (!isRecord(value) || typeof value.type !== \"string\") {\n return false;\n }\n\n switch (value.type) {\n case \"started\":\n return typeof value.id === \"string\";\n case \"tool_call\":\n return (\n typeof value.callId === \"string\" &&\n typeof value.providerName === \"string\" &&\n typeof value.safeToolName === \"string\" &&\n \"input\" in value\n );\n case \"done\":\n return typeof value.id === \"string\" && isDonePayload(value);\n default:\n return false;\n }\n}\n","/**\n * @packageDocumentation\n * Public API for the `@execbox/quickjs/runner/protocol-endpoint` entrypoint.\n */\nimport { randomUUID } from \"node:crypto\";\n\nimport type {\n DispatcherMessage,\n ExecuteMessage,\n RunnerMessage,\n ToolCallResult,\n} from \"@execbox/protocol\";\n// This entrypoint is executed directly from source in worker/process tests before\n// workspace packages are built, so its runtime validator must stay source-local.\nimport { isDispatcherMessage } from \"../../../protocol/src/messages.ts\";\n\nimport { runQuickJsSession } from \"./index.ts\";\n\n/**\n * Minimal worker/process-side port used by the shared QuickJS protocol endpoint.\n */\nexport interface QuickJsProtocolPort {\n onMessage(handler: (message: DispatcherMessage) => void): void | (() => void);\n send(message: RunnerMessage): void;\n}\n\n/**\n * Attaches the shared QuickJS protocol loop to a worker/process messaging port.\n */\nexport function attachQuickJsProtocolEndpoint(\n port: QuickJsProtocolPort,\n): () => void {\n const pendingToolCalls = new Map<string, (result: ToolCallResult) => void>();\n let activeAbortController: AbortController | undefined;\n let activeExecutionId: string | undefined;\n\n async function startExecution(message: ExecuteMessage): Promise<void> {\n if (activeExecutionId) {\n port.send({\n durationMs: 0,\n error: {\n code: \"internal_error\",\n message: \"QuickJS endpoint already has an active execution\",\n },\n id: message.id,\n logs: [],\n ok: false,\n type: \"done\",\n });\n return;\n }\n\n const abortController = new AbortController();\n activeAbortController = abortController;\n activeExecutionId = message.id;\n\n try {\n const result = await runQuickJsSession(\n {\n abortController,\n code: message.code,\n onStarted: () => {\n port.send({\n id: message.id,\n type: \"started\",\n });\n },\n onToolCall: (call) =>\n new Promise<ToolCallResult>((resolve) => {\n const callId = randomUUID();\n pendingToolCalls.set(callId, resolve);\n port.send({\n ...call,\n callId,\n type: \"tool_call\",\n });\n }),\n providers: message.providers,\n },\n message.options,\n );\n\n port.send({\n ...result,\n id: message.id,\n type: \"done\",\n });\n } catch (error) {\n port.send({\n durationMs: 0,\n error: {\n code: \"internal_error\",\n message: error instanceof Error ? error.message : String(error),\n },\n id: message.id,\n logs: [],\n ok: false,\n type: \"done\",\n });\n } finally {\n pendingToolCalls.clear();\n activeAbortController = undefined;\n activeExecutionId = undefined;\n }\n }\n\n const maybeDetach = port.onMessage((message: DispatcherMessage) => {\n if (!isDispatcherMessage(message)) {\n return;\n }\n\n switch (message.type) {\n case \"cancel\":\n if (message.id === activeExecutionId) {\n activeAbortController?.abort();\n }\n break;\n case \"execute\":\n void startExecution(message);\n break;\n case \"tool_result\": {\n const resolve = pendingToolCalls.get(message.callId);\n pendingToolCalls.delete(message.callId);\n resolve?.(message);\n break;\n }\n }\n });\n\n return () => {\n if (typeof maybeDetach === \"function\") {\n maybeDetach();\n }\n pendingToolCalls.clear();\n activeAbortController?.abort();\n activeAbortController = undefined;\n activeExecutionId = undefined;\n };\n}\n"],"mappings":";;;;AAQA,SAAS,SAAS,OAAkD;AAClE,QAAO,OAAO,UAAU,YAAY,UAAU;;AAGhD,SAAS,eAAe,OAAiC;AACvD,QAAO,OAAO,UAAU,YAAY,OAAO,SAAS,MAAM;;AAG5D,SAAS,iBAAiB,OAAiD;AACzE,KAAI,CAAC,SAAS,MAAM,CAClB,QAAO;AAGT,QACE,eAAe,MAAM,YAAY,IACjC,eAAe,MAAM,YAAY,IACjC,eAAe,MAAM,iBAAiB,IACtC,eAAe,MAAM,UAAU;;AAInC,SAAS,mBAAmB,OAA2C;AACrE,KAAI,CAAC,SAAS,MAAM,IAAI,OAAO,MAAM,SAAS,SAC5C,QAAO;AAGT,KAAI,CAAC,SAAS,MAAM,MAAM,IAAI,OAAO,MAAM,UAAU,SACnD,QAAO;AAGT,QAAO,OAAO,OAAO,MAAM,MAAM,CAAC,OAC/B,SACC,SAAS,KAAK,IACd,OAAO,KAAK,iBAAiB,YAC7B,OAAO,KAAK,aAAa,aACxB,KAAK,gB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