Flagship cross-profile chat example (portable, metal).
- One app scenario implemented across both supported compiler profiles.
- Typed runtime boundary (
ChatRuntime) with local and network-backed flows. - Interactive TUI UX plus deterministic headless CI test mode.
- In-frame diagnostics (
diag stream) so transport/activity signals stay inside the TUI. - Channel-scoped timeline rendering (
#ops,#compiler,#shiproom,#nightwatch) so each room has its own feed. - Presence-driven activity log (
online/offline) shown in its own TUI frame. - Momentum celebration effect: each room tracks momentum independently; hitting
100triggers a temporary full-frame center-origin particle burst (colorized ASCII particles, emoji headline when enabled) and resets that room’s momentum so it can be earned again. - Realtime history-sync behavior that imports new messages once (no repeated full-history spam lines).
- Presence heartbeats + timeout pruning so closed instances disappear from the operator list automatically.
When you run the normal (non-.ci) build:
- The app tries to connect to
127.0.0.1:7000. - If no room exists yet, it auto-starts a local host room and joins it.
- Later instances on the same machine auto-join that same room.
This gives a shared multi-instance chat experience by default.
Note: this is a localhost room-host topology (one host + many clients), not full mesh peer-to-peer.
Terminal 1:
cd examples/chat_loopback
npx haxe compile.hxml
(cd out && cargo run -q)Terminal 2:
cd examples/chat_loopback/out
cargo run -qEach instance gets an auto-generated funny name. Presence updates are automatic; /history is still available for manual refresh.
Use the repo cargo alias with flags instead of adding many task HXML files:
cargo hx dev
cargo hx run --profile portable
cargo hx run --profile metal
cargo hx test --profile portable --ci
cargo hx build --profile metal --release
# or from repo root:
# cargo hx run --project examples/chat_loopbackThis keeps profile selection in existing compile.<profile>.hxml files while build/run/test behavior is selected via cargo flags.
Tabcycles channels.Ctrl+Htoggles the help modal.?is regular text now (it does not open help by itself).Ctrl+Corqexits.
--server [port]- Start a dedicated shared room host.
--connect <host:port|port>- Connect as a client only.
- Fails with an explicit error if the endpoint is unreachable.
--local- Force fully local single-process runtime (no shared network room).
Server connect/disconnect diagnostics are disabled by default so background socket logs do not corrupt the TUI frame.
- Enable them only when debugging transport behavior:
-D chat_server_logs.
compile.*.ci.hxml defines chat_tui_headless for deterministic CI behavior.
In headless mode, the app intentionally does not auto-host and exits quickly after a bounded tick window.
Use non-.ci builds for real interactive multi-instance chat.