@pan-sec/notebooklm-mcp 2026.3.3 → 2026.4.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 (470) hide show
  1. package/dist/auth/auth-manager.d.ts +0 -1
  2. package/dist/auth/auth-manager.js +0 -1
  3. package/dist/auth/mcp-auth.d.ts +0 -1
  4. package/dist/auth/mcp-auth.js +0 -1
  5. package/dist/compliance/alert-manager.d.ts +6 -2
  6. package/dist/compliance/alert-manager.js +40 -10
  7. package/dist/compliance/breach-detection.d.ts +0 -1
  8. package/dist/compliance/breach-detection.js +0 -1
  9. package/dist/compliance/change-log.d.ts +13 -1
  10. package/dist/compliance/change-log.js +82 -16
  11. package/dist/compliance/compliance-logger.d.ts +29 -3
  12. package/dist/compliance/compliance-logger.js +90 -27
  13. package/dist/compliance/compliance-tools.d.ts +0 -1
  14. package/dist/compliance/compliance-tools.js +0 -1
  15. package/dist/compliance/consent-manager.d.ts +0 -1
  16. package/dist/compliance/consent-manager.js +0 -1
  17. package/dist/compliance/dashboard.d.ts +4 -3
  18. package/dist/compliance/dashboard.js +11 -8
  19. package/dist/compliance/data-classification.d.ts +0 -1
  20. package/dist/compliance/data-classification.js +0 -1
  21. package/dist/compliance/data-erasure.d.ts +0 -1
  22. package/dist/compliance/data-erasure.js +0 -1
  23. package/dist/compliance/data-export.d.ts +0 -1
  24. package/dist/compliance/data-export.js +0 -1
  25. package/dist/compliance/data-inventory.d.ts +0 -1
  26. package/dist/compliance/data-inventory.js +0 -1
  27. package/dist/compliance/dsar-handler.d.ts +0 -1
  28. package/dist/compliance/dsar-handler.js +0 -1
  29. package/dist/compliance/evidence-collector.d.ts +0 -1
  30. package/dist/compliance/evidence-collector.js +4 -2
  31. package/dist/compliance/health-monitor.d.ts +0 -1
  32. package/dist/compliance/health-monitor.js +0 -1
  33. package/dist/compliance/incident-manager.d.ts +0 -1
  34. package/dist/compliance/incident-manager.js +0 -1
  35. package/dist/compliance/index.d.ts +0 -1
  36. package/dist/compliance/index.js +0 -1
  37. package/dist/compliance/policy-docs.d.ts +0 -1
  38. package/dist/compliance/policy-docs.js +0 -1
  39. package/dist/compliance/privacy-notice-text.d.ts +0 -1
  40. package/dist/compliance/privacy-notice-text.js +0 -1
  41. package/dist/compliance/privacy-notice.d.ts +0 -1
  42. package/dist/compliance/privacy-notice.js +0 -1
  43. package/dist/compliance/report-generator.d.ts +7 -1
  44. package/dist/compliance/report-generator.js +116 -34
  45. package/dist/compliance/retention-engine.d.ts +0 -1
  46. package/dist/compliance/retention-engine.js +0 -1
  47. package/dist/compliance/siem-exporter.d.ts +26 -2
  48. package/dist/compliance/siem-exporter.js +89 -24
  49. package/dist/compliance/types.d.ts +0 -1
  50. package/dist/compliance/types.js +0 -1
  51. package/dist/config.d.ts +0 -1
  52. package/dist/config.js +2 -3
  53. package/dist/errors.d.ts +0 -1
  54. package/dist/errors.js +0 -1
  55. package/dist/events/event-emitter.d.ts +9 -1
  56. package/dist/events/event-emitter.js +47 -8
  57. package/dist/events/event-types.d.ts +0 -1
  58. package/dist/events/event-types.js +8 -2
  59. package/dist/gemini/gemini-client.d.ts +0 -1
  60. package/dist/gemini/gemini-client.js +237 -45
  61. package/dist/gemini/index.d.ts +0 -1
  62. package/dist/gemini/index.js +0 -1
  63. package/dist/gemini/pdf-chunker.d.ts +0 -1
  64. package/dist/gemini/pdf-chunker.js +60 -35
  65. package/dist/gemini/types.d.ts +0 -1
  66. package/dist/gemini/types.js +0 -1
  67. package/dist/index.d.ts +0 -1
  68. package/dist/index.js +60 -7
  69. package/dist/library/notebook-library.d.ts +30 -2
  70. package/dist/library/notebook-library.js +345 -85
  71. package/dist/library/types.d.ts +0 -1
  72. package/dist/library/types.js +0 -1
  73. package/dist/logging/index.d.ts +0 -1
  74. package/dist/logging/index.js +0 -1
  75. package/dist/logging/query-logger.d.ts +20 -1
  76. package/dist/logging/query-logger.js +104 -21
  77. package/dist/notebook-creation/audio-manager.d.ts +7 -16
  78. package/dist/notebook-creation/audio-manager.js +115 -58
  79. package/dist/notebook-creation/browser-options.d.ts +0 -1
  80. package/dist/notebook-creation/browser-options.js +0 -1
  81. package/dist/notebook-creation/data-table-manager.d.ts +8 -14
  82. package/dist/notebook-creation/data-table-manager.js +64 -37
  83. package/dist/notebook-creation/dom-scripts.d.ts +0 -1
  84. package/dist/notebook-creation/dom-scripts.js +0 -1
  85. package/dist/notebook-creation/errors.d.ts +0 -1
  86. package/dist/notebook-creation/errors.js +0 -1
  87. package/dist/notebook-creation/index.d.ts +0 -1
  88. package/dist/notebook-creation/index.js +0 -1
  89. package/dist/notebook-creation/notebook-creator.d.ts +9 -1
  90. package/dist/notebook-creation/notebook-creator.js +50 -1
  91. package/dist/notebook-creation/notebook-nav.d.ts +0 -1
  92. package/dist/notebook-creation/notebook-nav.js +21 -6
  93. package/dist/notebook-creation/notebook-sync.d.ts +14 -2
  94. package/dist/notebook-creation/notebook-sync.js +124 -35
  95. package/dist/notebook-creation/selectors.d.ts +0 -1
  96. package/dist/notebook-creation/selectors.js +6 -4
  97. package/dist/notebook-creation/source-manager-shared.d.ts +75 -0
  98. package/dist/notebook-creation/source-manager-shared.js +86 -0
  99. package/dist/notebook-creation/source-manager.d.ts +29 -2
  100. package/dist/notebook-creation/source-manager.js +0 -0
  101. package/dist/notebook-creation/studio-manager-base.d.ts +57 -0
  102. package/dist/notebook-creation/studio-manager-base.js +67 -0
  103. package/dist/notebook-creation/types.d.ts +0 -1
  104. package/dist/notebook-creation/types.js +0 -1
  105. package/dist/notebook-creation/video-manager.d.ts +3 -16
  106. package/dist/notebook-creation/video-manager.js +94 -53
  107. package/dist/observability/metrics.d.ts +0 -1
  108. package/dist/observability/metrics.js +0 -1
  109. package/dist/quota/index.d.ts +0 -1
  110. package/dist/quota/index.js +0 -1
  111. package/dist/quota/quota-manager.d.ts +59 -4
  112. package/dist/quota/quota-manager.js +195 -46
  113. package/dist/resources/resource-handlers.d.ts +0 -1
  114. package/dist/resources/resource-handlers.js +33 -3
  115. package/dist/session/browser-session.d.ts +0 -1
  116. package/dist/session/browser-session.js +0 -1
  117. package/dist/session/session-manager.d.ts +0 -1
  118. package/dist/session/session-manager.js +0 -1
  119. package/dist/session/session-timeout.d.ts +0 -1
  120. package/dist/session/session-timeout.js +0 -1
  121. package/dist/session/shared-context-manager.d.ts +0 -1
  122. package/dist/session/shared-context-manager.js +0 -1
  123. package/dist/tools/annotations.d.ts +0 -1
  124. package/dist/tools/annotations.js +0 -1
  125. package/dist/tools/definitions/ask-question.d.ts +6 -3
  126. package/dist/tools/definitions/ask-question.js +12 -8
  127. package/dist/tools/definitions/chat-history.d.ts +0 -1
  128. package/dist/tools/definitions/chat-history.js +1 -1
  129. package/dist/tools/definitions/data-tables.d.ts +0 -1
  130. package/dist/tools/definitions/data-tables.js +4 -1
  131. package/dist/tools/definitions/gemini.d.ts +0 -1
  132. package/dist/tools/definitions/gemini.js +14 -7
  133. package/dist/tools/definitions/notebook-management.d.ts +0 -1
  134. package/dist/tools/definitions/notebook-management.js +7 -2
  135. package/dist/tools/definitions/query-history.d.ts +0 -1
  136. package/dist/tools/definitions/query-history.js +0 -1
  137. package/dist/tools/definitions/session-management.d.ts +0 -1
  138. package/dist/tools/definitions/session-management.js +0 -1
  139. package/dist/tools/definitions/system.d.ts +0 -1
  140. package/dist/tools/definitions/system.js +32 -12
  141. package/dist/tools/definitions/video.d.ts +0 -1
  142. package/dist/tools/definitions/video.js +6 -3
  143. package/dist/tools/definitions.d.ts +0 -1
  144. package/dist/tools/definitions.js +0 -1
  145. package/dist/tools/handlers/ask-question.d.ts +0 -1
  146. package/dist/tools/handlers/ask-question.js +47 -18
  147. package/dist/tools/handlers/audio-video.d.ts +0 -1
  148. package/dist/tools/handlers/audio-video.js +0 -1
  149. package/dist/tools/handlers/auth.d.ts +0 -1
  150. package/dist/tools/handlers/auth.js +0 -1
  151. package/dist/tools/handlers/error-utils.d.ts +0 -1
  152. package/dist/tools/handlers/error-utils.js +0 -1
  153. package/dist/tools/handlers/gemini.d.ts +0 -1
  154. package/dist/tools/handlers/gemini.js +0 -1
  155. package/dist/tools/handlers/index.d.ts +0 -1
  156. package/dist/tools/handlers/index.js +0 -1
  157. package/dist/tools/handlers/notebook-creation.d.ts +0 -1
  158. package/dist/tools/handlers/notebook-creation.js +16 -1
  159. package/dist/tools/handlers/notebook-management.d.ts +0 -1
  160. package/dist/tools/handlers/notebook-management.js +7 -2
  161. package/dist/tools/handlers/session-management.d.ts +0 -1
  162. package/dist/tools/handlers/session-management.js +0 -1
  163. package/dist/tools/handlers/system.d.ts +0 -1
  164. package/dist/tools/handlers/system.js +0 -1
  165. package/dist/tools/handlers/types.d.ts +0 -1
  166. package/dist/tools/handlers/types.js +0 -1
  167. package/dist/tools/handlers/webhooks.d.ts +0 -1
  168. package/dist/tools/handlers/webhooks.js +0 -1
  169. package/dist/tools/icons.d.ts +0 -1
  170. package/dist/tools/icons.js +0 -1
  171. package/dist/tools/index.d.ts +0 -1
  172. package/dist/tools/index.js +0 -1
  173. package/dist/types.d.ts +0 -1
  174. package/dist/types.js +0 -1
  175. package/dist/utils/audit-logger.d.ts +11 -1
  176. package/dist/utils/audit-logger.js +189 -21
  177. package/dist/utils/cleanup-manager.d.ts +0 -1
  178. package/dist/utils/cleanup-manager.js +0 -1
  179. package/dist/utils/cli-handler.d.ts +0 -1
  180. package/dist/utils/cli-handler.js +0 -1
  181. package/dist/utils/crypto.d.ts +18 -9
  182. package/dist/utils/crypto.js +93 -28
  183. package/dist/utils/file-lock.d.ts +15 -1
  184. package/dist/utils/file-lock.js +67 -59
  185. package/dist/utils/file-permissions.d.ts +0 -1
  186. package/dist/utils/file-permissions.js +35 -7
  187. package/dist/utils/logger.d.ts +0 -1
  188. package/dist/utils/logger.js +0 -1
  189. package/dist/utils/page-utils.d.ts +0 -1
  190. package/dist/utils/page-utils.js +32 -28
  191. package/dist/utils/response-validator.d.ts +0 -1
  192. package/dist/utils/response-validator.js +18 -15
  193. package/dist/utils/secrets-scanner.d.ts +0 -1
  194. package/dist/utils/secrets-scanner.js +32 -7
  195. package/dist/utils/secure-memory.d.ts +34 -16
  196. package/dist/utils/secure-memory.js +40 -25
  197. package/dist/utils/security.d.ts +0 -1
  198. package/dist/utils/security.js +66 -39
  199. package/dist/utils/settings-manager.d.ts +9 -1
  200. package/dist/utils/settings-manager.js +45 -2
  201. package/dist/utils/stealth-utils.d.ts +0 -1
  202. package/dist/utils/stealth-utils.js +11 -9
  203. package/dist/webhooks/index.d.ts +0 -1
  204. package/dist/webhooks/index.js +0 -1
  205. package/dist/webhooks/types.d.ts +0 -1
  206. package/dist/webhooks/types.js +0 -1
  207. package/dist/webhooks/webhook-dispatcher.d.ts +0 -1
  208. package/dist/webhooks/webhook-dispatcher.js +0 -1
  209. package/package.json +5 -4
  210. package/dist/auth/auth-manager.d.ts.map +0 -1
  211. package/dist/auth/auth-manager.js.map +0 -1
  212. package/dist/auth/mcp-auth.d.ts.map +0 -1
  213. package/dist/auth/mcp-auth.js.map +0 -1
  214. package/dist/compliance/alert-manager.d.ts.map +0 -1
  215. package/dist/compliance/alert-manager.js.map +0 -1
  216. package/dist/compliance/breach-detection.d.ts.map +0 -1
  217. package/dist/compliance/breach-detection.js.map +0 -1
  218. package/dist/compliance/change-log.d.ts.map +0 -1
  219. package/dist/compliance/change-log.js.map +0 -1
  220. package/dist/compliance/compliance-logger.d.ts.map +0 -1
  221. package/dist/compliance/compliance-logger.js.map +0 -1
  222. package/dist/compliance/compliance-tools.d.ts.map +0 -1
  223. package/dist/compliance/compliance-tools.js.map +0 -1
  224. package/dist/compliance/consent-manager.d.ts.map +0 -1
  225. package/dist/compliance/consent-manager.js.map +0 -1
  226. package/dist/compliance/dashboard.d.ts.map +0 -1
  227. package/dist/compliance/dashboard.js.map +0 -1
  228. package/dist/compliance/data-classification.d.ts.map +0 -1
  229. package/dist/compliance/data-classification.js.map +0 -1
  230. package/dist/compliance/data-erasure.d.ts.map +0 -1
  231. package/dist/compliance/data-erasure.js.map +0 -1
  232. package/dist/compliance/data-export.d.ts.map +0 -1
  233. package/dist/compliance/data-export.js.map +0 -1
  234. package/dist/compliance/data-inventory.d.ts.map +0 -1
  235. package/dist/compliance/data-inventory.js.map +0 -1
  236. package/dist/compliance/dsar-handler.d.ts.map +0 -1
  237. package/dist/compliance/dsar-handler.js.map +0 -1
  238. package/dist/compliance/evidence-collector.d.ts.map +0 -1
  239. package/dist/compliance/evidence-collector.js.map +0 -1
  240. package/dist/compliance/health-monitor.d.ts.map +0 -1
  241. package/dist/compliance/health-monitor.js.map +0 -1
  242. package/dist/compliance/incident-manager.d.ts.map +0 -1
  243. package/dist/compliance/incident-manager.js.map +0 -1
  244. package/dist/compliance/index.d.ts.map +0 -1
  245. package/dist/compliance/index.js.map +0 -1
  246. package/dist/compliance/policy-docs.d.ts.map +0 -1
  247. package/dist/compliance/policy-docs.js.map +0 -1
  248. package/dist/compliance/privacy-notice-text.d.ts.map +0 -1
  249. package/dist/compliance/privacy-notice-text.js.map +0 -1
  250. package/dist/compliance/privacy-notice.d.ts.map +0 -1
  251. package/dist/compliance/privacy-notice.js.map +0 -1
  252. package/dist/compliance/report-generator.d.ts.map +0 -1
  253. package/dist/compliance/report-generator.js.map +0 -1
  254. package/dist/compliance/retention-engine.d.ts.map +0 -1
  255. package/dist/compliance/retention-engine.js.map +0 -1
  256. package/dist/compliance/siem-exporter.d.ts.map +0 -1
  257. package/dist/compliance/siem-exporter.js.map +0 -1
  258. package/dist/compliance/types.d.ts.map +0 -1
  259. package/dist/compliance/types.js.map +0 -1
  260. package/dist/config.d.ts.map +0 -1
  261. package/dist/config.js.map +0 -1
  262. package/dist/errors.d.ts.map +0 -1
  263. package/dist/errors.js.map +0 -1
  264. package/dist/events/event-emitter.d.ts.map +0 -1
  265. package/dist/events/event-emitter.js.map +0 -1
  266. package/dist/events/event-types.d.ts.map +0 -1
  267. package/dist/events/event-types.js.map +0 -1
  268. package/dist/gemini/gemini-client.d.ts.map +0 -1
  269. package/dist/gemini/gemini-client.js.map +0 -1
  270. package/dist/gemini/index.d.ts.map +0 -1
  271. package/dist/gemini/index.js.map +0 -1
  272. package/dist/gemini/pdf-chunker.d.ts.map +0 -1
  273. package/dist/gemini/pdf-chunker.js.map +0 -1
  274. package/dist/gemini/types.d.ts.map +0 -1
  275. package/dist/gemini/types.js.map +0 -1
  276. package/dist/index.d.ts.map +0 -1
  277. package/dist/index.js.map +0 -1
  278. package/dist/library/notebook-library.d.ts.map +0 -1
  279. package/dist/library/notebook-library.js.map +0 -1
  280. package/dist/library/types.d.ts.map +0 -1
  281. package/dist/library/types.js.map +0 -1
  282. package/dist/logging/index.d.ts.map +0 -1
  283. package/dist/logging/index.js.map +0 -1
  284. package/dist/logging/query-logger.d.ts.map +0 -1
  285. package/dist/logging/query-logger.js.map +0 -1
  286. package/dist/notebook-creation/audio-manager.d.ts.map +0 -1
  287. package/dist/notebook-creation/audio-manager.js.map +0 -1
  288. package/dist/notebook-creation/browser-options.d.ts.map +0 -1
  289. package/dist/notebook-creation/browser-options.js.map +0 -1
  290. package/dist/notebook-creation/data-table-manager.d.ts.map +0 -1
  291. package/dist/notebook-creation/data-table-manager.js.map +0 -1
  292. package/dist/notebook-creation/discover-creation-flow.d.ts +0 -2
  293. package/dist/notebook-creation/discover-creation-flow.d.ts.map +0 -1
  294. package/dist/notebook-creation/discover-creation-flow.js +0 -177
  295. package/dist/notebook-creation/discover-creation-flow.js.map +0 -1
  296. package/dist/notebook-creation/discover-quota.d.ts +0 -2
  297. package/dist/notebook-creation/discover-quota.d.ts.map +0 -1
  298. package/dist/notebook-creation/discover-quota.js +0 -194
  299. package/dist/notebook-creation/discover-quota.js.map +0 -1
  300. package/dist/notebook-creation/discover-source-dialog.d.ts +0 -8
  301. package/dist/notebook-creation/discover-source-dialog.d.ts.map +0 -1
  302. package/dist/notebook-creation/discover-source-dialog.js +0 -134
  303. package/dist/notebook-creation/discover-source-dialog.js.map +0 -1
  304. package/dist/notebook-creation/discover-sources.d.ts +0 -8
  305. package/dist/notebook-creation/discover-sources.d.ts.map +0 -1
  306. package/dist/notebook-creation/discover-sources.js +0 -272
  307. package/dist/notebook-creation/discover-sources.js.map +0 -1
  308. package/dist/notebook-creation/discover-text-input.d.ts +0 -7
  309. package/dist/notebook-creation/discover-text-input.d.ts.map +0 -1
  310. package/dist/notebook-creation/discover-text-input.js +0 -135
  311. package/dist/notebook-creation/discover-text-input.js.map +0 -1
  312. package/dist/notebook-creation/dom-scripts.d.ts.map +0 -1
  313. package/dist/notebook-creation/dom-scripts.js.map +0 -1
  314. package/dist/notebook-creation/errors.d.ts.map +0 -1
  315. package/dist/notebook-creation/errors.js.map +0 -1
  316. package/dist/notebook-creation/index.d.ts.map +0 -1
  317. package/dist/notebook-creation/index.js.map +0 -1
  318. package/dist/notebook-creation/notebook-creator.d.ts.map +0 -1
  319. package/dist/notebook-creation/notebook-creator.js.map +0 -1
  320. package/dist/notebook-creation/notebook-nav.d.ts.map +0 -1
  321. package/dist/notebook-creation/notebook-nav.js.map +0 -1
  322. package/dist/notebook-creation/notebook-sync.d.ts.map +0 -1
  323. package/dist/notebook-creation/notebook-sync.js.map +0 -1
  324. package/dist/notebook-creation/run-discovery.d.ts +0 -11
  325. package/dist/notebook-creation/run-discovery.d.ts.map +0 -1
  326. package/dist/notebook-creation/run-discovery.js +0 -151
  327. package/dist/notebook-creation/run-discovery.js.map +0 -1
  328. package/dist/notebook-creation/selector-discovery.d.ts +0 -65
  329. package/dist/notebook-creation/selector-discovery.d.ts.map +0 -1
  330. package/dist/notebook-creation/selector-discovery.js +0 -414
  331. package/dist/notebook-creation/selector-discovery.js.map +0 -1
  332. package/dist/notebook-creation/selectors.d.ts.map +0 -1
  333. package/dist/notebook-creation/selectors.js.map +0 -1
  334. package/dist/notebook-creation/selectors.ts +0 -112
  335. package/dist/notebook-creation/source-manager.d.ts.map +0 -1
  336. package/dist/notebook-creation/source-manager.js.map +0 -1
  337. package/dist/notebook-creation/test-create.d.ts +0 -8
  338. package/dist/notebook-creation/test-create.d.ts.map +0 -1
  339. package/dist/notebook-creation/test-create.js +0 -72
  340. package/dist/notebook-creation/test-create.js.map +0 -1
  341. package/dist/notebook-creation/types.d.ts.map +0 -1
  342. package/dist/notebook-creation/types.js.map +0 -1
  343. package/dist/notebook-creation/video-manager.d.ts.map +0 -1
  344. package/dist/notebook-creation/video-manager.js.map +0 -1
  345. package/dist/observability/metrics.d.ts.map +0 -1
  346. package/dist/observability/metrics.js.map +0 -1
  347. package/dist/quota/index.d.ts.map +0 -1
  348. package/dist/quota/index.js.map +0 -1
  349. package/dist/quota/quota-manager.d.ts.map +0 -1
  350. package/dist/quota/quota-manager.js.map +0 -1
  351. package/dist/resources/resource-handlers.d.ts.map +0 -1
  352. package/dist/resources/resource-handlers.js.map +0 -1
  353. package/dist/session/browser-session.d.ts.map +0 -1
  354. package/dist/session/browser-session.js.map +0 -1
  355. package/dist/session/session-manager.d.ts.map +0 -1
  356. package/dist/session/session-manager.js.map +0 -1
  357. package/dist/session/session-timeout.d.ts.map +0 -1
  358. package/dist/session/session-timeout.js.map +0 -1
  359. package/dist/session/shared-context-manager.d.ts.map +0 -1
  360. package/dist/session/shared-context-manager.js.map +0 -1
  361. package/dist/tools/annotations.d.ts.map +0 -1
  362. package/dist/tools/annotations.js.map +0 -1
  363. package/dist/tools/definitions/ask-question.d.ts.map +0 -1
  364. package/dist/tools/definitions/ask-question.js.map +0 -1
  365. package/dist/tools/definitions/chat-history.d.ts.map +0 -1
  366. package/dist/tools/definitions/chat-history.js.map +0 -1
  367. package/dist/tools/definitions/data-tables.d.ts.map +0 -1
  368. package/dist/tools/definitions/data-tables.js.map +0 -1
  369. package/dist/tools/definitions/gemini.d.ts.map +0 -1
  370. package/dist/tools/definitions/gemini.js.map +0 -1
  371. package/dist/tools/definitions/notebook-management.d.ts.map +0 -1
  372. package/dist/tools/definitions/notebook-management.js.map +0 -1
  373. package/dist/tools/definitions/query-history.d.ts.map +0 -1
  374. package/dist/tools/definitions/query-history.js.map +0 -1
  375. package/dist/tools/definitions/session-management.d.ts.map +0 -1
  376. package/dist/tools/definitions/session-management.js.map +0 -1
  377. package/dist/tools/definitions/system.d.ts.map +0 -1
  378. package/dist/tools/definitions/system.js.map +0 -1
  379. package/dist/tools/definitions/video.d.ts.map +0 -1
  380. package/dist/tools/definitions/video.js.map +0 -1
  381. package/dist/tools/definitions.d.ts.map +0 -1
  382. package/dist/tools/definitions.js.map +0 -1
  383. package/dist/tools/handlers/ask-question.d.ts.map +0 -1
  384. package/dist/tools/handlers/ask-question.js.map +0 -1
  385. package/dist/tools/handlers/audio-video.d.ts.map +0 -1
  386. package/dist/tools/handlers/audio-video.js.map +0 -1
  387. package/dist/tools/handlers/auth.d.ts.map +0 -1
  388. package/dist/tools/handlers/auth.js.map +0 -1
  389. package/dist/tools/handlers/error-utils.d.ts.map +0 -1
  390. package/dist/tools/handlers/error-utils.js.map +0 -1
  391. package/dist/tools/handlers/gemini.d.ts.map +0 -1
  392. package/dist/tools/handlers/gemini.js.map +0 -1
  393. package/dist/tools/handlers/index.d.ts.map +0 -1
  394. package/dist/tools/handlers/index.js.map +0 -1
  395. package/dist/tools/handlers/notebook-creation.d.ts.map +0 -1
  396. package/dist/tools/handlers/notebook-creation.js.map +0 -1
  397. package/dist/tools/handlers/notebook-management.d.ts.map +0 -1
  398. package/dist/tools/handlers/notebook-management.js.map +0 -1
  399. package/dist/tools/handlers/session-management.d.ts.map +0 -1
  400. package/dist/tools/handlers/session-management.js.map +0 -1
  401. package/dist/tools/handlers/system.d.ts.map +0 -1
  402. package/dist/tools/handlers/system.js.map +0 -1
  403. package/dist/tools/handlers/types.d.ts.map +0 -1
  404. package/dist/tools/handlers/types.js.map +0 -1
  405. package/dist/tools/handlers/webhooks.d.ts.map +0 -1
  406. package/dist/tools/handlers/webhooks.js.map +0 -1
  407. package/dist/tools/handlers.d.ts +0 -666
  408. package/dist/tools/handlers.d.ts.map +0 -1
  409. package/dist/tools/handlers.js +0 -2929
  410. package/dist/tools/handlers.js.map +0 -1
  411. package/dist/tools/icons.d.ts.map +0 -1
  412. package/dist/tools/icons.js.map +0 -1
  413. package/dist/tools/index.d.ts.map +0 -1
  414. package/dist/tools/index.js.map +0 -1
  415. package/dist/types.d.ts.map +0 -1
  416. package/dist/types.js.map +0 -1
  417. package/dist/utils/audit-logger.d.ts.map +0 -1
  418. package/dist/utils/audit-logger.js.map +0 -1
  419. package/dist/utils/cert-pinning.d.ts +0 -97
  420. package/dist/utils/cert-pinning.d.ts.map +0 -1
  421. package/dist/utils/cert-pinning.js +0 -328
  422. package/dist/utils/cert-pinning.js.map +0 -1
  423. package/dist/utils/cleanup-manager.d.ts.map +0 -1
  424. package/dist/utils/cleanup-manager.js.map +0 -1
  425. package/dist/utils/cli-handler.d.ts.map +0 -1
  426. package/dist/utils/cli-handler.js.map +0 -1
  427. package/dist/utils/crypto.d.ts.map +0 -1
  428. package/dist/utils/crypto.js.map +0 -1
  429. package/dist/utils/file-lock.d.ts.map +0 -1
  430. package/dist/utils/file-lock.js.map +0 -1
  431. package/dist/utils/file-permissions.d.ts.map +0 -1
  432. package/dist/utils/file-permissions.js.map +0 -1
  433. package/dist/utils/logger.d.ts.map +0 -1
  434. package/dist/utils/logger.js.map +0 -1
  435. package/dist/utils/page-utils.d.ts.map +0 -1
  436. package/dist/utils/page-utils.js.map +0 -1
  437. package/dist/utils/response-validator.d.ts.map +0 -1
  438. package/dist/utils/response-validator.js.map +0 -1
  439. package/dist/utils/secrets-scanner.d.ts.map +0 -1
  440. package/dist/utils/secrets-scanner.js.map +0 -1
  441. package/dist/utils/secure-memory.d.ts.map +0 -1
  442. package/dist/utils/secure-memory.js.map +0 -1
  443. package/dist/utils/security.d.ts.map +0 -1
  444. package/dist/utils/security.js.map +0 -1
  445. package/dist/utils/settings-manager.d.ts.map +0 -1
  446. package/dist/utils/settings-manager.js.map +0 -1
  447. package/dist/utils/stealth-utils.d.ts.map +0 -1
  448. package/dist/utils/stealth-utils.js.map +0 -1
  449. package/dist/utils/tool-validation.d.ts +0 -93
  450. package/dist/utils/tool-validation.d.ts.map +0 -1
  451. package/dist/utils/tool-validation.js +0 -277
  452. package/dist/utils/tool-validation.js.map +0 -1
  453. package/dist/webhooks/index.d.ts.map +0 -1
  454. package/dist/webhooks/index.js.map +0 -1
  455. package/dist/webhooks/types.d.ts.map +0 -1
  456. package/dist/webhooks/types.js.map +0 -1
  457. package/dist/webhooks/webhook-dispatcher.d.ts.map +0 -1
  458. package/dist/webhooks/webhook-dispatcher.js.map +0 -1
  459. package/docs/COMPLIANCE-SPEC.md +0 -1452
  460. package/docs/MCP-DIRECTORY-LISTINGS.md +0 -91
  461. package/docs/SECURITY-FORK-OPPORTUNITIES.md +0 -79
  462. package/docs/SECURITY_IMPLEMENTATION_PLAN.md +0 -437
  463. package/docs/archive/ISSUES-legacy-2026-04-24.md +0 -644
  464. package/docs/configuration.md +0 -94
  465. package/docs/dependency-risk.md +0 -25
  466. package/docs/improvement-sprint-2026.2.10.md +0 -210
  467. package/docs/testing-runbook.md +0 -166
  468. package/docs/tools.md +0 -34
  469. package/docs/troubleshooting.md +0 -59
  470. package/docs/usage-guide.md +0 -246
