import type { ListScoresResponse, SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals'; import type { CreateIndexOptions, PruneOptions, PruneResult, RetentionTablesDescriptor, ScoreTenancyFilters, StoragePagination, TableRetentionPolicy } from '@mastra/core/storage'; import { ScoresStorage } from '@mastra/core/storage'; import type { PgDomainConfig } from '../../db/index.js'; export declare class ScoresPG extends ScoresStorage { #private; /** Tables managed by this domain */ static readonly MANAGED_TABLES: readonly ["mastra_scorers"]; /** * Scorer results accumulate as evals run. Single table, anchored on the * timezone-aware `createdAtZ` mirror column (kept in sync by triggers). */ 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; /** * Returns default index definitions for the scores domain tables. * @param schemaPrefix - Prefix for index names (e.g. "my_schema_" or "") */ static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[]; /** * Returns all DDL statements for this domain: table and indexes. * Used by exportSchemas to produce a complete, reproducible schema export. */ static getExportDDL(schemaName?: string): string[]; /** * Returns default index definitions for this instance's schema. */ getDefaultIndexDefinitions(): CreateIndexOptions[]; /** * Creates default indexes for optimal query performance. */ createDefaultIndexes(): Promise; /** * Creates custom user-defined indexes for this domain's tables. */ createCustomIndexes(): Promise; dangerouslyClearAll(): Promise; /** Delete scorer results older than the `scorers` policy's `maxAge`, batched. */ prune(policies: Record, options?: PruneOptions): Promise; getScoreById({ id }: { id: string; }): Promise; listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, filters, }: { scorerId: string; pagination: StoragePagination; entityId?: string; entityType?: string; source?: ScoringSource; filters?: ScoreTenancyFilters; }): Promise; saveScore(score: SaveScorePayload): Promise<{ score: ScoreRowData; }>; listScoresByRunId({ runId, pagination, filters, }: { runId: string; pagination: StoragePagination; filters?: ScoreTenancyFilters; }): Promise; listScoresByEntityId({ entityId, entityType, pagination, filters, }: { pagination: StoragePagination; entityId: string; entityType: string; filters?: ScoreTenancyFilters; }): Promise; listScoresBySpan({ traceId, spanId, pagination, filters, }: { traceId: string; spanId: string; pagination: StoragePagination; filters?: ScoreTenancyFilters; }): Promise; } //# sourceMappingURL=index.d.ts.map