mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-14 18:29:30 -04:00
refactor: Remove experimental flag
This commit is contained in:
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
project(QodeAssist)
|
project(QodeAssist)
|
||||||
|
|
||||||
option(QODEASSIST_EXPERIMENTAL
|
|
||||||
"Enable experimental features" OFF)
|
|
||||||
message(STATUS "QodeAssist experimental features: ${QODEASSIST_EXPERIMENTAL}")
|
|
||||||
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
@@ -170,10 +166,7 @@ add_qtc_plugin(QodeAssist
|
|||||||
settings/McpClientsListAspect.hpp settings/McpClientsListAspect.cpp
|
settings/McpClientsListAspect.hpp settings/McpClientsListAspect.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(QODEASSIST_EXPERIMENTAL)
|
target_link_libraries(QodeAssist PRIVATE QodeAssistAgentPipelines)
|
||||||
target_compile_definitions(QodeAssist PRIVATE QODEASSIST_EXPERIMENTAL)
|
|
||||||
target_link_libraries(QodeAssist PRIVATE QodeAssistAgentPipelines)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_target_property(QtCreatorCorePath QtCreator::Core LOCATION)
|
get_target_property(QtCreatorCorePath QtCreator::Core LOCATION)
|
||||||
find_program(QtCreatorExecutable
|
find_program(QtCreatorExecutable
|
||||||
|
|||||||
@@ -54,21 +54,17 @@
|
|||||||
#include "settings/ChatAssistantSettings.hpp"
|
#include "settings/ChatAssistantSettings.hpp"
|
||||||
#include "settings/GeneralSettings.hpp"
|
#include "settings/GeneralSettings.hpp"
|
||||||
#include "settings/ProjectSettingsPanel.hpp"
|
#include "settings/ProjectSettingsPanel.hpp"
|
||||||
#ifdef QODEASSIST_EXPERIMENTAL
|
|
||||||
#include "settings/AgentsSettingsPage.hpp"
|
#include "settings/AgentsSettingsPage.hpp"
|
||||||
#include "settings/ProvidersSettingsPage.hpp"
|
#include "settings/ProvidersSettingsPage.hpp"
|
||||||
#include "sources/settings/AgentPipelinesPage.hpp"
|
#include "sources/settings/AgentPipelinesPage.hpp"
|
||||||
#endif
|
|
||||||
#include "settings/QuickRefactorSettings.hpp"
|
#include "settings/QuickRefactorSettings.hpp"
|
||||||
#include "settings/SettingsConstants.hpp"
|
#include "settings/SettingsConstants.hpp"
|
||||||
|
|
||||||
#ifdef QODEASSIST_EXPERIMENTAL
|
|
||||||
#include "ProviderInstanceFactory.hpp"
|
#include "ProviderInstanceFactory.hpp"
|
||||||
#include "ProviderLauncher.hpp"
|
#include "ProviderLauncher.hpp"
|
||||||
#include "ProviderSecretsStore.hpp"
|
#include "ProviderSecretsStore.hpp"
|
||||||
|
|
||||||
#include <AgentFactory.hpp>
|
#include <AgentFactory.hpp>
|
||||||
#endif
|
|
||||||
#include "templates/Templates.hpp"
|
#include "templates/Templates.hpp"
|
||||||
#include "widgets/CustomInstructionsManager.hpp"
|
#include "widgets/CustomInstructionsManager.hpp"
|
||||||
#include "widgets/QuickRefactorDialog.hpp"
|
#include "widgets/QuickRefactorDialog.hpp"
|
||||||
@@ -209,7 +205,6 @@ public:
|
|||||||
Settings::setupProjectPanel();
|
Settings::setupProjectPanel();
|
||||||
ConfigurationManager::instance().init();
|
ConfigurationManager::instance().init();
|
||||||
|
|
||||||
#ifdef QODEASSIST_EXPERIMENTAL
|
|
||||||
m_providerInstanceFactory = new Providers::ProviderInstanceFactory(this);
|
m_providerInstanceFactory = new Providers::ProviderInstanceFactory(this);
|
||||||
m_providerSecretsStore = new Providers::ProviderSecretsStore(this);
|
m_providerSecretsStore = new Providers::ProviderSecretsStore(this);
|
||||||
m_providerLauncher = new Providers::ProviderLauncher(this);
|
m_providerLauncher = new Providers::ProviderLauncher(this);
|
||||||
@@ -228,7 +223,6 @@ public:
|
|||||||
m_agentPipelinesPageNavigator = new Settings::AgentPipelinesPageNavigator(this);
|
m_agentPipelinesPageNavigator = new Settings::AgentPipelinesPageNavigator(this);
|
||||||
m_agentPipelinesOptionsPage = Settings::createAgentPipelinesSettingsPage(
|
m_agentPipelinesOptionsPage = Settings::createAgentPipelinesSettingsPage(
|
||||||
m_agentFactory, m_agentPipelinesPageNavigator, m_agentsPageNavigator);
|
m_agentFactory, m_agentPipelinesPageNavigator, m_agentsPageNavigator);
|
||||||
#endif
|
|
||||||
|
|
||||||
m_mcpServerManager = new Mcp::McpServerManager(this);
|
m_mcpServerManager = new Mcp::McpServerManager(this);
|
||||||
m_mcpServerManager->init();
|
m_mcpServerManager->init();
|
||||||
@@ -524,7 +518,6 @@ private:
|
|||||||
QPointer<Mcp::McpServerManager> m_mcpServerManager;
|
QPointer<Mcp::McpServerManager> m_mcpServerManager;
|
||||||
QPointer<QQmlEngine> m_engine;
|
QPointer<QQmlEngine> m_engine;
|
||||||
QPointer<Skills::SkillsManager> m_skillsManager;
|
QPointer<Skills::SkillsManager> m_skillsManager;
|
||||||
#ifdef QODEASSIST_EXPERIMENTAL
|
|
||||||
QPointer<Providers::ProviderInstanceFactory> m_providerInstanceFactory;
|
QPointer<Providers::ProviderInstanceFactory> m_providerInstanceFactory;
|
||||||
QPointer<Providers::ProviderSecretsStore> m_providerSecretsStore;
|
QPointer<Providers::ProviderSecretsStore> m_providerSecretsStore;
|
||||||
QPointer<Providers::ProviderLauncher> m_providerLauncher;
|
QPointer<Providers::ProviderLauncher> m_providerLauncher;
|
||||||
@@ -535,7 +528,6 @@ private:
|
|||||||
std::unique_ptr<Core::IOptionsPage> m_agentsOptionsPage;
|
std::unique_ptr<Core::IOptionsPage> m_agentsOptionsPage;
|
||||||
QPointer<Settings::AgentPipelinesPageNavigator> m_agentPipelinesPageNavigator;
|
QPointer<Settings::AgentPipelinesPageNavigator> m_agentPipelinesPageNavigator;
|
||||||
std::unique_ptr<Core::IOptionsPage> m_agentPipelinesOptionsPage;
|
std::unique_ptr<Core::IOptionsPage> m_agentPipelinesOptionsPage;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QodeAssist::Internal
|
} // namespace QodeAssist::Internal
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <solutions/terminal/terminalview.h>
|
#include <solutions/terminal/terminalview.h>
|
||||||
|
|
||||||
#include "ProviderInstanceWriter.hpp"
|
#include "ProviderInstanceWriter.hpp"
|
||||||
|
#include "ProviderSettings.hpp"
|
||||||
#include "SectionBox.hpp"
|
#include "SectionBox.hpp"
|
||||||
#include "SettingsTheme.hpp"
|
#include "SettingsTheme.hpp"
|
||||||
#include "SettingsUiBuilders.hpp"
|
#include "SettingsUiBuilders.hpp"
|
||||||
@@ -157,6 +158,14 @@ ProviderDetailPane::ProviderDetailPane(QWidget *parent)
|
|||||||
m_apiKeySaveBtn->setEnabled(false);
|
m_apiKeySaveBtn->setEnabled(false);
|
||||||
m_apiKeyClearBtn = new QPushButton(tr("Clear"), this);
|
m_apiKeyClearBtn = new QPushButton(tr("Clear"), this);
|
||||||
m_apiKeyClearBtn->setToolTip(tr("Erase the stored API key for this provider"));
|
m_apiKeyClearBtn->setToolTip(tr("Erase the stored API key for this provider"));
|
||||||
|
m_legacyKeyBtn = new QPushButton(tr("Insert legacy key"), this);
|
||||||
|
m_legacyKeyBtn->setVisible(false);
|
||||||
|
connect(m_legacyKeyBtn, &QPushButton::clicked, this, [this] {
|
||||||
|
if (m_legacyKeyValue.isEmpty())
|
||||||
|
return;
|
||||||
|
m_apiKeyEdit->setText(m_legacyKeyValue);
|
||||||
|
m_revealKeyBtn->setChecked(true);
|
||||||
|
});
|
||||||
connect(m_apiKeyEdit, &QLineEdit::textChanged, this, [this](const QString &t) {
|
connect(m_apiKeyEdit, &QLineEdit::textChanged, this, [this](const QString &t) {
|
||||||
m_apiKeySaveBtn->setEnabled(!t.isEmpty());
|
m_apiKeySaveBtn->setEnabled(!t.isEmpty());
|
||||||
});
|
});
|
||||||
@@ -189,7 +198,8 @@ ProviderDetailPane::ProviderDetailPane(QWidget *parent)
|
|||||||
credGrid->setVerticalSpacing(4);
|
credGrid->setVerticalSpacing(4);
|
||||||
FormBuilder credForm(credGrid);
|
FormBuilder credForm(credGrid);
|
||||||
credForm.row(tr("API key:"), keyRow);
|
credForm.row(tr("API key:"), keyRow);
|
||||||
credGrid->addWidget(m_keyHint, credForm.currentRow(), 1);
|
credGrid->addWidget(m_legacyKeyBtn, credForm.currentRow(), 1, Qt::AlignLeft);
|
||||||
|
credGrid->addWidget(m_keyHint, credForm.currentRow() + 1, 1);
|
||||||
credSection->bodyLayout()->addLayout(credGrid);
|
credSection->bodyLayout()->addLayout(credGrid);
|
||||||
|
|
||||||
m_launchSection = new SectionBox(tr("Launch"), this);
|
m_launchSection = new SectionBox(tr("Launch"), this);
|
||||||
@@ -318,6 +328,18 @@ void ProviderDetailPane::populate(const Providers::ProviderInstance &inst, bool
|
|||||||
m_keyHint->setText(tr("No key stored yet. Type a key and press Save key."));
|
m_keyHint->setText(tr("No key stored yet. Type a key and press Save key."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LegacyApiKeyEntry legacy
|
||||||
|
= needsKey ? legacyApiKeyForClientApi(inst.clientApi) : LegacyApiKeyEntry{};
|
||||||
|
m_legacyKeyValue = legacy.value;
|
||||||
|
if (!legacy.value.isEmpty()) {
|
||||||
|
m_legacyKeyBtn->setToolTip(
|
||||||
|
tr("Insert the API key saved in the old %1 settings into the field.")
|
||||||
|
.arg(legacy.label));
|
||||||
|
m_legacyKeyBtn->setVisible(true);
|
||||||
|
} else {
|
||||||
|
m_legacyKeyBtn->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
m_samplePreview->setText(
|
m_samplePreview->setText(
|
||||||
QStringLiteral("# sample request line\nPOST %1/<agent endpoint>").arg(inst.url));
|
QStringLiteral("# sample request line\nPOST %1/<agent endpoint>").arg(inst.url));
|
||||||
applyPreviewPalette();
|
applyPreviewPalette();
|
||||||
@@ -348,6 +370,8 @@ void ProviderDetailPane::clear()
|
|||||||
m_apiKeySaveBtn->setEnabled(false);
|
m_apiKeySaveBtn->setEnabled(false);
|
||||||
m_apiKeyClearBtn->setEnabled(false);
|
m_apiKeyClearBtn->setEnabled(false);
|
||||||
m_revealKeyBtn->setEnabled(false);
|
m_revealKeyBtn->setEnabled(false);
|
||||||
|
m_legacyKeyValue.clear();
|
||||||
|
m_legacyKeyBtn->setVisible(false);
|
||||||
m_samplePreview->clear();
|
m_samplePreview->clear();
|
||||||
m_rawToml->clear();
|
m_rawToml->clear();
|
||||||
m_editBtn->setVisible(false);
|
m_editBtn->setVisible(false);
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ private:
|
|||||||
QLabel *m_keyHint = nullptr;
|
QLabel *m_keyHint = nullptr;
|
||||||
QPushButton *m_apiKeySaveBtn = nullptr;
|
QPushButton *m_apiKeySaveBtn = nullptr;
|
||||||
QPushButton *m_apiKeyClearBtn = nullptr;
|
QPushButton *m_apiKeyClearBtn = nullptr;
|
||||||
|
QPushButton *m_legacyKeyBtn = nullptr;
|
||||||
|
QString m_legacyKeyValue;
|
||||||
|
|
||||||
SectionBox *m_launchSection = nullptr;
|
SectionBox *m_launchSection = nullptr;
|
||||||
QLabel *m_launchEmptyHint = nullptr;
|
QLabel *m_launchEmptyHint = nullptr;
|
||||||
|
|||||||
@@ -21,6 +21,46 @@ ProviderSettings &providerSettings()
|
|||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LegacyApiKeyEntry legacyApiKeyForClientApi(const QString &clientApi)
|
||||||
|
{
|
||||||
|
ProviderSettings &s = providerSettings();
|
||||||
|
QString label;
|
||||||
|
QString value;
|
||||||
|
|
||||||
|
if (clientApi == "Claude") {
|
||||||
|
label = QStringLiteral("Claude");
|
||||||
|
value = s.claudeApiKey();
|
||||||
|
} else if (clientApi == "OpenRouter") {
|
||||||
|
label = QStringLiteral("OpenRouter");
|
||||||
|
value = s.openRouterApiKey();
|
||||||
|
} else if (clientApi == "OpenAI Compatible") {
|
||||||
|
label = QStringLiteral("OpenAI Compatible");
|
||||||
|
value = s.openAiCompatApiKey();
|
||||||
|
} else if (clientApi == "OpenAI (Chat Completions)" || clientApi == "OpenAI (Responses API)") {
|
||||||
|
label = QStringLiteral("OpenAI");
|
||||||
|
value = s.openAiApiKey();
|
||||||
|
} else if (clientApi == "Mistral AI") {
|
||||||
|
label = QStringLiteral("Mistral AI");
|
||||||
|
value = s.mistralAiApiKey();
|
||||||
|
} else if (clientApi == "Codestral") {
|
||||||
|
label = QStringLiteral("Codestral");
|
||||||
|
value = s.codestralApiKey();
|
||||||
|
} else if (clientApi == "Google AI") {
|
||||||
|
label = QStringLiteral("Google AI");
|
||||||
|
value = s.googleAiApiKey();
|
||||||
|
} else if (clientApi == "Ollama (Native)" || clientApi == "Ollama (OpenAI-compatible)") {
|
||||||
|
label = QStringLiteral("Ollama (Bearer)");
|
||||||
|
value = s.ollamaBasicAuthApiKey();
|
||||||
|
} else if (clientApi == "llama.cpp") {
|
||||||
|
label = QStringLiteral("llama.cpp");
|
||||||
|
value = s.llamaCppApiKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.isEmpty())
|
||||||
|
return {};
|
||||||
|
return {label, value};
|
||||||
|
}
|
||||||
|
|
||||||
ProviderSettings::ProviderSettings()
|
ProviderSettings::ProviderSettings()
|
||||||
{
|
{
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
@@ -256,8 +296,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef QODEASSIST_EXPERIMENTAL
|
|
||||||
const ProviderSettingsPage providerSettingsPage;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace QodeAssist::Settings
|
} // namespace QodeAssist::Settings
|
||||||
|
|||||||
@@ -39,4 +39,12 @@ private:
|
|||||||
|
|
||||||
ProviderSettings &providerSettings();
|
ProviderSettings &providerSettings();
|
||||||
|
|
||||||
|
struct LegacyApiKeyEntry
|
||||||
|
{
|
||||||
|
QString label;
|
||||||
|
QString value;
|
||||||
|
};
|
||||||
|
|
||||||
|
LegacyApiKeyEntry legacyApiKeyForClientApi(const QString &clientApi);
|
||||||
|
|
||||||
} // namespace QodeAssist::Settings
|
} // namespace QodeAssist::Settings
|
||||||
|
|||||||
@@ -6,7 +6,4 @@ add_subdirectory(providers)
|
|||||||
add_subdirectory(templates)
|
add_subdirectory(templates)
|
||||||
add_subdirectory(agents)
|
add_subdirectory(agents)
|
||||||
add_subdirectory(providersConfig)
|
add_subdirectory(providersConfig)
|
||||||
|
add_subdirectory(settings)
|
||||||
if(QODEASSIST_EXPERIMENTAL)
|
|
||||||
add_subdirectory(settings)
|
|
||||||
endif()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user