cli: rename pod command crate to insomnia
This commit is contained in:
parent
3a58ab7bb3
commit
9e886bc73e
12
Cargo.lock
generated
12
Cargo.lock
generated
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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" }
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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<F>(config: SpawnConfig, mut progress: F) -> Result<SpawnR
|
|||
where
|
||||
F: FnMut(&str),
|
||||
{
|
||||
let pod_command = PodRuntimeCommand::resolve().map_err(SpawnError::Io)?;
|
||||
let runtime_command = PodRuntimeCommand::resolve().map_err(SpawnError::Io)?;
|
||||
|
||||
let pod_runtime_dir = manifest::paths::pod_runtime_dir(&config.pod_name)
|
||||
.ok_or(SpawnError::RuntimeDirUnavailable)?;
|
||||
|
|
@ -108,9 +108,9 @@ where
|
|||
let stderr_path = pod_runtime_dir.join("stderr.log");
|
||||
let stderr_file = std::fs::File::create(&stderr_path).map_err(SpawnError::Io)?;
|
||||
|
||||
let mut command = Command::new(pod_command.program());
|
||||
let mut command = Command::new(runtime_command.program());
|
||||
command
|
||||
.args(pod_command.prefix_args())
|
||||
.args(runtime_command.prefix_args())
|
||||
.current_dir(&config.cwd)
|
||||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::null())
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "pod-command"
|
||||
name = "insomnia"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
|
@ -14,7 +14,7 @@ pod-store = { workspace = true }
|
|||
manifest = { workspace = true }
|
||||
protocol = { workspace = true }
|
||||
provider = { workspace = true }
|
||||
pod-command = { workspace = true }
|
||||
insomnia = { workspace = true }
|
||||
pod-registry = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ 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::{Permission, ScopeRule};
|
||||
use pod_command::PodRuntimeCommand;
|
||||
use pod_store::{PodActiveSegmentRef, PodMetadata, PodMetadataStore};
|
||||
use protocol::stream::JsonLineReader;
|
||||
use protocol::{Event, PodStatus};
|
||||
|
|
@ -329,10 +329,11 @@ where
|
|||
pod_name: &str,
|
||||
socket_path: &Path,
|
||||
) -> 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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ fn accept_one_method(listener: UnixListener) -> tokio::task::JoinHandle<Option<M
|
|||
})
|
||||
}
|
||||
|
||||
fn point_pod_command_at_true() {
|
||||
fn point_runtime_command_at_true() {
|
||||
let path = which_true();
|
||||
unsafe {
|
||||
std::env::set_var("INSOMNIA_POD_COMMAND", &path);
|
||||
|
|
@ -224,7 +224,7 @@ async fn spawn_pod_delegates_scope_and_sends_run() {
|
|||
let allow_root = TempDir::new().unwrap();
|
||||
let (_tmp, runtime_base, spawner_socket, spawner_rd) =
|
||||
setup_spawner("root", allow_root.path()).await;
|
||||
point_pod_command_at_true();
|
||||
point_runtime_command_at_true();
|
||||
|
||||
let (_predicted_socket, listener) = bind_mock_pod_socket(&runtime_base, "child").await;
|
||||
let received = accept_one_method(listener);
|
||||
|
|
@ -317,7 +317,7 @@ async fn spawn_pod_rejects_scope_outside_spawner() {
|
|||
let outside = TempDir::new().unwrap();
|
||||
let (_tmp, runtime_base, spawner_socket, spawner_rd) =
|
||||
setup_spawner("root", allow_root.path()).await;
|
||||
point_pod_command_at_true();
|
||||
point_runtime_command_at_true();
|
||||
|
||||
let registry = SpawnedPodRegistry::new(spawner_rd);
|
||||
let spawner_scope = shared_scope_for(allow_root.path());
|
||||
|
|
@ -379,7 +379,7 @@ async fn spawn_pod_rolls_back_reservation_when_socket_never_appears() {
|
|||
let allow_root = TempDir::new().unwrap();
|
||||
let (_tmp, runtime_base, spawner_socket, spawner_rd) =
|
||||
setup_spawner("root", allow_root.path()).await;
|
||||
point_pod_command_at_true();
|
||||
point_runtime_command_at_true();
|
||||
|
||||
// Deliberately do NOT bind a socket at the predicted path. The
|
||||
// tool's wait_for_socket should time out, triggering rollback.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user