feat: introduce ToolSourceType enum and refactor related code to use it

This commit is contained in:
mlogclub
2026-04-14 15:05:38 +08:00
parent 0ea493e536
commit 8d560bb6bd
12 changed files with 76 additions and 39 deletions
+13 -10
View File
@@ -1,6 +1,9 @@
package response
import "cs-agent/internal/ai/mcps"
import (
"cs-agent/internal/ai/mcps"
"cs-agent/internal/pkg/enums"
)
type MCPConnectionResponse struct {
ServerCode string `json:"serverCode"`
@@ -66,15 +69,15 @@ func BuildMCPToolInfoResponses(items []mcps.ToolInfo) []MCPToolInfoResponse {
}
type MCPToolCatalogResponse struct {
ToolCode string `json:"toolCode"`
ServerCode string `json:"serverCode"`
ToolName string `json:"toolName"`
SourceType string `json:"sourceType"`
AutoInjected bool `json:"autoInjected"`
Title string `json:"title"`
Description string `json:"description"`
InputSchema any `json:"inputSchema"`
OutputSchema any `json:"outputSchema,omitempty"`
ToolCode string `json:"toolCode"`
ServerCode string `json:"serverCode"`
ToolName string `json:"toolName"`
SourceType enums.ToolSourceType `json:"sourceType"`
AutoInjected bool `json:"autoInjected"`
Title string `json:"title"`
Description string `json:"description"`
InputSchema any `json:"inputSchema"`
OutputSchema any `json:"outputSchema,omitempty"`
}
type MCPToolResultContentResponse struct {