Repository navigation
feat(wasm): add Python and TypeScript runtime host functions - #2743
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 6b5cafc | Commit Preview URL Branch Preview URL |
Oct 16 2026, 10:57 PM |
chaliy
force-pushed
the
feat/browser-runtime-host-functions
branch
from
October 16, 2026 21:58
a1bfb18 to
4a54c8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Browser hosts can import
@everruns/bashkit-wasm/runtimesto enable embedded Python and TypeScript with synchronous or asynchronous named host functions. Calls preserve each execution's caller context and receive an AbortSignal. Buffered execution, live command pipelines, byte sinks and bounded capture share the same execution-local dispatcher.The default import keeps its slim binary and transfer-size budgets. Both bundles ship in the same npm archive. Terminal can use the embedded runtimes but rejects host-function registration.
Why
Complete browser callback parity after the Python and native JavaScript SDKs (#2739, #2740), including interaction with live command I/O (#2741), without SharedArrayBuffer or cross-origin isolation.
Before / After
Before: the browser package could not run embedded Python or TypeScript or dispatch their host functions.
After: both runtimes return 42 through asynchronous host callbacks, including HTTP fetch and live byte sinks in Chromium main threads and module workers.
Local verification: 76 slim-package tests, 24 runtime tests, real Chromium main-thread/worker streaming and runtime checks, strict TypeScript declarations, npm archive imports, wasm-target Clippy and package transfer-size gates pass. A regression proves that dropping runtime execution options loses sinks/capture; the integrated dispatcher preserves them. Tests also cover pending-host cancellation/reuse, sink completion/deadlines, caller-context separation, concurrent calls, reset-preserved commands, JSON validation, VFS and persistence. Full local pre-PR checks, all-target/all-feature Clippy, feature-sliced Rust/fail-point tests and the parallel benchmark pass on the combined tree; final CI is running.
Risk
Medium: optional VM bundle and async callbacks. Python host waits use the portable timeout abstraction. ZapCode 1.5.1 uses unsupported standard clocks on browser WASM, so only that target uses a source copy with namespace and platform-clock substitutions; native/WASI retain upstream. CI verifies every upstream source hash, complete file inventory and native version alignment. Deadlines remain enabled. Host I/O must observe cancellation; text observers reject mixed live options before execution.
Checklist