Browser-isolated runtime packs for Block polyglot stages. This repository is
separate from Block_lang on purpose: Block owns parsing, source order, native
execution, and the CLI; this project executes one already-parsed non-native
stage and returns bounded JSON state.
The first supported packs are:
- Python 3.14 through Pyodide 314.0.5.
- In-memory SQLite through SQLite Wasm 3.53.0-build1.
No server starts user processes. Each stage runs in a fresh Web Worker on a dedicated, credential-free runtime origin. The embedding application can stop the job by terminating that worker.
Requires Node.js 22 or newer.
npm install
npm run vendor
npm test
npm run check
npm run serveOpen http://127.0.0.1:4174/. The demo deliberately loads the runner from
http://localhost:4174/ so the editor and runtime have different origins.
import { BlockRuntimeClient } from './src/host-client.mjs';
const runtime = new BlockRuntimeClient({
runnerUrl: 'https://block-web-runtime.pages.dev/runner.html'
});
await runtime.connect();
const result = await runtime.runStage({
runtime: 'python',
code: 'answer = total * 2\nprint(answer)',
state: { total: 21 }
});Do not host runner.html on the same origin as an authenticated editor. See
docs/ARCHITECTURE.md and
docs/BLOCK-INTEGRATION.md.
This is browser containment, not a VM. It protects the Block website and avoids server-side multi-tenant execution, but it cannot provide native process, memory, filesystem, socket, or compiler compatibility. Those features remain desktop-only until Block has a reviewed per-job container service.
Block Web Runtime source is MIT licensed. Runtime dependencies retain their
own licenses; see THIRD_PARTY_NOTICES.md.