@roomi-fields/notebooklm-mcp 1.3.6 → 1.5.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 (284) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +71 -34
  3. package/deployment/INDEX.md +292 -0
  4. package/deployment/PACKAGE-FILES.txt +180 -0
  5. package/deployment/QUICK-START.md +100 -0
  6. package/deployment/docs/01-INSTALL.md +611 -0
  7. package/deployment/docs/02-CONFIGURATION.md +404 -0
  8. package/deployment/docs/03-API.md +1691 -0
  9. package/deployment/docs/04-N8N-INTEGRATION.md +373 -0
  10. package/deployment/docs/05-TROUBLESHOOTING.md +429 -0
  11. package/deployment/docs/06-NOTEBOOK-LIBRARY.md +692 -0
  12. package/deployment/docs/07-AUTO-DISCOVERY.md +236 -0
  13. package/deployment/docs/08-WSL-USAGE.md +363 -0
  14. package/deployment/docs/09-MULTI-INTERFACE.md +293 -0
  15. package/deployment/docs/10-CONTENT-MANAGEMENT.md +421 -0
  16. package/deployment/docs/11-MULTI-ACCOUNT.md +295 -0
  17. package/deployment/docs/README.md +207 -0
  18. package/deployment/scripts/README.md +564 -0
  19. package/deployment/scripts/install.ps1 +114 -0
  20. package/deployment/scripts/setup-auth.ps1 +217 -0
  21. package/deployment/scripts/start-server.ps1 +72 -0
  22. package/deployment/scripts/stop-server.ps1 +51 -0
  23. package/deployment/scripts/test-api.ps1 +651 -0
  24. package/deployment/scripts/test-auth.ps1 +323 -0
  25. package/deployment/scripts/test-auto-discovery.ps1 +295 -0
  26. package/deployment/scripts/test-cors.ps1 +398 -0
  27. package/deployment/scripts/test-errors.ps1 +581 -0
  28. package/deployment/scripts/test-server.ps1 +140 -0
  29. package/deployment/scripts/test-sessions.ps1 +426 -0
  30. package/deployment/scripts/test-validation.ps1 +299 -0
  31. package/dist/accounts/account-manager.d.ts +163 -0
  32. package/dist/accounts/account-manager.d.ts.map +1 -0
  33. package/dist/accounts/account-manager.js +614 -0
  34. package/dist/accounts/account-manager.js.map +1 -0
  35. package/dist/accounts/auto-login-manager.d.ts +62 -0
  36. package/dist/accounts/auto-login-manager.d.ts.map +1 -0
  37. package/dist/accounts/auto-login-manager.js +537 -0
  38. package/dist/accounts/auto-login-manager.js.map +1 -0
  39. package/dist/accounts/crypto.d.ts +45 -0
  40. package/dist/accounts/crypto.d.ts.map +1 -0
  41. package/dist/accounts/crypto.js +138 -0
  42. package/dist/accounts/crypto.js.map +1 -0
  43. package/dist/accounts/index.d.ts +14 -0
  44. package/dist/accounts/index.d.ts.map +1 -0
  45. package/dist/accounts/index.js +14 -0
  46. package/dist/accounts/index.js.map +1 -0
  47. package/dist/accounts/types.d.ts +103 -0
  48. package/dist/accounts/types.d.ts.map +1 -0
  49. package/dist/accounts/types.js +7 -0
  50. package/dist/accounts/types.js.map +1 -0
  51. package/dist/auth/auth-manager.d.ts +9 -2
  52. package/dist/auth/auth-manager.d.ts.map +1 -1
  53. package/dist/auth/auth-manager.js +60 -6
  54. package/dist/auth/auth-manager.js.map +1 -1
  55. package/dist/auto-discovery/auto-discovery.d.ts.map +1 -1
  56. package/dist/auto-discovery/auto-discovery.js +2 -1
  57. package/dist/auto-discovery/auto-discovery.js.map +1 -1
  58. package/dist/cli/accounts.d.ts +13 -0
  59. package/dist/cli/accounts.d.ts.map +1 -0
  60. package/dist/cli/accounts.js +195 -0
  61. package/dist/cli/accounts.js.map +1 -0
  62. package/dist/config.d.ts +1 -0
  63. package/dist/config.d.ts.map +1 -1
  64. package/dist/config.js +24 -0
  65. package/dist/config.js.map +1 -1
  66. package/dist/content/content-generator.d.ts +153 -0
  67. package/dist/content/content-generator.d.ts.map +1 -0
  68. package/dist/content/content-generator.js +637 -0
  69. package/dist/content/content-generator.js.map +1 -0
  70. package/dist/content/content-manager.d.ts +364 -0
  71. package/dist/content/content-manager.d.ts.map +1 -0
  72. package/dist/content/content-manager.js +3841 -0
  73. package/dist/content/content-manager.js.map +1 -0
  74. package/dist/content/content-templates.d.ts +183 -0
  75. package/dist/content/content-templates.d.ts.map +1 -0
  76. package/dist/content/content-templates.js +719 -0
  77. package/dist/content/content-templates.js.map +1 -0
  78. package/dist/content/index.d.ts +14 -0
  79. package/dist/content/index.d.ts.map +1 -0
  80. package/dist/content/index.js +14 -0
  81. package/dist/content/index.js.map +1 -0
  82. package/dist/content/types.d.ts +285 -0
  83. package/dist/content/types.d.ts.map +1 -0
  84. package/dist/content/types.js +10 -0
  85. package/dist/content/types.js.map +1 -0
  86. package/dist/errors.d.ts +1 -1
  87. package/dist/errors.d.ts.map +1 -1
  88. package/dist/errors.js.map +1 -1
  89. package/dist/http-wrapper.d.ts +7 -0
  90. package/dist/http-wrapper.d.ts.map +1 -1
  91. package/dist/http-wrapper.js +449 -29
  92. package/dist/http-wrapper.js.map +1 -1
  93. package/dist/i18n/en.json +120 -0
  94. package/dist/i18n/fr.json +120 -0
  95. package/dist/i18n/index.d.ts +168 -0
  96. package/dist/i18n/index.d.ts.map +1 -0
  97. package/dist/i18n/index.js +213 -0
  98. package/dist/i18n/index.js.map +1 -0
  99. package/dist/index.js +26 -2
  100. package/dist/index.js.map +1 -1
  101. package/dist/library/notebook-library.d.ts +4 -0
  102. package/dist/library/notebook-library.d.ts.map +1 -1
  103. package/dist/library/notebook-library.js +20 -3
  104. package/dist/library/notebook-library.js.map +1 -1
  105. package/dist/session/browser-session.d.ts +35 -8
  106. package/dist/session/browser-session.d.ts.map +1 -1
  107. package/dist/session/browser-session.js +243 -28
  108. package/dist/session/browser-session.js.map +1 -1
  109. package/dist/session/session-manager.d.ts +6 -0
  110. package/dist/session/session-manager.d.ts.map +1 -1
  111. package/dist/session/session-manager.js +46 -14
  112. package/dist/session/session-manager.js.map +1 -1
  113. package/dist/session/shared-context-manager.d.ts +3 -3
  114. package/dist/session/shared-context-manager.d.ts.map +1 -1
  115. package/dist/session/shared-context-manager.js +10 -7
  116. package/dist/session/shared-context-manager.js.map +1 -1
  117. package/dist/stdio-http-proxy.d.ts +24 -0
  118. package/dist/stdio-http-proxy.d.ts.map +1 -0
  119. package/dist/stdio-http-proxy.js +592 -0
  120. package/dist/stdio-http-proxy.js.map +1 -0
  121. package/dist/tools/index.d.ts +106 -1
  122. package/dist/tools/index.d.ts.map +1 -1
  123. package/dist/tools/index.js +1028 -7
  124. package/dist/tools/index.js.map +1 -1
  125. package/dist/types.d.ts +81 -17
  126. package/dist/types.d.ts.map +1 -1
  127. package/dist/utils/citation-extractor.d.ts +66 -0
  128. package/dist/utils/citation-extractor.d.ts.map +1 -0
  129. package/dist/utils/citation-extractor.js +492 -0
  130. package/dist/utils/citation-extractor.js.map +1 -0
  131. package/dist/utils/page-utils.d.ts +8 -0
  132. package/dist/utils/page-utils.d.ts.map +1 -1
  133. package/dist/utils/page-utils.js +112 -8
  134. package/dist/utils/page-utils.js.map +1 -1
  135. package/docs/ADDING_A_LANGUAGE.md +209 -0
  136. package/docs/ARCHITECTURE_MIGRATION_STUDY.md +894 -0
  137. package/docs/CHROME_PROFILE_LIMITATION.md +15 -1
  138. package/docs/MULTI_ACCOUNT_SYSTEM.md +304 -0
  139. package/package.json +15 -12
  140. package/scripts/archive/add-and-activate-notebook.ps1 +31 -0
  141. package/scripts/archive/add-new-notebook.ps1 +25 -0
  142. package/scripts/archive/add-rom1pey.ps1 +2 -0
  143. package/scripts/archive/add-rpmonster.ps1 +2 -0
  144. package/scripts/archive/add-source-debug.ps1 +11 -0
  145. package/scripts/archive/add-source-e2e.ps1 +28 -0
  146. package/scripts/archive/add-source-visible.ps1 +11 -0
  147. package/scripts/archive/add-test-notebook.ps1 +13 -0
  148. package/scripts/archive/add-test-source.ps1 +50 -0
  149. package/scripts/archive/capture-screen.ps1 +11 -0
  150. package/scripts/archive/change-language.mjs +45 -0
  151. package/scripts/archive/change-language.ts +44 -0
  152. package/scripts/archive/check-account.ps1 +19 -0
  153. package/scripts/archive/check-notebook-2.ps1 +8 -0
  154. package/scripts/archive/check-test-notebook.ps1 +11 -0
  155. package/scripts/archive/create-notebook-auto.ps1 +31 -0
  156. package/scripts/archive/create-notebook.ps1 +8 -0
  157. package/scripts/archive/create-rom1pey-notebook.ps1 +19 -0
  158. package/scripts/archive/create-rom1pey.ps1 +8 -0
  159. package/scripts/archive/create-test-notebook-fresh.ps1 +21 -0
  160. package/scripts/archive/create-test-notebook.ps1 +16 -0
  161. package/scripts/archive/debug-add-source-auto.ps1 +29 -0
  162. package/scripts/archive/debug-add-source.ps1 +19 -0
  163. package/scripts/archive/debug-add-text-source.ps1 +47 -0
  164. package/scripts/archive/debug-home.ps1 +10 -0
  165. package/scripts/archive/debug-selectors.ps1 +55 -0
  166. package/scripts/archive/debug-sources-panel.ps1 +22 -0
  167. package/scripts/archive/debug-ui.ps1 +17 -0
  168. package/scripts/archive/discover-home.ps1 +26 -0
  169. package/scripts/archive/kill-automation-chrome.ps1 +37 -0
  170. package/scripts/archive/list-my-notebooks.ps1 +27 -0
  171. package/scripts/archive/navigate-home-visible.ps1 +23 -0
  172. package/scripts/archive/navigate-home.ps1 +15 -0
  173. package/scripts/archive/run-e2e-english.ps1 +111 -0
  174. package/scripts/archive/run-e2e-rom1pey-v2.ps1 +122 -0
  175. package/scripts/archive/run-e2e-rom1pey.ps1 +117 -0
  176. package/scripts/archive/setup-english-test.ps1 +36 -0
  177. package/scripts/archive/setup-test-notebook.ps1 +71 -0
  178. package/scripts/archive/simple-add-source.ps1 +14 -0
  179. package/scripts/archive/t10.ps1 +2 -0
  180. package/scripts/archive/t20.ps1 +4 -0
  181. package/scripts/archive/t30.ps1 +9 -0
  182. package/scripts/archive/t31.ps1 +11 -0
  183. package/scripts/archive/t32.ps1 +6 -0
  184. package/scripts/archive/t39.ps1 +5 -0
  185. package/scripts/archive/t40.ps1 +5 -0
  186. package/scripts/archive/t53.ps1 +12 -0
  187. package/scripts/archive/t54.ps1 +12 -0
  188. package/scripts/archive/t55.ps1 +11 -0
  189. package/scripts/archive/t9.ps1 +1 -0
  190. package/scripts/archive/test-access.ps1 +28 -0
  191. package/scripts/archive/test-add-delete-source.ps1 +64 -0
  192. package/scripts/archive/test-add-source-visible.ps1 +16 -0
  193. package/scripts/archive/test-add-source.ps1 +19 -0
  194. package/scripts/archive/test-add-text-debug.ps1 +28 -0
  195. package/scripts/archive/test-add-text-source.ps1 +8 -0
  196. package/scripts/archive/test-add-url-source.ps1 +7 -0
  197. package/scripts/archive/test-ask-ascii.ps1 +20 -0
  198. package/scripts/archive/test-ask-cnv.ps1 +20 -0
  199. package/scripts/archive/test-ask-headed.ps1 +51 -0
  200. package/scripts/archive/test-ask-ifs.ps1 +16 -0
  201. package/scripts/archive/test-ask-now.ps1 +24 -0
  202. package/scripts/archive/test-ask-real.ps1 +19 -0
  203. package/scripts/archive/test-ask-visible.ps1 +20 -0
  204. package/scripts/archive/test-create-notebook.ps1 +8 -0
  205. package/scripts/archive/test-create-then-add.ps1 +17 -0
  206. package/scripts/archive/test-delete-source.ps1 +41 -0
  207. package/scripts/archive/test-e2e-notebook.ps1 +21 -0
  208. package/scripts/archive/test-english-notebook.ps1 +20 -0
  209. package/scripts/archive/test-english.ps1 +7 -0
  210. package/scripts/archive/test-full-custom-instructions.ps1 +40 -0
  211. package/scripts/archive/test-full-infographic.ps1 +34 -0
  212. package/scripts/archive/test-full-language.ps1 +21 -0
  213. package/scripts/archive/test-full-presentation.ps1 +85 -0
  214. package/scripts/archive/test-full-report.ps1 +34 -0
  215. package/scripts/archive/test-full-source-selection.ps1 +35 -0
  216. package/scripts/archive/test-full-video-brief.ps1 +22 -0
  217. package/scripts/archive/test-full-video-explainer.ps1 +22 -0
  218. package/scripts/archive/test-full-video-styles.ps1 +37 -0
  219. package/scripts/archive/test-generate-report.ps1 +15 -0
  220. package/scripts/archive/test-generate-study-guide.ps1 +11 -0
  221. package/scripts/archive/test-headed-ask.ps1 +13 -0
  222. package/scripts/archive/test-headed-now.ps1 +9 -0
  223. package/scripts/archive/test-headed.ps1 +9 -0
  224. package/scripts/archive/test-hello.ps1 +7 -0
  225. package/scripts/archive/test-i18n-studio.ps1 +8 -0
  226. package/scripts/archive/test-i18n.ps1 +7 -0
  227. package/scripts/archive/test-manual-headed.ps1 +26 -0
  228. package/scripts/archive/test-mathieu-quota.ps1 +8 -0
  229. package/scripts/archive/test-notebook-1.ps1 +10 -0
  230. package/scripts/archive/test-notebook-2-sources.ps1 +12 -0
  231. package/scripts/archive/test-notebook1.ps1 +14 -0
  232. package/scripts/archive/test-personal-notebook.ps1 +14 -0
  233. package/scripts/archive/test-rate-limit.ps1 +19 -0
  234. package/scripts/archive/test-real-ask.ps1 +50 -0
  235. package/scripts/archive/test-real-ask2.ps1 +30 -0
  236. package/scripts/archive/test-rom1pey.ps1 +7 -0
  237. package/scripts/archive/test-rotation-complete.ps1 +14 -0
  238. package/scripts/archive/test-rotation.ps1 +8 -0
  239. package/scripts/archive/test-show-browser.ps1 +39 -0
  240. package/scripts/archive/test-update-notebook.ps1 +4 -0
  241. package/scripts/archive/verify-language-slow.ps1 +21 -0
  242. package/scripts/archive/verify-language.ps1 +15 -0
  243. package/scripts/check-server.ps1 +46 -0
  244. package/scripts/mcp-wsl-helper.sh +146 -0
  245. package/scripts/start-server.ps1 +94 -0
  246. package/scripts/stop-server.ps1 +30 -0
  247. package/scripts/switch-account-language.sh +191 -0
  248. package/scripts/test-account.ps1 +58 -0
  249. package/dist/__tests__/cleanup-manager.test.d.ts +0 -2
  250. package/dist/__tests__/cleanup-manager.test.d.ts.map +0 -1
  251. package/dist/__tests__/cleanup-manager.test.js +0 -341
  252. package/dist/__tests__/cleanup-manager.test.js.map +0 -1
  253. package/dist/__tests__/config-parsing.test.d.ts +0 -2
  254. package/dist/__tests__/config-parsing.test.d.ts.map +0 -1
  255. package/dist/__tests__/config-parsing.test.js +0 -338
  256. package/dist/__tests__/config-parsing.test.js.map +0 -1
  257. package/dist/__tests__/config.test.d.ts +0 -2
  258. package/dist/__tests__/config.test.d.ts.map +0 -1
  259. package/dist/__tests__/config.test.js +0 -267
  260. package/dist/__tests__/config.test.js.map +0 -1
  261. package/dist/__tests__/errors.test.d.ts +0 -2
  262. package/dist/__tests__/errors.test.d.ts.map +0 -1
  263. package/dist/__tests__/errors.test.js +0 -166
  264. package/dist/__tests__/errors.test.js.map +0 -1
  265. package/dist/__tests__/logger.test.d.ts +0 -2
  266. package/dist/__tests__/logger.test.d.ts.map +0 -1
  267. package/dist/__tests__/logger.test.js +0 -324
  268. package/dist/__tests__/logger.test.js.map +0 -1
  269. package/dist/__tests__/page-utils.test.d.ts +0 -2
  270. package/dist/__tests__/page-utils.test.d.ts.map +0 -1
  271. package/dist/__tests__/page-utils.test.js +0 -349
  272. package/dist/__tests__/page-utils.test.js.map +0 -1
  273. package/dist/__tests__/setup-verification.test.d.ts +0 -2
  274. package/dist/__tests__/setup-verification.test.d.ts.map +0 -1
  275. package/dist/__tests__/setup-verification.test.js +0 -15
  276. package/dist/__tests__/setup-verification.test.js.map +0 -1
  277. package/dist/__tests__/stealth-utils.test.d.ts +0 -2
  278. package/dist/__tests__/stealth-utils.test.d.ts.map +0 -1
  279. package/dist/__tests__/stealth-utils.test.js +0 -413
  280. package/dist/__tests__/stealth-utils.test.js.map +0 -1
  281. package/dist/__tests__/types.test.d.ts +0 -2
  282. package/dist/__tests__/types.test.d.ts.map +0 -1
  283. package/dist/__tests__/types.test.js +0 -461
  284. package/dist/__tests__/types.test.js.map +0 -1
