@charlie.act7/gemini-notebook-mcp 2.1.2 → 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.
Files changed (122) hide show
  1. package/README.md +461 -434
  2. package/dist/auth/auth-manager.d.ts +2 -6
  3. package/dist/auth/auth-manager.d.ts.map +1 -1
  4. package/dist/auth/auth-manager.js +50 -58
  5. package/dist/auth/auth-manager.js.map +1 -1
  6. package/dist/config.d.ts +3 -0
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +8 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/errors.d.ts +18 -5
  11. package/dist/errors.d.ts.map +1 -1
  12. package/dist/errors.js +69 -6
  13. package/dist/errors.js.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +101 -48
  16. package/dist/index.js.map +1 -1
  17. package/dist/library/notebook-library.d.ts +7 -3
  18. package/dist/library/notebook-library.d.ts.map +1 -1
  19. package/dist/library/notebook-library.js +190 -35
  20. package/dist/library/notebook-library.js.map +1 -1
  21. package/dist/library/types.d.ts +18 -0
  22. package/dist/library/types.d.ts.map +1 -1
  23. package/dist/notebooklm/artifact-store.d.ts +26 -0
  24. package/dist/notebooklm/artifact-store.d.ts.map +1 -0
  25. package/dist/notebooklm/artifact-store.js +102 -0
  26. package/dist/notebooklm/artifact-store.js.map +1 -0
  27. package/dist/notebooklm/audio.d.ts +3 -0
  28. package/dist/notebooklm/audio.d.ts.map +1 -1
  29. package/dist/notebooklm/audio.js +72 -39
  30. package/dist/notebooklm/audio.js.map +1 -1
  31. package/dist/notebooklm/chat.d.ts.map +1 -1
  32. package/dist/notebooklm/chat.js +22 -14
  33. package/dist/notebooklm/chat.js.map +1 -1
  34. package/dist/notebooklm/citations.d.ts +17 -22
  35. package/dist/notebooklm/citations.d.ts.map +1 -1
  36. package/dist/notebooklm/citations.js +148 -115
  37. package/dist/notebooklm/citations.js.map +1 -1
  38. package/dist/notebooklm/selectors.d.ts +54 -2
  39. package/dist/notebooklm/selectors.d.ts.map +1 -1
  40. package/dist/notebooklm/selectors.js +109 -2
  41. package/dist/notebooklm/selectors.js.map +1 -1
  42. package/dist/notebooklm/sources.d.ts +18 -3
  43. package/dist/notebooklm/sources.d.ts.map +1 -1
  44. package/dist/notebooklm/sources.js +128 -32
  45. package/dist/notebooklm/sources.js.map +1 -1
  46. package/dist/resources/resource-handlers.js +2 -2
  47. package/dist/resources/resource-handlers.js.map +1 -1
  48. package/dist/session/browser-session.d.ts +17 -10
  49. package/dist/session/browser-session.d.ts.map +1 -1
  50. package/dist/session/browser-session.js +165 -169
  51. package/dist/session/browser-session.js.map +1 -1
  52. package/dist/session/session-manager.d.ts +12 -7
  53. package/dist/session/session-manager.d.ts.map +1 -1
  54. package/dist/session/session-manager.js +120 -80
  55. package/dist/session/session-manager.js.map +1 -1
  56. package/dist/session/shared-context-manager.d.ts.map +1 -1
  57. package/dist/session/shared-context-manager.js +12 -10
  58. package/dist/session/shared-context-manager.js.map +1 -1
  59. package/dist/tools/definitions/ask-question.d.ts +4 -3
  60. package/dist/tools/definitions/ask-question.d.ts.map +1 -1
  61. package/dist/tools/definitions/ask-question.js +9 -109
  62. package/dist/tools/definitions/ask-question.js.map +1 -1
  63. package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
  64. package/dist/tools/definitions/notebook-management.js +47 -4
  65. package/dist/tools/definitions/notebook-management.js.map +1 -1
  66. package/dist/tools/definitions/session-management.d.ts.map +1 -1
  67. package/dist/tools/definitions/session-management.js +2 -0
  68. package/dist/tools/definitions/session-management.js.map +1 -1
  69. package/dist/tools/definitions/sources.d.ts +8 -0
  70. package/dist/tools/definitions/sources.d.ts.map +1 -1
  71. package/dist/tools/definitions/sources.js +152 -15
  72. package/dist/tools/definitions/sources.js.map +1 -1
  73. package/dist/tools/definitions/system.d.ts.map +1 -1
  74. package/dist/tools/definitions/system.js +23 -19
  75. package/dist/tools/definitions/system.js.map +1 -1
  76. package/dist/tools/definitions.d.ts +3 -3
  77. package/dist/tools/definitions.d.ts.map +1 -1
  78. package/dist/tools/definitions.js +5 -9
  79. package/dist/tools/definitions.js.map +1 -1
  80. package/dist/tools/handlers.d.ts +101 -14
  81. package/dist/tools/handlers.d.ts.map +1 -1
  82. package/dist/tools/handlers.js +280 -76
  83. package/dist/tools/handlers.js.map +1 -1
  84. package/dist/tools/validation.d.ts +6 -0
  85. package/dist/tools/validation.d.ts.map +1 -0
  86. package/dist/tools/validation.js +267 -0
  87. package/dist/tools/validation.js.map +1 -0
  88. package/dist/transport/http.d.ts +2 -0
  89. package/dist/transport/http.d.ts.map +1 -1
  90. package/dist/transport/http.js +6 -1
  91. package/dist/transport/http.js.map +1 -1
  92. package/dist/types.d.ts +15 -1
  93. package/dist/types.d.ts.map +1 -1
  94. package/dist/utils/cleanup-manager.d.ts +35 -115
  95. package/dist/utils/cleanup-manager.d.ts.map +1 -1
  96. package/dist/utils/cleanup-manager.js +179 -632
  97. package/dist/utils/cleanup-manager.js.map +1 -1
  98. package/dist/utils/disclaimer.d.ts +2 -1
  99. package/dist/utils/disclaimer.d.ts.map +1 -1
  100. package/dist/utils/disclaimer.js +3 -2
  101. package/dist/utils/disclaimer.js.map +1 -1
  102. package/dist/utils/logger.d.ts +26 -39
  103. package/dist/utils/logger.d.ts.map +1 -1
  104. package/dist/utils/logger.js +104 -50
  105. package/dist/utils/logger.js.map +1 -1
  106. package/dist/utils/operation.d.ts +8 -0
  107. package/dist/utils/operation.d.ts.map +1 -0
  108. package/dist/utils/operation.js +42 -0
  109. package/dist/utils/operation.js.map +1 -0
  110. package/dist/utils/page-utils.d.ts.map +1 -1
  111. package/dist/utils/page-utils.js +3 -3
  112. package/dist/utils/page-utils.js.map +1 -1
  113. package/dist/version.d.ts +3 -0
  114. package/dist/version.d.ts.map +1 -0
  115. package/dist/version.js +17 -0
  116. package/dist/version.js.map +1 -0
  117. package/docs/configuration.md +205 -179
  118. package/docs/implementation-plan.md +135 -0
  119. package/docs/tools.md +473 -412
  120. package/docs/troubleshooting.md +161 -159
  121. package/docs/usage-guide.md +282 -282
  122. package/package.json +4 -3
