pub struct CursorRunner;Expand description
Adapter for Cursor CLI (agent binary).
Headless invocation:
agent -p –output-format stream-json “
Stream format: NDJSON with event types:
- { type: “system”, subtype: “init”, session_id, model, cwd, apiKeySource, permissionMode }
- { type: “user”, message: { role, content: […] }, session_id }
- { type: “assistant”, message: { role, content: […] }, session_id }
- { type: “tool_call”, subtype: “started”|“completed”, call_id, tool_call, session_id }
- { type: “result”, subtype: “success”, result, session_id, duration_ms, is_error }
Trait Implementations§
Source§impl AgentRunner for CursorRunner
impl AgentRunner for CursorRunner
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 CursorRunner
impl RefUnwindSafe for CursorRunner
impl Send for CursorRunner
impl Sync for CursorRunner
impl Unpin for CursorRunner
impl UnwindSafe for CursorRunner
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