fix: prevent MCP operations from blocking chat interface

This commit is contained in:
Kadxy
2025-01-19 01:02:01 +08:00
parent bc71ae247b
commit bfeea4ed49
4 changed files with 136 additions and 131 deletions

View File

@@ -73,7 +73,16 @@ export interface ListToolsResponse {
};
}
export type McpClientData = McpActiveClient | McpErrorClient;
export type McpClientData =
| McpActiveClient
| McpErrorClient
| McpInitializingClient;
interface McpInitializingClient {
client: null;
tools: null;
errorMsg: null;
}
interface McpActiveClient {
client: Client;
@@ -88,7 +97,12 @@ interface McpErrorClient {
}
// 服务器状态类型
export type ServerStatus = "undefined" | "active" | "paused" | "error";
export type ServerStatus =
| "undefined"
| "active"
| "paused"
| "error"
| "initializing";
export interface ServerStatusResponse {
status: ServerStatus;