Skip to main content

Crate ftui_runtime

Crate ftui_runtime 

Source
Expand description

FrankenTUI Runtime

This crate provides the runtime components that tie together the core, render, and layout crates into a complete terminal application framework.

§Key Components

  • TerminalWriter - Unified terminal output coordinator with inline mode support
  • LogSink - Line-buffered writer for sanitized log output
  • Program - Bubbletea/Elm-style runtime for terminal applications
  • Model - Trait for application state and behavior
  • Cmd - Commands for side effects
  • Subscription - Trait for continuous event sources
  • Every - Built-in tick subscription

§Role in FrankenTUI

ftui-runtime is the orchestrator. It consumes input events from ftui-core, drives your Model::update, calls Model::view to render frames, and delegates rendering to ftui-render via TerminalWriter.

§How it fits in the system

The runtime is the center of the architecture: it is the bridge between input (ftui-core) and output (ftui-render). Widgets and layout are optional layers used by your view() to construct UI output.

Re-exports§

pub use asciicast::AsciicastRecorder;
pub use asciicast::AsciicastWriter;
pub use diff_evidence::DiffEvidenceLedger;
pub use diff_evidence::DiffRegime;
pub use diff_evidence::DiffStrategyRecord;
pub use diff_evidence::Observation;
pub use diff_evidence::RegimeTransition;
pub use evidence_sink::EvidenceSink;
pub use evidence_sink::EvidenceSinkConfig;
pub use evidence_sink::EvidenceSinkDestination;
pub use evidence_telemetry::BudgetDecisionSnapshot;
pub use evidence_telemetry::ConformalSnapshot;
pub use evidence_telemetry::DiffDecisionSnapshot;
pub use evidence_telemetry::ResizeDecisionSnapshot;
pub use evidence_telemetry::budget_snapshot;
pub use evidence_telemetry::clear_budget_snapshot;
pub use evidence_telemetry::clear_diff_snapshot;
pub use evidence_telemetry::clear_resize_snapshot;
pub use evidence_telemetry::diff_snapshot;
pub use evidence_telemetry::resize_snapshot;
pub use evidence_telemetry::set_budget_snapshot;
pub use evidence_telemetry::set_diff_snapshot;
pub use evidence_telemetry::set_resize_snapshot;
pub use input_macro::EventRecorder;
pub use input_macro::FilteredEventRecorder;
pub use input_macro::InputMacro;
pub use input_macro::MacroPlayback;
pub use input_macro::MacroPlayer;
pub use input_macro::MacroRecorder;
pub use input_macro::RecordingFilter;
pub use input_macro::RecordingState;
pub use input_macro::TimedEvent;
pub use locale::LocaleContext;
pub use locale::LocaleOverride;
pub use locale::current_locale;
pub use locale::detect_system_locale;
pub use locale::set_locale;
pub use log_sink::LogSink;
pub use program::App;
pub use program::AppBuilder;
pub use program::BatchController;
pub use program::Cmd;
pub use program::EffectQueueConfig;
pub use program::FrameTiming;
pub use program::FrameTimingConfig;
pub use program::FrameTimingSink;
pub use program::HeadlessEventSource;
pub use program::InlineAutoRemeasureConfig;
pub use program::Model;
pub use program::MouseCapturePolicy;
pub use program::PaneTerminalAdapter;
pub use program::PaneTerminalAdapterConfig;
pub use program::PaneTerminalDispatch;
pub use program::PaneTerminalIgnoredReason;
pub use program::PaneTerminalLifecyclePhase;
pub use program::PaneTerminalLogEntry;
pub use program::PaneTerminalLogOutcome;
pub use program::PaneTerminalSplitterHandle;
pub use program::PersistenceConfig;
pub use program::Program;
pub use program::ProgramConfig;
pub use program::ResizeBehavior;
pub use program::TaskSpec;
pub use program::WidgetRefreshConfig;
pub use program::pane_terminal_resolve_splitter_target;
pub use program::pane_terminal_splitter_handles;
pub use program::pane_terminal_target_from_hit;
pub use program::register_pane_terminal_splitter_hits;
pub use render_trace::RenderTraceConfig;
pub use render_trace::RenderTraceContext;
pub use render_trace::RenderTraceFrame;
pub use render_trace::RenderTraceRecorder;
pub use simulator::ProgramSimulator;
pub use string_model::StringModel;
pub use string_model::StringModelAdapter;
pub use subscription::Every;
pub use subscription::StopSignal;
pub use subscription::SubId;
pub use subscription::Subscription;
pub use terminal_writer::ScreenMode;
pub use terminal_writer::TerminalWriter;
pub use terminal_writer::UiAnchor;
pub use terminal_writer::inline_active_widgets;
pub use voi_telemetry::clear_inline_auto_voi_snapshot;
pub use voi_telemetry::inline_auto_voi_snapshot;
pub use voi_telemetry::set_inline_auto_voi_snapshot;
pub use allocation_budget::AllocationBudget;
pub use allocation_budget::BudgetAlert;
pub use allocation_budget::BudgetConfig;
pub use allocation_budget::BudgetEvidence;
pub use allocation_budget::BudgetSummary;
pub use conformal_alert::AlertConfig;
pub use conformal_alert::AlertDecision;
pub use conformal_alert::AlertEvidence;
pub use conformal_alert::AlertReason;
pub use conformal_alert::AlertStats;
pub use conformal_alert::ConformalAlert;
pub use conformal_predictor::BucketKey;
pub use conformal_predictor::ConformalConfig;
pub use conformal_predictor::ConformalPrediction;
pub use conformal_predictor::ConformalPredictor;
pub use conformal_predictor::ConformalUpdate;
pub use conformal_predictor::DiffBucket;
pub use conformal_predictor::ModeBucket;
pub use cost_model::BatchCostParams;
pub use cost_model::BatchCostResult;
pub use cost_model::CacheCostParams;
pub use cost_model::CacheCostResult;
pub use cost_model::PipelineCostParams;
pub use cost_model::PipelineCostResult;
pub use cost_model::StageStats;
pub use eprocess_throttle::EProcessThrottle;
pub use eprocess_throttle::ThrottleConfig;
pub use eprocess_throttle::ThrottleDecision;
pub use eprocess_throttle::ThrottleLog;
pub use eprocess_throttle::ThrottleStats;
pub use flake_detector::EvidenceLog;
pub use flake_detector::FlakeConfig;
pub use flake_detector::FlakeDecision;
pub use flake_detector::FlakeDetector;
pub use flake_detector::FlakeSummary;
pub use reactive::BatchScope;
pub use reactive::Binding;
pub use reactive::BindingScope;
pub use reactive::Computed;
pub use reactive::Observable;
pub use reactive::TwoWayBinding;
pub use resize_coalescer::CoalesceAction;
pub use resize_coalescer::CoalescerConfig;
pub use resize_coalescer::CoalescerStats;
pub use resize_coalescer::CycleTimePercentiles;
pub use resize_coalescer::DecisionLog;
pub use resize_coalescer::DecisionSummary;
pub use resize_coalescer::Regime;
pub use resize_coalescer::ResizeCoalescer;
pub use resize_sla::ResizeEvidence;
pub use resize_sla::ResizeSlaMonitor;
pub use resize_sla::SlaConfig;
pub use resize_sla::SlaLogEntry;
pub use resize_sla::SlaSummary;
pub use resize_sla::make_sla_hooks;
pub use undo::CommandBatch;
pub use undo::CommandError;
pub use undo::CommandMetadata;
pub use undo::CommandResult;
pub use undo::CommandSource;
pub use undo::HistoryConfig;
pub use undo::HistoryManager;
pub use undo::MergeConfig;
pub use undo::TextDeleteCmd;
pub use undo::TextInsertCmd;
pub use undo::TextReplaceCmd;
pub use undo::Transaction;
pub use undo::TransactionScope;
pub use undo::UndoableCmd;
pub use undo::WidgetId;
pub use unified_evidence::DecisionDomain;
pub use unified_evidence::DomainSummary;
pub use unified_evidence::EmitsEvidence;
pub use unified_evidence::EvidenceEntry;
pub use unified_evidence::EvidenceEntryBuilder;
pub use unified_evidence::EvidenceTerm;
pub use unified_evidence::LedgerSummary;
pub use unified_evidence::UnifiedEvidenceLedger;
pub use validation_pipeline::LedgerEntry;
pub use validation_pipeline::PipelineConfig;
pub use validation_pipeline::PipelineResult;
pub use validation_pipeline::PipelineSummary;
pub use validation_pipeline::ValidationOutcome;
pub use validation_pipeline::ValidationPipeline;
pub use validation_pipeline::ValidatorStats;
pub use voi_sampling::VoiConfig;
pub use voi_sampling::VoiDecision;
pub use voi_sampling::VoiLogEntry;
pub use voi_sampling::VoiObservation;
pub use voi_sampling::VoiSampler;
pub use voi_sampling::VoiSamplerSnapshot;
pub use voi_sampling::VoiSummary;
pub use state_persistence::MemoryStorage;
pub use state_persistence::RegistryStats;
pub use state_persistence::StateRegistry;
pub use state_persistence::StorageBackend;
pub use state_persistence::StorageError;
pub use state_persistence::StorageResult;
pub use state_persistence::StoredEntry;
pub use schedule_trace::CancelReason;
pub use schedule_trace::GoldenCompareResult;
pub use schedule_trace::IsomorphismProof;
pub use schedule_trace::ScheduleTrace;
pub use schedule_trace::SchedulerPolicy;
pub use schedule_trace::TaskEvent;
pub use schedule_trace::TraceConfig;
pub use schedule_trace::TraceEntry;
pub use schedule_trace::TraceSummary;
pub use schedule_trace::WakeupReason;
pub use schedule_trace::compare_golden;
pub use terminal_writer::RuntimeDiffConfig;
pub use wasm_runner::RenderedFrame;
pub use wasm_runner::StepResult;
pub use wasm_runner::WasmRunner;

