using System;

using AIRuntime.Runtime.Providers.Fallback;


namespace AIRuntime.Runtime.Services.Agent
{
    public sealed class AgentRunResult
    {
        public string Response
        {
            get;
            set;
        }


        public string SessionId
        {
            get;
            set;
        }


        public int ToolCallsExecuted
        {
            get;
            set;
        }


        public TimeSpan Duration
        {
            get;
            set;
        }


        public AgentRunStatus Status
        {
            get;
            set;
        }


        public string ErrorMessage
        {
            get;
            set;
        }


        /// <summary>
        /// Structured provider failure metadata, when the run stopped at the
        /// provider boundary. Null means the failure was not provider-classified.
        /// </summary>
        public ProviderFailureKind? ProviderFailureKind
        {
            get;
            set;
        }


        public bool Succeeded
        {
            get
            {
                return Status ==
                       AgentRunStatus.Succeeded;
            }
        }


        public bool Failed
        {
            get
            {
                return Status ==
                       AgentRunStatus.Failed;
            }
        }


        public bool Cancelled
        {
            get
            {
                return Status ==
                       AgentRunStatus.Cancelled;
            }
        }


        public bool TimedOut
        {
            get
            {
                return Status ==
                       AgentRunStatus.TimedOut;
            }
        }
    }
}
