feat(agent): enhance agent sharing and selection features

- Updated the AgentSelector component to improve agent selection logic, ensuring accurate representation of selected agents.
- Introduced new AgentShareSettings component for managing agent sharing with organizations, including UI for selecting organizations and displaying shared agents.
- Enhanced API interactions for sharing agents, including new methods for listing and managing agent shares.
- Improved localization support for agent sharing features across multiple languages.
- Updated various components to reflect changes in agent capabilities and sharing status, enhancing user experience and clarity.

This update strengthens the agent management features, providing users with better tools for sharing and selecting agents within organizations.
This commit is contained in:
wizardchen
2026-02-04 20:12:29 +08:00
committed by lyingbug
parent faa4e9e7b5
commit dfaf862bc0
45 changed files with 3606 additions and 477 deletions
+9 -3
View File
@@ -336,10 +336,9 @@ const sendMsg = async (value, modelId = '', mentionedItems = []) => {
const kbIds = [...kbIdSet];
const knowledgeIds = [...fileIdSet];
// Get selected agent ID
// Get selected agent ID (backend resolves shared agent and its tenant from share relation)
const selectedAgentId = useSettingsStoreInstance.selectedAgentId || '';
// Use agent-chat endpoint when agent is enabled, otherwise use knowledge-chat
const endpoint = agentEnabled ? '/api/v1/agent-chat' : '/api/v1/knowledge-chat';
@@ -351,7 +350,7 @@ const sendMsg = async (value, modelId = '', mentionedItems = []) => {
knowledge_base_ids: kbIds,
knowledge_ids: knowledgeIds,
agent_enabled: agentEnabled,
agent_id: selectedAgentId, // 传递选中的智能体 ID
agent_id: selectedAgentId,
web_search_enabled: webSearchEnabled,
summary_model_id: modelId,
mcp_service_ids: mcpServiceIds,
@@ -882,6 +881,13 @@ const updateAssistantSession = (payload) => {
onMounted(async () => {
messagesList.splice(0);
// 若从智能体列表点击共享智能体进入,URL 带 agent_id 与 source_tenant_id,同步到 store
const agentIdFromQuery = route.query.agent_id && String(route.query.agent_id);
const sourceTenantIdFromQuery = route.query.source_tenant_id && String(route.query.source_tenant_id);
if (agentIdFromQuery && sourceTenantIdFromQuery) {
useSettingsStoreInstance.selectAgent(agentIdFromQuery, sourceTenantIdFromQuery);
}
// 初始化状态:加载历史消息时不应显示loading
loading.value = false;
isReplying.value = false;