using UnityEngine;
using System.Collections.Generic;
namespace LLM.Editor.Analysis
{
///
/// A static registry that holds all the available "tools" (Context Providers)
/// that the LLM can use to query the project.
///
public static class ContextProviderRegistry
{
private static readonly Dictionary _providers = new();
// This static constructor will be used in the next phase to register all our tools.
static ContextProviderRegistry()
{
RegisterProvider("ComponentData", new ComponentDataProvider());
RegisterProvider("SourceCode", new SourceCodeProvider());
RegisterProvider("ProjectSettings", new ProjectSettingsProvider());
RegisterProvider("FindAssets", new FindAssetsProvider());
RegisterProvider("FindInScene", new FindInSceneProvider());
RegisterProvider("ConsoleLog", new ConsoleLogProvider());
}
private static void RegisterProvider(string dataType, IContextProvider provider)
{
if (string.IsNullOrEmpty(dataType) || provider == null) return;
_providers[dataType] = provider;
}
public static IContextProvider GetProvider(string dataType)
{
_providers.TryGetValue(dataType, out var provider);
return provider;
}
}
}