import type { PromptHistoryEntry, PromptLabel, PromptStore, PromptVersion } from '../types/prompts.js'; import { type PostgresLikeClient } from './client.js'; /** Options for the Postgres prompt store. */ export interface PostgresPromptStoreOptions { /** Table name prefix, optionally schema-qualified. Defaults to `nexus_prompt`, for `nexus_prompt_versions` and so on. */ table?: string; } /** The schema for the prompt store, as statements. */ export declare function promptStoreMigration(options?: PostgresPromptStoreOptions): string[]; /** * Prompt versions, labels, and history in Postgres. * * Label compare-and-set is a single statement — an insert that does nothing on conflict, or an update * that matches only the expected version — so two workers promoting at once cannot both win. */ export declare class PostgresPromptStore implements PromptStore { private readonly client; private readonly options; private readonly versions; private readonly labels; private readonly history; constructor(client: PostgresLikeClient, options?: PostgresPromptStoreOptions); /** Creates the prompt tables if they do not exist. Never runs implicitly. */ migrate(): Promise; /** Stores a version, unless one with the same content version exists. */ saveVersion(version: PromptVersion): Promise; /** Reads a version. */ getVersion(name: string, version: string): Promise; /** Versions of a prompt, newest first. Defaults to 50. */ listVersions(name: string, options?: { limit?: number; }): Promise; /** Reads a label. */ getLabel(name: string, label: string): Promise; /** Every label of a prompt, sorted by name. */ listLabels(name: string): Promise; /** Writes a label when it still points at `expected`, in one statement. */ setLabel(label: PromptLabel, expected?: string | null): Promise; /** Removes a label. Resolves true when it existed. */ deleteLabel(name: string, label: string): Promise; /** Records a change. */ appendHistory(entry: PromptHistoryEntry): Promise; /** A prompt's history, newest first, optionally for one label. Defaults to 100. */ listHistory(name: string, options?: { label?: string; limit?: number; }): Promise; /** Every prompt name, sorted. */ listNames(): Promise; }