notelm-mcp 1.2.1

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 (323) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +456 -0
  3. package/dist/auth/auth-manager.d.ts +139 -0
  4. package/dist/auth/auth-manager.d.ts.map +1 -0
  5. package/dist/auth/auth-manager.js +960 -0
  6. package/dist/auth/auth-manager.js.map +1 -0
  7. package/dist/config.d.ts +92 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +219 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/constants.d.ts +58 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +133 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/errors.d.ts +26 -0
  16. package/dist/errors.d.ts.map +1 -0
  17. package/dist/errors.js +41 -0
  18. package/dist/errors.js.map +1 -0
  19. package/dist/index.d.ts +32 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +325 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/library/notebook-library.d.ts +70 -0
  24. package/dist/library/notebook-library.d.ts.map +1 -0
  25. package/dist/library/notebook-library.js +279 -0
  26. package/dist/library/notebook-library.js.map +1 -0
  27. package/dist/library/types.d.ts +67 -0
  28. package/dist/library/types.d.ts.map +1 -0
  29. package/dist/library/types.js +8 -0
  30. package/dist/library/types.js.map +1 -0
  31. package/dist/playwright.config.d.ts +3 -0
  32. package/dist/playwright.config.d.ts.map +1 -0
  33. package/dist/playwright.config.js +38 -0
  34. package/dist/playwright.config.js.map +1 -0
  35. package/dist/resources/resource-handlers.d.ts +22 -0
  36. package/dist/resources/resource-handlers.d.ts.map +1 -0
  37. package/dist/resources/resource-handlers.js +216 -0
  38. package/dist/resources/resource-handlers.js.map +1 -0
  39. package/dist/scripts/save-auth-state.d.ts +2 -0
  40. package/dist/scripts/save-auth-state.d.ts.map +1 -0
  41. package/dist/scripts/save-auth-state.js +91 -0
  42. package/dist/scripts/save-auth-state.js.map +1 -0
  43. package/dist/session/browser-session.d.ts +108 -0
  44. package/dist/session/browser-session.d.ts.map +1 -0
  45. package/dist/session/browser-session.js +636 -0
  46. package/dist/session/browser-session.js.map +1 -0
  47. package/dist/session/session-manager.d.ts +76 -0
  48. package/dist/session/session-manager.d.ts.map +1 -0
  49. package/dist/session/session-manager.js +273 -0
  50. package/dist/session/session-manager.js.map +1 -0
  51. package/dist/session/shared-context-manager.d.ts +107 -0
  52. package/dist/session/shared-context-manager.d.ts.map +1 -0
  53. package/dist/session/shared-context-manager.js +447 -0
  54. package/dist/session/shared-context-manager.js.map +1 -0
  55. package/dist/src/auth/auth-manager.d.ts +139 -0
  56. package/dist/src/auth/auth-manager.d.ts.map +1 -0
  57. package/dist/src/auth/auth-manager.js +960 -0
  58. package/dist/src/auth/auth-manager.js.map +1 -0
  59. package/dist/src/config.d.ts +92 -0
  60. package/dist/src/config.d.ts.map +1 -0
  61. package/dist/src/config.js +219 -0
  62. package/dist/src/config.js.map +1 -0
  63. package/dist/src/constants.d.ts +58 -0
  64. package/dist/src/constants.d.ts.map +1 -0
  65. package/dist/src/constants.js +133 -0
  66. package/dist/src/constants.js.map +1 -0
  67. package/dist/src/errors.d.ts +26 -0
  68. package/dist/src/errors.d.ts.map +1 -0
  69. package/dist/src/errors.js +41 -0
  70. package/dist/src/errors.js.map +1 -0
  71. package/dist/src/index.d.ts +32 -0
  72. package/dist/src/index.d.ts.map +1 -0
  73. package/dist/src/index.js +325 -0
  74. package/dist/src/index.js.map +1 -0
  75. package/dist/src/library/notebook-library.d.ts +70 -0
  76. package/dist/src/library/notebook-library.d.ts.map +1 -0
  77. package/dist/src/library/notebook-library.js +279 -0
  78. package/dist/src/library/notebook-library.js.map +1 -0
  79. package/dist/src/library/types.d.ts +67 -0
  80. package/dist/src/library/types.d.ts.map +1 -0
  81. package/dist/src/library/types.js +8 -0
  82. package/dist/src/library/types.js.map +1 -0
  83. package/dist/src/resources/resource-handlers.d.ts +22 -0
  84. package/dist/src/resources/resource-handlers.d.ts.map +1 -0
  85. package/dist/src/resources/resource-handlers.js +216 -0
  86. package/dist/src/resources/resource-handlers.js.map +1 -0
  87. package/dist/src/scripts/health-check.d.ts +13 -0
  88. package/dist/src/scripts/health-check.d.ts.map +1 -0
  89. package/dist/src/scripts/health-check.js +100 -0
  90. package/dist/src/scripts/health-check.js.map +1 -0
  91. package/dist/src/session/browser-session.d.ts +108 -0
  92. package/dist/src/session/browser-session.d.ts.map +1 -0
  93. package/dist/src/session/browser-session.js +642 -0
  94. package/dist/src/session/browser-session.js.map +1 -0
  95. package/dist/src/session/session-manager.d.ts +76 -0
  96. package/dist/src/session/session-manager.d.ts.map +1 -0
  97. package/dist/src/session/session-manager.js +273 -0
  98. package/dist/src/session/session-manager.js.map +1 -0
  99. package/dist/src/session/shared-context-manager.d.ts +107 -0
  100. package/dist/src/session/shared-context-manager.d.ts.map +1 -0
  101. package/dist/src/session/shared-context-manager.js +447 -0
  102. package/dist/src/session/shared-context-manager.js.map +1 -0
  103. package/dist/src/tools/definitions/ask-question.d.ts +8 -0
  104. package/dist/src/tools/definitions/ask-question.d.ts.map +1 -0
  105. package/dist/src/tools/definitions/ask-question.js +211 -0
  106. package/dist/src/tools/definitions/ask-question.js.map +1 -0
  107. package/dist/src/tools/definitions/notebook-management.d.ts +3 -0
  108. package/dist/src/tools/definitions/notebook-management.d.ts.map +1 -0
  109. package/dist/src/tools/definitions/notebook-management.js +243 -0
  110. package/dist/src/tools/definitions/notebook-management.js.map +1 -0
  111. package/dist/src/tools/definitions/session-management.d.ts +3 -0
  112. package/dist/src/tools/definitions/session-management.d.ts.map +1 -0
  113. package/dist/src/tools/definitions/session-management.js +41 -0
  114. package/dist/src/tools/definitions/session-management.js.map +1 -0
  115. package/dist/src/tools/definitions/system.d.ts +3 -0
  116. package/dist/src/tools/definitions/system.d.ts.map +1 -0
  117. package/dist/src/tools/definitions/system.js +143 -0
  118. package/dist/src/tools/definitions/system.js.map +1 -0
  119. package/dist/src/tools/definitions.d.ts +12 -0
  120. package/dist/src/tools/definitions.d.ts.map +1 -0
  121. package/dist/src/tools/definitions.js +26 -0
  122. package/dist/src/tools/definitions.js.map +1 -0
  123. package/dist/src/tools/handlers.d.ts +212 -0
  124. package/dist/src/tools/handlers.d.ts.map +1 -0
  125. package/dist/src/tools/handlers.js +712 -0
  126. package/dist/src/tools/handlers.js.map +1 -0
  127. package/dist/src/tools/index.d.ts +8 -0
  128. package/dist/src/tools/index.d.ts.map +1 -0
  129. package/dist/src/tools/index.js +8 -0
  130. package/dist/src/tools/index.js.map +1 -0
  131. package/dist/src/types.d.ts +88 -0
  132. package/dist/src/types.d.ts.map +1 -0
  133. package/dist/src/types.js +5 -0
  134. package/dist/src/types.js.map +1 -0
  135. package/dist/src/utils/auth-manager.d.ts +2 -0
  136. package/dist/src/utils/auth-manager.d.ts.map +1 -0
  137. package/dist/src/utils/auth-manager.js +25 -0
  138. package/dist/src/utils/auth-manager.js.map +1 -0
  139. package/dist/src/utils/cleanup-manager.d.ts +133 -0
  140. package/dist/src/utils/cleanup-manager.d.ts.map +1 -0
  141. package/dist/src/utils/cleanup-manager.js +673 -0
  142. package/dist/src/utils/cleanup-manager.js.map +1 -0
  143. package/dist/src/utils/cli-handler.d.ts +16 -0
  144. package/dist/src/utils/cli-handler.d.ts.map +1 -0
  145. package/dist/src/utils/cli-handler.js +102 -0
  146. package/dist/src/utils/cli-handler.js.map +1 -0
  147. package/dist/src/utils/logger.d.ts +61 -0
  148. package/dist/src/utils/logger.d.ts.map +1 -0
  149. package/dist/src/utils/logger.js +92 -0
  150. package/dist/src/utils/logger.js.map +1 -0
  151. package/dist/src/utils/page-utils.d.ts +54 -0
  152. package/dist/src/utils/page-utils.d.ts.map +1 -0
  153. package/dist/src/utils/page-utils.js +381 -0
  154. package/dist/src/utils/page-utils.js.map +1 -0
  155. package/dist/src/utils/rate-limit-handler.d.ts +42 -0
  156. package/dist/src/utils/rate-limit-handler.d.ts.map +1 -0
  157. package/dist/src/utils/rate-limit-handler.js +88 -0
  158. package/dist/src/utils/rate-limit-handler.js.map +1 -0
  159. package/dist/src/utils/rate-limit-handler.test.d.ts +7 -0
  160. package/dist/src/utils/rate-limit-handler.test.d.ts.map +1 -0
  161. package/dist/src/utils/rate-limit-handler.test.js +86 -0
  162. package/dist/src/utils/rate-limit-handler.test.js.map +1 -0
  163. package/dist/src/utils/settings-manager.d.ts +37 -0
  164. package/dist/src/utils/settings-manager.d.ts.map +1 -0
  165. package/dist/src/utils/settings-manager.js +121 -0
  166. package/dist/src/utils/settings-manager.js.map +1 -0
  167. package/dist/src/utils/stealth-utils.d.ts +135 -0
  168. package/dist/src/utils/stealth-utils.d.ts.map +1 -0
  169. package/dist/src/utils/stealth-utils.js +396 -0
  170. package/dist/src/utils/stealth-utils.js.map +1 -0
  171. package/dist/src/utils/stealth-utils.test.d.ts +7 -0
  172. package/dist/src/utils/stealth-utils.test.d.ts.map +1 -0
  173. package/dist/src/utils/stealth-utils.test.js +72 -0
  174. package/dist/src/utils/stealth-utils.test.js.map +1 -0
  175. package/dist/tests/e2e/authenticated.spec.d.ts +2 -0
  176. package/dist/tests/e2e/authenticated.spec.d.ts.map +1 -0
  177. package/dist/tests/e2e/authenticated.spec.js +41 -0
  178. package/dist/tests/e2e/authenticated.spec.js.map +1 -0
  179. package/dist/tests/e2e/mocked.spec.d.ts +2 -0
  180. package/dist/tests/e2e/mocked.spec.d.ts.map +1 -0
  181. package/dist/tests/e2e/mocked.spec.js +32 -0
  182. package/dist/tests/e2e/mocked.spec.js.map +1 -0
  183. package/dist/tests/mocks/handlers.d.ts +4 -0
  184. package/dist/tests/mocks/handlers.d.ts.map +1 -0
  185. package/dist/tests/mocks/handlers.js +55 -0
  186. package/dist/tests/mocks/handlers.js.map +1 -0
  187. package/dist/tests/mocks/setup.d.ts +3 -0
  188. package/dist/tests/mocks/setup.d.ts.map +1 -0
  189. package/dist/tests/mocks/setup.js +77 -0
  190. package/dist/tests/mocks/setup.js.map +1 -0
  191. package/dist/tools/definitions/ask-question.d.ts +8 -0
  192. package/dist/tools/definitions/ask-question.d.ts.map +1 -0
  193. package/dist/tools/definitions/ask-question.js +211 -0
  194. package/dist/tools/definitions/ask-question.js.map +1 -0
  195. package/dist/tools/definitions/notebook-management.d.ts +3 -0
  196. package/dist/tools/definitions/notebook-management.d.ts.map +1 -0
  197. package/dist/tools/definitions/notebook-management.js +243 -0
  198. package/dist/tools/definitions/notebook-management.js.map +1 -0
  199. package/dist/tools/definitions/session-management.d.ts +3 -0
  200. package/dist/tools/definitions/session-management.d.ts.map +1 -0
  201. package/dist/tools/definitions/session-management.js +41 -0
  202. package/dist/tools/definitions/session-management.js.map +1 -0
  203. package/dist/tools/definitions/system.d.ts +3 -0
  204. package/dist/tools/definitions/system.d.ts.map +1 -0
  205. package/dist/tools/definitions/system.js +143 -0
  206. package/dist/tools/definitions/system.js.map +1 -0
  207. package/dist/tools/definitions.d.ts +12 -0
  208. package/dist/tools/definitions.d.ts.map +1 -0
  209. package/dist/tools/definitions.js +26 -0
  210. package/dist/tools/definitions.js.map +1 -0
  211. package/dist/tools/handlers.d.ts +212 -0
  212. package/dist/tools/handlers.d.ts.map +1 -0
  213. package/dist/tools/handlers.js +712 -0
  214. package/dist/tools/handlers.js.map +1 -0
  215. package/dist/tools/index.d.ts +8 -0
  216. package/dist/tools/index.d.ts.map +1 -0
  217. package/dist/tools/index.js +8 -0
  218. package/dist/tools/index.js.map +1 -0
  219. package/dist/types.d.ts +82 -0
  220. package/dist/types.d.ts.map +1 -0
  221. package/dist/types.js +5 -0
  222. package/dist/types.js.map +1 -0
  223. package/dist/utils/cleanup-manager.d.ts +133 -0
  224. package/dist/utils/cleanup-manager.d.ts.map +1 -0
  225. package/dist/utils/cleanup-manager.js +673 -0
  226. package/dist/utils/cleanup-manager.js.map +1 -0
  227. package/dist/utils/cli-handler.d.ts +16 -0
  228. package/dist/utils/cli-handler.d.ts.map +1 -0
  229. package/dist/utils/cli-handler.js +102 -0
  230. package/dist/utils/cli-handler.js.map +1 -0
  231. package/dist/utils/logger.d.ts +61 -0
  232. package/dist/utils/logger.d.ts.map +1 -0
  233. package/dist/utils/logger.js +92 -0
  234. package/dist/utils/logger.js.map +1 -0
  235. package/dist/utils/page-utils.d.ts +54 -0
  236. package/dist/utils/page-utils.d.ts.map +1 -0
  237. package/dist/utils/page-utils.js +381 -0
  238. package/dist/utils/page-utils.js.map +1 -0
  239. package/dist/utils/rate-limit-handler.d.ts +42 -0
  240. package/dist/utils/rate-limit-handler.d.ts.map +1 -0
  241. package/dist/utils/rate-limit-handler.js +88 -0
  242. package/dist/utils/rate-limit-handler.js.map +1 -0
  243. package/dist/utils/rate-limit-handler.test.d.ts +7 -0
  244. package/dist/utils/rate-limit-handler.test.d.ts.map +1 -0
  245. package/dist/utils/rate-limit-handler.test.js +91 -0
  246. package/dist/utils/rate-limit-handler.test.js.map +1 -0
  247. package/dist/utils/settings-manager.d.ts +37 -0
  248. package/dist/utils/settings-manager.d.ts.map +1 -0
  249. package/dist/utils/settings-manager.js +121 -0
  250. package/dist/utils/settings-manager.js.map +1 -0
  251. package/dist/utils/stealth-utils.d.ts +135 -0
  252. package/dist/utils/stealth-utils.d.ts.map +1 -0
  253. package/dist/utils/stealth-utils.js +396 -0
  254. package/dist/utils/stealth-utils.js.map +1 -0
  255. package/dist/utils/stealth-utils.test.d.ts +7 -0
  256. package/dist/utils/stealth-utils.test.d.ts.map +1 -0
  257. package/dist/utils/stealth-utils.test.js +72 -0
  258. package/dist/utils/stealth-utils.test.js.map +1 -0
  259. package/docs/01_configuration.md +94 -0
  260. package/docs/02_tools.md +34 -0
  261. package/docs/03_troubleshooting.md +59 -0
  262. package/docs/04_usage-guide.md +245 -0
  263. package/docs/05_project-analysis.qmd +309 -0
  264. package/docs/06_integration-analysis.html +914 -0
  265. package/docs/06_integration-analysis.qmd +255 -0
  266. package/docs/06_integration-analysis_files/libs/bootstrap/bootstrap-4f0954b6b0dd6bf39f4bb9151ba984db.min.css +12 -0
  267. package/docs/06_integration-analysis_files/libs/bootstrap/bootstrap-icons.css +2106 -0
  268. package/docs/06_integration-analysis_files/libs/bootstrap/bootstrap-icons.woff +0 -0
  269. package/docs/06_integration-analysis_files/libs/bootstrap/bootstrap.min.js +7 -0
  270. package/docs/06_integration-analysis_files/libs/clipboard/clipboard.min.js +7 -0
  271. package/docs/06_integration-analysis_files/libs/quarto-html/anchor.min.js +9 -0
  272. package/docs/06_integration-analysis_files/libs/quarto-html/axe/axe-check.js +145 -0
  273. package/docs/06_integration-analysis_files/libs/quarto-html/popper.min.js +6 -0
  274. package/docs/06_integration-analysis_files/libs/quarto-html/quarto-syntax-highlighting-587c61ba64f3a5504c4d52d930310e48.css +236 -0
  275. package/docs/06_integration-analysis_files/libs/quarto-html/quarto.js +847 -0
  276. package/docs/06_integration-analysis_files/libs/quarto-html/tabsets/tabsets.js +95 -0
  277. package/docs/06_integration-analysis_files/libs/quarto-html/tippy.css +1 -0
  278. package/docs/06_integration-analysis_files/libs/quarto-html/tippy.umd.min.js +2 -0
  279. package/docs/07_e2e-testing-safety.qmd +754 -0
  280. package/docs/08_project-re-evaluation.html +609 -0
  281. package/docs/08_project-re-evaluation.qmd +86 -0
  282. package/docs/08_project-re-evaluation_files/libs/bootstrap/bootstrap-4f0954b6b0dd6bf39f4bb9151ba984db.min.css +12 -0
  283. package/docs/08_project-re-evaluation_files/libs/bootstrap/bootstrap-icons.css +2106 -0
  284. package/docs/08_project-re-evaluation_files/libs/bootstrap/bootstrap-icons.woff +0 -0
  285. package/docs/08_project-re-evaluation_files/libs/bootstrap/bootstrap.min.js +7 -0
  286. package/docs/08_project-re-evaluation_files/libs/clipboard/clipboard.min.js +7 -0
  287. package/docs/08_project-re-evaluation_files/libs/quarto-html/anchor.min.js +9 -0
  288. package/docs/08_project-re-evaluation_files/libs/quarto-html/axe/axe-check.js +145 -0
  289. package/docs/08_project-re-evaluation_files/libs/quarto-html/popper.min.js +6 -0
  290. package/docs/08_project-re-evaluation_files/libs/quarto-html/quarto-syntax-highlighting-587c61ba64f3a5504c4d52d930310e48.css +236 -0
  291. package/docs/08_project-re-evaluation_files/libs/quarto-html/quarto.js +847 -0
  292. package/docs/08_project-re-evaluation_files/libs/quarto-html/tabsets/tabsets.js +95 -0
  293. package/docs/08_project-re-evaluation_files/libs/quarto-html/tippy.css +1 -0
  294. package/docs/08_project-re-evaluation_files/libs/quarto-html/tippy.umd.min.js +2 -0
  295. package/docs/notebooklm-mcp-usage.html +704 -0
  296. package/docs/notebooklm-mcp-usage.qmd +119 -0
  297. package/docs/notebooklm-mcp-usage_files/libs/bootstrap/bootstrap-6b71f2156b6a5230c6677325978bcf08.min.css +12 -0
  298. package/docs/notebooklm-mcp-usage_files/libs/bootstrap/bootstrap-icons.css +2106 -0
  299. package/docs/notebooklm-mcp-usage_files/libs/bootstrap/bootstrap-icons.woff +0 -0
  300. package/docs/notebooklm-mcp-usage_files/libs/bootstrap/bootstrap.min.js +7 -0
  301. package/docs/notebooklm-mcp-usage_files/libs/clipboard/clipboard.min.js +7 -0
  302. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/anchor.min.js +9 -0
  303. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/axe/axe-check.js +145 -0
  304. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/popper.min.js +6 -0
  305. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/quarto-syntax-highlighting-587c61ba64f3a5504c4d52d930310e48.css +236 -0
  306. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/quarto.js +847 -0
  307. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/tabsets/tabsets.js +95 -0
  308. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/tippy.css +1 -0
  309. package/docs/notebooklm-mcp-usage_files/libs/quarto-html/tippy.umd.min.js +2 -0
  310. package/docs/repomix-usage_files/libs/bootstrap/bootstrap-6b71f2156b6a5230c6677325978bcf08.min.css +12 -0
  311. package/docs/repomix-usage_files/libs/bootstrap/bootstrap-icons.css +2106 -0
  312. package/docs/repomix-usage_files/libs/bootstrap/bootstrap-icons.woff +0 -0
  313. package/docs/repomix-usage_files/libs/bootstrap/bootstrap.min.js +7 -0
  314. package/docs/repomix-usage_files/libs/clipboard/clipboard.min.js +7 -0
  315. package/docs/repomix-usage_files/libs/quarto-html/anchor.min.js +9 -0
  316. package/docs/repomix-usage_files/libs/quarto-html/axe/axe-check.js +145 -0
  317. package/docs/repomix-usage_files/libs/quarto-html/popper.min.js +6 -0
  318. package/docs/repomix-usage_files/libs/quarto-html/quarto-syntax-highlighting-587c61ba64f3a5504c4d52d930310e48.css +236 -0
  319. package/docs/repomix-usage_files/libs/quarto-html/quarto.js +847 -0
  320. package/docs/repomix-usage_files/libs/quarto-html/tabsets/tabsets.js +95 -0
  321. package/docs/repomix-usage_files/libs/quarto-html/tippy.css +1 -0
  322. package/docs/repomix-usage_files/libs/quarto-html/tippy.umd.min.js +2 -0
  323. package/package.json +62 -0
