#ifndef PLAYBOOKMANAGER_H
#define PLAYBOOKMANAGER_H

#include <QObject>
#include <QString>
#include <QList>
#include <QStringList>

struct PlaybookInfo {
    QString name;
    QString purpose;
    QStringList tags;
};

class PlaybookManager : public QObject
{
    Q_OBJECT

public:
    explicit PlaybookManager(QObject *parent = nullptr);

    QList<PlaybookInfo> getPlaybooks() const;
    bool addPlaybook(const QString &path);
    bool removePlaybook(const QString &name);
    bool editPlaybook(const QString &name, const QString &content);
    QString getPlaybookContent(const QString &name) const;

signals:
    void playbooksChanged();
    void errorOccurred(const QString &error);

private:
    QList<PlaybookInfo> m_playbooks;

    PlaybookInfo parsePlaybook(const QString &content) const;
};

#endif // PLAYBOOKMANAGER_H

