Skip to content

Web SDK Phase 8.0: WASM core (core/web-sdk)#10

Merged
engmsaleh merged 2 commits into
developfrom
feature/web-sdk-8.0-wasm-core
Jun 3, 2026
Merged

Web SDK Phase 8.0: WASM core (core/web-sdk)#10
engmsaleh merged 2 commits into
developfrom
feature/web-sdk-8.0-wasm-core

Conversation

@engmsaleh
Copy link
Copy Markdown
Collaborator

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 of core/mobile-sdk: policy + realtime + skills exposed to JS via wasm-bindgen.
  • Adds composePrompt (not in the mobile surface) — the browser widget composes the host site's teaching prompt client-side.
  • scripts/build-web-sdk.sh (wasm-packsdk/web/generated/), sdk/web/ README, AGENTS.md docs.

Design (keeps the workspace green on macOS)

Pure *_impl functions + Web* serde types are always compiled and host-testable; the wasm-bindgen glue and its deps are gated to target_arch = "wasm32". So cargo test --workspace needs no wasm toolchain.

Validation

  • cargo test -p skilly-core-web-sdk4 passed, including compose_prompt_web_matches_core_skills_fixture (reuses the shared core/skills fixture → proves the web prompt is byte-identical to the core, hence to desktop/mobile).
  • cargo check --workspace green.
  • The wasm32 compile runs via 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 standard serde-wasm-bindgen.

Not in this slice (Phase 8.1+)

The @skilly/web widget (Shadow-DOM overlay, DOM digest, selector pointing, voice pipeline) and the multi-tenant Next.js backend.

engmsaleh and others added 2 commits June 3, 2026 06:43
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>
@engmsaleh engmsaleh merged commit ddc09f5 into develop Jun 3, 2026
16 checks passed
@engmsaleh engmsaleh deleted the feature/web-sdk-8.0-wasm-core branch June 3, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant