Preserve codex-exec-server library APIs

This commit is contained in:
Charlie Marsh
2026-06-04 11:30:28 -04:00
parent 2965045c68
commit 686fbece24
2 changed files with 14 additions and 0 deletions

View File

@@ -230,6 +230,12 @@ impl EnvironmentManager {
self.local_environment.as_ref().map(Arc::clone)
}
/// Returns the default environment or local environment when either exists.
pub fn default_or_local_environment(&self) -> Option<Arc<Environment>> {
self.default_environment()
.or_else(|| self.try_local_environment())
}
/// Returns a named environment instance.
pub fn get_environment(&self, environment_id: &str) -> Option<Arc<Environment>> {
self.environments

View File

@@ -10,9 +10,17 @@ use serde::Serialize;
pub struct ProcessId(String);
impl ProcessId {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
pub fn into_inner(self) -> String {
self.0
}
}
impl Deref for ProcessId {