WebAssembly Setup

Install the complete local browser runtime and prepare its browser environment

Full browser runtime

The browser examples use the shared Rust executor through @kaya/browser-runtime, a typed local client and module Worker. Choose Start browser runtime, then run the credential-free basic example or configure your own model for the unchanged homepage example. Starting the runtime does not make a model request. The full /try IDE is a separate milestone.

The supported environment is Chromium on a secure origin (HTTPS or localhost), with module Workers, OPFS, Web Locks and BigInt. SQLite is a separate WASM module; the current backend does not require cross-origin isolation headers. Other browsers need their own qualification. Another tab owning the same namespace must close before this tab can acquire it.

WebAssembly runtime downloads

Verified browser runtime v0.1.0

Exact compiled source: b223c2f135b93076e8e81b76db37a4a6fb1bf7c6 (feat-release-0-1-0-frozen-source)

Third-party notices

Serve the complete extracted runtime over HTTPS or localhost. The qualified host is Chromium with module Workers, OPFS, Web Locks and BigInt. Keep all SQLite, regex, declarations and notice files together. Static consumers need no Bun, Node or daemon. Model endpoints require compatible CORS and your own private credentials.

When a verified archive is offered above, download it and compare its SHA-256 and byte size with the displayed values and immutable checksums. Extract the complete archive into an empty directory and serve that directory unchanged. The archive includes the original build manifest, declarations, license terms, third-party notices, module Workers and every adjacent WASM/snippet asset. Do not copy just index.js or the main WASM file. Use the original build manifest to identify the compiled source and the outer release manifest to identify the public cohort. No npm installation or native installer is needed to consume it.

For example, point the existing typed client at your extracted static directory as shown in WebAssembly Usage. Static runtime consumers need no Bun, Node, Cargo or HTTP daemon. Bun and the locked Rust tools are needed only when building the distribution from source.

Install from a source checkout

Build the complete static distribution using the repository's locked toolchain:

bun run --cwd packages/kaya-browser-runtime build:distribution -- /absolute/empty/runtime

Serve that complete directory from your page's secure origin. Keep index.js, worker.js, browser-services.js, runtime/ and all adjacent SQLite/regex assets, manifest, declarations and notices together with their relative paths intact. The public loader checks each inventoried byte and digest before starting its Worker. Use assetBaseURL if your application bundles the client separately.

These are source-checkout instructions, not a published npm command. Download availability is determined by the verified selection above. The website stages an already built, verified cohort at /kaya-runtime/; staging and later production publication are separately reviewed actions. The native installer does not install browser assets. Check release availability before using any public download link.

Private model setup

The example's Model setup form accepts your endpoint, upstream model and API key for the supported OpenAI Chat Completions protocol. The endpoint must allow requests from this page's origin through CORS. Other supported protocols can use the original native-format configuration form. Availability and session grants remain separate; the displayed catalog contains only actually admitted operations.

Save atomically validates and stores private setup for future initialization. The UI waits for the original runtime to close, then explicitly reopens saved setup. The getter reports presence only: it never returns authored documents, environment values, headers, profile comments or named secrets. Replacing setup uses new explicit input, with no private prefill. Origin-private storage is not encryption against other scripts with access to that origin.

Reset removes this owner's saved setup and closes the original runtime before acknowledging success; it preserves sessions and files. Storage or cleanup refusals remain real errors. No website server key or paid provider is supplied.

See WebAssembly Usage for the status of running programs and interacting with browser sessions.

Current components

Workspace packageJavaScript hostPurpose
@kaya/syntax-wasmNode/Bun, or a bundler configured for CommonJS and Buffer.Tokenize, parse and analyze Kaya source using Rust.
@kaya/presentationBrowser-safe JavaScript.Project durable history into presentation state, synchronize pages and parse markdown.
@kaya/presentation-webBrowser application with explicit host ports.Web Components and browser ports over the Rust presentation kernel.

These names identify source workspace packages, not published npm installation commands. Check release availability for verified artifacts. The standalone installer supplies native executables, not browser packages.

In a checkout with repository access, packages/kaya-syntax-wasm/pkg/ contains committed JavaScript, embedded WASM, type declarations and a source fingerprint. Consumers do not need Rust to use those outputs. The generated JavaScript uses CommonJS exports and require, and decodes bytes with Buffer.from. A plain browser module import does not provide these APIs. Browser bundling must supply and validate them; this package does not currently provide a browser ESM carrier.

The presentation wrapper at packages/kaya-presentation initializes embedded WASM synchronously without a network fetch or Node Buffer. Keep the generated JavaScript, wrappers, contracts, assets and licenses from the same revision. See component usage for the boundary between these components and full program execution.

For command-line use, follow Command Line Installation.