@elizaos/plugin-mcp 1.7.1 → 1.8.1
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 +8372 -1581
- package/dist/cjs/index.js.map +95 -24
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8408 -1616
- package/dist/index.js.map +95 -24
- package/dist/provider.d.ts.map +1 -1
- package/dist/service.d.ts +23 -21
- 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 +53 -88
- 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/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 +6 -4
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAiD,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGhG,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,OAAO,GACjB,gBAAgB,CAAC,iBAAiB,CAAC,CAErC;AAED,wBAAgB,qCAAqC,CACnD,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,KAAK,EACpB,WAAW,EAAE,MAAM,GAClB,MAAM,CA6BR"}
|
package/dist/utils/wrapper.d.ts
CHANGED
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import { type HandlerCallback, type Memory, type IAgentRuntime, type State } from
|
|
2
|
-
import { type ValidationResult } from
|
|
3
|
-
export type Input = string | object;
|
|
4
|
-
type CreateFeedbackPromptFnOptions = (originalResponse: Input, errorMessage: string, composedState: State, userMessage: string) => string;
|
|
1
|
+
import { type HandlerCallback, type Memory, type IAgentRuntime, type State } from "@elizaos/core";
|
|
2
|
+
import { type ValidationResult } from "../types";
|
|
5
3
|
export interface WithModelRetryOptions<T> {
|
|
6
4
|
runtime: IAgentRuntime;
|
|
7
5
|
message: Memory;
|
|
8
6
|
state: State;
|
|
9
|
-
input:
|
|
10
|
-
validationFn: (data:
|
|
11
|
-
createFeedbackPromptFn:
|
|
7
|
+
input: string | object;
|
|
8
|
+
validationFn: (data: unknown) => ValidationResult<T>;
|
|
9
|
+
createFeedbackPromptFn: (original: string | object, error: string, state: State, userMsg: string) => string;
|
|
12
10
|
callback?: HandlerCallback;
|
|
13
11
|
failureMsg?: string;
|
|
14
12
|
retryCount?: number;
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
|
-
* Retries
|
|
18
|
-
* @param input - The initial input to be parsed
|
|
19
|
-
* @param validationFn - The function to validate the parsed data
|
|
20
|
-
* @param createFeedbackPromptFn - The function to create a feedback prompt
|
|
21
|
-
* @param failureMsg - The message to be sent in case of failure
|
|
22
|
-
* @param retryCount - The current retry count
|
|
23
|
-
* @returns
|
|
15
|
+
* Retries model selection with feedback on parse errors
|
|
24
16
|
*/
|
|
25
17
|
export declare function withModelRetry<T>({ runtime, message, state, callback, input, validationFn, createFeedbackPromptFn, failureMsg, retryCount, }: WithModelRetryOptions<T>): Promise<T | null>;
|
|
26
|
-
export {};
|
|
27
18
|
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,KAAK,EAGX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtE,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACrD,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5G,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,EACtC,OAAO,EACP,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,UAAc,GACf,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAiC9C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-mcp",
|
|
3
3
|
"description": "ElizaOS plugin to integrate with MCP (Model Context Protocol) servers",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"elizaos-plugins"
|
|
42
42
|
],
|
|
43
43
|
"scripts": {
|
|
44
|
+
"test": "bun test tests/",
|
|
45
|
+
"test:watch": "bun test --watch tests/",
|
|
44
46
|
"build": "bun run build.ts",
|
|
45
47
|
"dev": "bun --hot build.ts",
|
|
46
48
|
"clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
|
|
@@ -61,14 +63,14 @@
|
|
|
61
63
|
"@types/bun": "1.2.5",
|
|
62
64
|
"@types/json-schema": "^7.0.15",
|
|
63
65
|
"@types/node": "^22.10.0",
|
|
66
|
+
"ajv": "^8.17.1",
|
|
64
67
|
"bumpp": "10.1.0",
|
|
68
|
+
"json5": "^2.2.3",
|
|
65
69
|
"typescript": "^5.7.2"
|
|
66
70
|
},
|
|
67
71
|
"dependencies": {
|
|
68
72
|
"@elizaos/core": "^1.7.0",
|
|
69
|
-
"@modelcontextprotocol/sdk": "^1.7.0"
|
|
70
|
-
"ajv": "^8.17.1",
|
|
71
|
-
"json5": "^2.2.3"
|
|
73
|
+
"@modelcontextprotocol/sdk": "^1.7.0"
|
|
72
74
|
},
|
|
73
75
|
"agentConfig": {
|
|
74
76
|
"pluginType": "elizaos:plugin:1.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callToolAction.d.ts","sourceRoot":"","sources":["../../src/actions/callToolAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAOZ,MAAM,eAAe,CAAC;AAQvB,eAAO,MAAM,cAAc,EAAE,MAqL5B,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const feedbackTemplate = "\n{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou previously attempted to parse a JSON selection but encountered an error. You need to fix the issues and provide a valid JSON response.\n\nPREVIOUS RESPONSE:\n{{{originalResponse}}\n\nERROR:\n{{{errorMessage}}\n\nAvailable {{{itemType}}}s:\n{{{itemsDescription}}\n\nUser request: \"{{{userMessage}}}\"\n\nCORRECTED INSTRUCTIONS:\n1. Create a valid JSON object that selects the most appropriate {{{itemType}}} for the task\n2. Make sure to use proper JSON syntax with double quotes for keys and string values\n3. Ensure all values exactly match the available {{{itemType}}}s (names are case-sensitive!)\n4. Do not include any markdown formatting, explanations, or non-JSON content\n5. Do not use placeholders - all values should be concrete and usable\n\nYOUR CORRECTED VALID JSON RESPONSE:\n";
|
|
2
|
-
//# sourceMappingURL=feedbackTemplate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feedbackTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/feedbackTemplate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,+1BA4B5B,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const toolReasoningTemplate = "\n{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are a helpful assistant responding to a user's request. You've just used the \"{{{toolName}}}\" tool from the \"{{{serverName}}}\" server to help answer this request.\n\nOriginal user request: \"{{{userMessage}}}\"\n\nTool response:\n{{{toolOutput}}}\n\n{{#if hasAttachments}}\nThe tool also returned images or other media that will be shared with the user.\n{{/if}}\n\nInstructions:\n1. Analyze how well the tool's response addresses the user's specific question or need\n2. Identify the most relevant information from the tool's output\n3. Create a natural, conversational response that incorporates this information\n4. If the tool's response is insufficient, acknowledge its limitations and explain what you can determine\n5. Do not start with phrases like \"I used the X tool\" or \"Here's what I found\" - instead, integrate the information naturally\n6. Maintain your helpful, intelligent assistant personality while presenting the information\n\nYour response (written as if directly to the user):\n";
|
|
2
|
-
//# sourceMappingURL=toolReasoningTemplate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolReasoningTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/toolReasoningTemplate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,wjCA2BjC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const toolSelectionNameTemplate = "\n{{mcpProvider.text}}\n\n{{recentMessages}}\n\n# TASK: Select the Most Appropriate Tool and Server\n\nYou must select the most appropriate tool from the list above to fulfill the user's request. Your response must be a valid JSON object with the required properties.\n\n## CRITICAL INSTRUCTIONS\n1. Provide both \"serverName\" and \"toolName\" from the options listed above.\n2. Each name must match EXACTLY as shown in the list:\n - Example (correct): \"serverName\": \"github\"\n - Example (incorrect): \"serverName\": \"GitHub\", \"Github\", or variations\n3. Extract ACTUAL parameter values from the conversation context.\n - Do not invent or use placeholders like \"octocat\" or \"Hello-World\" unless the user said so.\n4. Include a \"reasoning\" field explaining why the selected tool fits the request.\n5. If no tool is appropriate, respond with:\n {\n \"noToolAvailable\": true\n }\n\n!!! YOUR RESPONSE MUST BE A VALID JSON OBJECT ONLY !!! \n\nCRITICAL: Your response must START with { and END with }. DO NOT include ANY text before or after the JSON.\n\n## STRICT FORMAT REQUIREMENTS\n- The response MUST be a single valid JSON object.\n- DO NOT wrap the JSON in triple backticks (```), code blocks, or include any explanatory text.\n- DO NOT include comments (// or /* */) anywhere.\n- DO NOT use placeholders (e.g., \"replace with...\", \"example\", \"your...\", etc.)\n- ALL strings must use double quotes.\n\n## CRITICAL NOTES\n- All values must be fully grounded in user input or inferred contextually.\n- No missing fields unless they are explicitly optional in the schema.\n- All types must match the schema (strings, numbers, booleans).\n\n## JSON OBJECT STRUCTURE\nYour response MUST contain ONLY these top-level keys:\n1. \"serverName\" \u2014 The name of the server (e.g., \"github\", \"notion\")\n2. \"toolName\" \u2014 The name of the tool (e.g., \"get_file_contents\", \"search\")\n3. \"reasoning\" \u2014 A string explaining how the values were inferred from the conversation.\n4. \"noToolAvailable\" \u2014 A boolean indicating if no tool is available (true/false)\n\n## EXAMPLE RESPONSE\n{\n \"serverName\": \"github\",\n \"toolName\": \"get_file_contents\",\n \"reasoning\": \"The user wants to retrieve the README from the facebook/react repository.\",\n \"noToolAvailable\": false\n}\n\n## REMINDERS\n- Use \"github\" as serverName for GitHub tools.\n- Use \"notion\" as serverName for Notion tools.\n- For search and knowledge-based tasks, MCP tools are often appropriate.\n\nREMEMBER: This output will be parsed directly as JSON. If the format is incorrect, the operation will fail.\n";
|
|
2
|
-
export declare const toolSelectionArgumentTemplate = "\n{{recentMessages}}\n\n# TASK: Generate a Strictly Valid JSON Object for Tool Execution\n\nYou have chosen the \"{{toolSelectionName.toolName}}\" tool from the \"{{toolSelectionName.serverName}}\" server to address the user's request.\nThe reasoning behind this selection is: \"{{toolSelectionName.reasoning}}\"\n\n## CRITICAL INSTRUCTIONS\n1. Ensure the \"toolArguments\" object strictly adheres to the structure and requirements defined in the schema.\n2. All parameter values must be extracted from the conversation context and must be concrete, usable values.\n3. Avoid placeholders or generic terms unless explicitly provided by the user.\n\n!!! YOUR RESPONSE MUST BE A VALID JSON OBJECT ONLY !!! \n\n## STRICT FORMAT REQUIREMENTS\n- The response MUST be a single valid JSON object.\n- DO NOT wrap the JSON in triple backticks (```), code blocks, or include any explanatory text.\n- DO NOT include comments (// or /* */) anywhere.\n- DO NOT use placeholders (e.g., \"replace with...\", \"example\", \"your...\", etc.)\n- ALL strings must use double quotes\n\n## CRITICAL NOTES\n- All values must be fully grounded in user input or inferred contextually.\n- No missing fields unless they are explicitly optional in the schema.\n- All types must match the schema (strings, numbers, booleans).\n\n## JSON OBJECT STRUCTURE\nYour response MUST contain ONLY these two top-level keys:\n1. \"toolArguments\" \u2014 An object matching the input schema: {{toolInputSchema}}\n2. \"reasoning\" \u2014 A string explaining how the values were inferred from the conversation.\n\n## EXAMPLE RESPONSE\n{\n \"toolArguments\": {\n \"owner\": \"facebook\",\n \"repo\": \"react\",\n \"path\": \"README.md\",\n \"branch\": \"main\"\n },\n \"reasoning\": \"The user wants to see the README from the facebook/react repository based on our conversation.\"\n}\n\nREMEMBER: Your response will be parsed directly as JSON. If it fails to parse, the operation will fail completely.\n";
|
|
3
|
-
//# sourceMappingURL=toolSelectionTemplate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolSelectionTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/toolSelectionTemplate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,glFA2DrC,CAAC;AAEF,eAAO,MAAM,6BAA6B,27DA4CzC,CAAC"}
|
package/dist/utils/handler.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEnE,wBAAsB,qBAAqB,CACzC,QAAQ,CAAC,EAAE,eAAe,EAE1B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GACzC,OAAO,CAAC,YAAY,CAAC,CA4BvB"}
|
package/dist/utils/schemas.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export declare const toolSelectionNameSchema: {
|
|
2
|
-
type: string;
|
|
3
|
-
required: string[];
|
|
4
|
-
properties: {
|
|
5
|
-
serverName: {
|
|
6
|
-
type: string;
|
|
7
|
-
minLength: number;
|
|
8
|
-
errorMessage: string;
|
|
9
|
-
};
|
|
10
|
-
toolName: {
|
|
11
|
-
type: string;
|
|
12
|
-
minLength: number;
|
|
13
|
-
errorMessage: string;
|
|
14
|
-
};
|
|
15
|
-
reasoning: {
|
|
16
|
-
type: string;
|
|
17
|
-
};
|
|
18
|
-
noToolAvailable: {
|
|
19
|
-
type: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export interface ToolSelectionName {
|
|
24
|
-
serverName: string;
|
|
25
|
-
toolName: string;
|
|
26
|
-
reasoning?: string;
|
|
27
|
-
noToolAvailable?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare const toolSelectionArgumentSchema: {
|
|
30
|
-
type: string;
|
|
31
|
-
required: string[];
|
|
32
|
-
properties: {
|
|
33
|
-
toolArguments: {
|
|
34
|
-
type: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export interface ToolSelectionArgument {
|
|
39
|
-
toolArguments: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
export declare const ResourceSelectionSchema: {
|
|
42
|
-
type: string;
|
|
43
|
-
required: string[];
|
|
44
|
-
properties: {
|
|
45
|
-
serverName: {
|
|
46
|
-
type: string;
|
|
47
|
-
minLength: number;
|
|
48
|
-
errorMessage: string;
|
|
49
|
-
};
|
|
50
|
-
uri: {
|
|
51
|
-
type: string;
|
|
52
|
-
minLength: number;
|
|
53
|
-
errorMessage: string;
|
|
54
|
-
};
|
|
55
|
-
reasoning: {
|
|
56
|
-
type: string;
|
|
57
|
-
};
|
|
58
|
-
noResourceAvailable: {
|
|
59
|
-
type: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
export interface ResourceSelection {
|
|
64
|
-
serverName: string;
|
|
65
|
-
uri: string;
|
|
66
|
-
reasoning?: string;
|
|
67
|
-
noResourceAvailable?: boolean;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/utils/schemas.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;CAqBnC,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B;;;;;;;;CAQvC,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;CAqBnC,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type HandlerCallback, type IAgentRuntime, type Memory, type State } from "@elizaos/core";
|
|
2
|
-
import type { McpProvider } from "../types";
|
|
3
|
-
import type { ToolSelectionName, ToolSelectionArgument } from "./schemas";
|
|
4
|
-
export interface CreateToolSelectionOptions {
|
|
5
|
-
runtime: IAgentRuntime;
|
|
6
|
-
state: State;
|
|
7
|
-
message: Memory;
|
|
8
|
-
callback?: HandlerCallback;
|
|
9
|
-
mcpProvider: McpProvider;
|
|
10
|
-
toolSelectionName?: ToolSelectionName;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Creates a tool selection name based on the current state and MCP provider.
|
|
14
|
-
* @returns A tool selection name object or null if the selection is invalid.
|
|
15
|
-
* ```json
|
|
16
|
-
* {
|
|
17
|
-
* "serverName": "github",
|
|
18
|
-
* "toolName": "get_file_contents",
|
|
19
|
-
* "reasoning": "The user wants to see the README from the facebook/react repository based on our conversation."
|
|
20
|
-
* "noToolSelection": false
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function createToolSelectionName({ runtime, state, message, callback, mcpProvider, }: CreateToolSelectionOptions): Promise<ToolSelectionName | null>;
|
|
25
|
-
/**
|
|
26
|
-
* Creates a tool selection argument based on the current state and MCP provider.
|
|
27
|
-
* @returns A tool selection argument object or null if the selection is invalid.
|
|
28
|
-
* ```json
|
|
29
|
-
* {
|
|
30
|
-
* "toolArguments": {
|
|
31
|
-
* "file_path": "facebook/react/README.md",
|
|
32
|
-
* "repo": "facebook/react"
|
|
33
|
-
* },
|
|
34
|
-
* "reasoning": "The user wants to see the README from the facebook/react repository based on our conversation."
|
|
35
|
-
* }
|
|
36
|
-
*/
|
|
37
|
-
export declare function createToolSelectionArgument({ runtime, state, message, callback, mcpProvider, toolSelectionName, }: CreateToolSelectionOptions): Promise<ToolSelectionArgument | null>;
|
|
38
|
-
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/utils/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,MAAM,EAEX,KAAK,KAAK,EAGX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAO1E,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,OAAO,EACP,QAAQ,EACR,WAAW,GACZ,EAAE,0BAA0B,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAwBhE;AACD;;;;;;;;;;;GAWG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,OAAO,EACP,KAAK,EACL,OAAO,EACP,QAAQ,EACR,WAAW,EACX,iBAAiB,GAClB,EAAE,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA0CpE"}
|