@pan-sec/notebooklm-mcp 2026.2.11 → 2026.3.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 (305) hide show
  1. package/README.md +62 -19
  2. package/SECURITY.md +31 -61
  3. package/dist/auth/auth-manager.d.ts +2 -1
  4. package/dist/auth/auth-manager.d.ts.map +1 -1
  5. package/dist/auth/auth-manager.js +117 -44
  6. package/dist/auth/auth-manager.js.map +1 -1
  7. package/dist/auth/mcp-auth.d.ts +24 -4
  8. package/dist/auth/mcp-auth.d.ts.map +1 -1
  9. package/dist/auth/mcp-auth.js +149 -19
  10. package/dist/auth/mcp-auth.js.map +1 -1
  11. package/dist/compliance/alert-manager.d.ts.map +1 -1
  12. package/dist/compliance/alert-manager.js +7 -4
  13. package/dist/compliance/alert-manager.js.map +1 -1
  14. package/dist/compliance/breach-detection.d.ts.map +1 -1
  15. package/dist/compliance/breach-detection.js +14 -7
  16. package/dist/compliance/breach-detection.js.map +1 -1
  17. package/dist/compliance/change-log.d.ts.map +1 -1
  18. package/dist/compliance/change-log.js +7 -4
  19. package/dist/compliance/change-log.js.map +1 -1
  20. package/dist/compliance/compliance-logger.d.ts.map +1 -1
  21. package/dist/compliance/compliance-logger.js +11 -6
  22. package/dist/compliance/compliance-logger.js.map +1 -1
  23. package/dist/compliance/consent-manager.d.ts.map +1 -1
  24. package/dist/compliance/consent-manager.js +5 -3
  25. package/dist/compliance/consent-manager.js.map +1 -1
  26. package/dist/compliance/data-erasure.d.ts +1 -1
  27. package/dist/compliance/data-erasure.d.ts.map +1 -1
  28. package/dist/compliance/data-erasure.js +142 -83
  29. package/dist/compliance/data-erasure.js.map +1 -1
  30. package/dist/compliance/data-export.d.ts.map +1 -1
  31. package/dist/compliance/data-export.js +23 -12
  32. package/dist/compliance/data-export.js.map +1 -1
  33. package/dist/compliance/data-inventory.d.ts.map +1 -1
  34. package/dist/compliance/data-inventory.js +7 -6
  35. package/dist/compliance/data-inventory.js.map +1 -1
  36. package/dist/compliance/dsar-handler.d.ts +7 -1
  37. package/dist/compliance/dsar-handler.d.ts.map +1 -1
  38. package/dist/compliance/dsar-handler.js +74 -61
  39. package/dist/compliance/dsar-handler.js.map +1 -1
  40. package/dist/compliance/evidence-collector.d.ts.map +1 -1
  41. package/dist/compliance/evidence-collector.js +10 -6
  42. package/dist/compliance/evidence-collector.js.map +1 -1
  43. package/dist/compliance/health-monitor.d.ts.map +1 -1
  44. package/dist/compliance/health-monitor.js +15 -9
  45. package/dist/compliance/health-monitor.js.map +1 -1
  46. package/dist/compliance/incident-manager.d.ts.map +1 -1
  47. package/dist/compliance/incident-manager.js +5 -3
  48. package/dist/compliance/incident-manager.js.map +1 -1
  49. package/dist/compliance/policy-docs.d.ts.map +1 -1
  50. package/dist/compliance/policy-docs.js +14 -11
  51. package/dist/compliance/policy-docs.js.map +1 -1
  52. package/dist/compliance/privacy-notice-text.d.ts.map +1 -1
  53. package/dist/compliance/privacy-notice-text.js +3 -4
  54. package/dist/compliance/privacy-notice-text.js.map +1 -1
  55. package/dist/compliance/privacy-notice.d.ts.map +1 -1
  56. package/dist/compliance/privacy-notice.js +5 -3
  57. package/dist/compliance/privacy-notice.js.map +1 -1
  58. package/dist/compliance/report-generator.d.ts.map +1 -1
  59. package/dist/compliance/report-generator.js +5 -3
  60. package/dist/compliance/report-generator.js.map +1 -1
  61. package/dist/compliance/retention-engine.d.ts.map +1 -1
  62. package/dist/compliance/retention-engine.js +24 -10
  63. package/dist/compliance/retention-engine.js.map +1 -1
  64. package/dist/compliance/siem-exporter.d.ts.map +1 -1
  65. package/dist/compliance/siem-exporter.js +40 -16
  66. package/dist/compliance/siem-exporter.js.map +1 -1
  67. package/dist/config.d.ts +8 -31
  68. package/dist/config.d.ts.map +1 -1
  69. package/dist/config.js +26 -64
  70. package/dist/config.js.map +1 -1
  71. package/dist/errors.d.ts +22 -2
  72. package/dist/errors.d.ts.map +1 -1
  73. package/dist/errors.js +55 -4
  74. package/dist/errors.js.map +1 -1
  75. package/dist/gemini/gemini-client.d.ts +1 -0
  76. package/dist/gemini/gemini-client.d.ts.map +1 -1
  77. package/dist/gemini/gemini-client.js +50 -49
  78. package/dist/gemini/gemini-client.js.map +1 -1
  79. package/dist/gemini/types.d.ts +3 -1
  80. package/dist/gemini/types.d.ts.map +1 -1
  81. package/dist/gemini/types.js.map +1 -1
  82. package/dist/index.d.ts +52 -1
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +412 -89
  85. package/dist/index.js.map +1 -1
  86. package/dist/library/notebook-library.d.ts.map +1 -1
  87. package/dist/library/notebook-library.js +2 -1
  88. package/dist/library/notebook-library.js.map +1 -1
  89. package/dist/logging/query-logger.d.ts +13 -1
  90. package/dist/logging/query-logger.d.ts.map +1 -1
  91. package/dist/logging/query-logger.js +62 -10
  92. package/dist/logging/query-logger.js.map +1 -1
  93. package/dist/notebook-creation/audio-manager.d.ts.map +1 -1
  94. package/dist/notebook-creation/audio-manager.js +19 -24
  95. package/dist/notebook-creation/audio-manager.js.map +1 -1
  96. package/dist/notebook-creation/browser-options.d.ts +28 -0
  97. package/dist/notebook-creation/browser-options.d.ts.map +1 -0
  98. package/dist/notebook-creation/browser-options.js +75 -0
  99. package/dist/notebook-creation/browser-options.js.map +1 -0
  100. package/dist/notebook-creation/data-table-manager.d.ts.map +1 -1
  101. package/dist/notebook-creation/data-table-manager.js +20 -21
  102. package/dist/notebook-creation/data-table-manager.js.map +1 -1
  103. package/dist/notebook-creation/discover-creation-flow.d.ts +0 -6
  104. package/dist/notebook-creation/discover-creation-flow.d.ts.map +1 -1
  105. package/dist/notebook-creation/discover-creation-flow.js +10 -10
  106. package/dist/notebook-creation/discover-creation-flow.js.map +1 -1
  107. package/dist/notebook-creation/discover-quota.d.ts +0 -6
  108. package/dist/notebook-creation/discover-quota.d.ts.map +1 -1
  109. package/dist/notebook-creation/discover-quota.js +12 -13
  110. package/dist/notebook-creation/discover-quota.js.map +1 -1
  111. package/dist/notebook-creation/discover-sources.js +15 -16
  112. package/dist/notebook-creation/discover-sources.js.map +1 -1
  113. package/dist/notebook-creation/dom-scripts.d.ts +10 -0
  114. package/dist/notebook-creation/dom-scripts.d.ts.map +1 -0
  115. package/dist/notebook-creation/dom-scripts.js +58 -0
  116. package/dist/notebook-creation/dom-scripts.js.map +1 -0
  117. package/dist/notebook-creation/errors.d.ts +18 -0
  118. package/dist/notebook-creation/errors.d.ts.map +1 -0
  119. package/dist/notebook-creation/errors.js +20 -0
  120. package/dist/notebook-creation/errors.js.map +1 -0
  121. package/dist/notebook-creation/index.d.ts +2 -1
  122. package/dist/notebook-creation/index.d.ts.map +1 -1
  123. package/dist/notebook-creation/index.js +2 -1
  124. package/dist/notebook-creation/index.js.map +1 -1
  125. package/dist/notebook-creation/notebook-creator.d.ts +6 -82
  126. package/dist/notebook-creation/notebook-creator.d.ts.map +1 -1
  127. package/dist/notebook-creation/notebook-creator.js +49 -835
  128. package/dist/notebook-creation/notebook-creator.js.map +1 -1
  129. package/dist/notebook-creation/notebook-nav.d.ts +19 -0
  130. package/dist/notebook-creation/notebook-nav.d.ts.map +1 -0
  131. package/dist/notebook-creation/notebook-nav.js +240 -0
  132. package/dist/notebook-creation/notebook-nav.js.map +1 -0
  133. package/dist/notebook-creation/notebook-sync.d.ts.map +1 -1
  134. package/dist/notebook-creation/notebook-sync.js +36 -38
  135. package/dist/notebook-creation/notebook-sync.js.map +1 -1
  136. package/dist/notebook-creation/selector-discovery.d.ts.map +1 -1
  137. package/dist/notebook-creation/selector-discovery.js +17 -24
  138. package/dist/notebook-creation/selector-discovery.js.map +1 -1
  139. package/dist/notebook-creation/selectors.d.ts +23 -37
  140. package/dist/notebook-creation/selectors.d.ts.map +1 -1
  141. package/dist/notebook-creation/selectors.js +56 -60
  142. package/dist/notebook-creation/selectors.js.map +1 -1
  143. package/dist/notebook-creation/source-manager.d.ts +25 -0
  144. package/dist/notebook-creation/source-manager.d.ts.map +1 -1
  145. package/dist/notebook-creation/source-manager.js +689 -50
  146. package/dist/notebook-creation/source-manager.js.map +1 -1
  147. package/dist/notebook-creation/types.d.ts +4 -0
  148. package/dist/notebook-creation/types.d.ts.map +1 -1
  149. package/dist/notebook-creation/video-manager.d.ts.map +1 -1
  150. package/dist/notebook-creation/video-manager.js +33 -35
  151. package/dist/notebook-creation/video-manager.js.map +1 -1
  152. package/dist/observability/metrics.d.ts +19 -0
  153. package/dist/observability/metrics.d.ts.map +1 -0
  154. package/dist/observability/metrics.js +35 -0
  155. package/dist/observability/metrics.js.map +1 -0
  156. package/dist/quota/quota-manager.d.ts +11 -3
  157. package/dist/quota/quota-manager.d.ts.map +1 -1
  158. package/dist/quota/quota-manager.js +139 -47
  159. package/dist/quota/quota-manager.js.map +1 -1
  160. package/dist/resources/resource-handlers.d.ts.map +1 -1
  161. package/dist/resources/resource-handlers.js +39 -17
  162. package/dist/resources/resource-handlers.js.map +1 -1
  163. package/dist/session/browser-session.d.ts.map +1 -1
  164. package/dist/session/browser-session.js +22 -22
  165. package/dist/session/browser-session.js.map +1 -1
  166. package/dist/session/session-timeout.d.ts.map +1 -1
  167. package/dist/session/session-timeout.js +4 -2
  168. package/dist/session/session-timeout.js.map +1 -1
  169. package/dist/session/shared-context-manager.d.ts.map +1 -1
  170. package/dist/session/shared-context-manager.js +31 -30
  171. package/dist/session/shared-context-manager.js.map +1 -1
  172. package/dist/tools/annotations.d.ts.map +1 -1
  173. package/dist/tools/annotations.js +9 -56
  174. package/dist/tools/annotations.js.map +1 -1
  175. package/dist/tools/definitions/ask-question.d.ts.map +1 -1
  176. package/dist/tools/definitions/ask-question.js +35 -100
  177. package/dist/tools/definitions/ask-question.js.map +1 -1
  178. package/dist/tools/definitions/chat-history.d.ts +47 -1
  179. package/dist/tools/definitions/chat-history.d.ts.map +1 -1
  180. package/dist/tools/definitions/chat-history.js +10 -1
  181. package/dist/tools/definitions/chat-history.js.map +1 -1
  182. package/dist/tools/definitions/data-tables.d.ts.map +1 -1
  183. package/dist/tools/definitions/data-tables.js +2 -0
  184. package/dist/tools/definitions/data-tables.js.map +1 -1
  185. package/dist/tools/definitions/gemini.d.ts.map +1 -1
  186. package/dist/tools/definitions/gemini.js +54 -11
  187. package/dist/tools/definitions/gemini.js.map +1 -1
  188. package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
  189. package/dist/tools/definitions/notebook-management.js +100 -70
  190. package/dist/tools/definitions/notebook-management.js.map +1 -1
  191. package/dist/tools/definitions/query-history.d.ts +47 -1
  192. package/dist/tools/definitions/query-history.d.ts.map +1 -1
  193. package/dist/tools/definitions/query-history.js +7 -0
  194. package/dist/tools/definitions/query-history.js.map +1 -1
  195. package/dist/tools/definitions/session-management.d.ts.map +1 -1
  196. package/dist/tools/definitions/session-management.js +5 -0
  197. package/dist/tools/definitions/session-management.js.map +1 -1
  198. package/dist/tools/definitions/system.d.ts.map +1 -1
  199. package/dist/tools/definitions/system.js +71 -100
  200. package/dist/tools/definitions/system.js.map +1 -1
  201. package/dist/tools/definitions/video.d.ts.map +1 -1
  202. package/dist/tools/definitions/video.js +4 -1
  203. package/dist/tools/definitions/video.js.map +1 -1
  204. package/dist/tools/definitions.d.ts.map +1 -1
  205. package/dist/tools/definitions.js +4 -0
  206. package/dist/tools/definitions.js.map +1 -1
  207. package/dist/tools/handlers/ask-question.d.ts +1 -1
  208. package/dist/tools/handlers/ask-question.d.ts.map +1 -1
  209. package/dist/tools/handlers/ask-question.js +57 -13
  210. package/dist/tools/handlers/ask-question.js.map +1 -1
  211. package/dist/tools/handlers/audio-video.d.ts.map +1 -1
  212. package/dist/tools/handlers/audio-video.js +22 -161
  213. package/dist/tools/handlers/audio-video.js.map +1 -1
  214. package/dist/tools/handlers/auth.d.ts +14 -19
  215. package/dist/tools/handlers/auth.d.ts.map +1 -1
  216. package/dist/tools/handlers/auth.js +77 -121
  217. package/dist/tools/handlers/auth.js.map +1 -1
  218. package/dist/tools/handlers/error-utils.d.ts +16 -0
  219. package/dist/tools/handlers/error-utils.d.ts.map +1 -0
  220. package/dist/tools/handlers/error-utils.js +39 -0
  221. package/dist/tools/handlers/error-utils.js.map +1 -0
  222. package/dist/tools/handlers/gemini.d.ts +2 -0
  223. package/dist/tools/handlers/gemini.d.ts.map +1 -1
  224. package/dist/tools/handlers/gemini.js +88 -51
  225. package/dist/tools/handlers/gemini.js.map +1 -1
  226. package/dist/tools/handlers/index.d.ts +39 -47
  227. package/dist/tools/handlers/index.d.ts.map +1 -1
  228. package/dist/tools/handlers/index.js +15 -4
  229. package/dist/tools/handlers/index.js.map +1 -1
  230. package/dist/tools/handlers/notebook-creation.d.ts.map +1 -1
  231. package/dist/tools/handlers/notebook-creation.js +102 -86
  232. package/dist/tools/handlers/notebook-creation.js.map +1 -1
  233. package/dist/tools/handlers/notebook-management.d.ts +8 -8
  234. package/dist/tools/handlers/notebook-management.d.ts.map +1 -1
  235. package/dist/tools/handlers/notebook-management.js +34 -80
  236. package/dist/tools/handlers/notebook-management.js.map +1 -1
  237. package/dist/tools/handlers/session-management.d.ts +8 -10
  238. package/dist/tools/handlers/session-management.d.ts.map +1 -1
  239. package/dist/tools/handlers/session-management.js +34 -63
  240. package/dist/tools/handlers/session-management.js.map +1 -1
  241. package/dist/tools/handlers/system.d.ts.map +1 -1
  242. package/dist/tools/handlers/system.js +45 -10
  243. package/dist/tools/handlers/system.js.map +1 -1
  244. package/dist/tools/handlers/types.d.ts +1 -1
  245. package/dist/tools/handlers/types.d.ts.map +1 -1
  246. package/dist/tools/handlers/webhooks.d.ts.map +1 -1
  247. package/dist/tools/handlers/webhooks.js +15 -13
  248. package/dist/tools/handlers/webhooks.js.map +1 -1
  249. package/dist/types.d.ts +7 -17
  250. package/dist/types.d.ts.map +1 -1
  251. package/dist/utils/audit-logger.d.ts +19 -1
  252. package/dist/utils/audit-logger.d.ts.map +1 -1
  253. package/dist/utils/audit-logger.js +198 -30
  254. package/dist/utils/audit-logger.js.map +1 -1
  255. package/dist/utils/cleanup-manager.d.ts.map +1 -1
  256. package/dist/utils/cleanup-manager.js +6 -3
  257. package/dist/utils/cleanup-manager.js.map +1 -1
  258. package/dist/utils/crypto.d.ts +4 -1
  259. package/dist/utils/crypto.d.ts.map +1 -1
  260. package/dist/utils/crypto.js +32 -21
  261. package/dist/utils/crypto.js.map +1 -1
  262. package/dist/utils/file-lock.d.ts.map +1 -1
  263. package/dist/utils/file-lock.js +87 -16
  264. package/dist/utils/file-lock.js.map +1 -1
  265. package/dist/utils/file-permissions.d.ts +2 -0
  266. package/dist/utils/file-permissions.d.ts.map +1 -1
  267. package/dist/utils/file-permissions.js +2 -1
  268. package/dist/utils/file-permissions.js.map +1 -1
  269. package/dist/utils/logger.d.ts +4 -0
  270. package/dist/utils/logger.d.ts.map +1 -1
  271. package/dist/utils/logger.js +16 -0
  272. package/dist/utils/logger.js.map +1 -1
  273. package/dist/utils/page-utils.d.ts +13 -0
  274. package/dist/utils/page-utils.d.ts.map +1 -1
  275. package/dist/utils/page-utils.js +61 -39
  276. package/dist/utils/page-utils.js.map +1 -1
  277. package/dist/utils/response-validator.d.ts.map +1 -1
  278. package/dist/utils/response-validator.js +27 -22
  279. package/dist/utils/response-validator.js.map +1 -1
  280. package/dist/utils/secrets-scanner.d.ts +11 -0
  281. package/dist/utils/secrets-scanner.d.ts.map +1 -1
  282. package/dist/utils/secrets-scanner.js +65 -17
  283. package/dist/utils/secrets-scanner.js.map +1 -1
  284. package/dist/utils/secure-memory.d.ts +9 -31
  285. package/dist/utils/secure-memory.d.ts.map +1 -1
  286. package/dist/utils/secure-memory.js +17 -102
  287. package/dist/utils/secure-memory.js.map +1 -1
  288. package/dist/utils/security.d.ts +4 -3
  289. package/dist/utils/security.d.ts.map +1 -1
  290. package/dist/utils/security.js +43 -13
  291. package/dist/utils/security.js.map +1 -1
  292. package/dist/utils/stealth-utils.d.ts.map +1 -1
  293. package/dist/utils/stealth-utils.js +4 -4
  294. package/dist/utils/stealth-utils.js.map +1 -1
  295. package/dist/webhooks/types.d.ts +4 -0
  296. package/dist/webhooks/types.d.ts.map +1 -1
  297. package/dist/webhooks/webhook-dispatcher.d.ts +80 -12
  298. package/dist/webhooks/webhook-dispatcher.d.ts.map +1 -1
  299. package/dist/webhooks/webhook-dispatcher.js +497 -74
  300. package/dist/webhooks/webhook-dispatcher.js.map +1 -1
  301. package/docs/archive/ISSUES-legacy-2026-04-24.md +644 -0
  302. package/docs/dependency-risk.md +25 -0
  303. package/docs/testing-runbook.md +166 -0
  304. package/docs/usage-guide.md +2 -1
  305. package/package.json +34 -16
