mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-01 02:29:13 -04:00
refactor: Move to 0.7.0 version of llmqore
This commit is contained in:
@@ -5,12 +5,11 @@
|
|||||||
#include "McpServerConnection.hpp"
|
#include "McpServerConnection.hpp"
|
||||||
|
|
||||||
#include <LLMQore/McpClient.hpp>
|
#include <LLMQore/McpClient.hpp>
|
||||||
#include <LLMQore/McpExceptions.hpp>
|
|
||||||
#include <LLMQore/McpHttpTransport.hpp>
|
#include <LLMQore/McpHttpTransport.hpp>
|
||||||
#include <LLMQore/McpRemoteTool.hpp>
|
#include <LLMQore/McpRemoteTool.hpp>
|
||||||
#include <LLMQore/McpStdioTransport.hpp>
|
|
||||||
#include <LLMQore/McpTransport.hpp>
|
|
||||||
#include <LLMQore/McpTypes.hpp>
|
#include <LLMQore/McpTypes.hpp>
|
||||||
|
#include <LLMQore/RpcStdioTransport.hpp>
|
||||||
|
#include <LLMQore/RpcTransport.hpp>
|
||||||
#include <LLMQore/ToolsManager.hpp>
|
#include <LLMQore/ToolsManager.hpp>
|
||||||
#include <LLMQore/Version.hpp>
|
#include <LLMQore/Version.hpp>
|
||||||
|
|
||||||
@@ -125,7 +124,7 @@ McpServerConnection::~McpServerConnection()
|
|||||||
disconnectFromServer();
|
disconnectFromServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
::LLMQore::Mcp::McpTransport *McpServerConnection::createTransport()
|
::LLMQore::Rpc::Transport *McpServerConnection::createTransport()
|
||||||
{
|
{
|
||||||
if (m_config.transport == McpTransportKind::Http) {
|
if (m_config.transport == McpTransportKind::Http) {
|
||||||
if (!m_config.url.isValid()) {
|
if (!m_config.url.isValid()) {
|
||||||
@@ -149,7 +148,7 @@ McpServerConnection::~McpServerConnection()
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
::LLMQore::Mcp::StdioLaunchConfig cfg;
|
::LLMQore::Rpc::StdioLaunchConfig cfg;
|
||||||
cfg.arguments = m_config.args;
|
cfg.arguments = m_config.args;
|
||||||
cfg.workingDirectory = m_config.workingDirectory;
|
cfg.workingDirectory = m_config.workingDirectory;
|
||||||
|
|
||||||
@@ -194,7 +193,7 @@ McpServerConnection::~McpServerConnection()
|
|||||||
env.insert(it.key(), it.value());
|
env.insert(it.key(), it.value());
|
||||||
cfg.environment = env;
|
cfg.environment = env;
|
||||||
|
|
||||||
return new ::LLMQore::Mcp::McpStdioClientTransport(cfg, this);
|
return new ::LLMQore::Rpc::StdioClientTransport(cfg, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void McpServerConnection::connectToServer()
|
void McpServerConnection::connectToServer()
|
||||||
|
|||||||
@@ -22,9 +22,12 @@ class ToolsManager;
|
|||||||
|
|
||||||
namespace LLMQore::Mcp {
|
namespace LLMQore::Mcp {
|
||||||
class McpClient;
|
class McpClient;
|
||||||
class McpTransport;
|
|
||||||
} // namespace LLMQore::Mcp
|
} // namespace LLMQore::Mcp
|
||||||
|
|
||||||
|
namespace LLMQore::Rpc {
|
||||||
|
class Transport;
|
||||||
|
} // namespace LLMQore::Rpc
|
||||||
|
|
||||||
namespace QodeAssist::Mcp {
|
namespace QodeAssist::Mcp {
|
||||||
|
|
||||||
enum class McpTransportKind { Http, Stdio };
|
enum class McpTransportKind { Http, Stdio };
|
||||||
@@ -84,14 +87,14 @@ private:
|
|||||||
void setState(McpConnectionState state, const QString &text = {});
|
void setState(McpConnectionState state, const QString &text = {});
|
||||||
void fetchAndRegisterTools();
|
void fetchAndRegisterTools();
|
||||||
void unregisterTools();
|
void unregisterTools();
|
||||||
::LLMQore::Mcp::McpTransport *createTransport();
|
::LLMQore::Rpc::Transport *createTransport();
|
||||||
|
|
||||||
McpServerConfig m_config;
|
McpServerConfig m_config;
|
||||||
McpConnectionState m_state = McpConnectionState::Disabled;
|
McpConnectionState m_state = McpConnectionState::Disabled;
|
||||||
QString m_statusText;
|
QString m_statusText;
|
||||||
|
|
||||||
QPointer<::LLMQore::Mcp::McpClient> m_client;
|
QPointer<::LLMQore::Mcp::McpClient> m_client;
|
||||||
QPointer<::LLMQore::Mcp::McpTransport> m_transport;
|
QPointer<::LLMQore::Rpc::Transport> m_transport;
|
||||||
QPointer<QTimer> m_listToolsWatchdog;
|
QPointer<QTimer> m_listToolsWatchdog;
|
||||||
|
|
||||||
QList<::LLMQore::Mcp::ToolInfo> m_tools;
|
QList<::LLMQore::Mcp::ToolInfo> m_tools;
|
||||||
|
|||||||
Reference in New Issue
Block a user