diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 7c31cdc..86c2b07 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -469,25 +469,23 @@ multi-modal payloads (text inline, audio/photo/data via `iroh-blobs`). Receiving - [ ] 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. (Correction: it's more *project* than *build - target* — see below.) - - [x] **Groundwork done** — deps are target-split: native-only transports - (tokio-net/mdns/webrtc) + UniFFI + native reqwest under - `cfg(not(wasm32))`; wasm gets minimal tokio + fetch-reqwest + - wasm-bindgen-futures + iroh (`default-features=false`). SSE/RTC/LAN - gated to native; getrandom wasm rng wired. `cargo build --target - wasm32-unknown-unknown --features iroh-transport` now reaches - tethercore's own code: **15 errors, 4 structural clusters.** Native - unaffected. - - [ ] **Decouple UniFFI** (10 errs) — the FFI macros are on every public - item; gate them out for wasm and add a `wasm-bindgen` surface instead. - - [ ] **iroh wasm feature set** (2 errs) — `default-features=false` strips - `presets::N0` / `iroh_gossip::net`; find the right wasm features. - - [ ] **Runtime** (1 err) — the engine builds a tokio multi-thread runtime; - wasm needs `spawn_local` + `?Send` futures (the real refactor — the - `Transport`/spawn signatures differ by target). - - [ ] **reqwest `.timeout()`** (1 err) — not on the fetch backend; cfg it out. - - [ ] Then `wasm-bindgen` + a JS shim; relay-only in-browser (no holepunch). + core, no server bridge. **The core now COMPILES to wasm32** (`build-web.sh` + → `tethercore.wasm`); native is byte-unaffected. + - [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 + will bind via wasm-bindgen. + - [x] **iroh on wasm** — `default-features=false` + `tls-ring` (ring builds + for wasm with a wasm clang) + `iroh-gossip/net`; getrandom `wasm_js`. + - [x] **Runtime abstraction** — a `Spawner` replaces the tokio `Handle` + 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). + - [ ] 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 self-hosted iroh-relay (supernode #1) + a tiny gossip-bootstrap rendezvous.