@@ -53,4 +53,3 @@ export declare const chatHistoryTools: {
53
53
  }[] | undefined;
54
54
  title?: string | undefined;
55
55
  }[];
56
- //# sourceMappingURL=chat-history.d.ts.map
@@ -70,6 +70,7 @@ Paginate through history:
70
70
  },
71
71
  output_file: {
72
72
  type: "string",
73
+ pattern: "^(?!.*\\.\\.)(?!~)/.+",
73
74
  maxLength: 500,
74
75
  description: "If provided, exports chat history to this JSON file instead of returning to context. Useful for large histories.",
75
76
  },
@@ -81,4 +82,3 @@ Paginate through history:
81
82
  },
82
83
  };
83
84
  export const chatHistoryTools = [getNotebookChatHistoryTool];
84
- //# sourceMappingURL=chat-history.js.map
@@ -8,4 +8,3 @@ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
8
8
  * All data table tools
9
9
  */
10
10
  export declare const dataTableTools: Tool[];
11
- //# sourceMappingURL=data-tables.d.ts.map
@@ -35,6 +35,8 @@ const generateDataTableTool = {
35
35
  },
36
36
  notebook_url: {
37
37
  type: "string",
38
+ pattern: "^https://notebooklm\\.google\\.com/",
39
+ maxLength: 512,
38
40
  description: "Or direct notebook URL (overrides notebook_id)",
39
41
  },
