diff --git a/Cargo.lock b/Cargo.lock index 061eecd5..e84cc4e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,8 +332,8 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" name = "client" version = "0.1.0" dependencies = [ + "insomnia", "manifest", - "pod-command", "protocol", "serde_json", "tokio", @@ -1480,6 +1480,10 @@ dependencies = [ "rustversion", ] +[[package]] +name = "insomnia" +version = "0.1.0" + [[package]] name = "instability" version = "0.3.12" @@ -2334,12 +2338,12 @@ dependencies = [ "fs4", "futures", "include_dir", + "insomnia", "libc", "llm-worker", "manifest", "memory", "minijinja", - "pod-command", "pod-registry", "pod-store", "protocol", @@ -2359,10 +2363,6 @@ dependencies = [ "workflow", ] -[[package]] -name = "pod-command" -version = "0.1.0" - [[package]] name = "pod-registry" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 6f8842cc..ad7d4403 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ "crates/session-store", "crates/manifest", "crates/pod", - "crates/pod-command", + "crates/insomnia", "crates/pod-store", "crates/protocol", "crates/provider", @@ -34,7 +34,7 @@ manifest = { path = "crates/manifest" } lint-common = { path = "crates/lint-common" } memory = { path = "crates/memory" } pod = { path = "crates/pod" } -pod-command = { path = "crates/pod-command" } +insomnia = { path = "crates/insomnia" } pod-registry = { path = "crates/pod-registry" } pod-store = { path = "crates/pod-store" } protocol = { path = "crates/protocol" } diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 50a16c0b..9e304ceb 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true [dependencies] protocol = { workspace = true } manifest = { workspace = true } -pod-command = { workspace = true } +insomnia = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true, features = ["rt", "macros", "net", "io-util", "sync", "time", "process", "fs"] } uuid = { workspace = true } diff --git a/crates/client/src/spawn.rs b/crates/client/src/spawn.rs index dcada57d..23ccb0ec 100644 --- a/crates/client/src/spawn.rs +++ b/crates/client/src/spawn.rs @@ -15,7 +15,7 @@ use std::path::{Path, PathBuf}; use std::process::Stdio; use std::time::Duration; -use pod_command::PodRuntimeCommand; +use insomnia::PodRuntimeCommand; use tokio::process::Command; use uuid::Uuid; @@ -100,7 +100,7 @@ pub async fn spawn_pod(config: SpawnConfig, mut progress: F) -> Result Result<(), PodDiscoveryError> { - let pod_command = PodRuntimeCommand::resolve().map_err(PodDiscoveryError::RestoreSpawn)?; - let mut command = Command::new(pod_command.program()); + let runtime_command = + PodRuntimeCommand::resolve().map_err(PodDiscoveryError::RestoreSpawn)?; + let mut command = Command::new(runtime_command.program()); command - .args(pod_command.prefix_args()) + .args(runtime_command.prefix_args()) .arg("--pod") .arg(pod_name) .arg("--require-pod-state") diff --git a/crates/pod/src/spawn/tool.rs b/crates/pod/src/spawn/tool.rs index f8f822cd..32809ab2 100644 --- a/crates/pod/src/spawn/tool.rs +++ b/crates/pod/src/spawn/tool.rs @@ -12,6 +12,7 @@ use std::sync::Arc; use std::time::Duration; use async_trait::async_trait; +use insomnia::PodRuntimeCommand; use llm_worker::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput}; use manifest::{ CompactionConfigPartial, FileUploadLimitsPartial, Permission, PermissionConfigPartial, @@ -19,7 +20,6 @@ use manifest::{ ProfileRegistrySource, ProfileResolveOptions, ProfileResolver, ProfileSelector, ScopeConfig, ScopeRule, SessionConfigPartial, SharedScope, ToolOutputLimitsPartial, WorkerManifestConfig, }; -use pod_command::PodRuntimeCommand; use serde::Deserialize; use tokio::net::UnixStream; use tokio::process::Command; @@ -409,7 +409,7 @@ impl SpawnPodTool { spawn_config_json: &str, predicted_socket: &Path, ) -> Result<(), ToolError> { - let pod_command = PodRuntimeCommand::resolve().map_err(|error| { + let runtime_command = PodRuntimeCommand::resolve().map_err(|error| { ToolError::ExecutionFailed(format!("failed to resolve Pod runtime command: {error}")) })?; @@ -432,8 +432,8 @@ impl SpawnPodTool { ToolError::ExecutionFailed(format!("open {}: {e}", stderr_path.display())) })?; - let mut cmd = Command::new(pod_command.program()); - cmd.args(pod_command.prefix_args()) + let mut cmd = Command::new(runtime_command.program()); + cmd.args(runtime_command.prefix_args()) .arg("--adopt") .arg("--callback") .arg(&self.callback_socket) @@ -446,7 +446,7 @@ impl SpawnPodTool { .process_group(0); let child = cmd.spawn().map_err(|e| { - ToolError::ExecutionFailed(format!("failed to spawn `{pod_command}`: {e}")) + ToolError::ExecutionFailed(format!("failed to spawn `{runtime_command}`: {e}")) })?; // Default `kill_on_drop = false` keeps the process alive after diff --git a/crates/pod/tests/spawn_pod_test.rs b/crates/pod/tests/spawn_pod_test.rs index 358c4351..a280af76 100644 --- a/crates/pod/tests/spawn_pod_test.rs +++ b/crates/pod/tests/spawn_pod_test.rs @@ -141,7 +141,7 @@ fn accept_one_method(listener: UnixListener) -> tokio::task::JoinHandle