Skip to main content

smix_recorder/
lib.rs

1//! smix-recorder — host-side recorder for smix test sessions.
2//!
3//! Cement crate, smix-specific (depends on smix-sdk's `App`).
4//!
5//! # Architecture
6//!
7//! The user runs a test session against smix via [`smix_sdk::App`], but
8//! routes the calls through [`RecordingApp`] (a wrapper that delegates
9//! every side-effecting method to the underlying App AND pushes a
10//! matching [`IRAction`] into a [`RecordSession`] buffer). At the end
11//! of the session, a generator emits an equivalent test file:
12//! - [`generator_rust::generate_rust`] — emit a Rust `cargo test`-style
13//!   source file targeting the smix-sdk public surface
14//! - [`generator_maestro_yaml::generate_maestro_yaml`] — emit a
15//!   maestro-compatible yaml flow (cross-tool compatibility)
16//!
17//! [`cleanup::cleanup`] optionally pipes either output through the
18//! `claude` CLI for a constrained AI cleanup pass (naming, `wait_for`
19//! injection between phases). Cleanup is a sweetener; callers should
20//! fall back to the raw output on cleanup failure.
21
22#![doc(html_root_url = "https://docs.smix.dev/smix-recorder")]
23
24pub mod cleanup;
25pub mod generator_maestro_yaml;
26pub mod generator_rust;
27pub mod session;
28
29pub use cleanup::{CleanupConfig, CleanupError, cleanup};
30pub use generator_maestro_yaml::generate_maestro_yaml;
31pub use generator_rust::generate_rust;
32pub use session::{RecordSession, RecordingApp};
33
34// Re-export the upstream IRAction/RecorderError for convenience.
35pub use smix_authoring_ir::{IRAction, RecorderError, RecorderErrorReason};