Skip to main content

PatchAdapter

Trait PatchAdapter 

Source
pub trait PatchAdapter: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute(
        &self,
        label: &str,
        frame: &HashMap<String, Value>,
    ) -> Result<Value, String>;
}
Expand description

Trait for patch/tool adapters. Implement to give dispatched patches real execution targets. Register via crate::AinlRuntime::register_adapter.

v0.3.0+ will ship HTTP, shell, and MCP adapter implementations. When no adapter is registered for a label, dispatch is metadata-only (existing v0.2 behavior preserved).

Required Methods§

Source

fn name(&self) -> &str

Canonical slug matching ainl-semantic-tagger tool names e.g. “bash”, “search_web”, “mcp”, “python_repl”

Source

fn execute( &self, label: &str, frame: &HashMap<String, Value>, ) -> Result<Value, String>

Execute the patch. Called when declared_reads are satisfied.

Implementors§