import type { KnowledgeConsolidationCandidateRecord, KnowledgeConsolidationCandidateUpsertInput, KnowledgeConsolidationReportRecord, KnowledgeConsolidationReportUpsertInput, KnowledgeEdgeRecord, KnowledgeEdgeUpsertInput, KnowledgeExtractionRecord, KnowledgeExtractionUpsertInput, KnowledgeIssueRecord, KnowledgeIssueUpsertInput, KnowledgeItemView, KnowledgeJobRunRecord, KnowledgeJobRunUpsertInput, KnowledgeRefinementTaskFilter, KnowledgeRefinementTaskRecord, KnowledgeRefinementTaskUpsertInput, KnowledgeNodeRecord, KnowledgeNodeRevisionRecord, KnowledgeNodeUpsertInput, KnowledgeScheduleRecord, KnowledgeScheduleUpsertInput, KnowledgeSemanticEnrichmentStateRecord, KnowledgeSourceRecord, KnowledgeSourceUpsertInput, KnowledgeStatus, KnowledgeUsageRecord, KnowledgeUsageUpsertInput } from './types.js'; import { type KnowledgeStoreConfig } from './store-config.js'; import { type KnowledgeSpaceDeleteResult } from './store-space-delete.js'; export declare class KnowledgeStore { private readonly sqlite; private readonly dbPath; private ready; private initPromise; private readonly sources; private readonly nodes; private readonly edges; private readonly issues; private readonly extractions; private readonly jobRuns; private readonly refinementTasks; private readonly usageRecords; private readonly consolidationCandidates; private readonly consolidationReports; private readonly schedules; private readonly nodeRevisions; private readonly semanticEnrichmentStates; private readonly nodeAutoAcceptConfidence; constructor(config: KnowledgeStoreConfig); get isReady(): boolean; get storagePath(): string; private asReadView; init(): Promise; status(): KnowledgeStatus; /** Cheap count of retained in-memory records, for MemoryGovernor cache visibility. */ retainedEntryCount(): number; batch(operation: () => Promise): Promise; listSources(limit?: number): KnowledgeSourceRecord[]; listSourcesInSpace(spaceId: string): KnowledgeSourceRecord[]; listNodes(limit?: number): KnowledgeNodeRecord[]; /** One bounded page of sources (insertion order, no full materialization). */ listSourcesPage(offset: number, limit: number): KnowledgeSourceRecord[]; /** One bounded page of nodes (insertion order, no full materialization). */ listNodesPage(offset: number, limit: number): KnowledgeNodeRecord[]; /** * Single-pass cursor over sources (insertion order, no materialization). * O(N) for a full scan, offset paging in a loop re-walks the Map from zero * per page (O(N²/page)). Map iterators tolerate concurrent upsert/delete. */ iterateSources(): IterableIterator; /** Single-pass cursor over nodes. See {@link iterateSources}. */ iterateNodes(): IterableIterator; listNodesInSpace(spaceId: string): KnowledgeNodeRecord[]; listEdges(): KnowledgeEdgeRecord[]; listIssues(limit?: number): KnowledgeIssueRecord[]; listIssuesInSpace(spaceId: string): KnowledgeIssueRecord[]; listExtractions(limit?: number): KnowledgeExtractionRecord[]; listExtractionsInSpace(spaceId: string): KnowledgeExtractionRecord[]; listExtractionsForSources(sourceIds: ReadonlySet): KnowledgeExtractionRecord[]; listJobRuns(limit?: number, jobId?: string): KnowledgeJobRunRecord[]; listRefinementTasks(limit?: number, input?: KnowledgeRefinementTaskFilter): KnowledgeRefinementTaskRecord[]; listUsageRecords(limit?: number, input?: { readonly targetKind?: KnowledgeUsageRecord['targetKind'] | undefined; readonly targetId?: string | undefined; readonly usageKind?: KnowledgeUsageRecord['usageKind'] | undefined; }): KnowledgeUsageRecord[]; listConsolidationCandidates(limit?: number, input?: { readonly status?: KnowledgeConsolidationCandidateRecord['status'] | undefined; readonly subjectKind?: KnowledgeConsolidationCandidateRecord['subjectKind'] | undefined; readonly subjectId?: string | undefined; }): KnowledgeConsolidationCandidateRecord[]; listConsolidationReports(limit?: number): KnowledgeConsolidationReportRecord[]; listSchedules(limit?: number): KnowledgeScheduleRecord[]; getSource(id: string): KnowledgeSourceRecord | null; getNode(id: string): KnowledgeNodeRecord | null; getIssue(id: string): KnowledgeIssueRecord | null; getExtraction(id: string): KnowledgeExtractionRecord | null; getExtractionBySourceId(sourceId: string): KnowledgeExtractionRecord | null; getJobRun(id: string): KnowledgeJobRunRecord | null; getRefinementTask(id: string): KnowledgeRefinementTaskRecord | null; getUsageRecord(id: string): KnowledgeUsageRecord | null; getConsolidationCandidate(id: string): KnowledgeConsolidationCandidateRecord | null; getConsolidationCandidateBySubject(subjectKind: KnowledgeConsolidationCandidateRecord['subjectKind'], subjectId: string, candidateType: KnowledgeConsolidationCandidateRecord['candidateType']): KnowledgeConsolidationCandidateRecord | null; getConsolidationReport(id: string): KnowledgeConsolidationReportRecord | null; getSchedule(id: string): KnowledgeScheduleRecord | null; getSourceByCanonicalUri(canonicalUri: string): KnowledgeSourceRecord | null; getNodeByKindAndSlug(kind: KnowledgeNodeRecord['kind'], slug: string): KnowledgeNodeRecord | null; edgesFor(kind: KnowledgeEdgeRecord['fromKind'] | KnowledgeEdgeRecord['toKind'], id: string): KnowledgeEdgeRecord[]; getItem(id: string): KnowledgeItemView | null; upsertSource(input: KnowledgeSourceUpsertInput): Promise; deleteSource(id: string): Promise; private asRecordDeleteView; replaceSourceRecord(record: KnowledgeSourceRecord): Promise; upsertNode(input: KnowledgeNodeUpsertInput): Promise; /** Read a node's append-only revision history, oldest first. (Invariant 8.) */ listNodeRevisions(nodeId: string): KnowledgeNodeRevisionRecord[]; deleteNode(id: string): Promise; replaceNodeRecord(record: KnowledgeNodeRecord): Promise; /** Merge one node into another, re-pointing cross-reference edges. (Invariant 7.) */ mergeNodes(loserId: string, winnerId: string): Promise<{ merged: boolean; repointedEdges: number; }>; getSemanticEnrichmentState(sourceId: string): KnowledgeSemanticEnrichmentStateRecord | null; upsertSemanticEnrichmentState(input: { readonly sourceId: string; readonly textHash?: string | undefined; readonly enrichedAt?: number | undefined; readonly metadata?: Record | undefined; }): Promise; upsertEdge(input: KnowledgeEdgeUpsertInput): Promise; deleteEdge(id: string): Promise; replaceEdgeRecord(record: KnowledgeEdgeRecord): Promise; replaceIssues(inputs: readonly KnowledgeIssueUpsertInput[], namespace?: string): Promise; upsertIssue(input: KnowledgeIssueUpsertInput): Promise; replaceIssueRecord(record: KnowledgeIssueRecord): Promise; upsertExtraction(input: KnowledgeExtractionUpsertInput): Promise; upsertJobRun(input: KnowledgeJobRunUpsertInput): Promise; /** * Bound the retained job-run history to `keep` records. Active (queued / * running) runs are never pruned; settled runs beyond the cap are removed * oldest-first from BOTH the in-memory mirror and the sqlite table, so the * history cannot accrete without bound across uptime or restarts. Also the * MemoryGovernor's trim hook for this store (a real reclaim, not a no-op). */ pruneJobRuns(keep: number): number; upsertRefinementTask(input: KnowledgeRefinementTaskUpsertInput): Promise; upsertUsageRecord(input: KnowledgeUsageUpsertInput): Promise; upsertConsolidationCandidate(input: KnowledgeConsolidationCandidateUpsertInput): Promise; upsertConsolidationReport(input: KnowledgeConsolidationReportUpsertInput): Promise; upsertSchedule(input: KnowledgeScheduleUpsertInput): Promise; deleteSchedule(id: string): Promise; planKnowledgeSpaceDelete(spaceId: string): Promise; deleteKnowledgeSpace(spaceId: string, input?: { readonly dryRun?: boolean; }): Promise; private knowledgeSpaceRowStores; private initialize; } //# sourceMappingURL=store.d.ts.map