import type { Checkpoint, SearchAttributeValue, Serializer, WorkflowId } from '../types.ts'; /** * Create a fresh checkpoint for a new workflow. * * @example * ```ts * import { createCheckpoint } from '@lostgradient/weft'; * * const checkpoint = createCheckpoint('wf-789', '1.0.0'); * console.log(checkpoint.workflowId); // 'wf-789' * console.log(checkpoint.step); // 0 * console.log(checkpoint.version); // '1.0.0' * ``` */ export declare function createCheckpoint(workflowId: WorkflowId, version: string, now?: number, workflowExecutionToken?: string): Checkpoint; /** * Advance a checkpoint to the next step with new locals. * * @example * ```ts * import { createCheckpoint, advanceCheckpoint } from '@lostgradient/weft'; * * const checkpoint = createCheckpoint('wf-abc', '1.0.0'); * const next = advanceCheckpoint(checkpoint, { userId: 'u-1', status: 'active' }); * console.log(next.step); // 1 * console.log(next.locals['userId']); // 'u-1' * ``` */ export declare function advanceCheckpoint(checkpoint: Checkpoint, locals: Record, options?: { searchAttributes?: Record; accumulatedResults?: Array<[number, unknown]>; accumulatedResultReplayWatermark?: number; workerReplaySignatures?: Checkpoint['workerReplaySignatures']; workerReplayFailures?: Checkpoint['workerReplayFailures']; now?: number; }): Checkpoint; /** * Get the serialized size of a checkpoint in bytes. * * @example * ```ts * import { createCheckpoint, advanceCheckpoint, checkpointSizeBytes } from '@lostgradient/weft'; * * const cp = advanceCheckpoint( * createCheckpoint('wf-size', '1.0.0'), * { items: Array.from({ length: 100 }, (_, i) => i) }, * ); * const bytes = checkpointSizeBytes(cp); * console.log(bytes > 0); // true * ``` */ export declare function checkpointSizeBytes(checkpoint: Checkpoint, serializer?: Serializer): number;