pub struct WSOperatorSession { /* private fields */ }Expand description
1 sid = 1 session. Looked up by sid in the operator_sessions store on reconnect.
Trait Implementations§
Source§impl Operator for WSOperatorSession
impl Operator for WSOperatorSession
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
_system: Option<String>,
_prompt: String,
worker_token: CapToken,
) -> Pin<Box<dyn Future<Output = Result<WorkerResult, WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
_system: Option<String>,
_prompt: String,
worker_token: CapToken,
) -> Pin<Box<dyn Future<Output = Result<WorkerResult, WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Thin control channel impl (the Spawn thin-control axis): system / prompt
have already been baked into engine state on the server side
(= bake_worker_system_prompt in OperatorSpawner.spawn + the existing
fetch_prompt path). This impl encodes worker_token and hands it to
the MainAI in a single Spawn message; the SubAgent then hits
/v1/worker/prompt + /v1/worker/result itself over HTTP. The system
/ prompt arguments are intentionally not used here (= heavy payloads
are not carried on WS — thin-path discipline).
The SubAgent’s result post (= HTTP POST /v1/worker/result) appends
Final to output_tail; when the MainAI returns SpawnAck, this
execute returns WorkerResult and control returns to the dispatch path.
Source§impl SeniorBridge for WSOperatorSession
impl SeniorBridge for WSOperatorSession
Source§fn ask<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
question: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ask<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
question: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Value). The
implementation is free — a CLI prompt, an MCP modal, another
process, whatever.Source§impl SpawnHook for WSOperatorSession
impl SpawnHook for WSOperatorSession
Source§fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Err aborts the spawn.Source§fn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
result: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
result: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !Freeze for WSOperatorSession
impl !RefUnwindSafe for WSOperatorSession
impl !UnwindSafe for WSOperatorSession
impl Send for WSOperatorSession
impl Sync for WSOperatorSession
impl Unpin for WSOperatorSession
impl UnsafeUnpin for WSOperatorSession
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> 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