#[cfg(feature = "http-api")]
use async_trait::async_trait;
#[cfg(feature = "http-api")]
use crate::types::{AgentId, RuntimeError};
#[cfg(feature = "http-api")]
use super::types::{
AgentStatusResponse, CreateAgentRequest, CreateAgentResponse, CreateScheduleRequest,
CreateScheduleResponse, DeleteAgentResponse, DeleteScheduleResponse, ExecuteAgentRequest,
ExecuteAgentResponse, GetAgentHistoryResponse, NextRunsResponse, ScheduleActionResponse,
ScheduleDetail, ScheduleHistoryResponse, ScheduleSummary, SchedulerHealthResponse,
UpdateAgentRequest, UpdateAgentResponse, UpdateScheduleRequest, WorkflowExecutionRequest,
};
#[cfg(feature = "http-api")]
#[async_trait]
pub trait RuntimeApiProvider: Send + Sync {
async fn execute_workflow(
&self,
request: WorkflowExecutionRequest,
) -> Result<serde_json::Value, RuntimeError>;
async fn get_agent_status(
&self,
agent_id: AgentId,
) -> Result<AgentStatusResponse, RuntimeError>;
async fn get_system_health(&self) -> Result<serde_json::Value, RuntimeError>;
async fn list_agents(&self) -> Result<Vec<AgentId>, RuntimeError>;
async fn shutdown_agent(&self, agent_id: AgentId) -> Result<(), RuntimeError>;
async fn get_metrics(&self) -> Result<serde_json::Value, RuntimeError>;
async fn create_agent(
&self,
request: CreateAgentRequest,
) -> Result<CreateAgentResponse, RuntimeError>;
async fn update_agent(
&self,
agent_id: AgentId,
request: UpdateAgentRequest,
) -> Result<UpdateAgentResponse, RuntimeError>;
async fn delete_agent(&self, agent_id: AgentId) -> Result<DeleteAgentResponse, RuntimeError>;
async fn execute_agent(
&self,
agent_id: AgentId,
request: ExecuteAgentRequest,
) -> Result<ExecuteAgentResponse, RuntimeError>;
async fn get_agent_history(
&self,
agent_id: AgentId,
) -> Result<GetAgentHistoryResponse, RuntimeError>;
async fn list_schedules(&self) -> Result<Vec<ScheduleSummary>, RuntimeError>;
async fn create_schedule(
&self,
request: CreateScheduleRequest,
) -> Result<CreateScheduleResponse, RuntimeError>;
async fn get_schedule(&self, job_id: &str) -> Result<ScheduleDetail, RuntimeError>;
async fn update_schedule(
&self,
job_id: &str,
request: UpdateScheduleRequest,
) -> Result<ScheduleDetail, RuntimeError>;
async fn delete_schedule(&self, job_id: &str) -> Result<DeleteScheduleResponse, RuntimeError>;
async fn pause_schedule(&self, job_id: &str) -> Result<ScheduleActionResponse, RuntimeError>;
async fn resume_schedule(&self, job_id: &str) -> Result<ScheduleActionResponse, RuntimeError>;
async fn trigger_schedule(&self, job_id: &str) -> Result<ScheduleActionResponse, RuntimeError>;
async fn get_schedule_history(
&self,
job_id: &str,
limit: usize,
) -> Result<ScheduleHistoryResponse, RuntimeError>;
async fn get_schedule_next_runs(
&self,
job_id: &str,
count: usize,
) -> Result<NextRunsResponse, RuntimeError>;
async fn get_scheduler_health(&self) -> Result<SchedulerHealthResponse, RuntimeError>;
}