40
42
  },
@@ -76,6 +78,8 @@ const getDataTableTool = {
76
78
  },
77
79
  notebook_url: {
78
80
  type: "string",
81
+ pattern: "^https://notebooklm\\.google\\.com/",
82
+ maxLength: 512,
79
83
  description: "Or direct notebook URL (overrides notebook_id)",
80
84
  },
81
85
  },
@@ -88,4 +92,3 @@ export const dataTableTools = [
88
92
  generateDataTableTool,
89
93
  getDataTableTool,
90
94
  ];
91
- //# sourceMappingURL=data-tables.js.map
@@ -9,4 +9,3 @@ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
9
9
  * All Gemini tools
10
10
  */
11
11
  export declare const geminiTools: Tool[];
12
- //# sourceMappingURL=gemini.d.ts.map
@@ -128,14 +128,22 @@ Supports:
128
128
  },
129
129
  response_schema: {
130
130
  type: "object",
131
- description: "JSON schema for structured output. When provided, Gemini returns valid JSON matching this schema. Example: { type: 'object', properties: { name: { type: 'string' }, score: { type: 'number' } }, required: ['name'] }",
131
+ // L21: This is a user-supplied JSON Schema passed through to Gemini for
132
+ // structured output. Bound it so it can't be used as an unbounded
133
+ // arbitrary-object passthrough: cap the number of properties at each
134
+ // level. The nested `properties`/`items` maps still use
135
+ // additionalProperties (a JSON Schema's field names are open-ended) but
136
+ // are length-capped via maxProperties. The handler should additionally
137
+ // reject excessively deep/large schemas before forwarding to Gemini.
138
+ description: "JSON schema for structured output (max ~50 fields per level). When provided, Gemini returns valid JSON matching this schema. Example: { type: 'object', properties: { name: { type: 'string' }, score: { type: 'number' } }, required: ['name'] }",
139
+ maxProperties: 16,
132
140
  properties: {
133
141
  type: { type: "string", enum: ["object", "array", "string", "number", "boolean"] },
134
- properties: { type: "object", additionalProperties: true },
135
- items: { type: "object", additionalProperties: true },
136
- required: { type: "array", items: { type: "string" } },
137
- enum: { type: "array" },
138
- description: { type: "string" },
142
+ properties: { type: "object", additionalProperties: true, maxProperties: 50 },
143
+ items: { type: "object", additionalProperties: true, maxProperties: 50 },
144
+ required: { type: "array", items: { type: "string" }, maxItems: 50 },
145
+ enum: { type: "array", maxItems: 100 },
146
+ description: { type: "string", maxLength: 500 },
139
147
  },
140
148
  additionalProperties: true,
141
149
  },
