@charlie.act7/gemini-notebook-mcp 2.1.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +446 -434
- package/dist/auth/auth-manager.d.ts +2 -2
- package/dist/auth/auth-manager.d.ts.map +1 -1
- package/dist/auth/auth-manager.js +27 -26
- package/dist/auth/auth-manager.js.map +1 -1
- package/dist/errors.d.ts +10 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +19 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.js +53 -17
- package/dist/index.js.map +1 -1
- package/dist/library/notebook-library.d.ts +7 -3
- package/dist/library/notebook-library.d.ts.map +1 -1
- package/dist/library/notebook-library.js +162 -14
- package/dist/library/notebook-library.js.map +1 -1
- package/dist/library/types.d.ts +18 -0
- package/dist/library/types.d.ts.map +1 -1
- package/dist/notebooklm/artifact-store.d.ts +26 -0
- package/dist/notebooklm/artifact-store.d.ts.map +1 -0
- package/dist/notebooklm/artifact-store.js +102 -0
- package/dist/notebooklm/artifact-store.js.map +1 -0
- package/dist/notebooklm/audio.d.ts.map +1 -1
- package/dist/notebooklm/audio.js +13 -37
- package/dist/notebooklm/audio.js.map +1 -1
- package/dist/notebooklm/chat.d.ts.map +1 -1
- package/dist/notebooklm/chat.js +22 -14
- package/dist/notebooklm/chat.js.map +1 -1
- package/dist/notebooklm/citations.d.ts +17 -22
- package/dist/notebooklm/citations.d.ts.map +1 -1
- package/dist/notebooklm/citations.js +148 -115
- package/dist/notebooklm/citations.js.map +1 -1
- package/dist/notebooklm/selectors.d.ts +54 -2
- package/dist/notebooklm/selectors.d.ts.map +1 -1
- package/dist/notebooklm/selectors.js +109 -2
- package/dist/notebooklm/selectors.js.map +1 -1
- package/dist/notebooklm/sources.d.ts +16 -1
- package/dist/notebooklm/sources.d.ts.map +1 -1
- package/dist/notebooklm/sources.js +123 -27
- package/dist/notebooklm/sources.js.map +1 -1
- package/dist/session/browser-session.d.ts +15 -9
- package/dist/session/browser-session.d.ts.map +1 -1
- package/dist/session/browser-session.js +123 -154
- package/dist/session/browser-session.js.map +1 -1
- package/dist/session/session-manager.d.ts +1 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +47 -36
- package/dist/session/session-manager.js.map +1 -1
- package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
- package/dist/tools/definitions/notebook-management.js +43 -0
- package/dist/tools/definitions/notebook-management.js.map +1 -1
- package/dist/tools/definitions/sources.d.ts +8 -0
- package/dist/tools/definitions/sources.d.ts.map +1 -1
- package/dist/tools/definitions/sources.js +144 -8
- package/dist/tools/definitions/sources.js.map +1 -1
- package/dist/tools/handlers.d.ts +94 -13
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +222 -19
- package/dist/tools/handlers.js.map +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/tools/validation.js +108 -1
- package/dist/tools/validation.js.map +1 -1
- package/dist/transport/http.d.ts +2 -0
- package/dist/transport/http.d.ts.map +1 -1
- package/dist/transport/http.js +4 -0
- package/dist/transport/http.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/operation.d.ts +8 -0
- package/dist/utils/operation.d.ts.map +1 -0
- package/dist/utils/operation.js +42 -0
- package/dist/utils/operation.js.map +1 -0
- package/dist/utils/page-utils.d.ts.map +1 -1
- package/dist/utils/page-utils.js +3 -3
- package/dist/utils/page-utils.js.map +1 -1
- package/docs/configuration.md +184 -182
- package/docs/implementation-plan.md +26 -2
- package/docs/tools.md +469 -410
- package/docs/troubleshooting.md +176 -176
- package/docs/usage-guide.md +285 -285
- package/package.json +71 -69
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Citation extraction for NotebookLM answers (issue #20).
|
|
3
|
-
*
|
|
4
|
-
* NotebookLM renders citation markers like `[1]`, `[2]` inside the answer and
|
|
5
|
-
* — in a separate panel — the cited passage from the source document. v1
|
|
6
|
-
* required the LLM to spell those out manually, which wasted tokens and was
|
|
7
|
-
* unreliable. v2 reads the citations directly from the DOM after the answer
|
|
8
|
-
* settles.
|
|
9
|
-
*
|
|
10
|
-
* Approach:
|
|
11
|
-
* 1. Read all `button.citation-marker` inside the *latest* answer container
|
|
12
|
-
* (so previous answers in the same session don't bleed in).
|
|
13
|
-
* 2. For each marker, click it to open the source panel, read the
|
|
14
|
-
* highlighted passage out of `.paragraph .highlighted`, then press
|
|
15
|
-
* Escape so the chat input remains usable for follow-up questions.
|
|
16
|
-
* 3. Return structured `Citation[]` and a formatted variant of the answer
|
|
17
|
-
* according to the requested `SourceFormat`.
|
|
18
|
-
*
|
|
19
|
-
* All NotebookLM-facing CSS lives in the central selector registry, so a
|
|
20
|
-
* single UI change cannot break both this module and chat extraction.
|
|
21
|
-
*/
|
|
1
|
+
/** Citation extraction for completed NotebookLM answers. */
|
|
22
2
|
import { safeSleep } from "../browser/watchdog.js";
|
|
23
|
-
|
|
3
|
+
import { throwIfAborted } from "../utils/operation.js";
|
|
4
|
+
import { Selectors, joinAlt } from "./selectors.js";
|
|
5
|
+
export async function extractCitations(page, answerText, format = "none", options = {}) {
|
|
24
6
|
if (format === "none") {
|
|
25
7
|
return { citations: [], formattedAnswer: answerText };
|
|
26
8
|
}
|
|
9
|
+
const { timeoutMs = 8_000, signal } = options;
|
|
10
|
+
throwIfAborted(signal);
|
|
27
11
|
const rawCitations = await readCitationStubs(page);
|
|
12
|
+
throwIfAborted(signal);
|
|
28
13
|
if (rawCitations.length === 0) {
|
|
29
14
|
return { citations: [], formattedAnswer: answerText };
|
|
30
15
|
}
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
// the same DOM region. We cap each excerpt at 1.5 s so a slow panel can't
|
|
34
|
-
// block the whole batch (issue: ask_question hang after answer rendered).
|
|
16
|
+
// Citation panels share one DOM region, so extraction remains sequential,
|
|
17
|
+
// but one total budget prevents latency from growing with citation count.
|
|
35
18
|
const citations = [];
|
|
19
|
+
const deadline = Date.now() + timeoutMs;
|
|
36
20
|
for (const stub of rawCitations) {
|
|
37
|
-
|
|
21
|
+
throwIfAborted(signal);
|
|
22
|
+
const remaining = deadline - Date.now();
|
|
23
|
+
const excerpt = remaining > 0
|
|
24
|
+
? await extractExcerpt(page, stub.number, Math.min(1_500, remaining), signal)
|
|
25
|
+
: "";
|
|
26
|
+
const sourceText = excerpt || stub.sourceName;
|
|
38
27
|
citations.push({
|
|
39
28
|
marker: `[${stub.number}]`,
|
|
40
29
|
number: stub.number,
|
|
41
30
|
sourceName: stub.sourceName,
|
|
42
|
-
sourceText
|
|
31
|
+
sourceText,
|
|
32
|
+
source_id: stub.sourceId,
|
|
33
|
+
source_name: stub.sourceName,
|
|
34
|
+
source_type: inferCitationSourceType(stub.sourceName, stub.sourceUrl),
|
|
35
|
+
source_url: stub.sourceUrl,
|
|
36
|
+
location: inferCitationLocation(`${stub.sourceName} ${excerpt}`),
|
|
37
|
+
excerpt: excerpt || null,
|
|
38
|
+
extraction_status: excerpt ? "complete" : stub.sourceName ? "partial" : "unavailable",
|
|
43
39
|
});
|
|
44
40
|
}
|
|
45
|
-
// Best-effort: dismiss any source panel still open and refocus the chat
|
|
46
|
-
// input so the next question can be typed without an extra click.
|
|
47
41
|
await page.keyboard.press("Escape").catch(() => undefined);
|
|
48
42
|
await safeSleep(page, 100);
|
|
49
43
|
return {
|
|
@@ -53,77 +47,88 @@ export async function extractCitations(page, answerText, format = "none") {
|
|
|
53
47
|
}
|
|
54
48
|
async function readCitationStubs(page) {
|
|
55
49
|
try {
|
|
56
|
-
return (await page.evaluate(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
50
|
+
return (await page.evaluate(({ answerSelector, buttonSelector, labelSelector }) => {
|
|
51
|
+
const containers = document.querySelectorAll(answerSelector);
|
|
52
|
+
const scope = containers.length > 0 ? containers[containers.length - 1] : document;
|
|
53
|
+
const buttons = scope.querySelectorAll(buttonSelector);
|
|
54
|
+
const seen = new Set();
|
|
55
|
+
const out = [];
|
|
56
|
+
buttons.forEach((button) => {
|
|
57
|
+
const match = (button.textContent || "").match(/(\d+)/);
|
|
58
|
+
if (!match)
|
|
59
|
+
return;
|
|
60
|
+
const number = Number.parseInt(match[1], 10);
|
|
61
|
+
if (seen.has(number))
|
|
62
|
+
return;
|
|
63
|
+
seen.add(number);
|
|
64
|
+
const label = button.querySelector(labelSelector)?.getAttribute("aria-label") || "";
|
|
65
|
+
const colon = label.indexOf(": ");
|
|
66
|
+
const link = button.closest("a[href]") || button.querySelector("a[href]");
|
|
67
|
+
out.push({
|
|
68
|
+
number,
|
|
69
|
+
sourceName: colon > 0 ? label.slice(colon + 2).trim() : label.trim(),
|
|
70
|
+
sourceId: button.getAttribute("data-source-id") ||
|
|
71
|
+
button.getAttribute("data-citation-id") ||
|
|
72
|
+
null,
|
|
73
|
+
sourceUrl: link?.getAttribute("href") || null,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return out.sort((left, right) => left.number - right.number);
|
|
77
|
+
}, {
|
|
78
|
+
answerSelector: Selectors.chat.answerText,
|
|
79
|
+
buttonSelector: joinAlt(Selectors.citations.button),
|
|
80
|
+
labelSelector: Selectors.citations.label,
|
|
81
|
+
}));
|
|
82
82
|
}
|
|
83
83
|
catch {
|
|
84
84
|
return [];
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
async function extractExcerpt(page, number) {
|
|
87
|
+
async function extractExcerpt(page, number, timeoutMs, signal) {
|
|
88
88
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
throwIfAborted(signal);
|
|
90
|
+
const clicked = await page.evaluate(({ answerSelector, buttonSelector, citationNumber }) => {
|
|
91
|
+
const containers = document.querySelectorAll(answerSelector);
|
|
92
|
+
const scope = containers.length > 0 ? containers[containers.length - 1] : document;
|
|
93
|
+
const buttons = scope.querySelectorAll(buttonSelector);
|
|
94
|
+
for (const button of buttons) {
|
|
95
|
+
const match = (button.textContent || "").match(/(\d+)/);
|
|
96
|
+
if (match && Number.parseInt(match[1], 10) === citationNumber) {
|
|
97
|
+
button.scrollIntoView?.({ block: "center" });
|
|
98
|
+
button.click();
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}, {
|
|
104
|
+
answerSelector: Selectors.chat.answerText,
|
|
105
|
+
buttonSelector: joinAlt(Selectors.citations.button),
|
|
106
|
+
citationNumber: number,
|
|
107
|
+
});
|
|
106
108
|
if (!clicked)
|
|
107
109
|
return "";
|
|
108
|
-
|
|
109
|
-
// 1500 ms is enough for the highlighted-paragraph render in 95% of cases;
|
|
110
|
-
// the remaining 5% just lose the excerpt (sourceName still goes through).
|
|
111
|
-
const deadline = Date.now() + 1_500;
|
|
110
|
+
const deadline = Date.now() + timeoutMs;
|
|
112
111
|
while (Date.now() < deadline) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
throwIfAborted(signal);
|
|
113
|
+
const text = (await page.evaluate(({ highlightSelector, paragraphSelector }) => {
|
|
114
|
+
const highlights = document.querySelectorAll(highlightSelector);
|
|
115
|
+
if (highlights.length === 0)
|
|
116
|
+
return "";
|
|
117
|
+
const highlightedText = Array.from(highlights)
|
|
118
|
+
.map((element) => (element.innerText || element.textContent || "").trim())
|
|
119
|
+
.filter(Boolean)
|
|
120
|
+
.join(" ");
|
|
121
|
+
if (!highlightedText)
|
|
122
|
+
return "";
|
|
123
|
+
const parent = highlights[0].closest(paragraphSelector) || highlights[0].parentElement;
|
|
124
|
+
const paragraphText = (parent?.innerText ||
|
|
125
|
+
parent?.textContent ||
|
|
126
|
+
"").trim();
|
|
127
|
+
return paragraphText.length > highlightedText.length ? paragraphText : highlightedText;
|
|
128
|
+
}, {
|
|
129
|
+
highlightSelector: Selectors.citations.highlight,
|
|
130
|
+
paragraphSelector: Selectors.citations.paragraph,
|
|
131
|
+
}));
|
|
127
132
|
if (text) {
|
|
128
133
|
await page.keyboard.press("Escape").catch(() => undefined);
|
|
129
134
|
return text;
|
|
@@ -133,41 +138,69 @@ async function extractExcerpt(page, number) {
|
|
|
133
138
|
await page.keyboard.press("Escape").catch(() => undefined);
|
|
134
139
|
return "";
|
|
135
140
|
}
|
|
136
|
-
catch {
|
|
141
|
+
catch (error) {
|
|
142
|
+
throwIfAborted(signal);
|
|
143
|
+
if (error instanceof Error && error.name === "OperationCancelledError")
|
|
144
|
+
throw error;
|
|
137
145
|
return "";
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
148
|
function formatAnswer(answer, citations, format) {
|
|
141
149
|
if (format === "none" || citations.length === 0)
|
|
142
150
|
return answer;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const replacement = c.sourceText
|
|
153
|
-
? `${c.marker} (${c.sourceName}: "${truncate(c.sourceText, 200)}")`
|
|
154
|
-
: `${c.marker} (${c.sourceName})`;
|
|
155
|
-
out = out.split(c.marker).join(replacement);
|
|
156
|
-
}
|
|
157
|
-
return out;
|
|
158
|
-
}
|
|
159
|
-
case "footnotes":
|
|
160
|
-
default: {
|
|
161
|
-
const footnotes = citations
|
|
162
|
-
.map((c) => `${c.marker} ${c.sourceName}${c.sourceText && c.sourceText !== c.sourceName ? ` — "${truncate(c.sourceText, 240)}"` : ""}`)
|
|
163
|
-
.join("\n");
|
|
164
|
-
return `${answer}\n\nSources:\n${footnotes}`;
|
|
151
|
+
if (format === "json")
|
|
152
|
+
return answer;
|
|
153
|
+
if (format === "inline") {
|
|
154
|
+
let output = answer;
|
|
155
|
+
for (const citation of citations) {
|
|
156
|
+
const replacement = citation.sourceText
|
|
157
|
+
? `${citation.marker} (${citation.sourceName}: "${truncate(citation.sourceText, 200)}")`
|
|
158
|
+
: `${citation.marker} (${citation.sourceName})`;
|
|
159
|
+
output = output.split(citation.marker).join(replacement);
|
|
165
160
|
}
|
|
161
|
+
return output;
|
|
166
162
|
}
|
|
163
|
+
const footnotes = citations
|
|
164
|
+
.map((citation) => `${citation.marker} ${citation.sourceName}${citation.sourceText && citation.sourceText !== citation.sourceName
|
|
165
|
+
? ` — "${truncate(citation.sourceText, 240)}"`
|
|
166
|
+
: ""}`)
|
|
167
|
+
.join("\n");
|
|
168
|
+
return `${answer}\n\nSources:\n${footnotes}`;
|
|
167
169
|
}
|
|
168
170
|
function truncate(text, max) {
|
|
169
171
|
if (text.length <= max)
|
|
170
172
|
return text;
|
|
171
173
|
return `${text.slice(0, max - 1).trimEnd()}…`;
|
|
172
174
|
}
|
|
175
|
+
function inferCitationSourceType(sourceName, sourceUrl) {
|
|
176
|
+
const value = `${sourceName} ${sourceUrl ?? ""}`.toLowerCase();
|
|
177
|
+
if (/youtube|youtu\.be/.test(value))
|
|
178
|
+
return "youtube";
|
|
179
|
+
if (/\.pdf(?:\b|[?#])/.test(value))
|
|
180
|
+
return "pdf";
|
|
181
|
+
if (/\.(?:mp3|m4a|wav|ogg)(?:\b|[?#])/.test(value))
|
|
182
|
+
return "audio";
|
|
183
|
+
if (/\.(?:mp4|mov|webm)(?:\b|[?#])/.test(value))
|
|
184
|
+
return "video";
|
|
185
|
+
if (/^https?:/.test(sourceUrl ?? ""))
|
|
186
|
+
return "web";
|
|
187
|
+
if (/\.(?:docx?|pptx?|xlsx?|epub|txt)(?:\b|[?#])/.test(value))
|
|
188
|
+
return "document";
|
|
189
|
+
return "unknown";
|
|
190
|
+
}
|
|
191
|
+
function inferCitationLocation(text) {
|
|
192
|
+
const page = text.match(/(?:page|página|seite|pagina|ページ)\s*(\d+)/i);
|
|
193
|
+
if (page)
|
|
194
|
+
return { page: Number(page[1]) };
|
|
195
|
+
const slide = text.match(/(?:slide|diapositiva|folie|スライド)\s*(\d+)/i);
|
|
196
|
+
if (slide)
|
|
197
|
+
return { slide: Number(slide[1]) };
|
|
198
|
+
const timestamp = text.match(/\b(?:(\d{1,2}):)?(\d{1,2}):(\d{2})\b/);
|
|
199
|
+
if (timestamp) {
|
|
200
|
+
return {
|
|
201
|
+
timestamp_seconds: Number(timestamp[1] ?? 0) * 3600 + Number(timestamp[2]) * 60 + Number(timestamp[3]),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
173
206
|
//# sourceMappingURL=citations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"citations.js","sourceRoot":"","sources":["../../src/notebooklm/citations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"citations.js","sourceRoot":"","sources":["../../src/notebooklm/citations.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAG5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAuCpD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAU,EACV,U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D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -26,13 +26,24 @@
|
|
|
26
26
|
* Last verified: 2026-05 against the live notebooklm.google.com layout
|
|
27
27
|
* (DE, EN locales).
|
|
28
28
|
*/
|
|
29
|
+
import type { Page } from "patchright";
|
|
30
|
+
export declare const NOTEBOOK_UI_SELECTOR_VERSION = "2026.07.3";
|
|
29
31
|
export declare const Selectors: {
|
|
32
|
+
readonly auth: {
|
|
33
|
+
readonly emailInput: readonly ["input#identifierId", "input[name='identifier']", "input[type='email']"];
|
|
34
|
+
readonly identifierNext: readonly ["#identifierNext", "button:has-text('Next')", "button:has-text('Weiter')"];
|
|
35
|
+
readonly passwordInput: readonly ["input[name='Passwd']", "input[type='password']"];
|
|
36
|
+
readonly passwordNext: readonly ["#passwordNext", "button:has-text('Next')", "button:has-text('Weiter')"];
|
|
37
|
+
};
|
|
30
38
|
readonly chat: {
|
|
31
39
|
readonly message: "chat-message";
|
|
32
40
|
readonly userMessage: ".from-user-container";
|
|
33
41
|
readonly answerContainer: ".to-user-container";
|
|
34
42
|
readonly answerText: ".to-user-container .message-text-content";
|
|
35
43
|
readonly answerActions: ".to-user-container .message-actions";
|
|
44
|
+
readonly messageText: ".message-text-content";
|
|
45
|
+
readonly messageActions: ".message-actions";
|
|
46
|
+
readonly dialog: "[role=\"dialog\"]";
|
|
36
47
|
readonly jumpToBottomButton: "button.jump-to-bottom-button";
|
|
37
48
|
readonly stopButton: "button.stop-button";
|
|
38
49
|
/**
|
|
@@ -51,6 +62,7 @@ export declare const Selectors: {
|
|
|
51
62
|
readonly optionsButton: readonly ["button[aria-label=\"Chat options\"]", "button[aria-label=\"Opciones de chat\"]", "button[aria-label=\"Optionen für den Chat\"]", "button[aria-label=\"Options du chat\"]", "button[aria-label=\"Opzioni chat\"]", "button[aria-label=\"Opções do chat\"]", "button[aria-label=\"Chatopties\"]", "button[aria-label=\"チャットのオプション\"]"];
|
|
52
63
|
readonly clearHistoryMenuItem: readonly ["[role=\"menuitem\"]:has-text(\"Clear chat history\")", "[role=\"menuitem\"]:has-text(\"Borrar el historial de chat\")", "[role=\"menuitem\"]:has-text(\"Chatverlauf löschen\")", "[role=\"menuitem\"]:has-text(\"Effacer l’historique du chat\")", "[role=\"menuitem\"]:has-text(\"Cancella cronologia chat\")", "[role=\"menuitem\"]:has-text(\"Limpar histórico do chat\")", "[role=\"menuitem\"]:has-text(\"Chatgeschiedenis wissen\")", "[role=\"menuitem\"]:has-text(\"チャット履歴を削除\")"];
|
|
53
64
|
readonly clearHistoryConfirmButton: readonly ["button:has-text(\"Clear\")", "button:has-text(\"Borrar\")", "button:has-text(\"Löschen\")", "button:has-text(\"Effacer\")", "button:has-text(\"Cancella\")", "button:has-text(\"Limpar\")", "button:has-text(\"Wissen\")", "button:has-text(\"削除\")"];
|
|
65
|
+
readonly rateLimitContainers: readonly [".error-message", ".error-container", "[role='alert']", ".rate-limit-message", "[data-error]", ".notification-error", ".alert-error", ".toast-error"];
|
|
54
66
|
};
|
|
55
67
|
/**
|
|
56
68
|
* NotebookLM removed tabs in favour of a three-pane sidebar (2026 layout).
|
|
@@ -75,6 +87,10 @@ export declare const Selectors: {
|
|
|
75
87
|
* class — verified across all observed locales.
|
|
76
88
|
*/
|
|
77
89
|
readonly sourceContainer: ".single-source-container";
|
|
90
|
+
readonly sourceTitle: readonly [".source-title", ".source-name", "[data-source-title]", "[aria-label] .title", ".single-source-title"];
|
|
91
|
+
readonly sourceStatus: readonly ["[role='progressbar']", ".source-status", ".error-message", "[role='alert']"];
|
|
92
|
+
readonly sourceLink: readonly ["a[href]", "[data-source-url]"];
|
|
93
|
+
readonly sourceTypeIcon: readonly ["mat-icon", ".material-symbols-outlined", ".material-icons"];
|
|
78
94
|
/**
|
|
79
95
|
* "X Quellen" / "X sources" header text. Numeric so we read the count
|
|
80
96
|
* via regex on the visible text. Independent of sidebar collapse state.
|
|
@@ -94,14 +110,17 @@ export declare const Selectors: {
|
|
|
94
110
|
readonly overlayPane: "[role=\"dialog\"]";
|
|
95
111
|
readonly overlayInput: "[role=\"dialog\"] input[type=\"text\"]:not([readonly])";
|
|
96
112
|
readonly overlayTextarea: "[role=\"dialog\"] textarea";
|
|
113
|
+
readonly contentInput: readonly ["[role=\"dialog\"] textarea", "[role=\"dialog\"] input[type=\"text\"]:not([readonly])", "[role=\"dialog\"] textarea:not(.query-box-input):not(.query-box-textarea)"];
|
|
114
|
+
readonly titleInput: readonly ["input[placeholder*=\"title\" i]", "input[placeholder*=\"name\" i]", "input[name=\"title\"]", "input[type=\"text\"]:not([readonly])"];
|
|
115
|
+
readonly errorMessage: readonly ["[role=\"alert\"]:visible", ".error-message:visible", ".mdc-snackbar--open"];
|
|
97
116
|
/**
|
|
98
117
|
* Source-type buttons in the Add-source overlay. Google ships them
|
|
99
118
|
* *without* aria-labels — the only stable, language-agnostic anchor is
|
|
100
119
|
* the Material-Symbols icon name baked into a `<mat-icon>` text node.
|
|
101
120
|
*/
|
|
102
|
-
readonly sourceTypeUrl: readonly ["button.drop-zone-icon-button:has(mat-icon
|
|
121
|
+
readonly sourceTypeUrl: readonly ["button.drop-zone-icon-button:has(mat-icon:text-is(\"link\"))", "button.drop-zone-icon-button:has-text(\"Websites\")", "button.drop-zone-icon-button:has-text(\"Website\")", "button.drop-zone-icon-button:has-text(\"Sites Web\")", "button.drop-zone-icon-button:has-text(\"Sitio web\")", "button.drop-zone-icon-button:has-text(\"Sito web\")", "button.drop-zone-icon-button:has-text(\"Sites\")", "button.drop-zone-icon-button:has-text(\"ウェブサイト\")", "span:has-text(\"Website\")", "span:has-text(\"URL\")"];
|
|
103
122
|
readonly sourceTypeText: readonly ["button.drop-zone-icon-button:has(mat-icon:text-is(\"content_paste\"))", "button.drop-zone-icon-button:has-text(\"Kopierter Text\")", "button.drop-zone-icon-button:has-text(\"Copied text\")", "button.drop-zone-icon-button:has-text(\"Pasted text\")", "button.drop-zone-icon-button:has-text(\"Texte copié\")", "button.drop-zone-icon-button:has-text(\"Texto copiado\")", "button.drop-zone-icon-button:has-text(\"Testo copiato\")", "button.drop-zone-icon-button:has-text(\"Gekopieerde tekst\")", "button.drop-zone-icon-button:has-text(\"コピーしたテキスト\")", "span:has-text(\"Copied text\")", "span:has-text(\"Pasted text\")", "[data-type=\"text\"]"];
|
|
104
|
-
readonly sourceTypeYoutube: readonly ["button.drop-zone-icon-button
|
|
123
|
+
readonly sourceTypeYoutube: readonly ["button.drop-zone-icon-button:has(mat-icon.youtube-icon)", "button.drop-zone-icon-button:has(mat-icon:text-is(\"video_youtube\"))"];
|
|
105
124
|
readonly sourceTypeFile: readonly ["input[type=\"file\"]", "button.drop-zone-icon-button:has(mat-icon:text-is(\"upload\"))", "button.drop-zone-icon-button:has-text(\"Dateien hochladen\")", "button.drop-zone-icon-button:has-text(\"Upload sources\")", "button.drop-zone-icon-button:has-text(\"Importer\")", "button.drop-zone-icon-button:has-text(\"Subir\")", "button.drop-zone-icon-button:has-text(\"Carica\")", "button.drop-zone-icon-button:has-text(\"Uploaden\")", "button.drop-zone-icon-button:has-text(\"アップロード\")"];
|
|
106
125
|
/**
|
|
107
126
|
* Primary submit button in the add-source dialog. Material's
|
|
@@ -111,6 +130,10 @@ export declare const Selectors: {
|
|
|
111
130
|
readonly insertConfirm: readonly ["button.mdc-button--raised:has-text(\"Insert\")", "button.mat-flat-button:has-text(\"Insert\")", "button[color=\"primary\"]:has-text(\"Insert\")", "button.mdc-button--raised:has-text(\"Einfügen\")", "button.mdc-button--raised:has-text(\"Hinzufügen\")", "button.mdc-button--raised:has-text(\"Ajouter\")", "button.mdc-button--raised:has-text(\"Insertar\")", "button.mdc-button--raised:has-text(\"Inserisci\")", "button.mdc-button--raised:has-text(\"Invoegen\")", "button.mdc-button--raised:has-text(\"挿入\")", "button:has-text(\"Insert\")", "button:has-text(\"Einfügen\")", "button:has-text(\"Hinzufügen\")", "button:has-text(\"Ajouter\")", "button:has-text(\"Insérer\")", "button:has-text(\"Insertar\")", "button:has-text(\"Añadir\")", "button:has-text(\"Agregar\")", "button:has-text(\"Inserisci\")", "button:has-text(\"Aggiungi\")", "button:has-text(\"Inserir\")", "button:has-text(\"Adicionar\")", "button:has-text(\"Invoegen\")", "button:has-text(\"Toevoegen\")", "button:has-text(\"挿入\")", "button:has-text(\"追加\")", "button:has-text(\"Add\")", "button:has-text(\"Submit\")", "button[type=\"submit\"]", "[role=\"dialog\"] .mdc-dialog__actions button:not(:has-text(\"Cancel\")):not(:has-text(\"Close\")):not(:has-text(\"Schließen\")):not(:has-text(\"Annuler\")):not(:has-text(\"Cancelar\")):not(:has-text(\"Annulla\")):not(:has-text(\"Annuleren\")):not(:has-text(\"キャンセル\"))"];
|
|
112
131
|
};
|
|
113
132
|
readonly studio: {
|
|
133
|
+
readonly panel: ".studio-panel";
|
|
134
|
+
readonly customPromptField: "textarea, input[type='text']";
|
|
135
|
+
readonly expandPanelButton: readonly ["button:has(mat-icon:text-is(\"dock_to_left\"))", "button[aria-label*=\"erweitern\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"expand\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"ouvrir\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"abrir\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"aprire\" i][aria-label*=\"studio\" i]"];
|
|
136
|
+
readonly customiseAudioButton: readonly ["button[aria-label*=\"audio-zusammenfassung anpassen\" i]", "button[aria-label*=\"audio\" i][aria-label*=\"anpassen\" i]", "button[aria-label*=\"customise audio\" i]", "button[aria-label*=\"customize audio\" i]", "button[aria-label*=\"personnaliser\" i][aria-label*=\"audio\" i]", "button[aria-label*=\"personalizar\" i][aria-label*=\"audio\" i]", "button[aria-label*=\"personalizza\" i][aria-label*=\"audio\" i]"];
|
|
114
137
|
/**
|
|
115
138
|
* "Audio Overview" entry control. As of the 2026-05 Studio layout this
|
|
116
139
|
* is a `<div role="button">` with a Material-Symbols `audio_magic_eraser`
|
|
@@ -173,4 +196,33 @@ export declare const Selectors: {
|
|
|
173
196
|
* Example: `joinAlt(Selectors.chat.queryInput)` → `"textarea.query-box-input, textarea[aria-label*=\"query\" i], ..."`
|
|
174
197
|
*/
|
|
175
198
|
export declare function joinAlt(selectors: readonly string[]): string;
|
|
199
|
+
export declare const SelectorGroups: {
|
|
200
|
+
readonly "auth.emailInput": readonly ["input#identifierId", "input[name='identifier']", "input[type='email']"];
|
|
201
|
+
readonly "auth.identifierNext": readonly ["#identifierNext", "button:has-text('Next')", "button:has-text('Weiter')"];
|
|
202
|
+
readonly "auth.passwordInput": readonly ["input[name='Passwd']", "input[type='password']"];
|
|
203
|
+
readonly "auth.passwordNext": readonly ["#passwordNext", "button:has-text('Next')", "button:has-text('Weiter')"];
|
|
204
|
+
readonly "chat.queryInput": readonly ["textarea.query-box-input", "textarea[aria-label*=\"query\" i]", "textarea[aria-label*=\"anfrag\" i]", "textarea[aria-label*=\"requete\" i]", "textarea[aria-label*=\"zone de requete\" i]", "textarea[aria-label*=\"consulta\" i]", "textarea[aria-label*=\"domanda\" i]", "textarea[aria-label*=\"vraag\" i]", "textarea[aria-label*=\"質問\" i]", "textarea[aria-label*=\"pergunta\" i]"];
|
|
205
|
+
readonly "chat.submitButton": readonly ["button.submit-button", "button.submit-button[aria-label*=\"send\" i]", "button.submit-button[aria-label*=\"senden\" i]", "button.submit-button[aria-label*=\"envoyer\" i]", "button.submit-button[aria-label*=\"enviar\" i]", "button.submit-button[aria-label*=\"invia\" i]", "button.submit-button[aria-label*=\"verzend\" i]", "button.submit-button[aria-label*=\"送信\" i]"];
|
|
206
|
+
readonly "chat.answer": readonly [".to-user-container", ".to-user-container .message-text-content"];
|
|
207
|
+
readonly "chat.rateLimit": readonly [".error-message", ".error-container", "[role='alert']", ".rate-limit-message", "[data-error]", ".notification-error", ".alert-error", ".toast-error"];
|
|
208
|
+
readonly "sources.addButton": readonly ["button.add-source-button", "button[aria-label=\"Add source\"]", "button[aria-label*=\"add source\" i]", "button[aria-label*=\"quelle hinzu\" i]", "button[aria-label*=\"ajouter une source\" i]", "button[aria-label*=\"añadir fuente\" i]", "button[aria-label*=\"agregar fuente\" i]", "button[aria-label*=\"aggiungi fonte\" i]", "button[aria-label*=\"adicionar fonte\" i]", "button[aria-label*=\"bron toevoegen\" i]", "button[aria-label*=\"ソースを追加\" i]"];
|
|
209
|
+
readonly "sources.dialog": readonly ["[role=\"dialog\"]"];
|
|
210
|
+
readonly "sources.contentInput": readonly ["[role=\"dialog\"] textarea", "[role=\"dialog\"] input[type=\"text\"]:not([readonly])", "[role=\"dialog\"] textarea:not(.query-box-input):not(.query-box-textarea)"];
|
|
211
|
+
readonly "sources.insertConfirm": readonly ["button.mdc-button--raised:has-text(\"Insert\")", "button.mat-flat-button:has-text(\"Insert\")", "button[color=\"primary\"]:has-text(\"Insert\")", "button.mdc-button--raised:has-text(\"Einfügen\")", "button.mdc-button--raised:has-text(\"Hinzufügen\")", "button.mdc-button--raised:has-text(\"Ajouter\")", "button.mdc-button--raised:has-text(\"Insertar\")", "button.mdc-button--raised:has-text(\"Inserisci\")", "button.mdc-button--raised:has-text(\"Invoegen\")", "button.mdc-button--raised:has-text(\"挿入\")", "button:has-text(\"Insert\")", "button:has-text(\"Einfügen\")", "button:has-text(\"Hinzufügen\")", "button:has-text(\"Ajouter\")", "button:has-text(\"Insérer\")", "button:has-text(\"Insertar\")", "button:has-text(\"Añadir\")", "button:has-text(\"Agregar\")", "button:has-text(\"Inserisci\")", "button:has-text(\"Aggiungi\")", "button:has-text(\"Inserir\")", "button:has-text(\"Adicionar\")", "button:has-text(\"Invoegen\")", "button:has-text(\"Toevoegen\")", "button:has-text(\"挿入\")", "button:has-text(\"追加\")", "button:has-text(\"Add\")", "button:has-text(\"Submit\")", "button[type=\"submit\"]", "[role=\"dialog\"] .mdc-dialog__actions button:not(:has-text(\"Cancel\")):not(:has-text(\"Close\")):not(:has-text(\"Schließen\")):not(:has-text(\"Annuler\")):not(:has-text(\"Cancelar\")):not(:has-text(\"Annulla\")):not(:has-text(\"Annuleren\")):not(:has-text(\"キャンセル\"))"];
|
|
212
|
+
readonly "sources.errorMessage": readonly ["[role=\"alert\"]:visible", ".error-message:visible", ".mdc-snackbar--open"];
|
|
213
|
+
readonly "citations.marker": readonly ["button.citation-marker", "button.xap-inline-dialog.citation-marker", "button[data-citation]"];
|
|
214
|
+
readonly "citations.highlight": readonly [".paragraph .highlighted", ".highlighted"];
|
|
215
|
+
readonly "studio.audioOverview": readonly [".create-artifact-button-container:has(mat-icon:text-is(\"audio_magic_eraser\"))", "[role=\"button\"]:has(mat-icon:text-is(\"audio_magic_eraser\"))", "[role=\"button\"][aria-label*=\"audio-zusammenfassung\" i]", "[role=\"button\"][aria-label*=\"audio overview\" i]", "[role=\"button\"][aria-label*=\"aperçu audio\" i]", "[role=\"button\"][aria-label*=\"resumen de audio\" i]", "[role=\"button\"][aria-label*=\"panoramica audio\" i]", "[role=\"button\"][aria-label*=\"visão geral de áudio\" i]", "[role=\"button\"][aria-label*=\"audio-overzicht\" i]", "[role=\"button\"][aria-label*=\"音声の概要\" i]", "[role=\"button\"][aria-label*=\"audio\" i]", "button:has(mat-icon:text-is(\"audio_magic_eraser\"))", "button[aria-label*=\"audio overview\" i]", "button[aria-label*=\"audio-zusammenfassung\" i]", "button[aria-label*=\"podcast\" i]"];
|
|
216
|
+
readonly "studio.generate": readonly ["button:has-text(\"Generate\")", "button:has-text(\"Generieren\")", "button:has-text(\"Générer\")", "button:has-text(\"Generer\")", "button:has-text(\"Generar\")", "button:has-text(\"Genera\")", "button:has-text(\"Gerar\")", "button:has-text(\"Genereren\")", "button:has-text(\"生成\")"];
|
|
217
|
+
readonly "studio.expandPanel": readonly ["button:has(mat-icon:text-is(\"dock_to_left\"))", "button[aria-label*=\"erweitern\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"expand\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"ouvrir\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"abrir\" i][aria-label*=\"studio\" i]", "button[aria-label*=\"aprire\" i][aria-label*=\"studio\" i]"];
|
|
218
|
+
readonly "studio.customiseAudio": readonly ["button[aria-label*=\"audio-zusammenfassung anpassen\" i]", "button[aria-label*=\"audio\" i][aria-label*=\"anpassen\" i]", "button[aria-label*=\"customise audio\" i]", "button[aria-label*=\"customize audio\" i]", "button[aria-label*=\"personnaliser\" i][aria-label*=\"audio\" i]", "button[aria-label*=\"personalizar\" i][aria-label*=\"audio\" i]", "button[aria-label*=\"personalizza\" i][aria-label*=\"audio\" i]"];
|
|
219
|
+
readonly "studio.audioPlayer": readonly ["artifact-library-item:has(button.artifact-action-button)", ".artifact-library-container artifact-library-item", "audio", "[role=\"audio\"]"];
|
|
220
|
+
readonly "studio.audioMoreMenu": readonly ["artifact-library-item button:has(mat-icon:text-is(\"more_vert\"))", "artifact-library-item button[aria-label*=\"mehr\" i]", "artifact-library-item button[aria-label*=\"more\" i]", "artifact-library-item button[aria-label*=\"plus\" i]", "artifact-library-item button[aria-label*=\"más\" i]", "artifact-library-item button[aria-label*=\"altro\" i]", "artifact-library-item button[aria-label*=\"mais\" i]", "artifact-library-item button[aria-label*=\"meer\" i]", "artifact-library-item button[aria-label*=\"その他\" i]"];
|
|
221
|
+
readonly "studio.audioDownload": readonly ["[role=\"menuitem\"]:has(mat-icon:text-is(\"download\"))", "[role=\"menuitem\"]:has-text(\"Download\")", "[role=\"menuitem\"]:has-text(\"Herunterladen\")", "[role=\"menuitem\"]:has-text(\"Télécharger\")", "[role=\"menuitem\"]:has-text(\"Descargar\")", "[role=\"menuitem\"]:has-text(\"Scarica\")", "[role=\"menuitem\"]:has-text(\"Baixar\")", "[role=\"menuitem\"]:has-text(\"Downloaden\")", "[role=\"menuitem\"]:has-text(\"ダウンロード\")"];
|
|
222
|
+
readonly "notebooks.projectCard": readonly ["a.primary-action-button[href*=\"/notebook/\"]"];
|
|
223
|
+
};
|
|
224
|
+
export type SelectorGroupName = keyof typeof SelectorGroups;
|
|
225
|
+
export declare function selectorCandidates(group: SelectorGroupName): readonly string[];
|
|
226
|
+
export declare function findVisibleSelector(page: Page, group: SelectorGroupName, timeoutMs?: number): Promise<string | null>;
|
|
227
|
+
export declare function verifySelectorGroup(page: Page, group: SelectorGroupName, timeoutMs?: number): Promise<string>;
|
|
176
228
|
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/notebooklm/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/notebooklm/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;QAkBlB;;;WAGG;;QAaH;;;;;;WAMG;;;;;;;IAqDL;;;OAGG;;;;;;;;;;;;;;;QAqCD;;;WAGG;;;;;;QAYH;;;WAGG;;QAEH;;;WAGG;;QAcH;;;;;WAKG;;;;;;;QAgBH;;;;WAIG;;;;;QA8CH;;;;WAIG;;;;;;;;QAyDH;;;;WAIG;;QAqBH;;;WAGG;;QAYH;;;WAGG;;QAcH;;;;;;;WAOG;;QAQH;;;WAGG;;QAYH;;WAEG;;;;QAeH;;;;;;;WAOG;;;;;;IAoCL;;;OAGG;;CAiBK,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE5D;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CAwBjB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE5D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB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