Run plugins in a QuickJS sandbox in the browser

Adds packages/plugin-sandbox: QuickJS-ng compiled to wasm, running in a
dedicated worker, with a runtime shell inside it that loads a plugin bundle
and answers the same InternalEventPayload events the Node runtime answers.
Plugins are unmodified.

Wires the browser host's template function, authentication, cURL import and
template render commands to it, and relaxes TemplateCallback's Send bound on
wasm32 so the engine's renderer can call back out to a plugin.
This commit is contained in:
Gregory Schier
2026-08-17 18:48:21 -07:00
parent 83325971ec
commit 422b1724c9
37 changed files with 3250 additions and 136 deletions
+17
View File
@@ -0,0 +1,17 @@
{
"name": "@yaakapp-internal/plugin-sandbox",
"version": "1.0.0",
"private": true,
"main": "src/index.ts",
"scripts": {
"bootstrap": "npm run build",
"build": "node build-guest.mjs"
},
"dependencies": {
"@jitl/quickjs-ng-wasmfile-release-sync": "^0.32.0",
"quickjs-emscripten-core": "^0.32.0"
},
"devDependencies": {
"esbuild": "^0.28.0"
}
}