/** * Data Table Manager * * Manages Data Table extraction in NotebookLM notebooks. * Data Tables are structured tabular representations of information * extracted from notebook sources, available through the Studio panel. * * Selectors derived from live NotebookLM DOM inspection (Feb 2026): * - Studio panel toggle: .toggle-studio-panel-button (jslog="243457") * - Data table tile: icon text "table_view" inside .create-artifact-button-container[role="button"] * jslog="282298" (locale-independent). Note: data-create-button-type removed by Google Feb 2026. * - Clicking tile immediately starts generation (no customise dialog) * - Generating state: .artifact-item-button.shimmer-blue with .rotate sync icon * - Artifact title during generation: "Generating data table…" * - Chat-embedded tables use standard ) */ import { StudioManagerBase } from "./studio-manager-base.js"; export interface DataTable { headers: string[]; rows: string[][]; totalRows: number; totalColumns: number; } export interface DataTableStatus { status: "not_started" | "generating" | "ready" | "failed" | "unknown"; progress?: number; } export interface GenerateDataTableResult { success: boolean; status: DataTableStatus; error?: string; } export interface GetDataTableResult { success: boolean; table?: DataTable; error?: string; } export declare class DataTableManager extends StudioManagerBase { protected readonly logName = "data-table-manager"; /** * Ensure the Studio panel is visible (expand if collapsed). * * Live DOM inspection (Feb 2026) confirms: * - Toggle button: .toggle-studio-panel-button, aria-label="Collapse/Expand studio panel" * - Tiles container: .create-artifact-button-container (visible when panel is open) * * Strategy: * 1. If tiles are already visible the panel is open — return true immediately * 2. Try the toggle button via a prioritised selector chain (guards against future renames) * 3. Click the button if tiles not visible — no aria-label text check (locale-agnostic) */ private ensureStudioPanelOpen; /** * Check data table artifact status in the artifact library. * Looks for artifacts with the "table_view" icon (data table artifacts). */ private checkDataTableStatusInternal; /** * Click the Data Table tile in the Studio panel. * This immediately triggers generation (no customise dialog). */ private clickDataTableTile; /** * Click on an existing data table artifact to open/display it */ private clickDataTableArtifact; /** * Generate a data table for a notebook */ generateDataTable(notebookUrl: string): Promise; /** * Get an existing data table from a notebook. * Clicks on the data table artifact to display it, then extracts table data. */ getDataTable(notebookUrl: string): Promise; /** * Extract structured table data from all tables on the page. * NotebookLM tables use
/ (no
with direct children (no ). * Returns the largest table found. */ private extractTableData; /** * Sanitize extracted table content through the shared response validator. * Each cell originates from untrusted document sources, so any prompt * injection / malicious content is redacted before the table is returned * to the calling model. */ private sanitizeTable; }