/** * Citation decoration — Phase 2. * * Ported from upstream `extensions/memory-core/src/tools.citations.ts`. * Decorates memory_search hits with `[path#L{start}-L{end}]` markers so * the model can attribute claims back to specific memory files when it * uses them in its answer. * * Since our backend stores files as single rows (not line-chunked), we * compute line ranges from the returned content block on the fly: * - `startLine` = 1 (line 1 of the file) * - `endLine` = total number of lines in the block * This matches upstream's output format exactly while keeping the pg * schema chunk-free. */ export type MemoryCitationsMode = 'on' | 'off' | 'auto'; export declare const DEFAULT_CITATIONS_MODE: MemoryCitationsMode; export declare function resolveMemoryCitationsMode(raw: string | undefined | null): MemoryCitationsMode; export interface CitationCandidate { path: string; content: string; startLine?: number; endLine?: number; citation?: string; } /** * Decorate each hit with a citation marker. Mirrors upstream's behavior: * appends `\n\nSource: ` to the content and sets `citation`. * When `include=false`, clears any existing citation field. */ export declare function decorateCitations(hits: T[], include: boolean): T[]; /** * Whether citations should be emitted for this call. * * Upstream keys `auto` off the session type (direct/group/channel). In * Phase 1 we only have direct chat, so `auto` => `on`. Callers that * later distinguish session types can pass `mode` explicitly. */ export declare function shouldIncludeCitations(mode: MemoryCitationsMode): boolean;