@univerjs-pro/mcp 0.10.9 → 0.10.10-experimental.20251016-33b0941
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/controllers/mcp-connection.controller.d.ts +5 -5
- package/lib/types/controllers/mcp-tool-registry.controller.d.ts +6 -4
- package/lib/types/facade/f-event.d.ts +150 -0
- package/lib/types/facade/f-univer.d.ts +18 -0
- package/lib/types/facade/index.d.ts +2 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/services/mcp-event.service.d.ts +86 -0
- package/lib/types/utils/json-utils.d.ts +13 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
- package/lib/types/services/mcp-ui-event.service.d.ts +0 -84
|
@@ -15,7 +15,7 @@ export declare enum MCPConnectionStatus {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare enum MCPConnectionError {
|
|
17
17
|
NONE = "NONE",
|
|
18
|
-
|
|
18
|
+
UNAUTHORIZED = "UNAUTHORIZED",
|
|
19
19
|
SESSION_ID_OCCUPIED = "SESSION_ID_OCCUPIED",
|
|
20
20
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
21
21
|
MAX_RETRIES_EXCEEDED = "MAX_RETRIES_EXCEEDED"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
|
|
2
2
|
import { HTTPService } from '@univerjs/network';
|
|
3
|
-
import {
|
|
3
|
+
import { MCPEventService } from '../services/mcp-event.service';
|
|
4
4
|
import { MCPConnectionError, MCPConnectionStatus } from './config.schema';
|
|
5
5
|
/**
|
|
6
6
|
* MCP WebSocket Message interface
|
|
@@ -31,7 +31,7 @@ export declare class MCPConnectionController extends Disposable {
|
|
|
31
31
|
private readonly _configService;
|
|
32
32
|
private readonly _logService;
|
|
33
33
|
private readonly _httpService;
|
|
34
|
-
private readonly
|
|
34
|
+
private readonly _mcpEventService;
|
|
35
35
|
private _socket;
|
|
36
36
|
private _retryCount;
|
|
37
37
|
private _connectionStatus;
|
|
@@ -46,7 +46,7 @@ export declare class MCPConnectionController extends Disposable {
|
|
|
46
46
|
readonly sessionId$: import('rxjs').Observable<string>;
|
|
47
47
|
private readonly _message$;
|
|
48
48
|
readonly message$: import('rxjs').Observable<IMCPMessage>;
|
|
49
|
-
constructor(_injector: Injector, _configService: IConfigService, _logService: ILogService, _httpService: HTTPService,
|
|
49
|
+
constructor(_injector: Injector, _configService: IConfigService, _logService: ILogService, _httpService: HTTPService, _mcpEventService: MCPEventService);
|
|
50
50
|
/**
|
|
51
51
|
* Get current connection status
|
|
52
52
|
*/
|
|
@@ -111,11 +111,11 @@ export declare class MCPConnectionController extends Disposable {
|
|
|
111
111
|
*/
|
|
112
112
|
private _scheduleReconnect;
|
|
113
113
|
/**
|
|
114
|
-
* Set connection status
|
|
114
|
+
* Set connection status
|
|
115
115
|
*/
|
|
116
116
|
private _setConnectionStatus;
|
|
117
117
|
/**
|
|
118
|
-
* Set connection error
|
|
118
|
+
* Set connection error
|
|
119
119
|
*/
|
|
120
120
|
private _setConnectionError;
|
|
121
121
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Disposable, ILogService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { MCPEventService } from '../services/mcp-event.service';
|
|
4
4
|
/**
|
|
5
5
|
* MCP Tool definition interface
|
|
6
6
|
*/
|
|
@@ -37,9 +37,11 @@ export declare const IMCPToolRegistry: import('@wendellhu/redi').IdentifierDecor
|
|
|
37
37
|
*/
|
|
38
38
|
export declare class MCPToolRegistryController extends Disposable implements IMCPToolRegistry {
|
|
39
39
|
private readonly _logService;
|
|
40
|
-
private readonly
|
|
40
|
+
private readonly _mcpEventService;
|
|
41
|
+
readonly _injector: Injector;
|
|
42
|
+
private readonly _configService;
|
|
41
43
|
private readonly _tools;
|
|
42
|
-
constructor(_logService: ILogService,
|
|
44
|
+
constructor(_logService: ILogService, _mcpEventService: MCPEventService, _injector: Injector, _configService: IConfigService);
|
|
43
45
|
/**
|
|
44
46
|
* Register a tool for MCP calls
|
|
45
47
|
*/
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { MCPConnectionError, MCPConnectionStatus, MCPEventId } from '@univerjs-pro/mcp';
|
|
2
|
+
import { IEventBase } from '@univerjs/core/facade';
|
|
3
|
+
/**
|
|
4
|
+
* Event triggered when MCP connection status changes
|
|
5
|
+
*/
|
|
6
|
+
export interface IMcpConnectionStatusChangedEvent extends IEventBase {
|
|
7
|
+
/**
|
|
8
|
+
* Connection status
|
|
9
|
+
*/
|
|
10
|
+
status: MCPConnectionStatus;
|
|
11
|
+
/**
|
|
12
|
+
* Connection error (if any)
|
|
13
|
+
*/
|
|
14
|
+
error?: MCPConnectionError;
|
|
15
|
+
/**
|
|
16
|
+
* Status message
|
|
17
|
+
*/
|
|
18
|
+
message?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Event triggered when MCP tool call is received
|
|
22
|
+
*/
|
|
23
|
+
export interface IMcpToolCallReceivedEvent extends IEventBase {
|
|
24
|
+
/**
|
|
25
|
+
* The name of the tool being called
|
|
26
|
+
*/
|
|
27
|
+
toolName: string;
|
|
28
|
+
/**
|
|
29
|
+
* The parameters passed to the tool
|
|
30
|
+
*/
|
|
31
|
+
parameters: unknown;
|
|
32
|
+
/**
|
|
33
|
+
* The tool call ID (for tracking)
|
|
34
|
+
*/
|
|
35
|
+
callId?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Event triggered when MCP tool call executes successfully
|
|
39
|
+
*/
|
|
40
|
+
export interface IMcpToolCallExecutedEvent extends IEventBase {
|
|
41
|
+
/**
|
|
42
|
+
* The name of the tool that was called
|
|
43
|
+
*/
|
|
44
|
+
toolName: string;
|
|
45
|
+
/**
|
|
46
|
+
* The tool call ID (for tracking)
|
|
47
|
+
*/
|
|
48
|
+
callId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The result returned by the tool
|
|
51
|
+
*/
|
|
52
|
+
result?: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Event triggered when MCP tool call fails
|
|
56
|
+
*/
|
|
57
|
+
export interface IMcpToolCallFailedEvent extends IEventBase {
|
|
58
|
+
/**
|
|
59
|
+
* The name of the tool that failed
|
|
60
|
+
*/
|
|
61
|
+
toolName: string;
|
|
62
|
+
/**
|
|
63
|
+
* The tool call ID (for tracking)
|
|
64
|
+
*/
|
|
65
|
+
callId?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The error that occurred
|
|
68
|
+
*/
|
|
69
|
+
error?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Constants for MCP event names
|
|
73
|
+
* @ignore
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Subscribe to connection status changes
|
|
77
|
+
* univerAPI.addEvent(univerAPI.Event.McpConnectionStatusChanged, (event) => {
|
|
78
|
+
* console.log('Connection status:', event.status);
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* // Subscribe to tool call events
|
|
82
|
+
* univerAPI.addEvent(univerAPI.Event.McpToolCallReceived, (event) => {
|
|
83
|
+
* console.log('Tool called:', event.toolName);
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export interface IFMCPEventName {
|
|
88
|
+
/**
|
|
89
|
+
* Event triggered when MCP connection status changes
|
|
90
|
+
* @see {@link IMcpConnectionStatusChangedEvent}
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* univerAPI.addEvent(univerAPI.Event.McpConnectionStatusChanged, (event) => {
|
|
94
|
+
* if (event.status === 'CONNECTED') {
|
|
95
|
+
* console.log('MCP server connected');
|
|
96
|
+
* }
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
readonly McpConnectionStatusChanged: typeof MCPEventId.McpConnectionStatusChanged;
|
|
101
|
+
/**
|
|
102
|
+
* Event triggered when MCP tool call is received
|
|
103
|
+
* @see {@link IMcpToolCallReceivedEvent}
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* univerAPI.addEvent(univerAPI.Event.McpToolCallReceived, (event) => {
|
|
107
|
+
* console.log(`Received tool call: ${event.toolName}`, event.parameters);
|
|
108
|
+
* });
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
readonly McpToolCallReceived: typeof MCPEventId.McpToolCallReceived;
|
|
112
|
+
/**
|
|
113
|
+
* Event triggered when MCP tool call executes successfully
|
|
114
|
+
* @see {@link IMcpToolCallExecutedEvent}
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* univerAPI.addEvent(univerAPI.Event.McpToolCallExecuted, (event) => {
|
|
118
|
+
* console.log(`Tool ${event.toolName} executed successfully:`, event.result);
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
readonly McpToolCallExecuted: typeof MCPEventId.McpToolCallExecuted;
|
|
123
|
+
/**
|
|
124
|
+
* Event triggered when MCP tool call fails
|
|
125
|
+
* @see {@link IMcpToolCallFailedEvent}
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* univerAPI.addEvent(univerAPI.Event.McpToolCallFailed, (event) => {
|
|
129
|
+
* console.error(`Tool ${event.toolName} failed:`, event.error);
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
readonly McpToolCallFailed: typeof MCPEventId.McpToolCallFailed;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Event configuration for MCP events
|
|
137
|
+
* @ignore
|
|
138
|
+
*/
|
|
139
|
+
export interface IMCPEventConfig {
|
|
140
|
+
McpConnectionStatusChanged: IMcpConnectionStatusChangedEvent;
|
|
141
|
+
McpToolCallReceived: IMcpToolCallReceivedEvent;
|
|
142
|
+
McpToolCallExecuted: IMcpToolCallExecutedEvent;
|
|
143
|
+
McpToolCallFailed: IMcpToolCallFailedEvent;
|
|
144
|
+
}
|
|
145
|
+
declare module '@univerjs/core/facade' {
|
|
146
|
+
interface FEventName extends IFMCPEventName {
|
|
147
|
+
}
|
|
148
|
+
interface IEventParamConfig extends IMCPEventConfig {
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IMCPTool } from '@univerjs-pro/mcp';
|
|
2
|
+
import { Injector } from '@univerjs/core';
|
|
2
3
|
import { FUniver } from '@univerjs/core/facade';
|
|
3
4
|
/**
|
|
4
5
|
* @ignore
|
|
@@ -24,8 +25,22 @@ interface IFUniverMCP {
|
|
|
24
25
|
* @param params The parameters for the tool.
|
|
25
26
|
*/
|
|
26
27
|
callMCPTool(toolName: string, params: unknown): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Get current MCP connection status.
|
|
30
|
+
*/
|
|
31
|
+
getMCPConnectionStatus(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Connect to MCP server.
|
|
34
|
+
*/
|
|
35
|
+
connectMCP(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Disconnect from MCP server.
|
|
38
|
+
*/
|
|
39
|
+
disconnectMCP(): void;
|
|
27
40
|
}
|
|
28
41
|
export declare class FUniverMCPMixin extends FUniver implements IFUniverMCP {
|
|
42
|
+
_initialize(injector: Injector): void;
|
|
43
|
+
private _registerMCPFacadeEvents;
|
|
29
44
|
validateMCPToolCall(toolName: string, params: unknown): {
|
|
30
45
|
isValid: boolean;
|
|
31
46
|
error?: string;
|
|
@@ -33,6 +48,9 @@ export declare class FUniverMCPMixin extends FUniver implements IFUniverMCP {
|
|
|
33
48
|
};
|
|
34
49
|
getAllMCPTools(): IMCPTool[];
|
|
35
50
|
callMCPTool(toolName: string, params: unknown): Promise<any>;
|
|
51
|
+
getMCPConnectionStatus(): string;
|
|
52
|
+
connectMCP(): void;
|
|
53
|
+
disconnectMCP(): void;
|
|
36
54
|
}
|
|
37
55
|
declare module '@univerjs/core/facade' {
|
|
38
56
|
interface FUniver extends IFUniverMCP {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { MCPConnectionController } from './controllers/mcp-connection.controller
|
|
|
4
4
|
export { MCPMessageController } from './controllers/mcp-message.controller';
|
|
5
5
|
export { type IMCPTool, IMCPToolRegistry, MCPToolRegistryController } from './controllers/mcp-tool-registry.controller';
|
|
6
6
|
export { UniverMCPPlugin } from './plugin';
|
|
7
|
-
export {
|
|
7
|
+
export { MCPEventId } from './services/mcp-event.service';
|
|
8
|
+
export { MCPEventService } from './services/mcp-event.service';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { MCPConnectionError, MCPConnectionStatus } from '../controllers/config.schema';
|
|
2
|
+
/**
|
|
3
|
+
* MCP event interface - unified for all event types with strong typing
|
|
4
|
+
*/
|
|
5
|
+
export type IMCPEvent = {
|
|
6
|
+
type: MCPEventId.McpConnectionStatusChanged;
|
|
7
|
+
data: IConnectionStatusEvent;
|
|
8
|
+
} | {
|
|
9
|
+
type: MCPEventId.McpToolCallReceived;
|
|
10
|
+
data: IToolCallEvent;
|
|
11
|
+
} | {
|
|
12
|
+
type: MCPEventId.McpToolCallExecuted;
|
|
13
|
+
data: IToolExecutionEvent;
|
|
14
|
+
} | {
|
|
15
|
+
type: MCPEventId.McpToolCallFailed;
|
|
16
|
+
data: IToolExecutionEvent;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* MCP event IDs for communication between MCP core and consumers
|
|
20
|
+
*/
|
|
21
|
+
export declare enum MCPEventId {
|
|
22
|
+
McpConnectionStatusChanged = "McpConnectionStatusChanged",
|
|
23
|
+
McpToolCallReceived = "McpToolCallReceived",
|
|
24
|
+
McpToolCallExecuted = "McpToolCallExecuted",
|
|
25
|
+
McpToolCallFailed = "McpToolCallFailed"
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Connection status change event data
|
|
29
|
+
*/
|
|
30
|
+
export interface IConnectionStatusEvent {
|
|
31
|
+
status: MCPConnectionStatus;
|
|
32
|
+
error?: MCPConnectionError;
|
|
33
|
+
message?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Tool call event data
|
|
37
|
+
*/
|
|
38
|
+
export interface IToolCallEvent {
|
|
39
|
+
toolName: string;
|
|
40
|
+
parameters: unknown;
|
|
41
|
+
callId?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Tool execution result event data
|
|
45
|
+
*/
|
|
46
|
+
export interface IToolExecutionEvent {
|
|
47
|
+
toolName: string;
|
|
48
|
+
callId?: string;
|
|
49
|
+
result?: unknown;
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Configuration update event data
|
|
54
|
+
*/
|
|
55
|
+
export interface IConfigUpdateEvent {
|
|
56
|
+
key: string;
|
|
57
|
+
value: unknown;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* MCP Event Service
|
|
61
|
+
*
|
|
62
|
+
* This service provides event communication for MCP system:
|
|
63
|
+
* - Between MCP core and MCP UI plugin
|
|
64
|
+
* - For direct subscription by non-facade users
|
|
65
|
+
* - As source for facade event forwarding
|
|
66
|
+
*/
|
|
67
|
+
export declare class MCPEventService {
|
|
68
|
+
private readonly _event$;
|
|
69
|
+
readonly event$: import('rxjs').Observable<IMCPEvent>;
|
|
70
|
+
/**
|
|
71
|
+
* Emit an MCP event (private - use specific emit methods for type safety)
|
|
72
|
+
*/
|
|
73
|
+
private emitEvent;
|
|
74
|
+
/**
|
|
75
|
+
* Emit connection status change event
|
|
76
|
+
*/
|
|
77
|
+
_emitConnectionStatus(event: IConnectionStatusEvent): void;
|
|
78
|
+
/**
|
|
79
|
+
* Emit tool call received event
|
|
80
|
+
*/
|
|
81
|
+
_emitToolCallReceived(event: IToolCallEvent): void;
|
|
82
|
+
/**
|
|
83
|
+
* Emit tool execution result event
|
|
84
|
+
*/
|
|
85
|
+
_emitToolExecuted(event: IToolExecutionEvent): void;
|
|
86
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe JSON stringification utilities for MCP protocol
|
|
3
|
+
* Handles circular references and complex objects with minimal overhead
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Safely stringify JSON with strict filtering for complex objects
|
|
7
|
+
* Only allows basic types, plain Objects, and Arrays to be serialized
|
|
8
|
+
* All other types are converted to descriptive strings at the first level
|
|
9
|
+
* @param value - The value to stringify
|
|
10
|
+
* @param space - Optional spacing for formatting
|
|
11
|
+
* @returns JSON string with safe handling of complex objects
|
|
12
|
+
*/
|
|
13
|
+
export declare function safeJsonStringify(value: any, space?: string | number): string;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0xf5b5(_0x201d75,_0x12d19d){const _0x16bee5=_0x16be();return _0xf5b5=function(_0xf5b5d,_0x514184){_0xf5b5d=_0xf5b5d-0x1f2;let _0x4095d3=_0x16bee5[_0xf5b5d];return _0x4095d3;},_0xf5b5(_0x201d75,_0x12d19d);}function _0x16be(){const _0x291642=['1597770VcCWjr','fireEvent','21TXrGfp','connectMCP','1534182cbZoTl','getAllTools','getAllMCPTools','UniverCoreFacade','2620315QJrftN','MCPConnectionController','23533ltBSji','MCPEventService','connect','_registerMCPFacadeEvents','10AotwRM','1257684HDfCNP','get','_injector','function','UniverProMcp','object','callMCPTool','3076513pkpJMI','FEventName','20TzWNzn','4SOVWka','@univerjs/core','FUniver','type','2181032fLheyE','subscribe','McpToolCallReceived','event$','disconnectMCP','McpConnectionStatusChanged','Event','validateToolCall','validateMCPToolCall','disconnect','amd','data','extend','registerEventHandler','toDisposable','IMCPToolRegistry','McpToolCallExecuted','MCPEventId','McpToolCallFailed','executeTool'];_0x16be=function(){return _0x291642;};return _0x16be();}(function(_0x59fe34,_0x5d0284){const _0x5853b5=_0xf5b5,_0x206c53=_0x59fe34();while(!![]){try{const _0x41dbd1=parseInt(_0x5853b5(0x207))/0x1*(-parseInt(_0x5853b5(0x215))/0x2)+parseInt(_0x5853b5(0x201))/0x3+-parseInt(_0x5853b5(0x216))/0x4*(-parseInt(_0x5853b5(0x205))/0x5)+parseInt(_0x5853b5(0x20c))/0x6*(-parseInt(_0x5853b5(0x1ff))/0x7)+parseInt(_0x5853b5(0x21a))/0x8+parseInt(_0x5853b5(0x1fd))/0x9+-parseInt(_0x5853b5(0x20b))/0xa*(parseInt(_0x5853b5(0x213))/0xb);if(_0x41dbd1===_0x5d0284)break;else _0x206c53['push'](_0x206c53['shift']());}catch(_0x1f02e2){_0x206c53['push'](_0x206c53['shift']());}}}(_0x16be,0x53701),function(_0x204d51,_0x43847e){const _0x4a5d1e=_0xf5b5;typeof exports==_0x4a5d1e(0x211)&&typeof module<'u'?_0x43847e(require('@univerjs-pro/mcp'),require('@univerjs/core/facade'),require('@univerjs/core')):typeof define==_0x4a5d1e(0x20f)&&define[_0x4a5d1e(0x1f3)]?define(['@univerjs-pro/mcp','@univerjs/core/facade',_0x4a5d1e(0x217)],_0x43847e):(_0x204d51=typeof globalThis<'u'?globalThis:_0x204d51||self,_0x43847e(_0x204d51[_0x4a5d1e(0x210)],_0x204d51[_0x4a5d1e(0x204)],_0x204d51['UniverCore']));}(this,function(_0x172aae,_0x28e7da,_0x3e67bf){'use strict';const _0x260133=_0xf5b5;class _0x135d10{get['McpConnectionStatusChanged'](){const _0x18892c=_0xf5b5;return _0x172aae['MCPEventId'][_0x18892c(0x21f)];}get['McpToolCallReceived'](){const _0x276f68=_0xf5b5;return _0x172aae[_0x276f68(0x1fa)][_0x276f68(0x21c)];}get[_0x260133(0x1f9)](){const _0x7c2e70=_0x260133;return _0x172aae[_0x7c2e70(0x1fa)]['McpToolCallExecuted'];}get[_0x260133(0x1fb)](){const _0x1a3b57=_0x260133;return _0x172aae[_0x1a3b57(0x1fa)]['McpToolCallFailed'];}}_0x28e7da[_0x260133(0x214)][_0x260133(0x1f5)](_0x135d10);class _0x2ca230 extends _0x28e7da[_0x260133(0x218)]{['_initialize'](_0x24bee6){const _0x4e13c1=_0x260133;this[_0x4e13c1(0x20a)](_0x24bee6);}[_0x260133(0x20a)](_0x27329e){const _0x2f65ef=_0x260133,_0x427430=_0x27329e[_0x2f65ef(0x20d)](_0x172aae[_0x2f65ef(0x208)]);this[_0x2f65ef(0x1f6)](this['Event'][_0x2f65ef(0x21f)],()=>_0x3e67bf[_0x2f65ef(0x1f7)](_0x427430[_0x2f65ef(0x21d)][_0x2f65ef(0x21b)](_0x518355=>{const _0x5798c5=_0x2f65ef;_0x518355['type']===_0x172aae['MCPEventId'][_0x5798c5(0x21f)]&&this[_0x5798c5(0x1fe)](this[_0x5798c5(0x220)]['McpConnectionStatusChanged'],_0x518355[_0x5798c5(0x1f4)]);}))),this['registerEventHandler'](this['Event']['McpToolCallReceived'],()=>_0x3e67bf[_0x2f65ef(0x1f7)](_0x427430['event$'][_0x2f65ef(0x21b)](_0x52ece9=>{const _0x33c7f0=_0x2f65ef;_0x52ece9[_0x33c7f0(0x219)]===_0x172aae[_0x33c7f0(0x1fa)][_0x33c7f0(0x21c)]&&this['fireEvent'](this[_0x33c7f0(0x220)][_0x33c7f0(0x21c)],_0x52ece9[_0x33c7f0(0x1f4)]);}))),this[_0x2f65ef(0x1f6)](this[_0x2f65ef(0x220)][_0x2f65ef(0x1f9)],()=>_0x3e67bf[_0x2f65ef(0x1f7)](_0x427430[_0x2f65ef(0x21d)][_0x2f65ef(0x21b)](_0x8b5824=>{const _0x3604d2=_0x2f65ef;_0x8b5824['type']===_0x172aae[_0x3604d2(0x1fa)][_0x3604d2(0x1f9)]&&this[_0x3604d2(0x1fe)](this['Event'][_0x3604d2(0x1f9)],_0x8b5824[_0x3604d2(0x1f4)]);}))),this[_0x2f65ef(0x1f6)](this[_0x2f65ef(0x220)]['McpToolCallFailed'],()=>_0x3e67bf[_0x2f65ef(0x1f7)](_0x427430['event$']['subscribe'](_0x450c37=>{const _0x3ed1e5=_0x2f65ef;_0x450c37['type']===_0x172aae[_0x3ed1e5(0x1fa)][_0x3ed1e5(0x1fb)]&&this[_0x3ed1e5(0x1fe)](this[_0x3ed1e5(0x220)][_0x3ed1e5(0x1fb)],_0x450c37[_0x3ed1e5(0x1f4)]);})));}[_0x260133(0x222)](_0x4a0bb4,_0x48d0fa){const _0xab1547=_0x260133;return this[_0xab1547(0x20e)][_0xab1547(0x20d)](_0x172aae[_0xab1547(0x1f8)])[_0xab1547(0x221)](_0x4a0bb4,_0x48d0fa);}[_0x260133(0x203)](){const _0x238eda=_0x260133;return this[_0x238eda(0x20e)][_0x238eda(0x20d)](_0x172aae['IMCPToolRegistry'])[_0x238eda(0x202)]();}[_0x260133(0x212)](_0x570a25,_0x44bb4b){const _0x56bc71=_0x260133;return this[_0x56bc71(0x20e)][_0x56bc71(0x20d)](_0x172aae[_0x56bc71(0x1f8)])[_0x56bc71(0x1fc)](_0x570a25,_0x44bb4b);}['getMCPConnectionStatus'](){const _0x17d77a=_0x260133;return this[_0x17d77a(0x20e)][_0x17d77a(0x20d)](_0x172aae[_0x17d77a(0x206)])['getConnectionStatus']();}[_0x260133(0x200)](){const _0x579ec8=_0x260133;this['_injector'][_0x579ec8(0x20d)](_0x172aae[_0x579ec8(0x206)])[_0x579ec8(0x209)]();}[_0x260133(0x21e)](){const _0x222b3a=_0x260133;this[_0x222b3a(0x20e)][_0x222b3a(0x20d)](_0x172aae[_0x222b3a(0x206)])[_0x222b3a(0x1f2)]();}}_0x28e7da[_0x260133(0x218)]['extend'](_0x2ca230);}));
|