pub struct App { /* private fields */ }Implementations§
Source§impl App
impl App
pub fn config(&self) -> &Config
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Request graceful cancellation of the currently-running turn (if any). Safe to call from any task; the engine observes the token and halts at the next safe point.
Sourcepub fn permissions_cache(&self) -> Arc<SessionCache>
pub fn permissions_cache(&self) -> Arc<SessionCache>
Exposes the session cache so front-ends can write “Allow for session”
decisions resolved by the user. Exposed as Arc so callers can drop
their reference freely.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
M3: the underlying motosan session id. Always populated; ephemeral sessions use a synthetic id internally.
Sourcepub async fn session_history(&self) -> Result<Vec<Message>>
pub async fn session_history(&self) -> Result<Vec<Message>>
M3: snapshot of the session’s persisted message history. Used by the
binary on --continue / --session to seed the TUI transcript so
the user can see what was said in prior runs. AgentSession::resume
already populates this internally for the agent to use as context
on the next turn; this method exposes it so the front-end can
render it too. Returns motosan’s Vec<Message> verbatim (callers
decide how to map roles → UI blocks; system messages are typically
dropped because they’re the prompt, not transcript).
Sourcepub async fn disconnect_mcp(&self)
pub async fn disconnect_mcp(&self)
M4 Phase B: disconnect every registered MCP server (2s per-server timeout, best-effort). Call from the binary’s ctrl-C handler.