feat(agent): enhance agent and skill management features

- Updated the API to include disabled agent IDs for better management of user-specific agent visibility.
- Introduced a new function to set the disabled state for shared agents, allowing users to manage their shared agent preferences.
- Added a new Skills API to retrieve available skills, enhancing the overall agent capabilities.
- Improved the AgentSelector and related components to filter out disabled agents, ensuring a cleaner user experience.
- Updated localization strings to reflect new features and improve clarity in agent and skill management.

This update enhances the user experience by providing better control over agent visibility and introducing new skill management functionalities.
This commit is contained in:
wizardchen
2026-02-05 16:29:56 +08:00
committed by lyingbug
parent 5ab20a9148
commit c806eaf7f9
22 changed files with 1668 additions and 964 deletions
+18
View File
@@ -241,6 +241,8 @@ export interface SharedAgentInfo {
shared_at: string
shared_by_user_id?: string
shared_by_username?: string
/** 当前用户是否已停用该共享智能体(仅影响本人对话下拉显示) */
disabled_by_me?: boolean
}
export interface ListAgentSharesResponse {
@@ -610,6 +612,22 @@ export async function listSharedAgents(): Promise<ApiResponse<SharedAgentInfo[]>
}
}
/** 设置当前用户对某共享智能体的停用状态(仅影响本人对话下拉显示) */
export async function setSharedAgentDisabledByMe(
agentId: string,
disabled: boolean
): Promise<ApiResponse<void>> {
try {
const response = await post('/api/v1/shared-agents/disabled', {
agent_id: agentId,
disabled
})
return response as unknown as ApiResponse<void>
} catch (error: any) {
return { success: false, message: error.message || 'Failed to update preference' }
}
}
export async function listOrgAgentShares(orgId: string): Promise<ApiResponse<ListAgentSharesResponse>> {
try {
const response = await get(`/api/v1/organizations/${orgId}/agent-shares`)