diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 86c2b07..000d4d3 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -468,9 +468,18 @@ multi-modal payloads (text inline, audio/photo/data via `iroh-blobs`). Receiving - [ ] Rotatable rooms/keys/identities + stable-handle directory indirection. - [ ] Private discovery (OPRF/PSI lookup; ZKP ownership proofs). - [ ] Capability model (UCAN); offline mailbox. -- [~] **Web client = `tethercore` on `wasm32`** — relay-only iroh peer, same - core, no server bridge. **The core now COMPILES to wasm32** (`build-web.sh` - → `tethercore.wasm`); native is byte-unaffected. +- [x] **Web client = `tethercore` on `wasm32`** — relay-only iroh peer, same + core, no server bridge. **Compiles AND verified syncing**: text typed in a + browser tab lands on the Mac clipboard and vice-versa, cross-relay, with the + wasm engine running as a relay-only iroh peer (`build-web.sh` → + `tethercore.wasm` + `web/index.html` demo). Native is byte-unaffected. + Two wasm-specific bugs had to be fixed to get delivery (both in the + browser-sync commit): + • `Engine::send` panicked — `directly_covered()` → `Instant::now()` traps on + wasm32-unknown-unknown; `web-time` backs it with `Performance.now()`. + • Gossip island — a node that bootstrapped its topic alone never pulled + later-joining peers into its active view; the rendezvous re-register loop + now seeds peer relay addrs + `GossipSender::join_peers` each round. - [x] Deps target-split (native-only transports/UniFFI/native-reqwest under `cfg(not(wasm32))`; wasm gets fetch-reqwest + wasm-bindgen-futures). - [x] **UniFFI decoupled** — all FFI macros `cfg_attr`'d to native; wasm @@ -481,9 +490,10 @@ multi-modal payloads (text inline, audio/photo/data via `iroh-blobs`). Receiving across `Transport`/Engine: tokio runtime on native, `spawn_local` on wasm. IrohTransport's timers use `n0-future` (no tokio::time on wasm). - [x] reqwest `.timeout()` cfg'd to native. - - [ ] **wasm-bindgen JS surface + browser shim** — expose Engine/handler to - JS, then a minimal browser smoke test. Relay-only in-browser - (no holepunch in the sandbox). + - [x] **wasm-bindgen JS surface + browser shim** — `WasmEngine` + + `roomForAccount` exposed to JS (`src/wasm.rs`); `web/index.html` is the + smoke test. Relay-only in-browser (no holepunch in the sandbox) — + confirmed: browser↔Mac clipboard syncs both ways over the n0 relay. - [ ] Toolchain note: the wasm build needs a wasm-capable clang for ring (Homebrew LLVM) + the getrandom rustflag — both wired in `build-web.sh`. - [ ] **Retire the Go server** once IrohTransport wins — replace with a