Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

style(gitbooks): apply rustfmt formatting

Steven Enamakel41510071823d
diff --git a/crates/openhuman-core/src/tools/impl/network/gitbooks.rs b/crates/openhuman-core/src/tools/impl/network/gitbooks.rs
index a0d14dd54b..a2811ec123 100644
--- a/crates/openhuman-core/src/tools/impl/network/gitbooks.rs
+++ b/crates/openhuman-core/src/tools/impl/network/gitbooks.rs
@@ -1,11 +1,7 @@
//! `gitbooks` — answer questions about OpenHuman through the TinyMCP module's
//! confidential one-shot tool-call contract.
-use crate::{
- config::Config,
- mcp::http_client::redact_endpoint,
- modules::client::ModuleClient,
-};
+use crate::{config::Config, mcp::http_client::redact_endpoint, modules::client::ModuleClient};
use async_trait::async_trait;
use serde_json::{json, Value};
use std::time::Duration;
@@ -95,7 +91,11 @@ impl Tool for GitbooksSearchTool {
);
Ok(self
- .call("searchDocumentation", json!({ "query": query }), "gitbooks_search")
+ .call(
+ "searchDocumentation",
+ json!({ "query": query }),
+ "gitbooks_search",
+ )
.await)
}
}
@@ -190,15 +190,29 @@ impl Tool for GitbooksGetPageTool {
impl GitbooksSearchTool {
async fn call(&self, tool: &str, arguments: Value, label: &str) -> ToolResult {
- configured_call(&self.client, &self.endpoint, self.timeout_secs, tool, arguments, label)
- .await
+ configured_call(
+ &self.client,
+ &self.endpoint,
+ self.timeout_secs,
+ tool,
+ arguments,
+ label,
+ )
+ .await
}
}
impl GitbooksGetPageTool {
async fn call(&self, tool: &str, arguments: Value, label: &str) -> ToolResult {
- configured_call(&self.client, &self.endpoint, self.timeout_secs, tool, arguments, label)
- .await
+ configured_call(
+ &self.client,
+ &self.endpoint,
+ self.timeout_secs,
+ tool,
+ arguments,
+ label,
+ )
+ .await
}
}
diff --git a/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs b/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs
index f34a7e148a..70e40796a5 100644
--- a/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs
@@ -49,9 +49,7 @@ impl MockTinyMcp {
}
#[cfg(feature = "modules")]
-async fn mock_module_client(
- state: MockProviderState,
-) -> (ModuleClient, tinybus::Connection) {
+async fn mock_module_client(state: MockProviderState) -> (ModuleClient, tinybus::Connection) {
use tinybus::{broker::Broker, transport::memory::MemoryBus, Connection, ObjectPath};
let bus = MemoryBus::new();
@@ -112,7 +110,10 @@ async fn mock_gitbooks_provider() -> (String, std::sync::Arc<std::sync::Mutex<Ve
{"name": "getPage", "inputSchema": {"type": "object"}}
]}),
"tools/call" => {
- calls.lock().expect("provider request log").push(body["params"].clone());
+ calls
+ .lock()
+ .expect("provider request log")
+ .push(body["params"].clone());
let name = body["params"]["name"].as_str().unwrap_or_default();
let text = match name {
"searchDocumentation" => "search fixture result",
@@ -159,7 +160,10 @@ async fn gitbooks_tools_use_confidential_one_shot_module_calls() {
assert!(!page_result.is_error, "{}", page_result.output());
assert!(page_result.output().contains("page fixture markdown"));
assert_eq!(
- provider_calls.lock().expect("provider request log").as_slice(),
+ provider_calls
+ .lock()
+ .expect("provider request log")
+ .as_slice(),
[
serde_json::json!({"name": "searchDocumentation", "arguments": {"query": "module migration"}}),
serde_json::json!({"name": "getPage", "arguments": {"url": "https://docs.example.test/guide"}}),