incurs_codemode/
service.rs1use async_trait::async_trait;
2use serde_json::Value;
3
4use crate::{CodeModeRunOptions, ExecutionState, SearchOutput};
5
6#[async_trait]
8pub trait CodeModeService: Send + Sync {
9 async fn search(&self, query: String) -> Result<SearchOutput, String>;
11
12 async fn execute(
14 &self,
15 code: String,
16 options: CodeModeRunOptions,
17 ) -> Result<ExecutionState, String>;
18
19 async fn execution(&self, execution_id: String) -> Result<ExecutionState, String>;
24
25 async fn artifact(&self, execution_id: String, artifact_id: String) -> Result<Value, String>;
27
28 async fn approve(
30 &self,
31 execution_id: String,
32 seq: u64,
33 options: CodeModeRunOptions,
34 ) -> Result<ExecutionState, String>;
35
36 async fn reject(&self, execution_id: String, seq: u64) -> Result<ExecutionState, String>;
38
39 async fn cancel(&self, execution_id: String) -> Result<ExecutionState, String>;
41}