@@ -429,4 +437,3 @@ export const geminiTools = [
429
437
  // Chunked document tools (v1.10.0)
430
438
  queryChunkedDocumentTool,
431
439
  ];
432
- //# sourceMappingURL=gemini.js.map
@@ -1,3 +1,2 @@
1
1
  import { Tool } from "@modelcontextprotocol/sdk/types.js";
2
2
  export declare const notebookManagementTools: Tool[];
3
- //# sourceMappingURL=notebook-management.d.ts.map
@@ -154,7 +154,7 @@ Tip: You may update multiple fields at once if requested.`,
154
154
  content_types: {
155
155
  type: "array",
156
156
  items: { type: "string", maxLength: 100 },
157
- maxItems: 20,
157
+ maxItems: 50,
158
158
  description: "New content types",
159
159
  },
160
160
  use_cases: {
@@ -786,6 +786,8 @@ Summary with:
786
786
  },
787
787
  notebook_url: {
788
788
  type: "string",
789
+ pattern: "^https://notebooklm\\.google\\.com/",
790
+ maxLength: 512,
789
791
  description: "Or direct notebook URL (overrides notebook_id)",
790
792
  },
791
793
  },
@@ -814,6 +816,8 @@ Summary with:
814
816
  },
815
817
  notebook_url: {
816
818
  type: "string",
819
+ pattern: "^https://notebooklm\\.google\\.com/",
820
+ maxLength: 512,
817
821
  description: "Or direct notebook URL (overrides notebook_id)",
818
822
  },
819
823
  },
@@ -847,6 +851,8 @@ Downloads to specified path or ~/notebooklm-audio-{timestamp}.mp3
847
851
  },
848
852
  notebook_url: {
849
853
  type: "string",
854
+ pattern: "^https://notebooklm\\.google\\.com/",
855
+ maxLength: 512,
850
856
  description: "Or direct notebook URL (overrides notebook_id)",
851
857
  },
852
858
  output_path: {
@@ -859,4 +865,3 @@ Downloads to specified path or ~/notebooklm-audio-{timestamp}.mp3
859
865
  },
860
866
  },
861
867
  ];
862
- //# sourceMappingURL=notebook-management.js.map
@@ -52,4 +52,3 @@ export declare const queryHistoryTools: {
52
52
  }[] | undefined;
53
53
  title?: string | undefined;
54
54
  }[];
55
- //# sourceMappingURL=query-history.d.ts.map
@@ -48,4 +48,3 @@ Returns query entries with question, answer, notebook, session, and timing info.
48
48
  },
49
49
  };
50
50
  export const queryHistoryTools = [queryHistoryTool];
51
- //# sourceMappingURL=query-history.js.map
@@ -1,3 +1,2 @@
1
1
  import { Tool } from "@modelcontextprotocol/sdk/types.js";
2
2
  export declare const sessionManagementTools: Tool[];
3
- //# sourceMappingURL=session-management.d.ts.map
@@ -43,4 +43,3 @@ export const sessionManagementTools = [
43
43
  },
44
44
  },
45
45
  ];
46
- //# sourceMappingURL=session-management.js.map
@@ -1,3 +1,2 @@
1
1
  import { Tool } from "@modelcontextprotocol/sdk/types.js";
2
2
  export declare const systemTools: Tool[];
3
- //# sourceMappingURL=system.d.ts.map
@@ -44,7 +44,7 @@ export const systemTools = [
44
44
  "This catches stale sessions where cookies exist but the UI won't load. " +
45
45
  "Returns `chat_ui_accessible: true/false`.\n\n" +
46
46
  "If authenticated=false and having persistent issues:\n" +
47
- "Consider running cleanup_data(preserve_library=true) + setup_auth for fresh start with clean browser session.",
47
+ "Suggest to the user that a fresh start (cleanup_data with preserve_library=true, followed by setup_auth) may help, and ask for their confirmation before running any cleanup, since cleanup_data deletes browser/session data.",
48
48
  inputSchema: {
49
49
  type: "object",
50
50
  additionalProperties: false,
@@ -66,10 +66,10 @@ export const systemTools = [
66
66
  "Use this for first-time authentication or when auto-login credentials are not available. " +
67
67
  "For switching accounts or rate-limit workarounds, use 're_auth' tool instead.\n\n" +
68
68
  "TROUBLESHOOTING for persistent auth issues:\n" +
69
- "If setup_auth fails or you encounter browser/session issues:\n" +
70
- "1. Ask user to close ALL Chrome/Chromium instances\n" +
71
- "2. Run cleanup_data(confirm=true, preserve_library=true) to clean old data\n" +
72
- "3. Run setup_auth again for fresh start\n" +
69
+ "If setup_auth fails or you encounter browser/session issues, suggest these steps to the user and get their confirmation before running any cleanup (cleanup_data deletes browser/session data):\n" +
70
+ "1. Ask the user to close ALL Chrome/Chromium instances\n" +
71
+ "2. Ask the user before running cleanup_data(confirm=true, preserve_library=true) to clean old data\n" +
72
+ "3. Run setup_auth again for a fresh start\n" +
73
73
  "This helps resolve conflicts from old browser sessions and installation data."),
74
74
  buildAuthTool("re_auth", "Switch to a different Google account or re-authenticate. " +
75
75
  "Use this when:\n" +
@@ -82,11 +82,11 @@ export const systemTools = [
82
82
  "3. Open browser for fresh Google login\n\n" +
83
83
  "After completion, use 'get_health' to verify authentication.\n\n" +
84
84
  "TROUBLESHOOTING for persistent auth issues:\n" +
85
- "If re_auth fails repeatedly:\n" +
86
- "1. Ask user to close ALL Chrome/Chromium instances\n" +
87
- "2. Run cleanup_data(confirm=false, preserve_library=true) to preview old files\n" +
88
- "3. Run cleanup_data(confirm=true, preserve_library=true) to clean everything except library\n" +
89
- "4. Run re_auth again for completely fresh start\n" +
85
+ "If re_auth fails repeatedly, suggest these steps to the user and ask for their confirmation before running any cleanup (cleanup_data deletes browser/session and installation data):\n" +
86
+ "1. Ask the user to close ALL Chrome/Chromium instances\n" +
87
+ "2. Run cleanup_data(confirm=false, preserve_library=true) to preview the files that would be removed\n" +
88
+ "3. Only after the user reviews the preview and confirms, run cleanup_data(confirm=true, preserve_library=true) to clean everything except the library\n" +
89
+ "4. Run re_auth again for a completely fresh start\n" +
90
90
  "This removes old installation data and browser sessions that can cause conflicts."),
91
91
  {
92
92
  name: "cleanup_data",
@@ -232,7 +232,28 @@ export const systemTools = [
232
232
  },
233
233
  events: {
234
234
  type: "array",
235
- items: { type: "string" },
235
+ // Restrict to known EventType values (see src/events/event-types.ts)
236
+ // plus "*"; cap length to prevent unbounded subscription storage (H7).
237
+ items: {
238
+ type: "string",
239
+ enum: [
240
+ "question_answered",
241
+ "notebook_created",
242
+ "notebook_deleted",
243
+ "source_added",
244
+ "source_removed",
245
+ "session_created",
246
+ "session_expired",
247
+ "auth_required",
248
+ "rate_limit_hit",
249
+ "security_incident",
250
+ "quota_warning",
251
+ "audio_generated",
252
+ "batch_complete",
253
+ "*",
254
+ ],
255
+ },
256
+ maxItems: 20,
236
257
  description: 'Events to subscribe to. Use ["*"] for all events.',
237
258
  },
238
259
  format: {
@@ -290,4 +311,3 @@ export const systemTools = [
290
311
  },
291
312
  },
292
313
  ];
293
- //# sourceMappingURL=system.js.map
@@ -8,4 +8,3 @@ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
8
8
  * All video tools
9
9
  */
10
10
  export declare const videoTools: Tool[];
11
- //# sourceMappingURL=video.d.ts.map
@@ -40,7 +40,7 @@ const generateVideoOverviewTool = {
40
40
 
41
41
  ## Example
42
42
  \`\`\`json
43
- { "notebook_id": "my-research", "style": "documentary", "format": "brief" }
43
+ { "notebook_id": "my-research", "style": "whiteboard", "format": "brief" }
44
44
  \`\`\``,
