#pragma once #include #include #include #include "mcp_plugin_api.h" class mcp_Tool_LispInline : public mcp_Tool { public: virtual nlohmann::json Execute(const nlohmann::json &args) override; }; class mcp_Tool_LispFile : public mcp_Tool { private: std::wstring m_lispDir; public: mcp_Tool_LispFile(const std::wstring& lispDir) : m_lispDir(lispDir) {} virtual nlohmann::json Execute(const nlohmann::json &args) override; }; class mcp_Tool_DllProxy : public mcp_Tool { private: HMODULE m_hModule; mcp_Tool* m_pRealTool; // 真正由第三方 DLL 创建的工具对象 typedef void (*DestroyFunc)(mcp_Tool*); DestroyFunc m_destroyFunc; public: mcp_Tool_DllProxy(HMODULE hMod, mcp_Tool* pReal, DestroyFunc pDestroy) : m_hModule(hMod), m_pRealTool(pReal), m_destroyFunc(pDestroy) {} // RAII:基座销毁工具时,自动通知 DLL 释放内存,并卸载模块 virtual ~mcp_Tool_DllProxy(); virtual nlohmann::json Execute(const nlohmann::json &args) override; };