pub trait SessionSource: Send + Sync {
// Required methods
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ResolvedCall, FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
fin: Finalize,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn artifact_upload_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
kind: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadTarget, FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn put_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
bytes: Vec<u8>,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn node_tools<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDecl>, FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn tool_call<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
node_id: &'life2 str,
tool_name: &'life3 str,
args: &'life4 Value,
) -> Pin<Box<dyn Future<Output = Result<String, FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
}Expand description
Bootstraps a call from a run id + per-call token and writes results back.
Send + Sync because it is shared across the spawned per-leg tasks of a call.
Required Methods§
Sourcefn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ResolvedCall, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ResolvedCall, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve a run id + per-call token into the call’s configuration.
Sourcefn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
fin: Finalize,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
fin: Finalize,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark the run complete and persist usage / collected vars / artifact URLs.
Sourcefn artifact_upload_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
kind: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadTarget, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn artifact_upload_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
kind: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadTarget, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Obtain a (pre-signed) upload target for an artifact (kind = recording/transcript/…).
Sourcefn put_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
bytes: Vec<u8>,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
bytes: Vec<u8>,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
PUT raw bytes to a (pre-signed) upload URL with the given content type.
Sourcefn node_tools<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDecl>, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn node_tools<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDecl>, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch the current node’s MCP/HTTP workflow tools (distinct from the
brain’s graph transitions). These are the tools the control plane will
execute on the agent’s behalf (see SessionSource::tool_call).
Implementations degrade gracefully: any HTTP/parse failure returns
Ok(vec![]) (the call proceeds with no node tools) rather than aborting
the live call. params is the tool’s JSON-Schema (input_schema,
defaulting to an empty object).
Sourcefn tool_call<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
node_id: &'life2 str,
tool_name: &'life3 str,
args: &'life4 Value,
) -> Pin<Box<dyn Future<Output = Result<String, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn tool_call<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
run_id: i64,
token: &'life1 str,
node_id: &'life2 str,
tool_name: &'life3 str,
args: &'life4 Value,
) -> Pin<Box<dyn Future<Output = Result<String, FlowcatError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Relay a workflow tool call (name + args) to the control plane, which runs
the MCP/HTTP egress and returns the tool result content (fed back to the
model). The is_error flag from the control plane is folded into the
returned text — the model handles failures conversationally — so this
returns a single string in all cases. On a transport error it returns a
short “temporarily unavailable” message so the call continues.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".