Skip to main content

agentmux_common/
ipc.rs

1// Copyright 2025-2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Phase B.2 IPC wire protocol โ€” shared between agentmux-launcher
5//! (server) and agentmux-cef (client). One source of truth so the
6//! Command / Event shapes can't drift between binaries on a
7//! version-skew release.
8//!
9//! See `docs/specs/SPEC_WINDOW_PROCESS_STATE_MACHINE_2026_04_27.md` ยง5.
10//!
11//! Wire format: newline-delimited JSON. One message per line,
12//! parsed via serde_json. Format chosen for debuggability โ€”
13//! operators can `cat` / `nc` the named pipe and read traffic
14//! without a binary protocol decoder.
15//!
16//! Backward compat policy (B.2 baseline; harden in Phase D):
17//!   * Externally tagged enums (`{"cmd":"register",...}`) so adding
18//!     variants is non-breaking; clients send what they know.
19//!   * Unknown commands โ†’ server replies `Event::Error` rather than
20//!     crashing.
21//!   * `version: u64` on every Event lets Phase D's GetSnapshot /
22//!     resync detect skew. For B.2 it's set but not enforced.
23
24mod command;
25mod event;
26mod types;
27
28pub use command::*;
29pub use event::*;
30pub use types::*;
31
32#[cfg(test)]
33mod tests;