Skip to main content

Module app

Module app 

Source

Re-exports§

pub use event_source::event_to_msg;
pub use event_source::parse_slash_command;
pub use lifecycle::RuntimeLifecycle;
pub use recorder::Recorder;
pub use recorder::Replay;
pub use recorder::ReplayEntry;
pub use recorder::record_msg_body;
pub use run::InteractiveOptions;
pub use run::run_interactive;
pub use run::run_interactive_with;
pub use run_non_interactive::RunOptions;
pub use run_non_interactive::RunResult;
pub use run_non_interactive::format_result;
pub use run_non_interactive::run_non_interactive;
pub use run_non_interactive::run_non_interactive_with;
pub use terminal::TerminalGuard;

Modules§

event_source
Crossterm event stream → Msg.
instructions
Project-instructions loader (Step 5h).
lifecycle
Process lifecycle signal handling.
memory
Durable semantic memory (v0.10.0).
recorder
--record / --replay support.
run
The ~30-line main loop.
run_non_interactive
Headless driver for mermaid run <prompt>.
terminal
Terminal setup and teardown.

Structs§

CompactionConfig
Context-compaction settings.
Config
Main configuration structure
McpServerConfig
MCP server configuration
MemoryConfig
Durable semantic memory settings (v0.10.0).
SafetyConfig
UserProviderConfig
User-supplied OpenAI-compatible provider configuration. All fields are optional — when matching a built-in registry entry, only the supplied fields override; the rest fall back to the registry defaults. For fully custom providers, base_url and api_key_env are required.

Functions§

get_config_dir
Get the configuration directory
init_config
Create a default configuration file if it doesn’t exist
load_config
Load configuration from single config file Priority: config file > defaults (that’s it - no merging, no env vars)
load_config_or_warn
Like load_config but never fails: if a config file exists yet is malformed, warn on stderr and fall back to defaults — instead of silently swallowing the error (#111). An absent file is not an error (load_config returns defaults for it), so the warning fires only for a genuine read/parse failure the user should know about.
persist_default_reasoning
Persist the user’s default reasoning level to config file. Mirrors persist_last_model — used by the /reasoning slash command and the Alt+T cycle handler so the choice survives across sessions.
persist_last_model
Persist the last used model to config file. On a malformed config it propagates the error (the caller drops it) rather than clobbering the file with defaults — the three persist_* helpers all do this (#111).
persist_ollama_allow_ram_offload
Persist the Ollama RAM-offload toggle (/context offload on|off).
persist_ollama_num_ctx_for_model
Persist (or clear) a per-model Ollama num_ctx override. Some(n) sets it, None removes the entry (returning that model to auto-fit).
persist_reasoning_for_model
Persist a reasoning level for a specific model ID (e.g. anthropic/claude-sonnet-4-6). The TUI calls this from Alt+T, /reasoning <level>, and the does-not-support-thinking auto-snap so the choice sticks per-model rather than bleeding into other models on next session start.
resolve_model_id
Resolve which model to use: CLI arg > last_used > default_model > any available
save_config
Save configuration to file