pub mod approval;
use crate::BoxFuture;
use crate::vfs::error::VfsError;
use crate::vfs::types::ExecuteResponse;
use serde::{Deserialize, Serialize};
pub use approval::{
ApprovalCallback, ApprovalDecision, ApprovalRequest, AutoApproveCallback, AutoDenyCallback,
RiskLevel,
};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PipelineStage {
pub command: String,
pub args: Vec<String>,
pub stderr_to_stdout: bool,
pub timeout_secs: Option<u64>,
}
pub trait SandboxProtocol: Send + Sync {
fn execute(
&self,
cmd: &str,
args: &[String],
) -> BoxFuture<'_, Result<ExecuteResponse, VfsError>>;
fn execute_pipeline(
&self,
stages: &[PipelineStage],
) -> BoxFuture<'_, Result<Vec<ExecuteResponse>, VfsError>>;
fn id(&self) -> &str;
}
pub type BaseSandbox = dyn SandboxProtocol + Send + Sync;