deepstore_client/lib.rs
1//! DeepStore Rust Client
2//!
3//! High-level client for DeepStore that orchestrates control plane and data plane calls.
4//! Mirrors the TypeScript @alienplatform/deepstore-client package but uses auto-generated Rust SDKs.
5//!
6//! ## Architecture
7//!
8//! ```text
9//! DeepstoreClient
10//! ├─ Control Plane (deepstore-server-client)
11//! │ └─ List splits, SSE streaming
12//! └─ Data Plane (deepstore-agent-client via auth proxy)
13//! └─ Search, draft documents
14//! ```
15//!
16//! ## Usage
17//!
18//! ```rust,no_run
19//! use deepstore_client::{DeepstoreClient, SearchParams};
20//! use chrono::Utc;
21//!
22//! #[tokio::main]
23//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
24//! let client = DeepstoreClient::builder()
25//! .control_plane_url("https://deepstore.example.com")
26//! .auth_proxy_url("https://agent-manager.example.com")
27//! .query_token_provider(|| async { Ok("jwt_token".to_string()) })
28//! .build()?;
29//!
30//! let results = client.search(SearchParams {
31//! database_id: "db_abc123".to_string(),
32//! query: "level:error".to_string(),
33//! start_time: Utc::now() - chrono::Duration::hours(1),
34//! end_time: Utc::now(),
35//! max_hits: Some(100),
36//! ..Default::default()
37//! }).await?;
38//!
39//! println!("Found {} hits", results.num_hits);
40//! Ok(())
41//! }
42//! ```
43
44mod client;
45mod error;
46mod streaming;
47mod types;
48
49pub use client::{DeepstoreClient, DeepstoreClientBuilder};
50pub use error::{DeepstoreError, Result};
51pub use streaming::{DraftDocumentBatch, StreamParams};
52pub use types::{QueryTokenProvider, SearchParams, SearchResult};