@@ -0,0 +1,55 @@
1
+ import { http, HttpResponse } from 'msw';
2
+ export const googleOAuthHandlers = [
3
+ // Mock OAuth2 Auth Code Flow
4
+ http.get('https://accounts.google.com/o/oauth2/v2/auth', () => {
5
+ const mockAuthCode = 'mock_auth_code_12345';
6
+ // Simulate redirect back to localhost
7
+ return HttpResponse.redirect(`http://localhost:3000/callback?code=${mockAuthCode}`);
8
+ }),
9
+ // Mock Token Exchange
10
+ http.post('https://oauth2.googleapis.com/token', () => {
11
+ return HttpResponse.json({
12
+ access_token: 'mock_access_token',
13
+ refresh_token: 'mock_refresh_token',
14
+ expires_in: 3600,
15
+ token_type: 'Bearer',
16
+ });
17
+ }),
18
+ // Mock User Info
19
+ http.get('https://www.googleapis.com/oauth2/v3/userinfo', () => {
20
+ return HttpResponse.json({
21
+ sub: '123456789',
22
+ name: 'Test User',
23
+ email: 'test@example.com',
24
+ picture: 'https://example.com/avatar.jpg'
25
+ });
26
+ }),
27
+ ];
28
+ export const notebookLMHandlers = [
29
+ // Mock Chat API
30
+ http.post('https://notebooklm.google.com/api/chat', async () => {
31
+ // Ideally we would parse the request body to give context-aware responses
32
+ // const body = await request.json();
33
+ return HttpResponse.json({
34
+ response: `Mocked response from NotebookLM.`,
35
+ sources: [
36
+ { title: 'Mock Source 1', snippet: 'Relevant content...' }
37
+ ],
38
+ thinking_time: 1000,
39
+ });
40
+ }),
41
+ // Mock Notebooks List
42
+ http.get('https://notebooklm.google.com/api/notebooks', () => {
43
+ return HttpResponse.json({
44
+ notebooks: [
45
+ { id: 'mock-001', title: 'Test Notebook 1' },
46
+ { id: 'mock-002', title: 'Test Notebook 2' },
47
+ ]
48
+ });
49
+ }),
50
+ ];
51
+ export const handlers = [
52
+ ...googleOAuthHandlers,
53
+ ...notebookLMHandlers,
54
+ ];
55
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../tests/mocks/handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAEzC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,6BAA6B;IAC7B,IAAI,CAAC,GAAG,CAAC,8CAA8C,EAAE,GAAG,EAAE;QAC1D,MAAM,YAAY,GAAG,sBAAsB,CAAC;QAC5C,sCAAsC;QACtC,OAAO,YAAY,CAAC,QAAQ,CACxB,uCAAuC,YAAY,EAAE,CACxD,CAAC;IACN,CAAC,CAAC;IAEF,sBAAsB;IACtB,IAAI,CAAC,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAClD,OAAO,YAAY,CAAC,IAAI,CAAC;YACrB,YAAY,EAAE,mBAAmB;YACjC,aAAa,EAAE,oBAAoB;YACnC,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,QAAQ;SACvB,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,iBAAiB;IACjB,IAAI,CAAC,GAAG,CAAC,+CAA+C,EAAE,GAAG,EAAE;QAC3D,OAAO,YAAY,CAAC,IAAI,CAAC;YACrB,GAAG,EAAE,WAAW;YAChB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,gCAAgC;SAC5C,CAAC,CAAC;IACP,CAAC,CAAC;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,gBAAgB;IAChB,IAAI,CAAC,IAAI,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QAC3D,0EAA0E;QAC1E,qCAAqC;QAErC,OAAO,YAAY,CAAC,IAAI,CAAC;YACrB,QAAQ,EAAE,kCAAkC;YAC5C,OAAO,EAAE;gBACL,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE;aAC7D;YACD,aAAa,EAAE,IAAI;SACtB,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,sBAAsB;IACtB,IAAI,CAAC,GAAG,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACzD,OAAO,YAAY,CAAC,IAAI,CAAC;YACrB,SAAS,EAAE;gBACP,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE;gBAC5C,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE;aAC/C;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,GAAG,mBAAmB;IACtB,GAAG,kBAAkB;CACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Page } from '@playwright/test';
2
+ export declare function setupMSW(page: Page): Promise<void>;
3
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../tests/mocks/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA8BxC,wBAAsB,QAAQ,CAAC,IAAI,EAAE,IAAI,iBAoDxC"}
@@ -0,0 +1,77 @@
1
+ // import { setupWorker } from 'msw/browser'; // createWorker doesn't exist, use setupWorker if needed
2
+ // However, typically for E2E we might want to intercept at network layer.
3
+ // Providing a simple setup function.
4
+ // import { handlers } from './handlers.js';
5
+ // For Playwright, we often use page.route to intercept, but MSW has a cleaner integration.
6
+ // Since we are running in Node context (Playwright runner) but browser is separate,
7
+ // we can use MSW's http interceptor if we were doing API tests,
8
+ // OR we can use page.route handler generator if we want to mock network requests made by the browser.
9
+ //
10
+ // A common pattern for Playwright + MSW is to load the service worker in the browser,
11
+ // OR simply use Playwright's network interception to fulfill requests based on MSW handlers.
12
+ //
13
+ // For simplicity and robustness without Service Worker complexity in this environment:
14
+ // We will manually map MSW handlers to Playwright page.route if needed,
15
+ // BUT the simplest "MSW-like" approach in Playwright is just using page.route directly.
16
+ //
17
+ // However, to stick to the doc's "MSW" strategy, let's assume we want to use 'msw' library.
18
+ // The doc example showed `setupMSW(page, handlers)`. Let's implement that helper.
19
+ //
20
+ // Note: Direct MSW integration with Playwright often involves experimental loaders or manual routing.
21
+ // We will implement a helper that uses Playwright's `page.route` to handle requests using MSW logic
22
+ // or simply mimics it if MSW integration is too complex to setup in one go without a plugin.
23
+ //
24
+ // Actually, let's stick to true MSW if possible, but given the constraints,
25
+ // I will implement a `setupMSW` that uses `page.route` to fulfill requests
26
+ // corresponding to our handlers. This is more robust than trying to inject a Service Worker.
27
+ export async function setupMSW(page) {
28
+ // This is a simplified implementation that manually routes specific URL patterns
29
+ // to return the JSON defined in our handlers.
30
+ // Real MSW integration is more involved.
31
+ // To strictly follow the doc's "Strategy 1", we will implement the routing manually here
32
+ // to achieve the EFFECT of MSW without the full boilerplate of a Service Worker build step.
33
+ // 1. Mock Notebooks List
34
+ await page.route('**/api/notebooks', async (route) => {
35
+ await route.fulfill({
36
+ status: 200,
37
+ contentType: 'application/json',
38
+ body: JSON.stringify({
39
+ notebooks: [
40
+ { id: 'mock-001', title: 'Test Notebook 1' },
41
+ { id: 'mock-002', title: 'Test Notebook 2' },
42
+ ]
43
+ })
44
+ });
45
+ });
46
+ // 2. Mock Chat
47
+ await page.route('**/api/chat', async (route) => {
48
+ await route.fulfill({
49
+ status: 200,
50
+ contentType: 'application/json',
51
+ body: JSON.stringify({
52
+ response: `Mocked response from NotebookLM.`,
53
+ sources: [
54
+ { title: 'Mock Source 1', snippet: 'Relevant content...' }
55
+ ],
56
+ thinking_time: 1000,
57
+ })
58
+ });
59
+ });
60
+ // 3. Mock OAuth (simplified)
61
+ await page.route('https://accounts.google.com/**', async (route) => {
62
+ // If we are fully mocking, we might not even hit this if we start internally.
63
+ // But if app redirects here, we redirect back.
64
+ const url = new URL(route.request().url());
65
+ if (url.pathname.includes('auth')) {
66
+ await route.fulfill({
67
+ status: 302,
68
+ headers: { Location: 'http://localhost:3000/callback?code=mock_code' }
69
+ });
70
+ }
71
+ else {
72
+ await route.continue();
73
+ }
74
+ });
75
+ console.log('MSW (Simulated) initialized');
76
+ }
77
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../tests/mocks/setup.ts"],"names":[],"mappings":"AACA,sGAAsG;AACtG,0EAA0E;AAC1E,qCAAqC;AAErC,4CAA4C;AAE5C,2FAA2F;AAC3F,qFAAqF;AACrF,iEAAiE;AACjE,sGAAsG;AACtG,EAAE;AACF,sFAAsF;AACtF,6FAA6F;AAC7F,EAAE;AACF,uFAAuF;AACvF,yEAAyE;AACzE,wFAAwF;AACxF,EAAE;AACF,4FAA4F;AAC5F,kFAAkF;AAClF,GAAG;AACH,sGAAsG;AACtG,qGAAqG;AACrG,6FAA6F;AAC7F,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,6FAA6F;AAE7F,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAU;IACrC,kFAAkF;IAClF,+CAA+C;IAC/C,0CAA0C;IAC1C,0FAA0F;IAC1F,4F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E,EAAE,QAAQ,EAAE,+CAA+C,EAAE;aACzE,CAAC,CAAC;QACP,CAAC;aAAM,CAAC;YACJ,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ import { NotebookLibrary } from "../../library/notebook-library.js";
3
+ /**
4
+ * Build dynamic tool description for ask_question based on active notebook or library
5
+ */
6
+ export declare function buildAskQuestionDescription(library: NotebookLibrary): string;
7
+ export declare const askQuestionTool: Tool;
8
+ //# sourceMappingURL=ask-question.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-question.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/ask-question.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAuG5E;AAED,eAAO,MAAM,eAAe,EAAE,IA4G7B,CAAC"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Build dynamic tool description for ask_question based on active notebook or library
3
+ */
4
+ export function buildAskQuestionDescription(library) {
5
+ const active = library.getActiveNotebook();
6
+ const bt = "`"; // Backtick helper to avoid template literal issues
7
+ if (active) {
8
+ const topics = active.topics.join(", ");
9
+ const useCases = active.use_cases.map((uc) => ` - ${uc}`).join("\n");
10
+ return `# Conversational Research Partner (NotebookLM • Gemini 2.5 • Session RAG)
11
+
12
+ **Active Notebook:** ${active.name}
13
+ **Content:** ${active.description}
14
+ **Topics:** ${topics}
15
+
16
+ > Auth tip: If login is required, use the prompt 'notebooklm.auth-setup' and then verify with the 'get_health' tool. If authentication later fails (e.g., expired cookies), use the prompt 'notebooklm.auth-repair'.
17
+
18
+ ## What This Tool Is
19
+ - Full conversational research with Gemini (LLM) grounded on your notebook sources
20
+ - Session-based: each follow-up uses prior context for deeper, more precise answers
21
+ - Source-cited responses designed to minimize hallucinations
22
+
23
+ ## When To Use
24
+ ${useCases}
25
+
26
+ ## Rules (Important)
27
+ - Always prefer continuing an existing session for the same task
28
+ - If you start a new thread, create a new session and keep its session_id
29
+ - Ask clarifying questions before implementing; do not guess missing details
30
+ - If multiple notebooks could apply, propose the top 1–2 and ask which to use
31
+ - If task context changes, ask to reset the session or switch notebooks
32
+ - If authentication fails, use the prompts 'notebooklm.auth-repair' (or 'notebooklm.auth-setup') and verify with 'get_health'
33
+ - After every NotebookLM answer: pause, compare with the user's goal, and only respond if you are 100% sure the information is complete. Otherwise, plan the next NotebookLM question in the same session.
34
+
35
+ ## Session Flow (Recommended)
36
+ ${bt}${bt}${bt}javascript
37
+ // 1) Start broad (no session_id → creates one)
38
+ ask_question({ question: "Give me an overview of [topic]" })
39
+ // ← Save: result.session_id
40
+
41
+ // 2) Go specific (same session)
42
+ ask_question({ question: "Key APIs/methods?", session_id })
43
+
44
+ // 3) Cover pitfalls (same session)
45
+ ask_question({ question: "Common edge cases + gotchas?", session_id })
46
+
47
+ // 4) Ask for production example (same session)
48
+ ask_question({ question: "Show a production-ready example", session_id })
49
+ ${bt}${bt}${bt}
50
+
51
+ ## Automatic Multi-Pass Strategy (Host-driven)
52
+ - Simple prompts return once-and-done answers.
53
+ - For complex prompts, the host should issue follow-up calls:
54
+ 1. Implementation plan (APIs, dependencies, configuration, authentication).
55
+ 2. Pitfalls, gaps, validation steps, missing prerequisites.
56
+ - Keep the same session_id for all follow-ups, review NotebookLM's answer, and ask more questions until the problem is fully resolved.
57
+ - Before replying to the user, double-check: do you truly have everything? If not, queue another ask_question immediately.
58
+
59
+ ## 🔥 REAL EXAMPLE
60
+
61
+ Task: "Implement error handling in n8n workflow"
62
+
63
+ Bad (shallow):
64
+ ${bt}${bt}${bt}
65
+ Q: "How do I handle errors in n8n?"
66
+ A: [basic answer]
67
+ → Implement → Probably missing edge cases!
68
+ ${bt}${bt}${bt}
69
+
70
+ Good (deep):
71
+ ${bt}${bt}${bt}
72
+ Q1: "What are n8n's error handling mechanisms?" (session created)
73
+ A1: [Overview of error handling]
74
+
75
+ Q2: "What's the recommended pattern for API errors?" (same session)
76
+ A2: [Specific patterns, uses context from Q1]
77
+
78
+ Q3: "How do I handle retry logic and timeouts?" (same session)
79
+ A3: [Detailed approach, builds on Q1+Q2]
80
+
81
+ Q4: "Show me a production example with all these patterns" (same session)
82
+ A4: [Complete example with full context]
83
+
84
+ → NOW implement with confidence!
85
+ ${bt}${bt}${bt}
86
+
87
+ ## Notebook Selection
88
+ - Default: active notebook (${active.id})
89
+ - Or set notebook_id to use a library notebook
90
+ - Or set notebook_url for ad-hoc notebooks (not in library)
91
+ - If ambiguous which notebook fits, ASK the user which to use`;
92
+ }
93
+ else {
94
+ return `# Conversational Research Partner (NotebookLM • Gemini 2.5 • Session RAG)
95
+
96
+ ## No Active Notebook
97
+ - Visit https://notebooklm.google to create a notebook and get a share link
98
+ - Use **add_notebook** to add it to your library (explains how to get the link)
99
+ - Use **list_notebooks** to show available sources
100
+ - Use **select_notebook** to set one active
101
+
102
+ > Auth tip: If login is required, use the prompt 'notebooklm.auth-setup' and then verify with the 'get_health' tool. If authentication later fails (e.g., expired cookies), use the prompt 'notebooklm.auth-repair'.
103
+
104
+ Tip: Tell the user you can manage NotebookLM library and ask which notebook to use for the current task.`;
105
+ }
106
+ }
107
+ export const askQuestionTool = {
108
+ name: "ask_question",
109
+ // Description will be set dynamically using buildAskQuestionDescription
110
+ description: "Dynamic description placeholder",
111
+ inputSchema: {
112
+ type: "object",
113
+ properties: {
114
+ question: {
115
+ type: "string",
116
+ description: "The question to ask NotebookLM",
117
+ },
118
+ session_id: {
119
+ type: "string",
120
+ description: "Optional session ID for contextual conversations. If omitted, a new session is created.",
121
+ },
122
+ notebook_id: {
123
+ type: "string",
124
+ description: "Optional notebook ID from your library. If omitted, uses the active notebook. " +
125
+ "Use list_notebooks to see available notebooks.",
126
+ },
127
+ notebook_url: {
128
+ type: "string",
129
+ description: "Optional notebook URL (overrides notebook_id). Use this for ad-hoc queries to notebooks not in your library.",
130
+ },
131
+ show_browser: {
132
+ type: "boolean",
133
+ description: "Show browser window for debugging (simple version). " +
134
+ "For advanced control (typing speed, stealth, etc.), use browser_options instead.",
135
+ },
136
+ browser_options: {
137
+ type: "object",
138
+ description: "Optional browser behavior settings. Claude can control everything: " +
139
+ "visibility, typing speed, stealth mode, timeouts. Useful for debugging or fine-tuning.",
140
+ properties: {
141
+ show: {
142
+ type: "boolean",
143
+ description: "Show browser window (default: from ENV or false)",
144
+ },
145
+ headless: {
146
+ type: "boolean",
147
+ description: "Run browser in headless mode (default: true)",
148
+ },
149
+ timeout_ms: {
150
+ type: "number",
151
+ description: "Browser operation timeout in milliseconds (default: 30000)",
152
+ },
153
+ stealth: {
154
+ type: "object",
155
+ description: "Human-like behavior settings to avoid detection",
156
+ properties: {
157
+ enabled: {
158
+ type: "boolean",
159
+ description: "Master switch for all stealth features (default: true)",
160
+ },
161
+ random_delays: {
162
+ type: "boolean",
163
+ description: "Random delays between actions (default: true)",
164
+ },
165
+ human_typing: {
166
+ type: "boolean",
167
+ description: "Human-like typing patterns (default: true)",
168
+ },
169
+ mouse_movements: {
170
+ type: "boolean",
171
+ description: "Realistic mouse movements (default: true)",
172
+ },
173
+ typing_wpm_min: {
174
+ type: "number",
175
+ description: "Minimum typing speed in WPM (default: 160)",
176
+ },
177
+ typing_wpm_max: {
178
+ type: "number",
179
+ description: "Maximum typing speed in WPM (default: 240)",
180
+ },
181
+ delay_min_ms: {
182
+ type: "number",
183
+ description: "Minimum delay between actions in ms (default: 100)",
184
+ },
185
+ delay_max_ms: {
186
+ type: "number",
187
+ description: "Maximum delay between actions in ms (default: 400)",
188
+ },
189
+ },
190
+ },
191
+ viewport: {
192
+ type: "object",
193
+ description: "Browser viewport size",
194
+ properties: {
195
+ width: {
196
+ type: "number",
197
+ description: "Viewport width in pixels (default: 1920)",
198
+ },
199
+ height: {
200
+ type: "number",
201
+ description: "Viewport height in pixels (default: 1080)",
202
+ },
203
+ },
204
+ },
205
+ },
206
+ },
207
+ },
208
+ required: ["question"],
209
+ },
210
+ };
211
+ //# sourceMappingURL=ask-question.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-question.js","sourceRoot":"","sources":["../../../src/tools/definitions/ask-question.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAAwB;IAClE,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC3C,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,mDAAmD;IAEnE,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtE,OAAO;;uBAEY,MAAM,CAAC,IAAI;eACnB,MAAM,CAAC,WAAW;cACnB,MAAM;;;;;;;;;;EAUlB,QAAQ;;;;;;;;;;;;EAYR,EAAE,GAAG,EAAE,GAAG,EAAE;;;;;;;;;;;;;EAaZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;;;;;;;;;;;;;EAeZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;;EAIZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;EAGZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;;;;;;;;;;;;EAcZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;8BAGgB,MAAM,CAAC,EAAE;;;8DAGuB,CAAC;IAC7D,CAAC;SAAM,CAAC;QACN,OAAO;;;;;;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ACf,WAAW,EAAE,4CAA4C;6BAC1D;4BACD,eAAe,EAAE;gCACf,IAAI,EAAE,SAAS;gCACf,WAAW,EAAE,2CAA2C;6BACzD;4BACD,cAAc,EAAE;gCACd,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,4CAA4C;6BAC1D;4BACD,cAAc,EAAE;gCACd,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,4CAA4C;6BAC1D;4BACD,YAAY,EAAE;gCACZ,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,oDAAoD;6BAClE;4BACD,YAAY,EAAE;gCACZ,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,oDAAoD;6BAClE;yBACF;qBACF;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,uBAAuB;wBACpC,UAAU,EAAE;4BACV,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,0CAA0C;6BACxD;4BACD,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,2CAA2C;6BACzD;yBACF;qBACF;iBACF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ export declare const notebookManagementTools: Tool[];
3
+ //# sourceMappingURL=notebook-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-management.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/notebook-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,eAAO,MAAM,uBAAuB,EAAE,IAAI,EAwPzC,CAAC"}
@@ -0,0 +1,243 @@
1
+ export const notebookManagementTools = [
2
+ {
3
+ name: "add_notebook",
4
+ description: `PERMISSION REQUIRED — Only when user explicitly asks to add a notebook.
5
+
6
+ ## Conversation Workflow (Mandatory)
7
+ When the user says: "I have a NotebookLM with X"
8
+
9
+ 1) Ask URL: "What is the NotebookLM URL?"
10
+ 2) Ask content: "What knowledge is inside?" (1–2 sentences)
11
+ 3) Ask topics: "Which topics does it cover?" (3–5)
12
+ 4) Ask use cases: "When should we consult it?"
13
+ 5) Propose metadata and confirm:
14
+ - Name: [suggested]
15
+ - Description: [from user]
16
+ - Topics: [list]
17
+ - Use cases: [list]
18
+ "Add it to your library now?"
19
+ 6) Only after explicit "Yes" → call this tool
20
+
21
+ ## Rules
22
+ - Do not add without user permission
23
+ - Do not guess metadata — ask concisely
24
+ - Confirm summary before calling the tool
25
+
26
+ ## Example
27
+ User: "I have a notebook with n8n docs"
28
+ You: Ask URL → content → topics → use cases; propose summary
29
+ User: "Yes"
30
+ You: Call add_notebook
31
+
32
+ ## How to Get a NotebookLM Share Link
33
+
34
+ Visit https://notebooklm.google/ → Login (free: 100 notebooks, 50 sources each, 500k words, 50 daily queries)
35
+ 1) Click "+ New" (top right) → Upload sources (docs, knowledge)
36
+ 2) Click "Share" (top right) → Select "Anyone with the link"
37
+ 3) Click "Copy link" (bottom left) → Give this link to Claude
38
+
39
+ (Upgraded: Google AI Pro/Ultra gives 5x higher limits)`,
40
+ inputSchema: {
41
+ type: "object",
42
+ properties: {
43
+ url: {
44
+ type: "string",
45
+ description: "The NotebookLM notebook URL",
46
+ },
47
+ name: {
48
+ type: "string",
49
+ description: "Display name for the notebook (e.g., 'n8n Documentation')",
50
+ },
51
+ description: {
52
+ type: "string",
53
+ description: "What knowledge/content is in this notebook",
54
+ },
55
+ topics: {
56
+ type: "array",
57
+ items: { type: "string" },
58
+ description: "Topics covered in this notebook",
59
+ },
60
+ content_types: {
61
+ type: "array",
62
+ items: { type: "string" },
63
+ description: "Types of content (e.g., ['documentation', 'examples', 'best practices'])",
64
+ },
65
+ use_cases: {
66
+ type: "array",
67
+ items: { type: "string" },
68
+ description: "When should Claude use this notebook (e.g., ['Implementing n8n workflows'])",
69
+ },
70
+ tags: {
71
+ type: "array",
72
+ items: { type: "string" },
73
+ description: "Optional tags for organization",
74
+ },
75
+ },
76
+ required: ["url", "name", "description", "topics"],
77
+ },
78
+ },
79
+ {
80
+ name: "list_notebooks",
81
+ description: "List all library notebooks with metadata (name, topics, use cases, URL). " +
82
+ "Use this to present options, then ask which notebook to use for the task.",
83
+ inputSchema: {
84
+ type: "object",
85
+ properties: {},
86
+ },
87
+ },
88
+ {
89
+ name: "get_notebook",
90
+ description: "Get detailed information about a specific notebook by ID",
91
+ inputSchema: {
92
+ type: "object",
93
+ properties: {
94
+ id: {
95
+ type: "string",
96
+ description: "The notebook ID",
97
+ },
98
+ },
99
+ required: ["id"],
100
+ },
101
+ },
102
+ {
103
+ name: "select_notebook",
104
+ description: `Set a notebook as the active default (used when ask_question has no notebook_id).
105
+
106
+ ## When To Use
107
+ - User switches context: "Let's work on React now"
108
+ - User asks explicitly to activate a notebook
109
+ - Obvious task change requires another notebook
110
+
111
+ ## Auto-Switching
112
+ - Safe to auto-switch if the context is clear and you announce it:
113
+ "Switching to React notebook for this task..."
114
+ - If ambiguous, ask: "Switch to [notebook] for this task?"
115
+
116
+ ## Example
117
+ User: "Now let's build the React frontend"
118
+ You: "Switching to React notebook..." (call select_notebook)`,
119
+ inputSchema: {
120
+ type: "object",
121
+ properties: {
122
+ id: {
123
+ type: "string",
124
+ description: "The notebook ID to activate",
125
+ },
126
+ },
127
+ required: ["id"],
128
+ },
129
+ },
130
+ {
131
+ name: "update_notebook",
132
+ description: `Update notebook metadata based on user intent.
133
+
134
+ ## Pattern
135
+ 1) Identify target notebook and fields (topics, description, use_cases, tags, url)
136
+ 2) Propose the exact change back to the user
137
+ 3) After explicit confirmation, call this tool
138
+
139
+ ## Examples
140
+ - User: "React notebook also covers Next.js 14"
141
+ You: "Add 'Next.js 14' to topics for React?"
142
+ User: "Yes" → call update_notebook
143
+
144
+ - User: "Include error handling in n8n description"
145
+ You: "Update the n8n description to mention error handling?"
146
+ User: "Yes" → call update_notebook
147
+
148
+ Tip: You may update multiple fields at once if requested.`,
149
+ inputSchema: {
150
+ type: "object",
151
+ properties: {
152
+ id: {
153
+ type: "string",
154
+ description: "The notebook ID to update",
155
+ },
156
+ name: {
157
+ type: "string",
158
+ description: "New display name",
159
+ },
160
+ description: {
161
+ type: "string",
162
+ description: "New description",
163
+ },
164
+ topics: {
165
+ type: "array",
166
+ items: { type: "string" },
167
+ description: "New topics list",
168
+ },
169
+ content_types: {
170
+ type: "array",
171
+ items: { type: "string" },
172
+ description: "New content types",
173
+ },
174
+ use_cases: {
175
+ type: "array",
176
+ items: { type: "string" },
177
+ description: "New use cases",
178
+ },
179
+ tags: {
180
+ type: "array",
181
+ items: { type: "string" },
182
+ description: "New tags",
183
+ },
184
+ url: {
185
+ type: "string",
186
+ description: "New notebook URL",
187
+ },
188
+ },
189
+ required: ["id"],
190
+ },
191
+ },
192
+ {
193
+ name: "remove_notebook",
194
+ description: `Dangerous — requires explicit user confirmation.
195
+
196
+ ## Confirmation Workflow
197
+ 1) User requests removal ("Remove the React notebook")
198
+ 2) Look up full name to confirm
199
+ 3) Ask: "Remove '[notebook_name]' from your library? (Does not delete the actual NotebookLM notebook)"
200
+ 4) Only on explicit "Yes" → call remove_notebook
201
+
202
+ Never remove without permission or based on assumptions.
203
+
204
+ Example:
205
+ User: "Delete the old React notebook"
206
+ You: "Remove 'React Best Practices' from your library?"
207
+ User: "Yes" → call remove_notebook`,
208
+ inputSchema: {
209
+ type: "object",
210
+ properties: {
211
+ id: {
212
+ type: "string",
213
+ description: "The notebook ID to remove",
214
+ },
215
+ },
216
+ required: ["id"],
217
+ },
218
+ },
219
+ {
220
+ name: "search_notebooks",
221
+ description: "Search library by query (name, description, topics, tags). " +
222
+ "Use to propose relevant notebooks for the task and then ask which to use.",
223
+ inputSchema: {
224
+ type: "object",
225
+ properties: {
226
+ query: {
227
+ type: "string",
228
+ description: "Search query",
229
+ },
230
+ },
231
+ required: ["query"],
232
+ },
233
+ },
234
+ {
235
+ name: "get_library_stats",
236
+ description: "Get statistics about your notebook library (total notebooks, usage, etc.)",
237
+ inputSchema: {
238
+ type: "object",
239
+ properties: {},
240
+ },
241
+ },
242
+ ];
243
+ //# sourceMappingURL=notebook-management.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-management.js","sourceRoot":"","sources":["../../../src/tools/definitions/notebook-management.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAW;IAC7C;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAmCiD;QACnD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6BAA6B;iBAC3C;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2DAA2D;iBACzE;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,4CAA4C;iBAC1D;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,iCAAiC;iBAC/C;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EACT,0EAA0E;iBAC7E;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,6EAA6E;iBAC3F;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,gCAAgC;iBAC9C;aACF;YACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa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AE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,mBAAmB;iBACjC;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,eAAe;iBAC7B;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,UAAU;iBACxB;gBACD,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kBAAkB;iBAChC;aACF;YACD,QAAQ,EAAE,CAAC,IAAI,CAAC;SACjB;KACF;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT;;;;;;;;;;;;;mCAa6B;QAC/B,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,EAAE,EAAE;oBACF,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,IAAI,CAAC;SACjB;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,6DAA6D;YAC7D,2EAA2E;QAC7E,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,cAAc;iBAC5B;aACF;YACD,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,2EAA2E;QACxF,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;KACF;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ export declare const sessionManagementTools: Tool[];
3
+ //# sourceMappingURL=session-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-management.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/session-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,eAAO,MAAM,sBAAsB,EAAE,IAAI,EAyCxC,CAAC"}