@elizaos/plugin-mcp 1.7.0 → 1.8.0
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/dist/actions/dynamic-tool-actions.d.ts +16 -0
- package/dist/actions/dynamic-tool-actions.d.ts.map +1 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/schema-cache.d.ts +34 -0
- package/dist/cache/schema-cache.d.ts.map +1 -0
- package/dist/cjs/index.cjs +1359 -1954
- package/dist/cjs/index.js.map +24 -25
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1401 -2012
- package/dist/index.js.map +24 -25
- package/dist/provider.d.ts.map +1 -1
- package/dist/service.d.ts +26 -28
- package/dist/service.d.ts.map +1 -1
- package/dist/tool-compatibility/base.d.ts +25 -0
- package/dist/tool-compatibility/base.d.ts.map +1 -0
- package/dist/tool-compatibility/index.d.ts +7 -52
- package/dist/tool-compatibility/index.d.ts.map +1 -1
- package/dist/tool-compatibility/providers/anthropic.d.ts +2 -3
- package/dist/tool-compatibility/providers/anthropic.d.ts.map +1 -1
- package/dist/tool-compatibility/providers/google.d.ts +2 -3
- package/dist/tool-compatibility/providers/google.d.ts.map +1 -1
- package/dist/tool-compatibility/providers/openai.d.ts +2 -3
- package/dist/tool-compatibility/providers/openai.d.ts.map +1 -1
- package/dist/types.d.ts +52 -85
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/action-naming.d.ts +9 -0
- package/dist/utils/action-naming.d.ts.map +1 -0
- package/dist/utils/error.d.ts +1 -11
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/mcp.d.ts.map +1 -1
- package/dist/utils/processing.d.ts +5 -11
- package/dist/utils/processing.d.ts.map +1 -1
- package/dist/utils/schema-converter.d.ts +9 -0
- package/dist/utils/schema-converter.d.ts.map +1 -0
- package/dist/utils/validation.d.ts +1 -24
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/wrapper.d.ts +6 -15
- package/dist/utils/wrapper.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/actions/callToolAction.d.ts +0 -3
- package/dist/actions/callToolAction.d.ts.map +0 -1
- package/dist/templates/feedbackTemplate.d.ts +0 -2
- package/dist/templates/feedbackTemplate.d.ts.map +0 -1
- package/dist/templates/toolReasoningTemplate.d.ts +0 -2
- package/dist/templates/toolReasoningTemplate.d.ts.map +0 -1
- package/dist/templates/toolSelectionTemplate.d.ts +0 -3
- package/dist/templates/toolSelectionTemplate.d.ts.map +0 -1
- package/dist/utils/handler.d.ts +0 -3
- package/dist/utils/handler.d.ts.map +0 -1
- package/dist/utils/schemas.d.ts +0 -69
- package/dist/utils/schemas.d.ts.map +0 -1
- package/dist/utils/selection.d.ts +0 -38
- package/dist/utils/selection.d.ts.map +0 -1
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,QAAQ,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,QAAQ,EAAS,MAAM,eAAe,CAAC;AAM5E,eAAO,MAAM,QAAQ,EAAE,QAUtB,CAAC"}
|
package/dist/service.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type IAgentRuntime, Service } from
|
|
2
|
-
import type { CallToolResult } from
|
|
3
|
-
import { type
|
|
1
|
+
import { type IAgentRuntime, Service } from "@elizaos/core";
|
|
2
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { type McpToolAction } from "./actions/dynamic-tool-actions";
|
|
4
|
+
import { type McpProvider, type McpServer } from "./types";
|
|
4
5
|
export declare class McpService extends Service {
|
|
5
6
|
static serviceType: string;
|
|
6
7
|
capabilityDescription: string;
|
|
@@ -9,38 +10,35 @@ export declare class McpService extends Service {
|
|
|
9
10
|
private mcpProvider;
|
|
10
11
|
private pingConfig;
|
|
11
12
|
private toolCompatibility;
|
|
12
|
-
private
|
|
13
|
-
private
|
|
13
|
+
private initPromise;
|
|
14
|
+
private registeredActions;
|
|
15
|
+
private schemaCache;
|
|
16
|
+
private lazyConnections;
|
|
14
17
|
constructor(runtime: IAgentRuntime);
|
|
15
18
|
static start(runtime: IAgentRuntime): Promise<McpService>;
|
|
16
|
-
/**
|
|
17
|
-
* Wait for initialization to complete (useful if service was created without awaiting start)
|
|
18
|
-
*/
|
|
19
19
|
waitForInitialization(): Promise<void>;
|
|
20
20
|
stop(): Promise<void>;
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
|
|
21
|
+
private init;
|
|
22
|
+
private getSettings;
|
|
23
|
+
private connect;
|
|
24
|
+
disconnect(name: string): Promise<void>;
|
|
25
|
+
private createStdioTransport;
|
|
26
|
+
private createHttpTransport;
|
|
25
27
|
private setupTransportHandlers;
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private buildHttpClientTransport;
|
|
34
|
-
private appendErrorMessage;
|
|
35
|
-
private fetchToolsList;
|
|
36
|
-
private fetchResourcesList;
|
|
37
|
-
private fetchResourceTemplatesList;
|
|
28
|
+
private startPingMonitor;
|
|
29
|
+
private handleDisconnect;
|
|
30
|
+
private fetchTools;
|
|
31
|
+
private fetchResources;
|
|
32
|
+
private fetchResourceTemplates;
|
|
33
|
+
private registerToolsAsActions;
|
|
34
|
+
private unregisterToolsAsActions;
|
|
38
35
|
getServers(): McpServer[];
|
|
39
36
|
getProviderData(): McpProvider;
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
getRegisteredActions(): McpToolAction[];
|
|
38
|
+
isLazyConnection(serverName: string): boolean;
|
|
39
|
+
ensureConnected(serverName: string): Promise<void>;
|
|
40
|
+
callTool(serverName: string, toolName: string, args?: Record<string, unknown>): Promise<CallToolResult>;
|
|
41
|
+
readResource(serverName: string, uri: string): Promise<any>;
|
|
42
42
|
restartConnection(serverName: string): Promise<void>;
|
|
43
|
-
private initializeToolCompatibility;
|
|
44
|
-
applyToolCompatibility(toolSchema: any): any;
|
|
45
43
|
}
|
|
46
44
|
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,aAAa,EAAE,OAAO,EAAU,MAAM,eAAe,CAAC;AAKjF,OAAO,KAAK,EAAE,cAAc,EAAoC,MAAM,oCAAoC,CAAC;AAE3G,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1F,OAAO,EAQL,KAAK,WAAW,EAChB,KAAK,SAAS,EAOf,MAAM,SAAS,CAAC;AAMjB,qBAAa,UAAW,SAAQ,OAAO;IACrC,MAAM,CAAC,WAAW,SAAoB;IACtC,qBAAqB,SAAoD;IAEzE,OAAO,CAAC,WAAW,CAAoC;IACvD,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,OAAO,CAAC,WAAW,CAAkF;IACrG,OAAO,CAAC,UAAU,CAAmC;IACrD,OAAO,CAAC,iBAAiB,CAAqC;IAC9D,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,iBAAiB,CAAoC;IAC7D,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,eAAe,CAAsC;gBAEjD,OAAO,EAAE,aAAa;WAKrB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAMzD,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAQb,IAAI;IAuDpB,OAAO,CAAC,WAAW;YASH,OAAO;IA+Cf,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7C,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,sBAAsB;IAqB9B,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,gBAAgB;YA6BV,UAAU;YAqBV,cAAc;YASd,sBAAsB;IAWpC,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,wBAAwB;IAehC,UAAU,IAAI,SAAS,EAAE;IAMzB,eAAe,IAAI,WAAW;IAI9B,oBAAoB,IAAI,aAAa,EAAE;IAIvC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIvC,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBlD,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAavG,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAQ3D,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO3D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
2
|
+
export type ModelProvider = 'openai' | 'anthropic' | 'google' | 'openrouter' | 'unknown';
|
|
3
|
+
export interface ModelInfo {
|
|
4
|
+
provider: ModelProvider;
|
|
5
|
+
modelId: string;
|
|
6
|
+
supportsStructuredOutputs?: boolean;
|
|
7
|
+
isReasoningModel?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class McpToolCompatibility {
|
|
10
|
+
protected modelInfo: ModelInfo;
|
|
11
|
+
constructor(modelInfo: ModelInfo);
|
|
12
|
+
abstract shouldApply(): boolean;
|
|
13
|
+
transformToolSchema(toolSchema: JSONSchema7): JSONSchema7;
|
|
14
|
+
protected processSchema(schema: JSONSchema7): JSONSchema7;
|
|
15
|
+
protected processTypeSchema(schema: JSONSchema7, unsupported: string[]): JSONSchema7;
|
|
16
|
+
protected processArraySchema(schema: JSONSchema7): JSONSchema7;
|
|
17
|
+
protected processObjectSchema(schema: JSONSchema7): JSONSchema7;
|
|
18
|
+
protected processGenericSchema(schema: JSONSchema7): JSONSchema7;
|
|
19
|
+
protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string;
|
|
20
|
+
protected abstract getUnsupportedStringProperties(): string[];
|
|
21
|
+
protected abstract getUnsupportedNumberProperties(): string[];
|
|
22
|
+
protected abstract getUnsupportedArrayProperties(): string[];
|
|
23
|
+
protected abstract getUnsupportedObjectProperties(): string[];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/tool-compatibility/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAEzF,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,8BAAsB,oBAAoB;IACxC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;gBAEnB,SAAS,EAAE,SAAS;IAIhC,QAAQ,CAAC,WAAW,IAAI,OAAO;IAE/B,mBAAmB,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW;IAIzD,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAkBzD,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,WAAW;IAwBpF,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAU9D,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAe/D,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAchE,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;IAKtG,SAAS,CAAC,QAAQ,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAC7D,SAAS,CAAC,QAAQ,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAC7D,SAAS,CAAC,QAAQ,CAAC,6BAA6B,IAAI,MAAM,EAAE;IAC5D,SAAS,CAAC,QAAQ,CAAC,8BAA8B,IAAI,MAAM,EAAE;CAC9D"}
|
|
@@ -1,54 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
format?: string;
|
|
7
|
-
enum?: string[];
|
|
8
|
-
}
|
|
9
|
-
export interface NumberConstraints {
|
|
10
|
-
minimum?: number;
|
|
11
|
-
maximum?: number;
|
|
12
|
-
exclusiveMinimum?: number;
|
|
13
|
-
exclusiveMaximum?: number;
|
|
14
|
-
multipleOf?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface ArrayConstraints {
|
|
17
|
-
minItems?: number;
|
|
18
|
-
maxItems?: number;
|
|
19
|
-
uniqueItems?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface ObjectConstraints {
|
|
22
|
-
minProperties?: number;
|
|
23
|
-
maxProperties?: number;
|
|
24
|
-
additionalProperties?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export type SchemaConstraints = StringConstraints | NumberConstraints | ArrayConstraints | ObjectConstraints;
|
|
27
|
-
export type ModelProvider = 'openai' | 'anthropic' | 'google' | 'openrouter' | 'unknown';
|
|
28
|
-
export interface ModelInfo {
|
|
29
|
-
provider: ModelProvider;
|
|
30
|
-
modelId: string;
|
|
31
|
-
supportsStructuredOutputs?: boolean;
|
|
32
|
-
isReasoningModel?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export declare abstract class McpToolCompatibility {
|
|
35
|
-
protected modelInfo: ModelInfo;
|
|
36
|
-
constructor(modelInfo: ModelInfo);
|
|
37
|
-
abstract shouldApply(): boolean;
|
|
38
|
-
transformToolSchema(toolSchema: JSONSchema7): JSONSchema7;
|
|
39
|
-
protected processSchema(schema: JSONSchema7): JSONSchema7;
|
|
40
|
-
protected processStringSchema(schema: JSONSchema7): JSONSchema7;
|
|
41
|
-
protected processNumberSchema(schema: JSONSchema7): JSONSchema7;
|
|
42
|
-
protected processArraySchema(schema: JSONSchema7): JSONSchema7;
|
|
43
|
-
protected processObjectSchema(schema: JSONSchema7): JSONSchema7;
|
|
44
|
-
protected processGenericSchema(schema: JSONSchema7): JSONSchema7;
|
|
45
|
-
protected mergeDescription(originalDescription: string | undefined, constraints: SchemaConstraints): string;
|
|
46
|
-
protected abstract getUnsupportedStringProperties(): string[];
|
|
47
|
-
protected abstract getUnsupportedNumberProperties(): string[];
|
|
48
|
-
protected abstract getUnsupportedArrayProperties(): string[];
|
|
49
|
-
protected abstract getUnsupportedObjectProperties(): string[];
|
|
50
|
-
}
|
|
1
|
+
export { McpToolCompatibility, type ModelInfo, type ModelProvider } from './base.js';
|
|
2
|
+
import type { ModelInfo } from './base.js';
|
|
3
|
+
import { OpenAIMcpCompatibility, OpenAIReasoningMcpCompatibility } from './providers/openai.js';
|
|
4
|
+
import { AnthropicMcpCompatibility } from './providers/anthropic.js';
|
|
5
|
+
import { GoogleMcpCompatibility } from './providers/google.js';
|
|
51
6
|
export declare function detectModelProvider(runtime: any): ModelInfo;
|
|
52
|
-
export declare function
|
|
53
|
-
export declare
|
|
7
|
+
export declare function createMcpToolCompatibilitySync(runtime: any): OpenAIMcpCompatibility | OpenAIReasoningMcpCompatibility | AnthropicMcpCompatibility | GoogleMcpCompatibility | null;
|
|
8
|
+
export declare const createMcpToolCompatibility: typeof createMcpToolCompatibilitySync;
|
|
54
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-compatibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-compatibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAErF,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,GAAG,GAAG,SAAS,CAuB3D;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,GAAG,wHAa1D;AAGD,eAAO,MAAM,0BAA0B,uCAAiC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpToolCompatibility, type ModelInfo } from '../
|
|
1
|
+
import { McpToolCompatibility, type ModelInfo } from '../base.js';
|
|
2
2
|
export declare class AnthropicMcpCompatibility extends McpToolCompatibility {
|
|
3
3
|
constructor(modelInfo: ModelInfo);
|
|
4
4
|
shouldApply(): boolean;
|
|
@@ -6,7 +6,6 @@ export declare class AnthropicMcpCompatibility extends McpToolCompatibility {
|
|
|
6
6
|
protected getUnsupportedNumberProperties(): string[];
|
|
7
7
|
protected getUnsupportedArrayProperties(): string[];
|
|
8
8
|
protected getUnsupportedObjectProperties(): string[];
|
|
9
|
-
protected mergeDescription(
|
|
10
|
-
private formatConstraintsForAnthropic;
|
|
9
|
+
protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/tool-compatibility/providers/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/tool-compatibility/providers/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElE,qBAAa,yBAA0B,SAAQ,oBAAoB;gBACrD,SAAS,EAAE,SAAS;IAIhC,WAAW,IAAI,OAAO;IAItB,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IACpD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IACpD,SAAS,CAAC,6BAA6B,IAAI,MAAM,EAAE;IACnD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAEpD,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CASvG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpToolCompatibility, type ModelInfo } from '../
|
|
1
|
+
import { McpToolCompatibility, type ModelInfo } from '../base.js';
|
|
2
2
|
export declare class GoogleMcpCompatibility extends McpToolCompatibility {
|
|
3
3
|
constructor(modelInfo: ModelInfo);
|
|
4
4
|
shouldApply(): boolean;
|
|
@@ -6,7 +6,6 @@ export declare class GoogleMcpCompatibility extends McpToolCompatibility {
|
|
|
6
6
|
protected getUnsupportedNumberProperties(): string[];
|
|
7
7
|
protected getUnsupportedArrayProperties(): string[];
|
|
8
8
|
protected getUnsupportedObjectProperties(): string[];
|
|
9
|
-
protected mergeDescription(
|
|
10
|
-
private formatConstraintsForGoogle;
|
|
9
|
+
protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=google.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../src/tool-compatibility/providers/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../src/tool-compatibility/providers/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElE,qBAAa,sBAAuB,SAAQ,oBAAoB;gBAClD,SAAS,EAAE,SAAS;IAIhC,WAAW,IAAI,OAAO;IAItB,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAIpD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAIpD,SAAS,CAAC,6BAA6B,IAAI,MAAM,EAAE;IAInD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAIpD,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAiBvG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpToolCompatibility, type ModelInfo } from '../
|
|
1
|
+
import { McpToolCompatibility, type ModelInfo } from '../base.js';
|
|
2
2
|
export declare class OpenAIMcpCompatibility extends McpToolCompatibility {
|
|
3
3
|
constructor(modelInfo: ModelInfo);
|
|
4
4
|
shouldApply(): boolean;
|
|
@@ -14,7 +14,6 @@ export declare class OpenAIReasoningMcpCompatibility extends McpToolCompatibilit
|
|
|
14
14
|
protected getUnsupportedNumberProperties(): string[];
|
|
15
15
|
protected getUnsupportedArrayProperties(): string[];
|
|
16
16
|
protected getUnsupportedObjectProperties(): string[];
|
|
17
|
-
protected mergeDescription(
|
|
18
|
-
private formatConstraintsForReasoningModel;
|
|
17
|
+
protected mergeDescription(original: string | undefined, constraints: Record<string, unknown>): string;
|
|
19
18
|
}
|
|
20
19
|
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/tool-compatibility/providers/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/tool-compatibility/providers/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElE,qBAAa,sBAAuB,SAAQ,oBAAoB;gBAClD,SAAS,EAAE,SAAS;IAIhC,WAAW,IAAI,OAAO;IAKtB,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAMpD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAMpD,SAAS,CAAC,6BAA6B,IAAI,MAAM,EAAE;IAInD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;CAGrD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;gBAC3D,SAAS,EAAE,SAAS;IAIhC,WAAW,IAAI,OAAO;IAItB,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAIpD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAIpD,SAAS,CAAC,6BAA6B,IAAI,MAAM,EAAE;IAInD,SAAS,CAAC,8BAA8B,IAAI,MAAM,EAAE;IAIpD,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAgBvG"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import type { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
3
3
|
import type { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Resource, ResourceTemplate, Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
export declare const MCP_SERVICE_NAME = "mcp";
|
|
6
6
|
export declare const DEFAULT_MCP_TIMEOUT_SECONDS = 60000;
|
|
7
|
-
export declare const MIN_MCP_TIMEOUT_SECONDS = 1;
|
|
8
7
|
export declare const DEFAULT_MAX_RETRIES = 2;
|
|
8
|
+
export declare const MAX_RECONNECT_ATTEMPTS = 5;
|
|
9
|
+
export declare const BACKOFF_MULTIPLIER = 2;
|
|
10
|
+
export declare const INITIAL_RETRY_DELAY = 2000;
|
|
11
|
+
export declare const DEFAULT_PING_CONFIG: PingConfig;
|
|
12
|
+
export interface StdioMcpServerConfig {
|
|
13
|
+
type: "stdio";
|
|
14
|
+
command?: string;
|
|
15
|
+
args?: string[];
|
|
16
|
+
env?: Record<string, string>;
|
|
17
|
+
cwd?: string;
|
|
18
|
+
timeoutInMillis?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface HttpMcpServerConfig {
|
|
21
|
+
type: "http" | "streamable-http" | "sse";
|
|
22
|
+
url: string;
|
|
23
|
+
timeout?: number;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
export type McpServerConfig = StdioMcpServerConfig | HttpMcpServerConfig;
|
|
27
|
+
export interface McpSettings {
|
|
28
|
+
servers: Record<string, McpServerConfig>;
|
|
29
|
+
maxRetries?: number;
|
|
30
|
+
}
|
|
9
31
|
export interface PingConfig {
|
|
10
32
|
enabled: boolean;
|
|
11
33
|
intervalMs: number;
|
|
@@ -21,24 +43,6 @@ export interface ConnectionState {
|
|
|
21
43
|
lastError?: Error;
|
|
22
44
|
consecutivePingFailures: number;
|
|
23
45
|
}
|
|
24
|
-
export type StdioMcpServerConfig = {
|
|
25
|
-
type: "stdio";
|
|
26
|
-
command?: string;
|
|
27
|
-
args?: string[];
|
|
28
|
-
env?: Record<string, string>;
|
|
29
|
-
cwd?: string;
|
|
30
|
-
timeoutInMillis?: number;
|
|
31
|
-
};
|
|
32
|
-
export type HttpMcpServerConfig = {
|
|
33
|
-
type: "http" | "streamable-http" | "sse";
|
|
34
|
-
url: string;
|
|
35
|
-
timeout?: number;
|
|
36
|
-
};
|
|
37
|
-
export type McpServerConfig = StdioMcpServerConfig | HttpMcpServerConfig;
|
|
38
|
-
export type McpSettings = {
|
|
39
|
-
servers: Record<string, McpServerConfig>;
|
|
40
|
-
maxRetries?: number;
|
|
41
|
-
};
|
|
42
46
|
export type McpServerStatus = "connecting" | "connected" | "disconnected";
|
|
43
47
|
export interface McpServer {
|
|
44
48
|
name: string;
|
|
@@ -55,29 +59,9 @@ export interface McpConnection {
|
|
|
55
59
|
client: Client;
|
|
56
60
|
transport: StdioClientTransport | SSEClientTransport;
|
|
57
61
|
}
|
|
58
|
-
export interface McpToolResult {
|
|
59
|
-
content: Array<TextContent | ImageContent | EmbeddedResource>;
|
|
60
|
-
isError?: boolean;
|
|
61
|
-
}
|
|
62
|
-
export interface McpToolCallResponse {
|
|
63
|
-
content: Array<TextContent | ImageContent | EmbeddedResource>;
|
|
64
|
-
isError?: boolean;
|
|
65
|
-
}
|
|
66
|
-
export interface McpResourceResponse {
|
|
67
|
-
contents: Array<{
|
|
68
|
-
uri: string;
|
|
69
|
-
mimeType?: string;
|
|
70
|
-
text?: string;
|
|
71
|
-
blob?: string;
|
|
72
|
-
}>;
|
|
73
|
-
}
|
|
74
62
|
export interface McpToolInfo {
|
|
75
63
|
description: string;
|
|
76
|
-
inputSchema?:
|
|
77
|
-
properties?: Record<string, unknown>;
|
|
78
|
-
required?: string[];
|
|
79
|
-
[key: string]: unknown;
|
|
80
|
-
};
|
|
64
|
+
inputSchema?: Record<string, unknown>;
|
|
81
65
|
}
|
|
82
66
|
export interface McpResourceInfo {
|
|
83
67
|
name: string;
|
|
@@ -89,7 +73,10 @@ export interface McpServerInfo {
|
|
|
89
73
|
tools: Record<string, McpToolInfo>;
|
|
90
74
|
resources: Record<string, McpResourceInfo>;
|
|
91
75
|
}
|
|
92
|
-
export
|
|
76
|
+
export interface McpProviderData {
|
|
77
|
+
[serverName: string]: McpServerInfo;
|
|
78
|
+
}
|
|
79
|
+
export interface McpProvider {
|
|
93
80
|
values: {
|
|
94
81
|
mcp: McpProviderData;
|
|
95
82
|
mcpText?: string;
|
|
@@ -98,34 +85,30 @@ export type McpProvider = {
|
|
|
98
85
|
mcp: McpProviderData;
|
|
99
86
|
};
|
|
100
87
|
text: string;
|
|
101
|
-
};
|
|
102
|
-
export interface McpProviderData {
|
|
103
|
-
[serverName: string]: McpServerInfo;
|
|
104
88
|
}
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
89
|
+
export interface McpSchemaCacheConfig {
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
redisUrl?: string;
|
|
92
|
+
redisToken?: string;
|
|
93
|
+
ttlSeconds: number;
|
|
94
|
+
}
|
|
95
|
+
export interface CachedToolSchema {
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
inputSchema?: Tool["inputSchema"];
|
|
99
|
+
}
|
|
100
|
+
export interface CachedServerSchema {
|
|
101
|
+
serverName: string;
|
|
102
|
+
tools: CachedToolSchema[];
|
|
103
|
+
cachedAt: number;
|
|
104
|
+
configHash: string;
|
|
105
|
+
}
|
|
106
|
+
export type ValidationResult<T> = {
|
|
107
|
+
success: true;
|
|
108
|
+
data: T;
|
|
109
|
+
} | {
|
|
110
|
+
success: false;
|
|
111
|
+
error: string;
|
|
129
112
|
};
|
|
130
113
|
export declare const ResourceSelectionSchema: {
|
|
131
114
|
type: string;
|
|
@@ -134,12 +117,10 @@ export declare const ResourceSelectionSchema: {
|
|
|
134
117
|
serverName: {
|
|
135
118
|
type: string;
|
|
136
119
|
minLength: number;
|
|
137
|
-
errorMessage: string;
|
|
138
120
|
};
|
|
139
121
|
uri: {
|
|
140
122
|
type: string;
|
|
141
123
|
minLength: number;
|
|
142
|
-
errorMessage: string;
|
|
143
124
|
};
|
|
144
125
|
reasoning: {
|
|
145
126
|
type: string;
|
|
@@ -149,18 +130,4 @@ export declare const ResourceSelectionSchema: {
|
|
|
149
130
|
};
|
|
150
131
|
};
|
|
151
132
|
};
|
|
152
|
-
export declare const DEFAULT_PING_CONFIG: PingConfig;
|
|
153
|
-
export declare const MAX_RECONNECT_ATTEMPTS = 5;
|
|
154
|
-
export declare const BACKOFF_MULTIPLIER = 2;
|
|
155
|
-
export declare const INITIAL_RETRY_DELAY = 2000;
|
|
156
|
-
interface SuccessResult<T> {
|
|
157
|
-
success: true;
|
|
158
|
-
data: T;
|
|
159
|
-
}
|
|
160
|
-
interface ErrorResult {
|
|
161
|
-
success: false;
|
|
162
|
-
error: string;
|
|
163
|
-
}
|
|
164
|
-
export type ValidationResult<T> = SuccessResult<T> | ErrorResult;
|
|
165
|
-
export {};
|
|
166
133
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function toActionName(serverName: string, toolName: string): string;
|
|
2
|
+
export declare function generateSimiles(serverName: string, toolName: string): string[];
|
|
3
|
+
export declare function parseActionName(actionName: string): {
|
|
4
|
+
serverName: string;
|
|
5
|
+
toolName: string;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare function actionNamesCollide(name1: string, name2: string): boolean;
|
|
8
|
+
export declare function makeUniqueActionName(serverName: string, toolName: string, existing: Set<string>): string;
|
|
9
|
+
//# sourceMappingURL=action-naming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-naming.d.ts","sourceRoot":"","sources":["../../src/utils/action-naming.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASzE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB9E;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASnG;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAOxG"}
|
package/dist/utils/error.d.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import { type HandlerCallback, type IAgentRuntime, type Memory, type ActionResult } from '@elizaos/core';
|
|
2
|
-
import type { State } from '@elizaos/core';
|
|
1
|
+
import { type HandlerCallback, type IAgentRuntime, type Memory, type ActionResult, type State } from '@elizaos/core';
|
|
3
2
|
import type { McpProvider } from '../types';
|
|
4
3
|
export declare function handleMcpError(state: State, mcpProvider: McpProvider, error: unknown, runtime: IAgentRuntime, message: Memory, type: 'tool' | 'resource', callback?: HandlerCallback): Promise<ActionResult>;
|
|
5
|
-
export declare class McpError extends Error {
|
|
6
|
-
readonly code: string;
|
|
7
|
-
constructor(message: string, code?: string);
|
|
8
|
-
static connectionError(serverName: string, details?: string): McpError;
|
|
9
|
-
static toolNotFound(toolName: string, serverName: string): McpError;
|
|
10
|
-
static resourceNotFound(uri: string, serverName: string): McpError;
|
|
11
|
-
static validationError(details: string): McpError;
|
|
12
|
-
static serverError(serverName: string, details?: string): McpError;
|
|
13
|
-
}
|
|
14
4
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,MAAM,EAIX,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,MAAM,EAIX,KAAK,YAAY,EACjB,KAAK,KAAK,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAsB,cAAc,CAClC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,UAAU,EACzB,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,YAAY,CAAC,CA+BvB"}
|
package/dist/utils/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAsCA,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CA0C7C;AAOD,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,OAAO,EAC5C,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAqBhE"}
|
package/dist/utils/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAoC,SAAS,EAAe,MAAM,UAAU,CAAC;AAItG,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,WAAW,CAqCtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type HandlerCallback, type IAgentRuntime, type Media, type Memory } from
|
|
2
|
-
|
|
1
|
+
import { type HandlerCallback, type IAgentRuntime, type Media, type Memory } from "@elizaos/core";
|
|
2
|
+
/** Process resource result from MCP */
|
|
3
3
|
export declare function processResourceResult(result: {
|
|
4
4
|
contents: Array<{
|
|
5
5
|
uri: string;
|
|
@@ -11,6 +11,7 @@ export declare function processResourceResult(result: {
|
|
|
11
11
|
resourceContent: string;
|
|
12
12
|
resourceMeta: string;
|
|
13
13
|
};
|
|
14
|
+
/** Process tool result from MCP - used by dynamic-tool-actions */
|
|
14
15
|
export declare function processToolResult(result: {
|
|
15
16
|
content: Array<{
|
|
16
17
|
type: string;
|
|
@@ -29,15 +30,8 @@ export declare function processToolResult(result: {
|
|
|
29
30
|
hasAttachments: boolean;
|
|
30
31
|
attachments: Media[];
|
|
31
32
|
};
|
|
33
|
+
/** Handle resource analysis for readResourceAction */
|
|
32
34
|
export declare function handleResourceAnalysis(runtime: IAgentRuntime, message: Memory, uri: string, serverName: string, resourceContent: string, resourceMeta: string, callback?: HandlerCallback): Promise<void>;
|
|
33
|
-
|
|
34
|
-
values: {
|
|
35
|
-
mcp: unknown;
|
|
36
|
-
};
|
|
37
|
-
data: {
|
|
38
|
-
mcp: unknown;
|
|
39
|
-
};
|
|
40
|
-
text: string;
|
|
41
|
-
}, callback?: HandlerCallback): Promise<Memory>;
|
|
35
|
+
/** Send initial response for readResourceAction */
|
|
42
36
|
export declare function sendInitialResponse(callback?: HandlerCallback): Promise<void>;
|
|
43
37
|
//# sourceMappingURL=processing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processing.d.ts","sourceRoot":"","sources":["../../src/utils/processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"processing.d.ts","sourceRoot":"","sources":["../../src/utils/processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,MAAM,EAGZ,MAAM,eAAe,CAAC;AAcvB,uCAAuC;AACvC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,EAC7F,GAAG,EAAE,MAAM,GACV;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAWnD;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE;IACN,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC1D,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,EACD,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,MAAM,GACtB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,KAAK,EAAE,CAAA;CAAE,CA2BvE;AAED,sDAAsD;AACtD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED,mDAAmD;AACnD,wBAAsB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAQnF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export interface ActionParameter {
|
|
3
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
4
|
+
description: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function convertJsonSchemaToActionParams(schema?: Tool["inputSchema"]): Record<string, ActionParameter> | undefined;
|
|
8
|
+
export declare function validateParamsAgainstSchema(params: Record<string, unknown>, schema?: Tool["inputSchema"]): string[];
|
|
9
|
+
//# sourceMappingURL=schema-converter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter.d.ts","sourceRoot":"","sources":["../../src/utils/schema-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqDD,wBAAgB,+BAA+B,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,CAgBzH;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,EAAE,CA+BnH"}
|