@pan-sec/notebooklm-mcp 2026.3.3 → 2026.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) 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 +0 -1
  78. package/dist/notebook-creation/audio-manager.js +111 -20
  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 +7 -1
  82. package/dist/notebook-creation/data-table-manager.js +59 -3
  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.d.ts +29 -2
  98. package/dist/notebook-creation/source-manager.js +0 -0
  99. package/dist/notebook-creation/types.d.ts +0 -1
  100. package/dist/notebook-creation/types.js +0 -1
  101. package/dist/notebook-creation/video-manager.d.ts +0 -1
  102. package/dist/notebook-creation/video-manager.js +91 -15
  103. package/dist/observability/metrics.d.ts +0 -1
  104. package/dist/observability/metrics.js +0 -1
  105. package/dist/quota/index.d.ts +0 -1
  106. package/dist/quota/index.js +0 -1
  107. package/dist/quota/quota-manager.d.ts +59 -4
  108. package/dist/quota/quota-manager.js +195 -46
  109. package/dist/resources/resource-handlers.d.ts +0 -1
  110. package/dist/resources/resource-handlers.js +33 -3
  111. package/dist/session/browser-session.d.ts +0 -1
  112. package/dist/session/browser-session.js +0 -1
  113. package/dist/session/session-manager.d.ts +0 -1
  114. package/dist/session/session-manager.js +0 -1
  115. package/dist/session/session-timeout.d.ts +0 -1
  116. package/dist/session/session-timeout.js +0 -1
  117. package/dist/session/shared-context-manager.d.ts +0 -1
  118. package/dist/session/shared-context-manager.js +0 -1
  119. package/dist/tools/annotations.d.ts +0 -1
  120. package/dist/tools/annotations.js +0 -1
  121. package/dist/tools/definitions/ask-question.d.ts +6 -3
  122. package/dist/tools/definitions/ask-question.js +12 -8
  123. package/dist/tools/definitions/chat-history.d.ts +0 -1
  124. package/dist/tools/definitions/chat-history.js +1 -1
  125. package/dist/tools/definitions/data-tables.d.ts +0 -1
  126. package/dist/tools/definitions/data-tables.js +4 -1
  127. package/dist/tools/definitions/gemini.d.ts +0 -1
  128. package/dist/tools/definitions/gemini.js +14 -7
  129. package/dist/tools/definitions/notebook-management.d.ts +0 -1
  130. package/dist/tools/definitions/notebook-management.js +7 -2
  131. package/dist/tools/definitions/query-history.d.ts +0 -1
  132. package/dist/tools/definitions/query-history.js +0 -1
  133. package/dist/tools/definitions/session-management.d.ts +0 -1
  134. package/dist/tools/definitions/session-management.js +0 -1
  135. package/dist/tools/definitions/system.d.ts +0 -1
  136. package/dist/tools/definitions/system.js +32 -12
  137. package/dist/tools/definitions/video.d.ts +0 -1
  138. package/dist/tools/definitions/video.js +6 -3
  139. package/dist/tools/definitions.d.ts +0 -1
  140. package/dist/tools/definitions.js +0 -1
  141. package/dist/tools/handlers/ask-question.d.ts +0 -1
  142. package/dist/tools/handlers/ask-question.js +47 -18
  143. package/dist/tools/handlers/audio-video.d.ts +0 -1
  144. package/dist/tools/handlers/audio-video.js +0 -1
  145. package/dist/tools/handlers/auth.d.ts +0 -1
  146. package/dist/tools/handlers/auth.js +0 -1
  147. package/dist/tools/handlers/error-utils.d.ts +0 -1
  148. package/dist/tools/handlers/error-utils.js +0 -1
  149. package/dist/tools/handlers/gemini.d.ts +0 -1
  150. package/dist/tools/handlers/gemini.js +0 -1
  151. package/dist/tools/handlers/index.d.ts +0 -1
  152. package/dist/tools/handlers/index.js +0 -1
  153. package/dist/tools/handlers/notebook-creation.d.ts +0 -1
  154. package/dist/tools/handlers/notebook-creation.js +16 -1
  155. package/dist/tools/handlers/notebook-management.d.ts +0 -1
  156. package/dist/tools/handlers/notebook-management.js +7 -2
  157. package/dist/tools/handlers/session-management.d.ts +0 -1
  158. package/dist/tools/handlers/session-management.js +0 -1
  159. package/dist/tools/handlers/system.d.ts +0 -1
  160. package/dist/tools/handlers/system.js +0 -1
  161. package/dist/tools/handlers/types.d.ts +0 -1
  162. package/dist/tools/handlers/types.js +0 -1
  163. package/dist/tools/handlers/webhooks.d.ts +0 -1
  164. package/dist/tools/handlers/webhooks.js +0 -1
  165. package/dist/tools/icons.d.ts +0 -1
  166. package/dist/tools/icons.js +0 -1
  167. package/dist/tools/index.d.ts +0 -1
  168. package/dist/tools/index.js +0 -1
  169. package/dist/types.d.ts +0 -1
  170. package/dist/types.js +0 -1
  171. package/dist/utils/audit-logger.d.ts +11 -1
  172. package/dist/utils/audit-logger.js +189 -21
  173. package/dist/utils/cleanup-manager.d.ts +0 -1
  174. package/dist/utils/cleanup-manager.js +0 -1
  175. package/dist/utils/cli-handler.d.ts +0 -1
  176. package/dist/utils/cli-handler.js +0 -1
  177. package/dist/utils/crypto.d.ts +18 -9
  178. package/dist/utils/crypto.js +93 -28
  179. package/dist/utils/file-lock.d.ts +15 -1
  180. package/dist/utils/file-lock.js +67 -59
  181. package/dist/utils/file-permissions.d.ts +0 -1
  182. package/dist/utils/file-permissions.js +35 -7
  183. package/dist/utils/logger.d.ts +0 -1
  184. package/dist/utils/logger.js +0 -1
  185. package/dist/utils/page-utils.d.ts +0 -1
  186. package/dist/utils/page-utils.js +32 -28
  187. package/dist/utils/response-validator.d.ts +0 -1
  188. package/dist/utils/response-validator.js +18 -15
  189. package/dist/utils/secrets-scanner.d.ts +0 -1
  190. package/dist/utils/secrets-scanner.js +32 -7
  191. package/dist/utils/secure-memory.d.ts +34 -16
  192. package/dist/utils/secure-memory.js +40 -25
  193. package/dist/utils/security.d.ts +0 -1
  194. package/dist/utils/security.js +66 -39
  195. package/dist/utils/settings-manager.d.ts +9 -1
  196. package/dist/utils/settings-manager.js +45 -2
  197. package/dist/utils/stealth-utils.d.ts +0 -1
  198. package/dist/utils/stealth-utils.js +11 -9
  199. package/dist/webhooks/index.d.ts +0 -1
  200. package/dist/webhooks/index.js +0 -1
  201. package/dist/webhooks/types.d.ts +0 -1
  202. package/dist/webhooks/types.js +0 -1
  203. package/dist/webhooks/webhook-dispatcher.d.ts +0 -1
  204. package/dist/webhooks/webhook-dispatcher.js +0 -1
  205. package/package.json +5 -4
  206. package/dist/auth/auth-manager.d.ts.map +0 -1
  207. package/dist/auth/auth-manager.js.map +0 -1
  208. package/dist/auth/mcp-auth.d.ts.map +0 -1
  209. package/dist/auth/mcp-auth.js.map +0 -1
  210. package/dist/compliance/alert-manager.d.ts.map +0 -1
  211. package/dist/compliance/alert-manager.js.map +0 -1
  212. package/dist/compliance/breach-detection.d.ts.map +0 -1
  213. package/dist/compliance/breach-detection.js.map +0 -1
  214. package/dist/compliance/change-log.d.ts.map +0 -1
  215. package/dist/compliance/change-log.js.map +0 -1
  216. package/dist/compliance/compliance-logger.d.ts.map +0 -1
  217. package/dist/compliance/compliance-logger.js.map +0 -1
  218. package/dist/compliance/compliance-tools.d.ts.map +0 -1
  219. package/dist/compliance/compliance-tools.js.map +0 -1
  220. package/dist/compliance/consent-manager.d.ts.map +0 -1
  221. package/dist/compliance/consent-manager.js.map +0 -1
  222. package/dist/compliance/dashboard.d.ts.map +0 -1
  223. package/dist/compliance/dashboard.js.map +0 -1
  224. package/dist/compliance/data-classification.d.ts.map +0 -1
  225. package/dist/compliance/data-classification.js.map +0 -1
  226. package/dist/compliance/data-erasure.d.ts.map +0 -1
  227. package/dist/compliance/data-erasure.js.map +0 -1
  228. package/dist/compliance/data-export.d.ts.map +0 -1
  229. package/dist/compliance/data-export.js.map +0 -1
  230. package/dist/compliance/data-inventory.d.ts.map +0 -1
  231. package/dist/compliance/data-inventory.js.map +0 -1
  232. package/dist/compliance/dsar-handler.d.ts.map +0 -1
  233. package/dist/compliance/dsar-handler.js.map +0 -1
  234. package/dist/compliance/evidence-collector.d.ts.map +0 -1
  235. package/dist/compliance/evidence-collector.js.map +0 -1
  236. package/dist/compliance/health-monitor.d.ts.map +0 -1
  237. package/dist/compliance/health-monitor.js.map +0 -1
  238. package/dist/compliance/incident-manager.d.ts.map +0 -1
  239. package/dist/compliance/incident-manager.js.map +0 -1
  240. package/dist/compliance/index.d.ts.map +0 -1
  241. package/dist/compliance/index.js.map +0 -1
  242. package/dist/compliance/policy-docs.d.ts.map +0 -1
  243. package/dist/compliance/policy-docs.js.map +0 -1
  244. package/dist/compliance/privacy-notice-text.d.ts.map +0 -1
  245. package/dist/compliance/privacy-notice-text.js.map +0 -1
  246. package/dist/compliance/privacy-notice.d.ts.map +0 -1
  247. package/dist/compliance/privacy-notice.js.map +0 -1
  248. package/dist/compliance/report-generator.d.ts.map +0 -1
  249. package/dist/compliance/report-generator.js.map +0 -1
  250. package/dist/compliance/retention-engine.d.ts.map +0 -1
  251. package/dist/compliance/retention-engine.js.map +0 -1
  252. package/dist/compliance/siem-exporter.d.ts.map +0 -1
  253. package/dist/compliance/siem-exporter.js.map +0 -1
  254. package/dist/compliance/types.d.ts.map +0 -1
  255. package/dist/compliance/types.js.map +0 -1
  256. package/dist/config.d.ts.map +0 -1
  257. package/dist/config.js.map +0 -1
  258. package/dist/errors.d.ts.map +0 -1
  259. package/dist/errors.js.map +0 -1
  260. package/dist/events/event-emitter.d.ts.map +0 -1
  261. package/dist/events/event-emitter.js.map +0 -1
  262. package/dist/events/event-types.d.ts.map +0 -1
  263. package/dist/events/event-types.js.map +0 -1
  264. package/dist/gemini/gemini-client.d.ts.map +0 -1
  265. package/dist/gemini/gemini-client.js.map +0 -1
  266. package/dist/gemini/index.d.ts.map +0 -1
  267. package/dist/gemini/index.js.map +0 -1
  268. package/dist/gemini/pdf-chunker.d.ts.map +0 -1
  269. package/dist/gemini/pdf-chunker.js.map +0 -1
  270. package/dist/gemini/types.d.ts.map +0 -1
  271. package/dist/gemini/types.js.map +0 -1
  272. package/dist/index.d.ts.map +0 -1
  273. package/dist/index.js.map +0 -1
  274. package/dist/library/notebook-library.d.ts.map +0 -1
  275. package/dist/library/notebook-library.js.map +0 -1
  276. package/dist/library/types.d.ts.map +0 -1
  277. package/dist/library/types.js.map +0 -1
  278. package/dist/logging/index.d.ts.map +0 -1
  279. package/dist/logging/index.js.map +0 -1
  280. package/dist/logging/query-logger.d.ts.map +0 -1
  281. package/dist/logging/query-logger.js.map +0 -1
  282. package/dist/notebook-creation/audio-manager.d.ts.map +0 -1
  283. package/dist/notebook-creation/audio-manager.js.map +0 -1
  284. package/dist/notebook-creation/browser-options.d.ts.map +0 -1
  285. package/dist/notebook-creation/browser-options.js.map +0 -1
  286. package/dist/notebook-creation/data-table-manager.d.ts.map +0 -1
  287. package/dist/notebook-creation/data-table-manager.js.map +0 -1
  288. package/dist/notebook-creation/discover-creation-flow.d.ts +0 -2
  289. package/dist/notebook-creation/discover-creation-flow.d.ts.map +0 -1
  290. package/dist/notebook-creation/discover-creation-flow.js +0 -177
  291. package/dist/notebook-creation/discover-creation-flow.js.map +0 -1
  292. package/dist/notebook-creation/discover-quota.d.ts +0 -2
  293. package/dist/notebook-creation/discover-quota.d.ts.map +0 -1
  294. package/dist/notebook-creation/discover-quota.js +0 -194
  295. package/dist/notebook-creation/discover-quota.js.map +0 -1
  296. package/dist/notebook-creation/discover-source-dialog.d.ts +0 -8
  297. package/dist/notebook-creation/discover-source-dialog.d.ts.map +0 -1
  298. package/dist/notebook-creation/discover-source-dialog.js +0 -134
  299. package/dist/notebook-creation/discover-source-dialog.js.map +0 -1
  300. package/dist/notebook-creation/discover-sources.d.ts +0 -8
  301. package/dist/notebook-creation/discover-sources.d.ts.map +0 -1
  302. package/dist/notebook-creation/discover-sources.js +0 -272
  303. package/dist/notebook-creation/discover-sources.js.map +0 -1
  304. package/dist/notebook-creation/discover-text-input.d.ts +0 -7
  305. package/dist/notebook-creation/discover-text-input.d.ts.map +0 -1
  306. package/dist/notebook-creation/discover-text-input.js +0 -135
  307. package/dist/notebook-creation/discover-text-input.js.map +0 -1
  308. package/dist/notebook-creation/dom-scripts.d.ts.map +0 -1
  309. package/dist/notebook-creation/dom-scripts.js.map +0 -1
  310. package/dist/notebook-creation/errors.d.ts.map +0 -1
  311. package/dist/notebook-creation/errors.js.map +0 -1
  312. package/dist/notebook-creation/index.d.ts.map +0 -1
  313. package/dist/notebook-creation/index.js.map +0 -1
  314. package/dist/notebook-creation/notebook-creator.d.ts.map +0 -1
  315. package/dist/notebook-creation/notebook-creator.js.map +0 -1
  316. package/dist/notebook-creation/notebook-nav.d.ts.map +0 -1
  317. package/dist/notebook-creation/notebook-nav.js.map +0 -1
  318. package/dist/notebook-creation/notebook-sync.d.ts.map +0 -1
  319. package/dist/notebook-creation/notebook-sync.js.map +0 -1
  320. package/dist/notebook-creation/run-discovery.d.ts +0 -11
  321. package/dist/notebook-creation/run-discovery.d.ts.map +0 -1
  322. package/dist/notebook-creation/run-discovery.js +0 -151
  323. package/dist/notebook-creation/run-discovery.js.map +0 -1
  324. package/dist/notebook-creation/selector-discovery.d.ts +0 -65
  325. package/dist/notebook-creation/selector-discovery.d.ts.map +0 -1
  326. package/dist/notebook-creation/selector-discovery.js +0 -414
  327. package/dist/notebook-creation/selector-discovery.js.map +0 -1
  328. package/dist/notebook-creation/selectors.d.ts.map +0 -1
  329. package/dist/notebook-creation/selectors.js.map +0 -1
  330. package/dist/notebook-creation/selectors.ts +0 -112
  331. package/dist/notebook-creation/source-manager.d.ts.map +0 -1
  332. package/dist/notebook-creation/source-manager.js.map +0 -1
  333. package/dist/notebook-creation/test-create.d.ts +0 -8
  334. package/dist/notebook-creation/test-create.d.ts.map +0 -1
  335. package/dist/notebook-creation/test-create.js +0 -72
  336. package/dist/notebook-creation/test-create.js.map +0 -1
  337. package/dist/notebook-creation/types.d.ts.map +0 -1
  338. package/dist/notebook-creation/types.js.map +0 -1
  339. package/dist/notebook-creation/video-manager.d.ts.map +0 -1
  340. package/dist/notebook-creation/video-manager.js.map +0 -1
  341. package/dist/observability/metrics.d.ts.map +0 -1
  342. package/dist/observability/metrics.js.map +0 -1
  343. package/dist/quota/index.d.ts.map +0 -1
  344. package/dist/quota/index.js.map +0 -1
  345. package/dist/quota/quota-manager.d.ts.map +0 -1
  346. package/dist/quota/quota-manager.js.map +0 -1
  347. package/dist/resources/resource-handlers.d.ts.map +0 -1
  348. package/dist/resources/resource-handlers.js.map +0 -1
  349. package/dist/session/browser-session.d.ts.map +0 -1
  350. package/dist/session/browser-session.js.map +0 -1
  351. package/dist/session/session-manager.d.ts.map +0 -1
  352. package/dist/session/session-manager.js.map +0 -1
  353. package/dist/session/session-timeout.d.ts.map +0 -1
  354. package/dist/session/session-timeout.js.map +0 -1
  355. package/dist/session/shared-context-manager.d.ts.map +0 -1
  356. package/dist/session/shared-context-manager.js.map +0 -1
  357. package/dist/tools/annotations.d.ts.map +0 -1
  358. package/dist/tools/annotations.js.map +0 -1
  359. package/dist/tools/definitions/ask-question.d.ts.map +0 -1
  360. package/dist/tools/definitions/ask-question.js.map +0 -1
  361. package/dist/tools/definitions/chat-history.d.ts.map +0 -1
  362. package/dist/tools/definitions/chat-history.js.map +0 -1
  363. package/dist/tools/definitions/data-tables.d.ts.map +0 -1
  364. package/dist/tools/definitions/data-tables.js.map +0 -1
  365. package/dist/tools/definitions/gemini.d.ts.map +0 -1
  366. package/dist/tools/definitions/gemini.js.map +0 -1
  367. package/dist/tools/definitions/notebook-management.d.ts.map +0 -1
  368. package/dist/tools/definitions/notebook-management.js.map +0 -1
  369. package/dist/tools/definitions/query-history.d.ts.map +0 -1
  370. package/dist/tools/definitions/query-history.js.map +0 -1
  371. package/dist/tools/definitions/session-management.d.ts.map +0 -1
  372. package/dist/tools/definitions/session-management.js.map +0 -1
  373. package/dist/tools/definitions/system.d.ts.map +0 -1
  374. package/dist/tools/definitions/system.js.map +0 -1
  375. package/dist/tools/definitions/video.d.ts.map +0 -1
  376. package/dist/tools/definitions/video.js.map +0 -1
  377. package/dist/tools/definitions.d.ts.map +0 -1
  378. package/dist/tools/definitions.js.map +0 -1
  379. package/dist/tools/handlers/ask-question.d.ts.map +0 -1
  380. package/dist/tools/handlers/ask-question.js.map +0 -1
  381. package/dist/tools/handlers/audio-video.d.ts.map +0 -1
  382. package/dist/tools/handlers/audio-video.js.map +0 -1
  383. package/dist/tools/handlers/auth.d.ts.map +0 -1
  384. package/dist/tools/handlers/auth.js.map +0 -1
  385. package/dist/tools/handlers/error-utils.d.ts.map +0 -1
  386. package/dist/tools/handlers/error-utils.js.map +0 -1
  387. package/dist/tools/handlers/gemini.d.ts.map +0 -1
  388. package/dist/tools/handlers/gemini.js.map +0 -1
  389. package/dist/tools/handlers/index.d.ts.map +0 -1
  390. package/dist/tools/handlers/index.js.map +0 -1
  391. package/dist/tools/handlers/notebook-creation.d.ts.map +0 -1
  392. package/dist/tools/handlers/notebook-creation.js.map +0 -1
  393. package/dist/tools/handlers/notebook-management.d.ts.map +0 -1
  394. package/dist/tools/handlers/notebook-management.js.map +0 -1
  395. package/dist/tools/handlers/session-management.d.ts.map +0 -1
  396. package/dist/tools/handlers/session-management.js.map +0 -1
  397. package/dist/tools/handlers/system.d.ts.map +0 -1
  398. package/dist/tools/handlers/system.js.map +0 -1
  399. package/dist/tools/handlers/types.d.ts.map +0 -1
  400. package/dist/tools/handlers/types.js.map +0 -1
  401. package/dist/tools/handlers/webhooks.d.ts.map +0 -1
  402. package/dist/tools/handlers/webhooks.js.map +0 -1
  403. package/dist/tools/handlers.d.ts +0 -666
  404. package/dist/tools/handlers.d.ts.map +0 -1
  405. package/dist/tools/handlers.js +0 -2929
  406. package/dist/tools/handlers.js.map +0 -1
  407. package/dist/tools/icons.d.ts.map +0 -1
  408. package/dist/tools/icons.js.map +0 -1
  409. package/dist/tools/index.d.ts.map +0 -1
  410. package/dist/tools/index.js.map +0 -1
  411. package/dist/types.d.ts.map +0 -1
  412. package/dist/types.js.map +0 -1
  413. package/dist/utils/audit-logger.d.ts.map +0 -1
  414. package/dist/utils/audit-logger.js.map +0 -1
  415. package/dist/utils/cert-pinning.d.ts +0 -97
  416. package/dist/utils/cert-pinning.d.ts.map +0 -1
  417. package/dist/utils/cert-pinning.js +0 -328
  418. package/dist/utils/cert-pinning.js.map +0 -1
  419. package/dist/utils/cleanup-manager.d.ts.map +0 -1
  420. package/dist/utils/cleanup-manager.js.map +0 -1
  421. package/dist/utils/cli-handler.d.ts.map +0 -1
  422. package/dist/utils/cli-handler.js.map +0 -1
  423. package/dist/utils/crypto.d.ts.map +0 -1
  424. package/dist/utils/crypto.js.map +0 -1
  425. package/dist/utils/file-lock.d.ts.map +0 -1
  426. package/dist/utils/file-lock.js.map +0 -1
  427. package/dist/utils/file-permissions.d.ts.map +0 -1
  428. package/dist/utils/file-permissions.js.map +0 -1
  429. package/dist/utils/logger.d.ts.map +0 -1
  430. package/dist/utils/logger.js.map +0 -1
  431. package/dist/utils/page-utils.d.ts.map +0 -1
  432. package/dist/utils/page-utils.js.map +0 -1
  433. package/dist/utils/response-validator.d.ts.map +0 -1
  434. package/dist/utils/response-validator.js.map +0 -1
  435. package/dist/utils/secrets-scanner.d.ts.map +0 -1
  436. package/dist/utils/secrets-scanner.js.map +0 -1
  437. package/dist/utils/secure-memory.d.ts.map +0 -1
  438. package/dist/utils/secure-memory.js.map +0 -1
  439. package/dist/utils/security.d.ts.map +0 -1
  440. package/dist/utils/security.js.map +0 -1
  441. package/dist/utils/settings-manager.d.ts.map +0 -1
  442. package/dist/utils/settings-manager.js.map +0 -1
  443. package/dist/utils/stealth-utils.d.ts.map +0 -1
  444. package/dist/utils/stealth-utils.js.map +0 -1
  445. package/dist/utils/tool-validation.d.ts +0 -93
  446. package/dist/utils/tool-validation.d.ts.map +0 -1
  447. package/dist/utils/tool-validation.js +0 -277
  448. package/dist/utils/tool-validation.js.map +0 -1
  449. package/dist/webhooks/index.d.ts.map +0 -1
  450. package/dist/webhooks/index.js.map +0 -1
  451. package/dist/webhooks/types.d.ts.map +0 -1
  452. package/dist/webhooks/types.js.map +0 -1
  453. package/dist/webhooks/webhook-dispatcher.d.ts.map +0 -1
  454. package/dist/webhooks/webhook-dispatcher.js.map +0 -1
  455. package/docs/COMPLIANCE-SPEC.md +0 -1452
  456. package/docs/MCP-DIRECTORY-LISTINGS.md +0 -91
  457. package/docs/SECURITY-FORK-OPPORTUNITIES.md +0 -79
  458. package/docs/SECURITY_IMPLEMENTATION_PLAN.md +0 -437
  459. package/docs/archive/ISSUES-legacy-2026-04-24.md +0 -644
  460. package/docs/configuration.md +0 -94
  461. package/docs/dependency-risk.md +0 -25
  462. package/docs/improvement-sprint-2026.2.10.md +0 -210
  463. package/docs/testing-runbook.md +0 -166
  464. package/docs/tools.md +0 -34
  465. package/docs/troubleshooting.md +0 -59
  466. package/docs/usage-guide.md +0 -246
