Skip to main content

MonitoredAgent

Struct MonitoredAgent 

Source
pub struct MonitoredAgent {
Show 27 fields pub id: String, pub target: String, pub agent_type: AgentType, pub status: AgentStatus, pub title: String, pub last_content: String, pub last_content_ansi: String, pub cwd: String, pub pid: u32, pub session: String, pub window_name: String, pub window_index: u32, pub pane_index: u32, pub selected: bool, pub last_update: DateTime<Utc>, pub context_warning: Option<u8>, pub detection_source: DetectionSource, pub team_info: Option<AgentTeamInfo>, pub is_virtual: bool, pub detection_reason: Option<DetectionReason>, pub mode: AgentMode, pub git_branch: Option<String>, pub git_dirty: Option<bool>, pub is_worktree: Option<bool>, pub auto_approve_phase: Option<AutoApprovePhase>, pub git_common_dir: Option<String>, pub worktree_name: Option<String>,
}
Expand description

A monitored agent instance

Fields§

§id: String

Unique identifier (session:window.pane)

§target: String

tmux target identifier

§agent_type: AgentType

Type of agent

§status: AgentStatus

Current status

§title: String

Pane title

§last_content: String

Last captured content (plain text for detection)

§last_content_ansi: String

Last captured content with ANSI codes (for preview)

§cwd: String

Working directory

§pid: u32

Process ID

§session: String

Session name

§window_name: String

Window name

§window_index: u32

Window index

§pane_index: u32

Pane index

§selected: bool

Whether this agent is selected in the UI

§last_update: DateTime<Utc>

Last update timestamp

§context_warning: Option<u8>

Context warning percentage (e.g., “11%” remaining until auto-compact)

§detection_source: DetectionSource

How the agent state was detected

§team_info: Option<AgentTeamInfo>

Team information (if this agent is part of a team)

§is_virtual: bool

Whether this is a virtual agent (team member without detected pane)

§detection_reason: Option<DetectionReason>

Detection reason from the last status detection

§mode: AgentMode

Permission mode (Plan, Delegate, AutoApprove, etc.)

§git_branch: Option<String>

Git branch name (if in a git repo)

§git_dirty: Option<bool>

Whether the git working tree has uncommitted changes

§is_worktree: Option<bool>

Whether this directory is a git worktree (not the main repo)

§auto_approve_phase: Option<AutoApprovePhase>

Auto-approve judgment phase (set by AutoApproveService)

§git_common_dir: Option<String>

Absolute path to the shared git common directory (for repository grouping)

§worktree_name: Option<String>

Worktree name extracted from .claude/worktrees/{name} in cwd

Implementations§

Source§

impl MonitoredAgent

Source

pub fn new( target: String, agent_type: AgentType, title: String, cwd: String, pid: u32, session: String, window_name: String, window_index: u32, pane_index: u32, ) -> Self

Create a new monitored agent

Source

pub fn with_detection_source(self, source: DetectionSource) -> Self

Set the detection source

Source

pub fn update( &mut self, status: AgentStatus, content: String, content_ansi: String, title: String, context_warning: Option<u8>, )

Update the agent’s status and content

Source

pub fn display_cwd(&self) -> String

Get the cwd with $HOME replaced by ~

Source

pub fn display_name(&self) -> String

Get the display name for the agent

Trait Implementations§

Source§

impl Clone for MonitoredAgent

Source§

fn clone(&self) -> MonitoredAgent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MonitoredAgent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more