@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
@@ -37,8 +37,6 @@ function generateQueryId() {
37
37
  return crypto.randomBytes(8).toString("hex");
38
38
  }
39
39
  const MAX_LOG_FILE_BYTES = 100 * 1024 * 1024; // 100 MB per daily file (I232)
40
- const TRUNCATED_FIELD_LENGTH = 500;
41
- const TRUNCATED_SUFFIX = "...[truncated]";
42
40
  /**
43
41
  * Query Logger Class
44
42
  *
@@ -56,6 +54,19 @@ export class QueryLogger {
56
54
  * severity so we don't redact legitimate base64 payloads (images, PDFs,
57
55
  * JWT payloads) that frequently appear in NotebookLM answers. Real
58
56
  * credentials live at critical/high/medium severity.
57
+ *
58
+ * ACCEPTED RISK (L11): the only `severity: "low"` rule in the scanner is the
59
+ * "High Entropy String" pattern (/\b[A-Za-z0-9+/]{32,}={0,2}\b/, see
60
+ * secrets-scanner.ts). It is DELIBERATELY NOT redacted at rest because
61
+ * NotebookLM answers routinely contain long, high-entropy base64 that is NOT
62
+ * a secret — inline image/PDF data-URIs, JWT payload segments, GCS object
63
+ * names, CSRF tokens, document hashes. Redacting at "low" would shred this
64
+ * legitimate research content (high false-positive rate) for marginal gain:
65
+ * genuine credentials (API keys, bearer tokens, private keys, connection
66
+ * strings) already match dedicated critical/high/medium rules and are
67
+ * redacted regardless. The base64 false-positive cost outweighs the residual
68
+ * risk of an unstructured low-confidence entropy hit slipping through, so the
69
+ * threshold stays at "medium" by design.
59
70
  */
60
71
  scanner = new SecretsScanner({ minSeverity: "medium" });
