Module token_tui

Module token_tui 

Source
Expand description

Purpose: Render token telemetry as package-backed terminal dashboards.

StructsΒ§

AtlasLayout πŸ”’
Deterministic centered layout for the small resolved-relation projection.
AtlasNodePlacement πŸ”’
One force-settled node placement with graph-derived depth and cluster cues.
AtlasPreviewEdge πŸ”’
One real resolved relation retained by the bounded atlas preview.
CellAnsiStyle πŸ”’
Minimal style projection used by the ANSI serializer.
ModeledSourceGroup πŸ”’
Real modeled source bucket aggregated for display.
SavingsSourceRow πŸ”’
One visible aggregate row for savings-source telemetry.
ThemePalette πŸ”’
Semantic color palette used when serializing Ratatui cells to ANSI.
TokenAtlasPreview πŸ”’
Bounded, non-interactive projection of resolved relations from the active project database.
TokenMix πŸ”’
Signed and absolute token operands shown in the composition panel.

EnumsΒ§

TokenDashboardTheme πŸ”’
Human token dashboard color mode.

ConstantsΒ§

ACTIVE_TOKEN_THEME πŸ”’
Active token dashboard theme for the current render pass.
ATLAS_CANVAS_X_BOUND πŸ”’
Horizontal Canvas bound retaining a margin inside the atlas panel.
ATLAS_CANVAS_Y_BOUND πŸ”’
Vertical Canvas bound retaining a margin above the atlas footer.
ATLAS_DASHBOARD_MIN_WIDTH πŸ”’
Width at which the human dashboard can show the atlas without crowding impact data.
ATLAS_LAYOUT_IDEAL_DISTANCE πŸ”’
Ideal graph-space edge length for the bounded force layout.
ATLAS_LAYOUT_INITIAL_TEMPERATURE πŸ”’
Maximum per-step node movement before deterministic cooling.
ATLAS_LAYOUT_ITERATIONS πŸ”’
Fixed force steps keep the bounded static preview deterministic and fast.
ATLAS_NODE_HALO_DEGREE πŸ”’
Degree at which a node receives a small depth halo instead of a single point.
ATLAS_PREVIEW_MAX_EDGES πŸ”’
Maximum real resolved links retained by the decorative atlas preview.
ATLAS_PREVIEW_MAX_NODES πŸ”’
Maximum real resolved nodes retained by the decorative atlas preview.
ATLAS_PREVIEW_MAX_NODE_DEGREE πŸ”’
Maximum links one visual hub may consume in the decorative preview.
DASHBOARD_HEIGHT πŸ”’
Fixed terminal height for the token overview dashboard snapshot.
DASHBOARD_MAX_WIDTH πŸ”’
Maximum human dashboard width.
LIGHT_THEME πŸ”’
Light terminal palette preserving the same semantic color roles.
THEME_BAR_EMPTY πŸ”’
Token dashboard inactive bar cells.
THEME_BG πŸ”’
Reserved terminal-canvas color; overview frames leave the shell background visible.
THEME_BLUE πŸ”’
Counterfactual/original-baseline blue.
THEME_BORDER πŸ”’
Token dashboard subtle warm panel border.
THEME_GREEN πŸ”’
Net saved/success green.
THEME_INK_WHITE πŸ”’
Token dashboard identity ivory.
THEME_MUTED πŸ”’
Token dashboard muted label text.
THEME_PANEL πŸ”’
Token dashboard panel background.
THEME_PURPLE πŸ”’
Repository-graph test and route accent.
THEME_RED πŸ”’
Token dashboard loss red.
THEME_TEXT πŸ”’
Token dashboard primary warm text.
THEME_YELLOW πŸ”’
Modeled/search/estimate yellow.
TOKEN_IMPACT_COLUMN_WIDTH πŸ”’
Stable width reserved for the token-impact column in the wide dashboard.
TREND_DASHBOARD_HEIGHT πŸ”’
Fixed terminal height for the token trend dashboard snapshot.

FunctionsΒ§

