Skip to main content

cli_stream/
install.rs

1//! Streamed install / sign-in progress events.
2//!
3//! The neutral event vocabulary a subprocess install (or login) flow
4//! reports through. Both transports (axum SSE, Tauri Channel) serialize
5//! these identically — keep the field names stable, the TypeScript
6//! front-end consumes them verbatim. The concrete install *scripts*
7//! (e.g. bob's `install-bob.sh`) live in the per-harness crates; this is
8//! just the shape they emit.
9
10use serde::Serialize;
11
12#[derive(Debug, Clone, Serialize)]
13#[serde(tag = "kind", rename_all = "camelCase")]
14pub enum InstallEvent {
15    /// A `[…-INSTALL]`-prefixed marker line. Drives UI checkpoints
16    /// without parsing prose.
17    Step { text: String },
18    /// Non-marker stdout. Curl progress, npm output, etc.
19    Stdout { text: String },
20    /// stderr line. Often warnings but sometimes the real error.
21    Stderr { text: String },
22    /// Terminal event. Always sent exactly once at the end.
23    Done { exit_code: Option<i32>, ok: bool },
24}