@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.
- package/LICENSE +22 -22
- package/README.md +71 -34
- package/deployment/INDEX.md +292 -0
- package/deployment/PACKAGE-FILES.txt +180 -0
- package/deployment/QUICK-START.md +100 -0
- package/deployment/docs/01-INSTALL.md +611 -0
- package/deployment/docs/02-CONFIGURATION.md +404 -0
- package/deployment/docs/03-API.md +1691 -0
- package/deployment/docs/04-N8N-INTEGRATION.md +373 -0
- package/deployment/docs/05-TROUBLESHOOTING.md +429 -0
- package/deployment/docs/06-NOTEBOOK-LIBRARY.md +692 -0
- package/deployment/docs/07-AUTO-DISCOVERY.md +236 -0
- package/deployment/docs/08-WSL-USAGE.md +363 -0
- package/deployment/docs/09-MULTI-INTERFACE.md +293 -0
- package/deployment/docs/10-CONTENT-MANAGEMENT.md +421 -0
- package/deployment/docs/11-MULTI-ACCOUNT.md +295 -0
- package/deployment/docs/README.md +207 -0
- package/deployment/scripts/README.md +564 -0
- package/deployment/scripts/install.ps1 +114 -0
- package/deployment/scripts/setup-auth.ps1 +217 -0
- package/deployment/scripts/start-server.ps1 +72 -0
- package/deployment/scripts/stop-server.ps1 +51 -0
- package/deployment/scripts/test-api.ps1 +651 -0
- package/deployment/scripts/test-auth.ps1 +323 -0
- package/deployment/scripts/test-auto-discovery.ps1 +295 -0
- package/deployment/scripts/test-cors.ps1 +398 -0
- package/deployment/scripts/test-errors.ps1 +581 -0
- package/deployment/scripts/test-server.ps1 +140 -0
- package/deployment/scripts/test-sessions.ps1 +426 -0
- package/deployment/scripts/test-validation.ps1 +299 -0
- package/dist/accounts/account-manager.d.ts +163 -0
- package/dist/accounts/account-manager.d.ts.map +1 -0
- package/dist/accounts/account-manager.js +614 -0
- package/dist/accounts/account-manager.js.map +1 -0
- package/dist/accounts/auto-login-manager.d.ts +62 -0
- package/dist/accounts/auto-login-manager.d.ts.map +1 -0
- package/dist/accounts/auto-login-manager.js +537 -0
- package/dist/accounts/auto-login-manager.js.map +1 -0
- package/dist/accounts/crypto.d.ts +45 -0
- package/dist/accounts/crypto.d.ts.map +1 -0
- package/dist/accounts/crypto.js +138 -0
- package/dist/accounts/crypto.js.map +1 -0
- package/dist/accounts/index.d.ts +14 -0
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/accounts/index.js +14 -0
- package/dist/accounts/index.js.map +1 -0
- package/dist/accounts/types.d.ts +103 -0
- package/dist/accounts/types.d.ts.map +1 -0
- package/dist/accounts/types.js +7 -0
- package/dist/accounts/types.js.map +1 -0
- package/dist/auth/auth-manager.d.ts +9 -2
- package/dist/auth/auth-manager.d.ts.map +1 -1
- package/dist/auth/auth-manager.js +60 -6
- package/dist/auth/auth-manager.js.map +1 -1
- package/dist/auto-discovery/auto-discovery.d.ts.map +1 -1
- package/dist/auto-discovery/auto-discovery.js +2 -1
- package/dist/auto-discovery/auto-discovery.js.map +1 -1
- package/dist/cli/accounts.d.ts +13 -0
- package/dist/cli/accounts.d.ts.map +1 -0
- package/dist/cli/accounts.js +195 -0
- package/dist/cli/accounts.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -0
- package/dist/config.js.map +1 -1
- package/dist/content/content-generator.d.ts +153 -0
- package/dist/content/content-generator.d.ts.map +1 -0
- package/dist/content/content-generator.js +637 -0
- package/dist/content/content-generator.js.map +1 -0
- package/dist/content/content-manager.d.ts +364 -0
- package/dist/content/content-manager.d.ts.map +1 -0
- package/dist/content/content-manager.js +3841 -0
- package/dist/content/content-manager.js.map +1 -0
- package/dist/content/content-templates.d.ts +183 -0
- package/dist/content/content-templates.d.ts.map +1 -0
- package/dist/content/content-templates.js +719 -0
- package/dist/content/content-templates.js.map +1 -0
- package/dist/content/index.d.ts +14 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +14 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/types.d.ts +285 -0
- package/dist/content/types.d.ts.map +1 -0
- package/dist/content/types.js +10 -0
- package/dist/content/types.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/http-wrapper.d.ts +7 -0
- package/dist/http-wrapper.d.ts.map +1 -1
- package/dist/http-wrapper.js +449 -29
- package/dist/http-wrapper.js.map +1 -1
- package/dist/i18n/en.json +120 -0
- package/dist/i18n/fr.json +120 -0
- package/dist/i18n/index.d.ts +168 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +213 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/library/notebook-library.d.ts +4 -0
- package/dist/library/notebook-library.d.ts.map +1 -1
- package/dist/library/notebook-library.js +20 -3
- package/dist/library/notebook-library.js.map +1 -1
- package/dist/session/browser-session.d.ts +35 -8
- package/dist/session/browser-session.d.ts.map +1 -1
- package/dist/session/browser-session.js +243 -28
- package/dist/session/browser-session.js.map +1 -1
- package/dist/session/session-manager.d.ts +6 -0
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +46 -14
- package/dist/session/session-manager.js.map +1 -1
- package/dist/session/shared-context-manager.d.ts +3 -3
- package/dist/session/shared-context-manager.d.ts.map +1 -1
- package/dist/session/shared-context-manager.js +10 -7
- package/dist/session/shared-context-manager.js.map +1 -1
- package/dist/stdio-http-proxy.d.ts +24 -0
- package/dist/stdio-http-proxy.d.ts.map +1 -0
- package/dist/stdio-http-proxy.js +592 -0
- package/dist/stdio-http-proxy.js.map +1 -0
- package/dist/tools/index.d.ts +106 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1028 -7
- package/dist/tools/index.js.map +1 -1
- package/dist/types.d.ts +81 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/citation-extractor.d.ts +66 -0
- package/dist/utils/citation-extractor.d.ts.map +1 -0
- package/dist/utils/citation-extractor.js +492 -0
- package/dist/utils/citation-extractor.js.map +1 -0
- package/dist/utils/page-utils.d.ts +8 -0
- package/dist/utils/page-utils.d.ts.map +1 -1
- package/dist/utils/page-utils.js +112 -8
- package/dist/utils/page-utils.js.map +1 -1
- package/docs/ADDING_A_LANGUAGE.md +209 -0
- package/docs/ARCHITECTURE_MIGRATION_STUDY.md +894 -0
- package/docs/CHROME_PROFILE_LIMITATION.md +15 -1
- package/docs/MULTI_ACCOUNT_SYSTEM.md +304 -0
- package/package.json +15 -12
- package/scripts/archive/add-and-activate-notebook.ps1 +31 -0
- package/scripts/archive/add-new-notebook.ps1 +25 -0
- package/scripts/archive/add-rom1pey.ps1 +2 -0
- package/scripts/archive/add-rpmonster.ps1 +2 -0
- package/scripts/archive/add-source-debug.ps1 +11 -0
- package/scripts/archive/add-source-e2e.ps1 +28 -0
- package/scripts/archive/add-source-visible.ps1 +11 -0
- package/scripts/archive/add-test-notebook.ps1 +13 -0
- package/scripts/archive/add-test-source.ps1 +50 -0
- package/scripts/archive/capture-screen.ps1 +11 -0
- package/scripts/archive/change-language.mjs +45 -0
- package/scripts/archive/change-language.ts +44 -0
- package/scripts/archive/check-account.ps1 +19 -0
- package/scripts/archive/check-notebook-2.ps1 +8 -0
- package/scripts/archive/check-test-notebook.ps1 +11 -0
- package/scripts/archive/create-notebook-auto.ps1 +31 -0
- package/scripts/archive/create-notebook.ps1 +8 -0
- package/scripts/archive/create-rom1pey-notebook.ps1 +19 -0
- package/scripts/archive/create-rom1pey.ps1 +8 -0
- package/scripts/archive/create-test-notebook-fresh.ps1 +21 -0
- package/scripts/archive/create-test-notebook.ps1 +16 -0
- package/scripts/archive/debug-add-source-auto.ps1 +29 -0
- package/scripts/archive/debug-add-source.ps1 +19 -0
- package/scripts/archive/debug-add-text-source.ps1 +47 -0
- package/scripts/archive/debug-home.ps1 +10 -0
- package/scripts/archive/debug-selectors.ps1 +55 -0
- package/scripts/archive/debug-sources-panel.ps1 +22 -0
- package/scripts/archive/debug-ui.ps1 +17 -0
- package/scripts/archive/discover-home.ps1 +26 -0
- package/scripts/archive/kill-automation-chrome.ps1 +37 -0
- package/scripts/archive/list-my-notebooks.ps1 +27 -0
- package/scripts/archive/navigate-home-visible.ps1 +23 -0
- package/scripts/archive/navigate-home.ps1 +15 -0
- package/scripts/archive/run-e2e-english.ps1 +111 -0
- package/scripts/archive/run-e2e-rom1pey-v2.ps1 +122 -0
- package/scripts/archive/run-e2e-rom1pey.ps1 +117 -0
- package/scripts/archive/setup-english-test.ps1 +36 -0
- package/scripts/archive/setup-test-notebook.ps1 +71 -0
- package/scripts/archive/simple-add-source.ps1 +14 -0
- package/scripts/archive/t10.ps1 +2 -0
- package/scripts/archive/t20.ps1 +4 -0
- package/scripts/archive/t30.ps1 +9 -0
- package/scripts/archive/t31.ps1 +11 -0
- package/scripts/archive/t32.ps1 +6 -0
- package/scripts/archive/t39.ps1 +5 -0
- package/scripts/archive/t40.ps1 +5 -0
- package/scripts/archive/t53.ps1 +12 -0
- package/scripts/archive/t54.ps1 +12 -0
- package/scripts/archive/t55.ps1 +11 -0
- package/scripts/archive/t9.ps1 +1 -0
- package/scripts/archive/test-access.ps1 +28 -0
- package/scripts/archive/test-add-delete-source.ps1 +64 -0
- package/scripts/archive/test-add-source-visible.ps1 +16 -0
- package/scripts/archive/test-add-source.ps1 +19 -0
- package/scripts/archive/test-add-text-debug.ps1 +28 -0
- package/scripts/archive/test-add-text-source.ps1 +8 -0
- package/scripts/archive/test-add-url-source.ps1 +7 -0
- package/scripts/archive/test-ask-ascii.ps1 +20 -0
- package/scripts/archive/test-ask-cnv.ps1 +20 -0
- package/scripts/archive/test-ask-headed.ps1 +51 -0
- package/scripts/archive/test-ask-ifs.ps1 +16 -0
- package/scripts/archive/test-ask-now.ps1 +24 -0
- package/scripts/archive/test-ask-real.ps1 +19 -0
- package/scripts/archive/test-ask-visible.ps1 +20 -0
- package/scripts/archive/test-create-notebook.ps1 +8 -0
- package/scripts/archive/test-create-then-add.ps1 +17 -0
- package/scripts/archive/test-delete-source.ps1 +41 -0
- package/scripts/archive/test-e2e-notebook.ps1 +21 -0
- package/scripts/archive/test-english-notebook.ps1 +20 -0
- package/scripts/archive/test-english.ps1 +7 -0
- package/scripts/archive/test-full-custom-instructions.ps1 +40 -0
- package/scripts/archive/test-full-infographic.ps1 +34 -0
- package/scripts/archive/test-full-language.ps1 +21 -0
- package/scripts/archive/test-full-presentation.ps1 +85 -0
- package/scripts/archive/test-full-report.ps1 +34 -0
- package/scripts/archive/test-full-source-selection.ps1 +35 -0
- package/scripts/archive/test-full-video-brief.ps1 +22 -0
- package/scripts/archive/test-full-video-explainer.ps1 +22 -0
- package/scripts/archive/test-full-video-styles.ps1 +37 -0
- package/scripts/archive/test-generate-report.ps1 +15 -0
- package/scripts/archive/test-generate-study-guide.ps1 +11 -0
- package/scripts/archive/test-headed-ask.ps1 +13 -0
- package/scripts/archive/test-headed-now.ps1 +9 -0
- package/scripts/archive/test-headed.ps1 +9 -0
- package/scripts/archive/test-hello.ps1 +7 -0
- package/scripts/archive/test-i18n-studio.ps1 +8 -0
- package/scripts/archive/test-i18n.ps1 +7 -0
- package/scripts/archive/test-manual-headed.ps1 +26 -0
- package/scripts/archive/test-mathieu-quota.ps1 +8 -0
- package/scripts/archive/test-notebook-1.ps1 +10 -0
- package/scripts/archive/test-notebook-2-sources.ps1 +12 -0
- package/scripts/archive/test-notebook1.ps1 +14 -0
- package/scripts/archive/test-personal-notebook.ps1 +14 -0
- package/scripts/archive/test-rate-limit.ps1 +19 -0
- package/scripts/archive/test-real-ask.ps1 +50 -0
- package/scripts/archive/test-real-ask2.ps1 +30 -0
- package/scripts/archive/test-rom1pey.ps1 +7 -0
- package/scripts/archive/test-rotation-complete.ps1 +14 -0
- package/scripts/archive/test-rotation.ps1 +8 -0
- package/scripts/archive/test-show-browser.ps1 +39 -0
- package/scripts/archive/test-update-notebook.ps1 +4 -0
- package/scripts/archive/verify-language-slow.ps1 +21 -0
- package/scripts/archive/verify-language.ps1 +15 -0
- package/scripts/check-server.ps1 +46 -0
- package/scripts/mcp-wsl-helper.sh +146 -0
- package/scripts/start-server.ps1 +94 -0
- package/scripts/stop-server.ps1 +30 -0
- package/scripts/switch-account-language.sh +191 -0
- package/scripts/test-account.ps1 +58 -0
- package/dist/__tests__/cleanup-manager.test.d.ts +0 -2
- package/dist/__tests__/cleanup-manager.test.d.ts.map +0 -1
- package/dist/__tests__/cleanup-manager.test.js +0 -341
- package/dist/__tests__/cleanup-manager.test.js.map +0 -1
- package/dist/__tests__/config-parsing.test.d.ts +0 -2
- package/dist/__tests__/config-parsing.test.d.ts.map +0 -1
- package/dist/__tests__/config-parsing.test.js +0 -338
- package/dist/__tests__/config-parsing.test.js.map +0 -1
- package/dist/__tests__/config.test.d.ts +0 -2
- package/dist/__tests__/config.test.d.ts.map +0 -1
- package/dist/__tests__/config.test.js +0 -267
- package/dist/__tests__/config.test.js.map +0 -1
- package/dist/__tests__/errors.test.d.ts +0 -2
- package/dist/__tests__/errors.test.d.ts.map +0 -1
- package/dist/__tests__/errors.test.js +0 -166
- package/dist/__tests__/errors.test.js.map +0 -1
- package/dist/__tests__/logger.test.d.ts +0 -2
- package/dist/__tests__/logger.test.d.ts.map +0 -1
- package/dist/__tests__/logger.test.js +0 -324
- package/dist/__tests__/logger.test.js.map +0 -1
- package/dist/__tests__/page-utils.test.d.ts +0 -2
- package/dist/__tests__/page-utils.test.d.ts.map +0 -1
- package/dist/__tests__/page-utils.test.js +0 -349
- package/dist/__tests__/page-utils.test.js.map +0 -1
- package/dist/__tests__/setup-verification.test.d.ts +0 -2
- package/dist/__tests__/setup-verification.test.d.ts.map +0 -1
- package/dist/__tests__/setup-verification.test.js +0 -15
- package/dist/__tests__/setup-verification.test.js.map +0 -1
- package/dist/__tests__/stealth-utils.test.d.ts +0 -2
- package/dist/__tests__/stealth-utils.test.d.ts.map +0 -1
- package/dist/__tests__/stealth-utils.test.js +0 -413
- package/dist/__tests__/stealth-utils.test.js.map +0 -1
- package/dist/__tests__/types.test.d.ts +0 -2
- package/dist/__tests__/types.test.d.ts.map +0 -1
- package/dist/__tests__/types.test.js +0 -461
- package/dist/__tests__/types.test.js.map +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Start NotebookLM MCP HTTP Server on Windows with auto-restart
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
This script starts the HTTP server and automatically restarts it if it crashes.
|
|
7
|
+
It must be run from Windows (PowerShell), NOT from WSL.
|
|
8
|
+
|
|
9
|
+
.EXAMPLE
|
|
10
|
+
.\scripts\start-server.ps1
|
|
11
|
+
|
|
12
|
+
.EXAMPLE
|
|
13
|
+
# Run in background (hidden window)
|
|
14
|
+
Start-Process powershell -ArgumentList "-ExecutionPolicy Bypass -File D:\Claude\notebooklm-mcp-http\scripts\start-server.ps1" -WindowStyle Hidden
|
|
15
|
+
#>
|
|
16
|
+
|
|
17
|
+
param(
|
|
18
|
+
[int]$Port = 3000,
|
|
19
|
+
[int]$MaxRestarts = 10,
|
|
20
|
+
[int]$RestartDelaySeconds = 5
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
$ErrorActionPreference = "Stop"
|
|
24
|
+
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
25
|
+
$ProjectDir = Split-Path -Parent $ScriptDir
|
|
26
|
+
|
|
27
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
28
|
+
Write-Host " NotebookLM MCP HTTP Server (Windows) " -ForegroundColor Cyan
|
|
29
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
30
|
+
Write-Host ""
|
|
31
|
+
Write-Host "Project: $ProjectDir"
|
|
32
|
+
Write-Host "Port: $Port"
|
|
33
|
+
Write-Host "Max restarts: $MaxRestarts"
|
|
34
|
+
Write-Host ""
|
|
35
|
+
|
|
36
|
+
# Check we're on Windows (not WSL)
|
|
37
|
+
if ($env:WSL_DISTRO_NAME) {
|
|
38
|
+
Write-Host "ERROR: This script must be run from Windows, not WSL!" -ForegroundColor Red
|
|
39
|
+
Write-Host "Open PowerShell on Windows and run:" -ForegroundColor Yellow
|
|
40
|
+
Write-Host " cd $ProjectDir" -ForegroundColor Yellow
|
|
41
|
+
Write-Host " .\scripts\start-server.ps1" -ForegroundColor Yellow
|
|
42
|
+
exit 1
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# Kill any existing server on the port
|
|
46
|
+
$existingProcesses = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue |
|
|
47
|
+
Select-Object -ExpandProperty OwningProcess -Unique
|
|
48
|
+
|
|
49
|
+
foreach ($pid in $existingProcesses) {
|
|
50
|
+
Write-Host "Killing existing process on port $Port (PID: $pid)..." -ForegroundColor Yellow
|
|
51
|
+
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
# Change to project directory
|
|
55
|
+
Set-Location $ProjectDir
|
|
56
|
+
|
|
57
|
+
$restartCount = 0
|
|
58
|
+
$lastRestartTime = Get-Date
|
|
59
|
+
|
|
60
|
+
while ($restartCount -lt $MaxRestarts) {
|
|
61
|
+
Write-Host ""
|
|
62
|
+
Write-Host "[$(Get-Date -Format 'HH:mm:ss')] Starting server (attempt $($restartCount + 1)/$MaxRestarts)..." -ForegroundColor Green
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
# Start the server
|
|
66
|
+
$process = Start-Process -FilePath "node.exe" -ArgumentList "dist/http-wrapper.js" -NoNewWindow -PassThru -Wait
|
|
67
|
+
|
|
68
|
+
$exitCode = $process.ExitCode
|
|
69
|
+
Write-Host "[$(Get-Date -Format 'HH:mm:ss')] Server exited with code: $exitCode" -ForegroundColor Yellow
|
|
70
|
+
|
|
71
|
+
# Reset restart count if server ran for more than 1 minute
|
|
72
|
+
$timeSinceLastRestart = (Get-Date) - $lastRestartTime
|
|
73
|
+
if ($timeSinceLastRestart.TotalMinutes -gt 1) {
|
|
74
|
+
$restartCount = 0
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
$restartCount++
|
|
78
|
+
$lastRestartTime = Get-Date
|
|
79
|
+
|
|
80
|
+
if ($restartCount -lt $MaxRestarts) {
|
|
81
|
+
Write-Host "[$(Get-Date -Format 'HH:mm:ss')] Restarting in $RestartDelaySeconds seconds..." -ForegroundColor Cyan
|
|
82
|
+
Start-Sleep -Seconds $RestartDelaySeconds
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
Write-Host "[$(Get-Date -Format 'HH:mm:ss')] Error: $_" -ForegroundColor Red
|
|
87
|
+
$restartCount++
|
|
88
|
+
Start-Sleep -Seconds $RestartDelaySeconds
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
Write-Host ""
|
|
93
|
+
Write-Host "Max restarts ($MaxRestarts) reached. Server stopped." -ForegroundColor Red
|
|
94
|
+
Write-Host "Check logs for errors." -ForegroundColor Yellow
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Stop NotebookLM MCP HTTP Server on Windows
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
Stops all node processes running the HTTP server on port 3000.
|
|
7
|
+
#>
|
|
8
|
+
|
|
9
|
+
param(
|
|
10
|
+
[int]$Port = 3000
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
Write-Host "Stopping NotebookLM MCP HTTP Server..." -ForegroundColor Yellow
|
|
14
|
+
|
|
15
|
+
# Find and kill processes on the port
|
|
16
|
+
$processes = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue |
|
|
17
|
+
Select-Object -ExpandProperty OwningProcess -Unique
|
|
18
|
+
|
|
19
|
+
if ($processes) {
|
|
20
|
+
foreach ($pid in $processes) {
|
|
21
|
+
$proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
|
|
22
|
+
if ($proc) {
|
|
23
|
+
Write-Host "Stopping $($proc.ProcessName) (PID: $pid)..." -ForegroundColor Cyan
|
|
24
|
+
Stop-Process -Id $pid -Force
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
Write-Host "Server stopped." -ForegroundColor Green
|
|
28
|
+
} else {
|
|
29
|
+
Write-Host "No server running on port $Port." -ForegroundColor Gray
|
|
30
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Switch Account Language Script
|
|
3
|
+
#
|
|
4
|
+
# This script automates the process of switching an account to a new language.
|
|
5
|
+
# It deletes the Chrome profile cache and re-authenticates to get a fresh profile
|
|
6
|
+
# with the new language settings from Google Account.
|
|
7
|
+
#
|
|
8
|
+
# PREREQUISITE: You must first change the language in Google Account settings:
|
|
9
|
+
# https://myaccount.google.com/language
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# ./switch-account-language.sh --account=rom1pey --lang=en
|
|
13
|
+
# ./switch-account-language.sh --account=mathieu --lang=fr
|
|
14
|
+
# ./switch-account-language.sh --account=rpmonster --lang=en --show
|
|
15
|
+
|
|
16
|
+
set -e
|
|
17
|
+
|
|
18
|
+
# Default values
|
|
19
|
+
ACCOUNT=""
|
|
20
|
+
LANG=""
|
|
21
|
+
SHOW_BROWSER=""
|
|
22
|
+
|
|
23
|
+
# Account configurations
|
|
24
|
+
declare -A ACCOUNT_IDS=(
|
|
25
|
+
["mathieu"]="account-1766565732376"
|
|
26
|
+
["rpmonster"]="account-1767078713573"
|
|
27
|
+
["rom1pey"]="account-1767079146601"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
declare -A ACCOUNT_EMAILS=(
|
|
31
|
+
["mathieu"]="mathieudumont31@gmail.com"
|
|
32
|
+
["rpmonster"]="rpmonster@gmail.com"
|
|
33
|
+
["rom1pey"]="rom1pey@gmail.com"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Data path
|
|
37
|
+
DATA_PATH="/mnt/c/Users/romai/AppData/Local/notebooklm-mcp/Data"
|
|
38
|
+
|
|
39
|
+
# Parse arguments
|
|
40
|
+
for arg in "$@"; do
|
|
41
|
+
case $arg in
|
|
42
|
+
--account=*)
|
|
43
|
+
ACCOUNT="${arg#*=}"
|
|
44
|
+
;;
|
|
45
|
+
--lang=*)
|
|
46
|
+
LANG="${arg#*=}"
|
|
47
|
+
;;
|
|
48
|
+
--show)
|
|
49
|
+
SHOW_BROWSER="--show"
|
|
50
|
+
;;
|
|
51
|
+
--help)
|
|
52
|
+
echo "Switch Account Language Script"
|
|
53
|
+
echo ""
|
|
54
|
+
echo "PREREQUISITE: Change language in Google Account first:"
|
|
55
|
+
echo " https://myaccount.google.com/language"
|
|
56
|
+
echo ""
|
|
57
|
+
echo "Usage: ./switch-account-language.sh [options]"
|
|
58
|
+
echo ""
|
|
59
|
+
echo "Options:"
|
|
60
|
+
echo " --account=NAME Account: mathieu|rpmonster|rom1pey (required)"
|
|
61
|
+
echo " --lang=LANG Target language: en|fr (required)"
|
|
62
|
+
echo " --show Show browser during re-authentication"
|
|
63
|
+
echo " --help Show this help"
|
|
64
|
+
echo ""
|
|
65
|
+
echo "Examples:"
|
|
66
|
+
echo " ./switch-account-language.sh --account=rom1pey --lang=en"
|
|
67
|
+
echo " ./switch-account-language.sh --account=mathieu --lang=fr --show"
|
|
68
|
+
exit 0
|
|
69
|
+
;;
|
|
70
|
+
esac
|
|
71
|
+
done
|
|
72
|
+
|
|
73
|
+
# Validate arguments
|
|
74
|
+
if [ -z "$ACCOUNT" ]; then
|
|
75
|
+
echo "ERROR: --account is required"
|
|
76
|
+
echo "Use --help for usage information"
|
|
77
|
+
exit 1
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
if [ -z "$LANG" ]; then
|
|
81
|
+
echo "ERROR: --lang is required"
|
|
82
|
+
echo "Use --help for usage information"
|
|
83
|
+
exit 1
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
if [ -z "${ACCOUNT_IDS[$ACCOUNT]}" ]; then
|
|
87
|
+
echo "ERROR: Unknown account '$ACCOUNT'"
|
|
88
|
+
echo "Valid accounts: mathieu, rpmonster, rom1pey"
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
if [ "$LANG" != "en" ] && [ "$LANG" != "fr" ]; then
|
|
93
|
+
echo "ERROR: Invalid language '$LANG'"
|
|
94
|
+
echo "Valid languages: en, fr"
|
|
95
|
+
exit 1
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
ACCOUNT_ID="${ACCOUNT_IDS[$ACCOUNT]}"
|
|
99
|
+
ACCOUNT_EMAIL="${ACCOUNT_EMAILS[$ACCOUNT]}"
|
|
100
|
+
|
|
101
|
+
echo "╔════════════════════════════════════════════════════════════╗"
|
|
102
|
+
echo "║ Switch Account Language ║"
|
|
103
|
+
echo "╠════════════════════════════════════════════════════════════╣"
|
|
104
|
+
echo "║ Account: $ACCOUNT ($ACCOUNT_EMAIL)"
|
|
105
|
+
echo "║ Target: $LANG"
|
|
106
|
+
echo "╚════════════════════════════════════════════════════════════╝"
|
|
107
|
+
echo ""
|
|
108
|
+
|
|
109
|
+
# Step 1: Stop server and Chrome
|
|
110
|
+
echo "Step 1/5: Stopping server and Chrome..."
|
|
111
|
+
cmd.exe /c "taskkill /F /IM node.exe" 2>/dev/null || true
|
|
112
|
+
sleep 1
|
|
113
|
+
# Only kill Chrome if profile is locked (don't kill user's personal browser)
|
|
114
|
+
if [ -f "$DATA_PATH/chrome_profile/lockfile" ] 2>/dev/null; then
|
|
115
|
+
echo " Chrome profile locked, killing Chrome..."
|
|
116
|
+
cmd.exe /c "taskkill /F /IM chrome.exe" 2>/dev/null || true
|
|
117
|
+
sleep 2
|
|
118
|
+
fi
|
|
119
|
+
echo " Done."
|
|
120
|
+
|
|
121
|
+
# Step 2: Delete account's Chrome profile (to clear language cache)
|
|
122
|
+
echo ""
|
|
123
|
+
echo "Step 2/5: Deleting Chrome profile cache for $ACCOUNT..."
|
|
124
|
+
ACCOUNT_PROFILE="$DATA_PATH/accounts/$ACCOUNT_ID/profile"
|
|
125
|
+
if [ -d "$ACCOUNT_PROFILE" ]; then
|
|
126
|
+
rm -rf "$ACCOUNT_PROFILE"
|
|
127
|
+
echo " Deleted: $ACCOUNT_PROFILE"
|
|
128
|
+
else
|
|
129
|
+
echo " Profile not found (already clean)"
|
|
130
|
+
fi
|
|
131
|
+
echo " Done."
|
|
132
|
+
|
|
133
|
+
# Step 3: Re-authenticate to create fresh profile
|
|
134
|
+
echo ""
|
|
135
|
+
echo "Step 3/5: Re-authenticating $ACCOUNT..."
|
|
136
|
+
echo " This will open a browser to log in with the new language settings."
|
|
137
|
+
echo ""
|
|
138
|
+
|
|
139
|
+
cd /mnt/d/Claude/notebooklm-mcp-http
|
|
140
|
+
cmd.exe /c "cd /d D:\\Claude\\notebooklm-mcp-http && npm run accounts test $ACCOUNT_ID -- $SHOW_BROWSER"
|
|
141
|
+
|
|
142
|
+
echo " Done."
|
|
143
|
+
|
|
144
|
+
# Step 4: Sync new profile to main
|
|
145
|
+
echo ""
|
|
146
|
+
echo "Step 4/5: Syncing new profile to main..."
|
|
147
|
+
|
|
148
|
+
# Sync state.json
|
|
149
|
+
if [ -f "$DATA_PATH/accounts/$ACCOUNT_ID/browser_state/state.json" ]; then
|
|
150
|
+
cp "$DATA_PATH/accounts/$ACCOUNT_ID/browser_state/state.json" "$DATA_PATH/browser_state/"
|
|
151
|
+
echo " Synced state.json"
|
|
152
|
+
else
|
|
153
|
+
echo " WARNING: state.json not found"
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
# Sync Chrome profile
|
|
157
|
+
rm -rf "$DATA_PATH/chrome_profile" 2>/dev/null || true
|
|
158
|
+
if [ -d "$DATA_PATH/accounts/$ACCOUNT_ID/profile" ]; then
|
|
159
|
+
cp -r "$DATA_PATH/accounts/$ACCOUNT_ID/profile" "$DATA_PATH/chrome_profile"
|
|
160
|
+
echo " Synced Chrome profile"
|
|
161
|
+
else
|
|
162
|
+
echo " WARNING: Chrome profile not found"
|
|
163
|
+
fi
|
|
164
|
+
echo " Done."
|
|
165
|
+
|
|
166
|
+
# Step 5: Restart server with correct locale
|
|
167
|
+
echo ""
|
|
168
|
+
echo "Step 5/5: Starting server with UI locale '$LANG'..."
|
|
169
|
+
|
|
170
|
+
# Convert lang to uppercase for display
|
|
171
|
+
LANG_UPPER=$(echo "$LANG" | tr '[:lower:]' '[:upper:]')
|
|
172
|
+
|
|
173
|
+
cmd.exe /c "cd /d D:\\Claude\\notebooklm-mcp-http && set NOTEBOOKLM_UI_LOCALE=$LANG&& start /B node dist/http-wrapper.js" &
|
|
174
|
+
sleep 4
|
|
175
|
+
|
|
176
|
+
# Verify
|
|
177
|
+
echo ""
|
|
178
|
+
echo "Verifying server..."
|
|
179
|
+
HEALTH=$(cmd.exe /c "curl -s http://localhost:3000/health" 2>/dev/null || echo '{"error":"failed"}')
|
|
180
|
+
echo "$HEALTH" | head -c 200
|
|
181
|
+
|
|
182
|
+
echo ""
|
|
183
|
+
echo ""
|
|
184
|
+
echo "╔════════════════════════════════════════════════════════════╗"
|
|
185
|
+
echo "║ COMPLETED ║"
|
|
186
|
+
echo "╠════════════════════════════════════════════════════════════╣"
|
|
187
|
+
echo "║ Account '$ACCOUNT' is now configured for '$LANG_UPPER'."
|
|
188
|
+
echo "║ ║"
|
|
189
|
+
echo "║ IMPORTANT: Verify visually that NotebookLM UI is in $LANG_UPPER ║"
|
|
190
|
+
echo "║ by running a test with show_browser:true ║"
|
|
191
|
+
echo "╚════════════════════════════════════════════════════════════╝"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Test auto-login for a NotebookLM account
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
This script tests the auto-login functionality for a specific account.
|
|
7
|
+
It must be run from Windows (PowerShell), NOT from WSL.
|
|
8
|
+
|
|
9
|
+
.PARAMETER AccountId
|
|
10
|
+
The account ID to test
|
|
11
|
+
|
|
12
|
+
.PARAMETER ShowBrowser
|
|
13
|
+
Show the browser window during login
|
|
14
|
+
|
|
15
|
+
.EXAMPLE
|
|
16
|
+
.\scripts\test-account.ps1 -AccountId "account-123"
|
|
17
|
+
|
|
18
|
+
.EXAMPLE
|
|
19
|
+
.\scripts\test-account.ps1 -AccountId "account-123" -ShowBrowser
|
|
20
|
+
#>
|
|
21
|
+
|
|
22
|
+
param(
|
|
23
|
+
[Parameter(Mandatory=$true)]
|
|
24
|
+
[string]$AccountId,
|
|
25
|
+
|
|
26
|
+
[switch]$ShowBrowser
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
$ErrorActionPreference = "Stop"
|
|
30
|
+
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
31
|
+
$ProjectDir = Split-Path -Parent $ScriptDir
|
|
32
|
+
|
|
33
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
34
|
+
Write-Host " NotebookLM Account Login Test " -ForegroundColor Cyan
|
|
35
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
36
|
+
Write-Host ""
|
|
37
|
+
|
|
38
|
+
# Check we're on Windows (not WSL)
|
|
39
|
+
if ($env:WSL_DISTRO_NAME) {
|
|
40
|
+
Write-Host "ERROR: This script must be run from Windows, not WSL!" -ForegroundColor Red
|
|
41
|
+
Write-Host "Run from PowerShell on Windows." -ForegroundColor Yellow
|
|
42
|
+
exit 1
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Set-Location $ProjectDir
|
|
46
|
+
|
|
47
|
+
# Build arguments
|
|
48
|
+
$args = @("dist/cli/accounts.js", "test", $AccountId)
|
|
49
|
+
if ($ShowBrowser) {
|
|
50
|
+
$args += "--show"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Write-Host "Testing account: $AccountId"
|
|
54
|
+
Write-Host "Show browser: $ShowBrowser"
|
|
55
|
+
Write-Host ""
|
|
56
|
+
|
|
57
|
+
# Run the test
|
|
58
|
+
& node.exe @args
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup-manager.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/cleanup-manager.test.ts"],"names":[],"mappings":""}
|