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 events;
22pub mod helpers;
23pub mod intent_hints;
24pub mod protocol;
25pub mod session;
26pub mod stream_terminal;
27
28pub use client::{Client, ClientConfig, SendInputOptions};
29pub use command_client::{AsyncCommandClient, CommandClient};
30pub use config::{load_config_from_env, Config};
31pub use errors::{
32    disconnect_cause_name, ConnectionError, DaemonError, DisconnectCause, ReconnectError,
33    StaleLoopError, TimeoutError,
34};
35pub use events::{
36    EVENT_DEEP_RESEARCH_COMPLETED, EVENT_DEEP_RESEARCH_CRAWL_SUMMARY,
37    EVENT_DEEP_RESEARCH_GATHER_SUMMARY, EVENT_DEEP_RESEARCH_PROGRESS, EVENT_DEEP_RESEARCH_STARTED,
38    EVENT_DEEP_RESEARCH_STEP_COMPLETED, EVENT_EXPLORER_COMPLETED, EVENT_EXPLORER_MILESTONE,
39    EVENT_EXPLORER_STARTED, EVENT_EXPLORER_STEP_COMPLETED, EVENT_LOOP_REATTACHED_WIRE,
40    EVENT_PLAN_CREATED, EVENT_REPLAY_COMPLETE,
41};
42pub use helpers::{
43    check_daemon_status, fetch_config_section, fetch_loop_cards, fetch_loop_history,
44    fetch_skills_catalog, is_daemon_live, protocol1_rpc, request_daemon_config_reload,
45    request_daemon_shutdown, websocket_url_from_env,
46};
47pub use intent_hints::{
48    validate_loop_input_intent_hint, DEFAULT_DELIVERABLE_PHASES, EMBED, IMAGE_TO_TEXT, OCR,
49    TEXT_COMPLETION,
50};
51pub use protocol::{
52    decode_message, expand_wire_messages, new_connection_init, new_notification, new_ping,
53    new_pong, new_request, new_request_id, new_subscribe, new_unsubscribe, Envelope, ErrorObject,
54    MessageType, CLIENT_VERSION, DEFAULT_CLIENT_CAPABILITIES, PROTO_VERSION,
55};
56pub use session::{bootstrap_loop_session, connect_with_retries, BootstrapOptions};
57pub use stream_terminal::{
58    extract_loop_id_from_inbound, inbound_needs_delivery_ack, is_turn_end_custom_data,
59    is_turn_progress_chunk, stale_pending_frame_label, STREAM_END,
60};
61
62/// Crate version reported in `connection_init`.
63pub const VERSION: &str = env!("CARGO_PKG_VERSION");