use infinity_provider_protocol::Usage;
use crate::message::InfinityMessage;
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct UserChoice {
pub id: rap_protocol::ChoiceId,
pub prompt: String,
pub choices: Vec<String>,
pub default: usize,
pub response_url: String,
}
#[derive(Debug, Clone)]
pub enum AgentEvent {
UserInput { text: String },
ToolResult {
segments: Vec<rap_protocol::DisplaySegment>,
},
SubscriptionEvent { name: String, text: String },
OAuthRequired { auth_url: String },
CompactionApplied,
CompletionStarted,
TextChunk { text: String },
ThinkingStarted,
ThinkingChunk { text: String },
ThinkingEnded,
ToolCall {
name: String,
args: serde_json::Value,
display_as: Option<String>,
},
CompletionFinished { usage: Option<Usage> },
UserChoiceRequired { choice: UserChoice },
UserChoiceDismissed { choice_id: rap_protocol::ChoiceId },
Info { text: String },
}
#[derive(Debug, Clone)]
pub struct ReplaySnapshot {
pub history: Vec<InfinityMessage>,
pub current_thinking: Option<String>,
pub in_progress: bool,
pub pending_choices: Vec<UserChoice>,
}