/** * Five retrieval entry points corresponding to the V7 injection triggers * (ARCHITECTURE.md §4.3). Each picks the right mix of tiers + knob values: * * ┌─────────────────┬──────────────────────────────────────────────────┐ * │ Trigger │ Tiers │ Size │ Notes │ * ├─────────────────┼─────────────┼────────────────────┼───────────────┤ * │ turn_start │ 1 + 2 + 3 │ full │ "before user" │ * │ tool_driven │ 2 (+ 3) │ shrunk │ on memory_* call * │ skill_invoke │ 1 primary │ shrunk │ just-in-time │ * │ sub_agent │ 2 + 3 │ shrunk, no tier1 │ sub-agent ctx │ * │ decision_repair │ 1 + 2 │ includeLowValue=ON │ unblock loops │ * └─────────────────┴─────────────┴────────────────────┴───────────────┘ * * Each entry is a pure async function: it does storage reads, zero writes. * Events (`retrieval.started/.done/.failed`) are emitted via the provided * bus so callers can stream packets to the viewer or persist audit trails. */ import type { RetrievalEventBus } from "./events.js"; import type { RetrievalCtx, RetrievalDeps, RetrievalResult, RetrievalProfile } from "./types.js"; export type TurnStartRetrieveCtx = Extract; export type ToolDrivenRetrieveCtx = Extract; export type SkillInvokeRetrieveCtx = Extract; export type SubAgentRetrieveCtx = Extract; export type RepairRetrieveCtx = Extract; export interface RetrieveOptions { /** Event bus for `retrieval.*` events (optional — tests pass none). */ events?: RetrievalEventBus; /** Override `limit` default (tier totals honored when unspecified). */ limit?: number; /** Turn-start scheduler override. V1 uses this for intent tier gating. */ plan?: RetrievePlanOverride; /** * Return mechanically ranked candidates without the local LLM pass. * Used when the caller will merge another retrieval route, then run * one unified final LLM filter across all routes. */ skipLlmFilter?: boolean; /** Shared foreground cancellation signal. */ signal?: AbortSignal; /** Absolute request deadline used to cap optional LLM filtering. */ deadlineAt?: number; /** Per-request malformed-JSON retry policy for the LLM relevance filter. */ llmFilterMalformedRetries?: number; } export interface RetrievePlanOverride { scenarioId?: string; profile?: RetrievalProfile; wantTier1?: boolean; wantTier2?: boolean; wantTier3?: boolean; limit?: number; } export declare function turnStartRetrieve(deps: RetrievalDeps, ctx: TurnStartRetrieveCtx, opts?: RetrieveOptions): Promise; export declare function toolDrivenRetrieve(deps: RetrievalDeps, ctx: ToolDrivenRetrieveCtx, opts?: RetrieveOptions): Promise; export declare function skillInvokeRetrieve(deps: RetrievalDeps, ctx: SkillInvokeRetrieveCtx, opts?: RetrieveOptions): Promise; export declare function subAgentRetrieve(deps: RetrievalDeps, ctx: SubAgentRetrieveCtx, opts?: RetrieveOptions): Promise; export declare function repairRetrieve(deps: RetrievalDeps, ctx: RepairRetrieveCtx, opts?: RetrieveOptions): Promise; /** Thin façade so pipelines can `new Retriever(deps)` if they prefer OO. */ export declare class Retriever { private readonly deps; constructor(deps: RetrievalDeps); turnStart(ctx: TurnStartRetrieveCtx, opts?: RetrieveOptions): Promise; toolDriven(ctx: ToolDrivenRetrieveCtx, opts?: RetrieveOptions): Promise; skillInvoke(ctx: SkillInvokeRetrieveCtx, opts?: RetrieveOptions): Promise; subAgent(ctx: SubAgentRetrieveCtx, opts?: RetrieveOptions): Promise; repair(ctx: RepairRetrieveCtx, opts?: RetrieveOptions): Promise; } //# sourceMappingURL=retrieve.d.ts.map