use crate::golem_agentic::exports::golem::agent::guest::{
AgentError, AgentType, DataValue, Principal,
};
use crate::golem_agentic::golem::agent::host::parse_agent_id;
#[derive(Debug)]
pub struct SnapshotData {
pub data: Vec<u8>,
pub mime_type: String,
}
#[async_trait::async_trait(?Send)]
pub trait BaseAgent {
fn get_agent_id(&self) -> String;
async fn invoke(
&mut self,
method_name: String,
input: DataValue,
principal: Principal,
) -> Result<DataValue, AgentError>;
fn get_definition(&self) -> AgentType;
fn phantom_id(&self) -> Option<crate::Uuid> {
let (_, _, phantom_id) = parse_agent_id(&self.get_agent_id()).unwrap(); phantom_id.map(|id| id.into())
}
async fn load_snapshot_base(&mut self, bytes: Vec<u8>) -> Result<(), String>;
async fn save_snapshot_base(&self) -> Result<SnapshotData, String>;
}