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
//! # muse-codes
//!
//! Typed Rust SDK for [Meta's Muse Code](https://dev.meta.ai/docs) terminal
//! coding agent. Models the machine-readable JSONL event stream of headless
//! runs (`muse exec --json`): an event-sourced journal of envelope records
//! ([`MuseRecord`]) whose payloads cover command intake, run lifecycle,
//! task lifecycle, and streamed output.
//!
//! Types are derived from **captured real CLI output** (committed under
//! `test_cases/`), captured via the credential-free `--provider echo` mode.
//! Payload types not yet observed deserialize as [`MusePayload::Unknown`]
//! rather than failing, and the envelope keeps the raw payload so
//! round-trips are byte-faithful.
//!
//! ## Features
//!
//! - `types` — serde models only; `wasm32-unknown-unknown` compatible.
//! - `async-client` (default) — Tokio client spawning `muse exec --json`.
//!
//! ## Quick start
//!
//! ```ignore
//! use muse_codes::{ExecRun, MuseExecBuilder, MusePayload, Provider};
//!
//! let run = ExecRun::spawn(
//! &MuseExecBuilder::new("summarize this repo").provider(Provider::Meta),
//! ).await?;
//!
//! let terminal = run.wait_terminal(|record| {
//! if let Ok(MusePayload::RunOutputDelta(d)) = record.typed_payload() {
//! print!("{}", d.text);
//! }
//! }).await?;
//! println!("\nterminal: {}", terminal.terminal);
//! ```
// Core modules always available
// Client modules
pub use ;
pub use ;
pub use ;
pub use ExecRun;