import { type KnowledgeInjectionIngestMode, type KnowledgeInjectionProvenance, type KnowledgeInjectionRetention, type KnowledgeInjectionTrustTier, type KnowledgeInjectionUseAs } from '../knowledge/shared.js'; import type { MemoryRecord, MemoryRegistry, MemorySemanticSearchResult } from './memory-store.js'; export interface KnowledgeInjection { readonly id: string; readonly cls: string; readonly summary: string; readonly reason: string; readonly confidence: number; readonly reviewState: 'fresh' | 'reviewed' | 'stale' | 'contradicted'; readonly trustTier: KnowledgeInjectionTrustTier; readonly useAs: KnowledgeInjectionUseAs; readonly retention: KnowledgeInjectionRetention; readonly provenance: KnowledgeInjectionProvenance; readonly ingestMode: KnowledgeInjectionIngestMode; } type KnowledgeInjectionPromptInput = Pick & Partial>; type KnowledgeRegistrySource = { getAll(): readonly MemoryRecord[]; searchSemantic?(input: Parameters[0]): readonly MemorySemanticSearchResult[]; }; /** * One scored candidate from the ranking pipeline: the fully-built * `KnowledgeInjection` plus the numeric score that placed it, before any * `limit` slice is applied. Exists so callers other than the spawn-time * baseline (e.g. per-turn retrieval in turn-knowledge-injection.ts) can * apply their own relevance floor / budget trim over the SAME ranked list * without re-implementing scoreKnowledge/determineReason/determineIngestMode. */ export interface ScoredKnowledgeInjection { readonly injection: KnowledgeInjection; readonly score: number; } /** * Full ranking pipeline, unsliced: scores every registry record that clears * the confidence>=55 gate against `task`/`writeScope`, folds in semantic * similarity when the registry supports it, and returns every candidate with * score>0 sorted best-first. `limit` only widens the semantic-search * candidate pool (`Math.max(limit*4,12)`, mirroring the historical * behavior), it does NOT slice the returned array. Callers that want the * spawn-time top-N behavior should slice the result themselves; see * `selectKnowledgeForTask` below. */ export declare function selectKnowledgeForTaskScored(registry: KnowledgeRegistrySource, task: string, writeScope?: readonly string[], limit?: number): ScoredKnowledgeInjection[]; export declare function selectKnowledgeForTask(registry: KnowledgeRegistrySource, task: string, writeScope?: readonly string[], limit?: number): KnowledgeInjection[]; export declare function buildKnowledgeInjectionPrompt(injections: readonly KnowledgeInjectionPromptInput[]): string | null; export {}; //# sourceMappingURL=knowledge-injection.d.ts.map