focus/crates/focus-tui/src/lib.rs

42 lines
1.7 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//! focus-tui终端交互层。
//! focus-tui: the terminal interaction layer.
//!
//! 组装 provider / tools / harness提供交互式对话流式、折叠的思考与工具块、
//! 会话管理、自动压缩)。渲染使用 ratatui + crossterm白名单特批见 AGENTS.md
//! §2.1)。本 crate 只做**组装与呈现**,业务逻辑都在下层 crate。
//! Assembles providers / tools / harness into an interactive chat (streaming,
//! collapsible thinking & tool blocks, session management, auto-compaction).
//! Rendering uses ratatui + crossterm (whitelist-exempted, see AGENTS.md
//! §2.1). This crate only **assembles and renders**; the business logic lives
//! in the lower crates.
#![forbid(unsafe_code)]
/// 交互应用状态与命令处理。
/// Interactive app state and command handling.
pub mod app;
/// 持久化的 TUI 配置provider / 模型 / 端点等)。
/// Persisted TUI configuration (provider / model / endpoints).
pub mod config;
/// 摘要与格式化辅助工具摘要、耗时、token 格式)。
/// Summary & formatting helpers (tool summaries, durations, token formats).
pub mod format;
/// 后台任务:运行 agent、自动压缩。
/// Background jobs: running the agent, auto-compaction.
pub mod job;
/// 极简 Markdown 渲染。
/// Minimal Markdown rendering.
pub mod markdown;
/// 纯 UI 状态机:从 Agent 事件构建可渲染的块(可独立测试)。
/// Pure UI state machine: builds renderable blocks from Agent events
/// (testable without a terminal).
pub mod state;
pub use config::{ProviderKind, TuiConfig};
pub use state::UiBlock;
/// 终端渲染与主循环(内部模块)。
/// Terminal rendering and the main loop.
pub mod ui;