use aither_core::llm::CallIdentity;
use crate::SandboxMode;
#[derive(Debug, Clone, Default)]
#[non_exhaustive]
pub struct LaunchInfo {
pub task_id: Option<String>,
pub call: Option<CallIdentity>,
pub mode: SandboxMode,
}
impl LaunchInfo {
#[must_use]
pub fn new(task_id: impl Into<String>, call: Option<CallIdentity>, mode: SandboxMode) -> Self {
Self {
task_id: Some(task_id.into()),
call,
mode,
}
}
}
pub trait EnvSource: std::fmt::Debug + Send + Sync {
fn env(&self, launch: &LaunchInfo) -> Vec<(String, String)>;
}
impl EnvSource for Vec<(String, String)> {
fn env(&self, _launch: &LaunchInfo) -> Vec<(String, String)> {
self.clone()
}
}
impl<T: EnvSource + ?Sized> EnvSource for std::sync::Arc<T> {
fn env(&self, launch: &LaunchInfo) -> Vec<(String, String)> {
(**self).env(launch)
}
}