git.delta.rocks / remowt / refs/commits / 42e2f16609cb

difftreelog

feat basic plugin loading

mwqtzvovYaroslav Bolyukin2026-06-07parent: #69f690d.patch.diff
in: trunk

11 files changed

modifiedCargo.lockdiffbeforeafterboth
1079 "miniz_oxide 0.8.9",1079 "miniz_oxide 0.8.9",
1080]1080]
1081
1082[[package]]
1083name = "fleet-nix-daemon"
1084version = "0.1.0"
1085dependencies = [
1086 "anyhow",
1087 "bifrostlink",
1088 "bifrostlink-macros",
1089 "camino",
1090 "remowt-client",
1091 "serde",
1092 "thiserror 2.0.18",
1093 "tokio",
1094 "tracing",
1095 "uuid",
1096]
10971081
1098[[package]]1082[[package]]
1099name = "foldhash"1083name = "foldhash"
2270 "polkit-shared",2254 "polkit-shared",
2271 "rand 0.8.5",2255 "rand 0.8.5",
2272 "remowt-link-shared",2256 "remowt-link-shared",
2257 "remowt-plugin",
2273 "remowt-pty",2258 "remowt-pty",
2274 "serde",2259 "serde",
2275 "tempfile",2260 "tempfile",
2332 "ui-prompt",2317 "ui-prompt",
2333]2318]
2319
2320[[package]]
2321name = "remowt-nix-daemon"
2322version = "0.1.0"
2323dependencies = [
2324 "anyhow",
2325 "bifrostlink",
2326 "bifrostlink-macros",
2327 "camino",
2328 "remowt-client",
2329 "serde",
2330 "thiserror 2.0.18",
2331 "tokio",
2332 "tracing",
2333 "uuid",
2334]
2335
2336[[package]]
2337name = "remowt-plugin"
2338version = "0.1.0"
2339dependencies = [
2340 "anyhow",
2341 "bifrostlink",
2342 "bifrostlink-ports",
2343 "bytes",
2344 "remowt-link-shared",
2345 "tokio",
2346 "tracing",
2347 "tracing-subscriber",
2348]
23342349
2335[[package]]2350[[package]]
2336name = "remowt-pty"2351name = "remowt-pty"
modifiedCargo.tomldiffbeforeafterboth
10remowt-client = { path = "crates/remowt-client" }10remowt-client = { path = "crates/remowt-client" }
11polkit-shared = { version = "0.1.0", path = "crates/polkit-shared" }11polkit-shared = { version = "0.1.0", path = "crates/polkit-shared" }
12remowt-link-shared = { version = "0.1.0", path = "crates/remowt-link-shared" }12remowt-link-shared = { version = "0.1.0", path = "crates/remowt-link-shared" }
13remowt-plugin = { version = "0.1.0", path = "crates/remowt-plugin" }
13ui-prompt = { version = "0.1.0", path = "crates/ui-prompt" }14ui-prompt = { version = "0.1.0", path = "crates/ui-prompt" }
1415
15bifrostlink = "0.2.0"16bifrostlink = "0.2.0"
modifiedcmds/remowt-agent/Cargo.tomldiffbeforeafterboth
14polkit-shared.workspace = true14polkit-shared.workspace = true
15rand.workspace = true15rand.workspace = true
16remowt-link-shared.workspace = true16remowt-link-shared.workspace = true
17remowt-plugin.workspace = true
17remowt-pty.workspace = true18remowt-pty.workspace = true
18serde = { workspace = true, features = ["derive"] }19serde = { workspace = true, features = ["derive"] }
19tempfile.workspace = true20tempfile.workspace = true
modifiedcmds/remowt-agent/src/main.rsdiffbeforeafterboth
253 Systemd.register_endpoints(&mut rpc);253 Systemd.register_endpoints(&mut rpc);
254 Pty::new().register_endpoints(&mut rpc);254 Pty::new().register_endpoints(&mut rpc);
255
256 remowt_plugin::host::serve(&mut rpc);
255257
256 let user_prompter = PromptEndpointsClient::wrap(rpc.remote(Address::User));258 let user_prompter = PromptEndpointsClient::wrap(rpc.remote(Address::User));
257 let editor_client = EditorEndpointsClient::wrap(rpc.remote(Address::User));259 let editor_client = EditorEndpointsClient::wrap(rpc.remote(Address::User));
modifiedcrates/remowt-client/src/lib.rsdiffbeforeafterboth
9use bifrostlink_ports::unix_socket::from_socket;9use bifrostlink_ports::unix_socket::from_socket;
10use bytes::{Bytes, BytesMut};10use bytes::{Bytes, BytesMut};
11use camino::{Utf8Path, Utf8PathBuf};11use camino::{Utf8Path, Utf8PathBuf};
12use remowt_link_shared::plugin::PluginEndpointsClient;
12use remowt_link_shared::{13use remowt_link_shared::{
13 Address, BifConfig, ElevateEndpoints, ElevateError, Elevator, Fs, Pty, PtyClient, ShellId,14 Address, BifConfig, ElevateEndpoints, ElevateError, Elevator, Fs, Pty, PtyClient, ShellId,
14 Systemd,15 Systemd,
509 R::wrap(self.rpc.remote(Address::Agent))510 R::wrap(self.rpc.remote(Address::Agent))
510 }511 }
512
513 pub async fn load_plugin(&self, id: u16, name: &str) -> Result<()> {
514 let client: PluginEndpointsClient<BifConfig> = self.endpoints();
515 client
516 .load_plugin(id, name.to_owned())
517 .await?
518 .map_err(|e| anyhow!("agent failed to load plugin: {e}"))
519 }
520 pub async fn run0_load_plugin_path(&self, id: u16, path: &str) -> Result<()> {
521 self.ensure_elevated().await?;
522 let client: PluginEndpointsClient<BifConfig> =
523 PluginEndpointsClient::wrap(self.rpc.remote(Address::AgentPrivileged));
524 client
525 .load_plugin_path(id, path.to_owned())
526 .await?
527 .map_err(|e| anyhow!("privileged agent failed to load plugin: {e}"))
528 }
529 pub fn plugin_endpoints<R: RemoteEndpoints<BifConfig>>(&self, id: u16) -> R {
530 R::wrap(self.rpc.remote(Address::Plugin(id)))
531 }
511 pub async fn run0_endpoints<R: RemoteEndpoints<BifConfig>>(&self) -> Result<R> {532 pub async fn run0_endpoints<R: RemoteEndpoints<BifConfig>>(&self) -> Result<R> {
512 self.ensure_elevated().await?;533 self.ensure_elevated().await?;
513 Ok(R::wrap(self.rpc.remote(Address::AgentPrivileged)))534 Ok(R::wrap(self.rpc.remote(Address::AgentPrivileged)))
modifiedcrates/remowt-link-shared/src/lib.rsdiffbeforeafterboth
13 User,13 User,
14 Agent,14 Agent,
15 AgentPrivileged,15 AgentPrivileged,
16 Plugin(u16),
16}17}
17impl AddressT for Address {}18impl AddressT for Address {}
19
20pub mod plugin;
1821
19pub use remowt_fs::{Error as FsError, Fs, FsClient};22pub use remowt_fs::{Error as FsError, Fs, FsClient};
20pub use remowt_pty::{Error as PtyError, Pty, PtyClient, ShellId};23pub use remowt_pty::{Error as PtyError, Pty, PtyClient, ShellId};
addedcrates/remowt-link-shared/src/plugin.rsdiffbeforeafterboth

no changes

modifiedcrates/remowt-nix-daemon/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "fleet-nix-daemon"2name = "remowt-nix-daemon"
3description = "Nix daemon proxy endpoint + connection logic for fleet"3description = "Nix daemon proxy"
4version.workspace = true4version.workspace = true
5edition = "2021"5edition = "2021"
66
addedcrates/remowt-plugin/Cargo.tomldiffbeforeafterboth

no changes

addedcrates/remowt-plugin/src/host.rsdiffbeforeafterboth

no changes

addedcrates/remowt-plugin/src/lib.rsdiffbeforeafterboth

no changes