Web SDK Phase 8.0: WASM core (core/web-sdk)#10
Merged
Conversation
Adds core/web-sdk — the browser sibling of core/mobile-sdk: the shared core (policy, realtime, skills) exposed to JS via wasm-bindgen. Mirrors the mobile-sdk binding pattern and ADDS composePrompt (web widget composes the teaching prompt client-side). Design: Web* serde mirror types + pure *_impl functions are always compiled and host-testable; wasm-bindgen glue + deps are gated to target_arch=wasm32 so cargo test --workspace stays green on macOS with no wasm toolchain. Validated (host): cargo test -p skilly-core-web-sdk = 4 passed, incl. compose_prompt_web_matches_core_skills_fixture (byte-identical to core/skills). cargo check --workspace green. The wasm32 compile runs via wasm-pack/CI (scripts/build-web-sdk.sh) — local Homebrew+rustup toolchain conflict prevented a local wasm build; not a code issue. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…flict Root cause: on a host with both Homebrew rust and rustup, the toolchain cargo resolves rustc from PATH (Homebrew's, no wasm32 std) -> 'can't find crate for core'. Fix: build-web-sdk.sh now pins RUSTC/PATH to the rustup toolchain. Verified end-to-end: wasm-pack produces a ~195KB optimized wasm + JS + .d.ts exposing canStartTurn/trialIsExhausted/usageIsOverCap/composePrompt/replayRealtimeEvents. sdk/web/generated/ is gitignored (regenerated by the script / CI). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
First slice of the Web SDK plan (
docs/architecture/web-sdk-prd.md). The shared Rust core compiled for the browser — the third binding target of the same core, alongside desktop FFI and mobile UniFFI.What's in it
core/web-sdk— browser sibling ofcore/mobile-sdk:policy+realtime+skillsexposed to JS viawasm-bindgen.composePrompt(not in the mobile surface) — the browser widget composes the host site's teaching prompt client-side.scripts/build-web-sdk.sh(wasm-pack→sdk/web/generated/),sdk/web/README, AGENTS.md docs.Design (keeps the workspace green on macOS)
Pure
*_implfunctions +Web*serde types are always compiled and host-testable; thewasm-bindgenglue and its deps are gated totarget_arch = "wasm32". Socargo test --workspaceneeds no wasm toolchain.Validation
cargo test -p skilly-core-web-sdk→ 4 passed, includingcompose_prompt_web_matches_core_skills_fixture(reuses the sharedcore/skillsfixture → proves the web prompt is byte-identical to the core, hence to desktop/mobile).cargo check --workspacegreen.wasm-pack/CI. A local Homebrew+rustup toolchain conflict (can't find crate for core) blocked a local wasm build — environment, not code; the wrappers are standardserde-wasm-bindgen.Not in this slice (Phase 8.1+)
The
@skilly/webwidget (Shadow-DOM overlay, DOM digest, selector pointing, voice pipeline) and the multi-tenant Next.js backend.