using JetBrains.Annotations; using LLM.Editor.Data; using LLM.Editor.Helper; using UnityEngine; namespace LLM.Editor.Commands { // Parameters for this command [System.Serializable] public class DisplayMessageParams { public CommandOutcome outcome; public string message; } [UsedImplicitly] public class DisplayMessageCommand : ICommand { private readonly DisplayMessageParams _params; public DisplayMessageCommand(string jsonParams) { _params = jsonParams?.FromJson(); } public DisplayMessageCommand(DisplayMessageParams param) { _params = param; } public CommandOutcome Execute(CommandContext context) { if (_params == null || string.IsNullOrEmpty(_params.message)) { Debug.LogError("[DisplayMessageCommand] Parameters are invalid or message is empty."); return CommandOutcome.Error; } if (_params.outcome == CommandOutcome.Success) { Debug.Log($"[MCP]: {_params.message}"); } else { Debug.LogError($"[MCP]: {_params.message}"); } return CommandOutcome.Success; } } }