Skip to main content

soothe_client/
lib.rs

1//! Soothe WebSocket client for talking to a running soothe-daemon.
2//!
3//! Public surface mirrors Python / Go / TypeScript RFC-629 tiers:
4//!
5//! ```text
6//! Need                         → Entry point
7//! One conversation, stream     → appkit::DaemonSession
8//! Jobs / cron one-shots        → CommandClient
9//! Raw protocol / custom        → Client
10//! Multi-user HTTP backend      → appkit::ConnectionPool + TurnRunner
11//! ```
12
13#![deny(missing_docs)]
14#![allow(clippy::result_large_err)]
15
16pub mod appkit;
17pub mod client;
18pub mod command_client;
19pub mod config;
20pub mod errors;
21pub mod helpers;
22pub mod intent_hints;
23pub mod protocol;
24pub mod session;
25pub mod stream_terminal;
26
27pub use client::{Client, ClientConfig, SendInputOptions};
28pub use command_client::{AsyncCommandClient, CommandClient};
29pub use config::{load_config_from_env, Config};
30pub use errors::{
31    disconnect_cause_name, ConnectionError, DaemonError, DisconnectCause, ReconnectError,
32    StaleLoopError, TimeoutError,
33};
34pub use helpers::{
35    check_daemon_status, fetch_config_section, fetch_loop_cards, fetch_loop_history,
36    fetch_skills_catalog, is_daemon_live, protocol1_rpc, request_daemon_config_reload,
37    request_daemon_shutdown, websocket_url_from_env,
38};
39pub use intent_hints::{
40    validate_loop_input_intent_hint, DEFAULT_DELIVERABLE_PHASES, EMBED, IMAGE_TO_TEXT, OCR,
41    TEXT_COMPLETION,
42};
43pub use protocol::{
44    decode_message, expand_wire_messages, new_connection_init, new_notification, new_ping,
45    new_pong, new_request, new_request_id, new_subscribe, new_unsubscribe, Envelope, ErrorObject,
46    MessageType, CLIENT_VERSION, DEFAULT_CLIENT_CAPABILITIES, PROTO_VERSION,
47};
48pub use session::{bootstrap_loop_session, connect_with_retries, BootstrapOptions};
49pub use stream_terminal::{
50    extract_loop_id_from_inbound, inbound_needs_delivery_ack, is_turn_end_custom_data,
51    is_turn_progress_chunk, stale_pending_frame_label, STREAM_END,
52};
53
54/// Crate version reported in `connection_init`.
55pub const VERSION: &str = env!("CARGO_PKG_VERSION");