mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 19:09:14 -04:00
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
// Copyright (C) 2026 Petr Mironychev
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QStringList>
|
|
#include <QVector>
|
|
|
|
#include "AgentSkill.hpp"
|
|
|
|
class QFileSystemWatcher;
|
|
|
|
namespace QodeAssist::Skills {
|
|
|
|
class SkillsManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SkillsManager(QObject *parent = nullptr);
|
|
|
|
void configure(
|
|
const QString &projectPath,
|
|
const QStringList &globalRoots,
|
|
const QStringList &projectSubdirs);
|
|
|
|
void reload();
|
|
|
|
QVector<AgentSkill> skills() const;
|
|
|
|
std::optional<AgentSkill> findByName(const QString &name) const;
|
|
|
|
static QStringList resolveRoots(
|
|
const QString &projectPath,
|
|
const QStringList &globalRoots,
|
|
const QStringList &projectSubdirs);
|
|
|
|
QString catalogText() const;
|
|
|
|
QString alwaysOnBodies() const;
|
|
|
|
signals:
|
|
void skillsChanged();
|
|
|
|
private:
|
|
void updateWatcher(const QStringList &roots);
|
|
|
|
QString m_projectPath;
|
|
QStringList m_globalRoots;
|
|
QStringList m_projectSubdirs;
|
|
QVector<AgentSkill> m_skills;
|
|
QFileSystemWatcher *m_watcher = nullptr;
|
|
};
|
|
|
|
} // namespace QodeAssist::Skills
|