import { type ConnectionId, type CredentialReferenceId, type ChangeSetId, type MutationContext } from "@awp/contracts";
import type { DurableWorkflowProvider, FactoryProvider } from "./ports/providers.js";
import type { UnitOfWork } from "./ports/repositories.js";
import { type DurableWorkflowStepRunner } from "./durable-step.js";
import type { AutoMergeContinuation, AutoMergeReconciler, AutoMergeReconciliationResult, ExecutionDispatcher, ExecutionSelection } from "./execution.js";
export declare const I1_DURABLE_DISPATCH_WORKFLOW_KIND = "i1-task-dispatch";
export declare const I1_DURABLE_AUTOMERGE_WORKFLOW_KIND = "i1-changeset-automerge";
export interface DurableExecutionWorkflowInput {
    readonly factoryRunId: string;
    readonly taskId: string;
    readonly context: MutationContext;
    readonly selection?: ExecutionSelection;
}
export interface ProviderExecutionWorkerConfiguration {
    readonly factoryConnectionId: ConnectionId;
    readonly factoryCredentialReferenceId: CredentialReferenceId;
}
export declare class ProviderExecutionWorker {
    private readonly uow;
    private readonly factoryProvider;
    private readonly downstream;
    private readonly configuration;
    constructor(uow: UnitOfWork, factoryProvider: FactoryProvider, downstream: ExecutionDispatcher, configuration: ProviderExecutionWorkerConfiguration);
    execute(input: DurableExecutionWorkflowInput, workflowSteps?: DurableWorkflowStepRunner): Promise<Readonly<Record<string, unknown>>>;
}
export interface DurableExecutionDispatcherConfiguration {
    readonly workflowConnectionId: ConnectionId;
    readonly workflowCredentialReferenceId: CredentialReferenceId;
    readonly workflowKind?: string;
}
export declare class DurableExecutionDispatcher implements ExecutionDispatcher {
    private readonly workflowProvider;
    private readonly configuration;
    constructor(workflowProvider: DurableWorkflowProvider, configuration: DurableExecutionDispatcherConfiguration);
    dispatch(request: Parameters<ExecutionDispatcher["dispatch"]>[0]): Promise<void>;
}
export interface DurableAutoMergeWorkflowInput {
    readonly changeSetId: string;
    readonly context: MutationContext;
}
export declare class AutoMergeReconciliationWorker {
    private readonly reconciler;
    constructor(reconciler: AutoMergeReconciler);
    execute(input: DurableAutoMergeWorkflowInput, workflowSteps?: DurableWorkflowStepRunner, iteration?: number): Promise<AutoMergeReconciliationResult>;
}
export declare class DurableAutoMergeDispatcher implements AutoMergeContinuation {
    private readonly workflowProvider;
    private readonly configuration;
    constructor(workflowProvider: DurableWorkflowProvider, configuration: DurableExecutionDispatcherConfiguration);
    schedule(changeSetId: ChangeSetId, context: MutationContext): Promise<void>;
}
//# sourceMappingURL=provider-execution.d.ts.map