Skip to main content

sim_lib_web_bridge/
lib.rs

1//! Session and transport bridge over `realize`/`EvalFabric`: the Intent/Scene
2//! bus for the SIM Web-UI (WEBUI_4).
3//!
4//! The bridge connects the browser shell to any runtime, location-transparently,
5//! by targeting `realize_events`/`realize_final` rather than a transport-specific
6//! API. Four interchangeable transports sit behind one trait: in-browser wasm,
7//! local server, remote server, and fixture/cassette sessions for deterministic
8//! tests. Both a human (through the browser) and an agent (through the agent
9//! runner) are peers on this same bus.
10//!
11//! This crate provides the [`transport`] contract and session status, the
12//! deterministic [`fixture`] transport, the network [`remote`] transports, and
13//! the [`session`] bus with per-pane subscriptions and Scene-diff streaming.
14
15#![forbid(unsafe_code)]
16#![deny(missing_docs)]
17
18pub mod fabric;
19pub mod fixture;
20pub mod history;
21pub mod host;
22pub mod placement;
23pub mod remote;
24pub mod session;
25pub mod sync;
26pub mod transport;
27
28pub use fabric::{FabricTransport, operation_to_request};
29pub use fixture::FixtureTransport;
30pub use history::{History, SessionLog, Snapshots, annotate};
31pub use host::{DesktopHost, PHONE_PANE, PhoneHost};
32pub use placement::{
33    BrowserBridgeLane, BrowserPlacementReport, BrowserPlacementRequest, BrowserWasmEngine,
34    BrowserWasmEntryPoints, browser_audio_worklet_entry_symbol,
35    browser_server_only_refusal_diagnostic, browser_wasm_engine_entry_symbol,
36    browser_wasm_site_symbol,
37};
38pub use remote::RemoteTransport;
39pub use session::{SceneUpdate, Session};
40pub use sync::{Broadcast, EditRow, SurfaceHub, replay};
41pub use transport::{
42    BrowserStreamStatus, ChangeEvent, SessionStatus, StreamInspectorRecord, Transport,
43    TransportKind, WebStreamOperation, web_stream_operation_capability_names,
44    web_stream_operation_symbols,
45};
46
47/// Stable symbol for the session value carried on the bus.
48pub const SESSION_CLASS: &str = "web:Session";
49
50#[cfg(test)]
51mod history_tests;
52#[cfg(test)]
53mod placement_tests;
54#[cfg(test)]
55mod replay_tests;
56#[cfg(test)]
57mod tests;