use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, Default)]
pub struct ListAgentsInput {}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AgentSummary {
pub name: String,
pub description: String,
pub agent_type: String,
pub active: bool,
pub deployed_at: String,
}
#[derive(Debug, Serialize)]
pub struct ListAgentsOutput {
pub agents: Vec<AgentSummary>,
pub total: usize,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct RunAgentInput {
pub agent_name: String,
pub message: String,
#[serde(default)]
pub context_id: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct RunAgentOutput {
pub response: String,
pub agent: String,
pub context_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub sources: Option<Vec<SourceRef>>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SourceRef {
pub title: String,
pub url: Option<String>,
pub snippet: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct GetStatusInput {
pub context_id: String,
}
#[derive(Debug, Serialize)]
pub struct GetStatusOutput {
pub context_id: String,
pub status: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub partial_response: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DeployAgentInput {
pub toon_config: String,
#[serde(default)]
pub name_override: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct DeployAgentOutput {
pub agent_name: String,
pub action: String,
pub active: bool,
pub deployed_at: String,
}
#[derive(Debug, Deserialize, Serialize, Default)]
pub struct GetUsageInput {
#[serde(default)]
pub from_date: Option<String>,
#[serde(default)]
pub to_date: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct GetUsageOutput {
pub tenant_id: String,
pub tier: String,
pub period: UsagePeriod,
pub current_usage: UsageStats,
pub quota: UsageQuota,
}
#[derive(Debug, Serialize)]
pub struct UsagePeriod {
pub from: String,
pub to: String,
}
#[derive(Debug, Serialize)]
pub struct UsageStats {
pub total_requests: u64,
pub chat_requests: u64,
pub mcp_requests: u64,
pub tokens_used: u64,
pub agents_deployed: u32,
}
#[derive(Debug, Serialize)]
pub struct UsageQuota {
pub max_requests_per_month: u64,
pub max_agents: u32,
pub max_tokens_per_month: u64,
pub utilization: f64,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct ErukaReadInput {
#[serde(default)]
pub workspace_id: Option<String>,
pub category: String,
pub field: String,
}
#[derive(Debug, Serialize)]
pub struct ErukaReadOutput {
pub field: String,
pub value: serde_json::Value,
pub state: String,
pub confidence: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct ErukaWriteInput {
#[serde(default)]
pub workspace_id: Option<String>,
pub category: String,
pub field: String,
pub value: serde_json::Value,
pub confidence: f64,
pub source: String,
}
#[derive(Debug, Serialize)]
pub struct ErukaWriteOutput {
pub field: String,
pub state: String,
pub written_at: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct ErukaSearchInput {
#[serde(default)]
pub workspace_id: Option<String>,
pub query: String,
#[serde(default = "default_search_limit")]
pub limit: u32,
}
fn default_search_limit() -> u32 {
5
}
#[derive(Debug, Serialize)]
pub struct ErukaSearchResult {
pub category: String,
pub field: String,
pub value: serde_json::Value,
pub state: String,
pub relevance: f64,
}
#[derive(Debug, Serialize)]
pub struct ErukaSearchOutput {
pub results: Vec<ErukaSearchResult>,
pub total_results: usize,
}