#pragma once

#include <grove/IIO.h>
#include <string>

namespace celuna {

/**
 * @brief Interface for infrastructure services
 *
 * Services handle non-hot-reloadable infrastructure:
 * - LLM HTTP calls
 * - SQLite database
 * - Platform APIs (Win32/X11)
 * - TTS/STT engines
 *
 * Services communicate with modules via IIO pub/sub.
 */
class IService {
public:
    virtual ~IService() = default;

    /// Initialize the service with IIO for pub/sub
    virtual bool initialize(grove::IIO* io) = 0;

    /// Process pending work (called each frame from main loop)
    virtual void process() = 0;

    /// Clean shutdown
    virtual void shutdown() = 0;

    /// Service name for logging
    virtual std::string getName() const = 0;

    /// Check if service is healthy
    virtual bool isHealthy() const = 0;
};

} // namespace celuna
