@execbox/quickjs 0.1.0 → 0.1.2
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 +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/runner/index.cjs +1 -1
- package/dist/runner/index.d.cts.map +1 -1
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +1 -1
- package/dist/runner/protocolEndpoint.cjs +38 -1
- package/dist/runner/protocolEndpoint.cjs.map +1 -1
- package/dist/runner/protocolEndpoint.d.cts.map +1 -1
- package/dist/runner/protocolEndpoint.d.ts.map +1 -1
- package/dist/runner/protocolEndpoint.js +38 -1
- package/dist/runner/protocolEndpoint.js.map +1 -1
- package/dist/{runner-CYXIVOmJ.cjs → runner-9_N9h2rp.cjs} +15 -2
- package/dist/runner-9_N9h2rp.cjs.map +1 -0
- package/dist/{runner-DVOLiGt4.js → runner-O4f_FOhI.js} +15 -2
- package/dist/runner-O4f_FOhI.js.map +1 -0
- package/package.json +3 -3
- package/dist/runner-CYXIVOmJ.cjs.map +0 -1
- package/dist/runner-DVOLiGt4.js.map +0 -1
|
@@ -5395,10 +5395,23 @@ function injectProviders(context, providers, signal, trustedHostErrorKey, onTool
|
|
|
5395
5395
|
function createToolHandle(context, providerName, safeToolName, signal, trustedHostErrorKey, onToolCall) {
|
|
5396
5396
|
return context.newFunction(safeToolName, (...args) => {
|
|
5397
5397
|
const deferred = context.newPromise();
|
|
5398
|
-
const input = args[0] === void 0 ? void 0 : context.dump(args[0]);
|
|
5399
5398
|
const disposeDeferred = () => {
|
|
5400
5399
|
if (context.alive && deferred.alive) deferred.dispose();
|
|
5401
5400
|
};
|
|
5401
|
+
let input;
|
|
5402
|
+
try {
|
|
5403
|
+
input = args[0] === void 0 ? void 0 : fromGuestHandle(context, args[0]);
|
|
5404
|
+
} catch (error) {
|
|
5405
|
+
const executeError = isExecuteFailure(error) ? error : new ExecuteFailure("serialization_error", "Guest code passed a non-serializable tool input");
|
|
5406
|
+
const errorHandle = createGuestErrorHandle(context, executeError.code, executeError.message, trustedHostErrorKey);
|
|
5407
|
+
try {
|
|
5408
|
+
deferred.reject(errorHandle);
|
|
5409
|
+
return deferred.handle;
|
|
5410
|
+
} finally {
|
|
5411
|
+
errorHandle.dispose();
|
|
5412
|
+
queueMicrotask(disposeDeferred);
|
|
5413
|
+
}
|
|
5414
|
+
}
|
|
5402
5415
|
const onAbort = () => {
|
|
5403
5416
|
signal.removeEventListener("abort", onAbort);
|
|
5404
5417
|
if (!context.alive || !deferred.alive) {
|
|
@@ -5554,4 +5567,4 @@ async function runQuickJsSession(request, options = {}) {
|
|
|
5554
5567
|
|
|
5555
5568
|
//#endregion
|
|
5556
5569
|
export { runQuickJsSession as t };
|
|
5557
|
-
//# sourceMappingURL=runner-
|
|
5570
|
+
//# sourceMappingURL=runner-O4f_FOhI.js.map
|