Skip to main content

rpi_cli/remote/
mod.rs

1//! Remote client support for `rpi --connect`.
2//!
3//! rpi is a Rust replacement for the TS `pi` CLI, not a wrapper around it, so
4//! this module owns rpi's *own* wire contract instead of depending on any
5//! external implementation. The design borrows the shape of the TS
6//! `packages/coding-agent/src/modes/rpc/` layer (commands on stdin, responses +
7//! events on stdout, a session abstraction the UI can render), but every type
8//! here is native Rust.
9//!
10//! Pieces:
11//! - [`protocol`] — the shared wire types ([`protocol::RemoteEvent`],
12//!   [`protocol::RemoteCommand`], [`protocol::RemoteResponse`]) used by both the
13//!   `--mode rpc` server and the `--connect` client, so the contract has a
14//!   single source of truth.
15//! - [`framing`] / [`cbor`] / [`codec`] — the **binary** transport: 4-byte
16//!   length-prefixed frames carrying CBOR-encoded protocol messages (port of
17//!   the TS `@earendil-works/pi-protocol` package). The JSONL transport remains
18//!   the default; the binary one is available for callers that want it.
19//! - [`client`] — the TCP JSON-RPC connection to a `rpi --server` endpoint.
20//! - [`session`] — the client-side transcript + state the UI renders.
21//!
22//! The client itself (`--connect`) is built on top of these types: a TCP JSONL
23//! connection, a remote session that folds the event stream into a transcript,
24//! and a terminal UI that renders it. The client holds **no** local agent
25//! resources — no provider, tools, extensions, or session files.
26
27pub mod cbor;
28pub mod client;
29pub mod codec;
30pub mod framing;
31pub mod protocol;
32pub mod session;
33pub mod tui;