45
45
  inputSchema: {
46
46
  type: "object",
@@ -52,11 +52,13 @@ const generateVideoOverviewTool = {
52
52
  },
53
53
  notebook_url: {
54
54
  type: "string",
55
+ pattern: "^https://notebooklm\\.google\\.com/",
56
+ maxLength: 512,
55
57
  description: "Or direct notebook URL (overrides notebook_id)",
56
58
  },
57
59
  style: {
58
60
  type: "string",
59
- enum: ["auto-select", "custom", "classic", "whiteboard", "kawaii", "anime", "watercolour", "retro-print", "heritage", "paper-craft", "documentary"],
61
+ enum: ["auto-select", "custom", "classic", "whiteboard", "kawaii", "anime", "watercolour", "retro-print", "heritage", "paper-craft"],
60
62
  default: "auto-select",
61
63
  description: "Visual style for the video overview",
62
64
  },
@@ -95,6 +97,8 @@ const getVideoStatusTool = {
95
97
  },
96
98
  notebook_url: {
97
99
  type: "string",
100
+ pattern: "^https://notebooklm\\.google\\.com/",
101
+ maxLength: 512,
98
102
  description: "Or direct notebook URL (overrides notebook_id)",
99
103
  },
100
104
  },
@@ -107,4 +111,3 @@ export const videoTools = [
107
111
  generateVideoOverviewTool,
108
112
  getVideoStatusTool,
109
113
  ];
