harness-tui-kit
Harness TUI Kit — production-ready TUI components for building agent harnesses (chat, history, harness observability, AHE widgets).
Harness TUI Kit — production-ready TUI components for building agent harnesses (chat, history, harness observability, AHE widgets).
Package contract
| Field | Value |
|---|---|
| Language | rust |
| Source version | 0.1.0-alpha.1 |
| Manifest | harness-tui-kit/Cargo.toml |
| Source files | 101 |
| Evidence | Source reference; registry publication and runtime conformance are separate checks |
Import boundary
use harness_tui_kit;Use a source checkout or your verified private registry. Manifest coordinates identify the package; they do not establish that a public registry release exists.
Crate boundary
The following entries are taken from src/lib.rs. Feature conditions in the exact source still apply.
pub mod components;
pub mod util;
pub use effects::KitEffect;
pub use theme::{Theme, ThemeOverrides, DEFAULT_THEME};
pub use types::{
AgentInfo, AgentStatus, ApprovalAction, ApprovalRequest, ChatMessage, CommandHint, CostEntry,
DecisionOption, DiffLine, DiffLineKind, KeyShortcut, LatencySnapshot, LogEntry, LogLevel,
PaletteItem, PermissionCategory, PermissionDecision, PermissionRequest, ProposalInfo,
ProposalKind, ProposalStatus, RiskLevel, Role, Severity, TaskItem, TaskStatus, ToolCallInfo,
ToolCallStatus, TransactionEntry, TreasuryInfo, VoteChoice, WorkflowEdge, WorkflowNodeInfo,
WorkflowNodeKind,
};
pub use components::agent::{
AgentAvatar, AgentCard, AgentCardState, AgentList, AgentListState, AgentPanel, AgentPanelState,
AgentStatusDot, AvatarSize, MultiAgentHeader, MultiAgentHeaderState,
};
pub use components::chat::{
ChangeKind, ChatBubble, ChatBubbleState, ChatTimeline, ChatTimelineState, CodeBlock,
CodeBlockState, DiffView, DiffViewState, DocumentPreviewPane, DocumentPreviewState,
FileDisplay, FileDisplayState, InlineDiffCard, InputBar, InputBarState, MarkdownRenderer,
MarkdownStreamCollector, PageStyle, StreamingText, StreamingTextState, ToolCallCard,
ToolCallCardStatus, ToolCallDisplay, ToolCallState,
};
pub use components::governance::{
ConstitutionView, ConstitutionViewState, ProposalCard, ProposalCardState, TreasuryDisplay,
VotingPanel, VotingPanelState,
};
pub use components::harness::{
AttributionTable, AttributionTableRow, AttributionTaskOutcomeBadge, ChangeManifestView,
HarnessComponentRow, HarnessComponentStatus, HarnessComponentTree, HarnessComponentTreeState,
ManifestEntryView, ManifestVerdictBadge,
};
pub use components::history::{
ApprovalCell, ApprovalState, AssistantCell, DiffCell, ExecCell, ExecOutcome, HistoryCell,
HistoryView, HistoryViewState, SystemCell, SystemSeverity, ToolCell, ToolCellOutcome, UserCell,
};
pub use components::hitl::{
ApprovalChooser, ApprovalChooserAction, ApprovalChooserState, ApprovalDialog,
ApprovalDialogState, ApprovalQueue, ApprovalQueueState, ConfirmButton, ConfirmationPrompt,
ConfirmationPromptState, DecisionPanel, DecisionPanelState, PermissionBanner, PermissionPrompt,
PermissionPromptState,
};
pub use components::metrics::{
CostTracker, LatencyDisplay, MetricBarItem, MetricCard, MetricsBar, TokenMeter,
};
pub use components::system::{
custom_logo::CLAUSEN_LOGO_ROWS, fmt_elapsed_compact, AppShell, AppShellState, Banner,
BlockLogo, CollapseState, CommandPalette, CommandPaletteState, CustomLogo, FocusCard,
GoalDisplay, GoalStep, GoalStepStatus, HintBar, HintItem, KeyboardHelp, KeyboardHelpState,
LogViewer, LogViewerState, Modal, ModalButton, ModalState, ModelCapabilities, ModelPicker,
ModelPickerRow, ModelPickerState, NotificationToast, NotificationToastState, PagerOverlay,
PagerOverlayState, PendingSelection, ResumePicker, ResumePickerRow, ResumePickerState,
SettingsPalette, SettingsPaletteItem, SettingsPalettePage, SettingsPaletteState, ShellPanel,
Shimmer, ShimmerState, SlashDropdown, SlashDropdownItem, SlashDropdownState, Spinner,
SpinnerStyle, SplitDirection, SplitPane, SplitPaneState, StatusBar, StatusFooter,
StatusFooterIndicator, StatusIndicator, StatusIndicatorState, StatusKind, TabItem, Tabs,
TabsState, ThemePicker, ThemePickerRow, ThemePickerState, ThinkingAnimation,
ThinkingAnimationState, ThinkingIndicator, ToastMessage, WelcomeConfig, WelcomeScreen,
BLOCK_LOGO_GLYPH_WIDTH, BLOCK_LOGO_HEIGHT, BLOCK_LOGO_SPACING, SHIMMER_DEFAULT_WINDOW,
THINKING_ANIMATION_DEFAULT_CHARSET, THINKING_ANIMATION_DEFAULT_WIDTH,
};
pub use components::workflow::{
ProgressTimeline, TaskList, TaskListState, WorkflowDAG, WorkflowDAGState, WorkflowNode,
};
pub use util::live_wrap::{display_width, wrap_unicode};
pub use util::unified_diff::{parse_unified_diff, DiffFile};
pub use util::word_diff::{pair_changed_lines, word_diff, ChangedPair, WordDiff};Source reference
Download package reference JSON. Each original source file and generated declaration artifact has its own SHA-256 digest. Function bodies and constant values are omitted from downloads. These are source declaration inventories, not compiler-resolved rustdoc, TypeDoc, DocC, or Dokka output. Private modules can contain public declarations that are not reachable through the package boundary; consult the entry point before importing.
components/agent/agent_panel.rs
Read declaration text · 15 declaration entries
#[derive(Debug, Clone)]
pub struct AgentPanel<'a> {
}
#[must_use]
pub fn new(info: &'a AgentInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_metrics(mut self, show: bool) -> Self;
#[must_use]
pub fn show_tools(mut self, show: bool) -> Self;
#[must_use]
pub fn current_task(mut self, task: &'a str) -> Self;
#[must_use]
pub fn tokens_used(mut self, tokens: u64) -> Self;
#[must_use]
pub fn cost_display(mut self, cost: &'a str) -> Self;
#[must_use]
pub fn latency_ms(mut self, ms: u64) -> Self;
#[must_use]
pub fn tools(mut self, names: &'a [&'a str]) -> Self;
#[derive(Debug, Clone, Default)]
pub struct AgentPanelState {
}
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
#[must_use]
pub fn scroll_offset(&self) -> usize;
pub fn reset(&mut self);components/agent/avatar.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum AvatarSize {
/// 1 character wide, 1 row tall.
Small,
/// 3 characters wide, 3 rows tall.
Medium,
/// 5 characters wide, 5 rows tall.
Large,
}
#[derive(Debug, Clone)]
pub struct AgentAvatar<'a> {
}
#[must_use]
pub fn new(id: &'a str, name: &'a str) -> Self;
#[must_use]
pub fn size(mut self, size: AvatarSize) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/agent/card.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone)]
pub struct AgentCard<'a> {
}
#[must_use]
pub fn new(info: &'a AgentInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone, Default)]
pub struct AgentCardState {
/// Whether to show expanded (multi-line) or compact (single-line) mode.
pub expanded: bool
}
pub fn toggle(&mut self);
pub fn reset(&mut self);components/agent/list.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone)]
pub struct AgentList<'a> {
}
#[must_use]
pub fn new(agents: &'a [AgentInfo]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone)]
pub struct AgentListState {
/// Currently selected agent index (if any).
pub selected: Option<usize>,
/// Scroll offset for the list.
pub scroll_offset: usize,
/// Optional filter text.
pub filter: String,
/// Whether to show agents in compact mode.
pub compact: bool
}
#[must_use]
pub fn new() -> Self;
pub fn select_next(&mut self, total: usize);
pub fn select_prev(&mut self, total: usize);
pub fn set_filter(&mut self, text: impl AsRef<str>);
pub fn clear_filter(&mut self);
pub fn toggle_compact(&mut self);
#[must_use]
pub fn selected_agent<'a>(&self, agents: &'a [AgentInfo]) -> Option<&'a AgentInfo>;components/agent/mod.rs
Read declaration text · 7 declaration entries
pub mod agent_panel;
pub use agent_panel::{AgentPanel, AgentPanelState};
pub use avatar::{AgentAvatar, AvatarSize};
pub use card::{AgentCard, AgentCardState};
pub use list::{AgentList, AgentListState};
pub use multi_agent_header::{MultiAgentHeader, MultiAgentHeaderState};
pub use status::AgentStatusDot;components/agent/multi_agent_header.rs
Read declaration text · 10 declaration entries
#[derive(Debug, Clone)]
pub struct MultiAgentHeader<'a> {
}
#[derive(Debug, Clone, Default)]
pub struct MultiAgentHeaderState {
}
#[must_use]
pub fn new(agents: &'a [AgentInfo]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn focused_index(mut self, index: Option<usize>) -> Self;
#[must_use]
pub fn new() -> Self;
pub fn scroll_left(&mut self);
pub fn scroll_right(&mut self, agent_count: usize);
pub fn reset(&mut self);
#[must_use]
pub fn scroll_offset(&self) -> usize;components/agent/status.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone)]
pub struct AgentStatusDot<'a> {
}
#[must_use]
pub fn new(status: AgentStatus) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn with_label(mut self, show: bool) -> Self;components/chat/bubble.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone)]
pub struct ChatBubble<'a> {
}
#[must_use]
pub fn new(message: &'a ChatMessage) -> Self;
#[must_use]
pub fn markdown(mut self, enabled: bool) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_timestamp(mut self, show: bool) -> Self;
#[must_use]
pub fn show_sender(mut self, show: bool) -> Self;
#[must_use]
pub fn max_lines(mut self, max: usize) -> Self;
#[derive(Debug, Clone, Default)]
pub struct ChatBubbleState {
/// Scroll offset within the message content.
pub scroll_offset: usize,
/// Whether this bubble is currently selected.
pub selected: bool
}
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn reset(&mut self);components/chat/code_block.rs
Read declaration text · 12 declaration entries
#[derive(Debug, Clone)]
pub struct CodeBlock<'a> {
}
#[must_use]
pub fn new(code: &'a str) -> Self;
#[must_use]
pub fn language(mut self, lang: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_line_numbers(mut self, show: bool) -> Self;
#[must_use]
pub fn show_header(mut self, show: bool) -> Self;
#[derive(Debug, Clone, Default)]
pub struct CodeBlockState {
/// Vertical scroll offset (in lines).
pub scroll_offset: usize,
/// Horizontal scroll offset (in columns).
pub h_scroll: usize
}
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn scroll_left(&mut self);
pub fn scroll_right(&mut self);
pub fn reset(&mut self);components/chat/diff_view.rs
Read declaration text · 12 declaration entries
#[derive(Debug, Clone)]
pub struct DiffView<'a> {
}
#[must_use]
pub fn new(lines: &'a [DiffLine]) -> Self;
#[must_use]
pub fn filename(mut self, name: &'a str) -> Self;
#[must_use]
pub fn unified(mut self, value: bool) -> Self;
#[must_use]
pub fn context_lines(mut self, n: usize) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone, Default)]
pub struct DiffViewState {
/// Vertical scroll offset in rendered rows.
pub scroll_offset: usize
}
#[must_use]
pub fn new() -> Self;
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn reset(&mut self);
pub fn clamp(&mut self, max_offset: usize) -> usize;components/chat/document_preview.rs
Read declaration text · 19 declaration entries
#[derive(Debug, Clone, Default)]
pub struct DocumentPreviewState {
}
#[must_use]
pub fn scroll(&self) -> u16;
#[must_use]
pub fn follow_tail(&self) -> bool;
pub fn set_follow_tail(&mut self, on: bool);
pub fn line_up(&mut self);
pub fn line_down(&mut self);
pub fn page_up(&mut self, viewport_h: u16);
pub fn page_down(&mut self, viewport_h: u16);
pub fn jump_top(&mut self);
pub fn jump_bottom(&mut self, content_h: u16, viewport_h: u16);
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum PageStyle {
/// Subtle bordered chrome with page-number footer.
#[default]
Page,
/// Raw scrollable region with no border.
Plain,
}
#[derive(Debug, Clone)]
pub struct DocumentPreviewPane<'a> {
}
#[must_use]
pub fn new(lines: &'a [Line<'static>]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;
#[must_use]
pub fn page_style(mut self, style: PageStyle) -> Self;
#[must_use]
pub fn page_number(mut self, n: u16) -> Self;
#[must_use]
pub fn total_pages(mut self, n: u16) -> Self;
#[must_use]
pub fn doc_type(mut self, label: &'a str) -> Self;components/chat/file_display.rs
Read declaration text · 13 declaration entries
#[derive(Debug, Clone)]
pub struct FileDisplay<'a> {
}
#[must_use]
pub fn new(filename: &'a str, content: &'a str) -> Self;
#[must_use]
pub fn language(mut self, lang: &'a str) -> Self;
#[must_use]
pub fn file_size(mut self, bytes: u64) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone, Default)]
pub struct FileDisplayState {
}
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn toggle_collapse(&mut self);
pub fn reset(&mut self);
pub fn scroll_to(&mut self, line: usize);
#[must_use]
pub fn is_collapsed(&self) -> bool;
#[must_use]
pub fn scroll_offset(&self) -> usize;components/chat/inline_diff_card.rs
Read declaration text · 8 declaration entries
#[derive(Debug, Clone)]
pub struct InlineDiffCard<'a> {
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ChangeKind {
/// File was modified in place.
#[default]
Edit,
/// File was created from scratch.
Create,
/// File was deleted.
Delete,
/// File was renamed (or moved).
Rename,
}
#[must_use]
pub fn new(file: &'a str, lines: &'a [DiffLine]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn kind(mut self, kind: ChangeKind) -> Self;
#[must_use]
pub fn footer_hint(mut self, hint: &'a str) -> Self;
#[must_use]
pub fn max_body_rows(mut self, rows: u16) -> Self;
#[must_use]
pub fn suggested_height(&self) -> u16;components/chat/input.rs
Read declaration text · 22 declaration entries
#[derive(Debug, Clone)]
pub struct InputBar<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn bg_color(mut self, color: ratatui::style::Color) -> Self;
#[must_use]
pub fn show_prompt(mut self, show: bool) -> Self;
#[must_use]
pub fn show_top_border(mut self, show: bool) -> Self;
#[must_use]
pub fn placeholder(mut self, text: &'a str) -> Self;
#[must_use]
pub fn disabled(mut self, disabled: bool) -> Self;
#[must_use]
pub fn show_char_count(mut self, show: bool) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone, Default)]
pub struct InputBarState {
}
#[must_use]
pub fn text(&self) -> &str;
pub fn take_text(&mut self) -> String;
pub fn set_text(&mut self, text: impl Into<String>);
pub fn insert_char(&mut self, ch: char);
pub fn delete_char_before(&mut self);
pub fn move_cursor_left(&mut self);
pub fn move_cursor_right(&mut self);
pub fn history_prev(&mut self);
pub fn history_next(&mut self);
#[must_use]
pub fn char_count(&self) -> usize;
#[must_use]
pub fn is_empty(&self) -> bool;
pub fn clear(&mut self);components/chat/markdown.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone)]
pub struct MarkdownRenderer<'a> {
}
#[must_use]
pub fn new(content: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn wrap_width(mut self, width: usize) -> Self;components/chat/markdown_stream.rs
Read declaration text · 15 declaration entries
#[derive(Debug, Clone)]
pub struct MarkdownStreamCollector {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn with_cwd(mut self, cwd: &Path) -> Self;
#[must_use]
pub fn max_bytes(mut self, max_bytes: usize) -> Self;
#[must_use]
pub fn cwd(&self) -> Option<&Path>;
#[must_use]
pub fn overflowed(&self) -> bool;
pub fn push_delta(&mut self, delta: &str);
pub fn commit_complete_source(&mut self) -> Option<String>;
#[must_use]
pub fn full_source(&self) -> &str;
#[must_use]
pub fn committed_source(&self) -> &str;
#[must_use]
pub fn pending_source(&self) -> &str;
#[must_use]
pub fn len(&self) -> usize;
#[must_use]
pub fn is_empty(&self) -> bool;
pub fn finalize_and_drain_source(&mut self) -> String;
pub fn clear(&mut self);components/chat/mod.rs
Read declaration text · 13 declaration entries
pub use bubble::{ChatBubble, ChatBubbleState};
pub use code_block::{CodeBlock, CodeBlockState};
pub use diff_view::{DiffView, DiffViewState};
pub use document_preview::{DocumentPreviewPane, DocumentPreviewState, PageStyle};
pub use file_display::{FileDisplay, FileDisplayState};
pub use inline_diff_card::{ChangeKind, InlineDiffCard};
pub use input::{InputBar, InputBarState};
pub use markdown::MarkdownRenderer;
pub use markdown_stream::MarkdownStreamCollector;
pub use streaming::{StreamingText, StreamingTextState};
pub use timeline::{ChatTimeline, ChatTimelineState};
pub use tool_call::{ToolCallDisplay, ToolCallState};
pub use tool_call_card::{ToolCallCard, ToolCallCardStatus};components/chat/streaming.rs
Read declaration text · 21 declaration entries
#[derive(Debug, Clone)]
pub struct StreamingText<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_cursor(mut self, show: bool) -> Self;
#[must_use]
pub fn tick(mut self, tick: usize) -> Self;
#[derive(Debug, Clone)]
pub struct StreamingTextState {
}
#[must_use]
pub fn new(text: impl Into<String>) -> Self;
#[must_use]
pub fn full_text(&self) -> &str;
#[must_use]
pub fn revealed_text(&self) -> &str;
pub fn reveal(&mut self, n: usize);
pub fn reveal_all(&mut self);
pub fn append(&mut self, text: &str);
pub fn pause(&mut self);
pub fn resume(&mut self);
#[must_use]
pub fn is_paused(&self) -> bool;
#[must_use]
pub fn is_completed(&self) -> bool;
#[must_use]
pub fn revealed_count(&self) -> usize;
#[must_use]
pub fn total_count(&self) -> usize;
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn reset(&mut self);components/chat/timeline.rs
Read declaration text · 17 declaration entries
#[derive(Debug, Clone)]
pub struct ChatTimeline<'a> {
}
#[must_use]
pub fn new(messages: &'a [ChatMessage]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone, Default)]
pub struct ChatTimelineState {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn messages(&self) -> &[ChatMessage];
#[must_use]
pub fn message_count(&self) -> usize;
pub fn push_message(&mut self, message: ChatMessage);
pub fn update_streaming(&mut self, delta: &str);
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn scroll_to_bottom(&mut self);
pub fn scroll_to_top(&mut self);
pub fn select(&mut self, index: usize);
pub fn deselect(&mut self);
#[must_use]
pub fn is_auto_scroll(&self) -> bool;
pub fn clear(&mut self);components/chat/tool_call.rs
Read declaration text · 7 declaration entries
#[derive(Debug, Clone)]
pub struct ToolCallDisplay<'a> {
}
#[must_use]
pub fn new(info: &'a ToolCallInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[derive(Debug, Clone, Default)]
pub struct ToolCallState {
/// Whether the arguments section is expanded.
pub args_expanded: bool,
/// Whether the output section is expanded.
pub output_expanded: bool
}
pub fn toggle_args(&mut self);
pub fn toggle_output(&mut self);
pub fn reset(&mut self);components/chat/tool_call_card.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ToolCallCardStatus {
/// Queued but not yet executing.
#[default]
Pending,
/// Currently executing.
Running,
/// Finished successfully.
Success,
/// Finished with an error.
Failure,
}
#[derive(Debug, Clone)]
pub struct ToolCallCard<'a> {
}
#[must_use]
pub fn new(name: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn status(mut self, status: ToolCallCardStatus) -> Self;
#[must_use]
pub fn tick(mut self, tick: u8) -> Self;
#[must_use]
pub fn summary(mut self, summary: &'a str) -> Self;
#[must_use]
pub fn detail(mut self, detail: &'a str) -> Self;
#[must_use]
pub fn result(mut self, result: &'a str) -> Self;
#[must_use]
pub fn elapsed(mut self, label: &'a str) -> Self;
#[must_use]
pub fn measured_height(&self) -> u16;components/governance/constitution_view.rs
Read declaration text · 13 declaration entries
#[derive(Debug, Clone)]
pub struct ConstitutionView<'a> {
}
#[must_use]
pub fn new(text: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn sections(mut self, sections: &'a [(&'a str, usize)]) -> Self;
#[derive(Debug, Clone, Default)]
pub struct ConstitutionViewState {
}
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn jump_to_section(&mut self, index: usize, sections: &[(&str, usize)]);
pub fn next_section(&mut self, sections: &[(&str, usize)]);
pub fn prev_section(&mut self, sections: &[(&str, usize)]);
#[must_use]
pub fn scroll_offset(&self) -> usize;
#[must_use]
pub fn selected_section(&self) -> usize;
pub fn reset(&mut self);components/governance/mod.rs
Read declaration text · 8 declaration entries
pub mod constitution_view;
pub mod proposal_card;
pub mod treasury_display;
pub mod voting_panel;
pub use constitution_view::{ConstitutionView, ConstitutionViewState};
pub use proposal_card::{ProposalCard, ProposalCardState};
pub use treasury_display::TreasuryDisplay;
pub use voting_panel::{VotingPanel, VotingPanelState};components/governance/proposal_card.rs
Read declaration text · 8 declaration entries
#[derive(Debug, Clone)]
pub struct ProposalCard<'a> {
}
#[must_use]
pub fn new(proposal: &'a ProposalInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn compact(mut self, compact: bool) -> Self;
#[derive(Debug, Clone, Default)]
pub struct ProposalCardState {
}
pub fn toggle_expand(&mut self);
#[must_use]
pub fn is_expanded(&self) -> bool;
pub fn reset(&mut self);components/governance/treasury_display.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone)]
pub struct TreasuryDisplay<'a> {
}
#[must_use]
pub fn new(treasury: &'a TreasuryInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn max_transactions(mut self, max: usize) -> Self;components/governance/voting_panel.rs
Read declaration text · 10 declaration entries
#[derive(Debug, Clone)]
pub struct VotingPanel<'a> {
}
#[must_use]
pub fn new(proposal: &'a ProposalInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn current_vote(mut self, vote: Option<VoteChoice>) -> Self;
#[derive(Debug, Clone, Default)]
pub struct VotingPanelState {
}
pub fn select_next(&mut self);
pub fn select_prev(&mut self);
#[must_use]
pub fn confirm(&self) -> Option<VoteChoice>;
#[must_use]
pub fn selected_index(&self) -> usize;
pub fn reset(&mut self);components/harness/attribution_table.rs
Read declaration text · 9 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AttributionTaskOutcomeBadge {
/// Task passed.
Pass,
/// Task failed.
Fail,
/// Task did not run.
NotRun,
}
#[derive(Debug, Clone)]
pub struct AttributionTableRow {
/// Task name.
pub task: String,
/// Outcome before the iteration's edits.
pub before: AttributionTaskOutcomeBadge,
/// Outcome after the iteration's edits.
pub after: AttributionTaskOutcomeBadge
}
#[must_use]
pub fn is_fix(&self) -> bool;
#[must_use]
pub fn is_regression(&self) -> bool;
#[derive(Debug, Clone)]
pub struct AttributionTable<'a> {
}
#[must_use]
pub fn new(rows: &'a [AttributionTableRow]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;
#[must_use]
pub fn no_border(mut self) -> Self;components/harness/component_tree.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HarnessComponentStatus {
/// Editable + currently in sync with the last commit.
Clean,
/// Editable + has uncommitted edits in the current iteration.
Dirty,
/// Read-only — the runtime owns it (e.g. `ShortTermMemory`).
ReadOnly,
}
#[derive(Debug, Clone)]
pub struct HarnessComponentRow {
/// Stable id (e.g. `"system_prompt"`). The SDK consumer sets
/// this from `HarnessComponentKind::as_key()`.
pub id: String,
/// Human-readable label (e.g. `"system prompt"`).
pub label: String,
/// Mount path relative to the workspace root.
pub mount: String,
/// Status badge.
pub status: HarnessComponentStatus,
/// Number of edits applied to this component in the current
/// iteration. Rendered as `+N` next to the label.
pub edit_count: u32
}
#[derive(Debug, Clone, Default)]
pub struct HarnessComponentTreeState {
}
#[must_use]
pub fn selected(&self) -> usize;
pub fn move_down(&mut self, len: usize);
pub fn move_up(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct HarnessComponentTree<'a> {
}
#[must_use]
pub fn new(rows: &'a [HarnessComponentRow]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;components/harness/manifest_view.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ManifestVerdictBadge {
/// Edit not yet evaluated (this iteration's fresh manifest).
Pending,
/// `AttributionDecision::Confirmed`.
Confirmed,
/// `AttributionDecision::PartiallyConfirmed`.
PartiallyConfirmed,
/// `AttributionDecision::Refuted`.
Refuted,
/// `AttributionDecision::UnfalsifiableContract`.
UnfalsifiableContract,
}
#[derive(Debug, Clone)]
pub struct ManifestEntryView {
/// Entry id (uuid-as-string).
pub id: String,
/// One-line summary of the targeted fix.
pub targeted_fix: String,
/// Diagnosed root cause.
pub root_cause: String,
/// Free-form list of failure evidence items.
pub failure_evidence: Vec<String>,
/// Tasks the contract claims will be fixed.
pub expected_fixes: Vec<String>,
/// Tasks the contract flags as at-risk for regression.
pub at_risk_regressions: Vec<String>,
/// Verdict badge.
pub verdict: ManifestVerdictBadge,
/// Component label (e.g. `"system prompt"`) the edit targets.
pub component_label: String,
/// Path the edit touched.
pub edit_path: String
}
#[derive(Debug, Clone)]
pub struct ChangeManifestView {
}
#[must_use]
pub fn new(entry: ManifestEntryView) -> Self;
#[must_use]
pub fn entry(&self) -> &ManifestEntryView;components/harness/mod.rs
Read declaration text · 3 declaration entries
pub use attribution_table::{AttributionTable, AttributionTableRow, AttributionTaskOutcomeBadge};
pub use component_tree::{
HarnessComponentRow, HarnessComponentStatus, HarnessComponentTree, HarnessComponentTreeState,
};
pub use manifest_view::{ChangeManifestView, ManifestEntryView, ManifestVerdictBadge};components/history/approval_cell.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone, PartialEq)]
pub enum ApprovalState {
/// The agent is waiting for the user's decision.
Pending,
/// The user resolved the request.
Resolved(PermissionDecision),
}
#[derive(Debug, Clone)]
pub struct ApprovalCell {
}
#[must_use]
pub fn pending(request: PermissionRequest) -> Self;
#[must_use]
pub fn resolved(request: PermissionRequest, decision: PermissionDecision) -> Self;
#[must_use]
pub fn request(&self) -> &PermissionRequest;
#[must_use]
pub fn state(&self) -> &ApprovalState;components/history/assistant_cell.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone)]
pub struct AssistantCell {
}
#[must_use]
pub fn new(sender: impl Into<String>, body: impl Into<String>) -> Self;
#[must_use]
pub fn sender_style(mut self, style: Style) -> Self;
#[must_use]
pub fn continuation(mut self) -> Self;
#[must_use]
pub fn body(&self) -> &str;
#[must_use]
pub fn sender(&self) -> &str;components/history/cell.rs
Read declaration text · 1 declaration entries
pub trait HistoryCell: Debug + Send + Sync {
/// The logical lines displayed in the main chat viewport.
fn display_lines(&self, width: u16) -> Vec<Line<'static>>;
/// Number of viewport rows needed to render this cell at `width`.
/// Defaults to the count of logical lines returned by
/// [`Self::display_lines`]. Override when the cell wraps content
/// or contains lines wider than `width`.
fn desired_height(&self, width: u16) -> u16 ;
/// Lines for the transcript overlay (e.g. Ctrl+T in Codex).
/// Defaults to [`Self::display_lines`]; override when the
/// transcript representation should differ (e.g. `ExecCell` may
/// show every grouped command in transcript mode but only the
/// most-recent in viewport mode).
fn transcript_lines(&self, width: u16) -> Vec<Line<'static>> ;
/// Coarse "animation tick" for cells whose rendered output depends
/// on elapsed time (spinners, shimmer effects). Returning `Some`
/// signals that any cached transcript output should be invalidated
/// once the tick changes; returning `None` (the default) means the
/// cell renders identically across frames.
fn transcript_animation_tick(&self) -> Option<u64> ;
/// True when this cell continues a stream from the previous cell.
/// Used by the view to suppress redundant headers / dividers
/// between consecutive assistant deltas. Defaults to `false`.
fn is_stream_continuation(&self) -> bool ;
}components/history/diff_cell.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub struct DiffCell {
}
#[must_use]
pub fn new(file: DiffFile) -> Self;
#[must_use]
pub fn from_unified_diff(source: &str) -> Vec<Self>;
#[must_use]
pub fn hide_summary(mut self) -> Self;
#[must_use]
pub fn file(&self) -> &DiffFile;components/history/exec_cell.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub enum ExecOutcome {
/// Command still running.
Running,
/// Command finished with the given exit code and (possibly empty)
/// captured stdout+stderr.
Finished {
/// Process exit code (0 = success).
exit_code: i32,
/// Aggregated stdout + stderr output.
output: String,
/// Wall-clock duration.
duration: Duration,
},
}
#[derive(Debug, Clone)]
pub struct ExecCell {
}
#[must_use]
pub fn new(command: impl AsRef<str>) -> Self;
#[must_use]
pub fn cwd(mut self, cwd: impl Into<String>) -> Self;
#[must_use]
pub fn with_outcome(mut self, outcome: ExecOutcome) -> Self;components/history/history_view.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone, Default)]
pub struct HistoryViewState {
}
#[must_use]
pub fn following() -> Self;
#[must_use]
pub fn is_following(&self) -> bool;
pub fn set_follow(&mut self, follow: bool);
pub fn scroll_up(&mut self, rows: u16);
pub fn scroll_down(&mut self, rows: u16);
pub fn jump_to_latest(&mut self);
#[derive(Debug, Clone)]
pub struct HistoryView<'a> {
}
#[must_use]
pub fn new(cells: &'a [Box<dyn HistoryCell>]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn total_height(&self, width: u16) -> u32;components/history/mod.rs
Read declaration text · 9 declaration entries
pub use approval_cell::{ApprovalCell, ApprovalState};
pub use assistant_cell::AssistantCell;
pub use cell::HistoryCell;
pub use diff_cell::DiffCell;
pub use exec_cell::{ExecCell, ExecOutcome};
pub use history_view::{HistoryView, HistoryViewState};
pub use system_cell::{SystemCell, SystemSeverity};
pub use tool_cell::{ToolCell, ToolCellOutcome};
pub use user_cell::UserCell;components/history/system_cell.rs
Read declaration text · 9 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SystemSeverity {
/// Informational notice (default).
Info,
/// Non-fatal warning.
Warn,
/// Error that did not crash the agent but the user should see.
Error,
/// Successful state change (operation completed, login granted).
Success,
}
#[derive(Debug, Clone)]
pub struct SystemCell {
}
#[must_use]
pub fn new(severity: SystemSeverity, body: impl Into<String>) -> Self;
#[must_use]
pub fn info(body: impl Into<String>) -> Self;
#[must_use]
pub fn warn(body: impl Into<String>) -> Self;
#[must_use]
pub fn error(body: impl Into<String>) -> Self;
#[must_use]
pub fn success(body: impl Into<String>) -> Self;
#[must_use]
pub fn severity(&self) -> SystemSeverity;
#[must_use]
pub fn body(&self) -> &str;components/history/tool_cell.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ToolCellOutcome {
/// Tool call still running — shows a "running…" suffix.
Running,
/// Tool returned successfully.
Success,
/// Tool failed.
Failed,
}
#[derive(Debug, Clone)]
pub struct ToolCell {
}
#[must_use]
pub fn new(tool_name: impl Into<String>, input: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_outcome(
mut self,
outcome: ToolCellOutcome,
output: impl AsRef<str>,
duration_ms: Option<u64>,
) -> Self;
pub fn set_expanded(&mut self, expanded: bool);
#[must_use]
pub fn is_expanded(&self) -> bool;components/history/user_cell.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub struct UserCell {
}
#[must_use]
pub fn new(body: impl Into<String>) -> Self;
#[must_use]
pub fn prefix_style(mut self, style: Style) -> Self;
#[must_use]
pub fn body_style(mut self, style: Style) -> Self;
#[must_use]
pub fn body(&self) -> &str;components/hitl/approval_chooser.rs
Read declaration text · 10 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ApprovalChooserAction {
/// Approve this specific request once.
AllowOnce,
/// Approve every request matching the suggested glob for the
/// rest of the session.
ApproveForSession,
/// Approve every request matching the suggested glob, and
/// persist the rule (e.g. write to `plugins.toml`).
ApproveForPrefix,
/// Decline this request.
Decline,
/// Open the linked thread / fullscreen detail view (Codex's
/// "open fullscreen" escape hatch for big payloads).
OpenThread,
}
#[derive(Debug, Clone, Default)]
pub struct ApprovalChooserState {
}
#[must_use]
pub fn focused(&self) -> ApprovalChooserAction;
pub fn move_next(&mut self);
pub fn move_prev(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn handle_key(&mut self, ev: &KeyEvent) -> Option<ApprovalChooserAction>;
#[derive(Debug, Clone)]
pub struct ApprovalChooser<'a> {
}
#[must_use]
pub fn new(request: &'a PermissionRequest) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/hitl/approval_dialog.rs
Read declaration text · 16 declaration entries
#[derive(Debug, Clone, Default)]
pub struct ApprovalDialogState {
}
pub fn select_next(&mut self);
pub fn select_prev(&mut self);
pub fn start_edit(&mut self);
pub fn cancel_edit(&mut self);
#[must_use]
pub fn confirm(&self) -> Option<ApprovalAction>;
pub fn append_char(&mut self, ch: char);
pub fn delete_char(&mut self);
pub fn reset(&mut self);
#[must_use]
pub const fn selected_action(&self) -> usize;
#[must_use]
pub fn edit_text(&self) -> &str;
#[must_use]
pub const fn is_editing(&self) -> bool;
#[derive(Debug, Clone)]
pub struct ApprovalDialog<'a> {
}
#[must_use]
pub fn new(request: &'a ApprovalRequest) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_agent_name(mut self, show: bool) -> Self;components/hitl/approval_queue.rs
Read declaration text · 10 declaration entries
#[derive(Debug, Clone, Default)]
pub struct ApprovalQueueState {
}
pub fn select_next(&mut self, len: usize);
pub fn select_prev(&mut self);
#[must_use]
pub const fn selected_index(&self) -> usize;
#[must_use]
pub const fn scroll_offset(&self) -> usize;
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct ApprovalQueue<'a> {
}
#[must_use]
pub fn new(requests: &'a [ApprovalRequest]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_position(mut self, show: bool) -> Self;components/hitl/confirmation.rs
Read declaration text · 14 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ConfirmButton {
/// The yes/accept action button.
Yes,
/// The no/cancel action button (default focus).
#[default]
No,
}
#[derive(Debug, Clone)]
pub struct ConfirmationPromptState {
/// Which button is focused.
pub focused: ConfirmButton,
/// Whether the user has made a decision (and what it was).
pub decision: Option<bool>,
/// Whether the prompt is visible.
pub visible: bool
}
#[must_use]
pub fn new() -> Self;
pub fn focus_yes(&mut self);
pub fn focus_no(&mut self);
pub fn toggle_focus(&mut self);
pub fn confirm(&mut self);
pub fn reset(&mut self);
pub fn show(&mut self);
pub fn hide(&mut self);
#[derive(Debug, Clone)]
pub struct ConfirmationPrompt<'a> {
}
#[must_use]
pub fn new(message: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn dangerous(mut self, dangerous: bool) -> Self;components/hitl/decision_panel.rs
Read declaration text · 14 declaration entries
#[derive(Debug, Clone, Default)]
pub struct DecisionPanelState {
}
pub fn select_next(&mut self, option_count: usize);
pub fn select_prev(&mut self, option_count: usize);
pub fn select_by_number(&mut self, n: usize, option_count: usize);
pub fn cancel(&mut self);
#[must_use]
pub fn confirm(&mut self, option_count: usize) -> Option<usize>;
#[must_use]
pub fn is_cancelled(&self) -> bool;
#[must_use]
pub fn selected_index(&self) -> usize;
#[must_use]
pub fn confirmed_index(&self) -> Option<usize>;
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct DecisionPanel<'a> {
}
#[must_use]
pub fn new(options: &'a [DecisionOption]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;components/hitl/mod.rs
Read declaration text · 14 declaration entries
pub mod approval_chooser;
pub mod approval_dialog;
pub mod approval_queue;
pub mod confirmation;
pub mod decision_panel;
pub mod permission_banner;
pub mod permission_prompt;
pub use approval_chooser::{ApprovalChooser, ApprovalChooserAction, ApprovalChooserState};
pub use approval_dialog::{ApprovalDialog, ApprovalDialogState};
pub use approval_queue::{ApprovalQueue, ApprovalQueueState};
pub use confirmation::{ConfirmButton, ConfirmationPrompt, ConfirmationPromptState};
pub use decision_panel::{DecisionPanel, DecisionPanelState};
pub use permission_banner::PermissionBanner;
pub use permission_prompt::{PermissionPrompt, PermissionPromptState};components/hitl/permission_banner.rs
Read declaration text · 3 declaration entries
#[derive(Debug, Clone)]
pub struct PermissionBanner<'a> {
}
#[must_use]
pub fn new(pending_count: usize, auto_approved_count: usize) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/hitl/permission_prompt.rs
Read declaration text · 12 declaration entries
#[derive(Debug, Clone)]
pub struct PermissionPromptState {
/// The user's decision (if made).
pub decision: Option<PermissionDecision>,
/// The auto-generated glob pattern (shown when user presses 'a').
pub suggested_pattern: Option<String>,
/// Whether the pattern confirmation is showing.
pub showing_pattern: bool
}
#[must_use]
pub fn new() -> Self;
pub fn allow_once(&mut self);
pub fn deny(&mut self);
pub fn start_always_allow(&mut self, resource: &str);
pub fn confirm_pattern(&mut self);
pub fn cancel_pattern(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn generate_glob_pattern(resource: &str) -> String;
#[derive(Debug, Clone)]
pub struct PermissionPrompt<'a> {
}
#[must_use]
pub fn new(request: &'a PermissionRequest) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/metrics/card.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub struct MetricCard<'a> {
}
#[must_use]
pub fn new(label: &'a str, value: &'a str) -> Self;
#[must_use]
pub fn delta(mut self, delta: &'a str) -> Self;
#[must_use]
pub fn unit(mut self, unit: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/metrics/cost_tracker.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone)]
pub struct CostTracker<'a> {
}
#[must_use]
pub fn new(entries: &'a [CostEntry]) -> Self;
#[must_use]
pub fn currency_symbol(mut self, symbol: &'a str) -> Self;
#[must_use]
pub fn rate_per_min(mut self, rate: f64) -> Self;
#[must_use]
pub fn previous_total_cents(mut self, cents: u64) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/metrics/latency_display.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone)]
pub struct LatencyDisplay<'a> {
}
#[must_use]
pub fn new(snapshot: &'a LatencySnapshot) -> Self;
#[must_use]
pub fn warn_threshold_ms(mut self, ms: u64) -> Self;
#[must_use]
pub fn error_threshold_ms(mut self, ms: u64) -> Self;
#[must_use]
pub fn unit(mut self, unit: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/metrics/metrics_bar.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone)]
pub struct MetricBarItem<'a> {
/// Metric label (e.g., "Tokens", "Cost", "Latency").
pub label: &'a str,
/// Main value display (e.g., "4,096", "$12.34", "230ms").
pub value: &'a str,
/// Delta from previous value (e.g., "+12%", "-3.2%").
pub delta: &'a str,
/// Unit suffix (e.g., "tok", "ms", "req/s").
pub unit: &'a str
}
#[derive(Debug, Clone)]
pub struct MetricsBar<'a> {
}
#[must_use]
pub fn new(items: &'a [MetricBarItem<'a>]) -> Self;
#[must_use]
pub fn min_card_width(mut self, width: u16) -> Self;
#[must_use]
pub fn spacing(mut self, spacing: u16) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/metrics/mod.rs
Read declaration text · 5 declaration entries
pub use card::MetricCard;
pub use cost_tracker::CostTracker;
pub use latency_display::LatencyDisplay;
pub use metrics_bar::{MetricBarItem, MetricsBar};
pub use token_meter::TokenMeter;components/metrics/token_meter.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub struct TokenMeter<'a> {
}
#[must_use]
pub fn new(used: u64, limit: u64) -> Self;
#[must_use]
pub fn model(mut self, model: &'a str) -> Self;
#[must_use]
pub fn cost(mut self, cost: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/mod.rs
Read declaration text · 9 declaration entries
pub mod agent;
pub mod chat;
pub mod governance;
pub mod harness;
pub mod history;
pub mod hitl;
pub mod metrics;
pub mod system;
pub mod workflow;components/system/app_shell.rs
Read declaration text · 19 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum ShellPanel {
/// The top header strip.
Header,
/// The left sidebar panel.
Sidebar,
/// The main content area.
#[default]
Content,
/// The bottom footer strip.
Footer,
}
#[derive(Debug, Clone)]
pub struct AppShellState {
}
pub fn toggle_sidebar(&mut self);
pub fn set_focus(&mut self, panel: ShellPanel);
pub fn cycle_focus(&mut self);
#[must_use]
pub fn is_sidebar_collapsed(&self) -> bool;
#[must_use]
pub fn focused_panel(&self) -> ShellPanel;
pub fn reset(&mut self);
#[must_use]
pub fn header_area(&self) -> Rect;
#[must_use]
pub fn sidebar_area(&self) -> Rect;
#[must_use]
pub fn content_area(&self) -> Rect;
#[must_use]
pub fn footer_area(&self) -> Rect;
#[derive(Debug, Clone)]
pub struct AppShell<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn header_height(mut self, height: u16) -> Self;
#[must_use]
pub fn footer_height(mut self, height: u16) -> Self;
#[must_use]
pub fn sidebar_width(mut self, width: u16) -> Self;
#[must_use]
pub fn show_borders(mut self, show: bool) -> Self;components/system/banner.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone)]
pub struct Banner<'a> {
}
#[must_use]
pub fn new(text: &'a str) -> Self;
#[must_use]
pub fn gradient(mut self, gradient: bool) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/block_logo.rs
Read declaration text · 11 declaration entries
pub const BLOCK_LOGO_HEIGHT: u16;
pub const BLOCK_LOGO_GLYPH_WIDTH: u16;
pub const BLOCK_LOGO_SPACING: u16;
#[derive(Debug, Clone)]
pub struct BlockLogo<'a> {
}
#[must_use]
pub fn new(text: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn fill(mut self, color: Color) -> Self;
#[must_use]
pub fn gradient(mut self, from: Color, to: Color) -> Self;
#[must_use]
pub fn dim_prefix(mut self, n: usize) -> Self;
#[must_use]
pub fn measured_width(&self) -> u16;
#[must_use]
pub const fn measured_height(&self) -> u16;components/system/command_palette.rs
Read declaration text · 22 declaration entries
#[must_use]
pub fn fuzzy_score(query: &str, text: &str) -> Option<u32>;
#[derive(Debug, Clone, Default)]
pub struct CommandPaletteState {
}
pub fn set_query(&mut self, text: &str, items: &[PaletteItem]);
pub fn append_char(&mut self, ch: char);
pub fn delete_char(&mut self);
pub fn refilter(&mut self, items: &[PaletteItem]);
pub fn select_next(&mut self);
pub fn select_prev(&mut self);
#[must_use]
pub fn confirm(&self) -> Option<usize>;
pub fn show(&mut self);
pub fn hide(&mut self);
pub fn toggle(&mut self);
#[must_use]
pub fn is_visible(&self) -> bool;
pub fn reset(&mut self);
#[must_use]
pub fn query(&self) -> &str;
#[must_use]
pub fn selected(&self) -> usize;
#[must_use]
pub fn filtered_indices(&self) -> &[usize];
#[derive(Debug, Clone)]
pub struct CommandPalette<'a> {
}
#[must_use]
pub fn new(items: &'a [PaletteItem]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn max_visible(mut self, max_visible: usize) -> Self;
#[must_use]
pub fn width_percent(mut self, pct: u16) -> Self;components/system/custom_logo.rs
Read declaration text · 9 declaration entries
pub const CLAUSEN_LOGO_ROWS: &[&str];
#[derive(Debug, Clone)]
pub struct CustomLogo<'a> {
}
#[must_use]
pub fn new(rows: &'a [&'a str]) -> Self;
#[must_use]
pub fn clausen() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn fill(mut self, color: Color) -> Self;
#[must_use]
pub fn shade(mut self, color: Color) -> Self;
#[must_use]
pub fn measured_width(&self) -> u16;
#[must_use]
pub fn measured_height(&self) -> u16;components/system/focus_card.rs
Read declaration text · 8 declaration entries
#[derive(Debug, Clone)]
pub struct FocusCard<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn placeholder(mut self, text: &'a str) -> Self;
#[must_use]
pub fn mode(mut self, label: &'a str) -> Self;
#[must_use]
pub fn model(mut self, name: &'a str) -> Self;
#[must_use]
pub fn tagline(mut self, text: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub const fn suggested_height() -> u16;components/system/goal_display.rs
Read declaration text · 8 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GoalStepStatus {
/// Not started yet.
Pending,
/// Currently executing.
InProgress,
/// Completed successfully.
Done,
/// Skipped by the user / planner.
Skipped,
/// Failed (with an error).
Failed,
}
#[derive(Debug, Clone)]
pub struct GoalStep {
/// One-line description of the step.
pub label: String,
/// Current execution status.
pub status: GoalStepStatus
}
#[must_use]
pub fn new(label: impl Into<String>, status: GoalStepStatus) -> Self;
#[derive(Debug, Clone)]
pub struct GoalDisplay<'a> {
}
#[must_use]
pub fn new(goal: &'a str, steps: &'a [GoalStep]) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;
#[must_use]
pub fn no_border(mut self) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/hint_bar.rs
Read declaration text · 9 declaration entries
#[derive(Debug, Clone)]
pub struct HintItem {
/// Keystroke label (e.g. `"tab"`, `"ctrl+p"`).
pub key: String,
/// What the key does (e.g. `"agents"`, `"commands"`).
pub action: String
}
#[must_use]
pub fn new(key: impl Into<String>, action: impl Into<String>) -> Self;
#[must_use]
pub fn width(&self) -> u16;
#[derive(Debug, Clone)]
pub struct HintBar<'a> {
}
#[must_use]
pub fn new(items: &'a [HintItem]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn right_align(mut self, on: bool) -> Self;
#[must_use]
pub fn item_gap(mut self, gap: u16) -> Self;
#[must_use]
pub fn measured_width(&self) -> u16;components/system/keyboard_help.rs
Read declaration text · 12 declaration entries
#[derive(Debug, Clone, Default)]
pub struct KeyboardHelpState {
}
pub fn show(&mut self);
pub fn hide(&mut self);
pub fn toggle(&mut self);
#[must_use]
pub fn is_visible(&self) -> bool;
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct KeyboardHelp<'a> {
}
#[must_use]
pub fn new(shortcuts: &'a [KeyShortcut]) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/log_viewer.rs
Read declaration text · 18 declaration entries
#[derive(Debug, Clone)]
pub struct LogViewer<'a> {
}
#[must_use]
pub fn new(entries: &'a [LogEntry]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn auto_scroll(mut self, enabled: bool) -> Self;
#[derive(Debug, Clone)]
pub struct LogViewerState {
}
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn scroll_to_bottom(&mut self, entries_len: usize, visible_height: usize);
pub fn toggle_level(&mut self, level: LogLevel);
#[must_use]
pub fn is_level_visible(&self, level: LogLevel) -> bool;
pub fn set_search(&mut self, query: &str);
pub fn clear_search(&mut self);
pub fn toggle_auto_scroll(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn scroll_offset(&self) -> usize;
#[must_use]
pub fn level_filter(&self) -> u8;
#[must_use]
pub fn search_query(&self) -> &str;
#[must_use]
pub fn auto_scroll(&self) -> bool;components/system/mod.rs
Read declaration text · 47 declaration entries
pub mod app_shell;
pub mod block_logo;
pub mod command_palette;
pub mod custom_logo;
pub mod focus_card;
pub mod hint_bar;
pub mod keyboard_help;
pub mod log_viewer;
pub mod modal;
pub mod model_picker;
pub mod notification_toast;
pub mod pager_overlay;
pub mod resume_picker;
pub mod settings_palette;
pub mod slash_dropdown;
pub mod split_pane;
pub mod status_footer;
pub mod tabs;
pub mod welcome_screen;
pub use app_shell::{AppShell, AppShellState, ShellPanel};
pub use banner::Banner;
pub use block_logo::{BlockLogo, BLOCK_LOGO_GLYPH_WIDTH, BLOCK_LOGO_HEIGHT, BLOCK_LOGO_SPACING};
pub use command_palette::{CommandPalette, CommandPaletteState};
pub use custom_logo::{CustomLogo, CLAUSEN_LOGO_ROWS};
pub use focus_card::FocusCard;
pub use goal_display::{GoalDisplay, GoalStep, GoalStepStatus};
pub use hint_bar::{HintBar, HintItem};
pub use keyboard_help::{KeyboardHelp, KeyboardHelpState};
pub use log_viewer::{LogViewer, LogViewerState};
pub use modal::{Modal, ModalButton, ModalState};
pub use model_picker::{ModelCapabilities, ModelPicker, ModelPickerRow, ModelPickerState};
pub use notification_toast::{NotificationToast, NotificationToastState, ToastMessage};
pub use pager_overlay::{PagerOverlay, PagerOverlayState};
pub use resume_picker::{ResumePicker, ResumePickerRow, ResumePickerState};
pub use settings_palette::{
PendingSelection, SettingsPalette, SettingsPaletteItem, SettingsPalettePage,
SettingsPaletteState,
};
pub use shimmer::{Shimmer, ShimmerState, SHIMMER_DEFAULT_WINDOW};
pub use slash_dropdown::{SlashDropdown, SlashDropdownItem, SlashDropdownState};
pub use spinner::{Spinner, SpinnerStyle};
pub use split_pane::{CollapseState, SplitDirection, SplitPane, SplitPaneState};
pub use status_bar::StatusBar;
pub use status_footer::{StatusFooter, StatusFooterIndicator};
pub use status_indicator::{
fmt_elapsed_compact, StatusIndicator, StatusIndicatorState, StatusKind,
};
pub use tabs::{TabItem, Tabs, TabsState};
pub use theme_picker::{ThemePicker, ThemePickerRow, ThemePickerState};
pub use thinking::ThinkingIndicator;
pub use thinking_animation::{
ThinkingAnimation, ThinkingAnimationState, THINKING_ANIMATION_DEFAULT_CHARSET,
THINKING_ANIMATION_DEFAULT_WIDTH,
};
pub use welcome_screen::{WelcomeConfig, WelcomeScreen};components/system/modal.rs
Read declaration text · 17 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum ModalButton {
/// The confirm/accept action button.
Confirm,
/// The cancel/dismiss action button (default focus).
#[default]
Cancel,
}
#[derive(Debug, Clone)]
pub struct ModalState {
}
#[must_use]
pub fn new(title: &str) -> Self;
pub fn set_body(&mut self, body: &str);
pub fn show(&mut self);
pub fn hide(&mut self);
pub fn toggle(&mut self);
pub fn cycle_focus(&mut self);
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
#[must_use]
pub fn is_visible(&self) -> bool;
#[must_use]
pub fn focused_button(&self) -> ModalButton;
#[derive(Debug, Clone)]
pub struct Modal<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn confirm_label(mut self, label: &'a str) -> Self;
#[must_use]
pub fn cancel_label(mut self, label: &'a str) -> Self;components/system/model_picker.rs
Read declaration text · 12 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ModelCapabilities {
/// Whether the model supports tool / function calling.
pub tools: bool,
/// Whether the model supports vision input.
pub vision: bool,
/// Whether the model exposes a "thinking" / reasoning channel.
pub thinking: bool,
/// Whether the model is generally available (vs. preview).
pub ga: bool
}
#[must_use]
pub fn none() -> Self;
#[derive(Debug, Clone)]
pub struct ModelPickerRow {
/// Stable id (e.g. `"claude-opus-4.7"`).
pub id: String,
/// Display name (e.g. `"Claude Opus 4.7 (1M)"`).
pub name: String,
/// Short provider label (e.g. `"Anthropic"`).
pub provider: String,
/// One-line description shown below the name.
pub description: String,
/// Capability flags rendered as a `[T] [V] [R]` badge strip.
pub capabilities: ModelCapabilities,
/// Coarse cost tier label (e.g. `"$"`, `"$$"`, `"$$$"`).
pub cost: String
}
#[derive(Debug, Clone, Default)]
pub struct ModelPickerState {
}
#[must_use]
pub fn selected(&self) -> usize;
pub fn move_down(&mut self, len: usize);
pub fn move_up(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct ModelPicker<'a> {
}
#[must_use]
pub fn new(rows: &'a [ModelPickerRow]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;components/system/notification_toast.rs
Read declaration text · 14 declaration entries
#[derive(Debug, Clone)]
pub struct ToastMessage {
/// The severity level of this notification.
pub severity: Severity,
/// The sanitized message text.
pub message: String,
/// Number of ticks remaining before auto-dismissal.
pub remaining_ticks: u16
}
#[must_use]
pub fn new(severity: Severity, message: impl Into<String>, duration_ticks: u16) -> Self;
#[derive(Debug, Clone, Default)]
pub struct NotificationToastState {
}
pub fn push(&mut self, severity: Severity, message: impl Into<String>, duration_ticks: u16);
pub fn tick(&mut self);
pub fn dismiss(&mut self);
pub fn dismiss_all(&mut self);
#[must_use]
pub fn is_empty(&self) -> bool;
#[must_use]
pub fn count(&self) -> usize;
#[derive(Debug, Clone)]
pub struct NotificationToast<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn max_visible(mut self, max: usize) -> Self;
#[must_use]
pub fn toast_width(mut self, width: u16) -> Self;components/system/pager_overlay.rs
Read declaration text · 15 declaration entries
#[derive(Debug, Clone, Default)]
pub struct PagerOverlayState {
}
#[must_use]
pub fn scroll(&self) -> u16;
pub fn line_up(&mut self);
pub fn line_down(&mut self);
pub fn page_up(&mut self, viewport_height: u16);
pub fn page_down(&mut self, viewport_height: u16);
pub fn half_page_up(&mut self, viewport_height: u16);
pub fn half_page_down(&mut self, viewport_height: u16);
pub fn jump_top(&mut self);
pub fn jump_bottom(&mut self, content_height: u16, viewport_height: u16);
#[derive(Debug, Clone)]
pub struct PagerOverlay<'a> {
}
#[must_use]
pub fn new(lines: &'a [Line<'static>]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;
#[must_use]
pub fn footer_hint(mut self, hint: &'a str) -> Self;components/system/resume_picker.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone)]
pub struct ResumePickerRow {
/// Stable id used by the activation handler to identify the
/// chosen session (typically the session uuid as a string).
pub id: String,
/// Primary label (e.g. "clausen — /Users/me/repo").
pub title: String,
/// One-line preview (e.g. the first user message, truncated).
pub preview: String,
/// Right-aligned metadata column (e.g. "12 turns · 3m ago").
pub meta: String
}
#[derive(Debug, Clone, Default)]
pub struct ResumePickerState {
}
#[must_use]
pub fn selected(&self) -> usize;
pub fn move_down(&mut self, len: usize);
pub fn move_up(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct ResumePicker<'a> {
}
#[must_use]
pub fn new(rows: &'a [ResumePickerRow]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;
#[must_use]
pub fn empty_label(mut self, label: &'a str) -> Self;components/system/settings_palette.rs
Read declaration text · 30 declaration entries
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub enum SettingsPalettePage {
/// Top-level menu (Modes / Providers / …).
#[default]
Root,
/// Mode picker.
Modes,
/// Provider picker.
Providers,
/// Per-provider hub: drills into Models or Settings for the
/// chosen provider. Replaces the old special-case Flocks page —
/// every provider now goes through this same hub.
Provider { provider_id: String },
/// Models for a specific provider.
Models { provider_id: String },
/// Provider-specific settings (api keys, base URLs, Flocks CLI
/// selection, etc.). Field metadata comes from the adapter.
ProviderSettings { provider_id: String },
/// Flocks CLI picker — only reachable from
/// `ProviderSettings { provider_id == "flocks" }`.
FlocksClis,
/// Models for a specific Flocks CLI.
FlocksModels { cli_id: String },
}
#[must_use]
pub fn title(&self) -> String;
#[derive(Debug, Clone)]
pub struct SettingsPaletteItem {
/// Stable identifier — passed back to the runtime when this row
/// is selected.
pub id: String,
/// Primary label.
pub label: String,
/// Optional secondary description (rendered dim, after the label).
pub description: String,
/// `true` if the row represents the *currently-active* selection
/// — gets a check glyph and accent color.
pub active: bool,
/// `true` if picking this row drills into a sub-page rather than
/// applying a value directly. Drill-in rows show a `›` glyph.
pub drills_in: bool,
/// Optional badge rendered to the right of the row (e.g.
/// `"healthy"`, `"offline"`, `"context: 1M"`). Dim by default.
pub badge: String
}
#[must_use]
pub fn leaf(id: impl Into<String>, label: impl Into<String>) -> Self;
#[must_use]
pub fn drill(id: impl Into<String>, label: impl Into<String>) -> Self;
#[must_use]
pub fn description(mut self, text: impl Into<String>) -> Self;
#[must_use]
pub fn active(mut self, on: bool) -> Self;
#[must_use]
pub fn badge(mut self, text: impl Into<String>) -> Self;
#[derive(Debug, Clone, Default)]
pub struct SettingsPaletteState {
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PendingSelection {
/// The page where the selection happened.
pub page: SettingsPalettePage,
/// The selected item's id.
pub item_id: String
}
#[must_use]
pub fn is_visible(&self) -> bool;
#[must_use]
pub fn page(&self) -> &SettingsPalettePage;
#[must_use]
pub fn cursor(&self) -> usize;
#[must_use]
pub fn filter(&self) -> &str;
pub fn open(&mut self);
pub fn close(&mut self);
pub fn drill(&mut self, page: SettingsPalettePage);
pub fn back(&mut self) -> bool;
pub fn cursor_up(&mut self);
pub fn cursor_down(&mut self, len: usize);
pub fn filter_push(&mut self, ch: char);
pub fn filter_pop(&mut self);
pub fn filter_clear(&mut self);
pub fn select(&mut self, item_id: impl Into<String>);
pub fn take_pending(&mut self) -> Option<PendingSelection>;
#[derive(Debug, Clone)]
pub struct SettingsPalette<'a> {
}
#[must_use]
pub fn new(items: &'a [SettingsPaletteItem]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn hint(mut self, hint: &'a str) -> Self;
#[must_use]
pub fn filtered_indices(items: &[SettingsPaletteItem], filter: &str) -> Vec<usize>;components/system/shimmer.rs
Read declaration text · 11 declaration entries
pub const SHIMMER_DEFAULT_WINDOW: u16;
#[derive(Debug, Clone, Default)]
pub struct ShimmerState {
}
pub fn advance(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn tick(&self) -> u64;
#[derive(Debug, Clone)]
pub struct Shimmer<'a> {
}
#[must_use]
pub fn new(label: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn window(mut self, window: u16) -> Self;
#[must_use]
pub fn base_fg(mut self, fg: Color) -> Self;
#[must_use]
pub fn bright_fg(mut self, fg: Color) -> Self;components/system/slash_dropdown.rs
Read declaration text · 17 declaration entries
#[derive(Debug, Clone)]
pub struct SlashDropdownItem {
/// Command name (e.g., "mode").
pub name: String,
/// Short description (e.g., "Switch mode (chat/auto)").
pub description: String,
/// Usage template (e.g., "/mode <chat|auto>").
pub usage: String,
/// Category label (e.g., "built-in" or plugin name).
pub category: String
}
#[derive(Debug, Clone, Default)]
pub struct SlashDropdownState {
}
pub fn show(&mut self);
pub fn hide(&mut self);
#[must_use]
pub fn is_visible(&self) -> bool;
pub fn set_query(&mut self, text: &str, items: &[SlashDropdownItem]);
pub fn select_next(&mut self);
pub fn select_prev(&mut self);
#[must_use]
pub fn confirm(&self) -> Option<usize>;
pub fn reset(&mut self);
#[must_use]
pub fn query(&self) -> &str;
#[must_use]
pub fn filtered_indices(&self) -> &[usize];
#[must_use]
pub fn selected(&self) -> usize;
#[derive(Debug, Clone)]
pub struct SlashDropdown<'a> {
}
#[must_use]
pub fn new(items: &'a [SlashDropdownItem]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn max_visible(mut self, n: usize) -> Self;components/system/spinner.rs
Read declaration text · 6 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum SpinnerStyle {
/// Braille pattern dots: ⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏
#[default]
Dots,
/// Line rotation: |/-\
Line,
/// Arc rotation: ◜◝◞◟
Arc,
/// Bounce: ⠁⠂⠄⡀⢀⠠⠐⠈
Bounce,
/// Moon phases: 🌑🌒🌓🌔🌕🌖🌗🌘
Moon,
/// Clock: 🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛
Clock,
/// Arrow: ←↖↑↗→↘↓↙
Arrow,
/// Toggle: ⊶⊷
Toggle,
/// Growing bar: ▏▎▍▌▋▊▉█
GrowingBar,
/// Box bounce: ▖▘▝▗
BoxBounce,
}
#[derive(Debug, Clone)]
pub struct Spinner<'a> {
}
#[must_use]
pub fn new(tick: usize) -> Self;
#[must_use]
pub fn style(mut self, style: SpinnerStyle) -> Self;
#[must_use]
pub fn label(mut self, label: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/split_pane.rs
Read declaration text · 20 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SplitDirection {
/// Side-by-side layout: primary on the left, secondary on the right.
/// The divider is a vertical line of `│` characters.
Horizontal,
/// Stacked layout: primary on top, secondary on the bottom.
/// The divider is a horizontal line of `─` characters.
Vertical,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum CollapseState {
/// Both panes are visible with a divider between them.
#[default]
None,
/// Primary pane is collapsed; secondary fills the entire area.
Primary,
/// Secondary pane is collapsed; primary fills the entire area.
Secondary,
}
#[derive(Debug, Clone)]
pub struct SplitPaneState {
}
#[must_use]
pub fn new(direction: SplitDirection, ratio: f32) -> Self;
pub fn set_ratio(&mut self, ratio: f32);
pub fn resize(&mut self, delta: i16);
pub fn collapse_primary(&mut self);
pub fn collapse_secondary(&mut self);
pub fn expand(&mut self);
pub fn toggle_collapse(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn direction(&self) -> SplitDirection;
#[must_use]
pub fn ratio(&self) -> f32;
#[must_use]
pub fn collapsed(&self) -> CollapseState;
#[must_use]
pub fn primary_area(&self, area: Rect) -> Rect;
#[must_use]
pub fn secondary_area(&self, area: Rect) -> Rect;
#[must_use]
pub fn divider_area(&self, area: Rect) -> Rect;
#[derive(Debug, Clone)]
pub struct SplitPane<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/status_bar.rs
Read declaration text · 8 declaration entries
#[derive(Debug, Clone)]
pub struct StatusBar<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn connection(mut self, text: &'a str) -> Self;
#[must_use]
pub fn mode(mut self, text: &'a str) -> Self;
#[must_use]
pub fn agent(mut self, text: &'a str) -> Self;
#[must_use]
pub fn metric(mut self, text: &'a str) -> Self;
#[must_use]
pub fn hint(mut self, text: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/status_footer.rs
Read declaration text · 11 declaration entries
#[derive(Debug, Clone)]
pub struct StatusFooterIndicator {
pub dot: char,
pub label: String,
pub active: bool
}
#[must_use]
pub fn new(label: impl Into<String>) -> Self;
#[must_use]
pub fn dot(mut self, glyph: char) -> Self;
#[must_use]
pub fn inactive(mut self) -> Self;
#[derive(Debug, Clone)]
pub struct StatusFooter<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn left(mut self, text: &'a str) -> Self;
#[must_use]
pub fn indicators(mut self, items: &'a [StatusFooterIndicator]) -> Self;
#[must_use]
pub fn right(mut self, text: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn indicator_gap(mut self, gap: u16) -> Self;components/system/status_indicator.rs
Read declaration text · 13 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum StatusKind {
/// No active response — just the prompt blinking.
Idle,
/// Model thinking (no tokens streamed yet).
Thinking,
/// Tokens streaming in.
Streaming,
/// Tool / shell call in flight.
ToolCall,
/// User pressed `Esc` / `/stop` and the SDK is draining.
Stopping,
/// Stream finished, waiting on the next user input.
Done,
}
#[must_use]
pub fn is_busy(self) -> bool;
#[must_use]
pub fn label(self) -> &'static str;
#[derive(Debug, Clone, Default)]
pub struct StatusIndicatorState {
/// Animation tick (caller increments each frame).
pub tick: u64
}
pub fn advance(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct StatusIndicator<'a> {
}
#[must_use]
pub fn new(kind: StatusKind) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn elapsed(mut self, elapsed: Duration) -> Self;
#[must_use]
pub fn detail(mut self, detail: &'a str) -> Self;
#[must_use]
pub fn interrupt_hint(mut self, on: bool) -> Self;
#[must_use]
pub fn fmt_elapsed_compact(elapsed_secs: u64) -> String;components/system/tabs.rs
Read declaration text · 20 declaration entries
#[derive(Debug, Clone)]
pub struct TabItem {
}
#[must_use]
pub fn new(label: impl Into<String>) -> Self;
#[must_use]
pub fn with_badge(mut self, count: u32) -> Self;
#[must_use]
pub fn label(&self) -> &str;
#[must_use]
pub fn badge(&self) -> Option<u32>;
#[derive(Debug, Clone)]
pub struct TabsState {
}
#[must_use]
pub fn new(items: Vec<TabItem>) -> Self;
pub fn select(&mut self, index: usize);
pub fn next(&mut self);
pub fn prev(&mut self);
#[must_use]
pub fn active(&self) -> usize;
#[must_use]
pub fn active_label(&self) -> &str;
#[must_use]
pub fn len(&self) -> usize;
#[must_use]
pub fn is_empty(&self) -> bool;
pub fn set_badge(&mut self, index: usize, count: Option<u32>);
pub fn reset(&mut self);
#[must_use]
pub fn items(&self) -> &[TabItem];
#[derive(Debug, Clone)]
pub struct Tabs<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/theme_picker.rs
Read declaration text · 10 declaration entries
#[derive(Debug, Clone)]
pub struct ThemePickerRow {
/// Stable id (used by the activation handler).
pub id: String,
/// Display name (e.g. "Solarized Dark").
pub name: String,
/// One-line description shown beside the focus marker.
pub description: String,
/// Background color preview (for the swatch column).
pub preview_bg: Color,
/// Foreground color preview.
pub preview_fg: Color,
/// Accent color preview.
pub preview_accent: Color
}
#[derive(Debug, Clone, Default)]
pub struct ThemePickerState {
}
#[must_use]
pub fn selected(&self) -> usize;
pub fn move_down(&mut self, len: usize);
pub fn move_up(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct ThemePicker<'a> {
}
#[must_use]
pub fn new(rows: &'a [ThemePickerRow]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn title(mut self, title: &'a str) -> Self;components/system/thinking.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub struct ThinkingIndicator<'a> {
}
#[must_use]
pub fn new(tick: usize) -> Self;
#[must_use]
pub fn label(mut self, label: &'a str) -> Self;
#[must_use]
pub fn elapsed(mut self, elapsed: &'a str) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;components/system/thinking_animation.rs
Read declaration text · 15 declaration entries
pub const THINKING_ANIMATION_DEFAULT_WIDTH: u16;
pub const THINKING_ANIMATION_DEFAULT_CHARSET: &str;
#[derive(Debug, Clone)]
pub struct ThinkingAnimationState {
}
#[must_use]
pub fn with_width(width: u16) -> Self;
pub fn advance(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn width(&self) -> u16;
#[must_use]
pub fn tick(&self) -> u64;
#[derive(Debug, Clone)]
pub struct ThinkingAnimation<'a> {
}
#[must_use]
pub fn new() -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn width(mut self, width: u16) -> Self;
#[must_use]
pub fn charset(mut self, charset: &'a str) -> Self;
#[must_use]
pub fn fg(mut self, fg: Color) -> Self;
#[must_use]
pub fn bg(mut self, bg: Color) -> Self;components/system/welcome_screen.rs
Read declaration text · 19 declaration entries
#[derive(Debug, Clone, Default)]
pub struct WelcomeConfig {
/// Hero text rendered as block letters (e.g. `"clausen"`).
/// Ignored when [`Self::custom_logo_rows`] is set.
pub brand: String,
/// Optional pixel-art logo overriding the block-font [`Self::brand`].
/// Each row contains `█` (filled), `░` (shade), or ` ` (transparent)
/// cells — see [`crate::CustomLogo`] for the renderer and
/// [`crate::CLAUSEN_LOGO_ROWS`] for the bundled Clausen art.
pub custom_logo_rows: Option<&'static [&'static str]>,
/// How many leading characters of `brand` to render dim — used
/// for the opencode-style "open" dim / "code" bright effect.
/// Set to 0 to render the whole brand at full strength.
pub dim_prefix: usize,
/// Optional `(from, to)` truecolor gradient swept across the
/// block letters. Both colors must be `Color::Rgb`.
pub gradient: Option<(Color, Color)>,
/// Placeholder line shown inside the focus card.
pub placeholder: String,
/// Bold mode tag on the meta line (e.g. `"Build"`).
pub mode: String,
/// Model name (e.g. `"Kimi K2.6"`).
pub model: String,
/// Dim tagline that follows the model (e.g. `"Kimi For Coding"`).
pub model_tagline: String,
/// Hint pairs rendered in the bar below the focus card.
pub hints: Vec<HintItem>,
/// Footer left-aligned text (cwd, branch).
pub footer_left: String,
/// Footer center indicators.
pub footer_indicators: Vec<StatusFooterIndicator>,
/// Footer right-aligned text (typically version).
pub footer_right: String
}
#[must_use]
pub fn new(brand: impl Into<String>) -> Self;
#[must_use]
pub fn placeholder(mut self, text: impl Into<String>) -> Self;
#[must_use]
pub fn mode(mut self, label: impl Into<String>) -> Self;
#[must_use]
pub fn model(mut self, name: impl Into<String>) -> Self;
#[must_use]
pub fn model_tagline(mut self, text: impl Into<String>) -> Self;
#[must_use]
pub fn hints(mut self, items: Vec<HintItem>) -> Self;
#[must_use]
pub fn footer_left(mut self, text: impl Into<String>) -> Self;
#[must_use]
pub fn footer_indicators(mut self, items: Vec<StatusFooterIndicator>) -> Self;
#[must_use]
pub fn footer_right(mut self, text: impl Into<String>) -> Self;
#[must_use]
pub fn dim_prefix(mut self, n: usize) -> Self;
#[must_use]
pub fn gradient(mut self, from: Color, to: Color) -> Self;
#[must_use]
pub fn custom_logo(mut self, rows: &'static [&'static str]) -> Self;
#[derive(Debug, Clone)]
pub struct WelcomeScreen<'a> {
}
#[must_use]
pub fn new(config: &'a WelcomeConfig) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn focus_card_max_width(mut self, w: u16) -> Self;
#[must_use]
pub fn focus_card_rect(&self, area: Rect) -> Option<Rect>;
#[must_use]
pub fn input_overlay_rect(&self, area: Rect) -> Option<Rect>;components/workflow/mod.rs
Read declaration text · 8 declaration entries
pub mod progress_timeline;
pub mod task_list;
pub mod workflow_dag;
pub mod workflow_node;
pub use progress_timeline::ProgressTimeline;
pub use task_list::{TaskList, TaskListState};
pub use workflow_dag::{WorkflowDAG, WorkflowDAGState};
pub use workflow_node::WorkflowNode;components/workflow/progress_timeline.rs
Read declaration text · 5 declaration entries
#[derive(Debug, Clone)]
pub struct ProgressTimeline<'a> {
}
#[must_use]
pub fn new(steps: &'a [(String, TaskStatus)]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_elapsed(mut self, show: bool) -> Self;
#[must_use]
pub fn elapsed_seconds(mut self, elapsed: &'a [u64]) -> Self;components/workflow/task_list.rs
Read declaration text · 12 declaration entries
#[derive(Debug, Clone, Default)]
pub struct TaskListState {
}
pub fn select_next(&mut self, total_visible: usize);
pub fn select_prev(&mut self);
pub fn toggle_collapse(&mut self, id: impl AsRef<str>);
#[must_use]
pub fn selected_index(&self) -> usize;
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn reset(&mut self);
#[derive(Debug, Clone)]
pub struct TaskList<'a> {
}
#[must_use]
pub fn new(items: &'a [TaskItem]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn show_progress(mut self, show: bool) -> Self;components/workflow/workflow_dag.rs
Read declaration text · 14 declaration entries
#[derive(Debug, Clone, Default)]
pub struct WorkflowDAGState {
}
pub fn scroll_left(&mut self);
pub fn scroll_right(&mut self);
pub fn scroll_up(&mut self);
pub fn scroll_down(&mut self);
pub fn reset(&mut self);
#[must_use]
pub fn scroll_x(&self) -> usize;
#[must_use]
pub fn scroll_y(&self) -> usize;
#[derive(Debug, Clone)]
pub struct WorkflowDAG<'a> {
}
#[must_use]
pub fn new(nodes: &'a [WorkflowNodeInfo], edges: &'a [WorkflowEdge]) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn node_width(mut self, width: u16) -> Self;
#[must_use]
pub fn node_height(mut self, height: u16) -> Self;
#[must_use]
pub fn compute_layers(nodes: &[WorkflowNodeInfo], edges: &[WorkflowEdge]) -> Vec<Vec<usize>>;components/workflow/workflow_node.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone)]
pub struct WorkflowNode<'a> {
}
#[must_use]
pub fn new(info: &'a WorkflowNodeInfo) -> Self;
#[must_use]
pub fn theme(mut self, theme: &'a Theme) -> Self;
#[must_use]
pub fn compact(mut self, compact: bool) -> Self;effects.rs
Read declaration text · 3 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum KitEffect {
// ─── Chat Effects ────────────────────────────────────
/// New message slides up and fades in (250ms).
MessageAppear,
/// Blinking cursor at end of streaming text (500ms cycle).
StreamingCursor,
/// Tool call card expands (300ms).
ToolCallExpand,
/// Tool call card collapses (200ms).
ToolCallCollapse,
/// Code block copy flash (100ms).
CodeCopyFlash,
// ─── Agent Effects ───────────────────────────────────
/// Active agent status dot pulses (speed from theme).
StatusPulse,
/// Agent card glows briefly on status change (400ms).
StatusTransition,
/// Agent comes online — brief green glow (500ms).
AgentOnline,
/// Agent errors — brief red flash (300ms).
AgentError,
/// Agent terminated — fade to dim (600ms).
AgentTerminated,
// ─── System Effects ──────────────────────────────────
/// Cross-fade between screens (300ms).
ScreenTransition,
/// Toast slides in from edge (200ms).
NotificationSlideIn,
/// Toast fades out (300ms).
NotificationFadeOut,
/// Modal background dims (200ms).
ModalDim,
/// Modal content fades in (250ms).
ModalAppear,
/// Command palette drops down (150ms).
PaletteOpen,
// ─── Ambient Effects ─────────────────────────────────
/// Subtle breathing when system is idle (3s cycle).
IdleBreathe,
/// Ripple from an active element (400ms).
ActivityRipple,
// ─── Celebration Effects ─────────────────────────────
/// Brief green flash on approval.
ApprovalGranted,
/// Brief red flash on denial.
ApprovalDenied,
}
#[must_use]
pub fn to_effect(&self, theme: &Theme) -> Effect;
#[must_use]
pub fn base_duration_ms(&self) -> u32;lib.rs
Read declaration text · 17 declaration entries
pub mod components;
pub mod util;
pub use effects::KitEffect;
pub use theme::{Theme, ThemeOverrides, DEFAULT_THEME};
pub use types::{
AgentInfo, AgentStatus, ApprovalAction, ApprovalRequest, ChatMessage, CommandHint, CostEntry,
DecisionOption, DiffLine, DiffLineKind, KeyShortcut, LatencySnapshot, LogEntry, LogLevel,
PaletteItem, PermissionCategory, PermissionDecision, PermissionRequest, ProposalInfo,
ProposalKind, ProposalStatus, RiskLevel, Role, Severity, TaskItem, TaskStatus, ToolCallInfo,
ToolCallStatus, TransactionEntry, TreasuryInfo, VoteChoice, WorkflowEdge, WorkflowNodeInfo,
WorkflowNodeKind,
};
pub use components::agent::{
AgentAvatar, AgentCard, AgentCardState, AgentList, AgentListState, AgentPanel, AgentPanelState,
AgentStatusDot, AvatarSize, MultiAgentHeader, MultiAgentHeaderState,
};
pub use components::chat::{
ChangeKind, ChatBubble, ChatBubbleState, ChatTimeline, ChatTimelineState, CodeBlock,
CodeBlockState, DiffView, DiffViewState, DocumentPreviewPane, DocumentPreviewState,
FileDisplay, FileDisplayState, InlineDiffCard, InputBar, InputBarState, MarkdownRenderer,
MarkdownStreamCollector, PageStyle, StreamingText, StreamingTextState, ToolCallCard,
ToolCallCardStatus, ToolCallDisplay, ToolCallState,
};
pub use components::governance::{
ConstitutionView, ConstitutionViewState, ProposalCard, ProposalCardState, TreasuryDisplay,
VotingPanel, VotingPanelState,
};
pub use components::harness::{
AttributionTable, AttributionTableRow, AttributionTaskOutcomeBadge, ChangeManifestView,
HarnessComponentRow, HarnessComponentStatus, HarnessComponentTree, HarnessComponentTreeState,
ManifestEntryView, ManifestVerdictBadge,
};
pub use components::history::{
ApprovalCell, ApprovalState, AssistantCell, DiffCell, ExecCell, ExecOutcome, HistoryCell,
HistoryView, HistoryViewState, SystemCell, SystemSeverity, ToolCell, ToolCellOutcome, UserCell,
};
pub use components::hitl::{
ApprovalChooser, ApprovalChooserAction, ApprovalChooserState, ApprovalDialog,
ApprovalDialogState, ApprovalQueue, ApprovalQueueState, ConfirmButton, ConfirmationPrompt,
ConfirmationPromptState, DecisionPanel, DecisionPanelState, PermissionBanner, PermissionPrompt,
PermissionPromptState,
};
pub use components::metrics::{
CostTracker, LatencyDisplay, MetricBarItem, MetricCard, MetricsBar, TokenMeter,
};
pub use components::system::{
custom_logo::CLAUSEN_LOGO_ROWS, fmt_elapsed_compact, AppShell, AppShellState, Banner,
BlockLogo, CollapseState, CommandPalette, CommandPaletteState, CustomLogo, FocusCard,
GoalDisplay, GoalStep, GoalStepStatus, HintBar, HintItem, KeyboardHelp, KeyboardHelpState,
LogViewer, LogViewerState, Modal, ModalButton, ModalState, ModelCapabilities, ModelPicker,
ModelPickerRow, ModelPickerState, NotificationToast, NotificationToastState, PagerOverlay,
PagerOverlayState, PendingSelection, ResumePicker, ResumePickerRow, ResumePickerState,
SettingsPalette, SettingsPaletteItem, SettingsPalettePage, SettingsPaletteState, ShellPanel,
Shimmer, ShimmerState, SlashDropdown, SlashDropdownItem, SlashDropdownState, Spinner,
SpinnerStyle, SplitDirection, SplitPane, SplitPaneState, StatusBar, StatusFooter,
StatusFooterIndicator, StatusIndicator, StatusIndicatorState, StatusKind, TabItem, Tabs,
TabsState, ThemePicker, ThemePickerRow, ThemePickerState, ThinkingAnimation,
ThinkingAnimationState, ThinkingIndicator, ToastMessage, WelcomeConfig, WelcomeScreen,
BLOCK_LOGO_GLYPH_WIDTH, BLOCK_LOGO_HEIGHT, BLOCK_LOGO_SPACING, SHIMMER_DEFAULT_WINDOW,
THINKING_ANIMATION_DEFAULT_CHARSET, THINKING_ANIMATION_DEFAULT_WIDTH,
};
pub use components::workflow::{
ProgressTimeline, TaskList, TaskListState, WorkflowDAG, WorkflowDAGState, WorkflowNode,
};
pub use util::live_wrap::{display_width, wrap_unicode};
pub use util::unified_diff::{parse_unified_diff, DiffFile};
pub use util::word_diff::{pair_changed_lines, word_diff, ChangedPair, WordDiff};theme.rs
Read declaration text · 13 declaration entries
pub static DEFAULT_THEME: LazyLock<Theme>;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Theme {
// ─── Surface Colors ────────────────────────────────────
/// Base background color for the entire terminal area.
pub bg_base: Color,
/// Slightly elevated surface for cards and panels.
pub bg_surface: Color,
/// More prominently elevated surface for floating elements.
pub bg_elevated: Color,
/// Semi-transparent overlay backdrop for modals and dialogs.
pub bg_overlay: Color,
// ─── Text Colors ───────────────────────────────────────
/// Primary text color for body content and headings.
pub fg_primary: Color,
/// Secondary text color for labels and less important content.
pub fg_secondary: Color,
/// Muted text for hints, timestamps, and metadata.
pub fg_muted: Color,
/// Disabled text for inactive or unavailable elements.
pub fg_disabled: Color,
// ─── Semantic Colors ───────────────────────────────────
/// Accent color for interactive elements, links, and highlights.
pub accent: Color,
/// Success state indicator (confirmations, completions).
pub success: Color,
/// Warning state indicator (caution, degraded state).
pub warning: Color,
/// Error state indicator (failures, critical issues).
pub error: Color,
/// Informational state indicator (notices, tips).
pub info: Color,
// ─── Agent Status Colors ───────────────────────────────
/// Agent is online and ready to accept work.
pub agent_online: Color,
/// Agent is actively working on a task.
pub agent_working: Color,
/// Agent is processing or reasoning (thinking state).
pub agent_thinking: Color,
/// Agent is idle with no current task.
pub agent_idle: Color,
/// Agent is waiting for external input or approval.
pub agent_waiting: Color,
/// Agent has encountered an error condition.
pub agent_error: Color,
/// Agent has been terminated or shut down.
pub agent_terminated: Color,
/// Agent is offline and unreachable.
pub agent_offline: Color,
// ─── Chat Colors ───────────────────────────────────────
/// Color for user messages in chat.
pub chat_user: Color,
/// Color for agent/assistant messages in chat.
pub chat_agent: Color,
/// Color for system messages in chat.
pub chat_system: Color,
/// Color for tool call/result messages in chat.
pub chat_tool: Color,
// ─── Border Colors ─────────────────────────────────────
/// Default border color for unfocused elements.
pub border_default: Color,
/// Border color for focused/selected elements.
pub border_focus: Color,
/// Border color for active/interacting elements.
pub border_active: Color,
// ─── Effect Parameters ─────────────────────────────────
/// Whether tachyonfx effects are enabled globally.
pub effects_enabled: bool,
/// Color used for glow and highlight effects.
pub effect_glow: Color,
/// Pulse animation speed in cycles per second.
pub effect_pulse_speed: f32,
/// Streaming text speed in characters per second.
pub effect_streaming_cps: f32,
/// Fade transition duration in milliseconds.
pub effect_fade_ms: u32
}
#[must_use]
pub fn dark() -> Self;
#[must_use]
pub fn light() -> Self;
#[must_use]
pub fn midnight() -> Self;
#[must_use]
pub fn claude() -> Self;
#[must_use]
pub fn monochrome() -> Self;
#[must_use]
pub fn custom(base: Self, overrides: &ThemeOverrides) -> Self;
#[must_use]
pub fn resolve_color(&self, color: Color) -> Color;
#[must_use]
pub fn role_color(&self, role: &Role) -> Color;
#[must_use]
pub fn agent_status_color(&self, status: &AgentStatus) -> Color;
#[must_use]
pub fn severity_color(&self, severity: &Severity) -> Color;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ThemeOverrides {
// ─── Surface Colors ────────────────────────────────────
/// Override for [`Theme::bg_base`].
pub bg_base: Option<Color>,
/// Override for [`Theme::bg_surface`].
pub bg_surface: Option<Color>,
/// Override for [`Theme::bg_elevated`].
pub bg_elevated: Option<Color>,
/// Override for [`Theme::bg_overlay`].
pub bg_overlay: Option<Color>,
// ─── Text Colors ───────────────────────────────────────
/// Override for [`Theme::fg_primary`].
pub fg_primary: Option<Color>,
/// Override for [`Theme::fg_secondary`].
pub fg_secondary: Option<Color>,
/// Override for [`Theme::fg_muted`].
pub fg_muted: Option<Color>,
/// Override for [`Theme::fg_disabled`].
pub fg_disabled: Option<Color>,
// ─── Semantic Colors ───────────────────────────────────
/// Override for [`Theme::accent`].
pub accent: Option<Color>,
/// Override for [`Theme::success`].
pub success: Option<Color>,
/// Override for [`Theme::warning`].
pub warning: Option<Color>,
/// Override for [`Theme::error`].
pub error: Option<Color>,
/// Override for [`Theme::info`].
pub info: Option<Color>,
// ─── Agent Status Colors ───────────────────────────────
/// Override for [`Theme::agent_online`].
pub agent_online: Option<Color>,
/// Override for [`Theme::agent_working`].
pub agent_working: Option<Color>,
/// Override for [`Theme::agent_thinking`].
pub agent_thinking: Option<Color>,
/// Override for [`Theme::agent_idle`].
pub agent_idle: Option<Color>,
/// Override for [`Theme::agent_waiting`].
pub agent_waiting: Option<Color>,
/// Override for [`Theme::agent_error`].
pub agent_error: Option<Color>,
/// Override for [`Theme::agent_terminated`].
pub agent_terminated: Option<Color>,
/// Override for [`Theme::agent_offline`].
pub agent_offline: Option<Color>,
// ─── Chat Colors ───────────────────────────────────────
/// Override for [`Theme::chat_user`].
pub chat_user: Option<Color>,
/// Override for [`Theme::chat_agent`].
pub chat_agent: Option<Color>,
/// Override for [`Theme::chat_system`].
pub chat_system: Option<Color>,
/// Override for [`Theme::chat_tool`].
pub chat_tool: Option<Color>,
// ─── Border Colors ─────────────────────────────────────
/// Override for [`Theme::border_default`].
pub border_default: Option<Color>,
/// Override for [`Theme::border_focus`].
pub border_focus: Option<Color>,
/// Override for [`Theme::border_active`].
pub border_active: Option<Color>,
// ─── Effect Parameters ─────────────────────────────────
/// Override for [`Theme::effects_enabled`].
pub effects_enabled: Option<bool>,
/// Override for [`Theme::effect_glow`].
pub effect_glow: Option<Color>,
/// Override for [`Theme::effect_pulse_speed`].
pub effect_pulse_speed: Option<f32>,
/// Override for [`Theme::effect_streaming_cps`].
pub effect_streaming_cps: Option<f32>,
/// Override for [`Theme::effect_fade_ms`].
pub effect_fade_ms: Option<u32>
}types.rs
Read declaration text · 117 declaration entries
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Role {
/// A human end-user.
User,
/// An AI agent.
Agent,
/// A system-generated message (e.g. connection notice, error).
System,
/// Output from a tool invocation.
Tool,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn symbol(&self) -> &'static str;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AgentStatus {
/// The agent is connected and ready to accept work.
#[default]
Online,
/// The agent is actively executing a task.
Working,
/// The agent is reasoning / planning (no tool calls yet).
Thinking,
/// The agent is connected but has no pending work.
Idle,
/// The agent is blocked waiting on an external resource or human input.
Waiting,
/// The agent encountered an error.
Error,
/// The agent has been permanently shut down.
Terminated,
/// The agent is disconnected / unreachable.
Offline,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn is_active(&self) -> bool;
#[must_use]
pub const fn is_terminal(&self) -> bool;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ChatMessage {
/// Unique identifier for this message (monotonic counter per process).
pub id: String,
/// Role of the message author.
pub role: Role,
/// Display name of the sender.
pub sender: String,
/// Message body (plain text or markdown).
pub content: String,
/// ISO-8601 timestamp string, or empty if not set.
pub timestamp: String
}
#[must_use]
pub fn new(role: Role, sender: impl AsRef<str>, content: impl AsRef<str>) -> Self;
#[must_use]
pub fn user(content: impl AsRef<str>) -> Self;
#[must_use]
pub fn agent(sender: impl AsRef<str>, content: impl AsRef<str>) -> Self;
#[must_use]
pub fn system(content: impl AsRef<str>) -> Self;
#[must_use]
pub fn tool(content: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_timestamp(mut self, timestamp: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_id(mut self, id: impl AsRef<str>) -> Self;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AgentInfo {
/// Unique identifier for this agent.
pub id: String,
/// Human-readable display name.
pub name: String,
/// Short description of the agent's role or purpose.
pub role_description: String,
/// Model identifier (e.g. "gpt-4o", "claude-opus-4-6").
pub model: String,
/// Current lifecycle status.
pub status: AgentStatus
}
#[must_use]
pub fn new(id: impl AsRef<str>, name: impl AsRef<str>, model: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_role(mut self, role_description: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_status(mut self, status: AgentStatus) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ToolCallStatus {
/// The tool call has been requested but not yet started.
#[default]
Pending,
/// The tool call is currently executing.
Running,
/// The tool call completed successfully.
Success,
/// The tool call failed with an error.
Error,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn is_complete(&self) -> bool;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ToolCallInfo {
/// Name of the tool (e.g. "read_file", "bash").
pub name: String,
/// Serialized arguments passed to the tool (typically JSON).
pub arguments: String,
/// Output produced by the tool, or empty if not yet available.
pub output: String,
/// Current execution status.
pub status: ToolCallStatus,
/// Wall-clock duration of the tool call, if completed.
#[serde(
serialize_with = "serialize_opt_duration",
deserialize_with = "deserialize_opt_duration"
)]
pub duration: Option<Duration>
}
#[must_use]
pub fn new(name: impl AsRef<str>, arguments: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_status(mut self, status: ToolCallStatus) -> Self;
#[must_use]
pub fn with_output(mut self, output: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_duration(mut self, duration: Duration) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Severity {
/// Informational message.
#[default]
Info,
/// Positive outcome or confirmation.
Success,
/// Non-critical issue requiring attention.
Warning,
/// Critical failure or error condition.
Error,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn icon(&self) -> &'static str;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct CommandHint {
/// The command name (e.g., "help", "orgs form", "clear").
pub name: String,
/// Short description (e.g., "Show available commands").
pub description: String,
/// Source label — "built-in" or a plugin name (e.g., "orgs").
pub source: String
}
#[must_use]
pub fn new(
name: impl AsRef<str>,
description: impl AsRef<str>,
source: impl AsRef<str>,
) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PermissionCategory {
/// Network access (HTTP, DNS, WebSocket).
Network,
/// Filesystem read access.
Read,
/// Filesystem write access.
Write,
/// Shell command execution.
Shell,
/// Tool invocation (agent-to-agent or external).
Tool,
}
#[must_use]
pub const fn icon(&self) -> &'static str;
#[must_use]
pub const fn label(&self) -> &'static str;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PermissionRequest {
/// Category of access being requested.
pub category: PermissionCategory,
/// Name of the requesting entity (plugin or agent).
pub requester: String,
/// Specific resource (URL, file path, shell command).
pub resource: String,
/// One-line context explaining why the access is needed.
pub context: String,
/// Suggested glob pattern for "always allow" (e.g., `api.orgs.sh/*`).
pub suggested_pattern: String
}
#[must_use]
pub fn new(
category: PermissionCategory,
requester: impl AsRef<str>,
resource: impl AsRef<str>,
) -> Self;
#[must_use]
pub fn with_context(mut self, context: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_suggested_pattern(mut self, pattern: impl AsRef<str>) -> Self;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PermissionDecision {
/// Allow this specific request once.
AllowOnce,
/// Always allow requests matching the given glob pattern.
AlwaysAllow {
/// The glob pattern to persist (e.g., `api.orgs.sh/*`).
pattern: String,
},
/// Deny this request.
Deny,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum DiffLineKind {
/// Unchanged context line.
Context,
/// Added line (green).
Added,
/// Removed line (red).
Removed,
/// Section header (@@).
Header,
}
#[must_use]
pub const fn prefix(&self) -> &'static str;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DiffLine {
/// What kind of diff line this is.
pub kind: DiffLineKind,
/// The line content (without the +/- prefix).
pub content: String,
/// Original line number (for removed/context lines), if known.
pub old_line_no: Option<usize>,
/// New line number (for added/context lines), if known.
pub new_line_no: Option<usize>
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct CostEntry {
/// Agent that incurred the cost.
pub agent_id: String,
/// Model used (e.g., "claude-opus-4-6", "gpt-4o").
pub model: String,
/// Cost in the smallest currency unit (cents for USD).
pub amount_cents: u64,
/// ISO 4217 currency code (e.g., "USD", "EUR").
pub currency: String
}
#[must_use]
pub fn new(
agent_id: impl AsRef<str>,
model: impl AsRef<str>,
amount_cents: u64,
currency: impl AsRef<str>,
) -> Self;
#[must_use]
pub fn display_amount(&self) -> String;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LatencySnapshot {
/// Current latency in milliseconds.
pub current_ms: u64,
/// 50th percentile (median) latency in milliseconds.
pub p50: u64,
/// 95th percentile latency in milliseconds.
pub p95: u64,
/// 99th percentile latency in milliseconds.
pub p99: u64,
/// Recent latency samples for sparkline rendering.
pub samples: Vec<u64>
}
#[must_use]
pub fn new(current_ms: u64, p50: u64, p95: u64, p99: u64) -> Self;
#[must_use]
pub fn with_samples(mut self, samples: Vec<u64>) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum RiskLevel {
/// Low risk, routine action.
#[default]
Low,
/// Medium risk, warrants attention.
Medium,
/// High risk, requires careful review.
High,
/// Critical risk, potentially destructive or irreversible.
Critical,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn requires_review(&self) -> bool;
#[must_use]
pub const fn weight(&self) -> u8;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ApprovalRequest {
/// Unique identifier for this request.
pub id: String,
/// Name of the agent requesting approval.
pub agent_name: String,
/// Short summary of the proposed action.
pub action_summary: String,
/// Detailed reasoning for the action.
pub reasoning: String,
/// Resources affected by the action.
pub resources: Vec<String>,
/// Assessed risk level.
pub risk_level: RiskLevel,
/// ISO-8601 timestamp of when the request was created.
pub created_at: String
}
#[must_use]
pub fn new(
id: impl AsRef<str>,
agent_name: impl AsRef<str>,
action_summary: impl AsRef<str>,
) -> Self;
#[must_use]
pub fn with_risk_level(mut self, risk_level: RiskLevel) -> Self;
#[must_use]
pub fn with_reasoning(mut self, reasoning: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_resources(mut self, resources: Vec<String>) -> Self;
#[must_use]
pub fn with_created_at(mut self, created_at: impl AsRef<str>) -> Self;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ApprovalAction {
/// Approve the request as-is.
Approve,
/// Deny the request.
Deny,
/// Approve with modifications.
Edit {
/// Description of the modification.
modification: String,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum TaskStatus {
/// Task has not started.
#[default]
Pending,
/// Task is currently executing.
Active,
/// Task completed successfully.
Complete,
/// Task failed with an error.
Error,
/// Task was skipped.
Skipped,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn icon(&self) -> &'static str;
#[must_use]
pub const fn is_terminal(&self) -> bool;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TaskItem {
/// Unique task identifier.
pub id: String,
/// Display label for the task.
pub label: String,
/// Current task status.
pub status: TaskStatus,
/// Sub-tasks (for hierarchical display).
pub children: Vec<TaskItem>,
/// Progress fraction (0.0 to 1.0), where applicable.
pub progress: f32
}
#[must_use]
pub fn new(id: impl AsRef<str>, label: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_status(mut self, status: TaskStatus) -> Self;
#[must_use]
pub fn with_progress(mut self, progress: f32) -> Self;
#[must_use]
pub fn with_children(mut self, children: Vec<TaskItem>) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum WorkflowNodeKind {
/// An agent node.
#[default]
Agent,
/// A tool invocation node.
Tool,
/// A conditional branch node.
Condition,
/// A parallel execution node.
Parallel,
/// A human-in-the-loop gate.
HitlGate,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn icon(&self) -> &'static str;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct WorkflowNodeInfo {
/// Unique node identifier.
pub id: String,
/// Display label for the node.
pub label: String,
/// Node kind (determines icon and styling).
pub kind: WorkflowNodeKind,
/// Current execution status.
pub status: TaskStatus
}
#[must_use]
pub fn new(id: impl AsRef<str>, label: impl AsRef<str>, kind: WorkflowNodeKind) -> Self;
#[must_use]
pub fn with_status(mut self, status: TaskStatus) -> Self;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct WorkflowEdge {
/// Source node ID.
pub source_id: String,
/// Target node ID.
pub target_id: String,
/// Whether this edge is currently active (data flowing).
pub active: bool
}
#[must_use]
pub fn new(source_id: impl AsRef<str>, target_id: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_active(mut self, active: bool) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum LogLevel {
/// Trace-level diagnostic output.
Trace,
/// Debug-level diagnostic output.
Debug,
/// Informational messages.
#[default]
Info,
/// Warning conditions.
Warn,
/// Error conditions.
Error,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn severity(&self) -> u8;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct LogEntry {
/// ISO-8601 timestamp.
pub timestamp: String,
/// Log level.
pub level: LogLevel,
/// Source component or module.
pub source: String,
/// Log message text.
pub message: String
}
#[must_use]
pub fn new(level: LogLevel, source: impl AsRef<str>, message: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_timestamp(mut self, timestamp: impl AsRef<str>) -> Self;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct PaletteItem {
/// Display label.
pub label: String,
/// Short description.
pub description: String,
/// Category for grouping.
pub category: String,
/// Keyboard shortcut hint (e.g., "Ctrl+O").
pub shortcut: String
}
#[must_use]
pub fn new(
label: impl AsRef<str>,
description: impl AsRef<str>,
category: impl AsRef<str>,
) -> Self;
#[must_use]
pub fn with_shortcut(mut self, shortcut: impl AsRef<str>) -> Self;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct KeyShortcut {
/// Key combination (e.g., "Ctrl+C", "q", "Shift+Tab").
pub keys: String,
/// Description of what the shortcut does.
pub description: String,
/// Category for grouping (e.g., "Navigation", "Editing").
pub category: String
}
#[must_use]
pub fn new(
keys: impl AsRef<str>,
description: impl AsRef<str>,
category: impl AsRef<str>,
) -> Self;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ProposalKind {
/// General governance proposal.
#[default]
General,
/// Treasury spending or allocation.
Treasury,
/// Membership change (add/remove).
Membership,
/// Policy or constitution amendment.
Policy,
/// Technical or infrastructure change.
Technical,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ProposalStatus {
/// Proposal is open for voting.
#[default]
Active,
/// Proposal was approved.
Passed,
/// Proposal was rejected.
Rejected,
/// Proposal was withdrawn by the creator.
Withdrawn,
/// Proposal expired without reaching quorum.
Expired,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[must_use]
pub const fn is_open(&self) -> bool;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProposalInfo {
/// Unique proposal identifier.
pub id: String,
/// Proposal title.
pub title: String,
/// Proposal kind.
pub kind: ProposalKind,
/// Current status.
pub status: ProposalStatus,
/// Creator name.
pub creator: String,
/// Votes in favor.
pub votes_yes: u32,
/// Votes against.
pub votes_no: u32,
/// Abstentions.
pub votes_abstain: u32,
/// Required quorum (total votes needed).
pub quorum: u32,
/// ISO-8601 deadline timestamp.
pub deadline: String
}
#[must_use]
pub fn new(id: impl AsRef<str>, title: impl AsRef<str>, kind: ProposalKind) -> Self;
#[must_use]
pub fn with_creator(mut self, creator: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_status(mut self, status: ProposalStatus) -> Self;
#[must_use]
pub fn with_votes(mut self, yes: u32, no: u32, abstain: u32) -> Self;
#[must_use]
pub fn with_quorum(mut self, quorum: u32) -> Self;
#[must_use]
pub fn with_deadline(mut self, deadline: impl AsRef<str>) -> Self;
#[must_use]
pub fn total_votes(&self) -> u32;
#[must_use]
pub fn has_quorum(&self) -> bool;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum VoteChoice {
/// Vote in favor.
Yes,
/// Vote against.
No,
/// Abstain from voting.
Abstain,
}
#[must_use]
pub const fn label(&self) -> &'static str;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TreasuryInfo {
/// Current balance in the smallest currency unit.
pub balance_cents: u64,
/// Currency code (e.g., "USD", "USDC").
pub currency: String,
/// Chain or network label (e.g., "Ethereum", "Solana").
pub chain: String,
/// Daily spending limit in the smallest unit.
pub daily_limit_cents: u64,
/// Amount spent today in the smallest unit.
pub daily_spent_cents: u64,
/// Recent transactions.
pub recent_transactions: Vec<TransactionEntry>
}
#[must_use]
pub fn new(balance_cents: u64, currency: impl AsRef<str>, chain: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_daily_limit(mut self, limit_cents: u64) -> Self;
#[must_use]
pub fn with_daily_spent(mut self, spent_cents: u64) -> Self;
#[must_use]
pub fn with_transactions(mut self, txns: Vec<TransactionEntry>) -> Self;
#[must_use]
pub fn display_balance(&self) -> String;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TransactionEntry {
/// Amount in the smallest currency unit.
pub amount_cents: u64,
/// Direction: true = inflow, false = outflow.
pub is_inflow: bool,
/// Description or recipient.
pub description: String,
/// ISO-8601 timestamp.
pub timestamp: String
}
#[must_use]
pub fn new(amount_cents: u64, is_inflow: bool, description: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_timestamp(mut self, timestamp: impl AsRef<str>) -> Self;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DecisionOption {
/// Display label for this option.
pub label: String,
/// Description of what this option does.
pub description: String,
/// Whether this is the recommended choice.
pub recommended: bool
}
#[must_use]
pub fn new(label: impl AsRef<str>, description: impl AsRef<str>) -> Self;
#[must_use]
pub fn with_recommended(mut self, recommended: bool) -> Self;util/color.rs
Read declaration text · 4 declaration entries
#[must_use]
pub fn rgb_to_ansi256(r: u8, g: u8, b: u8) -> Color;
#[must_use]
pub fn lerp_color(from: Color, to: Color, t: f32) -> Color;
#[must_use]
pub fn luminance(color: Color) -> f32;
#[must_use]
pub fn has_sufficient_contrast(fg: Color, bg: Color, min_ratio: f32) -> bool;util/layout.rs
Read declaration text · 3 declaration entries
#[must_use]
pub fn centered_rect(width: u16, height: u16, outer: Rect) -> Rect;
#[must_use]
pub fn percentage_rect(width_pct: u16, height_pct: u16, outer: Rect) -> Rect;
#[must_use]
pub fn pad_rect(rect: Rect, horizontal: u16, vertical: u16) -> Rect;util/live_wrap.rs
Read declaration text · 2 declaration entries
#[must_use]
pub fn wrap_unicode(text: &str, width: usize, hanging_indent: &str) -> Vec<String>;
#[must_use]
pub fn display_width(s: &str) -> usize;util/mod.rs
Read declaration text · 7 declaration entries
pub mod color;
pub mod layout;
pub mod live_wrap;
pub mod sanitize;
pub mod text;
pub mod unified_diff;
pub mod word_diff;util/sanitize.rs
Read declaration text · 2 declaration entries
#[must_use]
pub fn sanitize(input: &str) -> String;
#[must_use]
pub fn sanitize_truncated(input: &str, max_len: usize) -> String;util/text.rs
Read declaration text · 4 declaration entries
#[must_use]
pub fn display_width(s: &str) -> usize;
#[must_use]
pub fn truncate_with_ellipsis(s: &str, max_width: usize) -> String;
#[must_use]
pub fn wrap_text(text: &str, max_width: usize) -> Vec<String>;
#[must_use]
pub fn line_count(text: &str, width: usize) -> usize;util/unified_diff.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DiffFile {
/// Display path. Prefers the `+++ b/<path>` side; falls back to
/// the `--- a/<path>` side; falls back to "(unknown)".
pub path: String,
/// Lines belonging to this file (`@@`, ` `, `+`, `-` rows).
pub lines: Vec<DiffLine>
}
#[must_use]
pub fn additions(&self) -> usize;
#[must_use]
pub fn deletions(&self) -> usize;
#[must_use]
pub fn parse_unified_diff(source: &str) -> Vec<DiffFile>;util/word_diff.rs
Read declaration text · 4 declaration entries
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct WordDiff {
/// Number of leading characters that match exactly.
pub prefix_chars: usize,
/// Number of trailing characters that match exactly.
pub suffix_chars: usize,
/// The changed-region character range on the old line:
/// `prefix_chars..(old_len - suffix_chars)`.
pub old_changed_range: std::ops::Range<usize>,
/// The changed-region character range on the new line:
/// `prefix_chars..(new_len - suffix_chars)`.
pub new_changed_range: std::ops::Range<usize>
}
#[must_use]
pub fn word_diff(old: &str, new: &str) -> WordDiff;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ChangedPair {
/// Index of the removed line.
pub removed_idx: usize,
/// Index of the added line.
pub added_idx: usize,
/// Word-level diff between the two contents.
pub word_diff: WordDiff
}
#[must_use]
pub fn pair_changed_lines(lines: &[DiffLine]) -> Vec<ChangedPair>;