pub struct GenericProvider { /* private fields */ }Expand description
Generic provider for any CLI agent.
Uses the provider name as the command and PTY activity heuristic for state detection.
Implementations§
Trait Implementations§
Source§impl Provider for GenericProvider
impl Provider for GenericProvider
Source§fn build_command(
&self,
dir: &Path,
args: &[String],
_resume_session: Option<&str>,
_prompt: Option<&str>,
) -> Command
fn build_command( &self, dir: &Path, args: &[String], _resume_session: Option<&str>, _prompt: Option<&str>, ) -> Command
Build the command to launch the agent in a directory.
Source§fn detect_state_from_output(
&self,
_recent_output: &[u8],
idle_duration: Duration,
) -> Option<AgentState>
fn detect_state_from_output( &self, _recent_output: &[u8], idle_duration: Duration, ) -> Option<AgentState>
Analyze agent state from recent PTY output and time since last output.
Returns
None if this provider doesn’t do output-based detection (e.g. uses hooks).Source§fn map_hook_event(&self, _event: &str) -> Option<AgentState>
fn map_hook_event(&self, _event: &str) -> Option<AgentState>
Map a hook event name to an agent state.
Returns
None if this provider doesn’t handle hooks or doesn’t recognize the event.Source§fn context_usage(&self, _pid: u32, _dir: &Path) -> Option<ContextUsage>
fn context_usage(&self, _pid: u32, _dir: &Path) -> Option<ContextUsage>
Read context window usage for an agent. Returns
None if not supported
or if the data isn’t available.Auto Trait Implementations§
impl Freeze for GenericProvider
impl RefUnwindSafe for GenericProvider
impl Send for GenericProvider
impl Sync for GenericProvider
impl Unpin for GenericProvider
impl UnsafeUnpin for GenericProvider
impl UnwindSafe for GenericProvider
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