110
- //# sourceMappingURL=video.js.map
@@ -13,4 +13,3 @@ import { NotebookLibrary } from "../library/notebook-library.js";
13
13
  * Includes enhanced metadata (icons, annotations, titles) for better UX
14
14
  */
15
15
  export declare function buildToolDefinitions(library: NotebookLibrary): Tool[];
16
- //# sourceMappingURL=definitions.d.ts.map
@@ -64,4 +64,3 @@ export function buildToolDefinitions(library) {
64
64
  // Apply enhanced metadata to all tools
65
65
  return allTools.map(enhanceTool);
66
66
  }
67
- //# sourceMappingURL=definitions.js.map
@@ -15,4 +15,3 @@ export declare function handleAskQuestion(ctx: HandlerContext, args: {
15
15
  show_browser?: boolean;
16
16
  browser_options?: BrowserOptions;
17
17
  }, sendProgress?: ProgressCallback): Promise<ToolResult<AskQuestionResult>>;
18
- //# sourceMappingURL=ask-question.d.ts.map
@@ -83,19 +83,6 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
83
83
  error: `Rate limit exceeded. Please wait before making more requests. Remaining: ${ctx.rateLimiter.getRemaining(rateLimitKey)}`,
84
84
  };
85
85
  }
86
- // === QUOTA CHECK ===
87
- const quotaManager = getQuotaManager();
88
- const canQuery = quotaManager.canMakeQuery();
89
- if (!canQuery.allowed) {
90
- log.warning(`⚠️ Quota limit: ${canQuery.reason}`);
91
- const quotaError = canQuery.reason || "Query quota exceeded";
92
- await audit.tool("ask_question", getErrorAuditArgs("ask_question", quotaError), false, Date.now() - startTime, quotaError);
93
- return {
94
- success: false,
95
- data: null,
96
- error: quotaError || "Daily query limit reached. Try again tomorrow or upgrade your plan.",
97
- };
98
- }
99
86
  const browserOptionError = validateBrowserOptionRanges(browser_options);