@@ -1,49 +1,49 @@
1
- # Troubleshooting
2
-
3
- A symptom → fix matrix for v2.0.0. For the full env-var inventory, see [`configuration.md`](./configuration.md).
4
-
5
- ## Chrome fails to launch (macOS Tahoe / Windows exit 21)
6
-
7
- Symptom: `Failed to launch chrome`, `chrome exited immediately`, `code 21`, `executable doesn't exist`.
8
-
9
- Cause: System Chrome on macOS 26 (Tahoe) and certain Windows 11 setups crashes on the persistent profile launch.
10
-
11
- Fix: Force the bundled Patchright Chromium.
12
-
13
- ```bash
14
- BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
15
- # or
16
- NOTEBOOKLM_BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
17
- ```
18
-
19
- The fallback is also auto-applied when launch errors match the known patterns, but setting the env var explicitly makes the choice deterministic.
20
-
21
- ## `ask_question` times out
22
-
23
- Symptom: The tool fails after roughly 10 min with a timeout error.
24
-
25
- Checks:
26
-
27
- 1. Confirm the answer wait is sufficient — long-form prompts on notebooks with many sources legitimately exceed 2 min.
28
- ```bash
29
- ANSWER_TIMEOUT_MS=900000 npx notebooklm-mcp@latest # 15 minutes
30
- ```
31
- Or per-call: `browser_options.timeout_ms`.
32
- 2. Run with a visible browser to see what NotebookLM is doing:
33
- ```json
34
- { "name": "ask_question", "arguments": { "question": "...", "show_browser": true } }
35
- ```
36
- Or start the server with `HEADLESS=false`.
1
+ # Troubleshooting
2
+
3
+ A symptom → fix matrix for the current 2.x release. For the full env-var inventory, see [`configuration.md`](./configuration.md).
4
+
5
+ ## Chrome fails to launch (macOS Tahoe / Windows exit 21)
6
+
7
+ Symptom: `Failed to launch chrome`, `chrome exited immediately`, `code 21`, `executable doesn't exist`.
8
+
9
+ Cause: System Chrome on macOS 26 (Tahoe) and certain Windows 11 setups crashes on the persistent profile launch.
10
+
11
+ Fix: Force the bundled Patchright Chromium.
12
+
13
+ ```bash
14
+ BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
15
+ # or
16
+ NOTEBOOKLM_BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
17
+ ```
18
+
19
+ The fallback is also auto-applied when launch errors match the known patterns, but setting the env var explicitly makes the choice deterministic.
20
+
21
+ ## `ask_question` times out
22
+
23
+ Symptom: The tool fails after roughly 10 min with a timeout error.
24
+
25
+ Checks:
26
+
27
+ 1. Confirm the answer wait is sufficient — long-form prompts on notebooks with many sources legitimately exceed 2 min.
28
+ ```bash
29
+ ANSWER_TIMEOUT_MS=900000 npx notebooklm-mcp@latest # 15 minutes
30
+ ```
31
+ Or per-call: `browser_options.timeout_ms`.
32
+ 2. Run with a visible browser to see what NotebookLM is doing:
33
+ ```json
34
+ { "name": "ask_question", "arguments": { "question": "...", "show_browser": true } }
35
+ ```
36
+ Or start the server with `HEADLESS=false`.
37
37
  3. `get_health` can confirm that a readable auth backup exists, but it does not
