1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Official Rust SDK for the [Hot Dev](https://hot.dev) API.
//!
//! The client is a thin mirror of the Hot API v1 resources. Request and
//! response payloads use the Hot API wire format (`event_type`, `stream_id`,
//! `event_data`, ...) as [`JsonObject`] values; the SDK never transforms
//! user-owned payloads such as `event_data`. SDK-only options use
//! Rust-idiomatic names (`base_url`, `timeout`).
//!
//! ```no_run
//! use futures_util::StreamExt;
//! use hot_dev::{HotClient, StreamEventExt, SubscribeWithEventOptions};
//! use serde_json::json;
//!
//! # async fn demo() -> hot_dev::Result<()> {
//! let client = HotClient::builder(std::env::var("HOT_API_KEY").unwrap()).build();
//!
//! // base_url defaults to https://api.hot.dev. For local development with
//! // `hot dev`, use .base_url("http://localhost:4681").
//!
//! let mut events = client.streams().subscribe_with_event(
//! json!({
//! "event_type": "team-agent:ask",
//! "event_data": { "question": "what is blocking launch?" },
//! }),
//! SubscribeWithEventOptions::default(),
//! );
//! while let Some(event) = events.next().await {
//! let event = event?;
//! if event.event_type() == "run:stop" {
//! println!("{:?}", event.run());
//! break;
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! Authenticated clients should run server-side; browser or untrusted clients
//! should call your own backend instead of embedding a Hot API key.
pub use ;
pub use ;
pub use ;
pub use ;
/// A JSON object in the Hot API wire format.
pub type JsonObject = Map;
/// One event from a Hot run stream (`type`, `data_type`, `payload`, `run`, ...).
pub type StreamEvent = JsonObject;
/// Result alias for SDK operations.
pub type Result<T> = Result;