use std::path::PathBuf;
#[derive(Debug)]
pub enum AgentEvent {
Connected {
agent_id: String,
session_id: String,
},
Disconnected { agent_id: String },
Error { agent_id: String, message: String },
MessageChunk { agent_id: String, text: String },
NonTextContent {
agent_id: String,
description: String,
},
ThoughtChunk { agent_id: String, text: String },
ToolCall {
agent_id: String,
tool_call_id: String,
title: String,
status: ToolCallStatus,
},
ToolCallUpdate {
agent_id: String,
tool_call_id: String,
title: Option<String>,
status: Option<ToolCallStatus>,
},
PermissionRequest {
agent_id: String,
request: PermissionRequest,
response_tx: tokio::sync::oneshot::Sender<PermissionResponse>,
},
PromptDone {
agent_id: String,
stop_reason: StopReason,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ToolCallStatus {
Pending,
InProgress,
Completed,
Failed,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum StopReason {
EndTurn,
MaxTokens,
StopSequence,
ToolUse,
Other(String),
}
#[derive(Debug, Clone)]
pub struct PermissionRequest {
pub title: String,
pub description: String,
pub options: Vec<PermissionOption>,
}
#[derive(Debug, Clone)]
pub struct PermissionOption {
pub id: String,
pub title: String,
pub description: String,
}
#[derive(Debug, Clone)]
pub struct PermissionResponse {
pub outcome: PermissionOutcome,
}
#[derive(Debug, Clone)]
pub enum PermissionOutcome {
Allowed { selected_option: String },
Denied,
}
pub enum AgentCommand {
Prompt(String),
}
#[derive(Debug, Clone)]
pub enum AgentAvailability {
OnPath(PathBuf),
Distributable,
}
#[derive(Debug, Clone)]
pub struct DiscoveredAgent {
pub name: String,
pub binary: PathBuf,
pub args: Vec<String>,
pub availability: AgentAvailability,
}
#[derive(Debug, Clone)]
pub enum InstallProgress {
Downloading {
bytes_received: u64,
total: Option<u64>,
},
Extracting,
Done(PathBuf),
Failed(String),
}
const _: () = {
const fn _assert<T: Send>() {}
_assert::<AgentEvent>();
_assert::<AgentCommand>();
_assert::<DiscoveredAgent>();
_assert::<AgentAvailability>();
_assert::<InstallProgress>();
_assert::<PermissionRequest>();
_assert::<PermissionResponse>();
};