mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
WEFT OS is a Wayland compositor and application runtime where every app is a WebAssembly component rendered in an isolated Servo WebView.
Implements the weft-appd WebSocket server that allows the system-ui.html page running inside Servo to send requests and receive push notifications without requiring custom SpiderMonkey bindings. ws.rs — WebSocket connection handler: - Accepts a tokio TcpStream, performs WebSocket handshake via tokio-tungstenite accept_async. - Reads JSON Text frames, deserializes as Request (serde_json), calls dispatch(), sends Response as JSON Text. - Subscribes to a broadcast::Receiver<Response> for server-push notifications (APP_READY, etc.); forwards to client via select!. - Handles close frames, partial errors, and lagged broadcast gracefully. main.rs — server changes: - broadcast::channel(16) created at startup; WebSocket handlers subscribe for push delivery. - TcpListener bound on 127.0.0.1:7410 (default) or WEFT_APPD_WS_PORT. - ws_port() / write_ws_port(): port written to XDG_RUNTIME_DIR/weft/appd.wsport for runtime discovery. - WS accept branch added to the main select! loop alongside Unix socket. ipc.rs — Response and AppStateKind now derive Clone (required by broadcast::Sender<Response>). system-ui.html — appd WebSocket client: - appdConnect(): opens ws://127.0.0.1:<port>/appd with exponential backoff reconnect (1s → 16s max). - On open: sends QUERY_RUNNING to populate taskbar with live sessions. - handleAppdMessage(): maps LAUNCH_ACK and RUNNING_APPS to taskbar entries; APP_READY shows a timed notification; APP_STATE::stopped removes the taskbar entry. - WEFT_APPD_WS_PORT window global overrides the default port. New deps: tokio-tungstenite 0.24, futures-util 0.3 (sink+std), serde_json 1. |
||
|---|---|---|
| .github/workflows | ||
| crates | ||
| docs | ||
| infra | ||
| protocol | ||
| scripts | ||
| .gitattributes | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| justfile | ||
| README.md | ||
| rust-toolchain.toml | ||
WEFT OS
WEFT OS is a Linux-based operating system effort built around a Smithay compositor, a Servo-rendered system shell, and a Wasmtime-based application runtime.
Current repository scope
This repository currently contains:
- the baseline Rust workspace
- public engineering documentation derived from the authoritative blueprint
- initial design documents for the shell protocol boundary and the Wasm–Servo channel
- local and CI validation paths for repository bootstrap work
It does not yet contain a compositor, shell, or application runtime implementation.
Source of truth
The authoritative technical reference for this repository is docu_dev/WEFT-OS-COMPREHENSIVE-BLUEPRINT.md.
Historical blueprint documents exist in docu_dev/, but they are not implementation authority where they conflict with the comprehensive blueprint.
Privacy boundary
docu_dev/ is a private coordination area used during development. It is intentionally ignored by git and is not part of the tracked public repository surface.
Development model
- Primary development host: Windows workstation
- Primary runtime target: Linux VM or QEMU guest
- Core system language: Rust
Validation
On Windows PowerShell:
./infra/scripts/check.ps1
On Linux:
./infra/scripts/check.sh
Repository layout
crates/ Rust workspace members
docs/ Public engineering documentation
infra/ Validation scripts and VM workflow material