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