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//! - [`client`] — the TCP JSON-RPC connection to a `rpi --server` endpoint.
16//! - [`session`] — the client-side transcript + state the UI renders.
17//!
18//! The client itself (`--connect`) is built on top of these types: a TCP JSONL
19//! connection, a remote session that folds the event stream into a transcript,
20//! and a terminal UI that renders it. The client holds **no** local agent
21//! resources — no provider, tools, extensions, or session files.
22
23pub mod client;
24pub mod protocol;
25pub mod session;
26pub mod tui;