@roomi-fields/notebooklm-mcp 1.5.2 → 1.5.7

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 (294) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +219 -201
  3. package/deployment/INDEX.md +0 -0
  4. package/deployment/PACKAGE-FILES.txt +180 -180
  5. package/deployment/QUICK-START.md +0 -0
  6. package/deployment/docs/01-INSTALL.md +0 -0
  7. package/deployment/docs/02-CONFIGURATION.md +0 -0
  8. package/deployment/docs/03-API.md +99 -13
  9. package/deployment/docs/04-N8N-INTEGRATION.md +0 -0
  10. package/deployment/docs/05-TROUBLESHOOTING.md +0 -0
  11. package/deployment/docs/06-NOTEBOOK-LIBRARY.md +0 -0
  12. package/deployment/docs/07-AUTO-DISCOVERY.md +0 -0
  13. package/deployment/docs/08-DOCKER.md +303 -0
  14. package/deployment/docs/08-WSL-USAGE.md +0 -0
  15. package/deployment/docs/09-MULTI-INTERFACE.md +0 -0
  16. package/deployment/docs/10-CONTENT-MANAGEMENT.md +0 -0
  17. package/deployment/docs/11-MULTI-ACCOUNT.md +0 -0
  18. package/deployment/docs/README.md +9 -2
  19. package/deployment/scripts/README.md +0 -0
  20. package/deployment/scripts/install.ps1 +114 -114
  21. package/deployment/scripts/setup-auth.ps1 +217 -217
  22. package/deployment/scripts/start-server.ps1 +72 -72
  23. package/deployment/scripts/stop-server.ps1 +51 -51
  24. package/deployment/scripts/test-api.ps1 +651 -651
  25. package/deployment/scripts/test-auth.ps1 +0 -0
  26. package/deployment/scripts/test-auto-discovery.ps1 +295 -295
  27. package/deployment/scripts/test-cors.ps1 +398 -398
  28. package/deployment/scripts/test-errors.ps1 +581 -581
  29. package/deployment/scripts/test-server.ps1 +140 -140
  30. package/deployment/scripts/test-sessions.ps1 +426 -426
  31. package/deployment/scripts/test-validation.ps1 +299 -299
  32. package/dist/accounts/account-manager.d.ts +15 -0
  33. package/dist/accounts/account-manager.d.ts.map +1 -1
  34. package/dist/accounts/account-manager.js +104 -0
  35. package/dist/accounts/account-manager.js.map +1 -1
  36. package/dist/accounts/auto-login-manager.d.ts +0 -0
  37. package/dist/accounts/auto-login-manager.d.ts.map +1 -1
  38. package/dist/accounts/auto-login-manager.js +45 -28
  39. package/dist/accounts/auto-login-manager.js.map +1 -1
  40. package/dist/accounts/crypto.d.ts +0 -0
  41. package/dist/accounts/crypto.d.ts.map +0 -0
  42. package/dist/accounts/crypto.js +0 -0
  43. package/dist/accounts/crypto.js.map +0 -0
  44. package/dist/accounts/index.d.ts +0 -0
  45. package/dist/accounts/index.d.ts.map +0 -0
  46. package/dist/accounts/index.js +0 -0
  47. package/dist/accounts/index.js.map +0 -0
  48. package/dist/accounts/types.d.ts +0 -0
  49. package/dist/accounts/types.d.ts.map +0 -0
  50. package/dist/accounts/types.js +0 -0
  51. package/dist/accounts/types.js.map +0 -0
  52. package/dist/auth/auth-manager.d.ts +1 -1
  53. package/dist/auth/auth-manager.d.ts.map +1 -1
  54. package/dist/auth/auth-manager.js +33 -13
  55. package/dist/auth/auth-manager.js.map +1 -1
  56. package/dist/auto-discovery/auto-discovery.d.ts +0 -0
  57. package/dist/auto-discovery/auto-discovery.d.ts.map +0 -0
  58. package/dist/auto-discovery/auto-discovery.js +0 -0
  59. package/dist/auto-discovery/auto-discovery.js.map +0 -0
  60. package/dist/cli/accounts.d.ts +0 -0
  61. package/dist/cli/accounts.d.ts.map +0 -0
  62. package/dist/cli/accounts.js +0 -0
  63. package/dist/cli/accounts.js.map +0 -0
  64. package/dist/cli/de-auth.d.ts +0 -0
  65. package/dist/cli/de-auth.d.ts.map +0 -0
  66. package/dist/cli/de-auth.js +0 -0
  67. package/dist/cli/de-auth.js.map +0 -0
  68. package/dist/cli/help.d.ts +0 -0
  69. package/dist/cli/help.d.ts.map +0 -0
  70. package/dist/cli/help.js +0 -0
  71. package/dist/cli/help.js.map +0 -0
  72. package/dist/cli/setup-auth.d.ts +0 -0
  73. package/dist/cli/setup-auth.d.ts.map +0 -0
  74. package/dist/cli/setup-auth.js +18 -10
  75. package/dist/cli/setup-auth.js.map +1 -1
  76. package/dist/config.d.ts +1 -0
  77. package/dist/config.d.ts.map +1 -1
  78. package/dist/config.js +15 -1
  79. package/dist/config.js.map +1 -1
  80. package/dist/content/content-generator.d.ts +0 -0
  81. package/dist/content/content-generator.d.ts.map +0 -0
  82. package/dist/content/content-generator.js +0 -0
  83. package/dist/content/content-generator.js.map +0 -0
  84. package/dist/content/content-manager.d.ts +0 -0
  85. package/dist/content/content-manager.d.ts.map +0 -0
  86. package/dist/content/content-manager.js +0 -0
  87. package/dist/content/content-manager.js.map +0 -0
  88. package/dist/content/content-templates.d.ts +0 -0
  89. package/dist/content/content-templates.d.ts.map +0 -0
  90. package/dist/content/content-templates.js +0 -0
  91. package/dist/content/content-templates.js.map +0 -0
  92. package/dist/content/index.d.ts +0 -0
  93. package/dist/content/index.d.ts.map +0 -0
  94. package/dist/content/index.js +0 -0
  95. package/dist/content/index.js.map +0 -0
  96. package/dist/content/types.d.ts +0 -0
  97. package/dist/content/types.d.ts.map +0 -0
  98. package/dist/content/types.js +0 -0
  99. package/dist/content/types.js.map +0 -0
  100. package/dist/errors.d.ts +0 -0
  101. package/dist/errors.d.ts.map +0 -0
  102. package/dist/errors.js +0 -0
  103. package/dist/errors.js.map +0 -0
  104. package/dist/http-wrapper.d.ts +0 -0
  105. package/dist/http-wrapper.d.ts.map +1 -1
  106. package/dist/http-wrapper.js +275 -7
  107. package/dist/http-wrapper.js.map +1 -1
  108. package/dist/i18n/en.json +0 -0
  109. package/dist/i18n/fr.json +0 -0
  110. package/dist/i18n/index.d.ts +0 -0
  111. package/dist/i18n/index.d.ts.map +0 -0
  112. package/dist/i18n/index.js +0 -0
  113. package/dist/i18n/index.js.map +0 -0
  114. package/dist/index.d.ts +0 -0
  115. package/dist/index.d.ts.map +0 -0
  116. package/dist/index.js +0 -0
  117. package/dist/index.js.map +0 -0
  118. package/dist/library/notebook-library.d.ts +0 -0
  119. package/dist/library/notebook-library.d.ts.map +0 -0
  120. package/dist/library/notebook-library.js +0 -0
  121. package/dist/library/notebook-library.js.map +0 -0
  122. package/dist/library/types.d.ts +0 -0
  123. package/dist/library/types.d.ts.map +0 -0
  124. package/dist/library/types.js +0 -0
  125. package/dist/library/types.js.map +0 -0
  126. package/dist/session/browser-session.d.ts +0 -0
  127. package/dist/session/browser-session.d.ts.map +1 -1
  128. package/dist/session/browser-session.js +215 -91
  129. package/dist/session/browser-session.js.map +1 -1
  130. package/dist/session/session-manager.d.ts +0 -0
  131. package/dist/session/session-manager.d.ts.map +0 -0
  132. package/dist/session/session-manager.js +0 -0
  133. package/dist/session/session-manager.js.map +0 -0
  134. package/dist/session/shared-context-manager.d.ts +0 -0
  135. package/dist/session/shared-context-manager.d.ts.map +1 -1
  136. package/dist/session/shared-context-manager.js +38 -5
  137. package/dist/session/shared-context-manager.js.map +1 -1
  138. package/dist/startup/startup-manager.d.ts +60 -0
  139. package/dist/startup/startup-manager.d.ts.map +1 -0
  140. package/dist/startup/startup-manager.js +468 -0
  141. package/dist/startup/startup-manager.js.map +1 -0
  142. package/dist/stdio-http-proxy.d.ts +0 -0
  143. package/dist/stdio-http-proxy.d.ts.map +0 -0
  144. package/dist/stdio-http-proxy.js +91 -16
  145. package/dist/stdio-http-proxy.js.map +1 -1
  146. package/dist/tools/index.d.ts +1 -0
  147. package/dist/tools/index.d.ts.map +1 -1
  148. package/dist/tools/index.js +55 -34
  149. package/dist/tools/index.js.map +1 -1
  150. package/dist/types.d.ts +0 -0
  151. package/dist/types.d.ts.map +0 -0
  152. package/dist/types.js +0 -0
  153. package/dist/types.js.map +0 -0
  154. package/dist/utils/citation-extractor.d.ts +6 -7
  155. package/dist/utils/citation-extractor.d.ts.map +1 -1
  156. package/dist/utils/citation-extractor.js +138 -303
  157. package/dist/utils/citation-extractor.js.map +1 -1
  158. package/dist/utils/cleanup-manager.d.ts +0 -0
  159. package/dist/utils/cleanup-manager.d.ts.map +0 -0
  160. package/dist/utils/cleanup-manager.js +0 -0
  161. package/dist/utils/cleanup-manager.js.map +0 -0
  162. package/dist/utils/logger.d.ts +0 -0
  163. package/dist/utils/logger.d.ts.map +0 -0
  164. package/dist/utils/logger.js +0 -0
  165. package/dist/utils/logger.js.map +0 -0
  166. package/dist/utils/page-utils.d.ts +0 -0
  167. package/dist/utils/page-utils.d.ts.map +1 -1
  168. package/dist/utils/page-utils.js +12 -13
  169. package/dist/utils/page-utils.js.map +1 -1
  170. package/dist/utils/stealth-utils.d.ts +0 -0
  171. package/dist/utils/stealth-utils.d.ts.map +0 -0
  172. package/dist/utils/stealth-utils.js +0 -0
  173. package/dist/utils/stealth-utils.js.map +0 -0
  174. package/docs/ADDING_A_LANGUAGE.md +0 -0
  175. package/docs/ARCHITECTURE_MIGRATION_STUDY.md +0 -0
  176. package/docs/CHROME_PROFILE_LIMITATION.md +0 -0
  177. package/docs/MULTI_ACCOUNT_SYSTEM.md +0 -0
  178. package/docs/archive/auto-discovery-complet.md +906 -0
  179. package/package.json +4 -2
  180. package/scripts/add-totp.ts +110 -0
  181. package/scripts/archive/add-and-activate-notebook.ps1 +0 -0
  182. package/scripts/archive/add-new-notebook.ps1 +0 -0
  183. package/scripts/archive/add-rom1pey.ps1 +0 -0
  184. package/scripts/archive/add-rpmonster.ps1 +0 -0
  185. package/scripts/archive/add-source-debug.ps1 +0 -0
  186. package/scripts/archive/add-source-e2e.ps1 +0 -0
  187. package/scripts/archive/add-source-visible.ps1 +0 -0
  188. package/scripts/archive/add-test-notebook.ps1 +0 -0
  189. package/scripts/archive/add-test-source.ps1 +0 -0
  190. package/scripts/archive/capture-screen.ps1 +0 -0
  191. package/scripts/archive/change-language.mjs +0 -0
  192. package/scripts/archive/change-language.ts +0 -0
  193. package/scripts/archive/check-account.ps1 +0 -0
  194. package/scripts/archive/check-notebook-2.ps1 +0 -0
  195. package/scripts/archive/check-test-notebook.ps1 +0 -0
  196. package/scripts/archive/create-notebook-auto.ps1 +0 -0
  197. package/scripts/archive/create-notebook.ps1 +0 -0
  198. package/scripts/archive/create-rom1pey-notebook.ps1 +0 -0
  199. package/scripts/archive/create-rom1pey.ps1 +0 -0
  200. package/scripts/archive/create-test-notebook-fresh.ps1 +0 -0
  201. package/scripts/archive/create-test-notebook.ps1 +0 -0
  202. package/scripts/archive/debug-add-source-auto.ps1 +0 -0
  203. package/scripts/archive/debug-add-source.ps1 +0 -0
  204. package/scripts/archive/debug-add-text-source.ps1 +0 -0
  205. package/scripts/archive/debug-home.ps1 +0 -0
  206. package/scripts/archive/debug-selectors.ps1 +0 -0
  207. package/scripts/archive/debug-sources-panel.ps1 +0 -0
  208. package/scripts/archive/debug-ui.ps1 +0 -0
  209. package/scripts/archive/discover-home.ps1 +0 -0
  210. package/scripts/archive/kill-automation-chrome.ps1 +0 -0
  211. package/scripts/archive/list-my-notebooks.ps1 +0 -0
  212. package/scripts/archive/navigate-home-visible.ps1 +0 -0
  213. package/scripts/archive/navigate-home.ps1 +0 -0
  214. package/scripts/archive/run-e2e-english.ps1 +0 -0
  215. package/scripts/archive/run-e2e-rom1pey-v2.ps1 +0 -0
  216. package/scripts/archive/run-e2e-rom1pey.ps1 +0 -0
  217. package/scripts/archive/setup-english-test.ps1 +0 -0
  218. package/scripts/archive/setup-test-notebook.ps1 +0 -0
  219. package/scripts/archive/simple-add-source.ps1 +0 -0
  220. package/scripts/archive/t10.ps1 +0 -0
  221. package/scripts/archive/t20.ps1 +0 -0
  222. package/scripts/archive/t30.ps1 +0 -0
  223. package/scripts/archive/t31.ps1 +0 -0
  224. package/scripts/archive/t32.ps1 +0 -0
  225. package/scripts/archive/t39.ps1 +0 -0
  226. package/scripts/archive/t40.ps1 +0 -0
  227. package/scripts/archive/t53.ps1 +0 -0
  228. package/scripts/archive/t54.ps1 +0 -0
  229. package/scripts/archive/t55.ps1 +0 -0
  230. package/scripts/archive/t9.ps1 +0 -0
  231. package/scripts/archive/test-access.ps1 +0 -0
  232. package/scripts/archive/test-add-delete-source.ps1 +0 -0
  233. package/scripts/archive/test-add-source-visible.ps1 +0 -0
  234. package/scripts/archive/test-add-source.ps1 +0 -0
  235. package/scripts/archive/test-add-text-debug.ps1 +0 -0
  236. package/scripts/archive/test-add-text-source.ps1 +0 -0
  237. package/scripts/archive/test-add-url-source.ps1 +0 -0
  238. package/scripts/archive/test-ask-ascii.ps1 +0 -0
  239. package/scripts/archive/test-ask-cnv.ps1 +0 -0
  240. package/scripts/archive/test-ask-headed.ps1 +0 -0
  241. package/scripts/archive/test-ask-ifs.ps1 +0 -0
  242. package/scripts/archive/test-ask-now.ps1 +0 -0
  243. package/scripts/archive/test-ask-real.ps1 +0 -0
  244. package/scripts/archive/test-ask-visible.ps1 +0 -0
  245. package/scripts/archive/test-create-notebook.ps1 +0 -0
  246. package/scripts/archive/test-create-then-add.ps1 +0 -0
  247. package/scripts/archive/test-delete-source.ps1 +0 -0
  248. package/scripts/archive/test-e2e-notebook.ps1 +0 -0
  249. package/scripts/archive/test-english-notebook.ps1 +0 -0
  250. package/scripts/archive/test-english.ps1 +0 -0
  251. package/scripts/archive/test-full-custom-instructions.ps1 +0 -0
  252. package/scripts/archive/test-full-infographic.ps1 +0 -0
  253. package/scripts/archive/test-full-language.ps1 +0 -0
  254. package/scripts/archive/test-full-presentation.ps1 +0 -0
  255. package/scripts/archive/test-full-report.ps1 +0 -0
  256. package/scripts/archive/test-full-source-selection.ps1 +0 -0
  257. package/scripts/archive/test-full-video-brief.ps1 +0 -0
  258. package/scripts/archive/test-full-video-explainer.ps1 +0 -0
  259. package/scripts/archive/test-full-video-styles.ps1 +0 -0
  260. package/scripts/archive/test-generate-report.ps1 +0 -0
  261. package/scripts/archive/test-generate-study-guide.ps1 +0 -0
  262. package/scripts/archive/test-headed-ask.ps1 +0 -0
  263. package/scripts/archive/test-headed-now.ps1 +0 -0
  264. package/scripts/archive/test-headed.ps1 +0 -0
  265. package/scripts/archive/test-hello.ps1 +0 -0
  266. package/scripts/archive/test-i18n-studio.ps1 +0 -0
  267. package/scripts/archive/test-i18n.ps1 +0 -0
  268. package/scripts/archive/test-manual-headed.ps1 +0 -0
  269. package/scripts/archive/test-mathieu-quota.ps1 +0 -0
  270. package/scripts/archive/test-notebook-1.ps1 +0 -0
  271. package/scripts/archive/test-notebook-2-sources.ps1 +0 -0
  272. package/scripts/archive/test-notebook1.ps1 +0 -0
  273. package/scripts/archive/test-personal-notebook.ps1 +0 -0
  274. package/scripts/archive/test-rate-limit.ps1 +0 -0
  275. package/scripts/archive/test-real-ask.ps1 +0 -0
  276. package/scripts/archive/test-real-ask2.ps1 +0 -0
  277. package/scripts/archive/test-rom1pey.ps1 +0 -0
  278. package/scripts/archive/test-rotation-complete.ps1 +0 -0
  279. package/scripts/archive/test-rotation.ps1 +0 -0
  280. package/scripts/archive/test-show-browser.ps1 +0 -0
  281. package/scripts/archive/test-update-notebook.ps1 +0 -0
  282. package/scripts/archive/verify-language-slow.ps1 +0 -0
  283. package/scripts/archive/verify-language.ps1 +0 -0
  284. package/scripts/check-server.ps1 +0 -0
  285. package/scripts/docker-entrypoint.sh +25 -0
  286. package/scripts/mcp-proxy-hidden.ps1 +31 -0
  287. package/scripts/mcp-wsl-helper.sh +146 -146
  288. package/scripts/start-server-hidden.vbs +13 -0
  289. package/scripts/start-server.ps1 +0 -0
  290. package/scripts/start-vnc.sh +37 -0
  291. package/scripts/stop-server.bat +5 -0
  292. package/scripts/stop-server.ps1 +0 -0
  293. package/scripts/switch-account-language.sh +0 -0
  294. package/scripts/test-account.ps1 +0 -0