38
38
  probe Google. A browser-driven NotebookLM operation performs the live check.
39
-
40
- ## Session expired / repeated login prompts
41
-
39
+
40
+ ## Session expired / repeated login prompts
41
+
42
42
  Symptom: a browser-driven NotebookLM operation redirects to
43
43
  `accounts.google.com` after a previously successful login.
44
-
45
- Workflow:
46
-
44
+
45
+ Workflow:
46
+
47
47
  1. Retry with `show_browser=true` and confirm that Google actually requests
48
48
  credentials. The age of `state.json` and `get_health.auth_state_present` do
49
49
  not establish whether the live session is valid.
@@ -53,61 +53,63 @@ Workflow:
53
53
  3. Only after a confirmed sign-in redirect, run `re_auth` to wipe stored auth
54
54
  and prompt for a fresh login. If that fails repeatedly, preview
55
55
  `cleanup_data` with the library preserved:
56
- ```json
57
- { "name": "cleanup_data", "arguments": { "confirm": false, "preserve_library": true } }
58
- ```
59
- Review the preview, then run again with `confirm: true`. Then `setup_auth`.
60
-
61
- ## WSL1
62
-
63
- Symptom: Chrome refuses to launch under WSL1.
64
-
65
- Fix: Upgrade to WSL2.
66
-
67
- ```powershell
68
- wsl --set-default-version 2
69
- wsl --set-version <distro> 2
70
- ```
71
-
72
- WSL2 with WSLg (Windows 11 / Windows 10 22H2+) supports a real Chromium and works out of the box.
73
-
74
- ## Headless Linux server
75
-
76
- Symptom: `setup_auth` fails on a server with no display because the login window cannot open.
77
-
78
- Fix: Run the one-time setup under `xvfb-run`. After login the persistent Chrome profile lets every subsequent run go fully headless.
79
-
80
- ```bash
81
- xvfb-run -a npx notebooklm-mcp@latest
82
- # call setup_auth from your client, complete login, then exit
83
- # from then on, run normally:
84
- npx notebooklm-mcp@latest
85
- ```
86
-
87
- ## "Unknown resource: mcp://notebooklm"
88
-
89
- Cause: A client used the wrong URI scheme.
90
-
91
- Fix: The scheme is `notebooklm://`, not `mcp://`. Supported URIs:
92
-
93
- - `notebooklm://library`
94
- - `notebooklm://library/{id}`
95
- - `notebooklm://metadata` (deprecated)
96
-
97
- The error message in v2 lists the correct set.
98
-
99
- ## Orphan Chrome processes
100
-
101
- Symptom: Chrome processes survive after the MCP server exits.
102
-
103
- v2 ships a 5-second shutdown watchdog and an aggressive teardown path, so this is rare. If it does happen:
104
-
105
- 1. Kill the lingering Chromes manually.
106
- 2. Run `cleanup_data` with `preserve_library: true` to remove stale profile locks.
107
- 3. Restart the server.
108
-
109
- ## Profile lock / `ProcessSingleton` errors
110
-
56
+ ```json
57
+ { "name": "cleanup_data", "arguments": { "confirm": false, "preserve_library": true } }
58
+ ```
59
+ Review the preview, close every browser session, then run again with
60
+ `confirm: true` and the returned `preview_token`. Then `setup_auth`.
61
+
62
+ ## WSL1
63
+
64
+ Symptom: Chrome refuses to launch under WSL1.
65
+
66
+ Fix: Upgrade to WSL2.
67
+
68
+ ```powershell
69
+ wsl --set-default-version 2
70
+ wsl --set-version <distro> 2
71
+ ```
72
+
73
+ WSL2 with WSLg (Windows 11 / Windows 10 22H2+) supports a real Chromium and works out of the box.
74
+
75
+ ## Headless Linux server
76
+
77
+ Symptom: `setup_auth` fails on a server with no display because the login window cannot open.
78
+
79
+ Fix: Run the one-time setup under `xvfb-run`. After login the persistent Chrome profile lets every subsequent run go fully headless.
80
+
81
+ ```bash
82
+ xvfb-run -a npx notebooklm-mcp@latest
83
+ # call setup_auth from your client, complete login, then exit
84
+ # from then on, run normally:
85
+ npx notebooklm-mcp@latest
86
+ ```
87
+
88
+ ## "Unknown resource: mcp://notebooklm"
89
+
90
+ Cause: A client used the wrong URI scheme.
91
+
92
+ Fix: The scheme is `notebooklm://`, not `mcp://`. Supported URIs:
93
+
94
+ - `notebooklm://library`
95
+ - `notebooklm://library/{id}`
96
+ - `notebooklm://metadata` (deprecated)
97
+
98
+ The error message in v2 lists the correct set.
99
+
100
+ ## Orphan Chrome processes
101
+
102
+ Symptom: Chrome processes survive after the MCP server exits.
103
+
104
+ v2 ships a 5-second shutdown watchdog and an aggressive teardown path, so this is rare. If it does happen:
105
+
106
+ 1. Kill the lingering Chromes manually.
107
+ 2. Preview `cleanup_data` with `preserve_library: true`, then confirm using the
108
+ returned token to remove MCP-owned profile data.
109
+ 3. Restart the server.
110
+
111
+ ## Profile lock / `ProcessSingleton` errors
112
+
111
113
  Cause: Another Chrome owns the base profile.
