From 1e6e1a93d8cb98cd096f9c6ff653a6f73c01935a Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Mon, 14 Sep 2026 14:04:21 +0000 Subject: [PATCH] acp: Add agent license if available from the registry (#64178) The JetBrains team started added links to the relevant license terms for each agent. Seems worth linking out to if we have it. Release Notes: - N/A --- crates/agent_servers/src/custom.rs | 1 + crates/agent_ui/src/agent_registry_ui.rs | 24 +++++++++++++++++++++- crates/project/src/agent_registry_store.rs | 8 ++++++++ crates/project/src/agent_server_store.rs | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/crates/agent_servers/src/custom.rs b/crates/agent_servers/src/custom.rs index c79ebdc45c..9d682fdcbc 100644 --- a/crates/agent_servers/src/custom.rs +++ b/crates/agent_servers/src/custom.rs @@ -361,6 +361,7 @@ mod tests { version: SharedString::from("1.0.0"), repository: None, website: None, + license_url: None, icon_path: None, }, package: id, diff --git a/crates/agent_ui/src/agent_registry_ui.rs b/crates/agent_ui/src/agent_registry_ui.rs index 72fb346391..5cdf6c7e37 100644 --- a/crates/agent_ui/src/agent_registry_ui.rs +++ b/crates/agent_ui/src/agent_registry_ui.rs @@ -444,6 +444,27 @@ impl AgentRegistryPage { }) }); + let license_button = agent.license_url().map(|license_url| { + let license_url = license_url.clone(); + let license_url_for_click = license_url.clone(); + IconButton::new( + SharedString::from(format!("agent-license-{}", agent.id())), + IconName::FileTextOutlined, + ) + .icon_size(IconSize::Small) + .tooltip(move |_, cx| { + Tooltip::with_meta( + "View Agent License or Terms of Service", + None, + license_url.clone(), + cx, + ) + }) + .on_click(move |_, _, cx| { + cx.open_url(&license_url_for_click); + }) + }); + AgentRegistryCard::new() .child( h_flex() @@ -483,7 +504,8 @@ impl AgentRegistryPage { .truncate(), ) .when_some(repository_button, |this, button| this.child(button)) - .when_some(website_button, |this, button| this.child(button)), + .when_some(website_button, |this, button| this.child(button)) + .when_some(license_button, |this, button| this.child(button)), ), ) } diff --git a/crates/project/src/agent_registry_store.rs b/crates/project/src/agent_registry_store.rs index 67550e8108..7ab885daba 100644 --- a/crates/project/src/agent_registry_store.rs +++ b/crates/project/src/agent_registry_store.rs @@ -32,6 +32,7 @@ pub struct RegistryAgentMetadata { pub version: SharedString, pub repository: Option, pub website: Option, + pub license_url: Option, pub icon_path: Option, } @@ -88,6 +89,10 @@ impl RegistryAgent { self.metadata().website.as_ref() } + pub fn license_url(&self) -> Option<&SharedString> { + self.metadata().license_url.as_ref() + } + pub fn icon_path(&self) -> Option<&SharedString> { self.metadata().icon_path.as_ref() } @@ -396,6 +401,7 @@ async fn build_registry_agents( version: entry.version.into(), repository: entry.repository.map(Into::into), website: entry.website.map(Into::into), + license_url: entry.license_url.map(Into::into), icon_path, }; @@ -643,6 +649,8 @@ struct RegistryEntry { #[serde(default)] website: Option, #[serde(default)] + license_url: Option, + #[serde(default)] icon: Option, distribution: RegistryDistribution, } diff --git a/crates/project/src/agent_server_store.rs b/crates/project/src/agent_server_store.rs index 6756319e10..8b10f8bb54 100644 --- a/crates/project/src/agent_server_store.rs +++ b/crates/project/src/agent_server_store.rs @@ -1765,6 +1765,7 @@ mod tests { version: SharedString::from(version.to_string()), repository: None, website: None, + license_url: None, icon_path: None, }, package: id,