diff --git a/Cargo.lock b/Cargo.lock index 44fac74..68f3d79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,7 +84,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -105,6 +105,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + [[package]] name = "biip" version = "0.9.3" @@ -132,7 +138,7 @@ dependencies = [ "mesh-llm-plugin", "regex-lite", "reqwest", - "rmcp", + "rmcp 1.7.0", "schemars", "serde", "serde_json", @@ -211,7 +217,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -258,8 +264,18 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.23.0", + "darling_macro 0.23.0", +] + +[[package]] +name = "darling" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" +dependencies = [ + "darling_core 0.24.1", + "darling_macro 0.24.1", ] [[package]] @@ -272,7 +288,20 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.117", +] + +[[package]] +name = "darling_core" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 3.0.6", ] [[package]] @@ -281,9 +310,20 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ - "darling_core", + "darling_core 0.23.0", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "darling_macro" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" +dependencies = [ + "darling_core 0.24.1", "quote", - "syn", + "syn 3.0.6", ] [[package]] @@ -315,7 +355,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -471,7 +511,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -664,7 +704,7 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-channel", "futures-util", @@ -929,15 +969,15 @@ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "mesh-llm-plugin" -version = "0.66.0" -source = "git+https://github.com/Mesh-LLM/mesh-llm.git?branch=codex%2Fplugin-cli-commands#c0dc2fef75bf1b2919843f196d97797b561d0c59" +version = "0.77.0" +source = "git+https://github.com/Mesh-LLM/mesh-llm.git?rev=4ae1ace57dbbe28d0c3d10a05ee542328e8e64e7#4ae1ace57dbbe28d0c3d10a05ee542328e8e64e7" dependencies = [ "anyhow", "async-trait", "prost", "prost-build", "protoc-bin-vendored", - "rmcp", + "rmcp 3.5.0", "schemars", "serde", "serde_json", @@ -1027,7 +1067,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1128,7 +1168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.117", ] [[package]] @@ -1165,7 +1205,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 2.0.117", "tempfile", ] @@ -1179,7 +1219,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1307,7 +1347,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1351,7 +1391,7 @@ version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", @@ -1406,12 +1446,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0810a9f717d9828f475fe1f629f4c305c8464b7f496c3a854b58d29e65f4058e" dependencies = [ "async-trait", - "base64", + "base64 0.22.1", "chrono", "futures", "pastey", "pin-project-lite", - "rmcp-macros", + "rmcp-macros 1.7.0", "schemars", "serde", "serde_json", @@ -1421,17 +1461,53 @@ dependencies = [ "tracing", ] +[[package]] +name = "rmcp" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fae7019994ae0fe4ada40b732f798f3ff26f0f04facb1477f1bf37eb4f18a2d3" +dependencies = [ + "base64 0.23.1", + "chrono", + "futures", + "indexmap", + "pastey", + "pin-project-lite", + "rmcp-macros 3.5.0", + "schemars", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-util", + "tracing", + "uuid", +] + [[package]] name = "rmcp-macros" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aefac48c364756e97f04c0401ba3231e8607882c7c1d92da0437dc16307904d" dependencies = [ - "darling", + "darling 0.23.0", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.117", +] + +[[package]] +name = "rmcp-macros" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e66877136e969d5a2d561ee5841b17717a0619aebd64abb47a2a2f46e34683" +dependencies = [ + "darling 0.24.1", "proc-macro2", "quote", "serde_json", - "syn", + "syn 3.0.6", ] [[package]] @@ -1524,7 +1600,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.117", ] [[package]] @@ -1589,7 +1665,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1600,7 +1676,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1695,6 +1771,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "sync_wrapper" version = "1.0.2" @@ -1712,7 +1799,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1766,7 +1853,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1804,7 +1891,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1904,7 +1991,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1964,6 +2051,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -2045,7 +2143,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.117", "wasm-bindgen-shared", ] @@ -2123,7 +2221,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -2134,7 +2232,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -2290,7 +2388,7 @@ dependencies = [ "heck", "indexmap", "prettyplease", - "syn", + "syn 2.0.117", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -2306,7 +2404,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn", + "syn 2.0.117", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -2373,7 +2471,7 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", "synstructure", ] @@ -2394,7 +2492,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", "synstructure", ] @@ -2434,7 +2532,7 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3239232..d343acf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ anyhow = "1" biip = "0.9.2" clap = { version = "4", features = ["derive"] } dirs = "6.0.0" -mesh-llm-plugin = { git = "https://github.com/Mesh-LLM/mesh-llm.git", branch = "codex/plugin-cli-commands" } +mesh-llm-plugin = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "4ae1ace57dbbe28d0c3d10a05ee542328e8e64e7" } regex-lite = "0.1" reqwest = { version = "0.12", features = ["json"] } rmcp = { version = "1.2", features = ["server", "transport-io"] } diff --git a/README.md b/README.md index f78054f..be311f8 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ for that agent before starting the session. cargo build ``` -The plugin currently depends on the `mesh-llm-plugin` crate from the -`codex/plugin-cli-commands` branch until that plugin CLI support lands on -`main`. +The plugin SDK is pinned to Mesh v0.77.0 (plugin protocol 3). +This build requires a protocol-3 host; older protocol-2 hosts must keep their +previous plugin release or upgrade Mesh together with the plugin. ## Configure diff --git a/tests/protocol.rs b/tests/protocol.rs new file mode 100644 index 0000000..5cea9d8 --- /dev/null +++ b/tests/protocol.rs @@ -0,0 +1,83 @@ +#![cfg(unix)] +use mesh_llm_plugin::{LocalStream, proto, read_envelope, write_envelope}; +use std::time::Duration; +use tokio::{net::UnixListener, process::Command}; + +#[tokio::test] +async fn protocol_three_initialization_health_and_disconnect() { + let sockets = tempfile::tempdir_in("/tmp").unwrap(); + let socket = sockets.path().join("ipc"); + let listener = UnixListener::bind(&socket).unwrap(); + let mut command = Command::new(env!("CARGO_BIN_EXE_blackboard")); + let mut child = command + .env("MESH_LLM_PLUGIN_ENDPOINT", &socket) + .env("MESH_LLM_PLUGIN_TRANSPORT", "unix") + .kill_on_drop(true) + .spawn() + .unwrap(); + let (stream, _) = tokio::time::timeout(Duration::from_secs(5), listener.accept()) + .await + .unwrap() + .unwrap(); + let mut stream = LocalStream::Unix(stream); + // Deliberately literal: a future SDK bump must not silently change this contract. + write_envelope( + &mut stream, + &proto::Envelope { + protocol_version: 3, + plugin_id: "blackboard".into(), + request_id: 1, + payload: Some(proto::envelope::Payload::InitializeRequest( + proto::InitializeRequest { + host_protocol_version: 3, + host_version: "0.77.0".into(), + host_info_json: "{}".into(), + mesh_visibility: proto::MeshVisibility::Private as i32, + }, + )), + }, + ) + .await + .unwrap(); + let reply = tokio::time::timeout(Duration::from_secs(5), read_envelope(&mut stream)) + .await + .unwrap() + .unwrap(); + let Some(proto::envelope::Payload::InitializeResponse(initialized)) = reply.payload else { + panic!("expected initialization response"); + }; + assert_eq!(initialized.plugin_protocol_version, 3); + assert_eq!(initialized.plugin_id, "blackboard"); + assert!(initialized.manifest.is_some()); + write_envelope( + &mut stream, + &proto::Envelope { + protocol_version: 3, + plugin_id: "blackboard".into(), + request_id: 2, + payload: Some(proto::envelope::Payload::HealthRequest( + proto::HealthRequest {}, + )), + }, + ) + .await + .unwrap(); + // Plugins may emit notifications before replying to health. + tokio::time::timeout(Duration::from_secs(5), async { + loop { + let reply = read_envelope(&mut stream).await.unwrap(); + if let Some(proto::envelope::Payload::HealthResponse(health)) = reply.payload { + assert_eq!(reply.request_id, 2); + assert_eq!(health.status, proto::health_response::Status::Ok as i32); + break; + } + } + }) + .await + .unwrap(); + drop(stream); + tokio::time::timeout(Duration::from_secs(5), child.wait()) + .await + .unwrap() + .unwrap(); +}