at main
6 folders
13 files
Let plugins run declared-provenance WASM, with a host binary cache
Adds wasm-unsafe-eval to the plugin sandbox CSP, without which no plugin
can execute WebAssembly at all. Unlocking that alone would let a plugin
ship an inscrutable compiled blob with no way for a user (or a plugin
reviewer) to know where it came from, so a manifest "executables" table
(name, sourceUrl, sha256) is required and enforced by a prelude injected
into the worker that hashes any bytes handed to WebAssembly.instantiate/
compile/Module and refuses anything undeclared - deliberately a
provenance pointer, not an openness/license check.
Also adds app.binaryCache, a host-mediated persistent store (Cache API
backed, namespaced per plugin) for large downloads like a WASM engine
or model file, since the plugin sandbox's own worker/iframe has an
opaque origin and can't reliably cache such things itself.
Builds on the binary-safe fetch() fix (separate PR/commit), since the
binary cache moves bytes across the same base64-over-postMessage
boundary that fix introduced.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>