File without changes
@@ -1,295 +1,295 @@
1
- #!/usr/bin/env pwsh
2
- #Requires -Version 5.1
3
-
4
- <#
5
- .SYNOPSIS
6
- Test the Auto-Discovery endpoint
7
-
8
- .DESCRIPTION
9
- Tests the POST /notebooks/auto-discover endpoint with various scenarios:
10
- - Valid NotebookLM URL
11
- - Invalid URL format
12
- - Missing URL field
13
-
14
- .PARAMETER ServerUrl
15
- Base URL of the NotebookLM MCP HTTP server (default: http://localhost:3000)
16
-
17
- .PARAMETER NotebookUrl
18
- Optional: NotebookLM notebook URL to test with
19
-
20
- .PARAMETER TestAll
21
- Test all public notebooks (default: false)
22
-
23
- .EXAMPLE
24
- .\test-auto-discovery.ps1
25
- # Tests with prompts for notebook URL
26
-
27
- .EXAMPLE
28
- .\test-auto-discovery.ps1 -NotebookUrl "https://notebooklm.google.com/notebook/abc123"
29
- # Tests with specific notebook URL
30
-
31
- .EXAMPLE
32
- .\test-auto-discovery.ps1 -TestAll
33
- # Tests with all 5 public notebooks
34
- #>
35
-
36
- param(
37
- [string]$ServerUrl = "http://localhost:3000",
38
- [string]$NotebookUrl = "",
39
- [switch]$TestAll = $false
40
- )
41
-
42
- # Public test notebooks
43
- $PublicNotebooks = @(
44
- "https://notebooklm.google.com/notebook/0d5cd576-2583-4835-8848-a5b7b6a97cea",
45
- "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
46
- "https://notebooklm.google.com/notebook/a09e40ad-d41f-43af-a3ca-5fc82bd459e5",
47
- "https://notebooklm.google.com/notebook/19bde485-a9c1-4809-8884-e872b2b67b44",
48
- "https://notebooklm.google.com/notebook/19fdf6bd-1975-40a3-9801-c554130bc64a"
49
- )
50
-
51
- # Colors
52
- function Write-Success { param([string]$Message) Write-Host "✅ $Message" -ForegroundColor Green }
53
- function Write-Info { param([string]$Message) Write-Host "ℹ️ $Message" -ForegroundColor Cyan }
54
- function Write-Warning-Custom { param([string]$Message) Write-Host "⚠️ $Message" -ForegroundColor Yellow }
55
- function Write-Error-Custom { param([string]$Message) Write-Host "❌ $Message" -ForegroundColor Red }
56
-
57
- # Banner
58
- Write-Host "`n╔════════════════════════════════════════════════════════╗" -ForegroundColor Magenta
59
- Write-Host "║ ║" -ForegroundColor Magenta
60
- Write-Host "║ AUTO-DISCOVERY ENDPOINT TESTS ║" -ForegroundColor Cyan
61
- Write-Host "║ ║" -ForegroundColor Magenta
62
- Write-Host "╚════════════════════════════════════════════════════════╝`n" -ForegroundColor Magenta
63
-
64
- Write-Info "Testing server: $ServerUrl"
65
- Write-Host ""
66
-
67
- # Check server is running
68
- Write-Info "Checking if server is accessible..."
69
- try {
70
- $health = Invoke-RestMethod -Uri "$ServerUrl/health" -Method GET -ErrorAction Stop
71
- Write-Success "Server is running"
72
- } catch {
73
- Write-Error-Custom "Server is not accessible at $ServerUrl"
74
- Write-Info "Start the server with: npm run daemon:start"
75
- exit 1
76
- }
77
-
78
- Write-Host ""
79
-
80
- # Test counter
81
- $totalTests = 0
82
- $passedTests = 0
83
- $failedTests = 0
84
-
85
- # ============================================================================
86
- # Test 1: Missing URL field
87
- # ============================================================================
88
- $totalTests++
89
- Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
90
- Write-Info "[Test 1/$totalTests] Missing URL field (should return 400)"
91
- Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
92
-
93
- try {
94
- $body = @{} | ConvertTo-Json
95
- $response = Invoke-RestMethod -Uri "$ServerUrl/notebooks/auto-discover" -Method POST -Body $body -ContentType "application/json" -ErrorAction Stop
96
- Write-Error-Custom "Test failed: Should have returned 400 error"
97
- $failedTests++
98
- } catch {
99
- if ($_.Exception.Response.StatusCode -eq 400) {
100
- Write-Success "Correctly returned 400 Bad Request"
101
- $passedTests++
102
- } else {
103
- Write-Error-Custom "Wrong error code: $($_.Exception.Response.StatusCode)"
104
- $failedTests++
105
- }
106
- }
107
-
108
- Write-Host ""
109
-
110
- # ============================================================================
111
- # Test 2: Invalid URL format
112
- # ============================================================================
113
- $totalTests++
114
- Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
115
- Write-Info "[Test 2/$totalTests] Invalid URL format (should return 400)"
116
- Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
117
-
118
- try {
119
- $body = @{
120
- url = "https://example.com/not-a-notebooklm-url"
121
- } | ConvertTo-Json
122
-
123
- $response = Invoke-RestMethod -Uri "$ServerUrl/notebooks/auto-discover" -Method POST -Body $body -ContentType "application/json" -ErrorAction Stop
124
- Write-Error-Custom "Test failed: Should have returned 400 error"
125
- $failedTests++
126
- } catch {
127
- if ($_.Exception.Response.StatusCode -eq 400) {
128
- Write-Success "Correctly returned 400 Bad Request"
129
- $passedTests++
130
- } else {
131
- Write-Error-Custom "Wrong error code: $($_.Exception.Response.StatusCode)"
132
- $failedTests++
133
- }
134
- }
135
-
136
- Write-Host ""
137
-
138
- # ============================================================================
139
- # Test 3: Valid NotebookLM URL (requires real notebook)
140
- # ============================================================================
141
-
142
- # Determine which notebooks to test
143
- $NotebooksToTest = @()
144
-
145
- if ($TestAll) {
146
- Write-Info "Testing ALL public notebooks (5 notebooks)"
147
- $NotebooksToTest = $PublicNotebooks
148
- } elseif ($NotebookUrl) {
149
- Write-Info "Testing provided notebook URL"
150
- $NotebooksToTest = @($NotebookUrl)
151
- } else {
152
- Write-Host ""
153
- Write-Info "To test auto-discovery, provide a valid NotebookLM URL."
154
- Write-Host "Format: https://notebooklm.google.com/notebook/[id]" -ForegroundColor White
155
- Write-Host ""
156
- Write-Host "Available public test notebooks:" -ForegroundColor White
157
- for ($i = 0; $i -lt $PublicNotebooks.Count; $i++) {
158
- Write-Host " $($i + 1). $($PublicNotebooks[$i])" -ForegroundColor Gray
159
- }
160
- Write-Host ""
161
- $NotebookUrl = Read-Host "Enter NotebookLM URL (or press Enter to skip)"
162
-
163
- if ($NotebookUrl) {
164
- $NotebooksToTest = @($NotebookUrl)
165
- }
166
- }
167
-
168
- if ($NotebooksToTest.Count -eq 0) {
169
- Write-Warning-Custom "Skipping: No NotebookLM URL provided"
170
- Write-Info "Rerun with -NotebookUrl parameter or -TestAll to test this"
171
- Write-Host ""
172
- } else {
173
- # Test each notebook
174
- foreach ($TestUrl in $NotebooksToTest) {
175
- $totalTests++
176
- $testNum = $totalTests
177
-
178
- Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
179
- Write-Info "[Test $testNum] Valid NotebookLM URL auto-discovery"
180
- Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
181
- Write-Info "Testing with: $TestUrl"
182
- Write-Warning-Custom "This may take 20-30 seconds (querying NotebookLM)..."
183
- Write-Host ""
184
-
185
- try {
186
- $body = @{
187
- url = $TestUrl
188
- } | ConvertTo-Json
189
-
190
- $response = Invoke-RestMethod -Uri "$ServerUrl/notebooks/auto-discover" -Method POST -Body $body -ContentType "application/json" -ErrorAction Stop
191
-
192
- if ($response.success) {
193
- Write-Success "Auto-discovery successful!"
194
- Write-Host ""
195
- Write-Info "Generated Metadata:"
196
- Write-Host " Name: $($response.notebook.name)" -ForegroundColor White
197
- Write-Host " Description: $($response.notebook.description)" -ForegroundColor White
198
- Write-Host " Topics: $($response.notebook.topics -join ', ')" -ForegroundColor White
199
- Write-Host " Auto-generated: $($response.notebook.auto_generated)" -ForegroundColor White
200
- Write-Host ""
201
-
202
- # Validate format
203
- $validations = @()
204
-
205
- # Check name format (kebab-case, 3 words max)
206
- if ($response.notebook.name -match '^[a-z0-9]+(-[a-z0-9]+){0,2}$') {
207
- $validations += "✅ Name format valid (kebab-case)"
208
- } else {
209
- $validations += "❌ Name format invalid: $($response.notebook.name)"
210
- }
211
-
212
- # Check description length (<= 150 chars)
213
- if ($response.notebook.description.Length -le 150) {
214
- $validations += "✅ Description length valid ($($response.notebook.description.Length) chars)"
215
- } else {
216
- $validations += "❌ Description too long: $($response.notebook.description.Length) chars"
217
- }
218
-
219
- # Check topics count (8-10)
220
- $topicCount = $response.notebook.topics.Count
221
- if ($topicCount -ge 8 -and $topicCount -le 10) {
222
- $validations += "✅ Topics count valid ($topicCount)"
223
- } else {
224
- $validations += "❌ Topics count invalid: $topicCount (must be 8-10)"
225
- }
226
-
227
- # Check auto_generated flag
228
- if ($response.notebook.auto_generated -eq $true) {
229
- $validations += "✅ Auto-generated flag set"
230
- } else {
231
- $validations += "❌ Auto-generated flag not set"
232
- }
233
-
234
- Write-Info "Validation Results:"
235
- foreach ($validation in $validations) {
236
- Write-Host " $validation"
237
- }
238
-
239
- if ($validations -match "❌") {
240
- Write-Error-Custom "Metadata validation failed"
241
- $failedTests++
242
- } else {
243
- Write-Success "All metadata validations passed"
244
- $passedTests++
245
- }
246
- } else {
247
- Write-Error-Custom "Auto-discovery failed: $($response.error)"
248
- $failedTests++
249
- }
250
- } catch {
251
- Write-Error-Custom "Request failed: $($_.Exception.Message)"
252
- if ($_.ErrorDetails.Message) {
253
- $errorObj = $_.ErrorDetails.Message | ConvertFrom-Json
254
- Write-Host " Error: $($errorObj.error)" -ForegroundColor Red
255
- }
256
- $failedTests++
257
- }
258
-
259
- Write-Host ""
260
- }
261
- }
262
-
263
- Write-Host ""
264
-
265
- # ============================================================================
266
- # Summary
267
- # ============================================================================
268
- Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Gray
269
- Write-Host "║ ║" -ForegroundColor Gray
270
- Write-Host "║ TEST SUMMARY ║" -ForegroundColor Cyan
271
- Write-Host "║ ║" -ForegroundColor Gray
272
- Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Gray
273
- Write-Host ""
274
-
275
- Write-Host "Total tests: $totalTests" -ForegroundColor White
276
- Write-Host "Passed: $passedTests" -ForegroundColor Green
277
- Write-Host "Failed: $failedTests" -ForegroundColor $(if ($failedTests -gt 0) { "Red" } else { "Gray" })
278
- Write-Host "Success rate: $([math]::Round(($passedTests / $totalTests) * 100, 1))%" -ForegroundColor White
279
- Write-Host ""
280
-
281
- if ($failedTests -gt 0) {
282
- Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Red
283
- Write-Host "║ ║" -ForegroundColor Red
284
- Write-Host "║ ❌ SOME TESTS FAILED ║" -ForegroundColor Red
285
- Write-Host "║ ║" -ForegroundColor Red
286
- Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Red
287
- exit 1
288
- } else {
289
- Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Green
290
- Write-Host "║ ║" -ForegroundColor Green
291
- Write-Host "║ ✅ ALL TESTS PASSED ║" -ForegroundColor Green
292
- Write-Host "║ ║" -ForegroundColor Green
293
- Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Green
294
- exit 0
295
- }
1
+ #!/usr/bin/env pwsh
2
+ #Requires -Version 5.1
3
+
4
+ <#
5
+ .SYNOPSIS
6
+ Test the Auto-Discovery endpoint
7
+
8
+ .DESCRIPTION
9
+ Tests the POST /notebooks/auto-discover endpoint with various scenarios:
10
+ - Valid NotebookLM URL
11
+ - Invalid URL format
12
+ - Missing URL field
13
+
14
+ .PARAMETER ServerUrl
15
+ Base URL of the NotebookLM MCP HTTP server (default: http://localhost:3000)
16
+
17
+ .PARAMETER NotebookUrl
18
+ Optional: NotebookLM notebook URL to test with
19
+
20
+ .PARAMETER TestAll
21
+ Test all public notebooks (default: false)
22
+
23
+ .EXAMPLE
24
+ .\test-auto-discovery.ps1
25
+ # Tests with prompts for notebook URL
26
+
27
+ .EXAMPLE
28
+ .\test-auto-discovery.ps1 -NotebookUrl "https://notebooklm.google.com/notebook/abc123"
29
+ # Tests with specific notebook URL
30
+
31
+ .EXAMPLE
32
+ .\test-auto-discovery.ps1 -TestAll
33
+ # Tests with all 5 public notebooks
34
+ #>
35
+
36
+ param(
37
+ [string]$ServerUrl = "http://localhost:3000",
38
+ [string]$NotebookUrl = "",
39
+ [switch]$TestAll = $false
40
+ )
41
+
42
+ # Public test notebooks
43
+ $PublicNotebooks = @(
44
+ "https://notebooklm.google.com/notebook/0d5cd576-2583-4835-8848-a5b7b6a97cea",
45
+ "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
46
+ "https://notebooklm.google.com/notebook/a09e40ad-d41f-43af-a3ca-5fc82bd459e5",
47
+ "https://notebooklm.google.com/notebook/19bde485-a9c1-4809-8884-e872b2b67b44",
48
+ "https://notebooklm.google.com/notebook/19fdf6bd-1975-40a3-9801-c554130bc64a"
49
+ )
50
+
51
+ # Colors
52
+ function Write-Success { param([string]$Message) Write-Host "✅ $Message" -ForegroundColor Green }
53
+ function Write-Info { param([string]$Message) Write-Host "ℹ️ $Message" -ForegroundColor Cyan }
54
+ function Write-Warning-Custom { param([string]$Message) Write-Host "⚠️ $Message" -ForegroundColor Yellow }
55
+ function Write-Error-Custom { param([string]$Message) Write-Host "❌ $Message" -ForegroundColor Red }
56
+
57
+ # Banner
58
+ Write-Host "`n╔════════════════════════════════════════════════════════╗" -ForegroundColor Magenta
59
+ Write-Host "║ ║" -ForegroundColor Magenta
60
+ Write-Host "║ AUTO-DISCOVERY ENDPOINT TESTS ║" -ForegroundColor Cyan
61
+ Write-Host "║ ║" -ForegroundColor Magenta
62
+ Write-Host "╚════════════════════════════════════════════════════════╝`n" -ForegroundColor Magenta
63
+
64
+ Write-Info "Testing server: $ServerUrl"
65
+ Write-Host ""
66
+
67
+ # Check server is running
68
+ Write-Info "Checking if server is accessible..."
69
+ try {
70
+ $health = Invoke-RestMethod -Uri "$ServerUrl/health" -Method GET -ErrorAction Stop
71
+ Write-Success "Server is running"
72
+ } catch {
73
+ Write-Error-Custom "Server is not accessible at $ServerUrl"
74
+ Write-Info "Start the server with: npm run daemon:start"
75
+ exit 1
76
+ }
77
+
78
+ Write-Host ""
79
+
80
+ # Test counter
81
+ $totalTests = 0
82
+ $passedTests = 0
83
+ $failedTests = 0
84
+
85
+ # ============================================================================
86
+ # Test 1: Missing URL field
87
+ # ============================================================================
88
+ $totalTests++
89
+ Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
90
+ Write-Info "[Test 1/$totalTests] Missing URL field (should return 400)"
91
+ Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
92
+
93
+ try {
94
+ $body = @{} | ConvertTo-Json
95
+ $response = Invoke-RestMethod -Uri "$ServerUrl/notebooks/auto-discover" -Method POST -Body $body -ContentType "application/json" -ErrorAction Stop
96
+ Write-Error-Custom "Test failed: Should have returned 400 error"
97
+ $failedTests++
98
+ } catch {
99
+ if ($_.Exception.Response.StatusCode -eq 400) {
100
+ Write-Success "Correctly returned 400 Bad Request"
101
+ $passedTests++
102
+ } else {
103
+ Write-Error-Custom "Wrong error code: $($_.Exception.Response.StatusCode)"
104
+ $failedTests++
105
+ }
106
+ }
107
+
108
+ Write-Host ""
109
+
110
+ # ============================================================================
111
+ # Test 2: Invalid URL format
112
+ # ============================================================================
113
+ $totalTests++
114
+ Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
115
+ Write-Info "[Test 2/$totalTests] Invalid URL format (should return 400)"
116
+ Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
117
+
118
+ try {
119
+ $body = @{
120
+ url = "https://example.com/not-a-notebooklm-url"
121
+ } | ConvertTo-Json
122
+
123
+ $response = Invoke-RestMethod -Uri "$ServerUrl/notebooks/auto-discover" -Method POST -Body $body -ContentType "application/json" -ErrorAction Stop
124
+ Write-Error-Custom "Test failed: Should have returned 400 error"
125
+ $failedTests++
126
+ } catch {
127
+ if ($_.Exception.Response.StatusCode -eq 400) {
128
+ Write-Success "Correctly returned 400 Bad Request"
129
+ $passedTests++
130
+ } else {
131
+ Write-Error-Custom "Wrong error code: $($_.Exception.Response.StatusCode)"
132
+ $failedTests++
133
+ }
134
+ }
135
+
136
+ Write-Host ""
137
+
138
+ # ============================================================================
139
+ # Test 3: Valid NotebookLM URL (requires real notebook)
140
+ # ============================================================================
141
+
142
+ # Determine which notebooks to test
143
+ $NotebooksToTest = @()
144
+
145
+ if ($TestAll) {
146
+ Write-Info "Testing ALL public notebooks (5 notebooks)"
147
+ $NotebooksToTest = $PublicNotebooks
148
+ } elseif ($NotebookUrl) {
149
+ Write-Info "Testing provided notebook URL"
150
+ $NotebooksToTest = @($NotebookUrl)
151
+ } else {
152
+ Write-Host ""
153
+ Write-Info "To test auto-discovery, provide a valid NotebookLM URL."
154
+ Write-Host "Format: https://notebooklm.google.com/notebook/[id]" -ForegroundColor White
155
+ Write-Host ""
156
+ Write-Host "Available public test notebooks:" -ForegroundColor White
157
+ for ($i = 0; $i -lt $PublicNotebooks.Count; $i++) {
158
+ Write-Host " $($i + 1). $($PublicNotebooks[$i])" -ForegroundColor Gray
159
+ }
160
+ Write-Host ""
161
+ $NotebookUrl = Read-Host "Enter NotebookLM URL (or press Enter to skip)"
162
+
163
+ if ($NotebookUrl) {
164
+ $NotebooksToTest = @($NotebookUrl)
165
+ }
166
+ }
167
+
168
+ if ($NotebooksToTest.Count -eq 0) {
169
+ Write-Warning-Custom "Skipping: No NotebookLM URL provided"
170
+ Write-Info "Rerun with -NotebookUrl parameter or -TestAll to test this"
171
+ Write-Host ""
172
+ } else {
173
+ # Test each notebook
174
+ foreach ($TestUrl in $NotebooksToTest) {
175
+ $totalTests++
176
+ $testNum = $totalTests
177
+
178
+ Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
179
+ Write-Info "[Test $testNum] Valid NotebookLM URL auto-discovery"
180
+ Write-Host "─────────────────────────────────────────────────────────" -ForegroundColor Gray
181
+ Write-Info "Testing with: $TestUrl"
182
+ Write-Warning-Custom "This may take 20-30 seconds (querying NotebookLM)..."
183
+ Write-Host ""
184
+
185
+ try {
186
+ $body = @{
187
+ url = $TestUrl
188
+ } | ConvertTo-Json
189
+
190
+ $response = Invoke-RestMethod -Uri "$ServerUrl/notebooks/auto-discover" -Method POST -Body $body -ContentType "application/json" -ErrorAction Stop
191
+
192
+ if ($response.success) {
193
+ Write-Success "Auto-discovery successful!"
194
+ Write-Host ""
195
+ Write-Info "Generated Metadata:"
196
+ Write-Host " Name: $($response.notebook.name)" -ForegroundColor White
197
+ Write-Host " Description: $($response.notebook.description)" -ForegroundColor White
198
+ Write-Host " Topics: $($response.notebook.topics -join ', ')" -ForegroundColor White
199
+ Write-Host " Auto-generated: $($response.notebook.auto_generated)" -ForegroundColor White
200
+ Write-Host ""
201
+
202
+ # Validate format
203
+ $validations = @()
204
+
205
+ # Check name format (kebab-case, 3 words max)
206
+ if ($response.notebook.name -match '^[a-z0-9]+(-[a-z0-9]+){0,2}$') {
207
+ $validations += "✅ Name format valid (kebab-case)"
208
+ } else {
209
+ $validations += "❌ Name format invalid: $($response.notebook.name)"
210
+ }
211
+
212
+ # Check description length (<= 150 chars)
213
+ if ($response.notebook.description.Length -le 150) {
214
+ $validations += "✅ Description length valid ($($response.notebook.description.Length) chars)"
215
+ } else {
216
+ $validations += "❌ Description too long: $($response.notebook.description.Length) chars"
217
+ }
218
+
219
+ # Check topics count (8-10)
220
+ $topicCount = $response.notebook.topics.Count
221
+ if ($topicCount -ge 8 -and $topicCount -le 10) {
222
+ $validations += "✅ Topics count valid ($topicCount)"
223
+ } else {
224
+ $validations += "❌ Topics count invalid: $topicCount (must be 8-10)"
225
+ }
226
+
227
+ # Check auto_generated flag
228
+ if ($response.notebook.auto_generated -eq $true) {
229
+ $validations += "✅ Auto-generated flag set"
230
+ } else {
231
+ $validations += "❌ Auto-generated flag not set"
232
+ }
233
+
234
+ Write-Info "Validation Results:"
235
+ foreach ($validation in $validations) {
236
+ Write-Host " $validation"
237
+ }
238
+
239
+ if ($validations -match "❌") {
240
+ Write-Error-Custom "Metadata validation failed"
241
+ $failedTests++
242
+ } else {
243
+ Write-Success "All metadata validations passed"
244
+ $passedTests++
245
+ }
246
+ } else {
247
+ Write-Error-Custom "Auto-discovery failed: $($response.error)"
248
+ $failedTests++
249
+ }
250
+ } catch {
251
+ Write-Error-Custom "Request failed: $($_.Exception.Message)"
252
+ if ($_.ErrorDetails.Message) {
253
+ $errorObj = $_.ErrorDetails.Message | ConvertFrom-Json
254
+ Write-Host " Error: $($errorObj.error)" -ForegroundColor Red
255
+ }
256
+ $failedTests++
257
+ }
258
+
259
+ Write-Host ""
260
+ }
261
+ }
262
+
263
+ Write-Host ""
264
+
265
+ # ============================================================================
266
+ # Summary
267
+ # ============================================================================
268
+ Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Gray
269
+ Write-Host "║ ║" -ForegroundColor Gray
270
+ Write-Host "║ TEST SUMMARY ║" -ForegroundColor Cyan
271
+ Write-Host "║ ║" -ForegroundColor Gray
272
+ Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Gray
273
+ Write-Host ""
274
+
275
+ Write-Host "Total tests: $totalTests" -ForegroundColor White
276
+ Write-Host "Passed: $passedTests" -ForegroundColor Green
277
+ Write-Host "Failed: $failedTests" -ForegroundColor $(if ($failedTests -gt 0) { "Red" } else { "Gray" })
278
+ Write-Host "Success rate: $([math]::Round(($passedTests / $totalTests) * 100, 1))%" -ForegroundColor White
279
+ Write-Host ""
280
+
281
+ if ($failedTests -gt 0) {
282
+ Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Red
283
+ Write-Host "║ ║" -ForegroundColor Red
284
+ Write-Host "║ ❌ SOME TESTS FAILED ║" -ForegroundColor Red
285
+ Write-Host "║ ║" -ForegroundColor Red
286
+ Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Red
287
+ exit 1
288
+ } else {
289
+ Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Green
290
+ Write-Host "║ ║" -ForegroundColor Green
291
+ Write-Host "║ ✅ ALL TESTS PASSED ║" -ForegroundColor Green
292
+ Write-Host "║ ║" -ForegroundColor Green
293
+ Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Green
294
+ exit 0
295
+ }