diff --git a/Cargo.lock b/Cargo.lock index b8d5b70..24ac8e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1079,6 +1079,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", + "webpki-roots", ] [[package]] @@ -1791,9 +1792,9 @@ dependencies = [ [[package]] name = "rhema-agent-tools" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839fa542e680de80f25876d6f54ea45dbace72a89d5f63f52c4423e54f048f82" +checksum = "dec3e06eef5c867bb8bc1f2170b5f6f46a6248f52428a25d2bf50f7573adb389" dependencies = [ "async-trait", "base64 0.22.1", @@ -1808,9 +1809,9 @@ dependencies = [ [[package]] name = "rhema-autonomous-agent" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e3ee50c812fa93f31be669557cb642ed8d03154613234b2090fa9567374516e" +checksum = "5234ec887bccf0175975fed5ae18ae53d2801146c8e229756eac09192ae9d7b8" dependencies = [ "async-trait", "rhema-core", @@ -1824,7 +1825,7 @@ dependencies = [ [[package]] name = "rhema-calendar-integration" -version = "0.2.3" +version = "0.3.0" dependencies = [ "async-trait", "quick-xml", @@ -1843,7 +1844,7 @@ dependencies = [ [[package]] name = "rhema-claw" -version = "0.2.3" +version = "0.3.0" dependencies = [ "axum", "base64 0.22.1", @@ -1879,7 +1880,7 @@ dependencies = [ [[package]] name = "rhema-claw-tools-contract" -version = "0.2.3" +version = "0.3.0" dependencies = [ "serde", "serde_json", @@ -1888,9 +1889,9 @@ dependencies = [ [[package]] name = "rhema-coding-agent" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5ef3b970ced4f05b4d18b9df56ca6a46bb488af7579f8d3c4a10788ca47761" +checksum = "a5fa7ca082f52429c159addd7cdd036ddc7aa69161ed82004bb480a2e3ae46d1" dependencies = [ "minijinja", "rhema-agent-tools", @@ -1905,22 +1906,23 @@ dependencies = [ [[package]] name = "rhema-config" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd98e6c5dd53a6e30367ae4c259ea03e5d214962aae9c1d66ab03f464487988" +checksum = "8c96cd6da28edeb36b8251a7a8129117ec0afa3f5851a0a6d904c10d67fbaa84" dependencies = [ "keyring", "rhema-core", "serde", + "serde_json", "serde_yaml", "thiserror", ] [[package]] name = "rhema-core" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b399005d398dd0dca791415a07f6280bacebc0aedfa84f9d3a29640f45f91144" +checksum = "8ac339e3dcd9c379d44c5580ac74075e338e6fce7e79c6e4fefe11fc26a3e10f" dependencies = [ "async-trait", "serde", @@ -1930,7 +1932,7 @@ dependencies = [ [[package]] name = "rhema-forge-integration" -version = "0.2.3" +version = "0.3.0" dependencies = [ "async-trait", "reqwest", @@ -1944,9 +1946,9 @@ dependencies = [ [[package]] name = "rhema-identity" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9355d075f5ff5800f9b6b4216e65ba087f681716bc0faf69986852eb13be26" +checksum = "6b9ced20fc75671b29e49890c6e7f0b5db88f6ad4b43629ee089face88bce633" dependencies = [ "rusqlite", "serde", @@ -1955,9 +1957,9 @@ dependencies = [ [[package]] name = "rhema-mcp" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb7dff3b33b3931c9da4ea6577e55f41c820cf5b2b880b06b8581f15673e06e" +checksum = "0c96a292b7da4db6334e0dda5d25d25c2dc0e1058cc0e07df49ca3f28944beff" dependencies = [ "async-stream", "axum", @@ -1967,6 +1969,7 @@ dependencies = [ "futures-util", "http-body-util", "hyper", + "hyper-rustls", "hyper-util", "mcp-to-cli", "rhema-agent-tools", @@ -1980,9 +1983,9 @@ dependencies = [ [[package]] name = "rhema-memory" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a0f161c473ae19dc161a1ad898603150ec6be081f24262182e15ea348db3b5" +checksum = "8fcc03d8df84af15c992fd4f317fce11735a824853e40c2d674dff394a952d78" dependencies = [ "async-trait", "rhema-core", @@ -1994,9 +1997,9 @@ dependencies = [ [[package]] name = "rhema-provider" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d178053a9d5400cf001109670f2294e427ded6cb895b235b4f4ffc2bc20f2f09" +checksum = "c9500c59a8661c16e80ece7525180fe44d553eab2a3e57751194d7a8f138ea6b" dependencies = [ "async-trait", "futures-core", @@ -2009,9 +2012,9 @@ dependencies = [ [[package]] name = "rhema-provider-anthropic" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc26ff01350bab0fb10a53fc11665dca939c3fda2ec1a3df93912a39b3fc8b0c" +checksum = "76136cc125a6a03f0db760879c3a417ea56298c1130d20d106f2716cbfe7d031" dependencies = [ "async-trait", "futures-util", @@ -2025,9 +2028,9 @@ dependencies = [ [[package]] name = "rhema-provider-chatgpt" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb807b39e95c49d2a5e8c101220ac34a9d6770aece6bece1eebcf8113b1811a2" +checksum = "38088d5cfa5bb85e6641bd8986757237fab33c8d3ebd86cbc53ef5d88e1af5d4" dependencies = [ "async-trait", "base64 0.22.1", @@ -2044,9 +2047,9 @@ dependencies = [ [[package]] name = "rhema-provider-copilot" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc6f041cb328de999c17abc34d3e050d586a2390d32ec9ae5fa543bd177fa0" +checksum = "43ed3942ab1a1ea1a00d082ab85e86ee5607e4718b0ad219a4e9ba9090a302da" dependencies = [ "async-trait", "futures-util", @@ -2062,9 +2065,9 @@ dependencies = [ [[package]] name = "rhema-provider-google" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cbbb477a94d995b09a3154288a0f5f10aee22fd35bc1d1145bbffee27ea388" +checksum = "bad86c3e875e59f166c08e144d9cecd0edd0d445a26472e65dbe0d1bdb6efc44" dependencies = [ "async-trait", "futures-util", @@ -2078,9 +2081,9 @@ dependencies = [ [[package]] name = "rhema-provider-llama-cpp" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3491fcb305e448492868473c6a146575174bdbb7ab328c85bf43a698052f56" +checksum = "6d9dd148f53af3a2dbd811da63cd8519130bbc4191af0b44fb23818ca0d82b6f" dependencies = [ "async-trait", "futures-util", @@ -2095,9 +2098,9 @@ dependencies = [ [[package]] name = "rhema-provider-openai-compatible" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98976f2fd5f8f09e5838405f53e2b9f113a5e9d2ed3823a80117f4919f0249a6" +checksum = "7347b2f056473170a4bf5d7d43fa06892a3b2139eb727a580474ce9bd78f436c" dependencies = [ "async-trait", "futures-util", @@ -2111,9 +2114,9 @@ dependencies = [ [[package]] name = "rhema-provider-opencode" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f6cc7db60525e63712ec2b66881cd57f3bb7b7b8c14001eebf86f64030302a" +checksum = "29823bcfc72d76d5e75bd5c2831a2e7ee07bcbd20598fab2694802652b85a706" dependencies = [ "async-trait", "reqwest", @@ -2126,9 +2129,9 @@ dependencies = [ [[package]] name = "rhema-provider-openrouter" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca68e90f9627c58e0908e52e010bd7c47e498290c40358c2ff326e95a9a20cc" +checksum = "488f07952b81a5b20b7acad0d80c2ec28b0fb51f78cc4e878bc183a48f71c32c" dependencies = [ "async-trait", "futures-util", @@ -2142,9 +2145,9 @@ dependencies = [ [[package]] name = "rhema-provider-registry" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f6b0b10943f6fa4272490acc3c33040944d85490971a8a1acc8515d704bfc2" +checksum = "3c3d7af90727ea9319a7553726653d0f3908ac9786d25c7ab75b832e4f93bf52" dependencies = [ "rhema-core", "rhema-provider", @@ -2161,9 +2164,9 @@ dependencies = [ [[package]] name = "rhema-rsd" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e05417b86144a2a0dbad3018a73c0b2376b5fec378676aea6b912678b059f6" +checksum = "a163669ba8f439389e0cb4b73c72b26d0b3ccd08b414283f577af9a0b69890ba" dependencies = [ "rhema-core", "rusqlite", @@ -2174,9 +2177,9 @@ dependencies = [ [[package]] name = "rhema-transcript" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00234b8879bd894f0a45a1fd804c94c7cc3d31ea9f5361609041cb42587a719" +checksum = "ee0104c104a9a476d7b246e36c5d7f795568afbae5dbb74f5787580ef2af61d7" dependencies = [ "async-trait", "rhema-core", @@ -2244,6 +2247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -3032,6 +3036,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7265c9301c16a8711c992c2d8da90ee77ef54b1ed51482d6dfeb00dc756b1297" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-link" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index 44cee9d..1f64043 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["crates/*", "integrations/*"] [workspace.package] -version = "0.2.3" +version = "0.3.0" edition = "2024" rust-version = "1.89" license = "MIT" diff --git a/crates/rhema-claw/Cargo.toml b/crates/rhema-claw/Cargo.toml index cc18c21..bcb8b37 100644 --- a/crates/rhema-claw/Cargo.toml +++ b/crates/rhema-claw/Cargo.toml @@ -27,28 +27,28 @@ mock = ["rhema-core/mock"] [dependencies] # The shared toolkit: the resident agent assembles its agent from the # shell, the approval seam, paste expansion, and revive-on-resume -rhema-agent-tools = "0.2.3" -rhema-autonomous-agent = "0.2.3" -rhema-coding-agent = "0.2.3" -rhema-config = "0.2.3" -rhema-core = "0.2.3" +rhema-agent-tools = "0.3.0" +rhema-autonomous-agent = "0.3.0" +rhema-coding-agent = "0.3.0" +rhema-config = "0.3.0" +rhema-core = "0.3.0" # The bounded request view over the claw sessions, on by default here -rhema-transcript = "0.2.3" +rhema-transcript = "0.3.0" rhema-calendar-integration = { path = "../../integrations/rhema-calendar-integration" } rhema-forge-integration = { path = "../../integrations/rhema-forge-integration" } # The accounts layer: identities hold the forge tokens the watches poll # with, and the identity tools manage them over chat -rhema-identity = "0.2.3" -rhema-rsd = "0.2.3" +rhema-identity = "0.3.0" +rhema-rsd = "0.3.0" # The tool contract: the agent-token allowlist and version the auth # middleware enforces (rhema-tools spec). The arrow runs claw -> # contract only — never the reverse. rhema-claw-tools-contract = { path = "../../tools/contract" } # The resident tier's durable memory: its tools join the resolver chain -rhema-memory = "0.2.3" +rhema-memory = "0.3.0" # The shared ModelCard the backend registry's listings return -rhema-provider = "0.2.3" -rhema-provider-registry = "0.2.3" +rhema-provider = "0.3.0" +rhema-provider-registry = "0.3.0" # Args for the two-flag binary surface clap = { version = "4.5", features = ["derive"] } serde = { workspace = true } @@ -71,7 +71,7 @@ time = { version = "0.3", default-features = false, features = ["parsing"] } # Inbound chat images ride base64; the dispatch decodes them into the # attachment store base64 = "0.22" -rhema-mcp = "0.2.3" +rhema-mcp = "0.3.0" [dev-dependencies] tempfile = "3" @@ -83,7 +83,7 @@ reqwest = { version = "0.12", features = ["json", "stream"] } bytes = "1" # The scripted provider for turn-level tests; mirrors rhema-code's mock # feature without a feature of our own — tests are the only consumer -rhema-core = { version = "0.2.3", features = ["mock"] } +rhema-core = { version = "0.3.0", features = ["mock"] } tokio = { workspace = true, features = ["rt-multi-thread", "macros", "sync", "time"] } [lints] diff --git a/crates/rhema-claw/src/handler.rs b/crates/rhema-claw/src/handler.rs index 5bdb7bf..4b94202 100644 --- a/crates/rhema-claw/src/handler.rs +++ b/crates/rhema-claw/src/handler.rs @@ -283,7 +283,7 @@ impl ClawHandler { let prompt = build_prompt(&key, &snapshot, &news, workspace.as_path(), role); let mut sink = TurnSink; let output = agent - .turn(prompt, &mut sink, Arc::new(AllowAll)) + .turn(prompt, &mut sink) .await .map_err(|err| format!("turn for {key} failed: {err}"))?; @@ -332,14 +332,14 @@ impl ClawHandler { key: &str, ) -> Result { let (provider, model) = self.backends.current(); - let config = self.agent_config(&model, workspace); + let config = self.agent_config(provider, &model, workspace); let agent = match &ctx.session.core.driver_state { // A never-dispatched key carries no stash: start clean. - serde_json::Value::Null => CodingAgent::new(provider, config), + serde_json::Value::Null => CodingAgent::new(config), stashed => { let session: Session = serde_json::from_value(stashed.clone()) .map_err(|err| format!("stashed session for {key} does not parse: {err}"))?; - CodingAgent::from_session(provider, config, session) + CodingAgent::from_session(config, session) } }; agent.map_err(|err| format!("cannot start the coding agent for {key}: {err}")) @@ -349,8 +349,13 @@ impl ClawHandler { /// agent's, with the bounded request view when the config has it on. /// A forge thread answers for as long as the thread lives; without /// the view its history would ride whole on every step. - fn agent_config(&self, model: &str, workspace: &Path) -> CodingAgentConfig { - let mut config = CodingAgentConfig::new(model, workspace); + fn agent_config( + &self, + provider: Arc, + model: &str, + workspace: &Path, + ) -> CodingAgentConfig { + let mut config = CodingAgentConfig::new(provider, model, workspace, AllowAll); // Write the resolved value, not an override: the coding agent's // own default is on now, and the config's `false` must win. config.transcript = self @@ -1221,6 +1226,7 @@ mod tests { .expect("constructs"), ); let accounts = Arc::new(rhema_identity::VolatileIdentityStore::new()); + let provider = registry.current().0; let on = ClawHandler::new( registry.clone(), "/tmp/w", @@ -1238,12 +1244,12 @@ mod tests { std::collections::BTreeMap::new(), ); assert!( - on.agent_config("m", Path::new("/tmp/w")) + on.agent_config(provider.clone(), "m", Path::new("/tmp/w")) .transcript .is_some() ); assert!( - off.agent_config("m", Path::new("/tmp/w")) + off.agent_config(provider, "m", Path::new("/tmp/w")) .transcript .is_none() ); diff --git a/crates/rhema-claw/src/jobs.rs b/crates/rhema-claw/src/jobs.rs index 4b0709d..9839edb 100644 --- a/crates/rhema-claw/src/jobs.rs +++ b/crates/rhema-claw/src/jobs.rs @@ -212,7 +212,7 @@ impl CodingJobHandler { .map_err(|err| format!("job {job_id} could not start: {err}"))?; let (provider, model) = self.backends.current(); - let mut config = CodingAgentConfig::new(model, &workspace); + let mut config = CodingAgentConfig::new(provider, model, &workspace, AllowAll); config.max_turn_steps = self.max_turn_steps; // A job's stashed session carries across runs and only ever // grows; the view is what keeps a repeat run's steps cheap. @@ -236,9 +236,9 @@ impl CodingJobHandler { self.fail(job_id, &instance_name, &reason); reason })?; - CodingAgent::from_session(provider, config, session) + CodingAgent::from_session(config, session) } - None => CodingAgent::new(provider, config), + None => CodingAgent::new(config), } .map_err(|err| { let reason = format!("cannot start the coding agent for {instance_name:?}: {err}"); @@ -253,7 +253,7 @@ impl CodingJobHandler { agent.set_commit_hook(Some(ctx.commit_hook())); let mut sink = JobSink; - let output = match agent.turn(&job.prompt, &mut sink, Arc::new(AllowAll)).await { + let output = match agent.turn(&job.prompt, &mut sink).await { Ok(output) => output, Err(err) => { let reason = format!("the coding turn for {instance_name:?} failed: {err}"); diff --git a/crates/rhema-claw/src/mcp.rs b/crates/rhema-claw/src/mcp.rs index 9020b6c..c55f275 100644 --- a/crates/rhema-claw/src/mcp.rs +++ b/crates/rhema-claw/src/mcp.rs @@ -82,7 +82,12 @@ mod tests { /// same map). #[test] fn apply_without_any_wiring_leaves_the_config_alone() { - let mut config = CodingAgentConfig::new("m", std::path::Path::new("/tmp")); + let mut config = CodingAgentConfig::new( + rhema_core::mock::MockProvider::new([]), + "m", + std::path::Path::new("/tmp"), + rhema_agent_tools::AllowAll, + ); let before = config.shell_env.clone(); apply(&mut config); // The wiring only appears when the machine's global mcp.yaml diff --git a/crates/rhema-claw/src/vision.rs b/crates/rhema-claw/src/vision.rs index 45ff8e0..f1e8a08 100644 --- a/crates/rhema-claw/src/vision.rs +++ b/crates/rhema-claw/src/vision.rs @@ -52,7 +52,12 @@ mod tests { /// values are constants, so extending twice is the same map. #[test] fn apply_twice_is_apply_once() { - let mut config = CodingAgentConfig::new("m", std::path::Path::new("/tmp")); + let mut config = CodingAgentConfig::new( + rhema_core::mock::MockProvider::new([]), + "m", + std::path::Path::new("/tmp"), + rhema_agent_tools::AllowAll, + ); apply(&mut config); let once = config.shell_env.clone(); apply(&mut config); diff --git a/integrations/rhema-calendar-integration/Cargo.toml b/integrations/rhema-calendar-integration/Cargo.toml index ebff752..2232f98 100644 --- a/integrations/rhema-calendar-integration/Cargo.toml +++ b/integrations/rhema-calendar-integration/Cargo.toml @@ -15,10 +15,10 @@ publish = false rusqlite = { version = "0.40", features = ["bundled"] } # The reminder source: one `Source` over the feeds, detect-pass shaped # like the task scheduler's -rhema-autonomous-agent = "0.2.3" +rhema-autonomous-agent = "0.3.0" # The reminder source ingests its slots into a `Dispatcher`; the event # and key-function shapes are the dispatcher's -rhema-rsd = "0.2.3" +rhema-rsd = "0.3.0" serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } diff --git a/integrations/rhema-forge-integration/Cargo.toml b/integrations/rhema-forge-integration/Cargo.toml index 14a8302..024d3e9 100644 --- a/integrations/rhema-forge-integration/Cargo.toml +++ b/integrations/rhema-forge-integration/Cargo.toml @@ -13,7 +13,7 @@ publish = false [dependencies] # The dispatch seam: watches ingest into a Dispatcher -rhema-rsd = "0.2.3" +rhema-rsd = "0.3.0" serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true }