@@ -112,23 +112,26 @@ const PROMPT_INJECTION_PATTERNS = [
112
112
  /**
113
113
  * Suspicious URL patterns
114
114
  */
115
+ // Precompiled with the global flag so detectSuspiciousUrls can call matchAll
116
+ // directly without re-allocating a RegExp per pattern per call (I-L55).
117
+ // matchAll clones the regex internally, so module-level reuse is state-safe.
115
118
  const SUSPICIOUS_URL_PATTERNS = [
116
119
  // URL shorteners (could hide malicious destinations)
117
- { pattern: /https?:\/\/(bit\.ly|tinyurl\.com|t\.co|goo\.gl|ow\.ly|is\.gd|buff\.ly|adf\.ly|j\.mp)\//i, description: "URL shortener" },
120
+ { pattern: /https?:\/\/(bit\.ly|tinyurl\.com|t\.co|goo\.gl|ow\.ly|is\.gd|buff\.ly|adf\.ly|j\.mp)\//gi, description: "URL shortener" },
118
121
  // Paste/sharing services (data exfiltration)
119
- { pattern: /https?:\/\/(pastebin\.com|hastebin\.com|paste\.ee|ghostbin\.com|dpaste\.org)\//i, description: "Paste service" },
122
+ { pattern: /https?:\/\/(pastebin\.com|hastebin\.com|paste\.ee|ghostbin\.com|dpaste\.org)\//gi, description: "Paste service" },
120
123
  // File sharing (potential malware)
121
- { pattern: /https?:\/\/(anonfiles\.com|mediafire\.com|zippyshare\.com|sendspace\.com)\//i, description: "File sharing service" },
124
+ { pattern: /https?:\/\/(anonfiles\.com|mediafire\.com|zippyshare\.com|sendspace\.com)\//gi, description: "File sharing service" },
122
125
  // Dangerous protocols
123
- { pattern: /javascript:/i, description: "JavaScript protocol" },
124
- { pattern: /\bdata:[a-z]+\/[a-z][\w+-]+/i, description: "Data protocol" },
125
- { pattern: /file:\/\//i, description: "File protocol" },
126
- { pattern: /vbscript:/i, description: "VBScript protocol" },
126
+ { pattern: /javascript:/gi, description: "JavaScript protocol" },
127
+ { pattern: /\bdata:[a-z]+\/[a-z][\w+-]+/gi, description: "Data protocol" },
128
+ { pattern: /file:\/\//gi, description: "File protocol" },
129
+ { pattern: /vbscript:/gi, description: "VBScript protocol" },
127
130
  // IP addresses (potential C2)
128
- { pattern: /https?:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i, description: "Raw IP address URL" },
131
+ { pattern: /https?:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/gi, description: "Raw IP address URL" },
129
132
  // Webhook URLs (data exfiltration)
130
- { pattern: /https?:\/\/[^\/]*webhook/i, description: "Webhook URL" },
131
- { pattern: /https?:\/\/[^\/]*discord(app)?\.com\/api\/webhooks/i, description: "Discord webhook" },
133
+ { pattern: /https?:\/\/[^\/]*webhook/gi, description: "Webhook URL" },
134
+ { pattern: /https?:\/\/[^\/]*discord(app)?\.com\/api\/webhooks/gi, description: "Discord webhook" },
132
135
  ];
133
136
  /**
134
137
  * Encoded payload patterns.
@@ -278,9 +281,8 @@ export class ResponseValidator {
278
281
  detectSuspiciousUrls(text) {
279
282
  const results = [];
280
283
  for (const { pattern, description } of SUSPICIOUS_URL_PATTERNS) {
281
- // Use source to create a new RegExp with global flag for matchAll
282
- const globalPattern = new RegExp(pattern.source, "gi");
283
- const matches = text.matchAll(globalPattern);
284
+ // Reuse the precompiled global pattern; matchAll clones it so no lastIndex leak.
285
+ const matches = text.matchAll(pattern);
284
286
  for (const match of matches) {
285
287
  results.push({
286
288
  pattern,
@@ -304,10 +306,12 @@ export class ResponseValidator {
304
306
  continue;
305
307
  if (minEntropy !== undefined && shannonEntropy(matchStr) < minEntropy)
306
308
  continue;
309
+ // Carry the FULL match so validate()'s replaceAll can actually redact it
310
+ // when blockEncodedPayloads is enabled (truncating broke redaction) (I-L57).
307
311
  results.push({
308
312
  pattern,
309
313
  description,
310
- match: matchStr.substring(0, 50) + (matchStr.length > 50 ? "..." : ""),
314
+ match: matchStr,
311
315
  });
312
316
  }
313
317
  }
@@ -356,4 +360,3 @@ export function getResponseValidator() {
356
360
  export async function validateResponse(response) {
357
361
  return getResponseValidator().validate(response);
358
362
  }
359
- //# sourceMappingURL=response-validator.js.map
@@ -134,4 +134,3 @@ export declare function scanAndRedactSecrets(text: string): Promise<{
134
134
  blocked: boolean;
135
135
  }>;
136
136
  export {};
137
- //# sourceMappingURL=secrets-scanner.d.ts.map
@@ -35,6 +35,28 @@ export function shannonEntropy(s) {
35
35
  }
36
36
  return h;
37
37
  }
38
+ /**
39
+ * Resolve 1-based line/column for a byte index using a sorted array of newline
40
+ * offsets. `line` = number of newlines before index + 1; `column` = distance
41
+ * from the start of that line + 1. Matches the previous substring/split semantics.
42
+ */
43
+ function lineColForIndex(newlineOffsets, index) {
44
+ // Binary search for the count of newline offsets strictly less than `index`.
45
+ let lo = 0;
46
+ let hi = newlineOffsets.length;
47
+ while (lo < hi) {
48
+ const mid = (lo + hi) >>> 1;
49
+ if (newlineOffsets[mid] < index) {
50
+ lo = mid + 1;
51
+ }
52
+ else {
53
+ hi = mid;
54
+ }
55
+ }
56
+ // lo = number of newlines before index → line is lo + 1.
57
+ const lastNewlineBefore = lo > 0 ? newlineOffsets[lo - 1] : -1;
58
+ return { line: lo + 1, column: index - lastNewlineBefore };
59
+ }
38
60
  /**
39
61
  * Secret detection patterns
40
62
  * Based on TruffleHog, GitLeaks, and custom patterns
@@ -241,7 +263,7 @@ const SECRET_PATTERNS = [
241
263
  // Email with password context
242
264
  {
243
265
  name: "Email with Password",
244
- pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b.*(?:password|pwd|passwd)/gi,
266
+ pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b.*(?:password|pwd|passwd)/gi,
245
267
  severity: "medium",
246
268
  description: "Email address in password context",
247
269
  },
@@ -302,6 +324,12 @@ export class SecretsScanner {
302
324
  this.stats.scanned++;
303
325
  const matches = [];
304
326
  const minSeverityLevel = SEVERITY_ORDER[this.config.minSeverity];
327
+ // Precompute newline offsets once so per-match line/column lookup is O(log n)
328
+ // instead of re-scanning from the string start for every match (I-L54).
329
+ const newlineOffsets = [];
330
+ for (let i = input.indexOf("\n"); i !== -1; i = input.indexOf("\n", i + 1)) {
331
+ newlineOffsets.push(i);
332
+ }
305
333
  for (const pattern of this.patterns) {
306
334
  // Skip if below minimum severity
307
335
  if (SEVERITY_ORDER[pattern.severity] < minSeverityLevel) {
@@ -319,11 +347,9 @@ export class SecretsScanner {
319
347
  if (pattern.ignoreContext?.(input, match)) {
320
348
  continue;
321
349
  }
322
- // Calculate line and column
323
- const beforeMatch = input.substring(0, match.index);
324
- const lines = beforeMatch.split("\n");
325
- const line = lines.length;
326
- const column = lines[lines.length - 1].length + 1;
350
+ // Calculate line and column via binary search over precomputed newline
351
+ // offsets equivalent to counting "\n" before match.index but O(log n).
352
+ const { line, column } = lineColForIndex(newlineOffsets, match.index);
327
353
  // Generate redacted version
328
354
  const redacted = pattern.redactFn
329
355
  ? pattern.redactFn(matchedText)
@@ -488,4 +514,3 @@ export function scanForSecrets(text) {
488
514
  export async function scanAndRedactSecrets(text) {
489
515
  return getSecretsScanner().scanAndRedact(text);
490
516
  }
491
- //# sourceMappingURL=secrets-scanner.js.map
@@ -1,15 +1,21 @@
1
1
  /**
2
2
  * Secure Memory Utilities for NotebookLM MCP Server
3
3
  *
4
- * Provides secure handling of sensitive data in memory:
5
- * - Zero-fill buffers and strings after use
6
- * - Secure string class that auto-wipes
7
- * - Memory-safe credential handling
4
+ * Provides best-effort handling of sensitive data in memory:
5
+ * - Zero-fill backing Buffers after use
6
+ * - Secure string class that wipes its backing Buffer
7
+ * - Time-bounded credential handling
8
8
  *
9
- * Why this matters:
10
- * - Prevents memory dump attacks
11
- * - Reduces credential exposure window
12
- * - Mitigates cold boot attacks
9
+ * Why this matters — and its limits:
10
+ * - REDUCES the exposure window for credentials in memory; it does not
11
+ * eliminate it.
12
+ * - This is mitigation, NOT prevention, of memory-dump or cold-boot attacks.
13
+ * We cannot guarantee secrets are gone from RAM after wipe().
14
+ * - V8 caveat: JavaScript strings are immutable. The input string passed in,
15
+ * and every value produced by toString() / getValue(), are independent V8
16
+ * string copies on the heap that this code CANNOT wipe and that persist
17
+ * until garbage collection (and possibly beyond, in freed-but-unzeroed
18
+ * memory). Only the internal Buffer is zeroed by wipe().
13
19
  *
14
20
  * Added by Pantheon Security for hardened fork.
15
21
  */
@@ -34,7 +40,10 @@ export declare class SecureString {
34
40
  private wiped;
35
41
  constructor(value: string);
36
42
  /**
37
- * Get the string value (creates new string each time)
43
+ * Get the string value.
44
+ * Note: returns a new immutable V8 string copy that cannot be wiped and
45
+ * persists until garbage collection. Avoid retaining the result longer
46
+ * than necessary.
38
47
  */
39
48
  toString(): string;
40
49
  /**
@@ -46,7 +55,9 @@ export declare class SecureString {
46
55
  */
47
56
  get length(): number;
48
57
  /**
49
- * Securely wipe the string from memory
58
+ * Wipe the backing Buffer (best effort).
59
+ * Only zeroes the internal Buffer; any string copies previously returned
60
+ * by toString() / the constructor input remain in the V8 heap until GC.
50
61
  */
51
62
  wipe(): void;
52
63
  /**
@@ -64,7 +75,9 @@ export declare class SecureCredential {
64
75
  private autoWipeTimer?;
65
76
  constructor(credential: string, maxAgeMs?: number);
66
77
  /**
67
- * Get the credential value
78
+ * Get the credential value.
79
+ * Note: returns an immutable V8 string copy that cannot be wiped and
80
+ * persists until garbage collection.
68
81
  */
69
82
  getValue(): string;
70
83
  /**
@@ -91,10 +104,16 @@ export declare function withSecureCredential<T>(credential: string, fn: (cred: S
91
104
  /**
92
105
  * Secure comparison to prevent timing attacks.
93
106
  *
94
- * Both buffers are copied into a fixed-size canonical buffer before comparison
95
- * so that timingSafeEqual always runs on the same number of bytes regardless
96
- * of input length. This prevents the previous implementation from leaking which
97
- * operand is shorter via the length passed to timingSafeEqual.
107
+ * Both operands are hashed (SHA-256) into a fixed-length digest before the
108
+ * constant-time comparison. This:
109
+ * - makes timingSafeEqual always run on the same number of bytes regardless of
110
+ * input length, leaking nothing about the actual lengths, and
111
+ * - compares the FULL content of each operand (L5): the previous version
112
+ * truncated both inputs to 64 bytes, so two distinct values sharing their
113
+ * first 64 bytes would compare equal. Hashing covers the entire input.
114
+ *
115
+ * The trailing length check is kept as defence-in-depth; SHA-256 already
116
+ * distinguishes different-length inputs.
98
117
  */
99
118
  export declare function secureCompare(a: string | Buffer, b: string | Buffer): boolean;
100
119
  /**
@@ -105,4 +124,3 @@ export declare function secureRandomString(length: number, encoding?: BufferEnco
105
124
  * Mask sensitive data for logging (doesn't expose real length)
106
125
  */
107
126
  export declare function maskSensitive(value: string, showChars?: number): string;
108
- //# sourceMappingURL=secure-memory.d.ts.map
@@ -1,15 +1,21 @@
1
1
  /**
2
2
  * Secure Memory Utilities for NotebookLM MCP Server
3
3
  *
4
- * Provides secure handling of sensitive data in memory:
5
- * - Zero-fill buffers and strings after use
6
- * - Secure string class that auto-wipes
7
- * - Memory-safe credential handling
4
+ * Provides best-effort handling of sensitive data in memory:
5
+ * - Zero-fill backing Buffers after use
6
+ * - Secure string class that wipes its backing Buffer
7
+ * - Time-bounded credential handling
8
8
  *
9
- * Why this matters:
10
- * - Prevents memory dump attacks
11
- * - Reduces credential exposure window
12
- * - Mitigates cold boot attacks
9
+ * Why this matters — and its limits:
10
+ * - REDUCES the exposure window for credentials in memory; it does not
11
+ * eliminate it.
12
+ * - This is mitigation, NOT prevention, of memory-dump or cold-boot attacks.
13
+ * We cannot guarantee secrets are gone from RAM after wipe().
14
+ * - V8 caveat: JavaScript strings are immutable. The input string passed in,
15
+ * and every value produced by toString() / getValue(), are independent V8
16
+ * string copies on the heap that this code CANNOT wipe and that persist
17
+ * until garbage collection (and possibly beyond, in freed-but-unzeroed
18
+ * memory). Only the internal Buffer is zeroed by wipe().
13
19
  *
14
20
  * Added by Pantheon Security for hardened fork.
15
21
  */
@@ -48,7 +54,10 @@ export class SecureString {
48
54
  this.buffer = Buffer.from(value, "utf-8");
49
55
  }
50
56
  /**
51
- * Get the string value (creates new string each time)
57
+ * Get the string value.
58
+ * Note: returns a new immutable V8 string copy that cannot be wiped and
59
+ * persists until garbage collection. Avoid retaining the result longer
60
+ * than necessary.
52
61
  */
53
62
  toString() {
54
63
  if (this.wiped) {
@@ -72,7 +81,9 @@ export class SecureString {
72
81
  return this.wiped ? 0 : this.buffer.length;
73
82
  }
74
83
  /**
75
- * Securely wipe the string from memory
84
+ * Wipe the backing Buffer (best effort).
85
+ * Only zeroes the internal Buffer; any string copies previously returned
86
+ * by toString() / the constructor input remain in the V8 heap until GC.
76
87
  */
77
88
  wipe() {
78
89
  if (!this.wiped) {
@@ -106,7 +117,9 @@ export class SecureCredential {
106
117
  this.autoWipeTimer.unref();
107
118
  }
108
119
  /**
109
- * Get the credential value
120
+ * Get the credential value.
121
+ * Note: returns an immutable V8 string copy that cannot be wiped and
122
+ * persists until garbage collection.
110
123
  */
111
124
  getValue() {
112
125
  if (this.isExpired()) {
@@ -157,26 +170,29 @@ export async function withSecureCredential(credential, fn) {
157
170
  secureCred.wipe();
158
171
  }
159
172
  }
160
- // Canonical comparison length: hex-encoded SHA3-256 output (64 chars = 64 bytes UTF-8)
161
- const HASH_COMPARE_LEN = 64;
162
173
  /**
163
174
  * Secure comparison to prevent timing attacks.
164
175
  *
165
- * Both buffers are copied into a fixed-size canonical buffer before comparison
166
- * so that timingSafeEqual always runs on the same number of bytes regardless
167
- * of input length. This prevents the previous implementation from leaking which
168
- * operand is shorter via the length passed to timingSafeEqual.
176
+ * Both operands are hashed (SHA-256) into a fixed-length digest before the
177
+ * constant-time comparison. This:
178
+ * - makes timingSafeEqual always run on the same number of bytes regardless of
179
+ * input length, leaking nothing about the actual lengths, and
180
+ * - compares the FULL content of each operand (L5): the previous version
181
+ * truncated both inputs to 64 bytes, so two distinct values sharing their
182
+ * first 64 bytes would compare equal. Hashing covers the entire input.
183
+ *
184
+ * The trailing length check is kept as defence-in-depth; SHA-256 already
185
+ * distinguishes different-length inputs.
169
186
  */
170
187
  export function secureCompare(a, b) {
171
188
  const bufA = typeof a === "string" ? Buffer.from(a) : a;
172
189
  const bufB = typeof b === "string" ? Buffer.from(b) : b;
173
- // Always compare HASH_COMPARE_LEN bytes leaks nothing about actual lengths
174
- const padA = Buffer.alloc(HASH_COMPARE_LEN);
175
- const padB = Buffer.alloc(HASH_COMPARE_LEN);
176
- bufA.copy(padA, 0, 0, Math.min(bufA.length, HASH_COMPARE_LEN));
177
- bufB.copy(padB, 0, 0, Math.min(bufB.length, HASH_COMPARE_LEN));
178
- // timingSafeEqual runs first (constant time), length check evaluated after
179
- const contentEqual = crypto.timingSafeEqual(padA, padB);
190
+ // Hash the full content of each operand to a fixed 32-byte digest, so
191
+ // timingSafeEqual always sees equal-length buffers and no input is truncated.
192
+ const digestA = crypto.createHash("sha256").update(bufA).digest();
193
+ const digestB = crypto.createHash("sha256").update(bufB).digest();
194
+ // timingSafeEqual runs first (constant time), length check evaluated after.
195
+ const contentEqual = crypto.timingSafeEqual(digestA, digestB);
180
196
  return contentEqual && bufA.length === bufB.length;
181
197
  }
182
198
  /**
@@ -195,4 +211,3 @@ export function maskSensitive(value, showChars = 4) {
195
211
  }
196
212
  return value.slice(0, showChars) + "****";
197
213
  }
198
- //# sourceMappingURL=secure-memory.js.map
@@ -86,4 +86,3 @@ export declare function checkSecurityContext(): {
86
86
  secure: boolean;
87
87
  warnings: string[];
88
88
  };
89
- //# sourceMappingURL=security.d.ts.map
@@ -34,28 +34,29 @@ const ALLOWED_NOTEBOOK_DOMAINS = [
34
34
  // Auth domains (reserved for future use)
35
35
  // const ALLOWED_AUTH_DOMAINS = ['accounts.google.com'];
36
36
  /**
37
- * Validate and sanitize a NotebookLM URL
38
- * Prevents URL injection, javascript: URLs, and other attacks
37
+ * Shared validation for HTTPS URLs: trims, rejects empty/dangerous-protocol/unparseable
38
+ * inputs, and enforces HTTPS. Returns the parsed URL for caller-specific checks.
39
39
  *
40
- * @param url - The URL to validate
41
- * @returns Validated URL or throws error
40
+ * @param url - The raw URL string
41
+ * @param errors - Caller-specific error messages so each public function keeps its distinct wording
42
+ * @returns Parsed URL object (HTTPS, non-dangerous)
42
43
  */
43
- export function validateNotebookUrl(url) {
44
+ function parseHttpsUrl(url, errors) {
44
45
  if (!url || typeof url !== 'string') {
45
- throw new SecurityError('URL is required and must be a string');
46
+ throw new SecurityError(errors.notString);
46
47
  }
47
48
  // Trim whitespace
48
49
  const trimmed = url.trim();
49
50
  // Block empty URLs
50
51
  if (trimmed.length === 0) {
51
- throw new SecurityError('URL cannot be empty');
52
+ throw new SecurityError(errors.empty);
52
53
  }
53
54
  // Block dangerous protocols
54
55
  const lowerUrl = trimmed.toLowerCase();
55
56
  const dangerousProtocols = ['javascript:', 'data:', 'vbscript:', 'file:', 'about:'];
56
57
  for (const protocol of dangerousProtocols) {
57
58
  if (lowerUrl.startsWith(protocol)) {
58
- throw new SecurityError(`Dangerous protocol not allowed: ${protocol}`);
59
+ throw new SecurityError(errors.dangerousProtocol(protocol));
59
60
  }
60
61
  }
61
62
  // Parse URL
@@ -64,13 +65,49 @@ export function validateNotebookUrl(url) {
64
65
  parsed = new URL(trimmed);
65
66
  }
66
67
  catch (err) {
67
- log.debug(`security: parsing URL in validateNotebookUrl: ${err instanceof Error ? err.message : String(err)}`);
68
- throw new SecurityError('Invalid URL format');
68
+ log.debug(`security: parsing URL: ${err instanceof Error ? err.message : String(err)}`);
69
+ throw new SecurityError(errors.invalidFormat);
69
70
  }
70
71
  // Enforce HTTPS
71
72
  if (parsed.protocol !== 'https:') {
72
- throw new SecurityError('Only HTTPS URLs are allowed');
73
+ throw new SecurityError(errors.notHttps);
74
+ }
75
+ return parsed;
76
+ }
77
+ /**
78
+ * Returns true if the hostname targets an obvious internal/loopback/link-local
79
+ * destination. Defense-in-depth against SSRF; intentionally conservative so that
80
+ * arbitrary public source URLs are not blocked.
81
+ */
82
+ function isInternalHost(hostname) {
83
+ // Strip IPv6 brackets (URL.hostname keeps them, e.g. "[::1]")
84
+ const host = hostname.toLowerCase().replace(/^\[|\]$/g, '');
85
+ if (host === 'localhost' || host === '::1' || host === '0.0.0.0') {
86
+ return true;
73
87
  }
88
+ // RFC1918 / loopback / link-local IPv4 ranges (anchored to avoid over-restriction)
89
+ return (/^127\./.test(host) || // loopback 127.0.0.0/8
90
+ /^10\./.test(host) || // private 10.0.0.0/8
91
+ /^192\.168\./.test(host) || // private 192.168.0.0/16
92
+ /^169\.254\./.test(host) || // link-local 169.254.0.0/16
93
+ /^172\.(1[6-9]|2[0-9]|3[01])\./.test(host) // private 172.16.0.0/12
94
+ );
95
+ }
96
+ /**
97
+ * Validate and sanitize a NotebookLM URL
98
+ * Prevents URL injection, javascript: URLs, and other attacks
99
+ *
100
+ * @param url - The URL to validate
101
+ * @returns Validated URL or throws error
102
+ */
103
+ export function validateNotebookUrl(url) {
104
+ const parsed = parseHttpsUrl(url, {
105
+ notString: 'URL is required and must be a string',
106
+ empty: 'URL cannot be empty',
107
+ dangerousProtocol: (protocol) => `Dangerous protocol not allowed: ${protocol}`,
108
+ invalidFormat: 'Invalid URL format',
109
+ notHttps: 'Only HTTPS URLs are allowed',
110
+ });
74
111
  // Validate domain
75
112
  const hostname = parsed.hostname.toLowerCase();
76
113
  const isAllowedNotebook = ALLOWED_NOTEBOOK_DOMAINS.some(d => hostname === d || hostname.endsWith('.' + d));
@@ -90,30 +127,18 @@ export function validateNotebookUrl(url) {
90
127
  * Enforces HTTPS and blocks dangerous schemes without restricting domain.
91
128
  */
92
129
  export function validateSourceUrl(url) {
93
- if (!url || typeof url !== 'string') {
94
- throw new SecurityError('Source URL is required and must be a string');
95
- }
96
- const trimmed = url.trim();
97
- if (trimmed.length === 0) {
98
- throw new SecurityError('Source URL cannot be empty');
99
- }
100
- const lowerUrl = trimmed.toLowerCase();
101
- const dangerousProtocols = ['javascript:', 'data:', 'vbscript:', 'file:', 'about:'];
102
- for (const protocol of dangerousProtocols) {
103
- if (lowerUrl.startsWith(protocol)) {
104
- throw new SecurityError(`Dangerous protocol not allowed in source URL: ${protocol}`);
105
- }
106
- }
107
- let parsed;
108
- try {
109
- parsed = new URL(trimmed);
110
- }
111
- catch (err) {
112
- log.debug(`security: parsing source URL in validateSourceUrl: ${err instanceof Error ? err.message : String(err)}`);
113
- throw new SecurityError('Invalid source URL format');
114
- }
115
- if (parsed.protocol !== 'https:') {
116
- throw new SecurityError('Only HTTPS source URLs are allowed');
130
+ const parsed = parseHttpsUrl(url, {
131
+ notString: 'Source URL is required and must be a string',
132
+ empty: 'Source URL cannot be empty',
133
+ dangerousProtocol: (protocol) => `Dangerous protocol not allowed in source URL: ${protocol}`,
134
+ invalidFormat: 'Invalid source URL format',
135
+ notHttps: 'Only HTTPS source URLs are allowed',
136
+ });
137
+ // Defense-in-depth SSRF guard: block obvious internal/loopback targets.
138
+ // The URL is fetched server-side downstream, so this only blocks the clearly
139
+ // internal cases — public hosts of any kind remain allowed.
140
+ if (isInternalHost(parsed.hostname)) {
141
+ throw new SecurityError(`Source URL targets an internal address: ${parsed.hostname}`);
117
142
  }
118
143
  return parsed.href;
119
144
  }
@@ -223,10 +248,13 @@ export function maskEmail(email) {
223
248
  export function validateFilePath(basePath, filePath) {
224
249
  // Resolve to absolute path
225
250
  const resolved = path.resolve(basePath, filePath);
226
- // Ensure it's within the base path
227
- const normalizedBase = path.normalize(basePath);
251
+ // Ensure it's within the base path.
252
+ // Use path.relative to avoid the prefix bug where /x/exports matches /x/exports-evil:
253
+ // an in-base path yields "" (equal) or a relative path that does not start with "..".
254
+ const normalizedBase = path.resolve(basePath);
228
255
  const normalizedResolved = path.normalize(resolved);
229
- if (!normalizedResolved.startsWith(normalizedBase)) {
256
+ const relative = path.relative(normalizedBase, normalizedResolved);
257
+ if (relative.startsWith('..') || path.isAbsolute(relative)) {
230
258
  throw new SecurityError('Path traversal detected: file must be within allowed directory');
231
259
  }
232
260
  return normalizedResolved;
@@ -339,4 +367,3 @@ export function checkSecurityContext() {
339
367
  warnings,
340
368
  };
341
369
  }
342
- //# sourceMappingURL=security.js.map
@@ -19,6 +19,15 @@ export declare class SettingsManager {
19
19
  * Load settings from file, falling back to defaults
20
20
  */
21
21
  private loadSettings;
22
+ /**
23
+ * Sanitize an untrusted customSettings object before it is stored and later
24
+ * spread/merged elsewhere. Strips prototype-pollution vectors
25
+ * ("__proto__"/"constructor"/"prototype"), drops nested objects/arrays
26
+ * (only primitive values are accepted), and bounds the number of keys.
27
+ * Builds the result on a null-prototype object so a poisoned key can never
28
+ * reach Object.prototype.
29
+ */
30
+ private sanitizeCustomSettings;
22
31
  /**
23
32
  * Save current settings to file
24
33
  */
@@ -34,4 +43,3 @@ export declare class SettingsManager {
34
43
  getSettingsPath(): string;
35
44
  getProfiles(): Record<ProfileName, string[]>;
36
45
  }
37
- //# sourceMappingURL=settings-manager.d.ts.map
@@ -13,6 +13,16 @@ const DEFAULT_SETTINGS = {
13
13
  profile: "standard",
14
14
  disabledTools: [],
15
15
  };
16
+ /**
17
+ * Dangerous keys that must never be copied into customSettings, since the
18
+ * object is later spread/merged and could otherwise poison Object.prototype.
19
+ */
20
+ const FORBIDDEN_CUSTOM_KEYS = ["__proto__", "constructor", "prototype"];
21
+ /**
22
+ * Upper bound on the number of own keys accepted in customSettings, to prevent
23
+ * an oversized/abusive settings file from bloating in-memory config.
24
+ */
25
+ const MAX_CUSTOM_SETTINGS_KEYS = 100;
16
26
  const PROFILES = {
17
27
  minimal: [
18
28
  "ask_question",
@@ -104,7 +114,7 @@ export class SettingsManager {
104
114
  validated.disabledTools = parsed.disabledTools.filter((t) => typeof t === "string");
105
115
  }
106
116
  if (parsed.customSettings && typeof parsed.customSettings === "object" && !Array.isArray(parsed.customSettings)) {
107
- validated.customSettings = parsed.customSettings;
117
+ validated.customSettings = this.sanitizeCustomSettings(parsed.customSettings);
108
118
  }
109
119
  return { ...DEFAULT_SETTINGS, ...validated };
110
120
  }
@@ -114,6 +124,40 @@ export class SettingsManager {
114
124
  }
115
125
  return { ...DEFAULT_SETTINGS };
116
126
  }
127
+ /**
128
+ * Sanitize an untrusted customSettings object before it is stored and later
129
+ * spread/merged elsewhere. Strips prototype-pollution vectors
130
+ * ("__proto__"/"constructor"/"prototype"), drops nested objects/arrays
131
+ * (only primitive values are accepted), and bounds the number of keys.
132
+ * Builds the result on a null-prototype object so a poisoned key can never
133
+ * reach Object.prototype.
134
+ */
135
+ sanitizeCustomSettings(raw) {
136
+ const safe = Object.create(null);
137
+ let count = 0;
138
+ for (const key of Object.keys(raw)) {
139
+ // Reject prototype-pollution keys (own keys only via Object.keys).
140
+ if (FORBIDDEN_CUSTOM_KEYS.includes(key)) {
141
+ log.warning(`⚠️ Ignoring forbidden custom setting key: "${key}"`);
142
+ continue;
143
+ }
144
+ if (count >= MAX_CUSTOM_SETTINGS_KEYS) {
145
+ log.warning(`⚠️ customSettings exceeds ${MAX_CUSTOM_SETTINGS_KEYS} keys; extra keys ignored.`);
146
+ break;
147
+ }
148
+ const value = raw[key];
149
+ const valueType = typeof value;
150
+ // Constrain values to primitives to avoid nested injection vectors.
151
+ if (value === null || valueType === "string" || valueType === "number" || valueType === "boolean") {
152
+ safe[key] = value;
153
+ count++;
154
+ }
155
+ else {
156
+ log.warning(`⚠️ Ignoring custom setting "${key}" with unsupported value type: ${valueType}`);
157
+ }
158
+ }
159
+ return safe;
160
+ }
117
161
  /**
118
162
  * Save current settings to file
119
163
  */
@@ -173,4 +217,3 @@ export class SettingsManager {
173
217
  return PROFILES;
174
218
  }
175
219
  }
176
- //# sourceMappingURL=settings-manager.js.map
@@ -132,4 +132,3 @@ declare const _default: {
132
132
  simulateReadingPage: typeof simulateReadingPage;
133
133
  };
134
134
  export default _default;
135
- //# sourceMappingURL=stealth-utils.d.ts.map