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: StringUnique identifier (session:window.pane)
target: Stringtmux target identifier
agent_type: AgentTypeType of agent
status: AgentStatusCurrent status
title: StringPane title
last_content: StringLast captured content (plain text for detection)
last_content_ansi: StringLast captured content with ANSI codes (for preview)
cwd: StringWorking directory
pid: u32Process ID
session: StringSession name
window_name: StringWindow name
window_index: u32Window index
pane_index: u32Pane index
selected: boolWhether 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: DetectionSourceHow the agent state was detected
team_info: Option<AgentTeamInfo>Team information (if this agent is part of a team)
is_virtual: boolWhether this is a virtual agent (team member without detected pane)
detection_reason: Option<DetectionReason>Detection reason from the last status detection
mode: AgentModePermission 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
impl MonitoredAgent
Sourcepub 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
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
Sourcepub fn with_detection_source(self, source: DetectionSource) -> Self
pub fn with_detection_source(self, source: DetectionSource) -> Self
Set the detection source
Sourcepub fn update(
&mut self,
status: AgentStatus,
content: String,
content_ansi: String,
title: String,
context_warning: Option<u8>,
)
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
Sourcepub fn display_cwd(&self) -> String
pub fn display_cwd(&self) -> String
Get the cwd with $HOME replaced by ~
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get the display name for the agent
Trait Implementations§
Source§impl Clone for MonitoredAgent
impl Clone for MonitoredAgent
Source§fn clone(&self) -> MonitoredAgent
fn clone(&self) -> MonitoredAgent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MonitoredAgent
impl RefUnwindSafe for MonitoredAgent
impl Send for MonitoredAgent
impl Sync for MonitoredAgent
impl Unpin for MonitoredAgent
impl UnsafeUnpin for MonitoredAgent
impl UnwindSafe for MonitoredAgent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.