import type { ResolvedBranding } from '../app-config/branding';
import type { ResolvedAppConfig, ResolvedIntegration, ResolvedKnowledge, ResolvedTranslation } from '../app-config/runtime';
import type { OpRef } from '../features';
import type { SecretProviderPort, TranslationResolver } from '../types';
import type { GuardCondition, Step, WorkflowExecutionErrorKind, WorkflowRegistry } from './spec';
import type { StateStore, WorkflowState } from './state';
export interface OperationExecutorContext {
    workflow: WorkflowState;
    step: Step;
    resolvedAppConfig?: ResolvedAppConfig;
    integrations?: ResolvedIntegration[];
    knowledge?: ResolvedKnowledge[];
    branding?: ResolvedBranding;
    translation?: ResolvedTranslation;
    translationResolver?: TranslationResolver;
    secretProvider?: SecretProviderPort;
}
export type OperationExecutor = (op: OpRef, input: unknown, context: OperationExecutorContext) => Promise<unknown>;
export type WorkflowPreFlightIssueType = 'integration' | 'capability';
export type WorkflowPreFlightIssueSeverity = 'error' | 'warning';
export interface WorkflowPreFlightIssue {
    stepId: string;
    type: WorkflowPreFlightIssueType;
    identifier: string;
    severity: WorkflowPreFlightIssueSeverity;
    reason: string;
}
export interface WorkflowPreFlightResult {
    canStart: boolean;
    issues: WorkflowPreFlightIssue[];
}
export interface GuardContext {
    workflow: WorkflowState;
    step: Step;
    input?: unknown;
}
export type GuardEvaluator = (guard: GuardCondition, context: GuardContext) => Promise<boolean> | boolean;
export interface WorkflowRunnerConfig {
    registry: WorkflowRegistry;
    stateStore: StateStore;
    opExecutor: OperationExecutor;
    guardEvaluator?: GuardEvaluator;
    eventEmitter?: (event: string, payload: Record<string, unknown>) => void;
    appConfigProvider?: (state: WorkflowState) => ResolvedAppConfig | undefined | Promise<ResolvedAppConfig | undefined>;
    enforceCapabilities?: (operation: OpRef, context: OperationExecutorContext) => void | Promise<void>;
    secretProvider?: SecretProviderPort;
    translationResolver?: TranslationResolver;
}
export declare class WorkflowRunner {
    private readonly config;
    constructor(config: WorkflowRunnerConfig);
    preFlightCheck(workflowName: string, version?: string, // Update to string
    resolvedConfig?: ResolvedAppConfig): Promise<WorkflowPreFlightResult>;
    start(workflowName: string, version?: string, initialData?: Record<string, unknown>): Promise<string>;
    executeStep(workflowId: string, input?: unknown): Promise<void>;
    rollback(workflowId: string): Promise<void>;
    getState(workflowId: string): Promise<WorkflowState>;
    pause(workflowId: string): Promise<void>;
    resume(workflowId: string): Promise<void>;
    cancel(workflowId: string): Promise<void>;
    private performPreFlight;
    private evaluateGuard;
    private runStepAction;
    private executeWithStepTimeout;
    private pickNextStepId;
    private getSpec;
    private getStateOrThrow;
    private emit;
}
export declare class WorkflowPreFlightError extends Error {
    readonly issues: WorkflowPreFlightIssue[];
    constructor(issues: WorkflowPreFlightIssue[]);
}
export declare class WorkflowExecutionError extends Error {
    readonly kind: WorkflowExecutionErrorKind;
    constructor(message: string, kind: WorkflowExecutionErrorKind);
}
