/** * Citation extraction for NotebookLM answers (issue #20). * * NotebookLM renders citation markers like `[1]`, `[2]` inside the answer and * — in a separate panel — the cited passage from the source document. v1 * required the LLM to spell those out manually, which wasted tokens and was * unreliable. v2 reads the citations directly from the DOM after the answer * settles. * * Approach: * 1. Read all `button.citation-marker` inside the *latest* answer container * (so previous answers in the same session don't bleed in). * 2. For each marker, click it to open the source panel, read the * highlighted passage out of `.paragraph .highlighted`, then press * Escape so the chat input remains usable for follow-up questions. * 3. Return structured `Citation[]` and a formatted variant of the answer * according to the requested `SourceFormat`. * * All NotebookLM-facing CSS lives in the central selector registry, so a * single UI change cannot break both this module and chat extraction. */ import type { Page } from "patchright"; export type SourceFormat = "none" | "inline" | "footnotes" | "json"; export interface Citation { marker: string; number: number; sourceName: string; sourceText: string; } export interface ExtractCitationsResult { citations: Citation[]; formattedAnswer: string; } export declare function extractCitations(page: Page, answerText: string, format?: SourceFormat): Promise; //# sourceMappingURL=citations.d.ts.map