mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-24 12:11:04 -04:00
refactor: Decoupling chat architecture (#367)
* refactor: Migrate tests to Qt Creator plugin framework and update llmqore transports * refactor: Move conversation history into IDE-free session library * refactor: Extract turn context assembly behind injected ports * build: Add RunQodeAssistTests target for the plugin test suite * refactor: Route the chat through a Session and ChatBackend seam
This commit is contained in:
@@ -5,12 +5,11 @@
|
||||
#include "McpServerConnection.hpp"
|
||||
|
||||
#include <LLMQore/McpClient.hpp>
|
||||
#include <LLMQore/McpExceptions.hpp>
|
||||
#include <LLMQore/McpHttpTransport.hpp>
|
||||
#include <LLMQore/McpRemoteTool.hpp>
|
||||
#include <LLMQore/McpStdioTransport.hpp>
|
||||
#include <LLMQore/McpTransport.hpp>
|
||||
#include <LLMQore/McpTypes.hpp>
|
||||
#include <LLMQore/RpcStdioTransport.hpp>
|
||||
#include <LLMQore/RpcTransport.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
#include <LLMQore/Version.hpp>
|
||||
|
||||
@@ -22,6 +21,8 @@
|
||||
#include <QJsonValue>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <logger/Logger.hpp>
|
||||
#include "providers/Provider.hpp"
|
||||
#include <settings/McpSettings.hpp>
|
||||
@@ -142,7 +143,7 @@ void McpServerConnection::setProviders(const QList<Providers::Provider *> &provi
|
||||
}
|
||||
}
|
||||
|
||||
::LLMQore::Mcp::McpTransport *McpServerConnection::createTransport()
|
||||
::LLMQore::Rpc::Transport *McpServerConnection::createTransport()
|
||||
{
|
||||
if (m_config.transport == McpTransportKind::Http) {
|
||||
if (!m_config.url.isValid()) {
|
||||
@@ -166,7 +167,7 @@ void McpServerConnection::setProviders(const QList<Providers::Provider *> &provi
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
::LLMQore::Mcp::StdioLaunchConfig cfg;
|
||||
::LLMQore::Rpc::StdioLaunchConfig cfg;
|
||||
cfg.arguments = m_config.args;
|
||||
cfg.workingDirectory = m_config.workingDirectory;
|
||||
|
||||
@@ -211,7 +212,7 @@ void McpServerConnection::setProviders(const QList<Providers::Provider *> &provi
|
||||
env.insert(it.key(), it.value());
|
||||
cfg.environment = env;
|
||||
|
||||
return new ::LLMQore::Mcp::McpStdioClientTransport(cfg, this);
|
||||
return new ::LLMQore::Rpc::StdioClientTransport(std::move(cfg), this);
|
||||
}
|
||||
|
||||
void McpServerConnection::connectToServer()
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
|
||||
namespace LLMQore::Mcp {
|
||||
class McpClient;
|
||||
class McpTransport;
|
||||
} // namespace LLMQore::Mcp
|
||||
|
||||
namespace LLMQore::Rpc {
|
||||
class Transport;
|
||||
} // namespace LLMQore::Rpc
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
class Provider;
|
||||
}
|
||||
@@ -77,14 +80,14 @@ private:
|
||||
void fetchAndRegisterTools();
|
||||
void registerTools(const QList<::LLMQore::Mcp::McpClient *> & /*unused*/);
|
||||
void unregisterTools();
|
||||
::LLMQore::Mcp::McpTransport *createTransport();
|
||||
::LLMQore::Rpc::Transport *createTransport();
|
||||
|
||||
McpServerConfig m_config;
|
||||
McpConnectionState m_state = McpConnectionState::Disabled;
|
||||
QString m_statusText;
|
||||
|
||||
QPointer<::LLMQore::Mcp::McpClient> m_client;
|
||||
QPointer<::LLMQore::Mcp::McpTransport> m_transport;
|
||||
QPointer<::LLMQore::Rpc::Transport> m_transport;
|
||||
QPointer<QTimer> m_listToolsWatchdog;
|
||||
|
||||
QList<QPointer<Providers::Provider>> m_providers;
|
||||
|
||||
Reference in New Issue
Block a user