Fügt CLI-Toolverwaltung und erweiterte UI-Funktionen hinzu
Ermöglicht die Verwaltung (Erstellen, Auflisten, Ausführen) von Tools über eine Befehlszeilenschnittstelle für Automatisierung und Integration. Die Benutzeroberfläche wurde mit dedizierten Ansichten für Toolerstellung und -bearbeitung, In-App-Lua-Hilfe sowie kontextsensitiven Menüs erweitert. Neue Abhängigkeiten (CLI11, rang) wurden integriert und eine umfassende Testsuite hinzugefügt. Die Lizenzierung wurde auf AGPL-3.0 umgestellt und ein Kontributionsleitfaden bereitgestellt.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -18,11 +19,73 @@ struct ToolboxItem {
|
||||
std::string license;
|
||||
};
|
||||
|
||||
struct ToolDraft {
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string luaScript;
|
||||
std::string iconBase64;
|
||||
int timeoutSeconds = 30;
|
||||
std::string templateType = "lua";
|
||||
std::string templateTarget;
|
||||
};
|
||||
|
||||
struct ToolDetails {
|
||||
std::filesystem::path path;
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string luaScript;
|
||||
std::string iconBase64;
|
||||
int timeoutSeconds = 30;
|
||||
std::string templateType = "lua";
|
||||
std::string templateTarget;
|
||||
};
|
||||
|
||||
struct ToolDetailsResult {
|
||||
bool success = false;
|
||||
std::string message;
|
||||
ToolDetails details;
|
||||
};
|
||||
|
||||
struct ToolUpdateDraft {
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string luaScript;
|
||||
std::optional<std::string> iconBase64;
|
||||
int timeoutSeconds = 30;
|
||||
std::string templateType = "lua";
|
||||
std::string templateTarget;
|
||||
};
|
||||
|
||||
struct ToolUpdateResult {
|
||||
bool success = false;
|
||||
std::string message;
|
||||
std::filesystem::path toolPath;
|
||||
};
|
||||
|
||||
struct ToolCreationResult {
|
||||
bool success = false;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
struct ToolDeletionResult {
|
||||
bool success = false;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
class ToolRegistry {
|
||||
public:
|
||||
static std::filesystem::path toolboxDirectory(const std::filesystem::path& userPath);
|
||||
static bool ensureToolboxDirectory(const std::filesystem::path& userPath);
|
||||
static std::vector<ToolboxItem> loadTools(const std::filesystem::path& userPath);
|
||||
static ToolCreationResult createTool(const std::filesystem::path& userPath,
|
||||
const ToolDraft& draft);
|
||||
static ToolDetailsResult getToolDetails(const std::filesystem::path& userPath,
|
||||
const std::filesystem::path& toolPath);
|
||||
static ToolUpdateResult updateTool(const std::filesystem::path& userPath,
|
||||
const std::filesystem::path& toolPath,
|
||||
const ToolUpdateDraft& draft);
|
||||
static ToolDeletionResult deleteTool(const std::filesystem::path& userPath,
|
||||
const std::filesystem::path& toolPath);
|
||||
|
||||
private:
|
||||
static void encodeIcon(const std::filesystem::path& imagePath, ToolboxItem& item);
|
||||
|
||||
Reference in New Issue
Block a user