Skip to main content

CodeModeService

Trait CodeModeService 

Source
pub trait CodeModeService: Send + Sync {
Show 18 methods // Required methods fn search<'life0, 'async_trait>( &'life0 self, query: String, ) -> Pin<Box<dyn Future<Output = Result<SearchOutput, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn execute<'life0, 'async_trait>( &'life0 self, code: String, options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn execution<'life0, 'async_trait>( &'life0 self, execution_id: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn artifact<'life0, 'async_trait>( &'life0 self, execution_id: String, artifact_id: String, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn approve<'life0, 'async_trait>( &'life0 self, execution_id: String, seq: u64, options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn reject<'life0, 'async_trait>( &'life0 self, execution_id: String, seq: u64, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cancel<'life0, 'async_trait>( &'life0 self, execution_id: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn install_workflows<'life0, 'async_trait>( &'life0 self, _definitions: BTreeMap<String, WorkflowDefinition>, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn prepare<'life0, 'async_trait>( &'life0 self, _code: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn recover<'life0, 'async_trait>( &'life0 self, execution_id: String, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn supports_retained_execution(&self) -> bool { ... } fn approve_detached<'life0, 'async_trait>( &'life0 self, _execution_id: String, _seq: u64, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn execute_retained<'life0, 'async_trait>( &'life0 self, _code: String, _retention_ms: u64, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn resume<'life0, 'async_trait>( &'life0 self, _execution_id: String, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn save_snippet<'life0, 'async_trait>( &'life0 self, _name: String, _description: String, _execution_id: String, _input_schema: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Snippet, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn publish_snippet<'life0, 'async_trait>( &'life0 self, _name: String, _description: String, _code: String, _input_schema: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Snippet, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn snippets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Snippet>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn delete_snippet<'life0, 'async_trait>( &'life0 self, _name: String, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Send-safe lifecycle boundary used by transports and native actor handles.

Required Methods§

Source

fn search<'life0, 'async_trait>( &'life0 self, query: String, ) -> Pin<Box<dyn Future<Output = Result<SearchOutput, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Searches current connector methods and saved snippets.

Source

fn execute<'life0, 'async_trait>( &'life0 self, code: String, options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts an execution and returns its durable running state.

Source

fn execution<'life0, 'async_trait>( &'life0 self, execution_id: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one bounded execution snapshot by identifier.

Oversized values remain artifact references so transports can return the snapshot before retrieving a selected artifact.

Source

fn artifact<'life0, 'async_trait>( &'life0 self, execution_id: String, artifact_id: String, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one artifact owned by an execution.

Source

fn approve<'life0, 'async_trait>( &'life0 self, execution_id: String, seq: u64, options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Approves a pending action and drives the next replay pass.

Source

fn reject<'life0, 'async_trait>( &'life0 self, execution_id: String, seq: u64, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rejects a pending action.

Source

fn cancel<'life0, 'async_trait>( &'life0 self, execution_id: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancels a running or paused execution.

Provided Methods§

Source

fn install_workflows<'life0, 'async_trait>( &'life0 self, _definitions: BTreeMap<String, WorkflowDefinition>, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Installs protected host-defined workflows in the shared composition catalog.

Source

fn prepare<'life0, 'async_trait>( &'life0 self, _code: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persists an idle execution without starting effects, so a host can bind it to a durable delivery before calling recover.

Source

fn recover<'life0, 'async_trait>( &'life0 self, execution_id: String, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Recovers interrupted running work without duplicating an active pass. Hosts with independent job workers may return their current snapshot.

Source

fn supports_retained_execution(&self) -> bool

Whether this host implements retained asynchronous execution and detached approval. Task-capable hosts must implement both execute_retained and approve_detached.

Source

fn approve_detached<'life0, 'async_trait>( &'life0 self, _execution_id: String, _seq: u64, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commits an approval before returning and drives its continuation independently.

Source

fn execute_retained<'life0, 'async_trait>( &'life0 self, _code: String, _retention_ms: u64, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts work retained for the supplied duration, returning before driving it.

Source

fn resume<'life0, 'async_trait>( &'life0 self, _execution_id: String, _options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Restarts interrupted running or recovery-paused work with current authority. Returns the committed running state before driving its pass independently. Paused approvals must be decided through approve or reject.

Source

fn save_snippet<'life0, 'async_trait>( &'life0 self, _name: String, _description: String, _execution_id: String, _input_schema: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Snippet, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Saves a completed execution as a named snippet.

Source

fn publish_snippet<'life0, 'async_trait>( &'life0 self, _name: String, _description: String, _code: String, _input_schema: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Snippet, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publishes callable source without invoking tools or requiring a completed execution.

Source

fn snippets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Snippet>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists saved snippets in stable name order.

Source

fn delete_snippet<'life0, 'async_trait>( &'life0 self, _name: String, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes one saved snippet, returning whether it existed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§