code wiki / (root) / nx_video_ui_core.nx

nx_video_ui_core.nx

buildroot/runtime/nx_video_ui_core.nx

4465 B77 linesdepth 0pulls 0 transitivereach 16 importersview sourcekind librarytopic video
docsdependenciesstructsconstsfunctions

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

nx_video_ui_core.nx nx_video_client_wasm.nx nx_video_ui_core_gate.nx

imports: none

imported by: nx_video_client_wasm.nxnx_video_ui_core_gate.nx

structs

none

consts

14const UST_PEERS: i64 = 0 // remote peer count (self implicit)
15const UST_MIC: i64 = 1
16const UST_CAM: i64 = 2
17const UST_SWAP: i64 = 3 // DUO: is the self tile the full-screen one (tap-to-swap)
18const UST_SHARE: i64 = 4 // screen-share active
19const UST_CHAT: i64 = 5 // chat panel open
20const UST_LEN: i64 = 6
24const UI_TOGGLE_MIC: i64 = 1
25const UI_TOGGLE_CAM: i64 = 2
26const UI_PEER_JOIN: i64 = 3
27const UI_PEER_LEAVE: i64 = 4
28const UI_SWAP_VIEW: i64 = 5
29const UI_TOGGLE_SHARE: i64 = 6
30const UI_TOGGLE_CHAT: i64 = 7
34const LAYOUT_SOLO: i64 = 1 // just me
35const LAYOUT_DUO: i64 = 2 // exactly 2 -> remote full-screen + self PiP corner (+ tap-to-swap)
36const LAYOUT_GRID: i64 = 3 // 3+ -> equal tiles

functions

38func uic_init(s: *i64) -> i64
called by 1: main
44func uic_set_peers(s: *i64, n: i64) -> i64
calls 1: uic_layout
52func uic_layout(s: *i64) -> i64
60func uic_intent(s: *i64, intent: i64) -> i64
called by 1: main calls 1: uic_layout
72func uic_mic(s: *i64) -> i64 { return s[UST_MIC] }
called by 1: main
73func uic_cam(s: *i64) -> i64 { return s[UST_CAM] }
called by 1: main
74func uic_peers(s: *i64) -> i64 { return s[UST_PEERS] }
75func uic_swapped(s: *i64) -> i64 { if uic_layout(s) == LAYOUT_DUO { return s[UST_SWAP] } return 0 }
called by 1: main calls 1: uic_layout
76func uic_sharing(s: *i64) -> i64 { return s[UST_SHARE] }
77func uic_chat_open(s: *i64) -> i64 { return s[UST_CHAT] }