o7 0.1.0

O7 workflow DSL runner
Documentation
//! Wizard types — state, questions, phases, and output shapes.

use std::collections::HashMap;

/// Which config file a question's answer belongs to.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum WizSection {
    Harness,
    Global,
}

/// A single wizard question (all are free-write for MVP).
#[derive(Debug, Clone)]
pub struct WizQuestion {
    pub id: String,
    pub prompt: String,
    pub section: WizSection,
    /// Initial value to pre-populate (empty string = blank field).
    pub prefill: String,
}

/// The logical phases the wizard moves through.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum WizPhase {
    Questions,
    Writing,
    Done,
    Aborted,
}

/// Wizard application state.
pub struct WizState {
    pub questions: Vec<WizQuestion>,
    /// Answers keyed by question id (strings only — all questions are free-write).
    pub answers: HashMap<String, String>,
    pub selected_tab: usize,
    pub show_review: bool,
    /// Current text buffer for the free-write field on selected_tab.
    pub text_buffer: String,
    /// Cursor position in text_buffer (character index, not byte index).
    pub text_cursor: usize,
    pub phase: WizPhase,
    /// Non-None when writing failed.
    pub error: Option<String>,
}

/// Resolved harness config ready to write.
pub struct WrittenHarness {
    pub name: String,
    pub command: String,
    pub prompt_slot: Option<String>,
}

/// Resolved global config ready to write.
pub struct WrittenGlobal {
    pub default_project_root: Option<String>,
    pub default_harness: Option<String>,
}