import type { Api, Model } from '@earendil-works/pi-ai/compat'; import type { Config } from '../../config/schema.js'; import type { SessionStore } from '../../session/store.js'; import type { ExecutionContext, ExecutionContextRequest } from './execution-context.types.js'; export interface RecallEvidence { id: string; conversationId: string; entryId: string; seq: number; observedAt: number; quote: string; } export interface DeepRecallResult { status: 'completed' | 'empty' | 'failed'; reason: 'historical_question' | 'weak_match'; modelCalls: number; evidence: RecallEvidence[]; queries: string[]; truncated: boolean; searchedSessions: number; } export type RecallQueryPlanner = (query: string, recent: string[], signal: AbortSignal) => Promise; /** A cheap gate keeps ordinary turns and explicit mutations off the model-assisted path. */ export declare function deepRecallReason(query: string, context: ExecutionContext): DeepRecallResult['reason'] | undefined; export declare function buildDeterministicRecallQueries(query: string, recent?: readonly string[]): string[]; /** * Zero-LLM deterministic query planner so pre-turn context preparation never blocks TTFT on an extra model call. * Deeper multi-hop historical lookup remains available on-demand via session_recall / session_search tools. */ export declare function createRecallQueryPlanner(_model?: Model, _config?: Config): RecallQueryPlanner; export declare function deepenExecutionContext(input: { config: Config; context: ExecutionContext; request: ExecutionContextRequest; recent: string[]; store: SessionStore; planQueries: RecallQueryPlanner; }): Promise;