@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
@@ -227,13 +227,15 @@ export function getSelectors(key) {
227
227
  const info = NOTEBOOKLM_SELECTORS[key];
228
228
  return [info.primary, ...info.fallbacks].filter(Boolean);
229
229
  }
230
- // I146: warn once at module load for unconfirmed selectors so UI drift is visible
231
- {
230
+ // I146 / L32: surface unconfirmed selectors so UI drift is visible, but as a
231
+ // debug-only message gated behind NLMCP_DEBUG. Previously this ran at import
232
+ // time as a log.warning side effect, producing constant unsuppressable startup
233
+ // noise on every server boot.
234
+ if (process.env.NLMCP_DEBUG) {
232
235
  const unconfirmed = Object.entries(NOTEBOOKLM_SELECTORS)
233
236
  .filter(([, v]) => !v.confirmed)
234
237
  .map(([k]) => k);
235
238
  if (unconfirmed.length > 0) {
236
- log.warning(`⚠️ Unconfirmed selectors in use (run discovery to validate): ${unconfirmed.join(", ")}`);
239
+ log.debug(`Unconfirmed selectors in use (run discovery to validate): ${unconfirmed.join(", ")}`);
237
240
  }
238
241
  }
239
- //# sourceMappingURL=selectors.js.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Source Manager — shared primitives
3
+ *
4
+ * Helpers genuinely shared between the two source managers in
5
+ * `source-manager.ts`:
6
+ * - SourceManager (legacy: list/add/remove on an existing
7
+ * notebook)
8
+ * - NotebookCreationSourceManager (the creation flow)
9
+ *
10
+ * Only logic that is byte-equivalent between the two classes lives here; the
11
+ * managers' distinct flows (source-type selection, submit/insert clicks, error
12
+ * alert handling, waitForSourceProcessing) intentionally differ and stay in
13
+ * place. These helpers are a pure de-duplication and are behavior-preserving.
14
+ */
15
+ import type { Page } from "patchright";
16
+ export type BrowserDomElement = unknown;
17
+ export type BrowserSourceItem = {
18
+ textContent?: string | null;
19
+ className?: string;
20
+ id?: string;
21
+ getAttribute(name: string): string | null;
22
+ querySelector(selector: string): BrowserDomElement | null;
23
+ click(): void;
24
+ };
25
+ export type BrowserVisibleElement = {
26
+ textContent?: string | null;
27
+ className?: string;
28
+ offsetParent?: unknown;
29
+ parentElement?: BrowserVisibleElement | null;
30
+ getAttribute(name: string): string | null;
31
+ click(): void;
32
+ };
33
+ export type BrowserTextVisibleElement = BrowserVisibleElement & {
34
+ className?: string;
35
+ };
36
+ export type BrowserTextAreaCandidate = BrowserVisibleElement & {
37
+ value?: string;
38
+ };
39
+ export type BrowserInnerTextHandle = {
40
+ innerText(): Promise<string>;
41
+ };
42
+ export type BrowserDocumentContext = {
43
+ document: {
44
+ querySelector(selector: string): BrowserDomElement | null;
45
+ querySelectorAll(selector: string): Iterable<BrowserDomElement>;
46
+ };
47
+ window: {
48
+ innerWidth: number;
49
+ };
50
+ };
51
+ /**
52
+ * Find the first `textInput` selector that resolves to a visible textarea which
53
+ * is NOT the "discover sources" / "search the web" / query-box control.
54
+ *
55
+ * This is the exact, equivalent logic that both SourceManager and
56
+ * NotebookCreationSourceManager used (their two private copies differed only in
57
+ * an unused `rejected` field and the debug-log wording — callers read only the
58
+ * boolean match). The three exclusion substrings are kept byte-identical.
59
+ *
60
+ * @param debugLabel preserves each caller's original debug log line verbatim.
61
+ */
62
+ export declare function findValidTextInputSelector(page: Page, debugLabel: string): Promise<string | null>;
63
+ /**
64
+ * Set the text-source content via the direct DOM-value path only.
65
+ * The value is passed as a serialized page.evaluate argument (never
66
+ * string-interpolated). We deliberately do NOT use the OS copy/paste
67
+ * buffer: writing to it leaks/overwrites the host's copied data and, when
68
+ * the relevant browser permission is denied (common in headless), a paste
69
+ * keystroke would inject STALE buffered contents and corrupt the source.
70
+ *
71
+ * This is the byte-identical evaluate block both classes used. The differing
72
+ * focus/click step that precedes it (textArea.focus() in the legacy manager,
73
+ * textarea.click() in the creation manager) stays with each caller.
74
+ */
75
+ export declare function setTextSourceValue(page: Page, selector: string, value: string): Promise<void>;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Source Manager — shared primitives
3
+ *
4
+ * Helpers genuinely shared between the two source managers in
5
+ * `source-manager.ts`:
6
+ * - SourceManager (legacy: list/add/remove on an existing
7
+ * notebook)
8
+ * - NotebookCreationSourceManager (the creation flow)
9
+ *
10
+ * Only logic that is byte-equivalent between the two classes lives here; the
11
+ * managers' distinct flows (source-type selection, submit/insert clicks, error
12
+ * alert handling, waitForSourceProcessing) intentionally differ and stay in
13
+ * place. These helpers are a pure de-duplication and are behavior-preserving.
14
+ */
15
+ import { log } from "../utils/logger.js";
16
+ import { getSelectors } from "./selectors.js";
17
+ /**
18
+ * Find the first `textInput` selector that resolves to a visible textarea which
19
+ * is NOT the "discover sources" / "search the web" / query-box control.
20
+ *
21
+ * This is the exact, equivalent logic that both SourceManager and
22
+ * NotebookCreationSourceManager used (their two private copies differed only in
23
+ * an unused `rejected` field and the debug-log wording — callers read only the
24
+ * boolean match). The three exclusion substrings are kept byte-identical.
25
+ *
26
+ * @param debugLabel preserves each caller's original debug log line verbatim.
27
+ */
28
+ export async function findValidTextInputSelector(page, debugLabel) {
29
+ for (const selector of getSelectors("textInput")) {
30
+ try {
31
+ const state = await page.evaluate((targetSelector) => {
32
+ const browser = globalThis;
33
+ const textarea = browser.document.querySelector(targetSelector);
34
+ if (!textarea || textarea.offsetParent === null) {
35
+ return { matches: false };
36
+ }
37
+ const aria = textarea.getAttribute("aria-label")?.toLowerCase() || "";
38
+ const placeholder = textarea.getAttribute("placeholder")?.toLowerCase() || "";
39
+ const className = textarea.className?.toLowerCase() || "";
40
+ const haystack = `${aria} ${placeholder} ${className}`;
41
+ return {
42
+ matches: !haystack.includes("discover sources") &&
43
+ !haystack.includes("search the web") &&
44
+ !haystack.includes("query-box"),
45
+ };
46
+ }, selector);
47
+ if (state.matches) {
48
+ return selector;
49
+ }
50
+ }
51
+ catch (err) {
52
+ log.debug(`${debugLabel}: ${err instanceof Error ? err.message : String(err)}`);
53
+ }
54
+ }
55
+ return null;
56
+ }
57
+ /**
58
+ * Set the text-source content via the direct DOM-value path only.
59
+ * The value is passed as a serialized page.evaluate argument (never
60
+ * string-interpolated). We deliberately do NOT use the OS copy/paste
61
+ * buffer: writing to it leaks/overwrites the host's copied data and, when
62
+ * the relevant browser permission is denied (common in headless), a paste
63
+ * keystroke would inject STALE buffered contents and corrupt the source.
64
+ *
65
+ * This is the byte-identical evaluate block both classes used. The differing
66
+ * focus/click step that precedes it (textArea.focus() in the legacy manager,
67
+ * textarea.click() in the creation manager) stays with each caller.
68
+ */
69
+ export async function setTextSourceValue(page, selector, value) {
70
+ await page.evaluate(({ selector, value }) => {
71
+ const browser = globalThis;
72
+ const textarea = browser.document.querySelector(selector);
73
+ if (!textarea)
74
+ return false;
75
+ textarea.focus();
76
+ if (typeof textarea.value === "string") {
77
+ textarea.value = value;
78
+ }
79
+ else {
80
+ textarea.textContent = value;
81
+ }
82
+ textarea.dispatchEvent(new browser.Event("input", { bubbles: true }));
83
+ textarea.dispatchEvent(new browser.Event("change", { bubbles: true }));
84
+ return true;
85
+ }, { selector, value });
86
+ }
@@ -32,7 +32,22 @@ export declare class SourceManager {
32
32
  private authManager;
33
33
  private contextManager;
34
34
  private page;
35
+ private opChain;
35
36
  constructor(authManager: AuthManager, contextManager: SharedContextManager);
37
+ /**
38
+ * Serialize a public operation onto the op chain so concurrent invocations do
39
+ * not race on the shared this.page field. Failures of one operation must not
40
+ * poison the chain for the next, so the chain link always resolves.
41
+ */
42
+ private runExclusive;
43
+ /**
44
+ * Derive a STABLE source id from a DOM identity attribute when available,
45
+ * otherwise from a hash of the (title, occurrence) pair. Hashing the title
46
+ * gives an id that denotes the same source across sessions far better than a
47
+ * raw enumeration index, while staying opaque/stable for the removeSource
48
+ * contract. Occurrence disambiguates equal-titled rows within one listing.
49
+ */
50
+ private deriveSourceId;
36
51
  /**
37
52
  * Navigate to a notebook and ensure we're on the right page
38
53
  */
@@ -41,14 +56,17 @@ export declare class SourceManager {
41
56
  * List all sources in a notebook
42
57
  */
43
58
  listSources(notebookUrl: string): Promise<ListSourcesResult>;
59
+ private listSourcesInternal;
44
60
  /**
45
61
  * Add a source to an existing notebook
46
62
  */
47
63
  addSource(notebookUrl: string, source: NotebookSource): Promise<AddSourceResult>;
64
+ private addSourceInternal;
48
65
  /**
49
66
  * Remove a source from a notebook
50
67
  */
51
68
  removeSource(notebookUrl: string, sourceId: string): Promise<RemoveSourceResult>;
69
+ private removeSourceInternal;
52
70
  /**
53
71
  * Internal: Add URL source
54
72
  */
@@ -65,9 +83,19 @@ export declare class SourceManager {
65
83
  */
66
84
  private addFileSourceInternal;
67
85
  /**
68
- * Wait for source processing to complete
86
+ * Wait for source processing to complete.
87
+ *
88
+ * Returns an honest status:
89
+ * - "failed" — an error alert/toast appeared
90
+ * - "ready" — the processing indicator cleared (positive completion)
91
+ * - "processing" — we timed out before any conclusion (do NOT report "ready")
69
92
  */
70
93
  private waitForSourceProcessing;
94
+ /**
95
+ * Detect an error alert/toast for a source. Returns the error text if found,
96
+ * otherwise null. Mirrors NotebookCreationSourceManager.throwIfSourceErrorAlert.
97
+ */
98
+ private detectSourceErrorAlert;
71
99
  /**
72
100
  * Close the page if open
73
101
  */
@@ -96,4 +124,3 @@ export declare class NotebookCreationSourceManager {
96
124
  private waitForSourceProcessing;
97
125
  private throwIfSourceErrorAlert;
98
126
  }
99
- //# sourceMappingURL=source-manager.d.ts.map
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Studio Manager Base
3
+ *
4
+ * Shared page-lifecycle plumbing for the NotebookLM "Studio" managers
5
+ * (audio, video, data table). These managers all open a notebook page,
6
+ * validate authentication, drive a Studio-panel artifact flow, then close
7
+ * the page. The navigation and teardown logic is identical across them and
8
+ * lives here; the artifact-specific flows stay in each subclass.
9
+ *
10
+ * Behavior is preserved exactly:
11
+ * - navigateToNotebook: getOrCreateContext → validateWithRetry (throws
12
+ * "Not authenticated. Run setup_auth first." when false) → newPage →
13
+ * goto(domcontentloaded) → waitForLoadState("networkidle") (errors
14
+ * swallowed) → per-subclass randomDelay → return page.
15
+ * - closePage: close the page, swallowing errors, then null the handle.
16
+ *
17
+ * Per-subclass differences are expressed as protected properties so that no
18
+ * call site needs to thread arguments:
19
+ * - navigateDelay: video & data table use 2000–3000ms, audio uses 1500–2500ms.
20
+ * - logName: the log-prefix used in the swallowed close-error debug line.
21
+ */
22
+ import type { Page } from "patchright";
23
+ import { AuthManager } from "../auth/auth-manager.js";
24
+ import { SharedContextManager } from "../session/shared-context-manager.js";
25
+ /** Opaque DOM element handle used only in `as`-casts inside page.evaluate bodies. */
26
+ export type BrowserDomElement = unknown;
27
+ /** Minimal `document` shape used inside page.evaluate bodies. Common to all managers. */
28
+ export interface BrowserDocumentContext {
29
+ document: {
30
+ querySelector(selector: string): BrowserDomElement | null;
31
+ querySelectorAll(selector: string): Iterable<BrowserDomElement>;
32
+ };
33
+ }
34
+ export declare abstract class StudioManagerBase {
35
+ protected authManager: AuthManager;
36
+ protected contextManager: SharedContextManager;
37
+ protected page: Page | null;
38
+ /**
39
+ * Trailing delay applied after navigation settles. Video & data table use the
40
+ * default (2000–3000ms); audio overrides to 1500–2500ms.
41
+ */
42
+ protected readonly navigateDelay: {
43
+ min: number;
44
+ max: number;
45
+ };
46
+ /** Log prefix used in the swallowed close-error debug line (kept per-manager). */
47
+ protected abstract readonly logName: string;
48
+ constructor(authManager: AuthManager, contextManager: SharedContextManager);
49
+ /**
50
+ * Navigate to a notebook and ensure we're on the right page
51
+ */
52
+ protected navigateToNotebook(notebookUrl: string): Promise<Page>;
53
+ /**
54
+ * Close the page if open
55
+ */
56
+ protected closePage(): Promise<void>;
57
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Studio Manager Base
3
+ *
4
+ * Shared page-lifecycle plumbing for the NotebookLM "Studio" managers
5
+ * (audio, video, data table). These managers all open a notebook page,
6
+ * validate authentication, drive a Studio-panel artifact flow, then close
7
+ * the page. The navigation and teardown logic is identical across them and
8
+ * lives here; the artifact-specific flows stay in each subclass.
9
+ *
10
+ * Behavior is preserved exactly:
11
+ * - navigateToNotebook: getOrCreateContext → validateWithRetry (throws
12
+ * "Not authenticated. Run setup_auth first." when false) → newPage →
13
+ * goto(domcontentloaded) → waitForLoadState("networkidle") (errors
14
+ * swallowed) → per-subclass randomDelay → return page.
15
+ * - closePage: close the page, swallowing errors, then null the handle.
16
+ *
17
+ * Per-subclass differences are expressed as protected properties so that no
18
+ * call site needs to thread arguments:
19
+ * - navigateDelay: video & data table use 2000–3000ms, audio uses 1500–2500ms.
20
+ * - logName: the log-prefix used in the swallowed close-error debug line.
21
+ */
22
+ import { log } from "../utils/logger.js";
23
+ import { randomDelay } from "../utils/stealth-utils.js";
24
+ export class StudioManagerBase {
25
+ authManager;
26
+ contextManager;
27
+ page = null;
28
+ /**
29
+ * Trailing delay applied after navigation settles. Video & data table use the
30
+ * default (2000–3000ms); audio overrides to 1500–2500ms.
31
+ */
32
+ navigateDelay = { min: 2000, max: 3000 };
33
+ constructor(authManager, contextManager) {
34
+ this.authManager = authManager;
35
+ this.contextManager = contextManager;
36
+ }
37
+ /**
38
+ * Navigate to a notebook and ensure we're on the right page
39
+ */
40
+ async navigateToNotebook(notebookUrl) {
41
+ const context = await this.contextManager.getOrCreateContext();
42
+ const isAuth = await this.authManager.validateWithRetry(context);
43
+ if (!isAuth) {
44
+ throw new Error("Not authenticated. Run setup_auth first.");
45
+ }
46
+ this.page = await context.newPage();
47
+ await this.page.goto(notebookUrl, { waitUntil: "domcontentloaded" });
48
+ await this.page.waitForLoadState("networkidle").catch(() => { });
49
+ await randomDelay(this.navigateDelay.min, this.navigateDelay.max);
50
+ return this.page;
51
+ }
52
+ /**
53
+ * Close the page if open
54
+ */
55
+ async closePage() {
56
+ if (this.page) {
57
+ try {
58
+ await this.page.close();
59
+ }
60
+ catch (err) {
61
+ log.debug(`${this.logName}: closing page: ${err instanceof Error ? err.message : String(err)}`);
62
+ // Ignore close errors
63
+ }
64
+ this.page = null;
65
+ }
66
+ }
67
+ }
@@ -174,4 +174,3 @@ export interface DiscoveryResult {
174
174
  /** Any errors encountered */
175
175
  errors: string[];
176
176
  }
177
- //# sourceMappingURL=types.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Types for notebook creation functionality
3
3
  */
4
4
  export {};
5
- //# sourceMappingURL=types.js.map
@@ -14,8 +14,7 @@
14
14
  * - Artifacts appear in .artifact-library-container with .artifact-item-button
15
15
  * - Generating state: .shimmer-blue class + .rotate icon + "Generating" title
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
  /**
20
19
  * Visual styles for video overviews (matches actual NotebookLM UI)
21
20
  */
@@ -34,15 +33,8 @@ export interface GenerateVideoResult {
34
33
  status: VideoStatus;
35
34
  error?: string;
36
35
  }
37
- export declare class VideoManager {
38
- private authManager;
39
- private contextManager;
40
- private page;
41
- constructor(authManager: AuthManager, contextManager: SharedContextManager);
42
- /**
43
- * Navigate to a notebook and ensure we're on the right page
44
- */
45
- private navigateToNotebook;
36
+ export declare class VideoManager extends StudioManagerBase {
37
+ protected readonly logName = "video-manager";
46
38
  /**
47
39
  * Ensure the Studio panel is visible (expand if collapsed).
48
40
  *
@@ -93,9 +85,4 @@ export declare class VideoManager {
93
85
  * Check the current video status for a notebook
94
86
  */
95
87
  getVideoStatus(notebookUrl: string): Promise<VideoStatus>;
96
- /**
97
- * Close the page if open
98
- */
99
- private closePage;
100
88
  }
101
- //# sourceMappingURL=video-manager.d.ts.map
@@ -16,29 +16,32 @@
16
16
  */
17
17
  import { log } from "../utils/logger.js";
18
18
  import { randomDelay } from "../utils/stealth-utils.js";
19
- export class VideoManager {
20
- authManager;
21
- contextManager;
22
- page = null;
23
- constructor(authManager, contextManager) {
24
- this.authManager = authManager;
25
- this.contextManager = contextManager;
26
- }
27
- /**
28
- * Navigate to a notebook and ensure we're on the right page
29
- */
30
- async navigateToNotebook(notebookUrl) {
31
- const context = await this.contextManager.getOrCreateContext();
32
- const isAuth = await this.authManager.validateWithRetry(context);
33
- if (!isAuth) {
34
- throw new Error("Not authenticated. Run setup_auth first.");
35
- }
36
- this.page = await context.newPage();
37
- await this.page.goto(notebookUrl, { waitUntil: "domcontentloaded" });
38
- await this.page.waitForLoadState("networkidle").catch(() => { });
39
- await randomDelay(2000, 3000);
40
- return this.page;
41
- }
19
+ import { StudioManagerBase, } from "./studio-manager-base.js";
20
+ /**
21
+ * Allowlisted style values. Single source of truth used to validate untrusted
22
+ * input before it is passed into the page context (prevents attribute-selector
23
+ * injection in selectStyle).
24
+ */
25
+ const VALID_VIDEO_STYLES = [
26
+ "auto-select",
27
+ "custom",
28
+ "classic",
29
+ "whiteboard",
30
+ "kawaii",
31
+ "anime",
32
+ "watercolour",
33
+ "retro-print",
34
+ "heritage",
35
+ "paper-craft",
36
+ ];
37
+ /**
38
+ * Allowlisted format values. Single source of truth used to validate untrusted
39
+ * input before it is passed into the page context (prevents attribute-selector
40
+ * injection in selectFormat).
41
+ */
42
+ const VALID_VIDEO_FORMATS = ["explainer", "brief"];
43
+ export class VideoManager extends StudioManagerBase {
44
+ logName = "video-manager";
42
45
  /**
43
46
  * Ensure the Studio panel is visible (expand if collapsed).
44
47
  *
@@ -117,6 +120,18 @@ export class VideoManager {
117
120
  item.classList?.contains("shimmer-green")) {
118
121
  return { status: "generating", progress: 0 };
119
122
  }
123
+ // Detect an explicit failure state on THIS artifact before assuming ready.
124
+ // A failed generation leaves a non-shimmer artifact, which would otherwise be
125
+ // misreported as "ready". Scope the check to the matched item only — a page-global
126
+ // alert query could match unrelated UI. Class names are best-effort (unconfirmed
127
+ // by live inspection); [role="alert"]/error child is the locale-independent signal.
128
+ const hasErrorChild = !!item.querySelector('[role="alert"], .error-state, .artifact-error');
129
+ if (hasErrorChild ||
130
+ item.classList?.contains("error-state") ||
131
+ item.classList?.contains("artifact-error") ||
132
+ item.classList?.contains("failed")) {
133
+ return { status: "failed" };
134
+ }
120
135
  // Otherwise it's ready
121
136
  return { status: "ready" };
122
137
  }
@@ -181,17 +196,28 @@ export class VideoManager {
181
196
  * Select a video format in the dialog (Explainer or Brief)
182
197
  */
183
198
  async selectFormat(page, format) {
199
+ // Validate against the allowlist BEFORE the value crosses into the page
200
+ // context. Without this, a value containing `"]` could break out of the
201
+ // attribute selector below (selector injection).
202
+ if (!VALID_VIDEO_FORMATS.includes(format)) {
203
+ log.warning(`video-manager: ignoring non-allowlisted format "${format}"`);
204
+ return false;
205
+ }
184
206
  return await page.evaluate((fmt) => {
185
207
  const browser = globalThis;
186
208
  // Format is in mat-radio-group.tile-group
187
209
  const radioGroup = browser.document.querySelector("mat-radio-group.tile-group");
188
210
  if (!radioGroup)
189
211
  return false;
190
- // Primary: value attribute (locale-independent if Angular Material uses stable values)
191
- const byValue = radioGroup.querySelector(`[value="${fmt}"]`);
192
- if (byValue) {
193
- byValue.click();
194
- return true;
212
+ // Primary: value attribute (locale-independent if Angular Material uses stable values).
213
+ // Iterate radio options and compare values with === rather than building a
214
+ // selector from the value, so untrusted text can never alter the selector.
215
+ const options = Array.from(radioGroup.querySelectorAll("[value]"));
216
+ for (const option of options) {
217
+ if (option.getAttribute?.("value") === fmt) {
218
+ option.click();
219
+ return true;
220
+ }
195
221
  }
196
222
  // Fallback: text match (English only — may not work in non-English locales,
197
223
  // but selectFormat is best-effort; generation will use default format if this fails)
@@ -210,17 +236,28 @@ export class VideoManager {
210
236
  * Select a video style in the dialog carousel
211
237
  */
212
238
  async selectStyle(page, style) {
239
+ // Validate against the allowlist BEFORE the value crosses into the page
240
+ // context. Without this, a value containing `"]` could break out of the
241
+ // attribute selector below (selector injection).
242
+ if (!VALID_VIDEO_STYLES.includes(style)) {
243
+ log.warning(`video-manager: ignoring non-allowlisted style "${style}"`);
244
+ return false;
245
+ }
213
246
  return await page.evaluate((styleName) => {
214
247
  const browser = globalThis;
215
248
  // Style is in mat-radio-group.carousel-group
216
249
  const radioGroup = browser.document.querySelector("mat-radio-group.carousel-group");
217
250
  if (!radioGroup)
218
251
  return false;
219
- // Primary: value attribute (locale-independent)
220
- const byValue = radioGroup.querySelector(`[value="${styleName}"]`);
221
- if (byValue) {
222
- byValue.click();
223
- return true;
252
+ // Primary: value attribute (locale-independent).
253
+ // Iterate radio options and compare values with === rather than building a
254
+ // selector from the value, so untrusted text can never alter the selector.
255
+ const options = Array.from(radioGroup.querySelectorAll("[value]"));
256
+ for (const option of options) {
257
+ if (option.getAttribute?.("value") === styleName) {
258
+ option.click();
259
+ return true;
260
+ }
224
261
  }
225
262
  // Fallback: text match (English only — style labels are translated in non-English UIs,
226
263
  // but selectStyle is best-effort; generation will use default style if this fails)
@@ -243,14 +280,26 @@ export class VideoManager {
243
280
  async clickDialogGenerate(page) {
244
281
  return await page.evaluate(() => {
245
282
  const browser = globalThis;
246
- // Primary: button in mat-dialog-actions
283
+ // Primary: the primary-color action button inside mat-dialog-actions.
284
+ // NEVER blindly click the FIRST button — Material dialogs conventionally place
285
+ // Cancel/Close first and the primary action last, so clicking [0] can hit Cancel
286
+ // and silently abort generation. Match the primary-color class/attribute first,
287
+ // then fall back to the LAST enabled button within the actions container.
247
288
  const dialogActions = browser.document.querySelector("mat-dialog-actions");
248
289
  if (dialogActions) {
249
- const btn = dialogActions.querySelector("button");
250
- if (btn) {
251
- btn.click();
290
+ const primaryInActions = dialogActions.querySelector('button.button-color--primary, button[color="primary"]');
291
+ if (primaryInActions) {
292
+ primaryInActions.click();
252
293
  return true;
253
294
  }
295
+ const actionButtons = Array.from(dialogActions.querySelectorAll("button"));
296
+ for (let i = actionButtons.length - 1; i >= 0; i--) {
297
+ const button = actionButtons[i];
298
+ if (!button.disabled) {
299
+ button.click();
300
+ return true;
301
+ }
302
+ }
254
303
  }
255
304
  // Fallback: button with primary color in any dialog
256
305
  const primaryBtn = browser.document.querySelector('.dialog-actions button, button.button-color--primary');
@@ -341,6 +390,14 @@ export class VideoManager {
341
390
  await randomDelay(500, 800);
342
391
  // Check if generation started
343
392
  const newStatus = await this.checkVideoStatusInternal(page);
393
+ if (newStatus.status === "failed") {
394
+ log.warning(" Video generation reported a failed state");
395
+ return {
396
+ success: false,
397
+ status: newStatus,
398
+ error: "Video generation failed.",
399
+ };
400
+ }
344
401
  if (newStatus.status === "generating" || newStatus.status === "ready") {
345
402
  log.success(` Video generation ${newStatus.status === "ready" ? "completed" : "started"}`);
346
403
  return { success: true, status: newStatus };
@@ -372,20 +429,4 @@ export class VideoManager {
372
429
  await this.closePage();
373
430
  }
374
431
  }
375
- /**
376
- * Close the page if open
377
- */
378
- async closePage() {
379
- if (this.page) {
380
- try {
381
- await this.page.close();
382
- }
383
- catch (err) {
384
- log.debug(`video-manager: closing page: ${err instanceof Error ? err.message : String(err)}`);
385
- // Ignore close errors
386
- }
387
- this.page = null;
388
- }
389
- }
390
432
  }
391
- //# sourceMappingURL=video-manager.js.map
@@ -16,4 +16,3 @@ export declare class MetricsRegistry {
16
16
  reset(): void;
17
17
  }
18
18
  export declare function getMetricsRegistry(): MetricsRegistry;
19
- //# sourceMappingURL=metrics.d.ts.map
@@ -32,4 +32,3 @@ const metrics = new MetricsRegistry();
32
32
  export function getMetricsRegistry() {
33
33
  return metrics;
34
34
  }
35
- //# sourceMappingURL=metrics.js.map
@@ -5,4 +5,3 @@
5
5
  * usage tracking, and limit enforcement.
6
6
  */
7
7
  export { QuotaManager, getQuotaManager, type LicenseTier, type QuotaLimits, type QuotaUsage, type QuotaSettings, } from "./quota-manager.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -5,4 +5,3 @@
5
5
  * usage tracking, and limit enforcement.
6
6
  */
7
7
  export { QuotaManager, getQuotaManager, } from "./quota-manager.js";
8
- //# sourceMappingURL=index.js.map