61
72
  stats = {
@@ -91,14 +102,25 @@ export class QueryLogger {
91
102
  cleanOldLogs() {
92
103
  try {
93
104
  const files = fs.readdirSync(this.config.logDir);
105
+ // Filenames are UTC dates (toISOString) and new Date("YYYY-MM-DD") parses as
106
+ // UTC midnight, so compute the cutoff at UTC midnight too — using local
107
+ // setDate/getDate would skew the comparison by up to a day near TZ boundaries (L13).
94
108
  const cutoffDate = new Date();
95
- cutoffDate.setDate(cutoffDate.getDate() - this.config.retentionDays);
109
+ cutoffDate.setUTCHours(0, 0, 0, 0);
110
+ cutoffDate.setUTCDate(cutoffDate.getUTCDate() - this.config.retentionDays);
96
111
  let deletedCount = 0;
97
112
  for (const file of files) {
98
113
  if (!file.startsWith("query-log-") || !file.endsWith(".jsonl"))
99
114
  continue;
100
- // Extract date from filename (query-log-YYYY-MM-DD.jsonl)
115
+ // Extract date from filename (query-log-YYYY-MM-DD.jsonl). The fixed-width
116
+ // slice(10,20) yields "YYYY-MM-DD" for both base and rotated
117
+ // (query-log-DATE.NNN.jsonl) names, so this guard does NOT exclude rotated files
118
+ // from retention — it only rejects genuinely malformed names before feeding
119
+ // new Date, which would otherwise parse to Invalid Date or a misread cutoff (L13).
120
+ // Matches audit-logger's guard.
101
121
  const dateStr = file.slice(10, 20);
122
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(dateStr))
123
+ continue;
102
124
  const fileDate = new Date(dateStr);
103
125
  if (fileDate < cutoffDate) {
104
126
  fs.unlinkSync(path.join(this.config.logDir, file));
@@ -131,7 +153,13 @@ export class QueryLogger {
131
153
  if (this.currentLogFile !== expectedFile) {
132
154
  this.currentLogFile = expectedFile;
133
155
  }
134
- // Enforce per-file size cap (I232) truncate fields if approaching limit
156
+ // Enforce per-file size cap (I232). When the cap would be exceeded we ROTATE to
157
+ // a sequence-suffixed file (query-log-DATE.NNN.jsonl) instead of silently
158
+ // truncating Q&A content (M9) — the old behaviour permanently lost research
159
+ // data with no record. Each rotation emits a mandatory log.warning so the event
160
+ // is visible. The current file size is re-read after each rotation; the next
161
+ // suffix is determined by scanning the directory so the cap holds across writers
162
+ // and process restarts (per-process counters did not).
135
163
  let currentFileSize = (() => {
136
164
  try {
137
165
  return fs.statSync(this.currentLogFile).size;
@@ -140,29 +168,65 @@ export class QueryLogger {
140
168
  return 0;
141
169
  }
142
170
  })();
143
- const lines = batch.map((e) => {
171
+ const linesToWrite = [];
172
+ for (const e of batch) {
144
173
  const serialized = JSON.stringify(e);
145
174
  const entryBytes = Buffer.byteLength(serialized + "\n");
146
- if (currentFileSize + entryBytes > MAX_LOG_FILE_BYTES) {
147
- const truncated = {
148
- ...e,
149
- question: e.question.slice(0, TRUNCATED_FIELD_LENGTH) + TRUNCATED_SUFFIX,
150
- answer: e.answer.slice(0, TRUNCATED_FIELD_LENGTH) + TRUNCATED_SUFFIX,
151
- };
152
- const ts = JSON.stringify(truncated);
153
- currentFileSize += Buffer.byteLength(ts + "\n");
154
- return ts;
175
+ if (currentFileSize > 0 && currentFileSize + entryBytes > MAX_LOG_FILE_BYTES) {
176
+ // Flush what we have to the current file before rotating.
177
+ if (linesToWrite.length > 0) {
178
+ appendFileSecure(this.currentLogFile, linesToWrite.join("\n") + "\n", PERMISSION_MODES.OWNER_READ_WRITE);
179
+ linesToWrite.length = 0;
180
+ }
181
+ const rotatedFile = this.nextRotatedFile(today);
182
+ log.warning(`⚠️ Query log ${path.basename(this.currentLogFile)} reached ${MAX_LOG_FILE_BYTES} byte cap — rotating to ${path.basename(rotatedFile)} (no content truncated)`);
183
+ this.currentLogFile = rotatedFile;
184
+ currentFileSize = (() => {
185
+ try {
186
+ return fs.statSync(this.currentLogFile).size;
187
+ }
188
+ catch {
189
+ return 0;
190
+ }
191
+ })();
155
192
  }
193
+ linesToWrite.push(serialized);
156
194
  currentFileSize += entryBytes;
157
- return serialized;
158
- }).join("\n") + "\n";
159
- appendFileSecure(this.currentLogFile, lines, PERMISSION_MODES.OWNER_READ_WRITE);
195
+ }
196
+ if (linesToWrite.length > 0) {
197
+ appendFileSecure(this.currentLogFile, linesToWrite.join("\n") + "\n", PERMISSION_MODES.OWNER_READ_WRITE);
198
+ }
160
199
  }
161
200
  }
162
201
  finally {
163
202
  this.isWriting = false;
164
203
  }
165
204
  }
205
+ /**
206
+ * Determine the next sequence-suffixed log file for `date` when the base file (or a
207
+ * prior rotation) has hit the size cap (M9). Scans the directory for the highest
208
+ * existing query-log-DATE.NNN.jsonl suffix and returns the next one, so rotation is
209
+ * correct across writers and restarts rather than relying on a per-process counter.
210
+ */
211
+ nextRotatedFile(date) {
212
+ let maxSeq = 0;
213
+ try {
214
+ const re = new RegExp(`^query-log-${date}\\.(\\d{3})\\.jsonl$`);
215
+ for (const f of fs.readdirSync(this.config.logDir)) {
216
+ const m = f.match(re);
217
+ if (m) {
218
+ const seq = parseInt(m[1], 10);
219
+ if (seq > maxSeq)
220
+ maxSeq = seq;
221
+ }
222
+ }
223
+ }
224
+ catch (err) {
225
+ log.debug(`query-logger: scanning for rotated files: ${err instanceof Error ? err.message : String(err)}`);
226
+ }
227
+ const nextSeq = String(maxSeq + 1).padStart(3, "0");
228
+ return path.join(this.config.logDir, `query-log-${date}.${nextSeq}.jsonl`);
229
+ }
166
230
  /**
167
231
  * Log a query (Q&A pair).
168
232
  *
@@ -216,8 +280,23 @@ export class QueryLogger {
216
280
  * Get all queries for a specific date (YYYY-MM-DD)
217
281
  */
218
282
  async getQueriesForDate(date) {
219
- const logFile = path.join(this.config.logDir, `query-log-${date}.jsonl`);
220
- return this.readLogFile(logFile);
283
+ // Include any size-cap rotations for the day (query-log-DATE.NNN.jsonl), not just
284
+ // the base file, so rotated entries are not missed (M9).
285
+ const baseFile = path.join(this.config.logDir, `query-log-${date}.jsonl`);
286
+ const entries = this.readLogFile(baseFile);
287
+ const rotatedRe = new RegExp(`^query-log-${date}\\.\\d{3}\\.jsonl$`);
288
+ try {
289
+ const rotated = fs.readdirSync(this.config.logDir)
290
+ .filter(f => rotatedRe.test(f))
291
+ .sort();
292
+ for (const f of rotated) {
293
+ entries.push(...this.readLogFile(path.join(this.config.logDir, f)));
294
+ }
295
+ }
296
+ catch (err) {
297
+ log.debug(`query-logger: reading rotated files for date ${date}: ${err instanceof Error ? err.message : String(err)}`);
298
+ }
299
+ return entries;
221
300
  }
222
301
  /**
223
302
  * Get recent queries
@@ -279,6 +358,11 @@ export class QueryLogger {
279
358
  return;
280
359
  process.on("beforeExit", () => QueryLogger.flushAllSync());
281
360
  process.on("SIGTERM", () => QueryLogger.flushAllSync());
361
+ // Mirror SIGTERM for SIGINT (Ctrl-C) and SIGHUP so buffered Q&A is flushed
362
+ // synchronously on those signals too (M5). Additive flush-only safety nets — the
363
+ // process entry point owns termination, so these do not suppress exit or hang.
364
+ process.on("SIGINT", () => QueryLogger.flushAllSync());
365
+ process.on("SIGHUP", () => QueryLogger.flushAllSync());
282
366
  QueryLogger.processHandlersRegistered = true;
283
367
  }
284
368
  static flushAllSync() {
@@ -361,4 +445,3 @@ export function getQueryLogger() {
361
445
  export async function logQuery(entry) {
362
446
  return getQueryLogger().logQuery(entry);
363
447
  }
364
- //# sourceMappingURL=query-logger.js.map
@@ -4,8 +4,7 @@
4
4
  * Manages audio overview generation in NotebookLM notebooks.
5
5
  * Audio overviews are AI-generated podcast-style summaries of notebook content.
6
6
  */
7
- import { AuthManager } from "../auth/auth-manager.js";
8
- import { SharedContextManager } from "../session/shared-context-manager.js";
7
+ import { StudioManagerBase } from "./studio-manager-base.js";
9
8
  export interface AudioStatus {
10
9
  status: "not_started" | "generating" | "ready" | "failed" | "unknown";
11
10
  progress?: number;
@@ -23,15 +22,12 @@ export interface DownloadAudioResult {
23
22
  size?: number;
24
23
  error?: string;
25
24
  }
26
- export declare class AudioManager {
27
- private authManager;
28
- private contextManager;
29
- private page;
30
- constructor(authManager: AuthManager, contextManager: SharedContextManager);
31
- /**
32
- * Navigate to a notebook and ensure we're on the right page
33
- */
34
- private navigateToNotebook;
25
+ export declare class AudioManager extends StudioManagerBase {
26
+ protected readonly logName = "audio-manager";
27
+ protected readonly navigateDelay: {
28
+ min: number;
29
+ max: number;
30
+ };
35
31
  /**
36
32
  * Generate an audio overview for a notebook
37
33
  */
@@ -48,9 +44,4 @@ export declare class AudioManager {
48
44
  * Download the generated audio file
49
45
  */
50
46
  downloadAudio(notebookUrl: string, outputPath?: string): Promise<DownloadAudioResult>;
51
- /**
52
- * Close the page if open
53
- */
54
- private closePage;
55
47
  }
56
- //# sourceMappingURL=audio-manager.d.ts.map
@@ -6,8 +6,71 @@
6
6
  */
7
7
  import { log } from "../utils/logger.js";
8
8
  import { randomDelay } from "../utils/stealth-utils.js";
9
+ import { StudioManagerBase, } from "./studio-manager-base.js";
9
10
  import fs from "fs";
10
11
  import path from "path";
12
+ import os from "os";
13
+ /**
14
+ * Maximum size for a downloaded audio file. Caps unbounded in-memory buffering
15
+ * (response.body() reads the whole response) and arbitrary disk writes (H14).
16
+ */
17
+ const MAX_AUDIO_BYTES = 200 * 1024 * 1024; // 200 MiB
18
+ /**
19
+ * Allowed origins for audio download URLs scraped from the page DOM.
20
+ * Prevents SSRF: the download URL (downloadBtn.href / data-url / audio.src) is
21
+ * attacker-influenceable content, so it must be confined to Google/NotebookLM
22
+ * hosts before page.goto() (C3). Mirrors the host-matching used by
23
+ * validateNotebookUrl in utils/security.ts.
24
+ */
25
+ const ALLOWED_AUDIO_DOWNLOAD_DOMAINS = [
26
+ "google.com",
27
+ "googleusercontent.com",
28
+ ];
29
+ /**
30
+ * Resolve and validate the audio output path, confining it to an allowed base
31
+ * directory (C2). Mirrors resolveExportPath in tools/handlers/system.ts:
32
+ * 1. NLMCP_EXPORT_DIR env override
33
+ * 2. user home directory
34
+ * Rejects absolute paths and '..' traversal that escape the base dir.
35
+ */
36
+ function resolveAudioOutputPath(userPath, defaultName) {
37
+ const envDir = process.env.NLMCP_EXPORT_DIR?.trim();
38
+ const baseDirRaw = envDir && envDir.length > 0 ? envDir : os.homedir();
39
+ const baseDir = path.resolve(baseDirRaw);
40
+ const candidate = userPath && userPath.trim().length > 0
41
+ ? path.resolve(baseDir, userPath)
42
+ : path.resolve(baseDir, defaultName);
43
+ // Defence in depth: ensure resolved path is still inside the base dir.
44
+ const rel = path.relative(baseDir, candidate);
45
+ if (rel.startsWith("..") || path.isAbsolute(rel)) {
46
+ throw new Error(`output_path must resolve inside ${baseDir} (got '${candidate}'). ` +
47
+ `Set NLMCP_EXPORT_DIR to allow another base directory.`);
48
+ }
49
+ return candidate;
50
+ }
51
+ /**
52
+ * Validate a DOM-sourced audio download URL before navigating to it (C3, SSRF).
53
+ * Enforces https and an allowed Google/NotebookLM host. Returns the normalized
54
+ * URL or throws.
55
+ */
56
+ function validateAudioDownloadUrl(url) {
57
+ let parsed;
58
+ try {
59
+ parsed = new URL(url);
60
+ }
61
+ catch {
62
+ throw new Error("Audio download URL is not a valid absolute URL");
63
+ }
64
+ if (parsed.protocol !== "https:") {
65
+ throw new Error(`Audio download URL must be https (got '${parsed.protocol}')`);
66
+ }
67
+ const hostname = parsed.hostname.toLowerCase();
68
+ const allowed = ALLOWED_AUDIO_DOWNLOAD_DOMAINS.some((d) => hostname === d || hostname.endsWith("." + d));
69
+ if (!allowed) {
70
+ throw new Error(`Audio download host not allowed: ${hostname}`);
71
+ }
72
+ return parsed.href;
73
+ }
11
74
  // Selectors for audio controls (may need refinement based on actual UI)
12
75
  const AUDIO_SELECTORS = {
13
76
  // Generate button
@@ -38,47 +101,27 @@ const AUDIO_SELECTORS = {
38
101
  text: '[class*="progress-text"], [class*="eta"]',
39
102
  },
40
103
  };
41
- export class AudioManager {
42
- authManager;
43
- contextManager;
44
- page = null;
45
- constructor(authManager, contextManager) {
46
- this.authManager = authManager;
47
- this.contextManager = contextManager;
48
- }
49
- /**
50
- * Navigate to a notebook and ensure we're on the right page
51
- */
52
- async navigateToNotebook(notebookUrl) {
53
- const context = await this.contextManager.getOrCreateContext();
54
- const isAuth = await this.authManager.validateWithRetry(context);
55
- if (!isAuth) {
56
- throw new Error("Not authenticated. Run setup_auth first.");
57
- }
58
- this.page = await context.newPage();
59
- await this.page.goto(notebookUrl, { waitUntil: "domcontentloaded" });
60
- await this.page.waitForLoadState("networkidle").catch(() => { });
61
- await randomDelay(1500, 2500);
62
- return this.page;
63
- }
104
+ export class AudioManager extends StudioManagerBase {
105
+ logName = "audio-manager";
106
+ navigateDelay = { min: 1500, max: 2500 };
64
107
  /**
65
108
  * Generate an audio overview for a notebook
66
109
  */
67
110
  async generateAudioOverview(notebookUrl) {
68
- log.info(`🎙️ Generating audio overview for: ${notebookUrl}`);
111
+ log.info(`Generating audio overview for: ${notebookUrl}`);
69
112
  const page = await this.navigateToNotebook(notebookUrl);
70
113
  try {
71
114
  // First, check current status
72
115
  const currentStatus = await this.checkAudioStatusInternal(page);
73
116
  if (currentStatus.status === "generating") {
74
- log.info(" Audio generation already in progress");
117
+ log.info(" Audio generation already in progress");
75
118
  return {
76
119
  success: true,
77
120
  status: currentStatus,
78
121
  };
79
122
  }
80
123
  if (currentStatus.status === "ready") {
81
- log.info(" Audio already generated");
124
+ log.info(" Audio already generated");
82
125
  return {
83
126
  success: true,
84
127
  status: currentStatus,
@@ -127,7 +170,7 @@ export class AudioManager {
127
170
  });
128
171
  }
129
172
  if (!generateClicked) {
130
- log.warning(" ⚠️ Could not find audio generation button");
173
+ log.warning(" Could not find audio generation button");
131
174
  return {
132
175
  success: false,
133
176
  status: { status: "unknown" },
@@ -138,7 +181,7 @@ export class AudioManager {
138
181
  // Check if generation started
139
182
  const newStatus = await this.checkAudioStatusInternal(page);
140
183
  if (newStatus.status === "generating" || newStatus.status === "ready") {
141
- log.success(` Audio generation ${newStatus.status === "ready" ? "completed" : "started"}`);
184
+ log.success(` Audio generation ${newStatus.status === "ready" ? "completed" : "started"}`);
142
185
  return {
143
186
  success: true,
144
187
  status: newStatus,
@@ -158,7 +201,7 @@ export class AudioManager {
158
201
  * Check the current audio status for a notebook
159
202
  */
160
203
  async getAudioStatus(notebookUrl) {
161
- log.info(`🔍 Checking audio status for: ${notebookUrl}`);
204
+ log.info(`Checking audio status for: ${notebookUrl}`);
162
205
  const page = await this.navigateToNotebook(notebookUrl);
163
206
  try {
164
207
  const status = await this.checkAudioStatusInternal(page);
@@ -222,7 +265,7 @@ export class AudioManager {
222
265
  * Download the generated audio file
223
266
  */
224
267
  async downloadAudio(notebookUrl, outputPath) {
225
- log.info(`⬇️ Downloading audio from: ${notebookUrl}`);
268
+ log.info(`Downloading audio from: ${notebookUrl}`);
226
269
  const page = await this.navigateToNotebook(notebookUrl);
227
270
  try {
228
271
  // First check if audio is ready
@@ -266,12 +309,12 @@ export class AudioManager {
266
309
  return false;
267
310
  });
268
311
  if (clicked) {
269
- // Wait for download to start
312
+ // The button was clicked but we cannot capture the file via this code
313
+ // path, so no file is written. Do not report success (M27).
270
314
  await randomDelay(2000, 3000);
271
- // Note: Actual file download handling would require more complex logic
272
315
  return {
273
- success: true,
274
- error: "Download initiated. Check your downloads folder.",
316
+ success: false,
317
+ error: "Download could not be completed automatically; no file was saved. Try downloading the audio manually from the notebook.",
275
318
  };
276
319
  }
277
320
  return {
@@ -279,29 +322,59 @@ export class AudioManager {
279
322
  error: "Could not find download button or audio source",
280
323
  };
281
324
  }
282
- // Generate output path if not provided
283
- const finalPath = outputPath || path.join(process.env.HOME || process.env.USERPROFILE || ".", `notebooklm-audio-${Date.now()}.mp3`);
325
+ // Confine output to an allowed base directory (C2). When no output_path
326
+ // is supplied, the generated default also lands inside the base dir.
327
+ const defaultName = `notebooklm-audio-${Date.now()}.mp3`;
328
+ const finalPath = resolveAudioOutputPath(outputPath, defaultName);
329
+ // Validate the DOM-sourced download URL before navigating (C3, SSRF).
330
+ const safeDownloadUrl = validateAudioDownloadUrl(downloadInfo.url);
284
331
  // Download the file using the page context
285
- const response = await page.goto(downloadInfo.url);
332
+ const response = await page.goto(safeDownloadUrl);
286
333
  if (!response) {
287
334
  return {
288
335
  success: false,
289
336
  error: "Failed to fetch audio file",
290
337
  };
291
338
  }
339
+ // Enforce size cap early via Content-Length if present (H14).
340
+ const contentLengthHeader = response.headers()["content-length"];
341
+ if (contentLengthHeader) {
342
+ const declared = parseInt(contentLengthHeader, 10);
343
+ if (Number.isFinite(declared) && declared > MAX_AUDIO_BYTES) {
344
+ return {
345
+ success: false,
346
+ error: `Audio file too large: ${declared} bytes exceeds limit of ${MAX_AUDIO_BYTES} bytes`,
347
+ };
348
+ }
349
+ }
350
+ // Warn (do not hard-fail) if content-type is not audio/* — NotebookLM may
351
+ // serve application/octet-stream.
352
+ const contentType = response.headers()["content-type"];
353
+ if (contentType && !contentType.startsWith("audio/") && !contentType.startsWith("application/octet-stream")) {
354
+ log.warning(` Unexpected audio content-type: ${contentType}`);
355
+ }
356
+ // patchright's response.body() has no streaming cap, so buffer then
357
+ // enforce the cap before writing (H14). Content-Length can be absent or
358
+ // inaccurate, so this check is authoritative.
292
359
  const buffer = await response.body();
293
- fs.writeFileSync(finalPath, buffer);
294
- const stats = fs.statSync(finalPath);
295
- log.success(` ✅ Audio downloaded: ${finalPath} (${stats.size} bytes)`);
360
+ if (buffer.length > MAX_AUDIO_BYTES) {
361
+ return {
362
+ success: false,
363
+ error: `Audio file too large: ${buffer.length} bytes exceeds limit of ${MAX_AUDIO_BYTES} bytes`,
364
+ };
365
+ }
366
+ // Async write to avoid blocking the event loop (H14).
367
+ await fs.promises.writeFile(finalPath, buffer);
368
+ log.success(` Audio downloaded: ${finalPath} (${buffer.length} bytes)`);
296
369
  return {
297
370
  success: true,
298
371
  filePath: finalPath,
299
- size: stats.size,
372
+ size: buffer.length,
300
373
  };
301
374
  }
302
375
  catch (error) {
303
376
  const msg = error instanceof Error ? error.message : String(error);
304
- log.error(` Failed to download audio: ${msg}`);
377
+ log.error(` Failed to download audio: ${msg}`);
305
378
  return {
306
379
  success: false,
307
380
  error: msg,
@@ -311,20 +384,4 @@ export class AudioManager {
311
384
  await this.closePage();
312
385
  }
313
386
  }
314
- /**
315
- * Close the page if open
316
- */
317
- async closePage() {
318
- if (this.page) {
319
- try {
320
- await this.page.close();
321
- }
322
- catch (err) {
323
- log.debug(`audio-manager: closing page: ${err instanceof Error ? err.message : String(err)}`);
324
- // Ignore close errors
325
- }
326
- this.page = null;
327
- }
328
- }
329
387
  }
330
- //# sourceMappingURL=audio-manager.js.map
@@ -25,4 +25,3 @@ export interface BrowserOptions {
25
25
  * Apply browser options to CONFIG (returns modified copy, doesn't mutate global CONFIG).
26
26
  */
27
27
  export declare function applyBrowserOptions(options?: BrowserOptions, legacyShowBrowser?: boolean): Config;
28
- //# sourceMappingURL=browser-options.d.ts.map
@@ -72,4 +72,3 @@ export function applyBrowserOptions(options, legacyShowBrowser) {
72
72
  }
73
73
  return config;
74
74
  }
75
- //# sourceMappingURL=browser-options.js.map
@@ -14,8 +14,7 @@
14
14
  * - Artifact title during generation: "Generating data table…"
15
15
  * - Chat-embedded tables use standard <table><tr><th>/<td> (no <tbody>)
16
16
  */
17
- import { AuthManager } from "../auth/auth-manager.js";
18
- import { SharedContextManager } from "../session/shared-context-manager.js";
17
+ import { StudioManagerBase } from "./studio-manager-base.js";
19
18
  export interface DataTable {
20
19
  headers: string[];
21
20
  rows: string[][];
@@ -36,15 +35,8 @@ export interface GetDataTableResult {
36
35
  table?: DataTable;
37
36
  error?: string;
38
37
  }
39
- export declare class DataTableManager {
40
- private authManager;
41
- private contextManager;
42
- private page;
43
- constructor(authManager: AuthManager, contextManager: SharedContextManager);
44
- /**
45
- * Navigate to a notebook and ensure we're on the right page
46
- */
47
- private navigateToNotebook;
38
+ export declare class DataTableManager extends StudioManagerBase {
39
+ protected readonly logName = "data-table-manager";
48
40
  /**
49
41
  * Ensure the Studio panel is visible (expand if collapsed).
50
42
  *
@@ -88,8 +80,10 @@ export declare class DataTableManager {
88
80
  */
89
81
  private extractTableData;
90
82
  /**
91
- * Close the page if open
83
+ * Sanitize extracted table content through the shared response validator.
84
+ * Each cell originates from untrusted document sources, so any prompt
85
+ * injection / malicious content is redacted before the table is returned
86
+ * to the calling model.
92
87
  */
93
- private closePage;
88
+ private sanitizeTable;
94
89
  }
95
- //# sourceMappingURL=data-table-manager.d.ts.map