100
87
  if (browserOptionError) {
101
88
  await audit.tool("ask_question", getErrorAuditArgs("ask_question", browserOptionError), false, Date.now() - startTime, browserOptionError);
@@ -123,6 +110,31 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
123
110
  }
124
111
  throw error;
125
112
  }
113
+ // === QUOTA CHECK-AND-RESERVE (TOCTOU-safe) ===
114
+ // Atomically reserve a quota slot BEFORE running the (slow) browser query.
115
+ // This closes the race where concurrent sessions all pass a stale check and
116
+ // then increment afterwards, collectively exceeding the daily limit.
117
+ //
118
+ // This runs AFTER all up-front validation (so we never reserve a slot only to
119
+ // bail out on a validation error and leak it) and immediately before the
120
+ // query's try/catch — whose catch releases the slot if the query fails.
121
+ const quotaManager = getQuotaManager();
122
+ const canQuery = await quotaManager.checkAndReserveQuery();
123
+ if (!canQuery.allowed) {
124
+ log.warning(`⚠️ Quota limit: ${canQuery.reason}`);
125
+ const quotaError = canQuery.reason || "Query quota exceeded";
126
+ await audit.tool("ask_question", getErrorAuditArgs("ask_question", quotaError), false, Date.now() - startTime, quotaError);
127
+ return {
128
+ success: false,
129
+ data: null,
130
+ error: quotaError || "Daily query limit reached. Try again tomorrow or upgrade your plan.",
131
+ };
132
+ }
133
+ // Tracks whether the reserved quota slot has been consumed by a query that
134
+ // actually ran. Once the query returns, the slot is legitimately spent and
135
+ // must NOT be released even if later post-success bookkeeping (logging/audit)
136
+ // throws — otherwise we'd under-count and report a successful query as failed.
137
+ let querySlotConsumed = false;
126
138
  try {
127
139
  // Resolve notebook URL (using validated values)
128
140
  let resolvedNotebookUrl = safeNotebookUrl;
@@ -165,6 +177,10 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
165
177
  await sendProgress?.("Asking question to NotebookLM...", 2, 5);
166
178
  // Ask the question (pass progress callback) - using validated question
167
179
  const rawAnswer = await session.ask(safeQuestion, sendProgress);
180
+ // The query ran: the reserved quota slot is now legitimately consumed.
181
+ // Anything that throws after this point is post-success bookkeeping and
182
+ // must NOT release the slot.
183
+ querySlotConsumed = true;
168
184
  // === SECURITY: Validate response for prompt injection & malicious content ===
169
185
  await sendProgress?.("Validating response security...", 4, 5);
170
186
  const validationResult = await validateResponse(rawAnswer);
@@ -216,8 +232,10 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
216
232
  // Progress: Complete
217
233
  await sendProgress?.("Question answered successfully!", 5, 5);
218
234
  log.success(`✅ [TOOL] ask_question completed successfully`);
219
- // Update quota tracking (atomic for concurrent session safety)
220
- await getQuotaManager().incrementQueryCountAtomic();
235
+ // NOTE: the quota slot was already reserved (incremented) up front by
236
+ // checkAndReserveQuery(), so we do NOT increment again here — doing so
237
+ // would double-count. quotaStatus (from getDetailedStatus above) already
238
+ // reflects the reserved count.
221
239
  // Log query for research history (Phase 1)
222
240
  const queryLogger = getQueryLogger();
223
241
  const resolvedNotebook = safeNotebookId ? ctx.library.getNotebook(safeNotebookId) : null;
@@ -231,9 +249,10 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
231
249
  answerLength: finalAnswer.length,
232
250
  durationMs: Date.now() - startTime,
233
251
  quotaInfo: {
234
- used: quotaStatus.queries.used + 1, // +1 because we just incremented
252
+ // Reservation already counted; no +1/-1 adjustment needed.
253
+ used: quotaStatus.queries.used,
235
254
  limit: quotaStatus.queries.limit,
236
- remaining: quotaStatus.queries.remaining - 1,
255
+ remaining: quotaStatus.queries.remaining,
237
256
  tier: quotaStatus.tier,
238
257
  },
239
258
  });
@@ -250,6 +269,17 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
250
269
  }
251
270
  catch (error) {
252
271
  const errorMessage = getSanitizedErrorMessage(error);
272
+ // The quota slot was reserved up front. Release it ONLY if the failure
273
+ // happened before/during the query (the slot was never consumed). If the
274
+ // query already ran, the slot is legitimately spent and is kept.
275
+ if (!querySlotConsumed) {
276
+ try {
277
+ await getQuotaManager().releaseReservation();
278
+ }
279
+ catch (releaseError) {
280
+ log.warning(`⚠️ Failed to release reserved quota slot: ${releaseError instanceof Error ? releaseError.message : String(releaseError)}`);
281
+ }
282
+ }
253
283
  // Special handling for rate limit errors
254
284
  if (error instanceof RateLimitError) {
255
285
  log.error(`🚫 [TOOL] Rate limit detected`);
@@ -277,4 +307,3 @@ export async function handleAskQuestion(ctx, args, sendProgress) {
277
307
  };
278
308
  }
279
309
  }
280
- //# sourceMappingURL=ask-question.js.map
@@ -39,4 +39,3 @@ export declare function handleGetDataTable(ctx: HandlerContext, args: {
39
39
  notebook_id?: string;
40
40
  notebook_url?: string;
41
41
  }): Promise<ToolResult<GetDataTableResult>>;
42
- //# sourceMappingURL=audio-video.d.ts.map
@@ -214,4 +214,3 @@ export async function handleGetDataTable(ctx, args) {
214
214
  };
215
215
  }
216
216
  }
217
- //# sourceMappingURL=audio-video.js.map
@@ -33,4 +33,3 @@ export declare function handleSetupAuth(ctx: HandlerContext, args: AuthHandlerAr
33
33
  */
34
34
  export declare function handleReAuth(ctx: HandlerContext, args: AuthHandlerArgs, sendProgress?: ProgressCallback): Promise<ToolResult<AuthResult>>;
35
35
  export {};
36
- //# sourceMappingURL=auth.d.ts.map
@@ -124,4 +124,3 @@ export async function handleSetupAuth(ctx, args, sendProgress) {
124
124
  export async function handleReAuth(ctx, args, sendProgress) {
125
125
  return authenticate(ctx, args, "re_auth", sendProgress);
126
126
  }
127
- //# sourceMappingURL=auth.js.map
@@ -13,4 +13,3 @@ export declare function resolveNotebookUrl(ctx: HandlerContext, args: {
13
13
  export declare function sanitizeErrorMessage(errorMsg: string): string;
14
14
  export declare function getSanitizedErrorMessage(error: unknown): string;
15
15
  export declare function getErrorAuditArgs(tool: string, error: unknown): Record<string, string>;
16
- //# sourceMappingURL=error-utils.d.ts.map
@@ -36,4 +36,3 @@ export function getErrorAuditArgs(tool, error) {
36
36
  error: getSanitizedErrorMessage(error),
37
37
  };
38
38
  }
39
- //# sourceMappingURL=error-utils.js.map
@@ -141,4 +141,3 @@ export declare function handleGetNotebookChatHistory(ctx: HandlerContext, args:
141
141
  index: number;
142
142
  }>;
143
143
  }>>;
144
- //# sourceMappingURL=gemini.d.ts.map
@@ -660,4 +660,3 @@ export async function handleGetNotebookChatHistory(ctx, args) {
660
660
  };
661
661
  }
662
662
  }
