This repository has been archived on 2026-10-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
maestro/crates/maestro-tui/src/lib.rs
T
naps62-yolo 31e1b73193
ci / rust (push) Successful in 15m8s
feat(maestro-tui): TuiConfig with shipped defaults + override merge (NAP-277)
`TuiConfig::load(&TuiSection)` builds the runtime config:

1. Apply shipped default Normal-mode bindings (cover every v1 action).
2. Insert mode binds the leader → `LeaveInsert` (built from the leader spec
   so rebinding leader moves the Insert escape automatically).
3. Apply user overrides from `[tui.keymap.normal]` / `[tui.keymap.insert]`
   over the defaults, with the same validation path — bad TOML entries
   surface as `BadKeymap { mode, input, action, source }`.

Also adjusts the existing `MaestroConfigFile` round-trip test to include the
new `tui` field.

8 new unit tests passing (49 total for tui + config).
2026-05-28 19:52:41 +00:00

37 lines
1.1 KiB
Rust

//! `maestro tui` — terminal UI client over the local daemon's `/api/*` surface.
//!
//! Design: `docs/superpowers/specs/2026-05-28-maestro-tui-design.md`
//! Implementation: `docs/superpowers/plans/2026-05-28-maestro-tui.md`
//!
//! Phase 1 (NAP-276) scaffolds the crate and a `Tui` subcommand stub. The real
//! event loop, rendering, and `/api/*` plumbing land in NAP-277 onward.
#![deny(missing_debug_implementations)]
pub mod action;
pub mod cli;
pub mod config;
pub mod input;
pub mod keymap;
/// Inputs for [`run`]. Built by the umbrella binary from the parsed
/// `TuiArgs` plus any global flags.
#[derive(Debug, Clone)]
pub struct RunConfig {
/// HTTP base URL of the local daemon, e.g. `http://127.0.0.1:7070`.
/// No trailing slash.
pub daemon_url: String,
}
#[derive(Debug, thiserror::Error)]
pub enum TuiError {
#[error("not implemented")]
NotImplemented,
}
/// Entry point. Phase-1 stub — returns `NotImplemented` so the subcommand
/// dispatch path is exercisable end-to-end before the renderer lands.
pub async fn run(_cfg: RunConfig) -> Result<(), TuiError> {
Err(TuiError::NotImplemented)
}