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:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user