import type { ClaimRunOwnershipInput, ClaimRunOwnershipResult, RenewRunOwnershipInput, RenewRunOwnershipResult, RunFence, RunOwnershipRecord, WorkflowRun, WorkflowRuns, StorageListWorkflowRunsInput, UpdateWorkflowStateOptions, PruneOptions, PruneResult, RetentionTablesDescriptor, TableRetentionPolicy } from '@mastra/core/storage'; import { WorkflowsStorage } from '@mastra/core/storage'; import type { StepResult, WorkflowRunState, WorkflowRunStatus } from '@mastra/core/workflows'; import type { D1DomainConfig } from '../../db/index.js'; export declare class WorkflowsStorageD1 extends WorkflowsStorage { #private; /** * Tables `prune()` can clean up. Run ownership records anchor on `updatedAt` (epoch ms), which every * claim, renewal and release refreshes, so a live execution's record is never * older than its renew interval. */ static readonly retentionTables: RetentionTablesDescriptor; constructor(config: D1DomainConfig); supportsGuardedSnapshotWrites(): boolean; supportsConcurrentUpdates(): boolean; init(): Promise; prune(policies: Record, options?: PruneOptions): Promise; dangerouslyClearAll(): Promise; supportsRunFencing(): boolean; claimRunOwnership({ runId, ownerId, leaseMs, force, expectedGeneration, }: ClaimRunOwnershipInput): Promise; renewRunOwnership({ leaseMs, ...fence }: RenewRunOwnershipInput): Promise; releaseRunOwnership(fence: RunFence): Promise; getRunOwnership({ runId }: { runId: string; }): Promise; updateWorkflowResults(_args: { workflowName: string; runId: string; stepId: string; result: StepResult; requestContext: Record; }): Promise>>; updateWorkflowState(_args: { workflowName: string; runId: string; opts: UpdateWorkflowStateOptions; }): Promise; persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, createdAt, updatedAt, fence, expectedStatus, }: { workflowName: string; runId: string; resourceId?: string; snapshot: WorkflowRunState; createdAt?: Date; updatedAt?: Date; fence?: RunFence; expectedStatus?: WorkflowRunStatus | WorkflowRunStatus[]; }): Promise; loadWorkflowRunStatus({ workflowName, runId, }: { workflowName: string; runId: string; }): Promise; loadWorkflowSnapshot(params: { workflowName: string; runId: string; }): Promise; /** * Maps a row to a workflow run. With `summary`, the row has `summaryFields` instead of the * snapshot. */ private parseWorkflowRun; /** * Lists runs newest first, with optional filters and pagination. With `summary`, each run's * snapshot holds only `status`, `timestamp` and `parentWorkflow`. */ listWorkflowRuns({ workflowName, fromDate, toDate, page, perPage, resourceId, status, summary, }?: StorageListWorkflowRunsInput): Promise; getWorkflowRunById({ runId, workflowName, }: { runId: string; workflowName?: string; }): Promise; deleteWorkflowRunById({ runId, workflowName, fence, }: { runId: string; workflowName: string; fence?: RunFence; }): Promise; } //# sourceMappingURL=index.d.ts.map