Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 10 additions & 45 deletions crates/openhuman-app/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion crates/openhuman-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ serde_json = "1"
# `openhuman-rpc`'s own: `http-client` (the relay client), `server` (the
# embedded JSON-RPC server and `host::desktop`) and `jev` (the Jev-backed
# `tool_search` ranker the product ships).
tinymcp = { path = "../../vendor/tinymcp/crates/tinymcp", default-features = false, features = ["ui"] }
openhuman-rpc = { path = "../openhuman-rpc", default-features = false, features = [
"os-keyring",
"http-client",
Expand All @@ -94,6 +93,9 @@ openhuman-rpc = { path = "../openhuman-rpc", default-features = false, features
"tinymemes",
"storage-sqlite",
] }
# The widget scheme reduces CSP origins with `tinymcp_bus::ui`'s pure rules.
# The contract, not the module crate: hosts reach modules through `*-bus`.
tinymcp-bus = { path = "../../vendor/tinymcp/crates/tinymcp-bus" }
# Tauri core and plugins. Use upstream Tauri's native WebView runtime (Wry),
# rather than the removed Chromium/CEF fork.
tauri = { version = "2.11", default-features = false, features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/openhuman-app/src/widget_scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn declared_origins(query: &str) -> (Vec<String>, Vec<String>) {
_ => {}
}
}
let reduce = |items: Vec<Value>| tinymcp::ui::https_origins(Some(&Value::Array(items)));
let reduce = |items: Vec<Value>| tinymcp_bus::ui::https_origins(Some(&Value::Array(items)));
(reduce(connect), reduce(resource))
}

