actr_cli/web_assets.rs
1//! Embedded web runtime assets for `actr run --web`.
2//!
3//! These files are compiled into the `actr` binary so that `actr run --web`
4//! can serve a fully self-contained web actor host without requiring any
5//! external runtime WASM files, JS glue, or HTML pages.
6//!
7//! Assets:
8//! - `actr_sw_host_bg.wasm` — shared SW host WASM (wasm-pack from sw-host)
9//! - `actr_sw_host.js` — wasm-bindgen JS glue for the SW host
10//! - `actor.sw.js` — Service Worker entry point (Option U /
11//! wasm-bindgen guest path; sole browser path after Phase 8)
12//! - `actr-host.html` — self-contained host page with inline @actr/dom
13
14/// Shared SW host WASM binary (compiled from actr-sw-host via wasm-pack).
15pub const RUNTIME_WASM: &[u8] = include_bytes!(concat!(
16 env!("OUT_DIR"),
17 "/web-runtime/actr_sw_host_bg.wasm"
18));
19
20/// wasm-bindgen JS glue for the shared SW host.
21pub const RUNTIME_JS: &str = include_str!(concat!(env!("OUT_DIR"), "/web-runtime/actr_sw_host.js"));
22
23/// Service Worker entry point — wasm-bindgen guest bridge (Option U).
24pub const ACTOR_SW_JS: &str = include_str!("../assets/web-runtime/actor.sw.js");
25
26/// Self-contained HTML host page with inline @actr/dom (WebRTC coordinator).
27pub const HOST_HTML: &str = include_str!("../assets/web-runtime/actr-host.html");