@elizaos/plugin-mcp 1.7.0 → 2.0.0-alpha.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.
Files changed (114) hide show
  1. package/LICENSE +23 -0
  2. package/dist/cjs/index.cjs +857 -1099
  3. package/dist/cjs/index.d.ts +2 -0
  4. package/dist/cjs/index.js.map +25 -27
  5. package/dist/index.d.ts +2 -7
  6. package/dist/node/actions/callToolAction.d.ts +3 -0
  7. package/dist/node/actions/callToolAction.d.ts.map +1 -0
  8. package/dist/node/actions/readResourceAction.d.ts +3 -0
  9. package/dist/node/actions/readResourceAction.d.ts.map +1 -0
  10. package/dist/node/generated/prompts/typescript/prompts.d.ts +24 -0
  11. package/dist/node/generated/prompts/typescript/prompts.d.ts.map +1 -0
  12. package/dist/node/index.d.ts +4 -0
  13. package/dist/node/index.d.ts.map +1 -0
  14. package/dist/{index.js → node/index.js} +874 -1104
  15. package/dist/node/index.js.map +31 -0
  16. package/dist/node/provider.d.ts.map +1 -0
  17. package/dist/{service.d.ts → node/service.d.ts} +6 -8
  18. package/dist/node/service.d.ts.map +1 -0
  19. package/dist/node/templates/errorAnalysisPrompt.d.ts +2 -0
  20. package/dist/node/templates/errorAnalysisPrompt.d.ts.map +1 -0
  21. package/dist/node/templates/feedbackTemplate.d.ts +8 -0
  22. package/dist/node/templates/feedbackTemplate.d.ts.map +1 -0
  23. package/dist/node/templates/resourceAnalysisTemplate.d.ts +8 -0
  24. package/dist/node/templates/resourceAnalysisTemplate.d.ts.map +1 -0
  25. package/dist/node/templates/resourceSelectionTemplate.d.ts +8 -0
  26. package/dist/node/templates/resourceSelectionTemplate.d.ts.map +1 -0
  27. package/dist/node/templates/toolReasoningTemplate.d.ts +8 -0
  28. package/dist/node/templates/toolReasoningTemplate.d.ts.map +1 -0
  29. package/dist/node/templates/toolSelectionTemplate.d.ts +8 -0
  30. package/dist/node/templates/toolSelectionTemplate.d.ts.map +1 -0
  31. package/dist/{tool-compatibility/index.d.ts → node/tool-compatibility/base.d.ts} +15 -16
  32. package/dist/node/tool-compatibility/base.d.ts.map +1 -0
  33. package/dist/node/tool-compatibility/index.d.ts +7 -0
  34. package/dist/node/tool-compatibility/index.d.ts.map +1 -0
  35. package/dist/node/tool-compatibility/integration-test.d.ts +10 -0
  36. package/dist/node/tool-compatibility/integration-test.d.ts.map +1 -0
  37. package/dist/node/tool-compatibility/providers/anthropic.d.ts +11 -0
  38. package/dist/node/tool-compatibility/providers/anthropic.d.ts.map +1 -0
  39. package/dist/node/tool-compatibility/providers/google.d.ts +11 -0
  40. package/dist/node/tool-compatibility/providers/google.d.ts.map +1 -0
  41. package/dist/node/tool-compatibility/providers/openai.d.ts +18 -0
  42. package/dist/node/tool-compatibility/providers/openai.d.ts.map +1 -0
  43. package/dist/node/tool-compatibility/test-example.d.ts +4 -0
  44. package/dist/node/tool-compatibility/test-example.d.ts.map +1 -0
  45. package/dist/node/types.d.ts +191 -0
  46. package/dist/node/types.d.ts.map +1 -0
  47. package/dist/{utils → node/utils}/error.d.ts +4 -4
  48. package/dist/node/utils/error.d.ts.map +1 -0
  49. package/dist/node/utils/handler.d.ts +8 -0
  50. package/dist/node/utils/handler.d.ts.map +1 -0
  51. package/dist/node/utils/json.d.ts +11 -0
  52. package/dist/node/utils/json.d.ts.map +1 -0
  53. package/dist/node/utils/mcp.d.ts +5 -0
  54. package/dist/node/utils/mcp.d.ts.map +1 -0
  55. package/dist/node/utils/processing.d.ts +43 -0
  56. package/dist/node/utils/processing.d.ts.map +1 -0
  57. package/dist/node/utils/schemas.d.ts +72 -0
  58. package/dist/node/utils/schemas.d.ts.map +1 -0
  59. package/dist/node/utils/selection.d.ts +14 -0
  60. package/dist/node/utils/selection.d.ts.map +1 -0
  61. package/dist/node/utils/validation.d.ts +17 -0
  62. package/dist/node/utils/validation.d.ts.map +1 -0
  63. package/dist/node/utils/wrapper.d.ts +18 -0
  64. package/dist/node/utils/wrapper.d.ts.map +1 -0
  65. package/dist/tsconfig.build.tsbuildinfo +1 -0
  66. package/package.json +35 -44
  67. package/README.md +0 -275
  68. package/dist/actions/callToolAction.d.ts +0 -3
  69. package/dist/actions/callToolAction.d.ts.map +0 -1
  70. package/dist/actions/readResourceAction.d.ts +0 -3
  71. package/dist/actions/readResourceAction.d.ts.map +0 -1
  72. package/dist/index.d.ts.map +0 -1
  73. package/dist/index.js.map +0 -33
  74. package/dist/provider.d.ts.map +0 -1
  75. package/dist/service.d.ts.map +0 -1
  76. package/dist/templates/errorAnalysisPrompt.d.ts +0 -2
  77. package/dist/templates/errorAnalysisPrompt.d.ts.map +0 -1
  78. package/dist/templates/feedbackTemplate.d.ts +0 -2
  79. package/dist/templates/feedbackTemplate.d.ts.map +0 -1
  80. package/dist/templates/resourceAnalysisTemplate.d.ts +0 -2
  81. package/dist/templates/resourceAnalysisTemplate.d.ts.map +0 -1
  82. package/dist/templates/resourceSelectionTemplate.d.ts +0 -2
  83. package/dist/templates/resourceSelectionTemplate.d.ts.map +0 -1
  84. package/dist/templates/toolReasoningTemplate.d.ts +0 -2
  85. package/dist/templates/toolReasoningTemplate.d.ts.map +0 -1
  86. package/dist/templates/toolSelectionTemplate.d.ts +0 -3
  87. package/dist/templates/toolSelectionTemplate.d.ts.map +0 -1
  88. package/dist/tool-compatibility/index.d.ts.map +0 -1
  89. package/dist/tool-compatibility/providers/anthropic.d.ts +0 -12
  90. package/dist/tool-compatibility/providers/anthropic.d.ts.map +0 -1
  91. package/dist/tool-compatibility/providers/google.d.ts +0 -12
  92. package/dist/tool-compatibility/providers/google.d.ts.map +0 -1
  93. package/dist/tool-compatibility/providers/openai.d.ts +0 -20
  94. package/dist/tool-compatibility/providers/openai.d.ts.map +0 -1
  95. package/dist/types.d.ts +0 -166
  96. package/dist/types.d.ts.map +0 -1
  97. package/dist/utils/error.d.ts.map +0 -1
  98. package/dist/utils/handler.d.ts +0 -3
  99. package/dist/utils/handler.d.ts.map +0 -1
  100. package/dist/utils/json.d.ts +0 -9
  101. package/dist/utils/json.d.ts.map +0 -1
  102. package/dist/utils/mcp.d.ts +0 -5
  103. package/dist/utils/mcp.d.ts.map +0 -1
  104. package/dist/utils/processing.d.ts +0 -43
  105. package/dist/utils/processing.d.ts.map +0 -1
  106. package/dist/utils/schemas.d.ts +0 -69
  107. package/dist/utils/schemas.d.ts.map +0 -1
  108. package/dist/utils/selection.d.ts +0 -38
  109. package/dist/utils/selection.d.ts.map +0 -1
  110. package/dist/utils/validation.d.ts +0 -34
  111. package/dist/utils/validation.d.ts.map +0 -1
  112. package/dist/utils/wrapper.d.ts +0 -27
  113. package/dist/utils/wrapper.d.ts.map +0 -1
  114. /package/dist/{provider.d.ts → node/provider.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,7 +1,2 @@
1
- import { type Plugin } from "@elizaos/core";
2
- export * from "./types";
3
- export { McpService } from "./service";
4
- export { createMcpToolCompatibilitySync, createMcpToolCompatibility, detectModelProvider, McpToolCompatibility, type ModelInfo, type ModelProvider, type StringConstraints, type NumberConstraints, type ArrayConstraints, type ObjectConstraints, type SchemaConstraints, } from "./tool-compatibility";
5
- declare const mcpPlugin: Plugin;
6
- export default mcpPlugin;
7
- //# sourceMappingURL=index.d.ts.map
1
+ export * from "./node/index";
2
+ export { default } from "./node/index";
@@ -0,0 +1,3 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const callToolAction: Action;
3
+ //# sourceMappingURL=callToolAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callToolAction.d.ts","sourceRoot":"","sources":["../../../src/actions/callToolAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAMP,MAAM,eAAe,CAAC;AAQvB,eAAO,MAAM,cAAc,EAAE,MA2J5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type Action } from "@elizaos/core";
2
+ export declare const readResourceAction: Action;
3
+ //# sourceMappingURL=readResourceAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readResourceAction.d.ts","sourceRoot":"","sources":["../../../src/actions/readResourceAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAQZ,MAAM,eAAe,CAAC;AAqDvB,eAAO,MAAM,kBAAkB,EAAE,MA6KhC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Auto-generated prompt templates
3
+ * DO NOT EDIT - Generated from ../../../../../prompts/*.txt
4
+ *
5
+ * These prompts use Handlebars-style template syntax:
6
+ * - {{variableName}} for simple substitution
7
+ * - {{#each items}}...{{/each}} for iteration
8
+ * - {{#if condition}}...{{/if}} for conditionals
9
+ */
10
+ export declare const errorAnalysisTemplate = "{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou're an assistant helping a user, but there was an error accessing the resource you tried to use.\n\nUser request: \"{{{userMessage}}}\"\nError message: {{{error}}}\n\nCreate a helpful response that:\n1. Acknowledges the issue in user-friendly terms\n2. Offers alternative approaches to help if possible\n3. Doesn't expose technical error details unless they're truly helpful\n4. Maintains a helpful, conversational tone\n\nYour response:";
11
+ export declare const ERROR_ANALYSIS_TEMPLATE = "{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou're an assistant helping a user, but there was an error accessing the resource you tried to use.\n\nUser request: \"{{{userMessage}}}\"\nError message: {{{error}}}\n\nCreate a helpful response that:\n1. Acknowledges the issue in user-friendly terms\n2. Offers alternative approaches to help if possible\n3. Doesn't expose technical error details unless they're truly helpful\n4. Maintains a helpful, conversational tone\n\nYour response:";
12
+ export declare const feedbackTemplate = "{{{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:";
13
+ export declare const FEEDBACK_TEMPLATE = "{{{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:";
14
+ export declare const resourceAnalysisTemplate = "{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are a helpful assistant responding to a user's request. You've just accessed the resource \"{{{uri}}}\" to help answer this request.\n\nOriginal user request: \"{{{userMessage}}}\"\n\nResource metadata: \n{{{resourceMeta}}\n\nResource content: \n{{{resourceContent}}\n\nInstructions:\n1. Analyze how well the resource's content addresses the user's specific question or need\n2. Identify the most relevant information from the resource\n3. Create a natural, conversational response that incorporates this information\n4. If the resource content is insufficient, acknowledge its limitations and explain what you can determine\n5. Do not start with phrases like \"According to the resource\" 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):";
15
+ export declare const RESOURCE_ANALYSIS_TEMPLATE = "{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are a helpful assistant responding to a user's request. You've just accessed the resource \"{{{uri}}}\" to help answer this request.\n\nOriginal user request: \"{{{userMessage}}}\"\n\nResource metadata: \n{{{resourceMeta}}\n\nResource content: \n{{{resourceContent}}\n\nInstructions:\n1. Analyze how well the resource's content addresses the user's specific question or need\n2. Identify the most relevant information from the resource\n3. Create a natural, conversational response that incorporates this information\n4. If the resource content is insufficient, acknowledge its limitations and explain what you can determine\n5. Do not start with phrases like \"According to the resource\" 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):";
16
+ export declare const resourceSelectionTemplate = "{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are an intelligent assistant helping select the right resource to address a user's request.\n\nCRITICAL INSTRUCTIONS:\n1. You MUST specify both a valid serverName AND uri from the list above\n2. The serverName value should match EXACTLY the server name shown in parentheses (Server: X)\n CORRECT: \"serverName\": \"github\" (if the server is called \"github\") \n WRONG: \"serverName\": \"GitHub\" or \"Github\" or any other variation\n3. The uri value should match EXACTLY the resource uri listed\n CORRECT: \"uri\": \"weather://San Francisco/current\" (if that's the exact uri)\n WRONG: \"uri\": \"weather://sanfrancisco/current\" or any variation\n4. Identify the user's information need from the conversation context\n5. Select the most appropriate resource based on its description and the request\n6. If no resource seems appropriate, output {\"noResourceAvailable\": true}\n\n!!! YOUR RESPONSE MUST BE A VALID JSON OBJECT ONLY !!! \n\nSTRICT FORMAT REQUIREMENTS:\n- NO code block formatting (NO backticks or ```)\n- NO comments (NO // or /* */)\n- NO placeholders like \"replace with...\", \"example\", \"your...\", \"actual\", etc.\n- Every parameter value must be a concrete, usable value (not instructions to replace)\n- Use proper JSON syntax with double quotes for strings\n- NO explanatory text before or after the JSON object\n\nEXAMPLE RESPONSE:\n{\n \"serverName\": \"weather-server\",\n \"uri\": \"weather://San Francisco/current\",\n \"reasoning\": \"Based on the conversation, the user is asking about current weather in San Francisco. This resource provides up-to-date weather information for that city.\"\n}\n\nREMEMBER: Your response will be parsed directly as JSON. If it fails to parse, the operation will fail completely!";
17
+ export declare const RESOURCE_SELECTION_TEMPLATE = "{{{mcpProvider.text}}}\n\n{{{recentMessages}}}\n\n# Prompt\n\nYou are an intelligent assistant helping select the right resource to address a user's request.\n\nCRITICAL INSTRUCTIONS:\n1. You MUST specify both a valid serverName AND uri from the list above\n2. The serverName value should match EXACTLY the server name shown in parentheses (Server: X)\n CORRECT: \"serverName\": \"github\" (if the server is called \"github\") \n WRONG: \"serverName\": \"GitHub\" or \"Github\" or any other variation\n3. The uri value should match EXACTLY the resource uri listed\n CORRECT: \"uri\": \"weather://San Francisco/current\" (if that's the exact uri)\n WRONG: \"uri\": \"weather://sanfrancisco/current\" or any variation\n4. Identify the user's information need from the conversation context\n5. Select the most appropriate resource based on its description and the request\n6. If no resource seems appropriate, output {\"noResourceAvailable\": true}\n\n!!! YOUR RESPONSE MUST BE A VALID JSON OBJECT ONLY !!! \n\nSTRICT FORMAT REQUIREMENTS:\n- NO code block formatting (NO backticks or ```)\n- NO comments (NO // or /* */)\n- NO placeholders like \"replace with...\", \"example\", \"your...\", \"actual\", etc.\n- Every parameter value must be a concrete, usable value (not instructions to replace)\n- Use proper JSON syntax with double quotes for strings\n- NO explanatory text before or after the JSON object\n\nEXAMPLE RESPONSE:\n{\n \"serverName\": \"weather-server\",\n \"uri\": \"weather://San Francisco/current\",\n \"reasoning\": \"Based on the conversation, the user is asking about current weather in San Francisco. This resource provides up-to-date weather information for that city.\"\n}\n\nREMEMBER: Your response will be parsed directly as JSON. If it fails to parse, the operation will fail completely!";
18
+ export declare const toolReasoningTemplate = "{{{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):";
19
+ export declare const TOOL_REASONING_TEMPLATE = "{{{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):";
20
+ export declare const toolSelectionArgumentTemplate = "{{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.";
21
+ export declare const TOOL_SELECTION_ARGUMENT_TEMPLATE = "{{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.";
22
+ export declare const toolSelectionNameTemplate = "{{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.";
23
+ export declare const TOOL_SELECTION_NAME_TEMPLATE = "{{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.";
24
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../../src/generated/prompts/typescript/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,qBAAqB,2fAiBnB,CAAC;AAEhB,eAAO,MAAM,uBAAuB,2fAAwB,CAAC;AAE7D,eAAO,MAAM,gBAAgB,21BA0BO,CAAC;AAErC,eAAO,MAAM,iBAAiB,21BAAmB,CAAC;AAElD,eAAO,MAAM,wBAAwB,u9BAwBe,CAAC;AAErD,eAAO,MAAM,0BAA0B,u9BAA2B,CAAC;AAEnE,eAAO,MAAM,yBAAyB,syDAqC6E,CAAC;AAEpH,eAAO,MAAM,2BAA2B,syDAA4B,CAAC;AAErE,eAAO,MAAM,qBAAqB,ojCAyBkB,CAAC;AAErD,eAAO,MAAM,uBAAuB,ojCAAwB,CAAC;AAE7D,eAAO,MAAM,6BAA6B,u7DA0CyE,CAAC;AAEpH,eAAO,MAAM,gCAAgC,u7DAAgC,CAAC;AAE9E,eAAO,MAAM,yBAAyB,4kFAyDsE,CAAC;AAE7G,eAAO,MAAM,4BAA4B,4kFAA4B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Plugin } from "@elizaos/core";
2
+ declare const mcpPlugin: Plugin;
3
+ export default mcpPlugin;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAMxE,QAAA,MAAM,SAAS,EAAE,MAWhB,CAAC;AAEF,eAAe,SAAS,CAAC"}