trustee_tui/lib.rs
1//! Trustee TUI - Terminal User Interface for Trustee Agent
2//!
3//! This crate provides a terminal-based user interface for interacting with
4//! the Trustee agent. It uses ratatui for rendering and crossterm for terminal
5//! control.
6
7mod app;
8mod tui_sink;
9
10pub use app::App;
11
12use std::collections::HashMap;
13
14/// Build information passed from the main binary
15pub type BuildInfo = abk::cli::BuildInfo;
16
17/// Run the TUI application with configuration
18///
19/// Task 50: This function accepts the merged configuration and secrets
20/// and will wire them to ABK's run_from_raw_config for workflow execution.
21///
22/// This function is async to allow concurrent workflow execution with the TUI event loop.
23pub async fn run(
24 config_toml: String,
25 secrets: HashMap<String, String>,
26 build_info: BuildInfo,
27) -> anyhow::Result<()> {
28 let mut app = App::new();
29
30 // Store config and secrets in the app for workflow execution
31 app.config_toml = Some(config_toml);
32 app.secrets = Some(secrets);
33 app.build_info = Some(build_info);
34
35 app.run().await
36}