oino_client/lib.rs
1//! `oino-client`: how frontends talk to a session.
2//!
3//! Every frontend (RPC server, TUI, GPUI, ACP adapter) drives a session through
4//! [`SessionBackend`]: Oino [`RpcCommand`]s in, one ordered stream of
5//! [`oino_core::events::ClientEvent`]s out, dialog answers via
6//! [`SessionBackend::ui_respond`]. The in-process backend passes the enums without
7//! serialisation; `oino-rpc`'s `RpcBackend` serialises them over JSONL, so a frontend cannot
8//! tell the two apart.
9//!
10//! # API map
11//!
12//! | Module | Contents |
13//! |---|---|
14//! | [`protocol`] | [`RpcCommand`] ([`AgentCommand`], [`OinoCommand`]), [`RpcRequest`], [`RpcResponse`], [`RpcSessionState`] |
15//! | [`backend`] | [`SessionBackend`], [`ClientError`] |
16//! | [`frontend`] | [`FrontendApi`]: typed `_oino/*` frontend commands (completions, panel actions, shortcuts, editor intents, settings, services, sign-in, topics, agents, queue edits, checkpoints / rewind, running bash, extensions) for every backend |
17//! | [`in_process`] (feature `in-process`) | `rpc-mode.ts` `handleCommand` | [`InProcessBackend`] over `AgentSessionRuntime` |
18//! | [`fake`] | [`fake::FakeBackend`]: scripted events and replies |
19//!
20//! The protocol records live here until `oino-protocol` exists (deviations/modes.md).
21
22#![doc(
23 html_logo_url = "https://raw.githubusercontent.com/Neuron-Mr-White/Oino/main/docs/assets/brand/png/oino-256.png",
24 html_favicon_url = "https://raw.githubusercontent.com/Neuron-Mr-White/Oino/main/docs/assets/brand/oino.ico"
25)]
26#![forbid(unsafe_code)]
27#![cfg_attr(
28 test,
29 allow(
30 clippy::unwrap_used,
31 clippy::expect_used,
32 clippy::panic,
33 reason = "tests assert by unwrapping"
34 )
35)]
36
37pub mod backend;
38pub mod fake;
39#[cfg(feature = "in-process")]
40mod follow;
41pub mod frontend;
42#[cfg(feature = "in-process")]
43pub mod hub;
44#[cfg(feature = "in-process")]
45pub mod in_process;
46pub mod protocol;
47
48pub use backend::{ClientError, SessionBackend};
49#[cfg(feature = "in-process")]
50pub use follow::FollowStream;
51pub use frontend::{AgentTree, FrontendApi, RenderRow, RewindOptions, ShortcutInfo};
52#[cfg(feature = "in-process")]
53pub use hub::{HubOptions, HubSession, HubSessionState, SessionHub};
54#[cfg(feature = "in-process")]
55pub use in_process::{InProcessBackend, ServerInfo};
56pub use protocol::{
57 AgentCommand, OinoCommand, RejectedCommand, RpcCommand, RpcRequest, RpcResponse,
58 RpcResponseData, RpcSessionState,
59};