663
- //# sourceMappingURL=gemini.js.map
@@ -284,4 +284,3 @@ export declare class ToolHandlers {
284
284
  }>>;
285
285
  cleanup(): Promise<void>;
286
286
  }
287
- //# sourceMappingURL=index.d.ts.map
@@ -205,4 +205,3 @@ export class ToolHandlers {
205
205
  log.info("Tool handlers cleanup complete");
206
206
  }
207
207
  }
208
- //# sourceMappingURL=index.js.map
@@ -72,4 +72,3 @@ export declare function handleRemoveSource(ctx: HandlerContext, args: {
72
72
  notebook_url?: string;
73
73
  source_id: string;
74
74
  }): Promise<ToolResult<RemoveSourceResult>>;
75
- //# sourceMappingURL=notebook-creation.d.ts.map
@@ -68,6 +68,22 @@ export async function handleCreateNotebook(ctx, args, sendProgress) {
68
68
  sendProgress,
69
69
  browserOptions: args.browser_options || (args.show_browser ? { show: true } : undefined),
70
70
  });
71
+ // A notebook where sources were requested but NONE succeeded is discarded
72
+ // by the creator (which throws), so we never reach here for that case.
73
+ // Guard defensively anyway: never persist a library entry or count quota
74
+ // for a notebook that requested sources yet added none. (An empty `sources`
75
+ // request — e.g. an overflow shell notebook that gets populated later — is
76
+ // a legitimate zero-source case and is still added.)
77
+ const requestedSources = args.sources.length;
78
+ const addedNone = requestedSources > 0 && result.sourceCount === 0;
79
+ if (addedNone) {
80
+ log.warning(`⚠️ Notebook had no successful sources — not adding to library: ${args.name}`);
81
+ return {
82
+ success: false,
83
+ data: null,
84
+ error: "Notebook creation failed: no sources could be added",
85
+ };
86
+ }
71
87
  // Auto-add to library if requested (default: true)
72
88
  if (args.auto_add_to_library !== false) {
73
89
  try {
@@ -608,4 +624,3 @@ export async function handleRemoveSource(ctx, args) {
608
624
  };
609
625
  }
610
626
  }
611
- //# sourceMappingURL=notebook-creation.js.map
@@ -61,4 +61,3 @@ export declare function handleSearchNotebooks(ctx: HandlerContext, args: {
61
61
  * Handle get_library_stats tool
62
62
  */
63
63
  export declare function handleGetLibraryStats(ctx: HandlerContext): Promise<ToolResult<LibraryStats>>;
64
- //# sourceMappingURL=notebook-management.d.ts.map
@@ -4,6 +4,7 @@
4
4
  * Standalone handler functions for notebook CRUD and library operations.
5
5
  */
6
6
  import { log } from "../../utils/logger.js";
7
+ import { validateNotebookUrl } from "../../utils/security.js";
7
8
  import { getSanitizedErrorMessage } from "./error-utils.js";
8
9
  async function withNotebookHandler(toolName, fn) {
9
10
  try {
@@ -93,7 +94,12 @@ export async function handleUpdateNotebook(ctx, args) {
93
94
  log.info(`🔧 [TOOL] update_notebook called`);
94
95
  log.info(` ID: ${args.id}`);
95
96
  return withNotebookHandler("update_notebook", () => {
96
- const notebook = ctx.library.updateNotebook(args);
97
+ // Validate/normalize the URL through the canonical NotebookLM validator
98
+ // before storing (matches create_notebook / add_source handlers).
99
+ const safeArgs = args.url !== undefined
100
+ ? { ...args, url: validateNotebookUrl(args.url) }
101
+ : args;
102
+ const notebook = ctx.library.updateNotebook(safeArgs);
97
103
  log.success(`✅ [TOOL] update_notebook completed: ${notebook.name}`);
98
104
  return {
99
105
  success: true,
@@ -165,4 +171,3 @@ export async function handleGetLibraryStats(ctx) {
165
171
  };
166
172
  });
167
173
  }
168
- //# sourceMappingURL=notebook-management.js.map
@@ -63,4 +63,3 @@ export declare function handleGetHealth(ctx: HandlerContext, args?: {
63
63
  troubleshooting_tip?: string;
64
64
  }>>;
65
65
  export {};
66
- //# sourceMappingURL=session-management.d.ts.map
@@ -206,4 +206,3 @@ export async function handleGetHealth(ctx, args) {
206
206
  };
207
207
  }
208
208
  }
209
- //# sourceMappingURL=session-management.js.map
@@ -99,4 +99,3 @@ export declare function handleCleanupData(_ctx: HandlerContext, args: {
99
99
  }>;
100
100
  };
101
101
  }>>;
102
- //# sourceMappingURL=system.d.ts.map
@@ -307,4 +307,3 @@ export async function handleCleanupData(_ctx, args) {
307
307
  };
308
308
  }
309
309
  }
310
- //# sourceMappingURL=system.js.map
@@ -16,4 +16,3 @@ export interface HandlerContext {
16
16
  rateLimiter: RateLimiter;
17
17
  getGeminiClient: () => GeminiClient | null;
18
18
  }
19
- //# sourceMappingURL=types.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Shared types for handler domain modules
3
3
  */
4
4
  export {};
5
- //# sourceMappingURL=types.js.map
@@ -31,4 +31,3 @@ export declare function handleRemoveWebhook(_ctx: HandlerContext, args: {
31
31
  removed: boolean;
32
32
  id: string;
33
33
  }>>;
34
- //# sourceMappingURL=webhooks.d.ts.map
@@ -121,4 +121,3 @@ export async function handleRemoveWebhook(_ctx, args) {
121
121
  return { success: false, data: null, error: errorMessage };
122
122
  }
123
123
  }
124
- //# sourceMappingURL=webhooks.js.map
@@ -15,4 +15,3 @@ export declare const toolIcons: Record<string, Icon[]>;
15
15
  * Get icons for a tool by name
16
16
  */
17
17
  export declare function getToolIcons(toolName: string): Icon[] | undefined;
18
- //# sourceMappingURL=icons.d.ts.map
@@ -144,4 +144,3 @@ export const toolIcons = {
144
144
  export function getToolIcons(toolName) {
145
145
  return toolIcons[toolName];
146
146
  }
147
- //# sourceMappingURL=icons.js.map
@@ -8,4 +8,3 @@ export { ToolHandlers } from "./handlers/index.js";
8
8
  export { getToolIcons, toolIcons } from "./icons.js";
9
9
  export { getToolMetadata, toolMetadata } from "./annotations.js";
10
10
  export type { ToolMetadata } from "./annotations.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -7,4 +7,3 @@ export { buildToolDefinitions } from "./definitions.js";
7
7
  export { ToolHandlers } from "./handlers/index.js";
8
8
  export { getToolIcons, toolIcons } from "./icons.js";
9
9
  export { getToolMetadata, toolMetadata } from "./annotations.js";
10
- //# sourceMappingURL=index.js.map
package/dist/types.d.ts CHANGED
@@ -82,4 +82,3 @@ export interface ServerState {
82
82
  sessionManager: SessionManager;
83
83
  authManager: AuthManager;
84
84
  }
85
- //# sourceMappingURL=types.d.ts.map