// Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; using System.Threading.Tasks; namespace Microsoft.Agents.AI.Workflows.Checkpointing; /// /// A manager for storing and retrieving workflow execution checkpoints. /// internal interface ICheckpointManager { /// /// Commits the specified checkpoint and returns information that can be used to retrieve it later. /// /// The identifier for the current run or execution context. /// The checkpoint to commit. /// A representing the incoming checkpoint. ValueTask CommitCheckpointAsync(string runId, Checkpoint checkpoint); /// /// Retrieves the checkpoint associated with the specified checkpoint information. /// /// The identifier for the current run of execution context. /// The information used to identify the checkpoint. /// A representing the asynchronous operation. The result contains the associated with the specified . /// Thrown if the checkpoint is not found. ValueTask LookupCheckpointAsync(string runId, CheckpointInfo checkpointInfo); /// /// Asynchronously retrieves the collection of checkpoint information for the specified run identifier, optionally /// filtered by a parent checkpoint. /// /// The unique identifier of the run for which to retrieve checkpoint information. Cannot be null or empty. /// An optional parent checkpoint to filter the results. If specified, only checkpoints with the given parent are /// returned; otherwise, all checkpoints for the run are included. /// A value task representing the asynchronous operation. The result contains a collection of objects associated with the specified run. The collection is empty if no checkpoints are /// found. ValueTask> RetrieveIndexAsync(string runId, CheckpointInfo? withParent = null); }