pub struct AgentSessionHost { /* private fields */ }Expand description
Production SessionHost over a live Arc<AgentSession> and the
owning Arc<AgentSessionRuntime>.
All async session methods route to the real AgentSession. New / fork /
switch / clone go through AgentSessionRuntime so the replacement
pipeline runs (teardown → apply → rebind). The host clones the Arcs so
it is 'static and cheap to share with the runtime.
Implementations§
Source§impl AgentSessionHost
impl AgentSessionHost
Sourcepub fn new(runtime: Arc<AgentSessionRuntime>) -> Self
pub fn new(runtime: Arc<AgentSessionRuntime>) -> Self
Construct a new host around the live runtime + its current session.
Sourcepub fn session(&self) -> Arc<AgentSession> ⓘ
pub fn session(&self) -> Arc<AgentSession> ⓘ
Snapshot the underlying session Arc (for rebind wiring).
Trait Implementations§
Source§impl Clone for AgentSessionHost
impl Clone for AgentSessionHost
Source§fn clone(&self) -> AgentSessionHost
fn clone(&self) -> AgentSessionHost
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SessionHost for AgentSessionHost
impl SessionHost for AgentSessionHost
Source§fn snapshot(&self) -> SessionSnapshot
fn snapshot(&self) -> SessionSnapshot
Snapshot of synchronous state for view projection.
Snapshot persisted token/cost/context state for the footer.
Source§fn subscribe(&self) -> EventSubscription
fn subscribe(&self) -> EventSubscription
Subscribe to public session events. The returned
EventSubscription
owns an mpsc receiver plus the unsubscribe token.Source§fn partial_rx(&self) -> Receiver<Option<Arc<AssistantMessage>>>
fn partial_rx(&self) -> Receiver<Option<Arc<AssistantMessage>>>
Receiver for the latest partial assistant message (
None when idle).Source§fn prompt(
&self,
text: &str,
opts: PromptOptions,
) -> BoxFuture<'_, Result<(), String>>
fn prompt( &self, text: &str, opts: PromptOptions, ) -> BoxFuture<'_, Result<(), String>>
Submit a prompt.
Source§fn steer(&self, text: &str) -> BoxFuture<'_, Result<(), String>>
fn steer(&self, text: &str) -> BoxFuture<'_, Result<(), String>>
Steer the in-flight stream (mid-turn injection).
Source§fn follow_up(&self, text: &str) -> BoxFuture<'_, Result<(), String>>
fn follow_up(&self, text: &str) -> BoxFuture<'_, Result<(), String>>
Queue a follow-up message for the next turn.
Source§fn abort(&self) -> BoxFuture<'static, Result<(), String>>
fn abort(&self) -> BoxFuture<'static, Result<(), String>>
Abort the active run, retry, compaction, bash, or branch summary. Read more
Source§fn compact(
&self,
instructions: Option<&str>,
) -> BoxFuture<'_, Result<(), String>>
fn compact( &self, instructions: Option<&str>, ) -> BoxFuture<'_, Result<(), String>>
Manually compact the context with optional custom instructions.
Source§fn cycle_thinking_level(&self) -> BoxFuture<'_, Result<(), String>>
fn cycle_thinking_level(&self) -> BoxFuture<'_, Result<(), String>>
Cycle the thinking level forward.
Source§fn cycle_model(&self, forward: bool) -> BoxFuture<'_, Result<(), String>>
fn cycle_model(&self, forward: bool) -> BoxFuture<'_, Result<(), String>>
Cycle the active model in the given direction.
Source§fn reload(&self) -> BoxFuture<'_, Result<(), String>>
fn reload(&self) -> BoxFuture<'_, Result<(), String>>
Reload extensions / resources / keybindings.
Source§fn messages(&self) -> Vec<AgentMessage>
fn messages(&self) -> Vec<AgentMessage>
Returns the full transcript for the current session (used on rebind).
Source§fn host_extension_runner(&self) -> Option<Arc<HostExtensionRunner>>
fn host_extension_runner(&self) -> Option<Arc<HostExtensionRunner>>
Concrete extension host for interactive UI bridging, when enabled.
Source§fn hide_thinking_block(&self) -> bool
fn hide_thinking_block(&self) -> bool
Initial persisted thinking-block visibility.
Source§fn set_hide_thinking_block(&self, hide: bool) -> Result<(), String>
fn set_hide_thinking_block(&self, hide: bool) -> Result<(), String>
Persist thinking-block visibility. Read more
Source§fn external_editor_command(&self) -> String
fn external_editor_command(&self) -> String
Configured external editor command.
Source§fn get_model_entries(
&self,
) -> BoxFuture<'_, Result<Vec<ModelSelectorEntry>, String>>
fn get_model_entries( &self, ) -> BoxFuture<'_, Result<Vec<ModelSelectorEntry>, String>>
Fetch the model list for the model selector.
Source§fn get_session_entries(
&self,
) -> BoxFuture<'_, Result<Vec<SessionPickerEntry>, String>>
fn get_session_entries( &self, ) -> BoxFuture<'_, Result<Vec<SessionPickerEntry>, String>>
Fetch the recent sessions for the session picker.
Source§fn get_tree_entries(&self) -> BoxFuture<'_, Result<Vec<TreeEntry>, String>>
fn get_tree_entries(&self) -> BoxFuture<'_, Result<Vec<TreeEntry>, String>>
Fetch the session tree (entries with depth) for the tree selector.
Source§fn get_fork_entries(&self) -> BoxFuture<'_, Result<Vec<TreeEntry>, String>>
fn get_fork_entries(&self) -> BoxFuture<'_, Result<Vec<TreeEntry>, String>>
Fetch the user-message fork list (tree entries, only user messages).
Source§fn get_trust_entries(&self) -> BoxFuture<'_, Result<Vec<SettingsRow>, String>>
fn get_trust_entries(&self) -> BoxFuture<'_, Result<Vec<SettingsRow>, String>>
Fetch the trust-state settings rows.
Source§fn get_auth_entries(
&self,
) -> BoxFuture<'_, Result<Vec<AuthSelectorEntry>, String>>
fn get_auth_entries( &self, ) -> BoxFuture<'_, Result<Vec<AuthSelectorEntry>, String>>
Fetch the auth selector entries (provider list).
Source§fn get_scoped_models_entries(
&self,
) -> BoxFuture<'_, Result<ScopedModelEntries, String>>
fn get_scoped_models_entries( &self, ) -> BoxFuture<'_, Result<ScopedModelEntries, String>>
Fetch the scoped-models selector entries with current enabled map.
Source§fn get_settings_entries(
&self,
) -> BoxFuture<'_, Result<Vec<SettingsRow>, String>>
fn get_settings_entries( &self, ) -> BoxFuture<'_, Result<Vec<SettingsRow>, String>>
Fetch the settings selector rows.
Source§fn get_config_entries(&self) -> BoxFuture<'_, Result<Vec<SettingsRow>, String>>
fn get_config_entries(&self) -> BoxFuture<'_, Result<Vec<SettingsRow>, String>>
Fetch the config selector rows.
Source§fn execute_bash(
&self,
command: &str,
exclude_from_context: bool,
) -> BoxFuture<'_, Result<(), String>>
fn execute_bash( &self, command: &str, exclude_from_context: bool, ) -> BoxFuture<'_, Result<(), String>>
Execute a bash command (the runtime passes the typed command minus the
! / !! prefix).Source§fn new_session(&self) -> BoxFuture<'_, Result<(), String>>
fn new_session(&self) -> BoxFuture<'_, Result<(), String>>
Start a new session (replacement pipeline).
Source§fn fork(&self, entry_id: &str) -> BoxFuture<'_, Result<(), String>>
fn fork(&self, entry_id: &str) -> BoxFuture<'_, Result<(), String>>
Open the fork selector’s confirmation; runtime supplies the entry id.
Source§fn switch_session(&self, path: &str) -> BoxFuture<'_, Result<(), String>>
fn switch_session(&self, path: &str) -> BoxFuture<'_, Result<(), String>>
Switch to a different session file (resume).
Source§fn export_html(
&self,
path: Option<&str>,
) -> BoxFuture<'_, Result<String, String>>
fn export_html( &self, path: Option<&str>, ) -> BoxFuture<'_, Result<String, String>>
Export the current session to HTML; runtime passes an optional path.
Source§fn set_session_name(&self, name: &str) -> BoxFuture<'_, Result<(), String>>
fn set_session_name(&self, name: &str) -> BoxFuture<'_, Result<(), String>>
Set the session display name.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentSessionHost
impl !UnwindSafe for AgentSessionHost
impl Freeze for AgentSessionHost
impl Send for AgentSessionHost
impl Sync for AgentSessionHost
impl Unpin for AgentSessionHost
impl UnsafeUnpin for AgentSessionHost
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.