@execbox/quickjs 0.6.0 → 0.7.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 +2 -8
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +51 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{runner-DRLfwiqY.cjs → runner-BeRzBTrn.cjs} +92 -74
- package/dist/runner-BeRzBTrn.cjs.map +1 -0
- package/dist/{runner-oZXbguX3.js → runner-DJd4Bh8V.js} +92 -74
- package/dist/runner-DJd4Bh8V.js.map +1 -0
- package/dist/workerEntry.cjs +105 -3
- package/dist/workerEntry.cjs.map +1 -1
- package/dist/workerEntry.js +104 -2
- package/dist/workerEntry.js.map +1 -1
- package/package.json +2 -29
- package/dist/protocolEndpoint-BGyrwlr_.cjs +0 -112
- package/dist/protocolEndpoint-BGyrwlr_.cjs.map +0 -1
- package/dist/protocolEndpoint-Ceadcq_L.js +0 -107
- package/dist/protocolEndpoint-Ceadcq_L.js.map +0 -1
- package/dist/remoteEndpoint.cjs +0 -45
- package/dist/remoteEndpoint.cjs.map +0 -1
- package/dist/remoteEndpoint.d.cts +0 -29
- package/dist/remoteEndpoint.d.cts.map +0 -1
- package/dist/remoteEndpoint.d.ts +0 -29
- package/dist/remoteEndpoint.d.ts.map +0 -1
- package/dist/remoteEndpoint.js +0 -45
- package/dist/remoteEndpoint.js.map +0 -1
- package/dist/runner/index.cjs +0 -3
- package/dist/runner/index.d.cts +0 -45
- package/dist/runner/index.d.cts.map +0 -1
- package/dist/runner/index.d.ts +0 -45
- package/dist/runner/index.d.ts.map +0 -1
- package/dist/runner/index.js +0 -3
- package/dist/runner/protocolEndpoint.cjs +0 -4
- package/dist/runner/protocolEndpoint.d.cts +0 -22
- package/dist/runner/protocolEndpoint.d.cts.map +0 -1
- package/dist/runner/protocolEndpoint.d.ts +0 -22
- package/dist/runner/protocolEndpoint.d.ts.map +0 -1
- package/dist/runner/protocolEndpoint.js +0 -4
- package/dist/runner-DRLfwiqY.cjs.map +0 -1
- package/dist/runner-oZXbguX3.js.map +0 -1
- package/dist/types-C-XfFJ7u.d.cts +0 -58
- package/dist/types-C-XfFJ7u.d.cts.map +0 -1
- package/dist/types-CE7SvejR.d.ts +0 -58
- package/dist/types-CE7SvejR.d.ts.map +0 -1
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
const require_runner = require('./runner-DRLfwiqY.cjs');
|
|
2
|
-
let __execbox_core_protocol = require("@execbox/core/protocol");
|
|
3
|
-
let node_crypto = require("node:crypto");
|
|
4
|
-
|
|
5
|
-
//#region src/runner/protocolEndpoint.ts
|
|
6
|
-
/**
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
* Public API for the `@execbox/quickjs/runner/protocol-endpoint` entrypoint.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Attaches the shared QuickJS protocol loop to a worker messaging port.
|
|
12
|
-
*/
|
|
13
|
-
function attachQuickJsProtocolEndpoint(port) {
|
|
14
|
-
const pendingToolCalls = /* @__PURE__ */ new Map();
|
|
15
|
-
let activeAbortController;
|
|
16
|
-
let activeExecutionId;
|
|
17
|
-
async function startExecution(message) {
|
|
18
|
-
if (activeExecutionId) {
|
|
19
|
-
port.send({
|
|
20
|
-
durationMs: 0,
|
|
21
|
-
error: {
|
|
22
|
-
code: "internal_error",
|
|
23
|
-
message: "QuickJS endpoint already has an active execution"
|
|
24
|
-
},
|
|
25
|
-
id: message.id,
|
|
26
|
-
logs: [],
|
|
27
|
-
ok: false,
|
|
28
|
-
type: "done"
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const abortController = new AbortController();
|
|
33
|
-
activeAbortController = abortController;
|
|
34
|
-
activeExecutionId = message.id;
|
|
35
|
-
try {
|
|
36
|
-
const result = await require_runner.runQuickJsSession({
|
|
37
|
-
abortController,
|
|
38
|
-
code: message.code,
|
|
39
|
-
onStarted: () => {
|
|
40
|
-
port.send({
|
|
41
|
-
id: message.id,
|
|
42
|
-
type: "started"
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
onToolCall: (call) => new Promise((resolve) => {
|
|
46
|
-
const callId = (0, node_crypto.randomUUID)();
|
|
47
|
-
pendingToolCalls.set(callId, resolve);
|
|
48
|
-
port.send({
|
|
49
|
-
...call,
|
|
50
|
-
callId,
|
|
51
|
-
type: "tool_call"
|
|
52
|
-
});
|
|
53
|
-
}),
|
|
54
|
-
providers: message.providers
|
|
55
|
-
}, message.options);
|
|
56
|
-
port.send({
|
|
57
|
-
...result,
|
|
58
|
-
id: message.id,
|
|
59
|
-
type: "done"
|
|
60
|
-
});
|
|
61
|
-
} catch (error) {
|
|
62
|
-
port.send({
|
|
63
|
-
durationMs: 0,
|
|
64
|
-
error: {
|
|
65
|
-
code: "internal_error",
|
|
66
|
-
message: error instanceof Error ? error.message : String(error)
|
|
67
|
-
},
|
|
68
|
-
id: message.id,
|
|
69
|
-
logs: [],
|
|
70
|
-
ok: false,
|
|
71
|
-
type: "done"
|
|
72
|
-
});
|
|
73
|
-
} finally {
|
|
74
|
-
pendingToolCalls.clear();
|
|
75
|
-
activeAbortController = void 0;
|
|
76
|
-
activeExecutionId = void 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const maybeDetach = port.onMessage((message) => {
|
|
80
|
-
if (!(0, __execbox_core_protocol.isDispatcherMessage)(message)) return;
|
|
81
|
-
switch (message.type) {
|
|
82
|
-
case "cancel":
|
|
83
|
-
if (message.id === activeExecutionId) activeAbortController?.abort();
|
|
84
|
-
break;
|
|
85
|
-
case "execute":
|
|
86
|
-
startExecution(message);
|
|
87
|
-
break;
|
|
88
|
-
case "tool_result": {
|
|
89
|
-
const resolve = pendingToolCalls.get(message.callId);
|
|
90
|
-
pendingToolCalls.delete(message.callId);
|
|
91
|
-
resolve?.(message);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return () => {
|
|
97
|
-
if (typeof maybeDetach === "function") maybeDetach();
|
|
98
|
-
pendingToolCalls.clear();
|
|
99
|
-
activeAbortController?.abort();
|
|
100
|
-
activeAbortController = void 0;
|
|
101
|
-
activeExecutionId = void 0;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
|
-
Object.defineProperty(exports, 'attachQuickJsProtocolEndpoint', {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function () {
|
|
109
|
-
return attachQuickJsProtocolEndpoint;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
//# sourceMappingURL=protocolEndpoint-BGyrwlr_.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocolEndpoint-BGyrwlr_.cjs","names":["activeAbortController: AbortController | undefined","activeExecutionId: string | undefined","runQuickJsSession"],"sources":["../src/runner/protocolEndpoint.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Public API for the `@execbox/quickjs/runner/protocol-endpoint` entrypoint.\n */\nimport { randomUUID } from \"node:crypto\";\n\nimport { isDispatcherMessage } from \"@execbox/core/protocol\";\nimport type {\n DispatcherMessage,\n ExecuteMessage,\n RunnerMessage,\n} from \"@execbox/core/protocol\";\nimport type { ToolCallResult } from \"@execbox/core\";\n\nimport { runQuickJsSession } from \"./index.ts\";\n\n/**\n * Minimal worker-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 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":";;;;;;;;;;;;AA2BA,SAAgB,8BACd,MACY;CACZ,MAAM,mCAAmB,IAAI,KAA+C;CAC5E,IAAIA;CACJ,IAAIC;CAEJ,eAAe,eAAe,SAAwC;AACpE,MAAI,mBAAmB;AACrB,QAAK,KAAK;IACR,YAAY;IACZ,OAAO;KACL,MAAM;KACN,SAAS;KACV;IACD,IAAI,QAAQ;IACZ,MAAM,EAAE;IACR,IAAI;IACJ,MAAM;IACP,CAAC;AACF;;EAGF,MAAM,kBAAkB,IAAI,iBAAiB;AAC7C,0BAAwB;AACxB,sBAAoB,QAAQ;AAE5B,MAAI;GACF,MAAM,SAAS,MAAMC,iCACnB;IACE;IACA,MAAM,QAAQ;IACd,iBAAiB;AACf,UAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM;MACP,CAAC;;IAEJ,aAAa,SACX,IAAI,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,kDAAqB,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,107 +0,0 @@
|
|
|
1
|
-
import { t as runQuickJsSession } from "./runner-oZXbguX3.js";
|
|
2
|
-
import { isDispatcherMessage } from "@execbox/core/protocol";
|
|
3
|
-
import { randomUUID } from "node:crypto";
|
|
4
|
-
|
|
5
|
-
//#region src/runner/protocolEndpoint.ts
|
|
6
|
-
/**
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
* Public API for the `@execbox/quickjs/runner/protocol-endpoint` entrypoint.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Attaches the shared QuickJS protocol loop to a worker messaging port.
|
|
12
|
-
*/
|
|
13
|
-
function attachQuickJsProtocolEndpoint(port) {
|
|
14
|
-
const pendingToolCalls = /* @__PURE__ */ new Map();
|
|
15
|
-
let activeAbortController;
|
|
16
|
-
let activeExecutionId;
|
|
17
|
-
async function startExecution(message) {
|
|
18
|
-
if (activeExecutionId) {
|
|
19
|
-
port.send({
|
|
20
|
-
durationMs: 0,
|
|
21
|
-
error: {
|
|
22
|
-
code: "internal_error",
|
|
23
|
-
message: "QuickJS endpoint already has an active execution"
|
|
24
|
-
},
|
|
25
|
-
id: message.id,
|
|
26
|
-
logs: [],
|
|
27
|
-
ok: false,
|
|
28
|
-
type: "done"
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const abortController = new AbortController();
|
|
33
|
-
activeAbortController = abortController;
|
|
34
|
-
activeExecutionId = message.id;
|
|
35
|
-
try {
|
|
36
|
-
const result = await runQuickJsSession({
|
|
37
|
-
abortController,
|
|
38
|
-
code: message.code,
|
|
39
|
-
onStarted: () => {
|
|
40
|
-
port.send({
|
|
41
|
-
id: message.id,
|
|
42
|
-
type: "started"
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
onToolCall: (call) => new Promise((resolve) => {
|
|
46
|
-
const callId = randomUUID();
|
|
47
|
-
pendingToolCalls.set(callId, resolve);
|
|
48
|
-
port.send({
|
|
49
|
-
...call,
|
|
50
|
-
callId,
|
|
51
|
-
type: "tool_call"
|
|
52
|
-
});
|
|
53
|
-
}),
|
|
54
|
-
providers: message.providers
|
|
55
|
-
}, message.options);
|
|
56
|
-
port.send({
|
|
57
|
-
...result,
|
|
58
|
-
id: message.id,
|
|
59
|
-
type: "done"
|
|
60
|
-
});
|
|
61
|
-
} catch (error) {
|
|
62
|
-
port.send({
|
|
63
|
-
durationMs: 0,
|
|
64
|
-
error: {
|
|
65
|
-
code: "internal_error",
|
|
66
|
-
message: error instanceof Error ? error.message : String(error)
|
|
67
|
-
},
|
|
68
|
-
id: message.id,
|
|
69
|
-
logs: [],
|
|
70
|
-
ok: false,
|
|
71
|
-
type: "done"
|
|
72
|
-
});
|
|
73
|
-
} finally {
|
|
74
|
-
pendingToolCalls.clear();
|
|
75
|
-
activeAbortController = void 0;
|
|
76
|
-
activeExecutionId = void 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const maybeDetach = port.onMessage((message) => {
|
|
80
|
-
if (!isDispatcherMessage(message)) return;
|
|
81
|
-
switch (message.type) {
|
|
82
|
-
case "cancel":
|
|
83
|
-
if (message.id === activeExecutionId) activeAbortController?.abort();
|
|
84
|
-
break;
|
|
85
|
-
case "execute":
|
|
86
|
-
startExecution(message);
|
|
87
|
-
break;
|
|
88
|
-
case "tool_result": {
|
|
89
|
-
const resolve = pendingToolCalls.get(message.callId);
|
|
90
|
-
pendingToolCalls.delete(message.callId);
|
|
91
|
-
resolve?.(message);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return () => {
|
|
97
|
-
if (typeof maybeDetach === "function") maybeDetach();
|
|
98
|
-
pendingToolCalls.clear();
|
|
99
|
-
activeAbortController?.abort();
|
|
100
|
-
activeAbortController = void 0;
|
|
101
|
-
activeExecutionId = void 0;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
|
-
export { attachQuickJsProtocolEndpoint as t };
|
|
107
|
-
//# sourceMappingURL=protocolEndpoint-Ceadcq_L.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocolEndpoint-Ceadcq_L.js","names":["activeAbortController: AbortController | undefined","activeExecutionId: string | undefined"],"sources":["../src/runner/protocolEndpoint.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Public API for the `@execbox/quickjs/runner/protocol-endpoint` entrypoint.\n */\nimport { randomUUID } from \"node:crypto\";\n\nimport { isDispatcherMessage } from \"@execbox/core/protocol\";\nimport type {\n DispatcherMessage,\n ExecuteMessage,\n RunnerMessage,\n} from \"@execbox/core/protocol\";\nimport type { ToolCallResult } from \"@execbox/core\";\n\nimport { runQuickJsSession } from \"./index.ts\";\n\n/**\n * Minimal worker-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 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":";;;;;;;;;;;;AA2BA,SAAgB,8BACd,MACY;CACZ,MAAM,mCAAmB,IAAI,KAA+C;CAC5E,IAAIA;CACJ,IAAIC;CAEJ,eAAe,eAAe,SAAwC;AACpE,MAAI,mBAAmB;AACrB,QAAK,KAAK;IACR,YAAY;IACZ,OAAO;KACL,MAAM;KACN,SAAS;KACV;IACD,IAAI,QAAQ;IACZ,MAAM,EAAE;IACR,IAAI;IACJ,MAAM;IACP,CAAC;AACF;;EAGF,MAAM,kBAAkB,IAAI,iBAAiB;AAC7C,0BAAwB;AACxB,sBAAoB,QAAQ;AAE5B,MAAI;GACF,MAAM,SAAS,MAAM,kBACnB;IACE;IACA,MAAM,QAAQ;IACd,iBAAiB;AACf,UAAK,KAAK;MACR,IAAI,QAAQ;MACZ,MAAM;MACP,CAAC;;IAEJ,aAAa,SACX,IAAI,SAAyB,YAAY;KACvC,MAAM,SAAS,YAAY;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"}
|
package/dist/remoteEndpoint.cjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
require('./runner-DRLfwiqY.cjs');
|
|
2
|
-
const require_protocolEndpoint = require('./protocolEndpoint-BGyrwlr_.cjs');
|
|
3
|
-
let __execbox_core_protocol = require("@execbox/core/protocol");
|
|
4
|
-
|
|
5
|
-
//#region src/remoteEndpoint.ts
|
|
6
|
-
/**
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
* QuickJS remote runner endpoint for `@execbox/remote` transports.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Attaches the shared QuickJS protocol endpoint to a remote runner transport
|
|
12
|
-
* and tears it down automatically when the transport closes or errors.
|
|
13
|
-
*/
|
|
14
|
-
function attachQuickJsRemoteEndpoint(port) {
|
|
15
|
-
const detachProtocol = require_protocolEndpoint.attachQuickJsProtocolEndpoint({
|
|
16
|
-
onMessage(handler) {
|
|
17
|
-
const maybeDetach = port.onMessage((message) => {
|
|
18
|
-
if (!(0, __execbox_core_protocol.isDispatcherMessage)(message)) return;
|
|
19
|
-
handler(message);
|
|
20
|
-
});
|
|
21
|
-
return () => {
|
|
22
|
-
if (typeof maybeDetach === "function") maybeDetach();
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
send(message) {
|
|
26
|
-
Promise.resolve(port.send(message)).catch(() => {});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const offClose = port.onClose?.(() => {
|
|
30
|
-
cleanup();
|
|
31
|
-
});
|
|
32
|
-
const offError = port.onError?.(() => {
|
|
33
|
-
cleanup();
|
|
34
|
-
});
|
|
35
|
-
function cleanup() {
|
|
36
|
-
if (typeof offClose === "function") offClose();
|
|
37
|
-
if (typeof offError === "function") offError();
|
|
38
|
-
detachProtocol();
|
|
39
|
-
}
|
|
40
|
-
return cleanup;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
exports.attachQuickJsRemoteEndpoint = attachQuickJsRemoteEndpoint;
|
|
45
|
-
//# sourceMappingURL=remoteEndpoint.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remoteEndpoint.cjs","names":["attachQuickJsProtocolEndpoint"],"sources":["../src/remoteEndpoint.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * QuickJS remote runner endpoint for `@execbox/remote` transports.\n */\nimport {\n isDispatcherMessage,\n type DispatcherMessage,\n type RunnerMessage,\n type TransportCloseReason,\n} from \"@execbox/core/protocol\";\n\nimport { attachQuickJsProtocolEndpoint } from \"./runner/protocolEndpoint.ts\";\n\n/**\n * Minimal runner-side port for transport-backed QuickJS execution.\n */\nexport interface QuickJsRemoteEndpointPort {\n /** Registers a close callback for transport shutdown notifications. */\n onClose?(\n handler: (reason?: TransportCloseReason) => void,\n ): void | (() => void);\n\n /** Registers an error callback for transport-level failures. */\n onError?(handler: (error: Error) => void): void | (() => void);\n\n /** Registers a handler for inbound runner messages. */\n onMessage(handler: (message: unknown) => void): void | (() => void);\n\n /** Sends a transport message to the attached host session. */\n send(message: unknown): void | Promise<void>;\n}\n\n/**\n * Attaches the shared QuickJS protocol endpoint to a remote runner transport\n * and tears it down automatically when the transport closes or errors.\n */\nexport function attachQuickJsRemoteEndpoint(\n port: QuickJsRemoteEndpointPort,\n): () => void {\n const detachProtocol = attachQuickJsProtocolEndpoint({\n onMessage(handler: (message: DispatcherMessage) => void): () => void {\n const maybeDetach = port.onMessage((message: unknown) => {\n if (!isDispatcherMessage(message)) {\n return;\n }\n\n handler(message);\n });\n\n return () => {\n if (typeof maybeDetach === \"function\") {\n maybeDetach();\n }\n };\n },\n send(message: RunnerMessage): void {\n void Promise.resolve(port.send(message)).catch(() => {});\n },\n });\n\n const offClose = port.onClose?.(() => {\n cleanup();\n });\n const offError = port.onError?.(() => {\n cleanup();\n });\n\n function cleanup(): void {\n if (typeof offClose === \"function\") {\n offClose();\n }\n if (typeof offError === \"function\") {\n offError();\n }\n detachProtocol();\n }\n\n return cleanup;\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,SAAgB,4BACd,MACY;CACZ,MAAM,iBAAiBA,uDAA8B;EACnD,UAAU,SAA2D;GACnE,MAAM,cAAc,KAAK,WAAW,YAAqB;AACvD,QAAI,kDAAqB,QAAQ,CAC/B;AAGF,YAAQ,QAAQ;KAChB;AAEF,gBAAa;AACX,QAAI,OAAO,gBAAgB,WACzB,cAAa;;;EAInB,KAAK,SAA8B;AACjC,GAAK,QAAQ,QAAQ,KAAK,KAAK,QAAQ,CAAC,CAAC,YAAY,GAAG;;EAE3D,CAAC;CAEF,MAAM,WAAW,KAAK,gBAAgB;AACpC,WAAS;GACT;CACF,MAAM,WAAW,KAAK,gBAAgB;AACpC,WAAS;GACT;CAEF,SAAS,UAAgB;AACvB,MAAI,OAAO,aAAa,WACtB,WAAU;AAEZ,MAAI,OAAO,aAAa,WACtB,WAAU;AAEZ,kBAAgB;;AAGlB,QAAO"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
-
*/
|
|
5
|
-
import { TransportCloseReason } from "@execbox/core/protocol";
|
|
6
|
-
|
|
7
|
-
//#region src/remoteEndpoint.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Minimal runner-side port for transport-backed QuickJS execution.
|
|
11
|
-
*/
|
|
12
|
-
interface QuickJsRemoteEndpointPort {
|
|
13
|
-
/** Registers a close callback for transport shutdown notifications. */
|
|
14
|
-
onClose?(handler: (reason?: TransportCloseReason) => void): void | (() => void);
|
|
15
|
-
/** Registers an error callback for transport-level failures. */
|
|
16
|
-
onError?(handler: (error: Error) => void): void | (() => void);
|
|
17
|
-
/** Registers a handler for inbound runner messages. */
|
|
18
|
-
onMessage(handler: (message: unknown) => void): void | (() => void);
|
|
19
|
-
/** Sends a transport message to the attached host session. */
|
|
20
|
-
send(message: unknown): void | Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Attaches the shared QuickJS protocol endpoint to a remote runner transport
|
|
24
|
-
* and tears it down automatically when the transport closes or errors.
|
|
25
|
-
*/
|
|
26
|
-
declare function attachQuickJsRemoteEndpoint(port: QuickJsRemoteEndpointPort): () => void;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { QuickJsRemoteEndpointPort, attachQuickJsRemoteEndpoint };
|
|
29
|
-
//# sourceMappingURL=remoteEndpoint.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remoteEndpoint.d.cts","names":[],"sources":["../src/remoteEndpoint.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAoCgB,SAAA,CApBC,yBAAA,CAoB0B;;8BAjBpB;;4BAIK;;;;iCAMK;;;;;;iBAOjB,2BAAA,OACR"}
|
package/dist/remoteEndpoint.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
-
*/
|
|
5
|
-
import { TransportCloseReason } from "@execbox/core/protocol";
|
|
6
|
-
|
|
7
|
-
//#region src/remoteEndpoint.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Minimal runner-side port for transport-backed QuickJS execution.
|
|
11
|
-
*/
|
|
12
|
-
interface QuickJsRemoteEndpointPort {
|
|
13
|
-
/** Registers a close callback for transport shutdown notifications. */
|
|
14
|
-
onClose?(handler: (reason?: TransportCloseReason) => void): void | (() => void);
|
|
15
|
-
/** Registers an error callback for transport-level failures. */
|
|
16
|
-
onError?(handler: (error: Error) => void): void | (() => void);
|
|
17
|
-
/** Registers a handler for inbound runner messages. */
|
|
18
|
-
onMessage(handler: (message: unknown) => void): void | (() => void);
|
|
19
|
-
/** Sends a transport message to the attached host session. */
|
|
20
|
-
send(message: unknown): void | Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Attaches the shared QuickJS protocol endpoint to a remote runner transport
|
|
24
|
-
* and tears it down automatically when the transport closes or errors.
|
|
25
|
-
*/
|
|
26
|
-
declare function attachQuickJsRemoteEndpoint(port: QuickJsRemoteEndpointPort): () => void;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { QuickJsRemoteEndpointPort, attachQuickJsRemoteEndpoint };
|
|
29
|
-
//# sourceMappingURL=remoteEndpoint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remoteEndpoint.d.ts","names":[],"sources":["../src/remoteEndpoint.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAoCgB,SAAA,CApBC,yBAAA,CAoB0B;;8BAjBpB;;4BAIK;;;;iCAMK;;;;;;iBAOjB,2BAAA,OACR"}
|
package/dist/remoteEndpoint.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import "./runner-oZXbguX3.js";
|
|
2
|
-
import { t as attachQuickJsProtocolEndpoint } from "./protocolEndpoint-Ceadcq_L.js";
|
|
3
|
-
import { isDispatcherMessage } from "@execbox/core/protocol";
|
|
4
|
-
|
|
5
|
-
//#region src/remoteEndpoint.ts
|
|
6
|
-
/**
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
* QuickJS remote runner endpoint for `@execbox/remote` transports.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Attaches the shared QuickJS protocol endpoint to a remote runner transport
|
|
12
|
-
* and tears it down automatically when the transport closes or errors.
|
|
13
|
-
*/
|
|
14
|
-
function attachQuickJsRemoteEndpoint(port) {
|
|
15
|
-
const detachProtocol = attachQuickJsProtocolEndpoint({
|
|
16
|
-
onMessage(handler) {
|
|
17
|
-
const maybeDetach = port.onMessage((message) => {
|
|
18
|
-
if (!isDispatcherMessage(message)) return;
|
|
19
|
-
handler(message);
|
|
20
|
-
});
|
|
21
|
-
return () => {
|
|
22
|
-
if (typeof maybeDetach === "function") maybeDetach();
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
send(message) {
|
|
26
|
-
Promise.resolve(port.send(message)).catch(() => {});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const offClose = port.onClose?.(() => {
|
|
30
|
-
cleanup();
|
|
31
|
-
});
|
|
32
|
-
const offError = port.onError?.(() => {
|
|
33
|
-
cleanup();
|
|
34
|
-
});
|
|
35
|
-
function cleanup() {
|
|
36
|
-
if (typeof offClose === "function") offClose();
|
|
37
|
-
if (typeof offError === "function") offError();
|
|
38
|
-
detachProtocol();
|
|
39
|
-
}
|
|
40
|
-
return cleanup;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
export { attachQuickJsRemoteEndpoint };
|
|
45
|
-
//# sourceMappingURL=remoteEndpoint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remoteEndpoint.js","names":[],"sources":["../src/remoteEndpoint.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * QuickJS remote runner endpoint for `@execbox/remote` transports.\n */\nimport {\n isDispatcherMessage,\n type DispatcherMessage,\n type RunnerMessage,\n type TransportCloseReason,\n} from \"@execbox/core/protocol\";\n\nimport { attachQuickJsProtocolEndpoint } from \"./runner/protocolEndpoint.ts\";\n\n/**\n * Minimal runner-side port for transport-backed QuickJS execution.\n */\nexport interface QuickJsRemoteEndpointPort {\n /** Registers a close callback for transport shutdown notifications. */\n onClose?(\n handler: (reason?: TransportCloseReason) => void,\n ): void | (() => void);\n\n /** Registers an error callback for transport-level failures. */\n onError?(handler: (error: Error) => void): void | (() => void);\n\n /** Registers a handler for inbound runner messages. */\n onMessage(handler: (message: unknown) => void): void | (() => void);\n\n /** Sends a transport message to the attached host session. */\n send(message: unknown): void | Promise<void>;\n}\n\n/**\n * Attaches the shared QuickJS protocol endpoint to a remote runner transport\n * and tears it down automatically when the transport closes or errors.\n */\nexport function attachQuickJsRemoteEndpoint(\n port: QuickJsRemoteEndpointPort,\n): () => void {\n const detachProtocol = attachQuickJsProtocolEndpoint({\n onMessage(handler: (message: DispatcherMessage) => void): () => void {\n const maybeDetach = port.onMessage((message: unknown) => {\n if (!isDispatcherMessage(message)) {\n return;\n }\n\n handler(message);\n });\n\n return () => {\n if (typeof maybeDetach === \"function\") {\n maybeDetach();\n }\n };\n },\n send(message: RunnerMessage): void {\n void Promise.resolve(port.send(message)).catch(() => {});\n },\n });\n\n const offClose = port.onClose?.(() => {\n cleanup();\n });\n const offError = port.onError?.(() => {\n cleanup();\n });\n\n function cleanup(): void {\n if (typeof offClose === \"function\") {\n offClose();\n }\n if (typeof offError === \"function\") {\n offError();\n }\n detachProtocol();\n }\n\n return cleanup;\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,SAAgB,4BACd,MACY;CACZ,MAAM,iBAAiB,8BAA8B;EACnD,UAAU,SAA2D;GACnE,MAAM,cAAc,KAAK,WAAW,YAAqB;AACvD,QAAI,CAAC,oBAAoB,QAAQ,CAC/B;AAGF,YAAQ,QAAQ;KAChB;AAEF,gBAAa;AACX,QAAI,OAAO,gBAAgB,WACzB,cAAa;;;EAInB,KAAK,SAA8B;AACjC,GAAK,QAAQ,QAAQ,KAAK,KAAK,QAAQ,CAAC,CAAC,YAAY,GAAG;;EAE3D,CAAC;CAEF,MAAM,WAAW,KAAK,gBAAgB;AACpC,WAAS;GACT;CACF,MAAM,WAAW,KAAK,gBAAgB;AACpC,WAAS;GACT;CAEF,SAAS,UAAgB;AACvB,MAAI,OAAO,aAAa,WACtB,WAAU;AAEZ,MAAI,OAAO,aAAa,WACtB,WAAU;AAEZ,kBAAgB;;AAGlB,QAAO"}
|
package/dist/runner/index.cjs
DELETED
package/dist/runner/index.d.cts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
-
*/
|
|
5
|
-
import { a as QuickJsWorkerExecutorOptions, i as QuickJsInlineExecutorOptions, n as QuickJsExecutorOptions, o as WorkerResourceLimits, r as QuickJsHostedMode, t as QuickJsExecutorHost } from "../types-C-XfFJ7u.cjs";
|
|
6
|
-
import { ExecuteResult, ExecutorRuntimeOptions, ProviderManifest, ToolCall, ToolCallResult } from "@execbox/core";
|
|
7
|
-
import { QuickJSWASMModule } from "quickjs-emscripten";
|
|
8
|
-
|
|
9
|
-
//#region src/runner/index.d.ts
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Transport-neutral host tool call emitted from a QuickJS session.
|
|
13
|
-
*/
|
|
14
|
-
type QuickJsSessionToolCall = ToolCall;
|
|
15
|
-
/**
|
|
16
|
-
* Input required to run one transport-backed QuickJS execution session.
|
|
17
|
-
*/
|
|
18
|
-
interface QuickJsSessionRequest {
|
|
19
|
-
/** Optional abort controller that should be triggered when execution stops. */
|
|
20
|
-
abortController?: AbortController;
|
|
21
|
-
/** Guest JavaScript source to evaluate inside QuickJS. */
|
|
22
|
-
code: string;
|
|
23
|
-
/** Host callback used to fulfill guest tool calls. */
|
|
24
|
-
onToolCall: (call: ToolCall) => Promise<ToolCallResult> | ToolCallResult;
|
|
25
|
-
/** Optional hook invoked once the guest runtime has started. */
|
|
26
|
-
onStarted?: () => void;
|
|
27
|
-
/** Transport-safe provider manifests exposed to the guest runtime. */
|
|
28
|
-
providers: ProviderManifest[];
|
|
29
|
-
/** Optional caller-owned abort signal for the session. */
|
|
30
|
-
signal?: AbortSignal;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Options controlling one transport-backed QuickJS session.
|
|
34
|
-
*/
|
|
35
|
-
type QuickJsSessionOptions = ExecutorRuntimeOptions & Pick<QuickJsInlineExecutorOptions, "loadModule"> & {
|
|
36
|
-
/** Optional preloaded QuickJS WASM module instance. */
|
|
37
|
-
module?: QuickJSWASMModule;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Runs one QuickJS-backed execution session using a transport-neutral tool callback.
|
|
41
|
-
*/
|
|
42
|
-
declare function runQuickJsSession(request: QuickJsSessionRequest, options?: QuickJsSessionOptions): Promise<ExecuteResult>;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { type QuickJsExecutorHost, type QuickJsExecutorOptions, type QuickJsHostedMode, type QuickJsInlineExecutorOptions, QuickJsSessionOptions, QuickJsSessionRequest, QuickJsSessionToolCall, type QuickJsWorkerExecutorOptions, type WorkerResourceLimits, runQuickJsSession };
|
|
45
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/runner/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AA6DA,CAAA,CAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,OAAA,CAAA,OAAA;AAKA,CAAA,CAAA;AAEoB,IAAA,CAPR,sBAAA,CAAA,CAAA,CAAyB,QAOjB;;;;AAMwC,SAAA,CAR3C,qBAAA,CAQ2C;EAM/C,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,CAAA,MAAA,CAAA,EAAA,CAAA,SAAA,CAAA,IAAA,CAAA,SAAA,CAAA,KAAA,CAAA,CAAA,CAAA;EAGF,eAAA,CAAA,CAAA,CAfS,eAeT;EAAW,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,UAAA,CAAA,MAAA,CAAA,EAAA,CAAA,QAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EAMV,IAAA,CAAA,CAAA,MAAA;EAAwB,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,EAAA,CAAA,OAAA,CAAA,KAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA;EAC7B,UAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAhBc,QAgBd,CAAA,CAAA,CAAA,CAAA,CAhB2B,OAgB3B,CAhBmC,cAgBnC,CAAA,CAAA,CAAA,CAhBqD,cAgBrD;EAAL,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,IAAA,CAAA,OAAA,CAAA,IAAA,CAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EAEW,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA;EAAiB,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,IAAA,CAAA,QAAA,CAAA,SAAA,CAAA,OAAA,CAAA,EAAA,CAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EA4TR,SAAA,CAAA,CAxUT,gBAwU0B,CAAA,CAAA;EAC5B,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,MAAA,CAAA,KAAA,CAAA,KAAA,CAAA,MAAA,CAAA,GAAA,CAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EACA,MAAA,CAAA,CAAA,CAvUA,WAuUA;;;;;KAjUC,qBAAA,CAAA,CAAA,CAAwB,yBAClC,KAAK;;WAEM;;;;;iBA4TS,iBAAA,UACX,iCACA,wBACR,QAAQ"}
|
package/dist/runner/index.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
-
*/
|
|
5
|
-
import { a as QuickJsWorkerExecutorOptions, i as QuickJsInlineExecutorOptions, n as QuickJsExecutorOptions, o as WorkerResourceLimits, r as QuickJsHostedMode, t as QuickJsExecutorHost } from "../types-CE7SvejR.js";
|
|
6
|
-
import { QuickJSWASMModule } from "quickjs-emscripten";
|
|
7
|
-
import { ExecuteResult, ExecutorRuntimeOptions, ProviderManifest, ToolCall, ToolCallResult } from "@execbox/core";
|
|
8
|
-
|
|
9
|
-
//#region src/runner/index.d.ts
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Transport-neutral host tool call emitted from a QuickJS session.
|
|
13
|
-
*/
|
|
14
|
-
type QuickJsSessionToolCall = ToolCall;
|
|
15
|
-
/**
|
|
16
|
-
* Input required to run one transport-backed QuickJS execution session.
|
|
17
|
-
*/
|
|
18
|
-
interface QuickJsSessionRequest {
|
|
19
|
-
/** Optional abort controller that should be triggered when execution stops. */
|
|
20
|
-
abortController?: AbortController;
|
|
21
|
-
/** Guest JavaScript source to evaluate inside QuickJS. */
|
|
22
|
-
code: string;
|
|
23
|
-
/** Host callback used to fulfill guest tool calls. */
|
|
24
|
-
onToolCall: (call: ToolCall) => Promise<ToolCallResult> | ToolCallResult;
|
|
25
|
-
/** Optional hook invoked once the guest runtime has started. */
|
|
26
|
-
onStarted?: () => void;
|
|
27
|
-
/** Transport-safe provider manifests exposed to the guest runtime. */
|
|
28
|
-
providers: ProviderManifest[];
|
|
29
|
-
/** Optional caller-owned abort signal for the session. */
|
|
30
|
-
signal?: AbortSignal;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Options controlling one transport-backed QuickJS session.
|
|
34
|
-
*/
|
|
35
|
-
type QuickJsSessionOptions = ExecutorRuntimeOptions & Pick<QuickJsInlineExecutorOptions, "loadModule"> & {
|
|
36
|
-
/** Optional preloaded QuickJS WASM module instance. */
|
|
37
|
-
module?: QuickJSWASMModule;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Runs one QuickJS-backed execution session using a transport-neutral tool callback.
|
|
41
|
-
*/
|
|
42
|
-
declare function runQuickJsSession(request: QuickJsSessionRequest, options?: QuickJsSessionOptions): Promise<ExecuteResult>;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { type QuickJsExecutorHost, type QuickJsExecutorOptions, type QuickJsHostedMode, type QuickJsInlineExecutorOptions, QuickJsSessionOptions, QuickJsSessionRequest, QuickJsSessionToolCall, type QuickJsWorkerExecutorOptions, type WorkerResourceLimits, runQuickJsSession };
|
|
45
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/runner/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AA6DA,CAAA,CAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,OAAA,CAAA,OAAA;AAKA,CAAA,CAAA;AAEoB,IAAA,CAPR,sBAAA,CAAA,CAAA,CAAyB,QAOjB;;;;AAMwC,SAAA,CAR3C,qBAAA,CAQ2C;EAM/C,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,CAAA,MAAA,CAAA,EAAA,CAAA,SAAA,CAAA,IAAA,CAAA,SAAA,CAAA,KAAA,CAAA,CAAA,CAAA;EAGF,eAAA,CAAA,CAAA,CAfS,eAeT;EAAW,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,UAAA,CAAA,MAAA,CAAA,EAAA,CAAA,QAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EAMV,IAAA,CAAA,CAAA,MAAA;EAAwB,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,EAAA,CAAA,OAAA,CAAA,KAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA;EAC7B,UAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAhBc,QAgBd,CAAA,CAAA,CAAA,CAAA,CAhB2B,OAgB3B,CAhBmC,cAgBnC,CAAA,CAAA,CAAA,CAhBqD,cAgBrD;EAAL,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,IAAA,CAAA,OAAA,CAAA,IAAA,CAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EAEW,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA;EAAiB,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,IAAA,CAAA,QAAA,CAAA,SAAA,CAAA,OAAA,CAAA,EAAA,CAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EA4TR,SAAA,CAAA,CAxUT,gBAwU0B,CAAA,CAAA;EAC5B,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,MAAA,CAAA,KAAA,CAAA,KAAA,CAAA,MAAA,CAAA,GAAA,CAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;EACA,MAAA,CAAA,CAAA,CAvUA,WAuUA;;;;;KAjUC,qBAAA,CAAA,CAAA,CAAwB,yBAClC,KAAK;;WAEM;;;;;iBA4TS,iBAAA,UACX,iCACA,wBACR,QAAQ"}
|
package/dist/runner/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
-
*/
|
|
5
|
-
import { DispatcherMessage, RunnerMessage } from "@execbox/core/protocol";
|
|
6
|
-
|
|
7
|
-
//#region src/runner/protocolEndpoint.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Minimal worker-side port used by the shared QuickJS protocol endpoint.
|
|
11
|
-
*/
|
|
12
|
-
interface QuickJsProtocolPort {
|
|
13
|
-
onMessage(handler: (message: DispatcherMessage) => void): void | (() => void);
|
|
14
|
-
send(message: RunnerMessage): void;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Attaches the shared QuickJS protocol loop to a worker messaging port.
|
|
18
|
-
*/
|
|
19
|
-
declare function attachQuickJsProtocolEndpoint(port: QuickJsProtocolPort): () => void;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { QuickJsProtocolPort, attachQuickJsProtocolEndpoint };
|
|
22
|
-
//# sourceMappingURL=protocolEndpoint.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocolEndpoint.d.cts","names":[],"sources":["../../src/runner/protocolEndpoint.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAmBA,CAAA,CAAA;AAQgB,SAAA,CARC,mBAAA,CAQ4B;+BAPd;gBACf;;;;;iBAMA,6BAAA,OACR"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* Public TypeScript declarations for this package entrypoint.
|
|
4
|
-
*/
|
|
5
|
-
import { DispatcherMessage, RunnerMessage } from "@execbox/core/protocol";
|
|
6
|
-
|
|
7
|
-
//#region src/runner/protocolEndpoint.d.ts
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Minimal worker-side port used by the shared QuickJS protocol endpoint.
|
|
11
|
-
*/
|
|
12
|
-
interface QuickJsProtocolPort {
|
|
13
|
-
onMessage(handler: (message: DispatcherMessage) => void): void | (() => void);
|
|
14
|
-
send(message: RunnerMessage): void;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Attaches the shared QuickJS protocol loop to a worker messaging port.
|
|
18
|
-
*/
|
|
19
|
-
declare function attachQuickJsProtocolEndpoint(port: QuickJsProtocolPort): () => void;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { QuickJsProtocolPort, attachQuickJsProtocolEndpoint };
|
|
22
|
-
//# sourceMappingURL=protocolEndpoint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocolEndpoint.d.ts","names":[],"sources":["../../src/runner/protocolEndpoint.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAmBA,CAAA,CAAA;AAQgB,SAAA,CARC,mBAAA,CAQ4B;+BAPd;gBACf;;;;;iBAMA,6BAAA,OACR"}
|