Modules§

allocation_budget
Sequential allocation leak detection using CUSUM and e-process.
asciicast
Asciicast v2 recorder for capturing terminal sessions.
bocpd
Bayesian Online Change-Point Detection (BOCPD) for Resize Regime Detection.
conformal_alert
Conformal alert threshold calibration with anytime-valid e-process control.
conformal_predictor
Conformal predictor for frame-time risk (bd-3e1t.3.2).
cost_model
Formal cost models for caches, scheduling, and batching (bd-lff4p.5.6).
debug_trace
Zero-cost debug tracing controlled by environment variable.
diff_evidence
Diff strategy evidence ledger (bd-3jlw5.3).
eprocess_throttle
Anytime-valid throttle using e-process (test martingale) control.
evidence_bridges
Evidence bridges: convert domain-specific decision types into unified EvidenceEntry records (bd-xox.4).
evidence_sink
JSONL evidence sink for deterministic diagnostics.
evidence_telemetry
Evidence telemetry snapshots for runtime explainability overlays.
flake_detector
Anytime-Valid Flake Detector (bd-1plj).
input_fairness
Input Fairness Guard (bd-1rz0.17)
input_macro
Input macro recording and playback.
locale
Locale context provider for runtime-wide internationalization.
log_sink
Log sink for in-process output routing.
program
Bubbletea/Elm-style runtime for terminal applications.
queueing_scheduler
Queueing Theory Scheduler with SRPT/Smith-Rule Style Scheduling (bd-13pq.7).
reactive
Reactive data bindings for FrankenTUI.
render_trace
Render-trace recorder for deterministic replay (bd-3e1t.4.13).
resize_coalescer
Adaptive resize stream coalescer.
resize_sla
Resize SLA monitoring with conformal alerting (bd-1rz0.21).
schedule_trace
Schedule Trace Module (bd-gyi5).
simulator
Deterministic program simulator for testing.
state_persistence
Widget state persistence for save/restore across sessions.
string_model
Easy-mode adapter for string-based views.
subscription
Subscription system for continuous event sources.
terminal_writer
Terminal output coordinator with inline mode support.
undo
Undo/Redo command history framework.
unified_evidence
Unified Evidence Ledger for all Bayesian decision points (bd-fp38v).
validation_pipeline
Expected-cost validation ordering with Bayesian online learning.
voi_sampling
Value-of-Information (VOI) Sampling Policy for expensive measurements.
voi_telemetry
VOI debug telemetry snapshots for runtime introspection.
wasm_runner
Step-based program runner for WASM targets.

Macros§

bind
Create a direct Binding to an observable.
bind_map
Create a mapped Binding from an observable with a transform function.
bind_map2
Create a mapped Binding from two observables.
debug_trace
Conditionally print debug trace output to stderr.

Structs§

BackendFeatures
Terminal feature toggles that backends must support.
DiffStrategyConfig
Configuration for the diff strategy selector.
DiffStrategySelector
Bayesian diff strategy selector.
StrategyEvidence
Evidence supporting a strategy decision.

Enums§

DiffStrategy
The diff strategy to use for the current frame.

Traits§

BackendEventSource
Event source abstraction: terminal size queries, feature toggles, and event I/O.

Type Aliases§

Locale
Locale identifier (e.g., "en", "en-US", "ru").