UNPKG

mycoder-agent

Version:

Agent module for mycoder - an AI-powered software development assistant

50 lines 1.99 kB
// Import tools import { agentDoneTool } from './agent/agentDone.js'; import { agentMessageTool } from './agent/agentMessage.js'; import { agentStartTool } from './agent/agentStart.js'; import { listAgentsTool } from './agent/listAgents.js'; import { fetchTool } from './fetch/fetch.js'; import { userMessageTool } from './interaction/userMessage.js'; import { userPromptTool } from './interaction/userPrompt.js'; import { createMcpTool } from './mcp.js'; import { listSessionsTool } from './session/listSessions.js'; import { sessionMessageTool } from './session/sessionMessage.js'; import { sessionStartTool } from './session/sessionStart.js'; import { listShellsTool } from './shell/listShells.js'; import { shellMessageTool } from './shell/shellMessage.js'; import { shellStartTool } from './shell/shellStart.js'; import { waitTool } from './sleep/wait.js'; import { textEditorTool } from './textEditor/textEditor.js'; export function getTools(options) { const userPrompt = options?.userPrompt !== false; // Default to true if not specified const mcpConfig = options?.mcpConfig || { servers: [], defaultResources: [] }; // Force cast to Tool type to avoid TypeScript issues const tools = [ textEditorTool, //agentExecuteTool as unknown as Tool, agentStartTool, agentMessageTool, listAgentsTool, agentDoneTool, fetchTool, shellStartTool, shellMessageTool, listShellsTool, sessionStartTool, sessionMessageTool, listSessionsTool, waitTool, ]; // Only include user interaction tools if enabled if (userPrompt) { tools.push(userPromptTool); tools.push(userMessageTool); } // Add MCP tool if we have any servers configured if (mcpConfig.servers && mcpConfig.servers.length > 0) { const mcpTool = createMcpTool(mcpConfig); tools.push(mcpTool); } return tools; } //# sourceMappingURL=getTools.js.map