Skip to main content

AgentSession

Struct AgentSession 

Source
pub struct AgentSession { /* private fields */ }
Expand description

Durable metadata for one provider-backed agent conversation.

Implementations§

Source§

impl AgentSession

Source

pub fn id(&self) -> &AgentSessionId

Stable identity owned by Muster rather than the provider.

Source

pub fn name(&self) -> &ProcessName

Generated or user-supplied display name.

Source

pub fn tool(&self) -> &AgentTool

Provider preset controlling launch, activity, and resume behavior.

Source

pub fn project(&self) -> &PathBuf

Exact workspace config location that owns the session.

Source

pub fn launch_command(&self) -> &CommandLine

Original launch command, including user customizations.

Source

pub fn working_dir(&self) -> &Option<PathBuf>

Optional working directory relative to the owning workspace.

Source

pub fn resume_command(&self) -> &Option<CommandLine>

Optional custom resume template. {session_id} is replaced when present.

Source

pub fn native_id(&self) -> &Option<NativeSessionId>

Provider identity captured by a lifecycle integration.

Source

pub fn owner_process_id(&self) -> &Option<AgentProcessId>

Process identity allowed to update the provider conversation.

Source

pub fn owner_process_start_token(&self) -> &Option<AgentProcessStartToken>

Creation marker paired with the owner PID to reject PID reuse.

Source

pub fn wrapper_process_id(&self) -> &Option<AgentProcessId>

Shell wrapper identity allowed to hand off to its direct provider child.

Source

pub fn state(&self) -> &AgentSessionState

Open sessions restore automatically; closed sessions remain in history.

Source§

impl AgentSession

Source

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

Source

pub fn with_native_id(self, native_id: NativeSessionId) -> Self

Returns a copy with the provider identity captured by a hook or plugin.

Source

pub fn with_owner_process_id(self, process_id: AgentProcessId) -> Self

Returns a copy bound to the current managed provider process.

Source

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.

Source

pub fn with_state(self, state: AgentSessionState) -> Self

Returns a copy with the requested persisted lifecycle state.

Source

pub fn resume(&self) -> Option<CommandLine>

Builds the provider-specific command that resumes this conversation.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> AgentSession

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentSession

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AgentSession

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AgentSession

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: Rng + ?Sized, Self: FakeBase<U>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more