@pan-sec/notebooklm-mcp 2026.2.11 → 2026.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -19
- package/SECURITY.md +31 -61
- package/dist/auth/auth-manager.d.ts +2 -1
- package/dist/auth/auth-manager.d.ts.map +1 -1
- package/dist/auth/auth-manager.js +117 -44
- package/dist/auth/auth-manager.js.map +1 -1
- package/dist/auth/mcp-auth.d.ts +24 -4
- package/dist/auth/mcp-auth.d.ts.map +1 -1
- package/dist/auth/mcp-auth.js +149 -19
- package/dist/auth/mcp-auth.js.map +1 -1
- package/dist/compliance/alert-manager.d.ts.map +1 -1
- package/dist/compliance/alert-manager.js +7 -4
- package/dist/compliance/alert-manager.js.map +1 -1
- package/dist/compliance/breach-detection.d.ts.map +1 -1
- package/dist/compliance/breach-detection.js +14 -7
- package/dist/compliance/breach-detection.js.map +1 -1
- package/dist/compliance/change-log.d.ts.map +1 -1
- package/dist/compliance/change-log.js +7 -4
- package/dist/compliance/change-log.js.map +1 -1
- package/dist/compliance/compliance-logger.d.ts.map +1 -1
- package/dist/compliance/compliance-logger.js +11 -6
- package/dist/compliance/compliance-logger.js.map +1 -1
- package/dist/compliance/consent-manager.d.ts.map +1 -1
- package/dist/compliance/consent-manager.js +5 -3
- package/dist/compliance/consent-manager.js.map +1 -1
- package/dist/compliance/data-erasure.d.ts +1 -1
- package/dist/compliance/data-erasure.d.ts.map +1 -1
- package/dist/compliance/data-erasure.js +142 -83
- package/dist/compliance/data-erasure.js.map +1 -1
- package/dist/compliance/data-export.d.ts.map +1 -1
- package/dist/compliance/data-export.js +23 -12
- package/dist/compliance/data-export.js.map +1 -1
- package/dist/compliance/data-inventory.d.ts.map +1 -1
- package/dist/compliance/data-inventory.js +7 -6
- package/dist/compliance/data-inventory.js.map +1 -1
- package/dist/compliance/dsar-handler.d.ts +7 -1
- package/dist/compliance/dsar-handler.d.ts.map +1 -1
- package/dist/compliance/dsar-handler.js +74 -61
- package/dist/compliance/dsar-handler.js.map +1 -1
- package/dist/compliance/evidence-collector.d.ts.map +1 -1
- package/dist/compliance/evidence-collector.js +10 -6
- package/dist/compliance/evidence-collector.js.map +1 -1
- package/dist/compliance/health-monitor.d.ts.map +1 -1
- package/dist/compliance/health-monitor.js +15 -9
- package/dist/compliance/health-monitor.js.map +1 -1
- package/dist/compliance/incident-manager.d.ts.map +1 -1
- package/dist/compliance/incident-manager.js +5 -3
- package/dist/compliance/incident-manager.js.map +1 -1
- package/dist/compliance/policy-docs.d.ts.map +1 -1
- package/dist/compliance/policy-docs.js +14 -11
- package/dist/compliance/policy-docs.js.map +1 -1
- package/dist/compliance/privacy-notice-text.d.ts.map +1 -1
- package/dist/compliance/privacy-notice-text.js +3 -4
- package/dist/compliance/privacy-notice-text.js.map +1 -1
- package/dist/compliance/privacy-notice.d.ts.map +1 -1
- package/dist/compliance/privacy-notice.js +5 -3
- package/dist/compliance/privacy-notice.js.map +1 -1
- package/dist/compliance/report-generator.d.ts.map +1 -1
- package/dist/compliance/report-generator.js +5 -3
- package/dist/compliance/report-generator.js.map +1 -1
- package/dist/compliance/retention-engine.d.ts.map +1 -1
- package/dist/compliance/retention-engine.js +24 -10
- package/dist/compliance/retention-engine.js.map +1 -1
- package/dist/compliance/siem-exporter.d.ts.map +1 -1
- package/dist/compliance/siem-exporter.js +40 -16
- package/dist/compliance/siem-exporter.js.map +1 -1
- package/dist/config.d.ts +8 -31
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +26 -64
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +22 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +55 -4
- package/dist/errors.js.map +1 -1
- package/dist/gemini/gemini-client.d.ts +1 -0
- package/dist/gemini/gemini-client.d.ts.map +1 -1
- package/dist/gemini/gemini-client.js +50 -49
- package/dist/gemini/gemini-client.js.map +1 -1
- package/dist/gemini/types.d.ts +3 -1
- package/dist/gemini/types.d.ts.map +1 -1
- package/dist/gemini/types.js.map +1 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +412 -89
- package/dist/index.js.map +1 -1
- package/dist/library/notebook-library.d.ts.map +1 -1
- package/dist/library/notebook-library.js +2 -1
- package/dist/library/notebook-library.js.map +1 -1
- package/dist/logging/query-logger.d.ts +13 -1
- package/dist/logging/query-logger.d.ts.map +1 -1
- package/dist/logging/query-logger.js +62 -10
- package/dist/logging/query-logger.js.map +1 -1
- package/dist/notebook-creation/audio-manager.d.ts.map +1 -1
- package/dist/notebook-creation/audio-manager.js +19 -24
- package/dist/notebook-creation/audio-manager.js.map +1 -1
- package/dist/notebook-creation/browser-options.d.ts +28 -0
- package/dist/notebook-creation/browser-options.d.ts.map +1 -0
- package/dist/notebook-creation/browser-options.js +75 -0
- package/dist/notebook-creation/browser-options.js.map +1 -0
- package/dist/notebook-creation/data-table-manager.d.ts.map +1 -1
- package/dist/notebook-creation/data-table-manager.js +20 -21
- package/dist/notebook-creation/data-table-manager.js.map +1 -1
- package/dist/notebook-creation/discover-creation-flow.d.ts +0 -6
- package/dist/notebook-creation/discover-creation-flow.d.ts.map +1 -1
- package/dist/notebook-creation/discover-creation-flow.js +10 -10
- package/dist/notebook-creation/discover-creation-flow.js.map +1 -1
- package/dist/notebook-creation/discover-quota.d.ts +0 -6
- package/dist/notebook-creation/discover-quota.d.ts.map +1 -1
- package/dist/notebook-creation/discover-quota.js +12 -13
- package/dist/notebook-creation/discover-quota.js.map +1 -1
- package/dist/notebook-creation/discover-sources.js +15 -16
- package/dist/notebook-creation/discover-sources.js.map +1 -1
- package/dist/notebook-creation/dom-scripts.d.ts +10 -0
- package/dist/notebook-creation/dom-scripts.d.ts.map +1 -0
- package/dist/notebook-creation/dom-scripts.js +58 -0
- package/dist/notebook-creation/dom-scripts.js.map +1 -0
- package/dist/notebook-creation/errors.d.ts +18 -0
- package/dist/notebook-creation/errors.d.ts.map +1 -0
- package/dist/notebook-creation/errors.js +20 -0
- package/dist/notebook-creation/errors.js.map +1 -0
- package/dist/notebook-creation/index.d.ts +2 -1
- package/dist/notebook-creation/index.d.ts.map +1 -1
- package/dist/notebook-creation/index.js +2 -1
- package/dist/notebook-creation/index.js.map +1 -1
- package/dist/notebook-creation/notebook-creator.d.ts +6 -82
- package/dist/notebook-creation/notebook-creator.d.ts.map +1 -1
- package/dist/notebook-creation/notebook-creator.js +49 -835
- package/dist/notebook-creation/notebook-creator.js.map +1 -1
- package/dist/notebook-creation/notebook-nav.d.ts +19 -0
- package/dist/notebook-creation/notebook-nav.d.ts.map +1 -0
- package/dist/notebook-creation/notebook-nav.js +240 -0
- package/dist/notebook-creation/notebook-nav.js.map +1 -0
- package/dist/notebook-creation/notebook-sync.d.ts.map +1 -1
- package/dist/notebook-creation/notebook-sync.js +36 -38
- package/dist/notebook-creation/notebook-sync.js.map +1 -1
- package/dist/notebook-creation/selector-discovery.d.ts.map +1 -1
- package/dist/notebook-creation/selector-discovery.js +17 -24
- package/dist/notebook-creation/selector-discovery.js.map +1 -1
- package/dist/notebook-creation/selectors.d.ts +23 -37
- package/dist/notebook-creation/selectors.d.ts.map +1 -1
- package/dist/notebook-creation/selectors.js +56 -60
- package/dist/notebook-creation/selectors.js.map +1 -1
- package/dist/notebook-creation/source-manager.d.ts +25 -0
- package/dist/notebook-creation/source-manager.d.ts.map +1 -1
- package/dist/notebook-creation/source-manager.js +689 -50
- package/dist/notebook-creation/source-manager.js.map +1 -1
- package/dist/notebook-creation/types.d.ts +4 -0
- package/dist/notebook-creation/types.d.ts.map +1 -1
- package/dist/notebook-creation/video-manager.d.ts.map +1 -1
- package/dist/notebook-creation/video-manager.js +33 -35
- package/dist/notebook-creation/video-manager.js.map +1 -1
- package/dist/observability/metrics.d.ts +19 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +35 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/quota/quota-manager.d.ts +11 -3
- package/dist/quota/quota-manager.d.ts.map +1 -1
- package/dist/quota/quota-manager.js +139 -47
- package/dist/quota/quota-manager.js.map +1 -1
- package/dist/resources/resource-handlers.d.ts.map +1 -1
- package/dist/resources/resource-handlers.js +39 -17
- package/dist/resources/resource-handlers.js.map +1 -1
- package/dist/session/browser-session.d.ts.map +1 -1
- package/dist/session/browser-session.js +22 -22
- package/dist/session/browser-session.js.map +1 -1
- package/dist/session/session-timeout.d.ts.map +1 -1
- package/dist/session/session-timeout.js +4 -2
- package/dist/session/session-timeout.js.map +1 -1
- package/dist/session/shared-context-manager.d.ts.map +1 -1
- package/dist/session/shared-context-manager.js +31 -30
- package/dist/session/shared-context-manager.js.map +1 -1
- package/dist/tools/annotations.d.ts.map +1 -1
- package/dist/tools/annotations.js +9 -56
- package/dist/tools/annotations.js.map +1 -1
- package/dist/tools/definitions/ask-question.d.ts.map +1 -1
- package/dist/tools/definitions/ask-question.js +35 -100
- package/dist/tools/definitions/ask-question.js.map +1 -1
- package/dist/tools/definitions/chat-history.d.ts +47 -1
- package/dist/tools/definitions/chat-history.d.ts.map +1 -1
- package/dist/tools/definitions/chat-history.js +10 -1
- package/dist/tools/definitions/chat-history.js.map +1 -1
- package/dist/tools/definitions/data-tables.d.ts.map +1 -1
- package/dist/tools/definitions/data-tables.js +2 -0
- package/dist/tools/definitions/data-tables.js.map +1 -1
- package/dist/tools/definitions/gemini.d.ts.map +1 -1
- package/dist/tools/definitions/gemini.js +54 -11
- package/dist/tools/definitions/gemini.js.map +1 -1
- package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
- package/dist/tools/definitions/notebook-management.js +100 -70
- package/dist/tools/definitions/notebook-management.js.map +1 -1
- package/dist/tools/definitions/query-history.d.ts +47 -1
- package/dist/tools/definitions/query-history.d.ts.map +1 -1
- package/dist/tools/definitions/query-history.js +7 -0
- package/dist/tools/definitions/query-history.js.map +1 -1
- package/dist/tools/definitions/session-management.d.ts.map +1 -1
- package/dist/tools/definitions/session-management.js +5 -0
- package/dist/tools/definitions/session-management.js.map +1 -1
- package/dist/tools/definitions/system.d.ts.map +1 -1
- package/dist/tools/definitions/system.js +71 -100
- package/dist/tools/definitions/system.js.map +1 -1
- package/dist/tools/definitions/video.d.ts.map +1 -1
- package/dist/tools/definitions/video.js +4 -1
- package/dist/tools/definitions/video.js.map +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +4 -0
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/handlers/ask-question.d.ts +1 -1
- package/dist/tools/handlers/ask-question.d.ts.map +1 -1
- package/dist/tools/handlers/ask-question.js +57 -13
- package/dist/tools/handlers/ask-question.js.map +1 -1
- package/dist/tools/handlers/audio-video.d.ts.map +1 -1
- package/dist/tools/handlers/audio-video.js +22 -161
- package/dist/tools/handlers/audio-video.js.map +1 -1
- package/dist/tools/handlers/auth.d.ts +14 -19
- package/dist/tools/handlers/auth.d.ts.map +1 -1
- package/dist/tools/handlers/auth.js +77 -121
- package/dist/tools/handlers/auth.js.map +1 -1
- package/dist/tools/handlers/error-utils.d.ts +16 -0
- package/dist/tools/handlers/error-utils.d.ts.map +1 -0
- package/dist/tools/handlers/error-utils.js +39 -0
- package/dist/tools/handlers/error-utils.js.map +1 -0
- package/dist/tools/handlers/gemini.d.ts +2 -0
- package/dist/tools/handlers/gemini.d.ts.map +1 -1
- package/dist/tools/handlers/gemini.js +88 -51
- package/dist/tools/handlers/gemini.js.map +1 -1
- package/dist/tools/handlers/index.d.ts +39 -47
- package/dist/tools/handlers/index.d.ts.map +1 -1
- package/dist/tools/handlers/index.js +15 -4
- package/dist/tools/handlers/index.js.map +1 -1
- package/dist/tools/handlers/notebook-creation.d.ts.map +1 -1
- package/dist/tools/handlers/notebook-creation.js +102 -86
- package/dist/tools/handlers/notebook-creation.js.map +1 -1
- package/dist/tools/handlers/notebook-management.d.ts +8 -8
- package/dist/tools/handlers/notebook-management.d.ts.map +1 -1
- package/dist/tools/handlers/notebook-management.js +34 -80
- package/dist/tools/handlers/notebook-management.js.map +1 -1
- package/dist/tools/handlers/session-management.d.ts +8 -10
- package/dist/tools/handlers/session-management.d.ts.map +1 -1
- package/dist/tools/handlers/session-management.js +34 -63
- package/dist/tools/handlers/session-management.js.map +1 -1
- package/dist/tools/handlers/system.d.ts.map +1 -1
- package/dist/tools/handlers/system.js +45 -10
- package/dist/tools/handlers/system.js.map +1 -1
- package/dist/tools/handlers/types.d.ts +1 -1
- package/dist/tools/handlers/types.d.ts.map +1 -1
- package/dist/tools/handlers/webhooks.d.ts.map +1 -1
- package/dist/tools/handlers/webhooks.js +15 -13
- package/dist/tools/handlers/webhooks.js.map +1 -1
- package/dist/types.d.ts +7 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/audit-logger.d.ts +19 -1
- package/dist/utils/audit-logger.d.ts.map +1 -1
- package/dist/utils/audit-logger.js +198 -30
- package/dist/utils/audit-logger.js.map +1 -1
- package/dist/utils/cleanup-manager.d.ts.map +1 -1
- package/dist/utils/cleanup-manager.js +6 -3
- package/dist/utils/cleanup-manager.js.map +1 -1
- package/dist/utils/crypto.d.ts +4 -1
- package/dist/utils/crypto.d.ts.map +1 -1
- package/dist/utils/crypto.js +32 -21
- package/dist/utils/crypto.js.map +1 -1
- package/dist/utils/file-lock.d.ts.map +1 -1
- package/dist/utils/file-lock.js +87 -16
- package/dist/utils/file-lock.js.map +1 -1
- package/dist/utils/file-permissions.d.ts +2 -0
- package/dist/utils/file-permissions.d.ts.map +1 -1
- package/dist/utils/file-permissions.js +2 -1
- package/dist/utils/file-permissions.js.map +1 -1
- package/dist/utils/logger.d.ts +4 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +16 -0
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/page-utils.d.ts +13 -0
- package/dist/utils/page-utils.d.ts.map +1 -1
- package/dist/utils/page-utils.js +61 -39
- package/dist/utils/page-utils.js.map +1 -1
- package/dist/utils/response-validator.d.ts.map +1 -1
- package/dist/utils/response-validator.js +27 -22
- package/dist/utils/response-validator.js.map +1 -1
- package/dist/utils/secrets-scanner.d.ts +11 -0
- package/dist/utils/secrets-scanner.d.ts.map +1 -1
- package/dist/utils/secrets-scanner.js +65 -17
- package/dist/utils/secrets-scanner.js.map +1 -1
- package/dist/utils/secure-memory.d.ts +9 -31
- package/dist/utils/secure-memory.d.ts.map +1 -1
- package/dist/utils/secure-memory.js +17 -102
- package/dist/utils/secure-memory.js.map +1 -1
- package/dist/utils/security.d.ts +4 -3
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js +43 -13
- package/dist/utils/security.js.map +1 -1
- package/dist/utils/stealth-utils.d.ts.map +1 -1
- package/dist/utils/stealth-utils.js +4 -4
- package/dist/utils/stealth-utils.js.map +1 -1
- package/dist/webhooks/types.d.ts +4 -0
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/webhooks/webhook-dispatcher.d.ts +80 -12
- package/dist/webhooks/webhook-dispatcher.d.ts.map +1 -1
- package/dist/webhooks/webhook-dispatcher.js +497 -74
- package/dist/webhooks/webhook-dispatcher.js.map +1 -1
- package/docs/archive/ISSUES-legacy-2026-04-24.md +644 -0
- package/docs/dependency-risk.md +25 -0
- package/docs/testing-runbook.md +166 -0
- package/docs/usage-guide.md +2 -1
- package/package.json +34 -16
|
@@ -3,85 +3,114 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { log } from "../../utils/logger.js";
|
|
5
5
|
import { audit } from "../../utils/audit-logger.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { getErrorAuditArgs, getSanitizedErrorMessage, } from "./error-utils.js";
|
|
7
|
+
const AUTH_MODES = {
|
|
8
|
+
setup_auth: {
|
|
9
|
+
toolName: "setup_auth",
|
|
10
|
+
totalSteps: 10,
|
|
11
|
+
initialProgress: "Initializing authentication setup...",
|
|
12
|
+
preparingProgress: "Preparing authentication browser...",
|
|
13
|
+
successProgress: "Authentication saved successfully!",
|
|
14
|
+
failureMessage: "Authentication failed or was cancelled",
|
|
15
|
+
headlessError: "setup_auth requires show_browser:true. Calling it without a visible browser wipes your saved credentials then fails to restore them. Run the auth-now.mjs script instead, or pass show_browser:true.",
|
|
16
|
+
successMessage: "Successfully authenticated and saved browser state",
|
|
17
|
+
clearExisting: false,
|
|
18
|
+
},
|
|
19
|
+
re_auth: {
|
|
20
|
+
toolName: "re_auth",
|
|
21
|
+
totalSteps: 12,
|
|
22
|
+
initialProgress: "Preparing re-authentication...",
|
|
23
|
+
preparingProgress: "Starting fresh authentication...",
|
|
24
|
+
successProgress: "Re-authentication complete!",
|
|
25
|
+
failureMessage: "Re-authentication failed or was cancelled",
|
|
26
|
+
headlessError: "re_auth requires show_browser:true. Google login is interactive and cannot complete in headless mode. Calling re_auth headlessly wipes your saved credentials then fails to restore them, destroying auth for all concurrent sessions. Pass show_browser:true.",
|
|
27
|
+
successMessage: "Successfully re-authenticated with new account. All previous sessions have been closed.",
|
|
28
|
+
clearExisting: true,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
async function authenticate(ctx, args, mode, sendProgress) {
|
|
32
|
+
const config = AUTH_MODES[mode];
|
|
13
33
|
const { show_browser } = args;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
log.info(`🔧 [TOOL] setup_auth called`);
|
|
34
|
+
await sendProgress?.(config.initialProgress, 0, config.totalSteps);
|
|
35
|
+
log.info(`🔧 [TOOL] ${config.toolName} called`);
|
|
17
36
|
if (show_browser !== undefined) {
|
|
18
37
|
log.info(` Show browser: ${show_browser}`);
|
|
19
38
|
}
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// all sessions permanently unauthenticated. Require show_browser:true.
|
|
39
|
+
// Google login is interactive. Refuse headless operation before clearing
|
|
40
|
+
// any credentials, otherwise a failed headless login would break all sessions.
|
|
23
41
|
if (!show_browser) {
|
|
24
|
-
log.error(
|
|
42
|
+
log.error(`❌ ${config.toolName} requires show_browser:true — cannot login interactively in headless mode`);
|
|
25
43
|
return {
|
|
26
44
|
success: false,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
data: mode === "setup_auth"
|
|
46
|
+
? { status: "error", message: "setup_auth requires show_browser:true", authenticated: false }
|
|
47
|
+
: null,
|
|
48
|
+
error: config.headlessError,
|
|
31
49
|
};
|
|
32
50
|
}
|
|
33
51
|
const startTime = Date.now();
|
|
34
52
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
if (config.clearExisting) {
|
|
54
|
+
await sendProgress?.("Closing all active sessions...", 1, config.totalSteps);
|
|
55
|
+
log.info(" 🛑 Closing all sessions...");
|
|
56
|
+
await ctx.sessionManager.closeAllSessions();
|
|
57
|
+
log.success(" ✅ All sessions closed");
|
|
58
|
+
await sendProgress?.("Clearing authentication data...", 2, config.totalSteps);
|
|
59
|
+
log.info(" 🗑️ Clearing all auth data...");
|
|
60
|
+
await ctx.authManager.clearAllAuthData();
|
|
61
|
+
log.success(" ✅ Auth data cleared");
|
|
62
|
+
}
|
|
63
|
+
await sendProgress?.(config.preparingProgress, config.clearExisting ? 3 : 1, config.totalSteps);
|
|
64
|
+
log.info(" 🌐 Opening browser for interactive login...");
|
|
65
|
+
await sendProgress?.("Opening browser window...", config.clearExisting ? 4 : 2, config.totalSteps);
|
|
42
66
|
const success = await ctx.authManager.performSetup(sendProgress, show_browser);
|
|
43
67
|
const durationSeconds = (Date.now() - startTime) / 1000;
|
|
44
68
|
if (success) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
await audit.auth("setup_auth", true, { duration_seconds: durationSeconds });
|
|
50
|
-
await audit.tool("setup_auth", {}, true, Date.now() - startTime);
|
|
69
|
+
await sendProgress?.(config.successProgress, config.totalSteps, config.totalSteps);
|
|
70
|
+
log.success(`✅ [TOOL] ${config.toolName} completed (${durationSeconds.toFixed(1)}s)`);
|
|
71
|
+
await audit.auth(config.toolName, true, { duration_seconds: durationSeconds });
|
|
72
|
+
await audit.tool(config.toolName, {}, true, Date.now() - startTime);
|
|
51
73
|
return {
|
|
52
74
|
success: true,
|
|
53
75
|
data: {
|
|
54
76
|
status: "authenticated",
|
|
55
|
-
message:
|
|
77
|
+
message: config.successMessage,
|
|
56
78
|
authenticated: true,
|
|
57
79
|
duration_seconds: durationSeconds,
|
|
58
80
|
},
|
|
59
81
|
};
|
|
60
82
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
}
|
|
83
|
+
log.error(`❌ [TOOL] ${config.toolName} failed (${durationSeconds.toFixed(1)}s)`);
|
|
84
|
+
await audit.auth(config.toolName, false, { reason: "cancelled_or_failed" });
|
|
85
|
+
await audit.tool(config.toolName, getErrorAuditArgs(config.toolName, config.failureMessage), false, Date.now() - startTime, config.failureMessage);
|
|
86
|
+
return {
|
|
87
|
+
success: false,
|
|
88
|
+
data: null,
|
|
89
|
+
error: config.failureMessage,
|
|
90
|
+
};
|
|
71
91
|
}
|
|
72
92
|
catch (error) {
|
|
73
|
-
const errorMessage =
|
|
93
|
+
const errorMessage = getSanitizedErrorMessage(error);
|
|
74
94
|
const durationSeconds = (Date.now() - startTime) / 1000;
|
|
75
|
-
log.error(`❌ [TOOL]
|
|
76
|
-
|
|
77
|
-
await audit.
|
|
78
|
-
await audit.tool("setup_auth", {}, false, Date.now() - startTime, errorMessage);
|
|
95
|
+
log.error(`❌ [TOOL] ${config.toolName} failed: ${errorMessage} (${durationSeconds.toFixed(1)}s)`);
|
|
96
|
+
await audit.auth(config.toolName, false, { error: errorMessage });
|
|
97
|
+
await audit.tool(config.toolName, getErrorAuditArgs(config.toolName, errorMessage), false, Date.now() - startTime, errorMessage);
|
|
79
98
|
return {
|
|
80
99
|
success: false,
|
|
100
|
+
data: null,
|
|
81
101
|
error: errorMessage,
|
|
82
102
|
};
|
|
83
103
|
}
|
|
84
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Handle setup_auth tool
|
|
107
|
+
*
|
|
108
|
+
* Opens a browser window for manual login with live progress updates.
|
|
109
|
+
* The operation waits synchronously for login completion (up to 10 minutes).
|
|
110
|
+
*/
|
|
111
|
+
export async function handleSetupAuth(ctx, args, sendProgress) {
|
|
112
|
+
return authenticate(ctx, args, "setup_auth", sendProgress);
|
|
113
|
+
}
|
|
85
114
|
/**
|
|
86
115
|
* Handle re_auth tool
|
|
87
116
|
*
|
|
@@ -93,79 +122,6 @@ export async function handleSetupAuth(ctx, args, sendProgress) {
|
|
|
93
122
|
* Use for switching Google accounts or recovering from rate limits.
|
|
94
123
|
*/
|
|
95
124
|
export async function handleReAuth(ctx, args, sendProgress) {
|
|
96
|
-
|
|
97
|
-
await sendProgress?.("Preparing re-authentication...", 0, 12);
|
|
98
|
-
log.info(`🔧 [TOOL] re_auth called`);
|
|
99
|
-
if (show_browser !== undefined) {
|
|
100
|
-
log.info(` Show browser: ${show_browser}`);
|
|
101
|
-
}
|
|
102
|
-
// Guard: re_auth requires a visible browser — Google login is interactive.
|
|
103
|
-
// Calling without show_browser:true would wipe saved credentials then fail,
|
|
104
|
-
// leaving all sessions permanently unauthenticated.
|
|
105
|
-
if (!show_browser) {
|
|
106
|
-
log.error("❌ re_auth requires show_browser:true — cannot login interactively in headless mode");
|
|
107
|
-
return {
|
|
108
|
-
success: false,
|
|
109
|
-
error: "re_auth requires show_browser:true. Google login is interactive and cannot complete " +
|
|
110
|
-
"in headless mode. Calling re_auth headlessly wipes your saved credentials then fails to " +
|
|
111
|
-
"restore them, destroying auth for all concurrent sessions. Pass show_browser:true.",
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
const startTime = Date.now();
|
|
115
|
-
try {
|
|
116
|
-
// 1. Close all active sessions
|
|
117
|
-
await sendProgress?.("Closing all active sessions...", 1, 12);
|
|
118
|
-
log.info(" 🛑 Closing all sessions...");
|
|
119
|
-
await ctx.sessionManager.closeAllSessions();
|
|
120
|
-
log.success(" ✅ All sessions closed");
|
|
121
|
-
// 2. Clear all auth data
|
|
122
|
-
await sendProgress?.("Clearing authentication data...", 2, 12);
|
|
123
|
-
log.info(" 🗑️ Clearing all auth data...");
|
|
124
|
-
await ctx.authManager.clearAllAuthData();
|
|
125
|
-
log.success(" ✅ Auth data cleared");
|
|
126
|
-
// 3. Perform fresh setup
|
|
127
|
-
await sendProgress?.("Starting fresh authentication...", 3, 12);
|
|
128
|
-
log.info(" 🌐 Starting fresh authentication setup...");
|
|
129
|
-
const success = await ctx.authManager.performSetup(sendProgress);
|
|
130
|
-
const durationSeconds = (Date.now() - startTime) / 1000;
|
|
131
|
-
if (success) {
|
|
132
|
-
await sendProgress?.("Re-authentication complete!", 12, 12);
|
|
133
|
-
log.success(`✅ [TOOL] re_auth completed (${durationSeconds.toFixed(1)}s)`);
|
|
134
|
-
// Audit: successful re-auth
|
|
135
|
-
await audit.auth("re_auth", true, { duration_seconds: durationSeconds });
|
|
136
|
-
await audit.tool("re_auth", {}, true, Date.now() - startTime);
|
|
137
|
-
return {
|
|
138
|
-
success: true,
|
|
139
|
-
data: {
|
|
140
|
-
status: "authenticated",
|
|
141
|
-
message: "Successfully re-authenticated with new account. All previous sessions have been closed.",
|
|
142
|
-
authenticated: true,
|
|
143
|
-
duration_seconds: durationSeconds,
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
log.error(`❌ [TOOL] re_auth failed (${durationSeconds.toFixed(1)}s)`);
|
|
149
|
-
// Audit: failed re-auth
|
|
150
|
-
await audit.auth("re_auth", false, { reason: "cancelled_or_failed" });
|
|
151
|
-
await audit.tool("re_auth", {}, false, Date.now() - startTime, "Re-authentication failed or was cancelled");
|
|
152
|
-
return {
|
|
153
|
-
success: false,
|
|
154
|
-
error: "Re-authentication failed or was cancelled",
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
160
|
-
const durationSeconds = (Date.now() - startTime) / 1000;
|
|
161
|
-
log.error(`❌ [TOOL] re_auth failed: ${errorMessage} (${durationSeconds.toFixed(1)}s)`);
|
|
162
|
-
// Audit: re-auth error
|
|
163
|
-
await audit.auth("re_auth", false, { error: errorMessage });
|
|
164
|
-
await audit.tool("re_auth", {}, false, Date.now() - startTime, errorMessage);
|
|
165
|
-
return {
|
|
166
|
-
success: false,
|
|
167
|
-
error: errorMessage,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
125
|
+
return authenticate(ctx, args, "re_auth", sendProgress);
|
|
170
126
|
}
|
|
171
127
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/tools/handlers/auth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/tools/handlers/auth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AA4B1B,MAAM,UAAU,GAAyC;IACvD,UAAU,EAAE;QACV,QAAQ,EAAE,YAAY;QACtB,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,sCAAsC;QACvD,iBAAiB,EAAE,qCAAqC;QACxD,eAAe,EAAE,oCAAoC;QACrD,cAAc,EAAE,wCAAwC;QACxD,aAAa,EAC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wBAAwB,CAAC,KAAK,CAAC,CAAC;QACrD,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;QACxD,GAAG,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,QAAQ,YAAY,YAAY,KAAK,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAClG,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QAClE,MAAM,KAAK,CAAC,IAAI,CACd,MAAM,CAAC,QAAQ,EACf,iBAAiB,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,EAChD,KAAK,EACL,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EACtB,YAAY,CACb,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,YAAY;SACpB,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAmB,EACnB,IAAqB,EACrB,YAA+B;IAE/B,OAAO,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAmB,EACnB,IAAqB,EACrB,YAA+B;IAE/B,OAAO,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared error helpers for tool handlers.
|
|
3
|
+
*/
|
|
4
|
+
import type { HandlerContext } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a notebook URL from either an explicit URL, a notebook ID, or the
|
|
7
|
+
* currently active notebook. Throws if no notebook can be identified.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveNotebookUrl(ctx: HandlerContext, args: {
|
|
10
|
+
notebook_id?: string;
|
|
11
|
+
notebook_url?: string;
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function sanitizeErrorMessage(errorMsg: string): string;
|
|
14
|
+
export declare function getSanitizedErrorMessage(error: unknown): string;
|
|
15
|
+
export declare function getErrorAuditArgs(tool: string, error: unknown): Record<string, string>;
|
|
16
|
+
//# sourceMappingURL=error-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-utils.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/error-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAKjD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD,MAAM,CAiBR;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKtF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared error helpers for tool handlers.
|
|
3
|
+
*/
|
|
4
|
+
import { log } from "../../utils/logger.js";
|
|
5
|
+
const ABSOLUTE_PATH_PATTERN = /\/[^\s:,'"]+/g;
|
|
6
|
+
/**
|
|
7
|
+
* Resolve a notebook URL from either an explicit URL, a notebook ID, or the
|
|
8
|
+
* currently active notebook. Throws if no notebook can be identified.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveNotebookUrl(ctx, args) {
|
|
11
|
+
if (args.notebook_url)
|
|
12
|
+
return args.notebook_url;
|
|
13
|
+
if (args.notebook_id) {
|
|
14
|
+
const notebook = ctx.library.getNotebook(args.notebook_id);
|
|
15
|
+
if (!notebook)
|
|
16
|
+
throw new Error(`Notebook not found in library: ${args.notebook_id}`);
|
|
17
|
+
log.info(` Resolved notebook: ${notebook.name}`);
|
|
18
|
+
return notebook.url;
|
|
19
|
+
}
|
|
20
|
+
const active = ctx.library.getActiveNotebook();
|
|
21
|
+
if (active) {
|
|
22
|
+
log.info(` Using active notebook: ${active.name}`);
|
|
23
|
+
return active.url;
|
|
24
|
+
}
|
|
25
|
+
throw new Error("No notebook specified. Provide notebook_id or notebook_url.");
|
|
26
|
+
}
|
|
27
|
+
export function sanitizeErrorMessage(errorMsg) {
|
|
28
|
+
return errorMsg.replace(ABSOLUTE_PATH_PATTERN, "[path]");
|
|
29
|
+
}
|
|
30
|
+
export function getSanitizedErrorMessage(error) {
|
|
31
|
+
return sanitizeErrorMessage(error instanceof Error ? error.message : String(error));
|
|
32
|
+
}
|
|
33
|
+
export function getErrorAuditArgs(tool, error) {
|
|
34
|
+
return {
|
|
35
|
+
tool,
|
|
36
|
+
error: getSanitizedErrorMessage(error),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=error-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-utils.js","sourceRoot":"","sources":["../../../src/tools/handlers/error-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAmB,EACnB,IAAqD;IAErD,IAAI,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC,YAAY,CAAC;IAEhD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACrF,GAAG,CAAC,IAAI,CAAC,wBAAwB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,OAAO,QAAQ,CAAC,GAAG,CAAC;IACtB,CAAC;IAED,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC/C,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,oBAAoB,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,KAAc;IAC5D,OAAO;QACL,IAAI;QACJ,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -15,6 +15,7 @@ export declare function handleDeepResearch(ctx: HandlerContext, args: {
|
|
|
15
15
|
query: string;
|
|
16
16
|
wait_for_completion?: boolean;
|
|
17
17
|
max_wait_seconds?: number;
|
|
18
|
+
thinking_level?: "minimal" | "low" | "medium" | "high";
|
|
18
19
|
}, sendProgress?: ProgressCallback): Promise<ToolResult<DeepResearchResult>>;
|
|
19
20
|
/**
|
|
20
21
|
* Handle gemini_query tool
|
|
@@ -61,6 +62,7 @@ export declare function handleListDocuments(ctx: HandlerContext, args: {
|
|
|
61
62
|
*/
|
|
62
63
|
export declare function handleDeleteDocument(ctx: HandlerContext, args: {
|
|
63
64
|
file_name: string;
|
|
65
|
+
confirm: boolean;
|
|
64
66
|
}): Promise<ToolResult<{
|
|
65
67
|
deleted: boolean;
|
|
66
68
|
fileName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/gemini.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/gemini.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAWnE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAc/B;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,SAAS,GA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