Skip to main content

MobBootstrapSpec

Struct MobBootstrapSpec 

Source
pub struct MobBootstrapSpec {
    pub definition: MobDefinition,
    pub storage: MobStorage,
    pub session_service: Arc<dyn MobSessionService>,
    pub binary_blob_store: Option<Arc<dyn BinaryBlobStore>>,
    pub options: MobBootstrapOptions,
    pub runtime_adapter: Option<Arc<MeerkatMachine>>,
    /* private fields */
}
Expand description

Specification for bootstrapping a mob runtime from a definition, storage, and session service.

Fields§

§definition: MobDefinition§storage: MobStorage§session_service: Arc<dyn MobSessionService>§binary_blob_store: Option<Arc<dyn BinaryBlobStore>>§options: MobBootstrapOptions§runtime_adapter: Option<Arc<MeerkatMachine>>

Explicit runtime adapter — bypasses session_service.runtime_adapter().

Used by persistent() to supply the adapter directly so the session service’s runtime_store can stay None (keeping the checkpointer enabled). See meerkat-session#checkpointer-enabled-flag.

Implementations§

Source§

impl MobBootstrapSpec

Source

pub fn new( definition: MobDefinition, storage: MobStorage, session_service: Arc<dyn MobSessionService>, ) -> Self

Source

pub fn with_options(self, options: MobBootstrapOptions) -> Self

Source

pub fn with_session_runtime_adapter(self, adapter: Arc<MeerkatMachine>) -> Self

Expose a runtime adapter through the session-service facade.

Custom embedders that construct their own MobSessionService still need MobKit’s session-service surface to report the same runtime authority that MobBuilder::with_runtime_adapter(...) receives. This keeps autonomous-host comms, runtime inspection, and control paths pointed at one machine without forcing embedders through the stock factory helpers.

Source

pub fn with_after_create_hook(self, hook: AfterCreateHook) -> Self

Wrap the session service with an after-create hook that fires after each successful create_session. The hook is best-effort: errors are not propagated. Uses AfterCreateMobSessionService which wraps the inner service without a pre-build hook, so any pre-build mutations from inner wrappers are fully reflected in the context.

Source

pub fn ephemeral( definition: MobDefinition, storage: MobStorage, store_path: PathBuf, max_sessions: usize, session_store: Option<Arc<dyn AgentSessionStore>>, ) -> Self

Build an ephemeral session service with a correctly wired AgentFactory.

If session_store is provided, it is set on the FactoryAgentBuilder so that agents use the given store instead of falling back to JSONL.

Source

pub fn ephemeral_with_hook( definition: MobDefinition, storage: MobStorage, store_path: PathBuf, max_sessions: usize, session_store: Option<Arc<dyn AgentSessionStore>>, hook: impl Fn(&mut CreateSessionRequest) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + '_>> + Send + Sync + 'static, ) -> Self

Like ephemeral, but with a pre-build hook that is called before each agent is constructed. Use this to inject external tools, augment system prompts, or set per-agent labels.

Source

pub fn persistent( definition: MobDefinition, storage: MobStorage, store_path: PathBuf, max_sessions: usize, session_store: Arc<dyn SessionStore>, ) -> Self

Build a persistent session service with a correctly wired AgentFactory.

The session_store is used in two places:

  1. As the persistence backend for PersistentSessionService (checkpoint/restore).
  2. Adapted via StoreAdapter and set on FactoryAgentBuilder.default_session_store so that agents use it directly instead of falling back to JSONL.
Source

pub fn persistent_with_hook( definition: MobDefinition, storage: MobStorage, store_path: PathBuf, max_sessions: usize, session_store: Arc<dyn SessionStore>, hook: impl Fn(&mut CreateSessionRequest) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + '_>> + Send + Sync + 'static, ) -> Self

Like persistent, but with a pre-build hook that is called before each agent is constructed. Use this to inject external tools, augment system prompts, or set per-agent labels.

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<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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,