This repository has been archived on 2026-10-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
maestro/crates/maestro-daemon/src/lib.rs
T
Miguel PalhasandClaude Opus 5 db44650a17
ci / rust (pull_request) Successful in 3m18s
ci / rust (push) Successful in 2m5s
refactor(maestro): collapse the daemon's double event fan-out
A background task, a second broadcast channel and a whole module existed
to remap SessionEvent onto CatalogEvent one variant at a time.
SessionManager now emits CatalogEvent directly.

Deletes local_events.rs, the publisher task, the LocalEventBus channel,
enum SessionEvent, LocalApiState::events, and the duplicate capacity
constant — events_capacity was declared twice for one logical stream.

Lag semantics improve. There were two lag points: the publisher falling
behind the manager, which broadcast one Lagged to every client, and each
WS subscriber falling behind the bus. Only the per-subscriber one is left,
which pump_events already handled — a slow client now makes only itself
resync.

Adds the first daemon-level tests for WS /api/events: the Snapshot-then-
deltas contract, and that a late subscriber gets a Snapshot of current
state. Both were described only in a comment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 13:37:15 +01:00

28 lines
747 B
Rust

//! `maestro daemon` — the per-host Maestro daemon.
//!
//! Wraps tmux, owns every session on the machine, and serves them to clients
//! (CLI, TUI, web) over a plain HTTP + WebSocket API on a local bind address.
//! No registry, no peers, no auth layer: reaching the bind address is the
//! authorization.
#![deny(missing_debug_implementations)]
pub mod activity;
pub mod attach;
pub mod cli;
pub mod config;
pub mod dirlist;
pub mod gitroot;
pub mod local_api;
pub mod panes;
pub mod proc;
pub mod pty;
pub mod session;
pub mod sidecar;
pub mod spawn_history;
pub mod tmux;
pub mod worktree;
pub use config::{default_config_path, default_state_dir, load_config, DaemonConfig, EnvOverrides};
pub use session::{SessionError, SessionManager};