/** * `resumeWorkflowFromStorage()`'s guts — split out of `resume.ts`, which has * no headroom under the repository's 500-line implementation-file ceiling * for the WFT-134 claim-release wrapping added around this logic (mirrors * `resume-generation-guard.ts`'s same split). `resume.ts` itself is now just * the public entry point: load/validate state, acquire a claim if needed, * and call {@link performResumeAfterClaimAcquired} below inside the * claim-release `try`/`catch`. * * @module core/engine/lifecycle/resume-body */ import { type EventHeadRecord } from '../../event-log.ts'; import type { Checkpoint, WorkflowState } from '../../types.ts'; import { type WorkflowVersionTuple } from '../../workflow-version-tuple.ts'; import { type WorkflowHandle } from '../handles.ts'; import type { EngineInternals } from '../internals.ts'; import { deriveResumeGeneration } from './resume-generation-guard.ts'; import { type LifecycleCallbacks, type RecoverAllOptions, type RegistrationEntry } from './shared.ts'; export type SerializedResumeArgs = { workflowId: string; resumeCheckpoint: Checkpoint; serializedCheckpoint: Uint8Array; registeredVersionTuple: WorkflowVersionTuple; restoredHead: EventHeadRecord; workflowStartHeaders: Map | undefined; registration: RegistrationEntry; /** * The EXACT revision `registration` resolved against, NOT `state.revision` * re-read independently (WFT-19 round 5): a legacy record with one registered * candidate has `state.revision === undefined` even though the resolver * resolved it — caching `state.revision` here would disable exact-revision lookup. */ resolvedRevision: string | undefined; expectedGeneration: ReturnType; callbacks: LifecycleCallbacks; }; /** * Everything `resumeWorkflowFromStorage` does once a claim (if any) is * acquired: load tracking/checkpoint/registration state, prepare the resume, * and either relaunch inline or in a worker. `resumeWorkflowFromStorage` * itself just wraps a call to this in the WFT-134 claim-release * `try`/`catch`. */ export declare function performResumeAfterClaimAcquired(internals: EngineInternals, workflowId: string, state: WorkflowState, dispatchResumedEvent: boolean, callbacks: LifecycleCallbacks, onRecoveredWorkflow?: RecoverAllOptions['onRecoveredWorkflow']): Promise;