nx_video_ui_core.nx
buildroot/runtime/nx_video_ui_core.nx
about
nx_video_ui_core.nx -- SOVEREIGN call-UI state machine. NO browser, NO WebSocket, NO getUserMedia, NO
WebAssembly-host, NO navigator, NO addEventListener anywhere. Owns the call's interaction LOGIC as pure
INTENTS over a flat state region (operator 2026-07-04: "we need this to work on NishiOS + the Nishi
browser without third parties -- build with that in mind"). The browser is ONE throwaway adapter (click
-> intent, WebSocket frame -> transport call, camera frame -> media call); NishiOS is ANOTHER adapter
over the SAME core. State is a FLAT i64[6] region (not a struct) so it compiles to WASM (browser last
mile) AND native (NishiOS) from this one source -- the WAT backend is flat memory + i64. The browser
passes a linear-memory offset; the native gate passes an mmap'd buffer. Because the logic is
intents-over-state (no host API), it is verified SOVEREIGNLY -- drive intents + assert state/layout
(nx_video_ui_core_gate), not by simulating DOM events. That survives the NishiOS transition.
license_tier: ORIGINAL
dependencies 0 imports · 2 importers
imports: none
imported by: nx_video_client_wasm.nxnx_video_ui_core_gate.nx
structs
| none |
consts
| 14 | const UST_PEERS: i64 = 0 // remote peer count (self implicit) |
| 15 | const UST_MIC: i64 = 1 |
| 16 | const UST_CAM: i64 = 2 |
| 17 | const UST_SWAP: i64 = 3 // DUO: is the self tile the full-screen one (tap-to-swap) |
| 18 | const UST_SHARE: i64 = 4 // screen-share active |
| 19 | const UST_CHAT: i64 = 5 // chat panel open |
| 20 | const UST_LEN: i64 = 6 |
| 24 | const UI_TOGGLE_MIC: i64 = 1 |
| 25 | const UI_TOGGLE_CAM: i64 = 2 |
| 26 | const UI_PEER_JOIN: i64 = 3 |
| 27 | const UI_PEER_LEAVE: i64 = 4 |
| 28 | const UI_SWAP_VIEW: i64 = 5 |
| 29 | const UI_TOGGLE_SHARE: i64 = 6 |
| 30 | const UI_TOGGLE_CHAT: i64 = 7 |
| 34 | const LAYOUT_SOLO: i64 = 1 // just me |
| 35 | const LAYOUT_DUO: i64 = 2 // exactly 2 -> remote full-screen + self PiP corner (+ tap-to-swap) |
| 36 | const LAYOUT_GRID: i64 = 3 // 3+ -> equal tiles |
functions
| 38 | func uic_init(s: *i64) -> i64 called by 1: main |
| 44 | func uic_set_peers(s: *i64, n: i64) -> i64 calls 1: uic_layout |
| 52 | func uic_layout(s: *i64) -> i64 |
| 60 | func uic_intent(s: *i64, intent: i64) -> i64 |
| 72 | func uic_mic(s: *i64) -> i64 { return s[UST_MIC] } called by 1: main |
| 73 | func uic_cam(s: *i64) -> i64 { return s[UST_CAM] } called by 1: main |
| 74 | func uic_peers(s: *i64) -> i64 { return s[UST_PEERS] } |
| 75 | func uic_swapped(s: *i64) -> i64 { if uic_layout(s) == LAYOUT_DUO { return s[UST_SWAP] } return 0 } |
| 76 | func uic_sharing(s: *i64) -> i64 { return s[UST_SHARE] } |
| 77 | func uic_chat_open(s: *i64) -> i64 { return s[UST_CHAT] } |