@@ -0,0 +1,122 @@
1
+ # E2E Tests v2 - Better order: add sources first, then ask questions
2
+ # Notebook: e2e-rom1pey-test (725d28e1-4284-4f36-99a2-b6693c2ebf13)
3
+
4
+ $ErrorActionPreference = "Continue"
5
+
6
+ Write-Host "========================================" -ForegroundColor Cyan
7
+ Write-Host " E2E Tests v2 - Rom1pey Account" -ForegroundColor Cyan
8
+ Write-Host "========================================" -ForegroundColor Cyan
9
+ Write-Host ""
10
+
11
+ # Activate the notebook
12
+ Write-Host "Activating e2e-rom1pey-test notebook..."
13
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks/e2e-rom1pey-test/activate" -Method PUT -TimeoutSec 30 | Out-Null
14
+ Write-Host "Active notebook: e2e-rom1pey-test"
15
+ Write-Host ""
16
+
17
+ $passed = 0
18
+ $failed = 0
19
+
20
+ # Test 1: Health check
21
+ Write-Host "=== TEST 1: Health ===" -ForegroundColor Yellow
22
+ try {
23
+ $health = Invoke-RestMethod -Uri "http://localhost:3000/health"
24
+ if ($health.success -and $health.data.authenticated) {
25
+ Write-Host " PASSED" -ForegroundColor Green
26
+ $passed++
27
+ } else {
28
+ Write-Host " FAILED: Not authenticated" -ForegroundColor Red
29
+ $failed++
30
+ }
31
+ } catch {
32
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
33
+ $failed++
34
+ }
35
+
36
+ # Test 2: Add text source FIRST (more reliable)
37
+ Write-Host "`n=== TEST 2: Add text source ===" -ForegroundColor Yellow
38
+ try {
39
+ $textBody = @{
40
+ source_type = "text"
41
+ text = "This is a comprehensive test document about software testing and quality assurance. It covers unit testing, integration testing, end-to-end testing, and performance testing methodologies. Testing is essential for ensuring software reliability and user satisfaction."
42
+ name = "E2E Test Document"
43
+ } | ConvertTo-Json
44
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $textBody -TimeoutSec 180
45
+ if ($response.success) {
46
+ Write-Host " PASSED: Text source added" -ForegroundColor Green
47
+ $passed++
48
+ } else {
49
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
50
+ $failed++
51
+ }
52
+ } catch {
53
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
54
+ $failed++
55
+ }
56
+
57
+ # Wait for source to be processed
58
+ Write-Host "`nWaiting 5 seconds for source processing..."
59
+ Start-Sleep -Seconds 5
60
+
61
+ # Test 3: Ask question (now that we have a source)
62
+ Write-Host "`n=== TEST 3: Ask question ===" -ForegroundColor Yellow
63
+ try {
64
+ $askBody = @{ question = "What types of testing are mentioned in the sources?" } | ConvertTo-Json
65
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method POST -ContentType "application/json" -Body $askBody -TimeoutSec 120
66
+ if ($response.success -and $response.data.answer) {
67
+ Write-Host " PASSED: Got response" -ForegroundColor Green
68
+ $answerPreview = $response.data.answer.Substring(0, [Math]::Min(150, $response.data.answer.Length))
69
+ Write-Host " Answer: $answerPreview..."
70
+ $passed++
71
+ } else {
72
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
73
+ $failed++
74
+ }
75
+ } catch {
76
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
77
+ $failed++
78
+ }
79
+
80
+ # Test 4: Add URL source
81
+ Write-Host "`n=== TEST 4: Add URL source ===" -ForegroundColor Yellow
82
+ try {
83
+ $urlBody = @{
84
+ source_type = "url"
85
+ url = "https://en.wikipedia.org/wiki/Hello_World"
86
+ } | ConvertTo-Json
87
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $urlBody -TimeoutSec 180
88
+ if ($response.success) {
89
+ Write-Host " PASSED: URL source added" -ForegroundColor Green
90
+ $passed++
91
+ } else {
92
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
93
+ $failed++
94
+ }
95
+ } catch {
96
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
97
+ $failed++
98
+ }
99
+
100
+ # Test 5: Get content list
101
+ Write-Host "`n=== TEST 5: Get content list ===" -ForegroundColor Yellow
102
+ try {
103
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content" -Method GET -TimeoutSec 90
104
+ if ($response.success) {
105
+ $sourceCount = 0
106
+ if ($response.data.sources) {
107
+ $sourceCount = $response.data.sources.Count
108
+ }
109
+ Write-Host " PASSED: Got content list ($sourceCount sources)" -ForegroundColor Green
110
+ $passed++
111
+ } else {
112
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
113
+ $failed++
114
+ }
115
+ } catch {
116
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
117
+ $failed++
118
+ }
119
+
120
+ Write-Host "`n========================================" -ForegroundColor Cyan
121
+ Write-Host " RESULTS: $passed passed, $failed failed" -ForegroundColor Cyan
122
+ Write-Host "========================================" -ForegroundColor Cyan
@@ -0,0 +1,117 @@
1
+ # E2E Tests with rom1pey account using the notebook we just created
2
+ # Notebook: e2e-rom1pey-test (725d28e1-4284-4f36-99a2-b6693c2ebf13)
3
+
4
+ $ErrorActionPreference = "Continue"
5
+
6
+ Write-Host "========================================" -ForegroundColor Cyan
7
+ Write-Host " E2E Tests - Rom1pey Account" -ForegroundColor Cyan
8
+ Write-Host "========================================" -ForegroundColor Cyan
9
+ Write-Host ""
10
+
11
+ # Activate the notebook
12
+ Write-Host "Activating e2e-rom1pey-test notebook..."
13
+ $activateResponse = Invoke-RestMethod -Uri "http://localhost:3000/notebooks/e2e-rom1pey-test/activate" -Method PUT -TimeoutSec 30
14
+ Write-Host "Activated: $($activateResponse.success)"
15
+
16
+ # Verify active notebook
17
+ $notebooks = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method GET
18
+ Write-Host "Active: $($notebooks.data.active_notebook_id)"
19
+ Write-Host ""
20
+
21
+ $passed = 0
22
+ $failed = 0
23
+
24
+ # Test 1: Health check
25
+ Write-Host "=== TEST 1: Health ===" -ForegroundColor Yellow
26
+ try {
27
+ $health = Invoke-RestMethod -Uri "http://localhost:3000/health"
28
+ if ($health.success -and $health.data.authenticated) {
29
+ Write-Host " PASSED" -ForegroundColor Green
30
+ $passed++
31
+ } else {
32
+ Write-Host " FAILED: Not authenticated" -ForegroundColor Red
33
+ $failed++
34
+ }
35
+ } catch {
36
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
37
+ $failed++
38
+ }
39
+
40
+ # Test 2: Ask question
41
+ Write-Host "`n=== TEST 2: Ask question ===" -ForegroundColor Yellow
42
+ try {
43
+ $askBody = @{ question = "What is this notebook about?" } | ConvertTo-Json
44
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method POST -ContentType "application/json" -Body $askBody -TimeoutSec 90
45
+ if ($response.success -and $response.data.answer) {
46
+ Write-Host " PASSED: Got response" -ForegroundColor Green
47
+ Write-Host " Answer: $($response.data.answer.Substring(0, [Math]::Min(100, $response.data.answer.Length)))..."
48
+ $passed++
49
+ } else {
50
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
51
+ $failed++
52
+ }
53
+ } catch {
54
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
55
+ $failed++
56
+ }
57
+
58
+ # Test 3: Add URL source
59
+ Write-Host "`n=== TEST 3: Add URL source ===" -ForegroundColor Yellow
60
+ try {
61
+ $urlBody = @{
62
+ source_type = "url"
63
+ url = "https://en.wikipedia.org/wiki/Hello_World"
64
+ } | ConvertTo-Json
65
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $urlBody -TimeoutSec 180
66
+ if ($response.success) {
67
+ Write-Host " PASSED: URL source added" -ForegroundColor Green
68
+ $passed++
69
+ } else {
70
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
71
+ $failed++
72
+ }
73
+ } catch {
74
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
75
+ $failed++
76
+ }
77
+
78
+ # Test 4: Add text source
79
+ Write-Host "`n=== TEST 4: Add text source ===" -ForegroundColor Yellow
80
+ try {
81
+ $textBody = @{
82
+ source_type = "text"
83
+ text = "This is a test text source for E2E testing. It contains information about testing methodologies and best practices for automated tests."
84
+ name = "E2E Test Text"
85
+ } | ConvertTo-Json
86
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $textBody -TimeoutSec 180
87
+ if ($response.success) {
88
+ Write-Host " PASSED: Text source added" -ForegroundColor Green
89
+ $passed++
90
+ } else {
91
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
92
+ $failed++
93
+ }
94
+ } catch {
95
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
96
+ $failed++
97
+ }
98
+
99
+ # Test 5: Get content list
100
+ Write-Host "`n=== TEST 5: Get content list ===" -ForegroundColor Yellow
101
+ try {
102
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content" -Method GET -TimeoutSec 90
103
+ if ($response.success) {
104
+ Write-Host " PASSED: Got content list ($($response.data.sources.Count) sources)" -ForegroundColor Green
105
+ $passed++
106
+ } else {
107
+ Write-Host " FAILED: $($response.error)" -ForegroundColor Red
108
+ $failed++
109
+ }
110
+ } catch {
111
+ Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red
112
+ $failed++
113
+ }
114
+
115
+ Write-Host "`n========================================" -ForegroundColor Cyan
116
+ Write-Host " RESULTS: $passed passed, $failed failed" -ForegroundColor Cyan
117
+ Write-Host "========================================" -ForegroundColor Cyan
@@ -0,0 +1,36 @@
1
+ # Step 1: Add notebook owned by rom1pey to library
2
+ Write-Host "Step 1: Adding rom1pey notebook to library..."
3
+ $addBody = @{
4
+ name = "rom1pey-english-test"
5
+ url = "https://notebooklm.google.com/notebook/258f62a1-8658-4f96-8333-a9e16224f602"
6
+ description = "Test notebook for English UI"
7
+ topics = @("test", "english")
8
+ } | ConvertTo-Json
9
+
10
+ try {
11
+ $result = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method POST -ContentType "application/json" -Body $addBody -TimeoutSec 60
12
+ Write-Host "Added: $($result | ConvertTo-Json -Compress)"
13
+ } catch {
14
+ Write-Host "Add failed (may already exist): $($_.Exception.Message)"
15
+ }
16
+
17
+ # Step 2: Activate this notebook
18
+ Write-Host "`nStep 2: Activating rom1pey notebook..."
19
+ try {
20
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks/rom1pey-english-test/activate" -Method PUT -TimeoutSec 10
21
+ Write-Host "Activated!"
22
+ } catch {
23
+ Write-Host "Activate failed: $($_.Exception.Message)"
24
+ }
25
+
26
+ # Step 3: Test URL source with visible browser
27
+ Write-Host "`nStep 3: Testing URL source with VISIBLE browser..."
28
+ $testBody = @{
29
+ source_type = "url"
30
+ url = "https://en.wikipedia.org/wiki/Hello_World"
31
+ show_browser = $true
32
+ } | ConvertTo-Json
33
+
34
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $testBody -TimeoutSec 120
35
+ Write-Host "Result:"
36
+ $response | ConvertTo-Json -Depth 5
@@ -0,0 +1,71 @@
1
+ # Setup test notebook with source
2
+ $testNotebookUrl = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
3
+
4
+ Write-Host "=== Setting up Test Notebook ===" -ForegroundColor Cyan
5
+
6
+ # 1. Add notebook to library
7
+ Write-Host "1. Adding notebook to library..."
8
+ $addBody = @{
9
+ url = $testNotebookUrl
10
+ name = "E2E-Test-Notebook"
11
+ description = "Notebook for E2E testing - can be modified/deleted"
12
+ topics = @("test", "e2e", "automation")
13
+ } | ConvertTo-Json
14
+
15
+ try {
16
+ $addResult = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method POST -ContentType "application/json" -Body $addBody -TimeoutSec 30
17
+ Write-Host " Added to library: $($addResult.success)" -ForegroundColor $(if ($addResult.success) { "Green" } else { "Red" })
18
+ } catch {
19
+ Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Yellow
20
+ }
21
+
22
+ # 2. Add a text source for testing
23
+ Write-Host "2. Adding text source..."
24
+ $sourceBody = @{
25
+ source_type = "text"
26
+ title = "E2E Test Document"
27
+ text = @"
28
+ # E2E Test Document
29
+
30
+ This is a test document for End-to-End testing of the NotebookLM MCP HTTP Server.
31
+
32
+ ## Section 1: Introduction
33
+ The NotebookLM MCP HTTP Server provides a REST API for interacting with Google's NotebookLM.
34
+ It supports features like:
35
+ - Asking questions about notebook content
36
+ - Adding and managing sources
37
+ - Generating audio overviews, presentations, and reports
38
+ - Creating and managing notes
39
+
40
+ ## Section 2: Test Data
41
+ Here are some test facts for verification:
42
+ - The project is written in TypeScript
43
+ - It uses Playwright for browser automation
44
+ - The server runs on port 3000 by default
45
+ - Multiple Google accounts can be used for rate limit rotation
46
+
47
+ ## Section 3: Technical Details
48
+ The architecture consists of:
49
+ 1. HTTP wrapper (Express.js)
50
+ 2. Session manager (Playwright browser sessions)
51
+ 3. Content manager (source and content operations)
52
+ 4. Account manager (multi-account support)
53
+
54
+ This document should provide enough content for testing various NotebookLM features.
55
+ "@
56
+ notebook_url = $testNotebookUrl
57
+ } | ConvertTo-Json
58
+
59
+ try {
60
+ $sourceResult = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $sourceBody -TimeoutSec 60
61
+ Write-Host " Source added: $($sourceResult.success)" -ForegroundColor $(if ($sourceResult.success) { "Green" } else { "Red" })
62
+ if (-not $sourceResult.success) {
63
+ Write-Host " Error: $($sourceResult.error)" -ForegroundColor Red
64
+ }
65
+ } catch {
66
+ Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red
67
+ }
68
+
69
+ Write-Host ""
70
+ Write-Host "Test notebook setup complete!" -ForegroundColor Green
71
+ Write-Host "URL: $testNotebookUrl"
@@ -0,0 +1,14 @@
1
+ $body = @{
2
+ source_type = "text"
3
+ title = "Test Source"
4
+ text = "Test document for E2E testing. Contains info about the server."
5
+ notebook_url = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
6
+ } | ConvertTo-Json
7
+
8
+ Write-Host "Adding source..."
9
+ try {
10
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 180
11
+ $response | ConvertTo-Json -Depth 5
12
+ } catch {
13
+ Write-Host "Error: $($_.Exception.Message)"
14
+ }
@@ -0,0 +1,2 @@
1
+ $body = @{ description = "Updated at $(Get-Date)" } | ConvertTo-Json
2
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks/e2e-rom1pey-test" -Method PUT -ContentType "application/json" -Body $body
@@ -0,0 +1,4 @@
1
+ # Test 20: Reject invalid source type
2
+ $body = @{ notebook_url = "https://notebooklm.google.com/notebook/725d28e1-4284-4f36-99a2-b6693c2ebf13"; source_type = "invalid_type" } | ConvertTo-Json
3
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 10
4
+ if ($response.success -eq $false) { Write-Host "PASS" } else { Write-Host "FAIL" }
@@ -0,0 +1,9 @@
1
+ # Test 30: Reject invalid content type
2
+ $body = @{ notebook_url = "https://notebooklm.google.com/notebook/725d28e1-4284-4f36-99a2-b6693c2ebf13"; content_type = "invalid_type" } | ConvertTo-Json
3
+ try {
4
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/generate" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 10
5
+ Write-Host "FAIL: Should have rejected"
6
+ } catch {
7
+ # 400 Bad Request = correct rejection
8
+ Write-Host "PASS"
9
+ }
@@ -0,0 +1,11 @@
1
+ # Test 31: Reject removed types (faq, study_guide, etc.)
2
+ $types = @("faq", "study_guide", "briefing_doc", "timeline", "table_of_contents")
3
+ $allPass = $true
4
+ foreach ($t in $types) {
5
+ $body = @{ notebook_url = "https://notebooklm.google.com/notebook/725d28e1"; content_type = $t } | ConvertTo-Json
6
+ try {
7
+ Invoke-RestMethod -Uri "http://localhost:3000/content/generate" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 5 | Out-Null
8
+ $allPass = $false
9
+ } catch { }
10
+ }
11
+ if ($allPass) { Write-Host "PASS" } else { Write-Host "FAIL" }
@@ -0,0 +1,6 @@
1
+ # Test 32: Reject video_style for non-video
2
+ $body = @{ notebook_url = "https://notebooklm.google.com/notebook/725d28e1"; content_type = "report"; video_style = "classroom" } | ConvertTo-Json
3
+ try {
4
+ Invoke-RestMethod -Uri "http://localhost:3000/content/generate" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 5 | Out-Null
5
+ Write-Host "FAIL"
6
+ } catch { Write-Host "PASS" }
@@ -0,0 +1,5 @@
1
+ # Test 39: Reject invalid download type
2
+ try {
3
+ Invoke-RestMethod -Uri "http://localhost:3000/content/download?content_type=invalid_type" -TimeoutSec 5 | Out-Null
4
+ Write-Host "FAIL"
5
+ } catch { Write-Host "PASS" }
@@ -0,0 +1,5 @@
1
+ # Test 40: Reject missing content_type
2
+ try {
3
+ Invoke-RestMethod -Uri "http://localhost:3000/content/download" -TimeoutSec 5 | Out-Null
4
+ Write-Host "FAIL"
5
+ } catch { Write-Host "PASS" }
@@ -0,0 +1,12 @@
1
+ # Test 53: Missing question - should fail
2
+ $body = @{ notebook_id = "e2e-rom1pey-test" } | ConvertTo-Json
3
+ try {
4
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 10
5
+ Write-Host "FAIL: Should have returned error"
6
+ } catch {
7
+ if ($_.Exception.Message -match "question" -or $_.Exception.Response.StatusCode -eq 400) {
8
+ Write-Host "PASS: Correctly rejected missing question"
9
+ } else {
10
+ Write-Host "FAIL: Wrong error - $($_.Exception.Message)"
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ # Test 54: Invalid notebook ID - should fail
2
+ $body = @{ question = "Test"; notebook_id = "non-existent-notebook" } | ConvertTo-Json
3
+ try {
4
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 10
5
+ if ($response.success -eq $false) {
6
+ Write-Host "PASS: Correctly rejected invalid notebook"
7
+ } else {
8
+ Write-Host "FAIL: Should have returned error"
9
+ }
10
+ } catch {
11
+ Write-Host "PASS: Correctly rejected invalid notebook"
12
+ }
@@ -0,0 +1,11 @@
1
+ # Test 55: Malformed JSON - should fail gracefully
2
+ try {
3
+ $response = Invoke-WebRequest -Uri "http://localhost:3000/ask" -Method POST -ContentType "application/json" -Body "not valid json" -TimeoutSec 10
4
+ Write-Host "FAIL: Should have returned error"
5
+ } catch {
6
+ if ($_.Exception.Response.StatusCode -eq 400 -or $_.Exception.Response.StatusCode -eq 500) {
7
+ Write-Host "PASS: Correctly handled malformed JSON"
8
+ } else {
9
+ Write-Host "PASS: Correctly handled malformed JSON (exception)"
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks/search?query=test"
@@ -0,0 +1,28 @@
1
+ # Test access to e2e-test-notebook (which should have been created by tests)
2
+ Write-Host "=== Testing notebook access with rom1pey ===" -ForegroundColor Cyan
3
+
4
+ # First activate e2e-test-notebook
5
+ Write-Host "`nActivating e2e-test-notebook..."
6
+ try {
7
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/notebooks/e2e-test-notebook/activate" -Method PUT -TimeoutSec 30
8
+ Write-Host "Activated: $($response.success)" -ForegroundColor Green
9
+ } catch {
10
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
11
+ }
12
+
13
+ # Now try to ask a question with visible browser
14
+ Write-Host "`nAsking question with visible browser..."
15
+ $body = @{
16
+ question = "Hello"
17
+ show_browser = $true
18
+ } | ConvertTo-Json
19
+
20
+ try {
21
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/ask" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 120
22
+ Write-Host "Response: $($response.success)" -ForegroundColor Green
23
+ if ($response.data.answer) {
24
+ Write-Host "Answer: $($response.data.answer.Substring(0, [Math]::Min(100, $response.data.answer.Length)))..."
25
+ }
26
+ } catch {
27
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
28
+ }
@@ -0,0 +1,64 @@
1
+ # Complete test: Add source, verify, delete, verify
2
+ Write-Host "=== Complete Add/Delete Source Test ===" -ForegroundColor Cyan
3
+ Write-Host "Notebook: 3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f" -ForegroundColor Gray
4
+
5
+ # Step 1: Add a text source
6
+ Write-Host "`n--- Step 1: Adding text source ---" -ForegroundColor Yellow
7
+ $uniqueId = Get-Date -Format "HHmmss"
8
+ $body = @{
9
+ notebook_url = "https://notebooklm.google.com/notebook/3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f"
10
+ source_type = "text"
11
+ text = "Test source for add/delete verification. Unique ID: $uniqueId. This is test content."
12
+ title = "TEST-DELETE-$uniqueId"
13
+ show_browser = $true
14
+ } | ConvertTo-Json
15
+
16
+ $addResult = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 120
17
+ Write-Host "Add result:" -ForegroundColor Gray
18
+ $addResult | ConvertTo-Json -Depth 3
19
+
20
+ if (-not $addResult.success) {
21
+ Write-Host "`n[FAIL] Add source failed!" -ForegroundColor Red
22
+ exit 1
23
+ }
24
+
25
+ $sourceName = $addResult.data.sourceName
26
+ Write-Host "`nSource added with name: $sourceName" -ForegroundColor Green
27
+
28
+ # Step 2: Wait and verify source exists
29
+ Write-Host "`n--- Step 2: Waiting 5 seconds and verifying source exists ---" -ForegroundColor Yellow
30
+ Start-Sleep -Seconds 5
31
+
32
+ $listResult = Invoke-RestMethod -Uri "http://localhost:3000/content?notebook_url=https://notebooklm.google.com/notebook/3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f" -Method GET
33
+ $sourceCount = $listResult.data.sources.Count
34
+ Write-Host "Total sources in notebook: $sourceCount" -ForegroundColor Gray
35
+
36
+ # Look for our source (either by name or "Texte colle")
37
+ $foundSource = $listResult.data.sources | Where-Object { $_.name -like "*Texte coll*" -or $_.name -like "*$uniqueId*" }
38
+ if ($foundSource) {
39
+ Write-Host "Found source:" -ForegroundColor Green
40
+ $foundSource | ConvertTo-Json -Depth 2
41
+ } else {
42
+ Write-Host "Note: Source not visible in list (may be filtered or named differently)" -ForegroundColor Yellow
43
+ }
44
+
45
+ # Step 3: Delete the source
46
+ Write-Host "`n--- Step 3: Deleting source by name '$sourceName' ---" -ForegroundColor Yellow
47
+ $deleteUrl = "http://localhost:3000/content/sources?source_name=$([System.Web.HttpUtility]::UrlEncode($sourceName))&notebook_url=https://notebooklm.google.com/notebook/3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f&show_browser=true"
48
+ Write-Host "DELETE URL: $deleteUrl" -ForegroundColor Gray
49
+
50
+ try {
51
+ $deleteResult = Invoke-RestMethod -Uri $deleteUrl -Method DELETE -TimeoutSec 120
52
+ Write-Host "`nDelete result:" -ForegroundColor Gray
53
+ $deleteResult | ConvertTo-Json -Depth 3
54
+
55
+ if ($deleteResult.success) {
56
+ Write-Host "`n[SUCCESS] Delete operation completed!" -ForegroundColor Green
57
+ } else {
58
+ Write-Host "`n[FAIL] Delete returned success=false: $($deleteResult.error)" -ForegroundColor Red
59
+ }
60
+ } catch {
61
+ Write-Host "`n[ERROR] Delete failed with exception: $_" -ForegroundColor Red
62
+ }
63
+
64
+ Write-Host "`n=== Test Complete ===" -ForegroundColor Cyan
@@ -0,0 +1,16 @@
1
+ # Test add source with visible browser
2
+ Write-Host "=== Testing add source with VISIBLE browser ===" -ForegroundColor Cyan
3
+ $body = @{
4
+ notebook_url = "https://notebooklm.google.com/notebook/3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f"
5
+ source_type = "text"
6
+ text = "Test content for debugging the text upload issue."
7
+ title = "DEBUG-TEST-SOURCE"
8
+ show_browser = $true
9
+ } | ConvertTo-Json
10
+
11
+ Write-Host "Request body:" -ForegroundColor Yellow
12
+ $body
13
+
14
+ $result = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body
15
+ Write-Host "`nResult:" -ForegroundColor Yellow
16
+ $result | ConvertTo-Json -Depth 5
@@ -0,0 +1,19 @@
1
+ # Quick test for add source with debug
2
+ $body = @{
3
+ source_type = "text"
4
+ text = "Debug test content - testing selectors"
5
+ title = "Debug Test"
6
+ notebook_url = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
7
+ show_browser = $true
8
+ } | ConvertTo-Json
9
+
10
+ Write-Host "Testing add source..." -ForegroundColor Cyan
11
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 180
12
+
13
+ if ($response.success) {
14
+ Write-Host "SUCCESS" -ForegroundColor Green
15
+ } else {
16
+ Write-Host "FAIL: $($response.error)" -ForegroundColor Red
17
+ }
18
+
19
+ $response | ConvertTo-Json -Depth 5
@@ -0,0 +1,28 @@
1
+ # Test adding a text source with debug logging
2
+ $uniqueId = (Get-Date).ToString("HHmmss")
3
+ $notebookUrl = "https://notebooklm.google.com/notebook/3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f"
4
+
5
+ Write-Host "`n=== Testing add_source (text) with debug ===" -ForegroundColor Cyan
6
+ Write-Host "Notebook URL: $notebookUrl"
7
+ Write-Host "Expected UUID: 3e79b7be-9a72-4ac7-aaf7-ac3f450fa96f`n"
8
+
9
+ $body = @{
10
+ notebook_url = $notebookUrl
11
+ source_type = "text"
12
+ text = "DEBUG test content $uniqueId - Lorem ipsum dolor sit amet."
13
+ title = "DEBUG-TEST-$uniqueId"
14
+ show_browser = $true
15
+ } | ConvertTo-Json
16
+
17
+ try {
18
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body
19
+ Write-Host "Response:" -ForegroundColor Green
20
+ $response | ConvertTo-Json -Depth 5
21
+ } catch {
22
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
23
+ if ($_.Exception.Response) {
24
+ $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
25
+ $reader.BaseStream.Position = 0
26
+ $reader.ReadToEnd()
27
+ }
28
+ }
@@ -0,0 +1,8 @@
1
+ $body = @{
2
+ source_type = "text"
3
+ text = "This is a comprehensive test document about software testing. It covers unit testing, integration testing, and end-to-end testing methodologies."
4
+ name = "E2E-Test-Text-Source"
5
+ } | ConvertTo-Json
6
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 180
7
+ Write-Host "Success: $($response.success)"
8
+ if (-not $response.success) { Write-Host "Error: $($response.error)" }
@@ -0,0 +1,7 @@
1
+ $body = @{
2
+ source_type = "url"
3
+ url = "https://en.wikipedia.org/wiki/Software_testing"
4
+ } | ConvertTo-Json
5
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 180
6
+ Write-Host "Success: $($response.success)"
7
+ if (-not $response.success) { Write-Host "Error: $($response.error)" }