Refactor skill and agent editing to integrate MCP tool catalog, enhancing tool selection and management

This commit is contained in:
mlogclub
2026-04-09 15:36:20 +08:00
parent 92490d7faf
commit 399c29002b
3 changed files with 202 additions and 55 deletions
+23 -7
View File
@@ -216,6 +216,7 @@ export type AIAgent = {
skillIds: number[]
skills: { id: number; code: string; name: string }[]
directTools: {
toolCode: string
serverCode: string
toolName: string
title: string
@@ -246,6 +247,7 @@ export type CreateAIAgentPayload = {
knowledgeIds: number[]
skillIds: number[]
directTools: {
toolCode: string
serverCode: string
toolName: string
title: string
@@ -276,10 +278,9 @@ export type SkillDefinition = {
code: string
name: string
description: string
prompt: string
executionMode?: string
executionModeName?: string
executionConfig?: string
content: string
examples: string[]
allowedToolCodes: string[]
priority: number
status: number
statusName: string
@@ -294,9 +295,10 @@ export type CreateSkillDefinitionPayload = {
code: string
name: string
description: string
prompt: string
executionMode?: string
executionConfig?: string
content: string
examples: string[]
allowedToolCodes: string[]
priority?: number
remark: string
}
@@ -327,6 +329,16 @@ export type MCPToolInfo = {
outputSchema?: unknown
}
export type MCPToolCatalogItem = {
toolCode: string
serverCode: string
toolName: string
title: string
description: string
inputSchema: unknown
outputSchema?: unknown
}
export type MCPToolResultContent = {
type: string
text?: string
@@ -878,6 +890,10 @@ export function listMCPTools(serverCode: string) {
})
}
export function fetchMCPCatalog() {
return request<MCPToolCatalogItem[]>("/api/console/mcp/catalog")
}
export function callMCPTool(payload: {
serverCode: string
toolName: string