Commit graph

10 commits

Author SHA1 Message Date
Till Wegmueller
70859175c0 Add doors IPC transport for illumos, simplify client binaries
Add platform-aware IPC transport layer for the launcher protocol:

- transport module: send_request_sync() auto-selects doors (illumos)
  or Unix sockets (Linux) at compile time
- doors_transport: uses doors::Client for high-speed synchronous RPC,
  gated behind cfg(target_os = "illumos") + "doors" feature flag
- unix_transport: blocking Unix socket client for all platforms

Simplify client binaries to use the sync transport:
- wradm: drops tokio dependency entirely, now fully synchronous
- wrlogin: drops tokio dependency, uses sync transport
- wrsessd: uses shared default_ipc_path() for consistency

The doors crate (0.8.1) is an optional illumos-only dependency.
On Linux, all code compiles and tests pass with Unix socket transport.
2026-04-09 22:21:14 +02:00
Till Wegmueller
f6b9ea56ba Add session launcher, greeter, admin CLI, and session config
Session infrastructure for the launcher/greeter architecture (Phase 3):

- Launcher protocol: JSON-over-Unix-socket messages (LauncherRequest/
  LauncherResponse) for session_requested, session_authenticated,
  session_logout, plus admin queries (list_sessions, kill_session)

- Session config: ~/.config/wayray/session.toml with wm, panel,
  launcher, notifications, and autostart fields. Serde TOML parsing
  with sensible defaults (wr-wm-floating). 5 unit tests.

- wrsessd: Session launcher daemon listening on Unix socket. Manages
  per-token sessions, launches greeter on session_requested, starts
  desktop components from session.toml on session_authenticated,
  cleans up child processes on logout. Admin query support.

- wrlogin: Reference CLI greeter. Reads credentials from stdin,
  sends session_authenticated to wrsessd, exits on success.
  Token passed via WAYRAY_SESSION_TOKEN env var.

- wradm: Session management commands (list, kill) communicating
  with wrsessd via launcher protocol. Tabular output format.
2026-04-09 21:22:46 +02:00
Till Wegmueller
d59411ca60 Add session lifecycle, token-based identity, and client token support
Core session management infrastructure for Phase 3:

- Session module: SessionId, SessionToken, SessionState enum with
  validated transitions (Creating→Active⇄Suspended→Destroyed),
  Session struct with timeout tracking, SessionRegistry with O(1)
  lookup by ID and token (10 unit tests)

- Protocol: ClientHello gains optional token field, ServerHello gains
  resumed flag and token echo, SessionStatus/SessionEvent enums added
  to ControlMessage for session state notifications

- Server: SessionRegistry in headless CalloopData, sessions created on
  client connect (with token lookup for resumption), suspended on
  disconnect (not destroyed), periodic cleanup of expired sessions

- Client: --token CLI flag, persistent token at ~/.config/wayray/token
  with auto-generation (random 16-byte hex), token sent in ClientHello,
  resumed state logged from ServerHello
2026-04-09 21:14:48 +02:00
Till Wegmueller
f2aebe04a6 Implement pluggable window management protocol (Phase 2.5)
Add a custom Wayland protocol (wayray_wm_v1) that allows external
window manager processes to control layout, focus, and keybindings
in the WayRay compositor, inspired by River's two-phase transaction
model.

New crates:
- wayray-wm-protocol: Wayland protocol XML + generated server/client
  bindings via wayland-scanner for four interfaces (manager, window,
  seat, workspace)
- wr-wm-tiling: Reference BSP tiling WM demonstrating the protocol

Compositor changes:
- WindowManager trait + WmState coordinator abstracts WM behavior
- Built-in floating WM (centered windows, click-to-focus, z-ordering)
- Protocol server with GlobalDispatch/Dispatch for all interfaces
- Hot-swap (replaced event) and crash resilience (fallback to built-in)
- new_toplevel delegates to WM instead of hardcoding 800x600 at (0,0)
- WM render phase integrated into headless frame pipeline
2026-04-07 22:29:19 +02:00
Till Wegmueller
43a4d7e6af Add missing display.rs and wrclient display dependencies
display.rs (winit + wgpu renderer) and Cargo.toml changes (winit,
wgpu, pollster, env_logger) were created but not committed in the
Task 5 subagent.
2026-04-07 17:51:40 +02:00
Till Wegmueller
f79a934c2b Add QUIC transport layer with quinn for server and client
Implement QUIC networking for wrsrvd (server) and wrclient (client) using
quinn over rustls with self-signed certificates. Three logical channels:
control (bidirectional), display (server->client unidirectional), and
input (client->server unidirectional).

Server runs tokio in a background thread, communicating with the compositor
via std::sync::mpsc channels. Client exposes an async connect() API that
returns a ServerConnection with methods for sending input and receiving
frames.

Key design note: quinn streams are lazily materialized -- accept_bi/
accept_uni on the peer won't resolve until data is written. The handshake
protocol accounts for this by having each side write immediately after
opening streams.
2026-04-07 16:54:01 +02:00
Till Wegmueller
8a3d14ff19 Add headless backend with PixmanRenderer, refactor into backend modules
Restructure wrsrvd to support two backends: a headless PixmanRenderer
(default) for running without a display server, and the existing Winit
backend (via --backend winit). The render logic is split into per-backend
modules, and the old render.rs is removed.
2026-04-07 16:29:32 +02:00
Till Wegmueller
f394d8cd7d Add XOR diff + zstd frame encoding in wayray-protocol
Encoder: xor_diff + encode_region (per damage rectangle).
Decoder: apply_region (decompress + XOR apply to framebuffer).
Both live in wayray-protocol::encoding for shared access.
14 tests including 3 end-to-end round-trip integration tests.
2026-04-07 15:42:54 +02:00
Till Wegmueller
0762cb1fa3 Implement wire protocol messages and codec in wayray-protocol
Message types for control, display, and input channels with serde
derives. Length-prefixed postcard codec with encode/decode/framing.
Seven round-trip tests covering all message types and edge cases.
2026-04-07 15:35:48 +02:00
Till Wegmueller
4e08dfb5a9 Set up Cargo workspace with four crates
Workspace: wrsrvd, wrclient, wayray-protocol, wradm under crates/.
Smithay configured with default-features=false, portable features only.
Implements ADR-007 project structure.
2026-04-04 18:16:53 +02:00