Skip to content

Latest commit

 

History

131 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meta-TUI: Agent Orchestration Workbench

English | 简体中文

A high-density Terminal (TUI) workbench built with Rust + Ratatui + Tokio, orchestrating CLI AI agents through RPC technology.

Overview

Meta-TUI connects to pi (or other CLI agents) via RPC, providing a three-panel TUI interface:

  • Left panel: Active session + workspace tree (expandable session list)
  • Center: Conversation/message area + bottom input box
  • Right panel: Subagent list (AGENTS) + SKILLS + MCPS + TASKS (discovered from ~/.pi/agent/)
  • Bottom bar: Keyboard shortcuts + status hints + Context/Token/Cost info

Text selection is confined within each panel boundary; releasing the mouse automatically copies the selection to the system clipboard.

Quick Start

# Build
cargo build

# Print configuration info (without starting pi)
cargo run -- --dry-run

# Run TUI (automatically starts pi RPC backend)
cargo run -- --tui

# Run Router standalone mode (Provider config TUI)
cargo run -- --router

# Test
cargo test
cargo clippy -- -D warnings
cargo fmt --check

Tech Stack

Component Technology
Language Rust (edition 2024, MSRV 1.85)
TUI Framework Ratatui 0.30.2 + Crossterm 0.29
Async Runtime Tokio
RPC Custom JSONL RPC Protocol
Error Handling color-eyre + thiserror
Logging tracing + tracing-subscriber

Project Structure

meta-tui/
├── src/
│   ├── main.rs              # Entry point + --dry-run
│   ├── lib.rs               # Library root
│   ├── action.rs            # Action enum
│   ├── app.rs               # App state machine + TuiState
│   ├── persistence.rs        # UI state persistence (state.json)
│   ├── tui.rs               # TUI event loop (RPC + mouse/keyboard)
│   ├── selection.rs         # Mouse selection highlighting + text collection
│   ├── config.rs            # CLI argument parsing
│   ├── errors.rs            # Error types
│   ├── logging.rs           # Log initialization
│   ├── message.rs           # ChatMessage + ContentBlock model
│   ├── theme.rs             # Cyan industrial theme
│   ├── state.rs             # Session state context management
│   ├── tui_state.rs         # TUI layout state (scroll, collapse, cursor)
│   ├── router_tui.rs        # Router standalone mode TUI (Provider config)
│   ├── utils.rs             # Utility functions (JSON parsing, string utils)
│   ├── backend/
│   │   ├── mod.rs           # AgentBackend trait
│   │   ├── rpc.rs           # PiRpcBackend (process management)
│   │   ├── rpc_client.rs    # JSONL RPC client
│   │   └── event.rs         # PiEvent types + parsing
│   ├── provider/
│   │   ├── mod.rs           # ProviderConfig + persistence
│   │   └── router.rs        # axum HTTP reverse proxy
│   └── components/
│       ├── mod.rs           # Component trait (&mut self)
│       ├── sidebar.rs       # Left: session + workspace tree + PROVIDER/MODEL
│       ├── main_view.rs     # Center: conversation + input + block collapse
│       ├── markdown.rs      # Markdown → Ratatui Line renderer (GFM + code blocks)
│       ├── agent_panel.rs   # Right: AGENTS / SKILLS / MCPS / TASKS
│       ├── bottom_bar.rs    # Bottom: shortcuts + status + Token
│       ├── top_bar.rs       # Top tab bar
│       └── popup.rs         # Popup overlay
└── tests/
    └── integration_test.rs

License

MIT

About

Meta-TUI 智能体编排工作台 — Rust TUI 应用 / PTY 驱动的 AI Agent 多进程编排器

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages