// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json.Serialization;
namespace Microsoft.Agents.AI.Workflows;
///
/// Base class for SuperStep-scoped events, for example,
///
[JsonDerivedType(typeof(SuperStepStartedEvent))]
[JsonDerivedType(typeof(SuperStepCompletedEvent))]
public class SuperStepEvent(int stepNumber, object? data = null) : WorkflowEvent(data)
{
///
/// The zero-based index of the SuperStep associated with this event.
///
public int StepNumber => stepNumber;
///
public override string ToString() =>
this.Data is not null ?
$"{this.GetType().Name}(Step = {this.StepNumber}, Data: {this.Data.GetType()} = {this.Data})" :
$"{this.GetType().Name}(Step = {this.StepNumber})";
}