@@ -26,7 +26,9 @@ export type { HandlerContext } from "./types.js";
26
26
  */
27
27
  export declare class ToolHandlers {
28
28
  private ctx;
29
+ private geminiClient;
29
30
  constructor(sessionManager: SessionManager, authManager: AuthManager, library: NotebookLibrary);
31
+ private getGeminiClient;
30
32
  handleAskQuestion(args: Parameters<typeof handleAskQuestion>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<import("../../types.js").AskQuestionResult>>;
31
33
  handleListSessions(): Promise<import("../../types.js").ToolResult<{
32
34
  active_sessions: number;
@@ -34,7 +36,7 @@ export declare class ToolHandlers {
34
36
  session_timeout: number;
35
37
  oldest_session_seconds: number;
36
38
  total_messages: number;
37
- sessions: Array<{
39
+ sessions: {
38
40
  id: string;
39
41
  created_at: number;
40
42
  last_activity: number;
@@ -42,7 +44,7 @@ export declare class ToolHandlers {
42
44
  inactive_seconds: number;
43
45
  message_count: number;
44
46
  notebook_url: string;
45
- }>;
47
+ }[];
46
48
  }>>;
47
49
  handleCloseSession(args: Parameters<typeof handleCloseSession>[1]): Promise<import("../../types.js").ToolResult<{
48
50
  status: string;
@@ -65,56 +67,46 @@ export declare class ToolHandlers {
65
67
  headless: boolean;
66
68
  auto_login_enabled: boolean;
67
69
  stealth_enabled: boolean;
68
- chat_ui_accessible?: boolean;
69
- deep_check_notebook?: string;
70
- troubleshooting_tip?: string;
71
- }>>;
72
- handleSetupAuth(args: Parameters<typeof handleSetupAuth>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<{
73
- status: string;
74
- message: string;
75
- authenticated: boolean;
76
- duration_seconds?: number;
77
- }>>;
78
- handleReAuth(args: Parameters<typeof handleReAuth>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<{
79
- status: string;
80
- message: string;
81
- authenticated: boolean;
82
- duration_seconds?: number;
70
+ chat_ui_accessible?: boolean | undefined;
71
+ deep_check_notebook?: string | undefined;
72
+ troubleshooting_tip?: string | undefined;
83
73
  }>>;
74
+ handleSetupAuth(args: Parameters<typeof handleSetupAuth>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<import("./auth.js").AuthResult>>;
75
+ handleReAuth(args: Parameters<typeof handleReAuth>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<import("./auth.js").AuthResult>>;
84
76
  handleAddNotebook(args: Parameters<typeof handleAddNotebook>[1]): Promise<import("../../types.js").ToolResult<{
85
- notebook: any;
77
+ notebook: import("../../library/types.js").NotebookEntry;
86
78
  }>>;
87
79
  handleListNotebooks(): Promise<import("../../types.js").ToolResult<{
88
- notebooks: any[];
80
+ notebooks: import("../../library/types.js").NotebookEntry[];
89
81
  }>>;
90
82
  handleGetNotebook(args: Parameters<typeof handleGetNotebook>[1]): Promise<import("../../types.js").ToolResult<{
91
- notebook: any;
83
+ notebook: import("../../library/types.js").NotebookEntry;
92
84
  }>>;
93
85
  handleSelectNotebook(args: Parameters<typeof handleSelectNotebook>[1]): Promise<import("../../types.js").ToolResult<{
94
- notebook: any;
86
+ notebook: import("../../library/types.js").NotebookEntry;
95
87
  }>>;
96
88
  handleUpdateNotebook(args: Parameters<typeof handleUpdateNotebook>[1]): Promise<import("../../types.js").ToolResult<{
97
- notebook: any;
89
+ notebook: import("../../library/types.js").NotebookEntry;
98
90
  }>>;
99
91
  handleRemoveNotebook(args: Parameters<typeof handleRemoveNotebook>[1]): Promise<import("../../types.js").ToolResult<{
100
92
  removed: boolean;
101
93
  closed_sessions: number;
102
94
  }>>;
103
95
  handleSearchNotebooks(args: Parameters<typeof handleSearchNotebooks>[1]): Promise<import("../../types.js").ToolResult<{
104
- notebooks: any[];
96
+ notebooks: import("../../library/types.js").NotebookEntry[];
105
97
  }>>;
106
- handleGetLibraryStats(): Promise<import("../../types.js").ToolResult<any>>;
98
+ handleGetLibraryStats(): Promise<import("../../types.js").ToolResult<import("../../library/types.js").LibraryStats>>;
107
99
  handleCreateNotebook(args: Parameters<typeof handleCreateNotebook>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<import("../../notebook-creation/types.js").CreatedNotebook>>;
108
100
  handleBatchCreateNotebooks(args: Parameters<typeof handleBatchCreateNotebooks>[1], sendProgress?: ProgressCallback): Promise<import("../../types.js").ToolResult<{
109
101
  total: number;
110
102
  succeeded: number;
111
103
  failed: number;
112
- results: Array<{
104
+ results: {
113
105
  name: string;
114
106
  success: boolean;
115
- url?: string;
116
- error?: string;
117
- }>;
107
+ url?: string | undefined;
108
+ error?: string | undefined;
109
+ }[];
118
110
  }>>;
119
111
  handleSyncLibrary(args: Parameters<typeof handleSyncLibrary>[1]): Promise<import("../../types.js").ToolResult<import("../../notebook-creation/notebook-sync.js").SyncResult>>;
120
112
  handleListSources(args: Parameters<typeof handleListSources>[1]): Promise<import("../../types.js").ToolResult<import("../../notebook-creation/source-manager.js").ListSourcesResult>>;
@@ -125,10 +117,10 @@ export declare class ToolHandlers {
125
117
  files_failed: number;
126
118
  files_skipped: number;
127
119
  notebooks_used: string[];
128
- failed_files: Array<{
120
+ failed_files: {
129
121
  file: string;
130
122
  error: string;
131
- }>;
123
+ }[];
132
124
  dry_run: boolean;
133
125
  }>>;
134
126
  handleRemoveSource(args: Parameters<typeof handleRemoveSource>[1]): Promise<import("../../types.js").ToolResult<import("../../notebook-creation/source-manager.js").RemoveSourceResult>>;
@@ -180,8 +172,8 @@ export declare class ToolHandlers {
180
172
  google_quota?: {
181
173
  used: number;
182
174
  limit: number;
183
- } | null;
184
- rate_limit_detected?: boolean;
175
+ } | null | undefined;
176
+ rate_limit_detected?: boolean | undefined;
185
177
  }>>;
186
178
  handleSetQuotaTier(args: Parameters<typeof handleSetQuotaTier>[1]): Promise<import("../../types.js").ToolResult<{
187
179
  tier: string;
@@ -196,16 +188,16 @@ export declare class ToolHandlers {
196
188
  status: string;
197
189
  mode: string;
198
190
  preview?: {
199
- categories: Array<{
191
+ categories: {
200
192
  name: string;
201
193
  description: string;
202
194
  paths: string[];
203
195
  totalBytes: number;
204
196
  optional: boolean;
205
- }>;
197
+ }[];
206
198
  totalPaths: number;
207
199
  totalSizeBytes: number;
208
- };
200
+ } | undefined;
209
201
  result?: {
210
202
  deletedPaths: string[];
211
203
  failedPaths: string[];
@@ -214,7 +206,7 @@ export declare class ToolHandlers {
214
206
  count: number;
215
207
  bytes: number;
216
208
  }>;
217
- };
209
+ } | undefined;
218
210
  }>>;
219
211
  handleGenerateAudioOverview(args: Parameters<typeof handleGenerateAudioOverview>[1]): Promise<import("../../types.js").ToolResult<import("../../notebook-creation/audio-manager.js").GenerateAudioResult>>;
220
212
  handleGetAudioStatus(args: Parameters<typeof handleGetAudioStatus>[1]): Promise<import("../../types.js").ToolResult<import("../../notebook-creation/audio-manager.js").AudioStatus>>;
@@ -249,19 +241,19 @@ export declare class ToolHandlers {
249
241
  handleQueryChunkedDocument(args: Parameters<typeof handleQueryChunkedDocument>[1]): Promise<import("../../types.js").ToolResult<{
250
242
  answer: string;
251
243
  model: string;
252
- tokensUsed?: number;
244
+ tokensUsed?: number | undefined;
253
245
  chunksQueried: number;
254
246
  filesUsed: string[];
255
247
  }>>;
256
248
  handleGetQueryHistory(args: Parameters<typeof handleGetQueryHistory>[1]): Promise<import("../../types.js").ToolResult<{
257
249
  count: number;
258
- queries: Array<{
250
+ queries: {
259
251
  timestamp: string;
260
252
  queryId: string;
261
253
  sessionId: string;
262
- notebookId?: string;
254
+ notebookId?: string | undefined;
263
255
  notebookUrl: string;
264
- notebookName?: string;
256
+ notebookName?: string | undefined;
265
257
  question: string;
266
258
  answer: string;
267
259
  answerLength: number;
@@ -272,23 +264,23 @@ export declare class ToolHandlers {
272
264
  remaining: number;
273
265
  tier: string;
274
266
  };
275
- }>;
267
+ }[];
276
268
  }>>;
277
269
  handleGetNotebookChatHistory(args: Parameters<typeof handleGetNotebookChatHistory>[1]): Promise<import("../../types.js").ToolResult<{
278
270
  notebook_url: string;
279
- notebook_name?: string;
271
+ notebook_name?: string | undefined;
280
272
  total_messages: number;
281
273
  returned_messages: number;
282
274
  user_messages: number;
283
275
  assistant_messages: number;
284
- offset?: number;
285
- has_more?: boolean;
286
- output_file?: string;
287
- messages?: Array<{
276
+ offset?: number | undefined;
277
+ has_more?: boolean | undefined;
278
+ output_file?: string | undefined;
279
+ messages?: {
288
280
  role: "user" | "assistant";
289
281
  content: string;
290
282
  index: number;
291
- }>;
283
+ }[] | undefined;
292
284
  }>>;
293
285
  cleanup(): Promise<void>;
294
286
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EAC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CAAC,CAAC,CAAC,EAC9C,YAAY,CAAC,EAAE,gBAAgB;IAIjC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAG/D,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAG3E,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAGrE,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAGnE,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAGnE,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC;;;;IAGrE,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC;;;;;;;IAGjF,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;IAGvE,4BAA4B,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;IAK/E,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAM/B"}
@@ -16,6 +16,8 @@ import { handleExportLibrary, handleGetProjectInfo, handleGetQuota, handleSetQuo
16
16
  import { handleGenerateAudioOverview, handleGetAudioStatus, handleDownloadAudio, handleGenerateVideoOverview, handleGetVideoStatus, handleGenerateDataTable, handleGetDataTable, } from "./audio-video.js";
17
17
  import { handleConfigureWebhook, handleListWebhooks, handleTestWebhook, handleRemoveWebhook, } from "./webhooks.js";
18
18
  import { handleDeepResearch, handleGeminiQuery, handleGetResearchStatus, handleUploadDocument, handleQueryDocument, handleListDocuments, handleDeleteDocument, handleQueryChunkedDocument, handleGetQueryHistory, handleGetNotebookChatHistory, } from "./gemini.js";
19
+ const RATE_LIMIT_MAX_REQUESTS = 100;
20
+ const RATE_LIMIT_WINDOW_MS = 60000; // 1 minute
19
21
  /**
20
22
  * ToolHandlers — facade class that delegates to domain handler functions.
21
23
  *
@@ -24,15 +26,24 @@ import { handleDeepResearch, handleGeminiQuery, handleGetResearchStatus, handleU
24
26
  */
25
27
  export class ToolHandlers {
26
28
  ctx;
29
+ geminiClient = null;
27
30
  constructor(sessionManager, authManager, library) {
28
31
  this.ctx = {
29
32
  sessionManager,
30
33
  authManager,
31
34
  library,
32
- rateLimiter: new RateLimiter(100, 60000),
33
- geminiClient: new GeminiClient(),
35
+ rateLimiter: new RateLimiter(RATE_LIMIT_MAX_REQUESTS, RATE_LIMIT_WINDOW_MS),
36
+ getGeminiClient: () => this.getGeminiClient(),
34
37
  };
35
38
  }
39
+ getGeminiClient() {
40
+ const apiKey = process.env.GEMINI_API_KEY?.trim();
41
+ if (!apiKey) {
42
+ return null;
43
+ }
44
+ this.geminiClient ??= new GeminiClient(apiKey);
45
+ return this.geminiClient;
46
+ }
36
47
  // === Ask Question ===
37
48
  handleAskQuestion(args, sendProgress) {
38
49
  return handleAskQuestion(this.ctx, args, sendProgress);
@@ -189,9 +200,9 @@ export class ToolHandlers {
189
200
  // === Cleanup ===
190
201
  async cleanup() {
191
202
  const { log } = await import("../../utils/logger.js");
192
- log.info(`🧹 Cleaning up tool handlers...`);
203
+ log.info("Cleaning up tool handlers...");
193
204
  await this.ctx.sessionManager.closeAllSessions();
194
- log.success(`✅ Tool handlers cleanup complete`);
205
+ log.info("Tool handlers cleanup complete");
195
206
  }
196
207
  }
197
208
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAA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AAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CACH,CA0NA;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CA2DzC"}
1
+ {"version":3,"file":"notebook-creation.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/notebook-creation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,cAAc,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAcnD,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,mBAAmB,EACzB,YAAY,CAAC,EAAE,gBAAgB,GAC9B,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAuHtC;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,SAAS,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAA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C,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,EACD,YAAY,CAAC,EAAE,gBAAgB,GAC9B,OAAO,CACR,UAAU,CAAC;IACT,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CACH,CAmOA;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAuCzC"}
@@ -11,6 +11,7 @@ import { validateNotebookUrl } from "../../utils/security.js";
11
11
  import { getQuotaManager } from "../../quota/index.js";
12
12
  import { log } from "../../utils/logger.js";
13
13
  import { audit } from "../../utils/audit-logger.js";
14
+ import { getErrorAuditArgs, getSanitizedErrorMessage, resolveNotebookUrl, } from "./error-utils.js";
14
15
  export async function handleCreateNotebook(ctx, args, sendProgress) {
15
16
  log.info(`🔧 [TOOL] create_notebook called`);
16
17
  log.info(` Name: ${args.name}`);
@@ -35,7 +36,8 @@ export async function handleCreateNotebook(ctx, args, sendProgress) {
35
36
  try {
36
37
  new URL(source.value);
37
38
  }
38
- catch {
39
+ catch (err) {
40
+ log.debug(`notebook-creation: validating source URL: ${err instanceof Error ? err.message : String(err)}`);
39
41
  throw new Error(`Invalid URL: ${source.value}`);
40
42
  }
41
43
  }
@@ -47,6 +49,7 @@ export async function handleCreateNotebook(ctx, args, sendProgress) {
47
49
  log.warning(`⚠️ Quota limit: ${canCreate.reason}`);
48
50
  return {
49
51
  success: false,
52
+ data: null,
50
53
  error: canCreate.reason || "Notebook quota limit reached",
51
54
  };
52
55
  }
@@ -57,6 +60,7 @@ export async function handleCreateNotebook(ctx, args, sendProgress) {
57
60
  log.warning(`⚠️ Quota limit: ${reason}`);
58
61
  return {
59
62
  success: false,
63
+ data: null,
60
64
  error: reason,
61
65
  };
62
66
  }
@@ -101,14 +105,12 @@ export async function handleCreateNotebook(ctx, args, sendProgress) {
101
105
  };
102
106
  }
103
107
  catch (error) {
104
- const errorMessage = error instanceof Error ? error.message : String(error);
108
+ const errorMessage = getSanitizedErrorMessage(error);
105
109
  log.error(`❌ [TOOL] create_notebook failed: ${errorMessage}`);
106
- await audit.tool("create_notebook", {
107
- name: args.name,
108
- error: errorMessage,
109
- }, false, 0, errorMessage);
110
+ await audit.tool("create_notebook", getErrorAuditArgs("create_notebook", errorMessage), false, 0, errorMessage);
110
111
  return {
111
112
  success: false,
113
+ data: null,
112
114
  error: errorMessage,
113
115
  };
114
116
  }
@@ -169,7 +171,7 @@ export async function handleBatchCreateNotebooks(ctx, args, sendProgress) {
169
171
  }
170
172
  }
171
173
  catch (error) {
172
- const errorMessage = error instanceof Error ? error.message : String(error);
174
+ const errorMessage = getSanitizedErrorMessage(error);
173
175
  results.push({
174
176
  name: notebook.name,
175
177
  success: false,
@@ -201,10 +203,11 @@ export async function handleBatchCreateNotebooks(ctx, args, sendProgress) {
201
203
  };
202
204
  }
203
205
  catch (error) {
204
- const errorMessage = error instanceof Error ? error.message : String(error);
206
+ const errorMessage = getSanitizedErrorMessage(error);
205
207
  log.error(`❌ [TOOL] batch_create_notebooks failed: ${errorMessage}`);
206
208
  return {
207
209
  success: false,
210
+ data: null,
208
211
  error: errorMessage,
209
212
  };
210
213
  }
@@ -236,13 +239,12 @@ export async function handleSyncLibrary(ctx, args) {
236
239
  };
237
240
  }
238
241
  catch (error) {
239
- const errorMessage = error instanceof Error ? error.message : String(error);
242
+ const errorMessage = getSanitizedErrorMessage(error);
240
243
  log.error(`❌ [TOOL] sync_library failed: ${errorMessage}`);
241
- await audit.tool("sync_library", {
242
- error: errorMessage,
243
- }, false, 0, errorMessage);
244
+ await audit.tool("sync_library", getErrorAuditArgs("sync_library", errorMessage), false, 0, errorMessage);
244
245
  return {
245
246
  success: false,
247
+ data: null,
246
248
  error: errorMessage,
247
249
  };
248
250
  }
@@ -250,28 +252,7 @@ export async function handleSyncLibrary(ctx, args) {
250
252
  export async function handleListSources(ctx, args) {
251
253
  log.info(`🔧 [TOOL] list_sources called`);
252
254
  try {
253
- // Resolve notebook URL
254
- let notebookUrl = args.notebook_url;
255
- if (!notebookUrl && args.notebook_id) {
256
- const notebook = ctx.library.getNotebook(args.notebook_id);
257
- if (!notebook) {
258
- throw new Error(`Notebook not found in library: ${args.notebook_id}`);
259
- }
260
- notebookUrl = notebook.url;
261
- log.info(` Resolved notebook: ${notebook.name}`);
262
- }
263
- else if (!notebookUrl) {
264
- const active = ctx.library.getActiveNotebook();
265
- if (active) {
266
- notebookUrl = active.url;
267
- log.info(` Using active notebook: ${active.name}`);
268
- }
269
- else {
270
- throw new Error("No notebook specified. Provide notebook_id or notebook_url.");
271
- }
272
- }
273
- // Validate URL
274
- const safeUrl = validateNotebookUrl(notebookUrl);
255
+ const safeUrl = validateNotebookUrl(resolveNotebookUrl(ctx, args));
275
256
  // Get the shared context manager from session manager
276
257
  const contextManager = ctx.sessionManager.getContextManager();
277
258
  // List sources
@@ -284,10 +265,11 @@ export async function handleListSources(ctx, args) {
284
265
  };
285
266
  }
286
267
  catch (error) {
287
- const errorMessage = error instanceof Error ? error.message : String(error);
268
+ const errorMessage = getSanitizedErrorMessage(error);
288
269
  log.error(`❌ [TOOL] list_sources failed: ${errorMessage}`);
289
270
  return {
290
271
  success: false,
272
+ data: null,
291
273
  error: errorMessage,
292
274
  };
293
275
  }
@@ -303,28 +285,7 @@ export async function handleAddSource(ctx, args) {
303
285
  if (!["url", "text", "file"].includes(args.source.type)) {
304
286
  throw new Error(`Invalid source type: ${args.source.type}. Must be url, text, or file.`);
305
287
  }
306
- // Resolve notebook URL
307
- let notebookUrl = args.notebook_url;
308
- if (!notebookUrl && args.notebook_id) {
309
- const notebook = ctx.library.getNotebook(args.notebook_id);
310
- if (!notebook) {
311
- throw new Error(`Notebook not found in library: ${args.notebook_id}`);
312
- }
313
- notebookUrl = notebook.url;
314
- log.info(` Resolved notebook: ${notebook.name}`);
315
- }
316
- else if (!notebookUrl) {
317
- const active = ctx.library.getActiveNotebook();
318
- if (active) {
319
- notebookUrl = active.url;
320
- log.info(` Using active notebook: ${active.name}`);
321
- }
322
- else {
323
- throw new Error("No notebook specified. Provide notebook_id or notebook_url.");
324
- }
325
- }
326
- // Validate URL
327
- const safeUrl = validateNotebookUrl(notebookUrl);
288
+ const safeUrl = validateNotebookUrl(resolveNotebookUrl(ctx, args));
328
289
  // Get the shared context manager from session manager
329
290
  const contextManager = ctx.sessionManager.getContextManager();
330
291
  // Add source
@@ -343,18 +304,92 @@ export async function handleAddSource(ctx, args) {
343
304
  };
344
305
  }
345
306
  catch (error) {
346
- const errorMessage = error instanceof Error ? error.message : String(error);
307
+ const errorMessage = getSanitizedErrorMessage(error);
347
308
  log.error(`❌ [TOOL] add_source failed: ${errorMessage}`);
348
309
  return {
349
310
  success: false,
311
+ data: null,
350
312
  error: errorMessage,
351
313
  };
352
314
  }
353
315
  }
316
+ /**
317
+ * Resolve `add_folder` input path and enforce the allowlist/denylist.
318
+ *
319
+ * - Allowlist: `NLMCP_FOLDER_ALLOWLIST` (colon-separated absolute paths).
320
+ * Defaults to the user's home directory when unset.
321
+ * - Denylist: paths that touch common credential/config dirs are rejected
322
+ * even when inside an allowed base (defence in depth).
323
+ *
324
+ * Rationale: `add_folder` uploads every file it finds to Google's NotebookLM.
325
+ * Without constraints an authenticated caller can exfiltrate SSH keys,
326
+ * cloud credentials, or kernel interfaces via a legitimate-looking user
327
+ * action. See ISSUES.md:I316.
328
+ */
329
+ async function resolveFolderPath(userPath) {
330
+ const path = await import("path");
331
+ const os = await import("os");
332
+ if (!userPath || userPath.trim().length === 0) {
333
+ throw new Error("folder_path is required");
334
+ }
335
+ const resolved = path.resolve(userPath);
336
+ // Allowlist.
337
+ const envList = process.env.NLMCP_FOLDER_ALLOWLIST?.trim();
338
+ const allowedBases = envList && envList.length > 0
339
+ ? envList.split(":").map((p) => path.resolve(p.trim())).filter((p) => p.length > 0)
340
+ : [path.resolve(os.homedir())];
341
+ const inAllowedBase = allowedBases.some((base) => {
342
+ const rel = path.relative(base, resolved);
343
+ return rel === "" || (!rel.startsWith("..") && !path.isAbsolute(rel));
344
+ });
345
+ if (!inAllowedBase) {
346
+ throw new Error(`folder_path must be inside one of: ${allowedBases.join(", ")}. ` +
347
+ `Set NLMCP_FOLDER_ALLOWLIST to extend the list.`);
348
+ }
349
+ // Denylist (sensitive subpaths — checked after allowlist).
350
+ const deniedSegments = [
351
+ ".ssh",
352
+ ".aws",
353
+ ".gnupg",
354
+ ".docker",
355
+ ".kube",
356
+ ".config/gcloud",
357
+ ".config/git",
358
+ ".netrc",
359
+ ".npmrc",
360
+ ".mcpregistry_github_token",
361
+ ".mcpregistry_registry_token",
362
+ ];
363
+ const deniedAbsolute = ["/etc", "/root", "/proc", "/sys", "/var/log"];
364
+ const segments = resolved.split(path.sep);
365
+ for (const denied of deniedSegments) {
366
+ const parts = denied.split("/");
367
+ for (let i = 0; i <= segments.length - parts.length; i++) {
368
+ if (parts.every((p, j) => segments[i + j] === p)) {
369
+ throw new Error(`folder_path traverses a sensitive directory (${denied}); refusing to upload.`);
370
+ }
371
+ }
372
+ }
373
+ for (const denied of deniedAbsolute) {
374
+ if (resolved === denied || resolved.startsWith(denied + path.sep)) {
375
+ throw new Error(`folder_path is inside a protected system directory (${denied}); refusing to upload.`);
376
+ }
377
+ }
378
+ return resolved;
379
+ }
354
380
  export async function handleAddFolder(ctx, args, sendProgress) {
355
381
  const { promises: fs } = await import("fs");
356
382
  const path = await import("path");
357
- const folderPath = args.folder_path;
383
+ // Validate and resolve first so the denylist runs before any filesystem read.
384
+ let folderPath;
385
+ try {
386
+ folderPath = await resolveFolderPath(args.folder_path);
387
+ }
388
+ catch (error) {
389
+ const errorMessage = getSanitizedErrorMessage(error);
390
+ log.error(`❌ [TOOL] add_folder failed: ${errorMessage}`);
391
+ return { success: false, data: null, error: errorMessage };
392
+ }
358
393
  const recursive = args.recursive ?? false;
359
394
  const dryRun = args.dry_run ?? false;
360
395
  const fileTypes = (args.file_types ?? [".pdf", ".txt", ".md", ".docx"]).map((e) => e.startsWith(".") ? e.toLowerCase() : `.${e.toLowerCase()}`);
@@ -369,7 +404,8 @@ export async function handleAddFolder(ctx, args, sendProgress) {
369
404
  try {
370
405
  stat = await fs.stat(folderPath);
371
406
  }
372
- catch {
407
+ catch (err) {
408
+ log.debug(`notebook-creation: stat-ing folder path in bulk create handler: ${err instanceof Error ? err.message : String(err)}`);
373
409
  throw new Error(`Folder not found: ${folderPath}`);
374
410
  }
375
411
  if (!stat.isDirectory()) {
@@ -509,7 +545,7 @@ export async function handleAddFolder(ctx, args, sendProgress) {
509
545
  }
510
546
  }
511
547
  catch (err) {
512
- const msg = err instanceof Error ? err.message : String(err);
548
+ const msg = getSanitizedErrorMessage(err);
513
549
  failedFiles.push({ file: filePath, error: msg });
514
550
  log.warning(` ⚠️ Error: ${fileName} — ${msg}`);
515
551
  }
@@ -534,9 +570,9 @@ export async function handleAddFolder(ctx, args, sendProgress) {
534
570
  };
535
571
  }
536
572
  catch (error) {
537
- const errorMessage = error instanceof Error ? error.message : String(error);
573
+ const errorMessage = getSanitizedErrorMessage(error);
538
574
  log.error(`❌ [TOOL] add_folder failed: ${errorMessage}`);
539
- return { success: false, error: errorMessage };
575
+ return { success: false, data: null, error: errorMessage };
540
576
  }
541
577
  }
542
578
  export async function handleRemoveSource(ctx, args) {
@@ -547,28 +583,7 @@ export async function handleRemoveSource(ctx, args) {
547
583
  if (!args.source_id) {
548
584
  throw new Error("source_id is required");
549
585
  }
550
- // Resolve notebook URL
551
- let notebookUrl = args.notebook_url;
552
- if (!notebookUrl && args.notebook_id) {
553
- const notebook = ctx.library.getNotebook(args.notebook_id);
554
- if (!notebook) {
555
- throw new Error(`Notebook not found in library: ${args.notebook_id}`);
556
- }
557
- notebookUrl = notebook.url;
558
- log.info(` Resolved notebook: ${notebook.name}`);
559
- }
560
- else if (!notebookUrl) {
561
- const active = ctx.library.getActiveNotebook();
562
- if (active) {
563
- notebookUrl = active.url;
564
- log.info(` Using active notebook: ${active.name}`);
565
- }
566
- else {
567
- throw new Error("No notebook specified. Provide notebook_id or notebook_url.");
568
- }
569
- }
570
- // Validate URL
571
- const safeUrl = validateNotebookUrl(notebookUrl);
586
+ const safeUrl = validateNotebookUrl(resolveNotebookUrl(ctx, args));
572
587
  // Get the shared context manager from session manager
573
588
  const contextManager = ctx.sessionManager.getContextManager();
574
589
  // Remove source
@@ -587,10 +602,11 @@ export async function handleRemoveSource(ctx, args) {
587
602
  };
588
603
  }
589
604
  catch (error) {
590
- const errorMessage = error instanceof Error ? error.message : String(error);
605
+ const errorMessage = getSanitizedErrorMessage(error);
591
606
  log.error(`❌ [TOOL] remove_source failed: ${errorMessage}`);
592
607
  return {
593
608
  success: false,
609
+ data: null,
594
610
  error: errorMessage,
595
611
  };
596
612
  }