import type { BackgroundTask, TaskFilter, TaskListResult, UpdateBackgroundTask } from '@mastra/core/background-tasks'; import type { CreateIndexOptions, PruneOptions, PruneResult, RetentionTablesDescriptor, TableRetentionPolicy } from '@mastra/core/storage'; import { BackgroundTasksStorage } from '@mastra/core/storage'; import type { PgDomainConfig } from '../../db/index.js'; export declare class BackgroundTasksPG extends BackgroundTasksStorage { #private; static readonly MANAGED_TABLES: readonly ["mastra_background_tasks"]; /** * Completed background tasks accumulate as dead weight. Anchored on the * timezone-aware `completedAtZ` mirror column: NULL (in-flight) rows are * excluded automatically since `completedAtZ < cutoff` is false for NULL. */ static readonly retentionTables: RetentionTablesDescriptor; constructor(config: PgDomainConfig); init(): Promise; /** * Lazily ensures a btree index exists on each configured policy's retention * anchor column so age-based `prune()` deletes stay fast on large tables. * Called from the prune path (not init) so only deployments that configure * retention pay the index's write/disk overhead. Best-effort: failures are * logged and pruning proceeds (correct, just slower). * Created even with `skipDefaultIndexes` — retention is an explicit opt-in, * so its supporting index is not part of the default index set. */ private ensureRetentionIndexes; /** Delete completed tasks older than the `backgroundTasks` policy's `maxAge`, batched. */ prune(policies: Record, options?: PruneOptions): Promise; static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[]; static getExportDDL(schemaName?: string): string[]; getDefaultIndexDefinitions(): CreateIndexOptions[]; createDefaultIndexes(): Promise; createCustomIndexes(): Promise; dangerouslyClearAll(): Promise; createTask(task: BackgroundTask): Promise; updateTask(taskId: string, update: UpdateBackgroundTask, options?: { expectedStatus?: BackgroundTask['status']; }): Promise; getTask(taskId: string): Promise; listTasks(filter: TaskFilter): Promise; deleteTask(taskId: string): Promise; deleteTasks(filter: TaskFilter): Promise; getRunningCount(): Promise; getRunningCountByAgent(agentId: string): Promise; } //# sourceMappingURL=index.d.ts.map