chore: 提交所有工作进度 — SaaS 后端增强、Admin UI、桌面端集成
包含大量 SaaS 平台改进、Admin 管理后台更新、桌面端集成完善、 文档同步、测试文件重构等内容。为 QA 测试准备干净工作树。
This commit is contained in:
@@ -427,6 +427,28 @@ impl A2aRouter {
|
||||
pub fn agent_id(&self) -> &AgentId {
|
||||
&self.agent_id
|
||||
}
|
||||
|
||||
/// Discover agents that have a specific capability
|
||||
pub async fn discover(&self, capability: &str) -> Result<Vec<A2aAgentProfile>> {
|
||||
let cap_index = self.capability_index.read().await;
|
||||
let profiles = self.profiles.read().await;
|
||||
|
||||
match cap_index.get(capability) {
|
||||
Some(agent_ids) => {
|
||||
let result: Vec<A2aAgentProfile> = agent_ids.iter()
|
||||
.filter_map(|id| profiles.get(id).cloned())
|
||||
.collect();
|
||||
Ok(result)
|
||||
}
|
||||
None => Ok(Vec::new()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get all registered agent profiles
|
||||
pub async fn list_profiles(&self) -> Vec<A2aAgentProfile> {
|
||||
let profiles = self.profiles.read().await;
|
||||
profiles.values().cloned().collect()
|
||||
}
|
||||
}
|
||||
|
||||
/// Basic A2A client implementation
|
||||
|
||||
Reference in New Issue
Block a user