using ColaFlow.Modules.Mcp.Contracts.Resources;

namespace ColaFlow.Modules.Mcp.Application.Services;

/// <summary>
/// Registry for all MCP Resources
/// Manages resource discovery, routing, and categorization
/// </summary>
public interface IMcpResourceRegistry
{
    /// <summary>
    /// Register a resource
    /// </summary>
    void RegisterResource(IMcpResource resource);

    /// <summary>
    /// Get all registered resources
    /// </summary>
    IReadOnlyList<IMcpResource> GetAllResources();

    /// <summary>
    /// Get resource by URI (supports URI templates like "colaflow://projects.get/{id}")
    /// </summary>
    IMcpResource? GetResourceByUri(string uri);

    /// <summary>
    /// Get all resource descriptors (for resources/list method)
    /// </summary>
    IReadOnlyList<McpResourceDescriptor> GetResourceDescriptors();

    /// <summary>
    /// Get resources by category
    /// </summary>
    IReadOnlyList<IMcpResource> GetResourcesByCategory(string category);

    /// <summary>
    /// Get all categories
    /// </summary>
    IReadOnlyList<string> GetCategories();

    /// <summary>
    /// Get resources grouped by category
    /// </summary>
    IReadOnlyDictionary<string, List<IMcpResource>> GetResourcesGroupedByCategory();
}
