atomr_agents_coding_cli_isolator/traits.rs
1use async_trait::async_trait;
2
3use atomr_agents_coding_cli_core::CliCommand;
4
5use crate::error::IsolatorError;
6use crate::handle::{IsolationOpts, ProcessHandle};
7
8/// Spawns a [`CliCommand`] in some execution environment and returns
9/// a uniform [`ProcessHandle`].
10#[async_trait]
11pub trait Isolator: Send + Sync {
12 /// Stable identifier used in `/api/cli/vendors` and logs.
13 fn name(&self) -> &str;
14
15 async fn spawn(
16 &self,
17 cmd: CliCommand,
18 opts: IsolationOpts,
19 ) -> Result<Box<dyn ProcessHandle>, IsolatorError>;
20}