import type { AccessContext, SetFactsCrawledInput, DeletedFactResult, DeletedFactsResult, DeleteFactInput, EmbedderStatus, EmbeddingEndpointConfig, EnhancedFactStore, FactRecord, FactsStatsRow, FactsTombstoneStats, ForcePurgeFactsInput, ReadFactsQuery, SearchOpts, SearchResult, SimilarOpts, StoreFactInput, StoredFactResult } from "./types.js"; import type { HorizonFactsConfig } from "./config.js"; /** @internal — pg_durable uses a global 8-hex node PK, so random collisions are retryable. */ export declare function startDurableWorkflow(exec: { query(sql: string, params?: unknown[]): Promise<{ rows: any[]; }>; }, sql: string, params: unknown[]): Promise; /** df-allow-list normalization: the Azure AI Foundry unified host is blocked * for df.http; the classic AOAI host points at the same deployment. */ export declare function toAllowlistedAzureHost(url: string): { url: string; rewritten: boolean; }; export declare class HorizonDBFactStore implements EnhancedFactStore { private readonly cfg; private pool; private initialized; /** Snapshot of the configured endpoint (mirrors the durable vars). */ private embedConfig?; private queryEmbedder?; /** Capability descriptor (enhancedfactstore 07 §1.4) — HorizonDB always * backs multi-signal search (lexical works with no endpoint). `embedder` * reflects whether an embedding endpoint was provisioned at construction: * the durable in-DB embed loop only runs (and semantic/hybrid return * semantic hits) when one is configured. A store created without * `embedding` reports `embedder:false` so the runtime can gate the embedder * lifecycle on real configuration rather than a hardcoded `true`. */ readonly capabilities: { search: boolean; embedder: boolean; }; private constructor(); static create(config?: Partial): Promise; private get schema(); private get s(); /** * Fail-fast (01 §5.5): verify every required extension is available — * itemized error otherwise — then apply the numbered migrations, then * verify df.http usability. When the config carries an embedding endpoint, * configure the embedder from it. */ initialize(): Promise; close(): Promise; storeFact(input: StoreFactInput): Promise; storeFact(input: StoreFactInput[]): Promise<{ stored: number; facts: StoredFactResult[]; }>; readFacts(query: ReadFactsQuery, access?: AccessContext): Promise<{ count: number; facts: FactRecord[]; }>; deleteFact(input: DeleteFactInput & { pattern: true; }): Promise; deleteFact(input: DeleteFactInput & { pattern?: false | undefined; }): Promise; deleteFact(input: DeleteFactInput): Promise; deleteSessionFactsForSession(sessionId: string): Promise; private stats; getSessionFactsStats(sessionId: string): Promise; getFactsStatsForSessions(sessionIds: string[]): Promise; getSharedFactsStats(): Promise; searchFacts(query: string, opts?: SearchOpts, access?: AccessContext): Promise; private aclParams; private lexicalCandidates; private semanticCandidates; similarFacts(scopeKey: string, opts?: SimilarOpts, access?: AccessContext): Promise; readUncrawledFacts(opts?: { keyPrefix?: string; namespace?: string; limit?: number; embeddedOnly?: boolean; }): Promise<{ count: number; facts: FactRecord[]; }>; setFactsCrawled(input: SetFactsCrawledInput): Promise<{ affected: number; skipped: number; }>; purgeExpiredFacts(ttlSeconds: number, limit?: number): Promise; getFactsTombstoneStats(ttlSeconds?: number): Promise; forcePurgeFacts(input: ForcePurgeFactsInput): Promise; private varName; private embedderLabel; private get legacyEmbedderLabel(); private get embedderLabels(); private cancelRunningLabel; /** * Serialize embedder start/restart across processes. Two providers * initializing the same schema concurrently must not both df.start (the * design is ONE loop per schema, label hz-embed-cron:). Reuses the * migrator's advisory-lock pattern: hold a session-level lock on a single * checked-out client for the whole critical section, then release it. */ private withEmbedderLock; configureEmbedder(endpoint: EmbeddingEndpointConfig, opts?: { restartIfRunning?: boolean; }): Promise; startEmbedder(opts?: { intervalSeconds?: number; batch?: number; }): Promise; private startLoops; stopEmbedder(reason?: string): Promise; embedderStatus(exec?: any): Promise; private getvar; /** Query-time embedding client, resolved from the configured endpoint * (memory snapshot → durable vars). Throws when semantic search is * attempted with no endpoint configured (02 §6). */ /** * Whether an embedding endpoint is available to this store — either the * in-memory snapshot or the durable config vars written by configureEmbedder * (possibly by another process). Non-throwing; used by searchFacts to decide * whether HYBRID can include the semantic signal or must degrade to lexical. */ private hasEmbedder; private requireQueryEmbedder; } //# sourceMappingURL=horizon-store.d.ts.map