active_token_theme πŸ”’
Return the active token dashboard theme.
allocate_signed_total πŸ”’
Allocate a signed display total across real source groups and preserve the exact sum.
atlas_cluster_color πŸ”’
Map graph-derived first-hop branches to the stable dashboard accent palette.
atlas_layout πŸ”’
Settle one connected graph with the reusable force engine and center its strongest hub.
block_bar πŸ”’
Return a segmented bar matching the reference dashboard.
body_style πŸ”’
Body text style.
buffer_to_ansi_string πŸ”’
Convert a Ratatui buffer into ANSI-styled terminal text.
buffer_to_string πŸ”’
Convert a Ratatui buffer into trimmed terminal text.
center_symbol πŸ”’
Return a centered operator paragraph.
color_to_ansi πŸ”’
Convert one Ratatui color into foreground/background ANSI code.
composition_line πŸ”’
Return one composition row with a compact bar.
current_clock_label πŸ”’
Return a compact clock label for the footer status row.
dashboard_width πŸ”’
Return the preferred dashboard width.
file_handling_token_mix πŸ”’
Return the token operands that back the composition panel.
grouped_count πŸ”’
Format an unsigned count with thousands separators.
header_style πŸ”’
Header style used for panel titles.
hero_state_marker πŸ”’
Return the semantic marker used beside the saved-token headline.
hero_value_style πŸ”’
Large positive/negative hero value style.
identity_style πŸ”’
Identity label style.
identity_title_style πŸ”’
ProjectAtlas title identity style.
impact_bar_line πŸ”’
Return one labeled, exact ratio and its proportional block bar.
is_observed_source_bucket πŸ”’
Whether a bucket represents observed ProjectAtlas file handling.
label πŸ”’
Styled field label span.
modeled_group_index πŸ”’
Pick the reference-style source row for one modeled bucket.
modeled_source_groups πŸ”’
Return modeled source rows backed by actual telemetry buckets.
muted_bold_style πŸ”’
Muted bold label style.
muted_style πŸ”’
Muted text style.
observed_source_steps πŸ”’
Return observed source steps from real observed buckets, with legacy fallback.
panel πŸ”’
Return a screenshot-matched dashboard panel.
percentage_label πŸ”’
Format one part of a whole as a nearest integer percentage.
percentage_one_decimal πŸ”’
Format a percentage with one decimal place.
rate_label πŸ”’
Format an optional savings rate.
ratio πŸ”’
Return a stable ratio for Ratatui gauges.
reconciled_without_projectatlas πŸ”’
Return the screenshot hero’s reconciled conservative baseline operand.
reference_title πŸ”’
Return the reference-like spaced title treatment used for dominant section labels.
remap_to_light_theme πŸ”’
Convert one dark semantic role color into its light-theme counterpart.
render_atlas_map πŸ”’
Draw the bounded live repository constellation in the wide dashboard column.
render_atlas_message πŸ”’
Draw an explicit centered atlas state without substituting decorative data.
render_avoided_navigation_card πŸ”’
Draw the reference-style avoided navigation-work strip.
render_calibration_notes πŸ”’
Draw calibration notes without duplicating headline totals.
render_composition_and_signal πŸ”’
Draw the side-by-side composition and signal cards.
render_dashboard_to_ansi_string πŸ”’
Render one Ratatui frame into a deterministic ANSI terminal buffer.
render_dashboard_to_string πŸ”’
Render one Ratatui frame into a deterministic plain string buffer.
render_divider πŸ”’
Render a horizontal divider in a panel.
render_file_read_impact_row πŸ”’
Draw the source-reconciled file-read total and its observed/modeled split.
render_file_read_total πŸ”’
Draw the left file-read total with the reference document-icon hierarchy.
render_hero_value πŸ”’
Draw the saved-token headline as readable terminal text.
render_impact_metric πŸ”’
Draw one file-read component with its exact share of the reconciled total.
render_metric_column πŸ”’
Draw one metric operand in the hero equation.
render_overview_frame πŸ”’
Draw the full overview dashboard frame.
render_overview_frame_with_atlas πŸ”’
Draw the overview and, when requested and wide enough, its static live atlas.
render_overview_main πŸ”’
Draw the proven one-screen savings overview.
render_savings_breakdown_table πŸ”’
Draw the screenshot-style source table.
render_savings_composition πŸ”’
Draw observed-vs-modeled token composition.
render_signal_card πŸ”’
Draw signal metadata from the reference dashboard.
render_status_bar πŸ”’
Draw the compact footer/status row from the reference dashboard.
render_token_dashboard_plain_with_theme πŸ”’
Render the token overview as a plain terminal chart for agent payloads.
render_token_dashboard_with_atlas πŸ”’
Render the human token dashboard with its optional bounded live atlas.
render_token_header πŸ”’
Draw the title band.
render_token_hero πŸ”’
Draw the dominant saved-token hero panel.
render_token_trend_dashboard_plain_with_theme πŸ”’
Render token trends as a plain terminal chart for agent payloads.
render_token_trend_dashboard_with_theme πŸ”’
Render token trends as a human terminal dashboard with the selected theme.
render_trend_frame πŸ”’
Draw the full trend dashboard frame.
render_trend_table πŸ”’
Draw period rows for the trend dashboard.
render_vertical_separator πŸ”’
Render a vertical separator in a panel.
render_window_title_bar πŸ”’
Draw the reference-style app title bar and window controls.
resolve_dashboard_width πŸ”’
Resolve an explicit dashboard width before using the detected terminal width.
savings_source_rows_for_width πŸ”’
Aggregate visible accounting with screenshot-aligned labels.
section_title_style πŸ”’
Section title style used for dashboard chrome.
settle_atlas_layout πŸ”’
Settle the tiny deterministic preview with bounded Fruchterman-Reingold steps.
signed_color πŸ”’
Return the color for a signed value.
signed_count πŸ”’
Format a signed count with thousands separators.
signed_trend_color πŸ”’
Return a trend color that signals all-loss or mixed-sign series.
signed_trend_points πŸ”’
Convert trend periods into signed chart coordinates.
signed_y_bounds πŸ”’
Return y-axis bounds that preserve the sign of trend values and include zero.
split_signed_by_ratio πŸ”’
Split a signed value by a simple integer ratio.
themed_color πŸ”’
Remap the dark reference palette to the selected output palette.
token_atlas_network_relation πŸ”’
Return whether a relation belongs in the cross-entity atlas network.
token_dashboard_wants_atlas πŸ”’
Return whether the current terminal is wide enough for the optional atlas read.
token_title_style πŸ”’
Token Impact title style.
usize_to_isize_saturating πŸ”’
Convert a usize to isize without panicking on unusually large values.
value πŸ”’
Styled unsigned value span.
with_token_theme πŸ”’
Run one render closure with the selected token dashboard theme.