pub struct App {Show 50 fields
pub cli: Cli,
pub session_id: String,
pub mode: Mode,
pub run_state: RunState,
pub input: PromptInput,
pub input_history: Vec<String>,
pub history_cursor: Option<usize>,
pub history_draft: String,
pub transcript: Vec<Entry>,
pub cwd: PathBuf,
pub git_status: Option<GitStatusSummary>,
pub model: String,
pub model_picker_items: Vec<PickerItem>,
pub user_label: String,
pub websearch: WebSearchMode,
pub theme: Theme,
pub verbose: bool,
pub session_tokens_in: u64,
pub session_tokens_out: u64,
pub ttft: TurnTtftState,
pub context_sources: Vec<ContextSource>,
pub context_diagnostics: Vec<InstructionDiagnostic>,
pub context_ledger: Option<ContextLedger>,
pub last_request_accounting: Option<ProviderRequestAccounting>,
pub skills: Vec<SkillMetadata>,
pub skill_diagnostics: Vec<SkillDiagnostic>,
pub ui_tick: u64,
pub ctrl_d_pending: Option<u64>,
pub stopping_deadline: Option<u64>,
pub session_writer: Option<SessionWriter>,
pub tool_artifacts: HashMap<String, String>,
pub turn_count: u64,
pub process_registry: ProcessRegistry,
pub last_input: Option<String>,
pub last_compaction_review: Option<CompactionReviewResult>,
pub queue_target: QueueTarget,
pub picker: Option<PickerState>,
pub prompt_accessory: PromptAccessory,
pub first_run_recovery: Option<FirstRunRecovery>,
pub chatgpt_oauth_driver: ChatGptOAuthDriver,
pub chatgpt_browser_login: Option<ChatGptCodexBrowserLogin>,
pub queued_steering: Vec<String>,
pub queued_followups: Vec<String>,
pub kill_ring: Vec<String>,
pub detail_pane: DetailPane,
pub pending_permission: Option<PendingPermission>,
pub config_diagnostics: Vec<String>,
pub mcp_config_files: Vec<SessionConfigFile>,
pub mcp_config_diagnostics: Vec<String>,
pub quit: bool,
/* private fields */
}Expand description
The full application state used to draw the screen.
Fields§
§cli: CliSnapshot of the effective CLI config used by command-like TUI flows.
session_id: String§mode: Mode§run_state: RunState§input: PromptInput§input_history: Vec<String>Submitted prompt history for Up/Down recall.
history_cursor: Option<usize>Current index into input_history while navigating history.
history_draft: StringDraft input captured before history navigation starts.
transcript: Vec<Entry>§cwd: PathBuf§git_status: Option<GitStatusSummary>Current git working tree summary for the status line.
model: String§model_picker_items: Vec<PickerItem>§user_label: String§websearch: WebSearchMode§theme: ThemeUI color theme.
verbose: boolWhether diagnostic provider/log status rows should be shown in transcript.
session_tokens_in: u64Provider token usage accumulated for this session.
session_tokens_out: u64§ttft: TurnTtftStateIn-memory client-observed TTFT for the active and last completed turn.
context_sources: Vec<ContextSource>Loaded context sources (e.g. AGENTS.md).
context_diagnostics: Vec<InstructionDiagnostic>Filesystem discovery diagnostics for project instructions.
context_ledger: Option<ContextLedger>Latest provider-neutral context ledger used for inspection and prompt assembly. It is replaced at each turn boundary.
last_request_accounting: Option<ProviderRequestAccounting>Most recent completed provider request accounting for /tokens and
context export. The request projection is in-memory only.
skills: Vec<SkillMetadata>Discovered Agent Skills metadata.
skill_diagnostics: Vec<SkillDiagnostic>Skill discovery diagnostics for ignored malformed skills.
ui_tick: u64Monotonic UI tick used for lightweight animated affordances.
ctrl_d_pending: Option<u64>When Some, the user pressed Ctrl+D once and we are waiting for a
second press within roughly three seconds to actually quit. The value
is the tick deadline at which the pending confirmation expires.
stopping_deadline: Option<u64>Tick deadline that bounds how long a cancelled run may remain in the
Stopping state while its worker unwinds.
session_writer: Option<SessionWriter>Append-only session writer. None when persistence is disabled
(e.g. the sessions directory is not writable).
tool_artifacts: HashMap<String, String>Tool-call ids mapped to their bounded redacted recovery handles.
turn_count: u64Monotonic turn counter for session record correlation.
process_registry: ProcessRegistryRegistry of background processes started via run_shell.
last_input: Option<String>The active provider prompt, retained so user input can be restored on provider failure. This can be an internal compaction request that is intentionally absent from the visible transcript. Cleared on successful completion.
last_compaction_review: Option<CompactionReviewResult>Last compaction review state for the context health surface.
queue_target: QueueTargetCurrent target for input submitted while the agent is running.
picker: Option<PickerState>Active fuzzy picker state, used by file and model pickers.
prompt_accessory: PromptAccessoryInline prompt accessory rendered above the input.
first_run_recovery: Option<FirstRunRecovery>Focused first-run or credential recovery surface.
chatgpt_oauth_driver: ChatGptOAuthDriverChatGPT OAuth functions used by focused recovery.
chatgpt_browser_login: Option<ChatGptCodexBrowserLogin>Short-lived browser PKCE callback owned by the application adapter.
queued_steering: Vec<String>Steering messages waiting to be sent to the active agent thread.
queued_followups: Vec<String>Follow-up prompts to submit as new turns after the active run completes.
kill_ring: Vec<String>Kill-ring for readline-style yank (Ctrl+Y).
detail_pane: DetailPaneScrollable detail pane for inspecting full tool output.
pending_permission: Option<PendingPermission>One pending ACP permission request, if an external agent is blocked on a user decision.
config_diagnostics: Vec<String>Non-fatal config diagnostics from effective config loading. Surfaced in verbose startup rows and prompt inspection.
mcp_config_files: Vec<SessionConfigFile>MCP config files captured when the session audit metadata was written.
mcp_config_diagnostics: Vec<String>Non-fatal MCP config diagnostics from the latest MCP config audit load.
quit: boolWhen true the loop should stop and the app exit.
Implementations§
Source§impl App
impl App
Sourcepub fn recover_context_evidence(
&mut self,
reference: &str,
) -> Result<ArtifactRecovery, String>
pub fn recover_context_evidence( &mut self, reference: &str, ) -> Result<ArtifactRecovery, String>
Recover bounded redacted evidence for a context item or artifact handle.
The recovery action is appended even when the body is missing or expired, so the item’s audit metadata remains useful across resume.
Sourcepub fn refresh_context_ledger(
&mut self,
user_turn: Option<&str>,
) -> ContextLedger
pub fn refresh_context_ledger( &mut self, user_turn: Option<&str>, ) -> ContextLedger
Rebuild the deterministic context ledger for a turn boundary.
The caller owns discovery, transcript projection, and persistence. The agent library receives only typed candidates and returns the policy result. This method also stores the latest ledger for bounded inspection.
Sourcepub fn open_context_surface(&mut self)
pub fn open_context_surface(&mut self)
Open the bounded context inspection surface.
Sourcepub fn build_context_export(&mut self, include_artifacts: bool) -> ContextExport
pub fn build_context_export(&mut self, include_artifacts: bool) -> ContextExport
Build the current bounded context export.
Sourcepub fn write_context_export(
&mut self,
path: &Path,
format: ContextExportFormat,
include_artifacts: bool,
) -> Result<(), String>
pub fn write_context_export( &mut self, path: &Path, format: ContextExportFormat, include_artifacts: bool, ) -> Result<(), String>
Render and atomically write a bounded context export.
pub fn restore_context_state(&mut self, records: &[SessionRecord])
Source§impl App
impl App
Sourcepub fn from_cli(cli: &Cli) -> Self
pub fn from_cli(cli: &Cli) -> Self
Build the initial app from parsed CLI args.
Discovers the workspace root from --cwd (preferring the git root), loads
scoped AGENTS.md sources if present, and records their metadata in the session.
Sourcepub fn compaction_in_flight(&self) -> bool
pub fn compaction_in_flight(&self) -> bool
Whether a compaction turn is currently in flight.
Used by the preflight gate to avoid re-triggering auto-compaction while the configured-model summary request is the active turn.
Sourcepub fn artifact_store(&self) -> ArtifactStore
pub fn artifact_store(&self) -> ArtifactStore
Return the local bounded artifact store for this session workspace.
The store is deliberately separate from JSONL so session records carry metadata and handles without making artifact bodies part of replay truth.
Sourcepub fn token_accounting_status(&self) -> String
pub fn token_accounting_status(&self) -> String
Render the bounded /tokens inspection projection.
Sourcepub fn self_knowledge_snapshot(&self) -> SelfKnowledgeSnapshot
pub fn self_knowledge_snapshot(&self) -> SelfKnowledgeSnapshot
Build the compact self-knowledge snapshot used by the startup display.
Sourcepub fn status_label(&self) -> &'static str
pub fn status_label(&self) -> &'static str
Derive the granular status label for the status line.
Maps RunState plus the last transcript entry into one of idle, sending,
thinking, working, running tool, stopping, cancelled, failed, error, done.
Sourcepub fn prompt_state(&self) -> PromptState
pub fn prompt_state(&self) -> PromptState
Derive the prompt UI state from run_state and the transcript.
Sourcepub fn effective_compaction_policy(&self) -> CompactionPolicy
pub fn effective_compaction_policy(&self) -> CompactionPolicy
Resolve the configured compaction policy from loaded config layers.
Trait Implementations§
Source§impl From<&App> for FocusedSurfaceView
impl From<&App> for FocusedSurfaceView
Source§impl From<&App> for SemanticUiView
impl From<&App> for SemanticUiView
Source§impl From<&App> for PromptSurfaceView
impl From<&App> for PromptSurfaceView
Source§impl From<&App> for OrientationBandView
impl From<&App> for OrientationBandView
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl UnwindSafe for App
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more