pub struct Agent {
pub id: String,
pub branch: String,
pub model: Option<String>,
pub description: Option<String>,
pub worktree_path: Option<PathBuf>,
pub status: AgentStatus,
pub last_activity: Option<DateTime<Utc>>,
pub tmux_pane: Option<String>,
pub config: AgentConfig,
}Expand description
Represents an AI coding agent with its workspace configuration and operational parameters.
Fields§
§id: StringUnique identifier for the agent (number or name)
branch: StringGit branch name for this agent’s work
model: Option<String>AI model to use (e.g., “claude-sonnet-4”, “gpt-4”)
description: Option<String>Role or specialization description
worktree_path: Option<PathBuf>Local workspace path (defaults to agents/{id})
status: AgentStatusCurrent status of the agent
last_activity: Option<DateTime<Utc>>Last activity timestamp
tmux_pane: Option<String>tmux pane identifier
config: AgentConfigAgent-specific configuration
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn new(id: impl Into<String>, branch: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, branch: impl Into<String>) -> Self
Create a new agent with basic configuration.
Sourcepub fn workspace_path(&self) -> &PathBuf
pub fn workspace_path(&self) -> &PathBuf
Get the workspace path for this agent.
Sourcepub fn update_activity(&mut self)
pub fn update_activity(&mut self)
Update the agent’s last activity timestamp.
Sourcepub fn error_message(&self) -> Option<&str>
pub fn error_message(&self) -> Option<&str>
Get the error message if the agent is in an error state.
Sourcepub fn add_command(&mut self, _command: CommandMessage)
pub fn add_command(&mut self, _command: CommandMessage)
Add a command to the agent’s command history.
Sourcepub fn add_result(&mut self, _result: ExecutionResult)
pub fn add_result(&mut self, _result: ExecutionResult)
Add an execution result to the agent’s history.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Agent
impl<'de> Deserialize<'de> for Agent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
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