pub struct AgentSession { /* private fields */ }Expand description
Durable metadata for one provider-backed agent conversation.
Implementations§
Source§impl AgentSession
impl AgentSession
Sourcepub fn id(&self) -> &AgentSessionId
pub fn id(&self) -> &AgentSessionId
Stable identity owned by Muster rather than the provider.
Sourcepub fn name(&self) -> &ProcessName
pub fn name(&self) -> &ProcessName
Generated or user-supplied display name.
Sourcepub fn tool(&self) -> &AgentTool
pub fn tool(&self) -> &AgentTool
Provider preset controlling launch, activity, and resume behavior.
Sourcepub fn launch_command(&self) -> &CommandLine
pub fn launch_command(&self) -> &CommandLine
Original launch command, including user customizations.
Sourcepub fn working_dir(&self) -> &Option<PathBuf>
pub fn working_dir(&self) -> &Option<PathBuf>
Optional working directory relative to the owning workspace.
Sourcepub fn resume_command(&self) -> &Option<CommandLine>
pub fn resume_command(&self) -> &Option<CommandLine>
Optional custom resume template. {session_id} is replaced when present.
Sourcepub fn native_id(&self) -> &Option<NativeSessionId>
pub fn native_id(&self) -> &Option<NativeSessionId>
Provider identity captured by a lifecycle integration.
Sourcepub fn owner_process_id(&self) -> &Option<AgentProcessId>
pub fn owner_process_id(&self) -> &Option<AgentProcessId>
Process identity allowed to update the provider conversation.
Sourcepub fn owner_process_start_token(&self) -> &Option<AgentProcessStartToken>
pub fn owner_process_start_token(&self) -> &Option<AgentProcessStartToken>
Creation marker paired with the owner PID to reject PID reuse.
Sourcepub fn wrapper_process_id(&self) -> &Option<AgentProcessId>
pub fn wrapper_process_id(&self) -> &Option<AgentProcessId>
Shell wrapper identity allowed to hand off to its direct provider child.
Sourcepub fn state(&self) -> &AgentSessionState
pub fn state(&self) -> &AgentSessionState
Open sessions restore automatically; closed sessions remain in history.
Source§impl AgentSession
impl AgentSession
Sourcepub fn builder() -> AgentSessionBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> AgentSessionBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building AgentSession.
On the builder, call .id(...), .name(...), .tool(...), .project(...), .launch_command(...), .working_dir(...)(optional), .resume_command(...)(optional), .native_id(...)(optional), .owner_process_id(...)(optional), .owner_process_start_token(...)(optional), .wrapper_process_id(...)(optional), .state(...) to set the values of the fields.
Finally, call .build() to create the instance of AgentSession.
Source§impl AgentSession
impl AgentSession
Sourcepub fn with_native_id(self, native_id: NativeSessionId) -> Self
pub fn with_native_id(self, native_id: NativeSessionId) -> Self
Returns a copy with the provider identity captured by a hook or plugin.
Sourcepub fn with_owner_process_id(self, process_id: AgentProcessId) -> Self
pub fn with_owner_process_id(self, process_id: AgentProcessId) -> Self
Returns a copy bound to the current managed provider process.
Sourcepub fn with_launch_processes(
self,
owner_process_id: AgentProcessId,
owner_process_start_token: Option<AgentProcessStartToken>,
wrapper_process_id: Option<AgentProcessId>,
) -> Self
pub fn with_launch_processes( self, owner_process_id: AgentProcessId, owner_process_start_token: Option<AgentProcessStartToken>, wrapper_process_id: Option<AgentProcessId>, ) -> Self
Returns a copy bound to a launch owner and its optional shell wrapper.
Sourcepub fn with_state(self, state: AgentSessionState) -> Self
pub fn with_state(self, state: AgentSessionState) -> Self
Returns a copy with the requested persisted lifecycle state.
Sourcepub fn resume(&self) -> Option<CommandLine>
pub fn resume(&self) -> Option<CommandLine>
Builds the provider-specific command that resumes this conversation.
Sourcepub fn restore_command(&self) -> Option<CommandLine>
pub fn restore_command(&self) -> Option<CommandLine>
Builds the safest command available after a process or Muster restart. Pending launches and open caller-assigned identities retry their original new-session command until a lifecycle hook confirms them.
Sourcepub fn resume_template_is_valid(template: &CommandLine) -> bool
pub fn resume_template_is_valid(template: &CommandLine) -> bool
Whether a custom resume template can accept a provider identity without embedding it in a quoted or compound shell word. The complete template must also end outside quotes or escape syntax.
Sourcepub fn launch_command_accepts_provider_arguments(command: &CommandLine) -> bool
pub fn launch_command_accepts_provider_arguments(command: &CommandLine) -> bool
Whether built-in provider arguments can be safely appended to command.
Shell compositions require an explicit resume template so arguments are
never attached to a different command in a pipeline or sequence.
Trait Implementations§
Source§impl Clone for AgentSession
impl Clone for AgentSession
Source§fn clone(&self) -> AgentSession
fn clone(&self) -> AgentSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentSession
impl Debug for AgentSession
Source§impl<'de> Deserialize<'de> for AgentSession
impl<'de> Deserialize<'de> for AgentSession
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AgentSession
impl RefUnwindSafe for AgentSession
impl Send for AgentSession
impl Sync for AgentSession
impl Unpin for AgentSession
impl UnsafeUnpin for AgentSession
impl UnwindSafe for AgentSession
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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