Skip to main content

Effect

Enum Effect 

Source
pub enum Effect<M = UnitModeProtocol>
where M: ModeProtocol,
{ SyncExecutionSurface { id: EffectId, update_machine_config: bool, }, LlmCall { id: EffectId, request: Arc<LlmRequest>, }, CancelLlm { id: EffectId, }, ToolCalls { id: EffectId, calls: Vec<PendingToolCall>, }, ExecCode { id: EffectId, code: String, }, Checkpoint { id: EffectId, checkpoint: CheckpointKind, }, Sleep { id: EffectId, duration: Duration, }, Log { event: LogEvent, }, Emit(SessionEvent), Progress { messages: MessageSequence, events: Arc<Vec<SessionEventRecord<<M as ModeProtocol>::Event>>>, mode_iteration: usize, }, Done { messages: MessageSequence, events: Arc<Vec<SessionEventRecord<<M as ModeProtocol>::Event>>>, mode_iteration: usize, }, }
Expand description

An effect the host must fulfil.

Variants§

§

SyncExecutionSurface

Sync the live execution surface before the turn proceeds.

update_machine_config is only needed after the turn has already advanced at least once and the host may need to swap in a refreshed system prompt or tool schema for the next mode iteration. Initial syncs are host-only because the machine was already constructed from a fresh execution surface.

Fields

§update_machine_config: bool
§

LlmCall

Start an LLM call.

Fields

§request: Arc<LlmRequest>
§

CancelLlm

Cancel an in-progress LLM stream.

Fields

§

ToolCalls

Execute one or more standard-mode tool calls.

§

ExecCode

Execute a mode-owned code block.

Fields

§code: String
§

Checkpoint

Run a host/plugin checkpoint before the machine continues or completes.

Fields

§checkpoint: CheckpointKind
§

Sleep

Retry backoff.

Fields

§duration: Duration
§

Log

Host-implemented fire-and-forget logging.

Fields

§event: LogEvent
§

Emit(SessionEvent)

Fire-and-forget event (no response needed).

§

Progress

Prompt-history progress that may be durably persisted by the host.

This is separate from SessionEvent: UI stream events can be partial, duplicated, or display-only, while Progress is emitted only after the state machine has applied semantic message or mode-step changes.

Fields

§mode_iteration: usize
§

Done

Turn is done.

Fields

§mode_iteration: usize

Trait Implementations§

Source§

impl<M> Debug for Effect<M>
where M: Debug + ModeProtocol, <M as ModeProtocol>::Event: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<M = UnitModeProtocol> !Freeze for Effect<M>

§

impl<M = UnitModeProtocol> !RefUnwindSafe for Effect<M>

§

impl<M> Send for Effect<M>

§

impl<M> Sync for Effect<M>

§

impl<M> Unpin for Effect<M>

§

impl<M> UnsafeUnpin for Effect<M>

§

impl<M = UnitModeProtocol> !UnwindSafe for Effect<M>

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