import type { WorkflowEngine } from '../../../core/workflow/index.js'; import type { SessionLog } from '../../../infra/fs/index.js'; import type { WorkflowAbortKind } from '../../../core/workflow/types.js'; import type { RunFailure } from '../../../core/workflow/run/run-meta.js'; import type { ProviderType, StreamEvent } from '../../../shared/types/provider.js'; import type { UsageEventLogger } from '../../../core/logging/usageEventLogger.js'; import { StreamDisplay } from '../../../shared/ui/index.js'; import type { ExceededInfo, WorkflowExecutionEvent, WorkflowExecutionOptions } from './types.js'; import { type WorkflowTerminalPayloadFactory, type WorkflowTerminalPublicationPayload } from './workflowTerminalPayload.js'; import { type RunFinalizationIssue } from './workflowRunExecution.js'; export interface WorkflowExecutionEventState { abortReason?: string; abortKind?: WorkflowAbortKind; failure?: RunFailure; exceededInfo?: ExceededInfo; lastStepContent?: string; lastStepName?: string; currentStepName?: string; lastResumePoint?: WorkflowExecutionOptions['resumePoint']; currentIteration: number; sessionLog: SessionLog; } interface WorkflowExecutionEventBridgeDeps { engine: WorkflowEngine; workflowConfig: { name: string; steps: Array<{ name: string; }>; maxSteps: number | 'infinite'; }; currentProvider: ProviderType; configuredModel: string | undefined; out: ReturnType; prefixWriter: import('../../../shared/ui/TaskPrefixWriter.js').TaskPrefixWriter | undefined; displayRef: { current: StreamDisplay | null; }; handlerRef: { current: ReturnType | null; }; usageEventLogger: UsageEventLogger; analyticsEmitter: import('./analyticsEmitter.js').AnalyticsEmitter; sessionLogger: import('./sessionLogger.js').SessionLogger; runMetaManager: import('./runMeta.js').RunMetaManager; shouldNotifyRateLimit: boolean; initialResumePoint: WorkflowExecutionOptions['resumePoint']; sessionLog: SessionLog; eventSink: WorkflowExecutionOptions['eventSink']; terminalPayloads: WorkflowTerminalPayloadFactory; } export interface WorkflowExecutionEventBridge { state: WorkflowExecutionEventState; syncLatestResumePoint: () => void; getFinalizationIssues: () => readonly RunFinalizationIssue[]; getStagedAbort: () => { readonly iteration: number; readonly reason: string; readonly kind: WorkflowAbortKind; readonly status: 'aborted' | 'failed'; } | undefined; emitRunStarted: (event: Extract) => void; stageWorkflowFailure: (iteration: number, reason: string, status: 'aborted' | 'failed') => void; stageHeartbeatFailure: (iteration: number, reason: string, status: 'aborted' | 'failed') => void; prepareTerminalPublicationPayload: () => WorkflowTerminalPublicationPayload; emitProviderOutput: (event: StreamEvent) => void; emitTerminalFeedback: (event: Extract) => void; flushEventSink: () => Promise; } export declare function bindWorkflowExecutionEvents(deps: WorkflowExecutionEventBridgeDeps): WorkflowExecutionEventBridge; export {}; //# sourceMappingURL=workflowExecutionEvents.d.ts.map