using UnityEditor;
using UnityEngine;

namespace LLM.Editor.Analysis
{
    /// <summary>
    /// Provides context about the current state of the Unity Editor (Play, Edit, Paused).
    /// </summary>
    public class EditorStateProvider : IContextProvider
    {
        public class EditorStateResult
        {
            public string currentState;
        }
        
        public object GetContext(Object target, string qualifier)
        {
            var state = "EditMode";
            if (EditorApplication.isPlaying)
            {
                state = EditorApplication.isPaused ? "Paused" : "PlayMode";
            }

            return new EditorStateResult { currentState = state };
        }
    }
}