Expand Down
5 changes: 2 additions & 3 deletions crates/openhuman-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@ tinyconnectors-bus = { path = "../../vendor/tinyconnectors/crates/tinyconnectors



# tinymcp: pure tool-UI rules only (`tinymcp::ui`). The MCP runtime itself runs
# as a module behind `tinymcp-bus`.
tinymcp = { path = "../../vendor/tinymcp/crates/tinymcp", default-features = false, features = ["ui"] }
# tinymcp's contract, including the pure tool-UI rules (`tinymcp_bus::ui`). The
# MCP runtime itself runs as a module behind it.
tinymcp-bus = { path = "../../vendor/tinymcp/crates/tinymcp-bus", features = ["schemars"] }
# The transport-free channel vocabulary: inbound envelopes, outbound intents,
# the config schema, controller metadata and relay frames. UNCONDITIONAL — `DomainEvent` embeds
Expand Down
2 changes: 1 addition & 1 deletion crates/openhuman-core/src/mcp/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub fn client_config(config: &Config) -> tinymcp_bus::McpClientConfig {
client.client_identity.name = config.mcp_client.client_identity.name.clone();
client.client_identity.title = config.mcp_client.client_identity.title.clone();
client.client_identity.version = config.mcp_client.client_identity.version.clone();
client.client_identity.capabilities = tinymcp::ui::client_capabilities();
client.client_identity.capabilities = tinymcp_bus::ui::client_capabilities();
Comment thread
M3gA-Mind marked this conversation as resolved.
client.registry_auth = config.mcp_client.registry_auth.clone();

// GitBooks uses dedicated deferred tools and is not part of the configured
Expand Down
2 changes: 1 addition & 1 deletion crates/openhuman-core/src/mcp/ui/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use serde_json::Value;

fn template_uri(meta: &Value) -> Option<String> {
tinymcp::ui::template_from_meta(meta).map(|(uri, _)| uri)
tinymcp_bus::ui::template_from_meta(meta).map(|(uri, _)| uri)
}

fn meta_keys(meta: &Value) -> Vec<String> {
Expand Down
2 changes: 1 addition & 1 deletion crates/openhuman-core/src/mcp/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Tool-provided UI in the chat: MCP Apps widgets, OpenAI Apps SDK widgets,
//! skill views, and the links a tool result offers.
//!
//! - [`resolve`] applies `tinymcp::ui`'s rules to one call's descriptor
//! - [`resolve`] applies `tinymcp_bus::ui`'s rules to one call's descriptor
//! `_meta` and result, giving a [`types::McpUiPresentation`], the metadata
//! the chat surface renders, and caches any document the result carried.
//! - [`decorate`] applies that to every MCP tool path.
Expand Down
4 changes: 2 additions & 2 deletions crates/openhuman-core/src/mcp/ui/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ pub async fn tool_call(
.tool_descriptor(&server_id, &tool_name)
.await
.ok_or_else(|| format!("`{tool_name}` is not offered by this server"))?;
if !tinymcp::ui::visible_to_app(descriptor.meta.as_ref()) {
if !tinymcp_bus::ui::visible_to_app(descriptor.meta.as_ref()) {
tracing::debug!(
server_id,
tool_name,
"[mcp_ui] widget asked for a model-only tool"
);
return Err(format!("`{tool_name}` cannot be called from a widget"));
}
let read_only = tinymcp::ui::is_read_only(descriptor.annotations.as_ref());
let read_only = tinymcp_bus::ui::is_read_only(descriptor.annotations.as_ref());
if !read_only && !confirmed {
tracing::debug!(
server_id,
Expand Down
6 changes: 3 additions & 3 deletions crates/openhuman-core/src/mcp/ui/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Turning one tool call into what the chat surface shows for it.
//!
//! The rules are `tinymcp::ui`'s. This host keeps any widget document the
//! The rules are `tinymcp_bus::ui`'s. This host keeps any widget document the
//! result carried, so the frame can load it by id.

pub use tinymcp::ui::{
pub use tinymcp_bus::ui::{
https_origins, is_ui_uri, resource_from_contents, view_from_envelope, view_from_raw_result,
MAX_STRUCTURED_BYTES, MAX_WIDGET_BYTES as MAX_RESOURCE_BYTES,
};
Expand All @@ -15,7 +15,7 @@ use super::types::{McpUiPresentation, UiCallView};
/// nor a link. A document the result embedded is cached for the frame.
#[must_use]
pub fn presentation_from_view(view: &UiCallView) -> Option<McpUiPresentation> {
let resolved = tinymcp::ui::resolve_presentation(view)?;
let resolved = tinymcp_bus::ui::resolve_presentation(view)?;
let mut presentation = resolved.presentation;
if let Some((uri, document)) = resolved.prefetched {
cache::put_read(&view.server_id, &uri, document);
Expand Down
2 changes: 1 addition & 1 deletion crates/openhuman-core/src/mcp/ui/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult
use super::cache::{self, InlineEntry};
use super::resolve::{MAX_RESOURCE_BYTES, MAX_STRUCTURED_BYTES};
use super::types::{McpUiPresentation, UiCsp, UiFlavor, UiResource, MCP_APP_MIME, MCP_UI_KIND};
use tinymcp::ui::extract_links;
use tinymcp_bus::ui::extract_links;

/// The tool's registered name.
pub const SHOW_UI_TOOL: &str = "show_ui";
Expand Down
4 changes: 2 additions & 2 deletions crates/openhuman-core/src/mcp/ui/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

use serde_json::Value;

pub use tinymcp::ui::{
pub use tinymcp_bus::ui::{
Comment thread
coderabbitai[bot] marked this conversation as resolved.
McpUiPresentation, UiCallView, UiCsp, UiFlavor, UiLink, UiLinkKind, UiResource,
MCP_APPS_EXTENSION, MCP_APP_MIME, MCP_UI_KIND,
};
pub use tinymcp::MCP_RESULT_KIND;
pub use tinymcp_bus::MCP_RESULT_KIND;

/// What a widget-initiated tool call needs to know about its target tool.
#[derive(Debug, Clone, Default, PartialEq)]
Expand Down
Loading
Loading