import type { DatabaseAdapter } from '../db-manager.js'; import type { ListVisibleTwinEdgesOptions, TwinEdgeRecord, TwinRef } from '../edges/types.js'; import type { RecallBundle, RecallMemoryOptions } from '../memory/types.js'; import type { SearchHitDiagnostics, SearchStrictness } from '../search/search-quality.js'; import type { ContextBoundary, ContextProjectRef, ContextRange, ContextRef } from './types.js'; import type { MemoryScopeRef } from '../memory/types.js'; type ContextSourceAdapter = Pick; export type ContextCandidateSource = 'memory' | 'raw' | 'graph'; export type ContextCandidateKind = ContextRef['kind']; export interface ContextCandidateSupport { retrieval_source?: string; lexical_support?: boolean; entity_support?: boolean; scope_support?: boolean; graph_source?: 'primary' | 'expanded' | null; graph_expanded?: boolean; is_vector_only?: boolean; vector_similarity?: number | null; confirmation_signals: string[]; metadata_signals: string[]; } export interface ContextCandidate { ref: ContextRef; title: string; excerpt: string; score: number; timestamp_ms: number | null; source: ContextCandidateSource; visible: boolean; hidden_reason?: string; support: ContextCandidateSupport; retrieval_diagnostics?: SearchHitDiagnostics; edge_id?: string; edge_type?: string; } export interface HiddenCandidateAggregate { total: number; by_kind: Partial>; by_reason: Record; } export interface ContextSourceReadResult { candidates: ContextCandidate[]; hidden: HiddenCandidateAggregate; source_refs: ContextRef[]; } export interface ContextSourceReadInput { task: string; scopes?: MemoryScopeRef[]; connectors?: string[]; project_refs?: ContextProjectRef[]; tenant_id?: string | null; boundary?: ContextBoundary; range?: ContextRange; as_of?: string | number | null; limit?: number; threshold?: number; strictness?: SearchStrictness; } export interface ContextSourceReaderDeps { adapter?: ContextSourceAdapter; recallMemory?: (query: string, options?: RecallMemoryOptions) => Promise; listVisibleTwinEdgesForRefs?: (adapter: ContextSourceAdapter, refs: readonly TwinRef[], options?: ListVisibleTwinEdgesOptions) => TwinEdgeRecord[]; } export declare function sourceRefsFromCandidates(candidates: readonly ContextCandidate[]): ContextRef[]; export declare function readMemoryCandidates(input: ContextSourceReadInput, deps?: ContextSourceReaderDeps): Promise; export declare function readRawCandidates(adapter: ContextSourceAdapter, input: ContextSourceReadInput): ContextSourceReadResult; export declare function readGraphCandidates(adapter: ContextSourceAdapter, input: ContextSourceReadInput, visibleRefs: readonly ContextRef[], deps?: ContextSourceReaderDeps): ContextSourceReadResult; export {}; //# sourceMappingURL=source-readers.d.ts.map