using Nexus.Api.Models;

namespace Nexus.Api.Services;

public interface IOpenClawRunService
{
    Task<OpenClawRunCollectionDto> GetAsync(
        OpenClawRunQuery query,
        CancellationToken cancellationToken = default);
    Task<OpenClawRunDto?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);
    Task<OpenClawRunOperationDto> StartAsync(
        StartOpenClawRunRequest request,
        OpenClawInvocationMetadata invocation,
        CancellationToken cancellationToken = default);
    Task<OpenClawRunOperationDto?> StopAsync(
        Guid id,
        string? reason,
        OpenClawInvocationMetadata invocation,
        CancellationToken cancellationToken = default);
    Task<OpenClawRunOperationDto?> ResumeAsync(
        Guid id,
        string? reason,
        OpenClawInvocationMetadata invocation,
        CancellationToken cancellationToken = default);
    Task<OpenClawRunOperationDto?> RetryAsync(
        Guid id,
        string? reason,
        OpenClawInvocationMetadata invocation,
        CancellationToken cancellationToken = default);
    Task<OpenClawRunHistoryResponse?> GetHistoryAsync(
        Guid id,
        int gatewayLimit = 200,
        CancellationToken cancellationToken = default);
    Task ReconcileAsync(
        GatewayEventEnvelope gatewayEvent,
        CancellationToken cancellationToken = default);
}
