// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Agents.AI.Workflows;
///
/// Debug information about the SuperStep that finished running.
///
public sealed class SuperStepCompletionInfo(IEnumerable activatedExecutors, IEnumerable? instantiatedExecutors = null)
{
///
/// The unique identifiers of instances that processed messages during this SuperStep
///
public HashSet ActivatedExecutors { get; } = [.. Throw.IfNull(activatedExecutors)];
///
/// The unique identifiers of instances newly created during this SuperStep
///
public HashSet InstantiatedExecutors { get; } = [.. instantiatedExecutors ?? []];
///
/// A flag indicating whether the managed state was written to during this SuperStep. If the run was started
/// with checkpointing, any updated during the checkpointing process are also included.
///
public bool StateUpdated { get; init; }
///
/// A flag indicating whether there are messages pending delivery after this SuperStep.
///
public bool HasPendingMessages { get; init; }
///
/// A flag indicating whether there are requests pending delivery after this SuperStep.
///
public bool HasPendingRequests { get; init; }
///
/// Gets the corresponding to the checkpoint created at the end of this SuperStep.
/// if checkpointing was not enabled when the run was started.
///
public CheckpointInfo? Checkpoint { get; init; }
}