diff options
| author | soryu <soryu@soryu.co> | 2026-05-18 01:21:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-18 01:21:30 +0100 |
| commit | f240675da99bc7705e473b8f70a2628812aa4c10 (patch) | |
| tree | 3ee2d24b431ccb8cd1a3013c86b34a5782a3e224 /makima/src/daemon/tui/mod.rs | |
| parent | 0d996cf7590e3e52f424859c7d6f0e68640f119e (diff) | |
| download | soryu-master.tar.gz soryu-master.zip | |
The contracts table, supervisor task type, and all their backing
machinery have been inert for several PRs. The directives system reads
its own active contract body for spec text, and PR #135 removed the
last LLM surface that spawned supervisors.
This PR wipes the dead surface in one shot — the user authorised a DB
wipe, so the migration drops every legacy table with CASCADE rather
than carrying forward stub rows. Net change: −12k LOC across handlers,
repository, state, models, the TUI, and the listen module.
What's gone:
- contracts, contract_chat_*, contract_events, contract_repositories,
contract_type_templates tables.
- supervisor_states, supervisor_heartbeats tables.
- mesh_chat_conversations, mesh_chat_messages tables.
- tasks.contract_id/is_supervisor/supervisor_task_id/supervisor_worktree_task_id columns.
- directive_steps.contract_id/contract_type columns.
- files.contract_id/contract_phase columns.
- history_events.contract_id/phase columns.
- The Contract/Supervisor/MeshChat handler + model + repository
surface, plus the daemon TUI views that read them.
- The standalone listen.rs websocket handler (orphaned with the LLM).
What stays:
- mesh_supervisor handler: trimmed to just the questions + orders
backchannel used by `makima directive ask` / `create-order` (kept
the URL prefix for CLI client compat).
- directive_documents (the user-facing "contracts" surface).
- pending_questions in-memory state for the directive Ask flow.
cargo check, cargo test --lib (68 passed), tsc, and vite build all
clean.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'makima/src/daemon/tui/mod.rs')
| -rw-r--r-- | makima/src/daemon/tui/mod.rs | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/makima/src/daemon/tui/mod.rs b/makima/src/daemon/tui/mod.rs deleted file mode 100644 index e52b12a..0000000 --- a/makima/src/daemon/tui/mod.rs +++ /dev/null @@ -1,98 +0,0 @@ -//! TUI module for interactive browsing. -//! -//! This module provides an interactive Terminal User Interface (TUI) for -//! browsing and managing tasks, contracts, and files in the makima system. -//! -//! # Features -//! -//! - **Fuzzy Search**: Real-time filtering with the SkimMatcherV2 algorithm -//! - **Keyboard Navigation**: Vim-style keybindings (j/k) and arrow keys -//! - **Preview Pane**: Side-by-side view of item details -//! - **Multiple Views**: Browse tasks, contracts, or files - -pub mod app; -pub mod event; -pub mod fuzzy; -pub mod ui; -pub mod ws_client; - -pub use app::{App, ListItem, ViewType, ViewState, InputMode, Action, OutputBuffer, OutputLine, OutputMessageType, WsConnectionState, CreateContractState, CreateFormField, RepositorySuggestion}; -pub use ws_client::{TuiWsClient, WsCommand, WsEvent, TaskOutputEvent}; -pub use fuzzy::FuzzyMatcher; - -use std::io; -use crossterm::{ - event::{DisableMouseCapture, EnableMouseCapture}, - execute, - terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, -}; -use ratatui::prelude::*; -use ratatui::backend::CrosstermBackend; - -pub type Terminal = ratatui::Terminal<CrosstermBackend<io::Stdout>>; - -/// Run the TUI application -pub fn run(mut app: App) -> Result<Option<String>, Box<dyn std::error::Error>> { - // Setup terminal - enable_raw_mode()?; - let mut stdout = io::stdout(); - execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?; - let backend = CrosstermBackend::new(stdout); - let mut terminal = ratatui::Terminal::new(backend)?; - - // Run the main loop - let result = run_app(&mut terminal, &mut app); - - // Cleanup terminal - disable_raw_mode()?; - execute!( - terminal.backend_mut(), - LeaveAlternateScreen, - DisableMouseCapture - )?; - terminal.show_cursor()?; - - result -} - -fn run_app( - terminal: &mut Terminal, - app: &mut App, -) -> Result<Option<String>, Box<dyn std::error::Error>> { - use crossterm::event::Event; - use std::time::Duration; - - loop { - terminal.draw(|f| ui::render(f, app))?; - - // Poll for events with 100ms timeout - if let Some(evt) = event::poll_event(Duration::from_millis(100))? { - if let Event::Key(key) = evt { - let action = event::handle_key_event(app, key); - match action { - Action::Quit => break, - Action::OutputPath(path) => return Ok(Some(path)), - Action::None => {} - _ => { - let result = app.handle_action(action); - // Check if handle_action returned a special action - if let Action::OutputPath(path) = result { - return Ok(Some(path)); - } - } - } - } - } - - if app.should_quit { - break; - } - } - - Ok(None) -} - -/// Print a path to stdout (for cd integration) -pub fn print_path(path: &str) { - println!("{}", path); -} |
