pub struct ClaudeRunner;Expand description
Adapter for Claude Code (claude CLI).
Headless invocation:
claude -p “
Stream format: NDJSON with event types:
- { type: “system”, subtype: “init”, session_id, model, cwd }
- { type: “assistant”, message: { role, content: [{ type: “text”, text }, { type: “tool_use”, … }] } }
- { type: “user”, message: { role, content: [{ type: “tool_result”, … }] } }
- { type: “result”, subtype: “success”|“error_*”, result, session_id, duration_ms, … }
Trait Implementations§
Source§impl AgentRunner for ClaudeRunner
impl AgentRunner for ClaudeRunner
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Check whether the agent binary is available on the system.
Source§fn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>
fn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>
Resolve the binary path (user override or PATH lookup).
Source§fn build_args(&self, config: &TaskConfig) -> Vec<String>
fn build_args(&self, config: &TaskConfig) -> Vec<String>
Build the command-line arguments for the agent process.
Source§fn build_env(&self, _config: &TaskConfig) -> Vec<(String, String)>
fn build_env(&self, _config: &TaskConfig) -> Vec<(String, String)>
Build the environment variables for the agent process.
Source§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the task and return a
StreamHandle with event stream and cancel token.Source§fn capabilities(&self) -> AgentCapabilities
fn capabilities(&self) -> AgentCapabilities
What features this agent supports.
Source§fn version(&self, config: &TaskConfig) -> Option<String>
fn version(&self, config: &TaskConfig) -> Option<String>
Get the version of the installed agent binary.
Source§fn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning>
fn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning>
Validate config against this agent’s capabilities.
Auto Trait Implementations§
impl Freeze for ClaudeRunner
impl RefUnwindSafe for ClaudeRunner
impl Send for ClaudeRunner
impl Sync for ClaudeRunner
impl Unpin for ClaudeRunner
impl UnwindSafe for ClaudeRunner
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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