112
114
 
113
115
  Fix: the default `NOTEBOOK_PROFILE_STRATEGY=single` fails clearly so the server
@@ -117,65 +119,65 @@ concurrent instances are intentional, opt into automatic isolation:
117
119
  ```bash
118
120
  NOTEBOOK_PROFILE_STRATEGY=auto npx notebooklm-mcp@latest
119
121
  ```
120
-
121
- ## Rate limit reached
122
-
123
- Symptom: `NotebookLM rate limit reached (50 queries/day for free accounts)`.
124
-
125
- Options:
126
-
127
- - Use `re_auth` to switch to a different Google account.
128
- - Use multi-account mode for a clean separation:
129
- ```bash
130
- NOTEBOOKLM_ACCOUNT=backup npx notebooklm-mcp@latest
131
- ```
132
- - Wait until the daily quota resets.
133
- - Upgrade to Google AI Pro/Ultra for higher limits.
134
-
135
- ## Stealth typing too slow
136
-
137
- The default `160–240 WPM` range is realistic but slow for batch use. Either disable stealth typing or tighten the range:
138
-
139
- ```bash
140
- STEALTH_HUMAN_TYPING=false npx notebooklm-mcp@latest
141
- # or
142
- TYPING_WPM_MIN=400 TYPING_WPM_MAX=600 npx notebooklm-mcp@latest
143
- ```
144
-
145
- ## Citations are empty for `source_format=footnotes`
146
-
147
- The DOM citation panel is read after the answer settles. If it is empty:
148
-
149
- - The notebook may not have grounded sources for that question.
150
- - The UI may have shifted — check the active selectors in `src/notebooklm/selectors.ts`.
151
- - Run with `show_browser=true` and inspect the live page after the answer renders.
152
-
153
- ## Follow-up reminder is missing
154
-
155
- In v2 the follow-up reminder appended to `ask_question` answers is off by default. Re-enable with:
156
-
157
- ```bash
158
- NOTEBOOKLM_FOLLOW_UP_REMINDER=true npx notebooklm-mcp@latest
159
- ```
160
-
161
- ## AI marker breaks downstream parsing
162
-
163
- The default answer text starts with `[AI-GENERATED via Gemini 2.5 (NotebookLM) — …]`. To return to the unprefixed answer, set:
164
-
165
- ```bash
166
- NOTEBOOKLM_AI_MARKER=false npx notebooklm-mcp@latest
167
- ```
168
-
169
- Or replace the prefix with your own:
170
-
171
- ```bash
172
- NOTEBOOKLM_AI_MARKER_PREFIX="[notebooklm]" npx notebooklm-mcp@latest
173
- ```
174
-
175
- The `_provenance` envelope on the result remains regardless.
176
-
177
- ## HTTP transport: `unknown session`
178
-
179
- Cause: The client made a `GET /mcp` or `POST /mcp` (non-initialize) without echoing the `Mcp-Session-Id` returned by the initial `initialize` response.
180
-
181
- Fix: Capture the `Mcp-Session-Id` response header from the initialize call and pass it on every subsequent request. The lifecycle is owned by the MCP SDK's `StreamableHTTPServerTransport`.
122
+
123
+ ## Rate limit reached
124
+
125
+ Symptom: NotebookLM reports a rate or quota limit.
126
+
127
+ Options:
128
+
129
+ - Use `re_auth` to switch to a different Google account.
130
+ - Use multi-account mode for a clean separation:
131
+ ```bash
132
+ NOTEBOOKLM_ACCOUNT=backup npx notebooklm-mcp@latest
133
+ ```
134
+ - Wait until the daily quota resets.
135
+ - Upgrade to Google AI Pro/Ultra for higher limits.
136
+
137
+ ## Stealth typing too slow
138
+
139
+ The default `160–240 WPM` range is realistic but slow for batch use. Either disable stealth typing or tighten the range:
140
+
141
+ ```bash
142
+ STEALTH_HUMAN_TYPING=false npx notebooklm-mcp@latest
143
+ # or
144
+ TYPING_WPM_MIN=400 TYPING_WPM_MAX=600 npx notebooklm-mcp@latest
145
+ ```
146
+
147
+ ## Citations are empty for `source_format=footnotes`
148
+
149
+ The DOM citation panel is read after the answer settles. If it is empty:
150
+
151
+ - The notebook may not have grounded sources for that question.
152
+ - The UI may have shifted — check the active selectors in `src/notebooklm/selectors.ts`.
153
+ - Run with `show_browser=true` and inspect the live page after the answer renders.
154
+
155
+ ## Follow-up reminder is missing
156
+
157
+ In v2 the follow-up reminder appended to `ask_question` answers is off by default. Re-enable with:
158
+
159
+ ```bash
160
+ NOTEBOOKLM_FOLLOW_UP_REMINDER=true npx notebooklm-mcp@latest
161
+ ```
162
+
163
+ ## AI marker breaks downstream parsing
164
+
165
+ The default answer text starts with `[AI-GENERATED via Google NotebookLM — …]`. To return to the unprefixed answer, set:
166
+
167
+ ```bash
168
+ NOTEBOOKLM_AI_MARKER=false npx notebooklm-mcp@latest
169
+ ```
170
+
171
+ Or replace the prefix with your own:
172
+
173
+ ```bash
174
+ NOTEBOOKLM_AI_MARKER_PREFIX="[notebooklm]" npx notebooklm-mcp@latest
175
+ ```
176
+
177
+ The `_provenance` envelope on the result remains regardless.
178
+
179
+ ## HTTP transport: `unknown session`
180
+
181
+ Cause: The client made a `GET /mcp` or `POST /mcp` (non-initialize) without echoing the `Mcp-Session-Id` returned by the initial `initialize` response.
182
+
183
+ Fix: Capture the `Mcp-Session-Id` response header from the initialize call and pass it on every subsequent request. The lifecycle is owned by the MCP SDK's `StreamableHTTPServerTransport`.