@pan-sec/notebooklm-mcp 2026.3.3 → 2026.4.0
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/dist/auth/auth-manager.d.ts +0 -1
- package/dist/auth/auth-manager.js +0 -1
- package/dist/auth/mcp-auth.d.ts +0 -1
- package/dist/auth/mcp-auth.js +0 -1
- package/dist/compliance/alert-manager.d.ts +6 -2
- package/dist/compliance/alert-manager.js +40 -10
- package/dist/compliance/breach-detection.d.ts +0 -1
- package/dist/compliance/breach-detection.js +0 -1
- package/dist/compliance/change-log.d.ts +13 -1
- package/dist/compliance/change-log.js +82 -16
- package/dist/compliance/compliance-logger.d.ts +29 -3
- package/dist/compliance/compliance-logger.js +90 -27
- package/dist/compliance/compliance-tools.d.ts +0 -1
- package/dist/compliance/compliance-tools.js +0 -1
- package/dist/compliance/consent-manager.d.ts +0 -1
- package/dist/compliance/consent-manager.js +0 -1
- package/dist/compliance/dashboard.d.ts +4 -3
- package/dist/compliance/dashboard.js +11 -8
- package/dist/compliance/data-classification.d.ts +0 -1
- package/dist/compliance/data-classification.js +0 -1
- package/dist/compliance/data-erasure.d.ts +0 -1
- package/dist/compliance/data-erasure.js +0 -1
- package/dist/compliance/data-export.d.ts +0 -1
- package/dist/compliance/data-export.js +0 -1
- package/dist/compliance/data-inventory.d.ts +0 -1
- package/dist/compliance/data-inventory.js +0 -1
- package/dist/compliance/dsar-handler.d.ts +0 -1
- package/dist/compliance/dsar-handler.js +0 -1
- package/dist/compliance/evidence-collector.d.ts +0 -1
- package/dist/compliance/evidence-collector.js +4 -2
- package/dist/compliance/health-monitor.d.ts +0 -1
- package/dist/compliance/health-monitor.js +0 -1
- package/dist/compliance/incident-manager.d.ts +0 -1
- package/dist/compliance/incident-manager.js +0 -1
- package/dist/compliance/index.d.ts +0 -1
- package/dist/compliance/index.js +0 -1
- package/dist/compliance/policy-docs.d.ts +0 -1
- package/dist/compliance/policy-docs.js +0 -1
- package/dist/compliance/privacy-notice-text.d.ts +0 -1
- package/dist/compliance/privacy-notice-text.js +0 -1
- package/dist/compliance/privacy-notice.d.ts +0 -1
- package/dist/compliance/privacy-notice.js +0 -1
- package/dist/compliance/report-generator.d.ts +7 -1
- package/dist/compliance/report-generator.js +116 -34
- package/dist/compliance/retention-engine.d.ts +0 -1
- package/dist/compliance/retention-engine.js +0 -1
- package/dist/compliance/siem-exporter.d.ts +26 -2
- package/dist/compliance/siem-exporter.js +89 -24
- package/dist/compliance/types.d.ts +0 -1
- package/dist/compliance/types.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +2 -3
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -1
- package/dist/events/event-emitter.d.ts +9 -1
- package/dist/events/event-emitter.js +47 -8
- package/dist/events/event-types.d.ts +0 -1
- package/dist/events/event-types.js +8 -2
- package/dist/gemini/gemini-client.d.ts +0 -1
- package/dist/gemini/gemini-client.js +237 -45
- package/dist/gemini/index.d.ts +0 -1
- package/dist/gemini/index.js +0 -1
- package/dist/gemini/pdf-chunker.d.ts +0 -1
- package/dist/gemini/pdf-chunker.js +60 -35
- package/dist/gemini/types.d.ts +0 -1
- package/dist/gemini/types.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +60 -7
- package/dist/library/notebook-library.d.ts +30 -2
- package/dist/library/notebook-library.js +345 -85
- package/dist/library/types.d.ts +0 -1
- package/dist/library/types.js +0 -1
- package/dist/logging/index.d.ts +0 -1
- package/dist/logging/index.js +0 -1
- package/dist/logging/query-logger.d.ts +20 -1
- package/dist/logging/query-logger.js +104 -21
- package/dist/notebook-creation/audio-manager.d.ts +0 -1
- package/dist/notebook-creation/audio-manager.js +111 -20
- package/dist/notebook-creation/browser-options.d.ts +0 -1
- package/dist/notebook-creation/browser-options.js +0 -1
- package/dist/notebook-creation/data-table-manager.d.ts +7 -1
- package/dist/notebook-creation/data-table-manager.js +59 -3
- package/dist/notebook-creation/dom-scripts.d.ts +0 -1
- package/dist/notebook-creation/dom-scripts.js +0 -1
- package/dist/notebook-creation/errors.d.ts +0 -1
- package/dist/notebook-creation/errors.js +0 -1
- package/dist/notebook-creation/index.d.ts +0 -1
- package/dist/notebook-creation/index.js +0 -1
- package/dist/notebook-creation/notebook-creator.d.ts +9 -1
- package/dist/notebook-creation/notebook-creator.js +50 -1
- package/dist/notebook-creation/notebook-nav.d.ts +0 -1
- package/dist/notebook-creation/notebook-nav.js +21 -6
- package/dist/notebook-creation/notebook-sync.d.ts +14 -2
- package/dist/notebook-creation/notebook-sync.js +124 -35
- package/dist/notebook-creation/selectors.d.ts +0 -1
- package/dist/notebook-creation/selectors.js +6 -4
- package/dist/notebook-creation/source-manager.d.ts +29 -2
- package/dist/notebook-creation/source-manager.js +0 -0
- package/dist/notebook-creation/types.d.ts +0 -1
- package/dist/notebook-creation/types.js +0 -1
- package/dist/notebook-creation/video-manager.d.ts +0 -1
- package/dist/notebook-creation/video-manager.js +91 -15
- package/dist/observability/metrics.d.ts +0 -1
- package/dist/observability/metrics.js +0 -1
- package/dist/quota/index.d.ts +0 -1
- package/dist/quota/index.js +0 -1
- package/dist/quota/quota-manager.d.ts +59 -4
- package/dist/quota/quota-manager.js +195 -46
- package/dist/resources/resource-handlers.d.ts +0 -1
- package/dist/resources/resource-handlers.js +33 -3
- package/dist/session/browser-session.d.ts +0 -1
- package/dist/session/browser-session.js +0 -1
- package/dist/session/session-manager.d.ts +0 -1
- package/dist/session/session-manager.js +0 -1
- package/dist/session/session-timeout.d.ts +0 -1
- package/dist/session/session-timeout.js +0 -1
- package/dist/session/shared-context-manager.d.ts +0 -1
- package/dist/session/shared-context-manager.js +0 -1
- package/dist/tools/annotations.d.ts +0 -1
- package/dist/tools/annotations.js +0 -1
- package/dist/tools/definitions/ask-question.d.ts +6 -3
- package/dist/tools/definitions/ask-question.js +12 -8
- package/dist/tools/definitions/chat-history.d.ts +0 -1
- package/dist/tools/definitions/chat-history.js +1 -1
- package/dist/tools/definitions/data-tables.d.ts +0 -1
- package/dist/tools/definitions/data-tables.js +4 -1
- package/dist/tools/definitions/gemini.d.ts +0 -1
- package/dist/tools/definitions/gemini.js +14 -7
- package/dist/tools/definitions/notebook-management.d.ts +0 -1
- package/dist/tools/definitions/notebook-management.js +7 -2
- package/dist/tools/definitions/query-history.d.ts +0 -1
- package/dist/tools/definitions/query-history.js +0 -1
- package/dist/tools/definitions/session-management.d.ts +0 -1
- package/dist/tools/definitions/session-management.js +0 -1
- package/dist/tools/definitions/system.d.ts +0 -1
- package/dist/tools/definitions/system.js +32 -12
- package/dist/tools/definitions/video.d.ts +0 -1
- package/dist/tools/definitions/video.js +6 -3
- package/dist/tools/definitions.d.ts +0 -1
- package/dist/tools/definitions.js +0 -1
- package/dist/tools/handlers/ask-question.d.ts +0 -1
- package/dist/tools/handlers/ask-question.js +47 -18
- package/dist/tools/handlers/audio-video.d.ts +0 -1
- package/dist/tools/handlers/audio-video.js +0 -1
- package/dist/tools/handlers/auth.d.ts +0 -1
- package/dist/tools/handlers/auth.js +0 -1
- package/dist/tools/handlers/error-utils.d.ts +0 -1
- package/dist/tools/handlers/error-utils.js +0 -1
- package/dist/tools/handlers/gemini.d.ts +0 -1
- package/dist/tools/handlers/gemini.js +0 -1
- package/dist/tools/handlers/index.d.ts +0 -1
- package/dist/tools/handlers/index.js +0 -1
- package/dist/tools/handlers/notebook-creation.d.ts +0 -1
- package/dist/tools/handlers/notebook-creation.js +16 -1
- package/dist/tools/handlers/notebook-management.d.ts +0 -1
- package/dist/tools/handlers/notebook-management.js +7 -2
- package/dist/tools/handlers/session-management.d.ts +0 -1
- package/dist/tools/handlers/session-management.js +0 -1
- package/dist/tools/handlers/system.d.ts +0 -1
- package/dist/tools/handlers/system.js +0 -1
- package/dist/tools/handlers/types.d.ts +0 -1
- package/dist/tools/handlers/types.js +0 -1
- package/dist/tools/handlers/webhooks.d.ts +0 -1
- package/dist/tools/handlers/webhooks.js +0 -1
- package/dist/tools/icons.d.ts +0 -1
- package/dist/tools/icons.js +0 -1
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/dist/utils/audit-logger.d.ts +11 -1
- package/dist/utils/audit-logger.js +189 -21
- package/dist/utils/cleanup-manager.d.ts +0 -1
- package/dist/utils/cleanup-manager.js +0 -1
- package/dist/utils/cli-handler.d.ts +0 -1
- package/dist/utils/cli-handler.js +0 -1
- package/dist/utils/crypto.d.ts +18 -9
- package/dist/utils/crypto.js +93 -28
- package/dist/utils/file-lock.d.ts +15 -1
- package/dist/utils/file-lock.js +67 -59
- package/dist/utils/file-permissions.d.ts +0 -1
- package/dist/utils/file-permissions.js +35 -7
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/page-utils.d.ts +0 -1
- package/dist/utils/page-utils.js +32 -28
- package/dist/utils/response-validator.d.ts +0 -1
- package/dist/utils/response-validator.js +18 -15
- package/dist/utils/secrets-scanner.d.ts +0 -1
- package/dist/utils/secrets-scanner.js +32 -7
- package/dist/utils/secure-memory.d.ts +34 -16
- package/dist/utils/secure-memory.js +40 -25
- package/dist/utils/security.d.ts +0 -1
- package/dist/utils/security.js +66 -39
- package/dist/utils/settings-manager.d.ts +9 -1
- package/dist/utils/settings-manager.js +45 -2
- package/dist/utils/stealth-utils.d.ts +0 -1
- package/dist/utils/stealth-utils.js +11 -9
- package/dist/webhooks/index.d.ts +0 -1
- package/dist/webhooks/index.js +0 -1
- package/dist/webhooks/types.d.ts +0 -1
- package/dist/webhooks/types.js +0 -1
- package/dist/webhooks/webhook-dispatcher.d.ts +0 -1
- package/dist/webhooks/webhook-dispatcher.js +0 -1
- package/package.json +5 -4
- package/dist/auth/auth-manager.d.ts.map +0 -1
- package/dist/auth/auth-manager.js.map +0 -1
- package/dist/auth/mcp-auth.d.ts.map +0 -1
- package/dist/auth/mcp-auth.js.map +0 -1
- package/dist/compliance/alert-manager.d.ts.map +0 -1
- package/dist/compliance/alert-manager.js.map +0 -1
- package/dist/compliance/breach-detection.d.ts.map +0 -1
- package/dist/compliance/breach-detection.js.map +0 -1
- package/dist/compliance/change-log.d.ts.map +0 -1
- package/dist/compliance/change-log.js.map +0 -1
- package/dist/compliance/compliance-logger.d.ts.map +0 -1
- package/dist/compliance/compliance-logger.js.map +0 -1
- package/dist/compliance/compliance-tools.d.ts.map +0 -1
- package/dist/compliance/compliance-tools.js.map +0 -1
- package/dist/compliance/consent-manager.d.ts.map +0 -1
- package/dist/compliance/consent-manager.js.map +0 -1
- package/dist/compliance/dashboard.d.ts.map +0 -1
- package/dist/compliance/dashboard.js.map +0 -1
- package/dist/compliance/data-classification.d.ts.map +0 -1
- package/dist/compliance/data-classification.js.map +0 -1
- package/dist/compliance/data-erasure.d.ts.map +0 -1
- package/dist/compliance/data-erasure.js.map +0 -1
- package/dist/compliance/data-export.d.ts.map +0 -1
- package/dist/compliance/data-export.js.map +0 -1
- package/dist/compliance/data-inventory.d.ts.map +0 -1
- package/dist/compliance/data-inventory.js.map +0 -1
- package/dist/compliance/dsar-handler.d.ts.map +0 -1
- package/dist/compliance/dsar-handler.js.map +0 -1
- package/dist/compliance/evidence-collector.d.ts.map +0 -1
- package/dist/compliance/evidence-collector.js.map +0 -1
- package/dist/compliance/health-monitor.d.ts.map +0 -1
- package/dist/compliance/health-monitor.js.map +0 -1
- package/dist/compliance/incident-manager.d.ts.map +0 -1
- package/dist/compliance/incident-manager.js.map +0 -1
- package/dist/compliance/index.d.ts.map +0 -1
- package/dist/compliance/index.js.map +0 -1
- package/dist/compliance/policy-docs.d.ts.map +0 -1
- package/dist/compliance/policy-docs.js.map +0 -1
- package/dist/compliance/privacy-notice-text.d.ts.map +0 -1
- package/dist/compliance/privacy-notice-text.js.map +0 -1
- package/dist/compliance/privacy-notice.d.ts.map +0 -1
- package/dist/compliance/privacy-notice.js.map +0 -1
- package/dist/compliance/report-generator.d.ts.map +0 -1
- package/dist/compliance/report-generator.js.map +0 -1
- package/dist/compliance/retention-engine.d.ts.map +0 -1
- package/dist/compliance/retention-engine.js.map +0 -1
- package/dist/compliance/siem-exporter.d.ts.map +0 -1
- package/dist/compliance/siem-exporter.js.map +0 -1
- package/dist/compliance/types.d.ts.map +0 -1
- package/dist/compliance/types.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/events/event-emitter.d.ts.map +0 -1
- package/dist/events/event-emitter.js.map +0 -1
- package/dist/events/event-types.d.ts.map +0 -1
- package/dist/events/event-types.js.map +0 -1
- package/dist/gemini/gemini-client.d.ts.map +0 -1
- package/dist/gemini/gemini-client.js.map +0 -1
- package/dist/gemini/index.d.ts.map +0 -1
- package/dist/gemini/index.js.map +0 -1
- package/dist/gemini/pdf-chunker.d.ts.map +0 -1
- package/dist/gemini/pdf-chunker.js.map +0 -1
- package/dist/gemini/types.d.ts.map +0 -1
- package/dist/gemini/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/library/notebook-library.d.ts.map +0 -1
- package/dist/library/notebook-library.js.map +0 -1
- package/dist/library/types.d.ts.map +0 -1
- package/dist/library/types.js.map +0 -1
- package/dist/logging/index.d.ts.map +0 -1
- package/dist/logging/index.js.map +0 -1
- package/dist/logging/query-logger.d.ts.map +0 -1
- package/dist/logging/query-logger.js.map +0 -1
- package/dist/notebook-creation/audio-manager.d.ts.map +0 -1
- package/dist/notebook-creation/audio-manager.js.map +0 -1
- package/dist/notebook-creation/browser-options.d.ts.map +0 -1
- package/dist/notebook-creation/browser-options.js.map +0 -1
- package/dist/notebook-creation/data-table-manager.d.ts.map +0 -1
- package/dist/notebook-creation/data-table-manager.js.map +0 -1
- package/dist/notebook-creation/discover-creation-flow.d.ts +0 -2
- package/dist/notebook-creation/discover-creation-flow.d.ts.map +0 -1
- package/dist/notebook-creation/discover-creation-flow.js +0 -177
- package/dist/notebook-creation/discover-creation-flow.js.map +0 -1
- package/dist/notebook-creation/discover-quota.d.ts +0 -2
- package/dist/notebook-creation/discover-quota.d.ts.map +0 -1
- package/dist/notebook-creation/discover-quota.js +0 -194
- package/dist/notebook-creation/discover-quota.js.map +0 -1
- package/dist/notebook-creation/discover-source-dialog.d.ts +0 -8
- package/dist/notebook-creation/discover-source-dialog.d.ts.map +0 -1
- package/dist/notebook-creation/discover-source-dialog.js +0 -134
- package/dist/notebook-creation/discover-source-dialog.js.map +0 -1
- package/dist/notebook-creation/discover-sources.d.ts +0 -8
- package/dist/notebook-creation/discover-sources.d.ts.map +0 -1
- package/dist/notebook-creation/discover-sources.js +0 -272
- package/dist/notebook-creation/discover-sources.js.map +0 -1
- package/dist/notebook-creation/discover-text-input.d.ts +0 -7
- package/dist/notebook-creation/discover-text-input.d.ts.map +0 -1
- package/dist/notebook-creation/discover-text-input.js +0 -135
- package/dist/notebook-creation/discover-text-input.js.map +0 -1
- package/dist/notebook-creation/dom-scripts.d.ts.map +0 -1
- package/dist/notebook-creation/dom-scripts.js.map +0 -1
- package/dist/notebook-creation/errors.d.ts.map +0 -1
- package/dist/notebook-creation/errors.js.map +0 -1
- package/dist/notebook-creation/index.d.ts.map +0 -1
- package/dist/notebook-creation/index.js.map +0 -1
- package/dist/notebook-creation/notebook-creator.d.ts.map +0 -1
- package/dist/notebook-creation/notebook-creator.js.map +0 -1
- package/dist/notebook-creation/notebook-nav.d.ts.map +0 -1
- package/dist/notebook-creation/notebook-nav.js.map +0 -1
- package/dist/notebook-creation/notebook-sync.d.ts.map +0 -1
- package/dist/notebook-creation/notebook-sync.js.map +0 -1
- package/dist/notebook-creation/run-discovery.d.ts +0 -11
- package/dist/notebook-creation/run-discovery.d.ts.map +0 -1
- package/dist/notebook-creation/run-discovery.js +0 -151
- package/dist/notebook-creation/run-discovery.js.map +0 -1
- package/dist/notebook-creation/selector-discovery.d.ts +0 -65
- package/dist/notebook-creation/selector-discovery.d.ts.map +0 -1
- package/dist/notebook-creation/selector-discovery.js +0 -414
- package/dist/notebook-creation/selector-discovery.js.map +0 -1
- package/dist/notebook-creation/selectors.d.ts.map +0 -1
- package/dist/notebook-creation/selectors.js.map +0 -1
- package/dist/notebook-creation/selectors.ts +0 -112
- package/dist/notebook-creation/source-manager.d.ts.map +0 -1
- package/dist/notebook-creation/source-manager.js.map +0 -1
- package/dist/notebook-creation/test-create.d.ts +0 -8
- package/dist/notebook-creation/test-create.d.ts.map +0 -1
- package/dist/notebook-creation/test-create.js +0 -72
- package/dist/notebook-creation/test-create.js.map +0 -1
- package/dist/notebook-creation/types.d.ts.map +0 -1
- package/dist/notebook-creation/types.js.map +0 -1
- package/dist/notebook-creation/video-manager.d.ts.map +0 -1
- package/dist/notebook-creation/video-manager.js.map +0 -1
- package/dist/observability/metrics.d.ts.map +0 -1
- package/dist/observability/metrics.js.map +0 -1
- package/dist/quota/index.d.ts.map +0 -1
- package/dist/quota/index.js.map +0 -1
- package/dist/quota/quota-manager.d.ts.map +0 -1
- package/dist/quota/quota-manager.js.map +0 -1
- package/dist/resources/resource-handlers.d.ts.map +0 -1
- package/dist/resources/resource-handlers.js.map +0 -1
- package/dist/session/browser-session.d.ts.map +0 -1
- package/dist/session/browser-session.js.map +0 -1
- package/dist/session/session-manager.d.ts.map +0 -1
- package/dist/session/session-manager.js.map +0 -1
- package/dist/session/session-timeout.d.ts.map +0 -1
- package/dist/session/session-timeout.js.map +0 -1
- package/dist/session/shared-context-manager.d.ts.map +0 -1
- package/dist/session/shared-context-manager.js.map +0 -1
- package/dist/tools/annotations.d.ts.map +0 -1
- package/dist/tools/annotations.js.map +0 -1
- package/dist/tools/definitions/ask-question.d.ts.map +0 -1
- package/dist/tools/definitions/ask-question.js.map +0 -1
- package/dist/tools/definitions/chat-history.d.ts.map +0 -1
- package/dist/tools/definitions/chat-history.js.map +0 -1
- package/dist/tools/definitions/data-tables.d.ts.map +0 -1
- package/dist/tools/definitions/data-tables.js.map +0 -1
- package/dist/tools/definitions/gemini.d.ts.map +0 -1
- package/dist/tools/definitions/gemini.js.map +0 -1
- package/dist/tools/definitions/notebook-management.d.ts.map +0 -1
- package/dist/tools/definitions/notebook-management.js.map +0 -1
- package/dist/tools/definitions/query-history.d.ts.map +0 -1
- package/dist/tools/definitions/query-history.js.map +0 -1
- package/dist/tools/definitions/session-management.d.ts.map +0 -1
- package/dist/tools/definitions/session-management.js.map +0 -1
- package/dist/tools/definitions/system.d.ts.map +0 -1
- package/dist/tools/definitions/system.js.map +0 -1
- package/dist/tools/definitions/video.d.ts.map +0 -1
- package/dist/tools/definitions/video.js.map +0 -1
- package/dist/tools/definitions.d.ts.map +0 -1
- package/dist/tools/definitions.js.map +0 -1
- package/dist/tools/handlers/ask-question.d.ts.map +0 -1
- package/dist/tools/handlers/ask-question.js.map +0 -1
- package/dist/tools/handlers/audio-video.d.ts.map +0 -1
- package/dist/tools/handlers/audio-video.js.map +0 -1
- package/dist/tools/handlers/auth.d.ts.map +0 -1
- package/dist/tools/handlers/auth.js.map +0 -1
- package/dist/tools/handlers/error-utils.d.ts.map +0 -1
- package/dist/tools/handlers/error-utils.js.map +0 -1
- package/dist/tools/handlers/gemini.d.ts.map +0 -1
- package/dist/tools/handlers/gemini.js.map +0 -1
- package/dist/tools/handlers/index.d.ts.map +0 -1
- package/dist/tools/handlers/index.js.map +0 -1
- package/dist/tools/handlers/notebook-creation.d.ts.map +0 -1
- package/dist/tools/handlers/notebook-creation.js.map +0 -1
- package/dist/tools/handlers/notebook-management.d.ts.map +0 -1
- package/dist/tools/handlers/notebook-management.js.map +0 -1
- package/dist/tools/handlers/session-management.d.ts.map +0 -1
- package/dist/tools/handlers/session-management.js.map +0 -1
- package/dist/tools/handlers/system.d.ts.map +0 -1
- package/dist/tools/handlers/system.js.map +0 -1
- package/dist/tools/handlers/types.d.ts.map +0 -1
- package/dist/tools/handlers/types.js.map +0 -1
- package/dist/tools/handlers/webhooks.d.ts.map +0 -1
- package/dist/tools/handlers/webhooks.js.map +0 -1
- package/dist/tools/handlers.d.ts +0 -666
- package/dist/tools/handlers.d.ts.map +0 -1
- package/dist/tools/handlers.js +0 -2929
- package/dist/tools/handlers.js.map +0 -1
- package/dist/tools/icons.d.ts.map +0 -1
- package/dist/tools/icons.js.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/audit-logger.d.ts.map +0 -1
- package/dist/utils/audit-logger.js.map +0 -1
- package/dist/utils/cert-pinning.d.ts +0 -97
- package/dist/utils/cert-pinning.d.ts.map +0 -1
- package/dist/utils/cert-pinning.js +0 -328
- package/dist/utils/cert-pinning.js.map +0 -1
- package/dist/utils/cleanup-manager.d.ts.map +0 -1
- package/dist/utils/cleanup-manager.js.map +0 -1
- package/dist/utils/cli-handler.d.ts.map +0 -1
- package/dist/utils/cli-handler.js.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/file-lock.d.ts.map +0 -1
- package/dist/utils/file-lock.js.map +0 -1
- package/dist/utils/file-permissions.d.ts.map +0 -1
- package/dist/utils/file-permissions.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/page-utils.d.ts.map +0 -1
- package/dist/utils/page-utils.js.map +0 -1
- package/dist/utils/response-validator.d.ts.map +0 -1
- package/dist/utils/response-validator.js.map +0 -1
- package/dist/utils/secrets-scanner.d.ts.map +0 -1
- package/dist/utils/secrets-scanner.js.map +0 -1
- package/dist/utils/secure-memory.d.ts.map +0 -1
- package/dist/utils/secure-memory.js.map +0 -1
- package/dist/utils/security.d.ts.map +0 -1
- package/dist/utils/security.js.map +0 -1
- package/dist/utils/settings-manager.d.ts.map +0 -1
- package/dist/utils/settings-manager.js.map +0 -1
- package/dist/utils/stealth-utils.d.ts.map +0 -1
- package/dist/utils/stealth-utils.js.map +0 -1
- package/dist/utils/tool-validation.d.ts +0 -93
- package/dist/utils/tool-validation.d.ts.map +0 -1
- package/dist/utils/tool-validation.js +0 -277
- package/dist/utils/tool-validation.js.map +0 -1
- package/dist/webhooks/index.d.ts.map +0 -1
- package/dist/webhooks/index.js.map +0 -1
- package/dist/webhooks/types.d.ts.map +0 -1
- package/dist/webhooks/types.js.map +0 -1
- package/dist/webhooks/webhook-dispatcher.d.ts.map +0 -1
- package/dist/webhooks/webhook-dispatcher.js.map +0 -1
- package/docs/COMPLIANCE-SPEC.md +0 -1452
- package/docs/MCP-DIRECTORY-LISTINGS.md +0 -91
- package/docs/SECURITY-FORK-OPPORTUNITIES.md +0 -79
- package/docs/SECURITY_IMPLEMENTATION_PLAN.md +0 -437
- package/docs/archive/ISSUES-legacy-2026-04-24.md +0 -644
- package/docs/configuration.md +0 -94
- package/docs/dependency-risk.md +0 -25
- package/docs/improvement-sprint-2026.2.10.md +0 -210
- package/docs/testing-runbook.md +0 -166
- package/docs/tools.md +0 -34
- package/docs/troubleshooting.md +0 -59
- package/docs/usage-guide.md +0 -246
|
@@ -112,23 +112,26 @@ const PROMPT_INJECTION_PATTERNS = [
|
|
|
112
112
|
/**
|
|
113
113
|
* Suspicious URL patterns
|
|
114
114
|
*/
|
|
115
|
+
// Precompiled with the global flag so detectSuspiciousUrls can call matchAll
|
|
116
|
+
// directly without re-allocating a RegExp per pattern per call (I-L55).
|
|
117
|
+
// matchAll clones the regex internally, so module-level reuse is state-safe.
|
|
115
118
|
const SUSPICIOUS_URL_PATTERNS = [
|
|
116
119
|
// URL shorteners (could hide malicious destinations)
|
|
117
|
-
{ pattern: /https?:\/\/(bit\.ly|tinyurl\.com|t\.co|goo\.gl|ow\.ly|is\.gd|buff\.ly|adf\.ly|j\.mp)\//
|
|
120
|
+
{ pattern: /https?:\/\/(bit\.ly|tinyurl\.com|t\.co|goo\.gl|ow\.ly|is\.gd|buff\.ly|adf\.ly|j\.mp)\//gi, description: "URL shortener" },
|
|
118
121
|
// Paste/sharing services (data exfiltration)
|
|
119
|
-
{ pattern: /https?:\/\/(pastebin\.com|hastebin\.com|paste\.ee|ghostbin\.com|dpaste\.org)\//
|
|
122
|
+
{ pattern: /https?:\/\/(pastebin\.com|hastebin\.com|paste\.ee|ghostbin\.com|dpaste\.org)\//gi, description: "Paste service" },
|
|
120
123
|
// File sharing (potential malware)
|
|
121
|
-
{ pattern: /https?:\/\/(anonfiles\.com|mediafire\.com|zippyshare\.com|sendspace\.com)\//
|
|
124
|
+
{ pattern: /https?:\/\/(anonfiles\.com|mediafire\.com|zippyshare\.com|sendspace\.com)\//gi, description: "File sharing service" },
|
|
122
125
|
// Dangerous protocols
|
|
123
|
-
{ pattern: /javascript:/
|
|
124
|
-
{ pattern: /\bdata:[a-z]+\/[a-z][\w+-]+/
|
|
125
|
-
{ pattern: /file:\/\//
|
|
126
|
-
{ pattern: /vbscript:/
|
|
126
|
+
{ pattern: /javascript:/gi, description: "JavaScript protocol" },
|
|
127
|
+
{ pattern: /\bdata:[a-z]+\/[a-z][\w+-]+/gi, description: "Data protocol" },
|
|
128
|
+
{ pattern: /file:\/\//gi, description: "File protocol" },
|
|
129
|
+
{ pattern: /vbscript:/gi, description: "VBScript protocol" },
|
|
127
130
|
// IP addresses (potential C2)
|
|
128
|
-
{ pattern: /https?:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
|
|
131
|
+
{ pattern: /https?:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/gi, description: "Raw IP address URL" },
|
|
129
132
|
// Webhook URLs (data exfiltration)
|
|
130
|
-
{ pattern: /https?:\/\/[^\/]*webhook/
|
|
131
|
-
{ pattern: /https?:\/\/[^\/]*discord(app)?\.com\/api\/webhooks/
|
|
133
|
+
{ pattern: /https?:\/\/[^\/]*webhook/gi, description: "Webhook URL" },
|
|
134
|
+
{ pattern: /https?:\/\/[^\/]*discord(app)?\.com\/api\/webhooks/gi, description: "Discord webhook" },
|
|
132
135
|
];
|
|
133
136
|
/**
|
|
134
137
|
* Encoded payload patterns.
|
|
@@ -278,9 +281,8 @@ export class ResponseValidator {
|
|
|
278
281
|
detectSuspiciousUrls(text) {
|
|
279
282
|
const results = [];
|
|
280
283
|
for (const { pattern, description } of SUSPICIOUS_URL_PATTERNS) {
|
|
281
|
-
//
|
|
282
|
-
const
|
|
283
|
-
const matches = text.matchAll(globalPattern);
|
|
284
|
+
// Reuse the precompiled global pattern; matchAll clones it so no lastIndex leak.
|
|
285
|
+
const matches = text.matchAll(pattern);
|
|
284
286
|
for (const match of matches) {
|
|
285
287
|
results.push({
|
|
286
288
|
pattern,
|
|
@@ -304,10 +306,12 @@ export class ResponseValidator {
|
|
|
304
306
|
continue;
|
|
305
307
|
if (minEntropy !== undefined && shannonEntropy(matchStr) < minEntropy)
|
|
306
308
|
continue;
|
|
309
|
+
// Carry the FULL match so validate()'s replaceAll can actually redact it
|
|
310
|
+
// when blockEncodedPayloads is enabled (truncating broke redaction) (I-L57).
|
|
307
311
|
results.push({
|
|
308
312
|
pattern,
|
|
309
313
|
description,
|
|
310
|
-
match: matchStr
|
|
314
|
+
match: matchStr,
|
|
311
315
|
});
|
|
312
316
|
}
|
|
313
317
|
}
|
|
@@ -356,4 +360,3 @@ export function getResponseValidator() {
|
|
|
356
360
|
export async function validateResponse(response) {
|
|
357
361
|
return getResponseValidator().validate(response);
|
|
358
362
|
}
|
|
359
|
-
//# sourceMappingURL=response-validator.js.map
|
|
@@ -35,6 +35,28 @@ export function shannonEntropy(s) {
|
|
|
35
35
|
}
|
|
36
36
|
return h;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve 1-based line/column for a byte index using a sorted array of newline
|
|
40
|
+
* offsets. `line` = number of newlines before index + 1; `column` = distance
|
|
41
|
+
* from the start of that line + 1. Matches the previous substring/split semantics.
|
|
42
|
+
*/
|
|
43
|
+
function lineColForIndex(newlineOffsets, index) {
|
|
44
|
+
// Binary search for the count of newline offsets strictly less than `index`.
|
|
45
|
+
let lo = 0;
|
|
46
|
+
let hi = newlineOffsets.length;
|
|
47
|
+
while (lo < hi) {
|
|
48
|
+
const mid = (lo + hi) >>> 1;
|
|
49
|
+
if (newlineOffsets[mid] < index) {
|
|
50
|
+
lo = mid + 1;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
hi = mid;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// lo = number of newlines before index → line is lo + 1.
|
|
57
|
+
const lastNewlineBefore = lo > 0 ? newlineOffsets[lo - 1] : -1;
|
|
58
|
+
return { line: lo + 1, column: index - lastNewlineBefore };
|
|
59
|
+
}
|
|
38
60
|
/**
|
|
39
61
|
* Secret detection patterns
|
|
40
62
|
* Based on TruffleHog, GitLeaks, and custom patterns
|
|
@@ -241,7 +263,7 @@ const SECRET_PATTERNS = [
|
|
|
241
263
|
// Email with password context
|
|
242
264
|
{
|
|
243
265
|
name: "Email with Password",
|
|
244
|
-
pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-
|
|
266
|
+
pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b.*(?:password|pwd|passwd)/gi,
|
|
245
267
|
severity: "medium",
|
|
246
268
|
description: "Email address in password context",
|
|
247
269
|
},
|
|
@@ -302,6 +324,12 @@ export class SecretsScanner {
|
|
|
302
324
|
this.stats.scanned++;
|
|
303
325
|
const matches = [];
|
|
304
326
|
const minSeverityLevel = SEVERITY_ORDER[this.config.minSeverity];
|
|
327
|
+
// Precompute newline offsets once so per-match line/column lookup is O(log n)
|
|
328
|
+
// instead of re-scanning from the string start for every match (I-L54).
|
|
329
|
+
const newlineOffsets = [];
|
|
330
|
+
for (let i = input.indexOf("\n"); i !== -1; i = input.indexOf("\n", i + 1)) {
|
|
331
|
+
newlineOffsets.push(i);
|
|
332
|
+
}
|
|
305
333
|
for (const pattern of this.patterns) {
|
|
306
334
|
// Skip if below minimum severity
|
|
307
335
|
if (SEVERITY_ORDER[pattern.severity] < minSeverityLevel) {
|
|
@@ -319,11 +347,9 @@ export class SecretsScanner {
|
|
|
319
347
|
if (pattern.ignoreContext?.(input, match)) {
|
|
320
348
|
continue;
|
|
321
349
|
}
|
|
322
|
-
// Calculate line and column
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
const line = lines.length;
|
|
326
|
-
const column = lines[lines.length - 1].length + 1;
|
|
350
|
+
// Calculate line and column via binary search over precomputed newline
|
|
351
|
+
// offsets — equivalent to counting "\n" before match.index but O(log n).
|
|
352
|
+
const { line, column } = lineColForIndex(newlineOffsets, match.index);
|
|
327
353
|
// Generate redacted version
|
|
328
354
|
const redacted = pattern.redactFn
|
|
329
355
|
? pattern.redactFn(matchedText)
|
|
@@ -488,4 +514,3 @@ export function scanForSecrets(text) {
|
|
|
488
514
|
export async function scanAndRedactSecrets(text) {
|
|
489
515
|
return getSecretsScanner().scanAndRedact(text);
|
|
490
516
|
}
|
|
491
|
-
//# sourceMappingURL=secrets-scanner.js.map
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Secure Memory Utilities for NotebookLM MCP Server
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
5
|
-
* - Zero-fill
|
|
6
|
-
* - Secure string class that
|
|
7
|
-
* -
|
|
4
|
+
* Provides best-effort handling of sensitive data in memory:
|
|
5
|
+
* - Zero-fill backing Buffers after use
|
|
6
|
+
* - Secure string class that wipes its backing Buffer
|
|
7
|
+
* - Time-bounded credential handling
|
|
8
8
|
*
|
|
9
|
-
* Why this matters:
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
9
|
+
* Why this matters — and its limits:
|
|
10
|
+
* - REDUCES the exposure window for credentials in memory; it does not
|
|
11
|
+
* eliminate it.
|
|
12
|
+
* - This is mitigation, NOT prevention, of memory-dump or cold-boot attacks.
|
|
13
|
+
* We cannot guarantee secrets are gone from RAM after wipe().
|
|
14
|
+
* - V8 caveat: JavaScript strings are immutable. The input string passed in,
|
|
15
|
+
* and every value produced by toString() / getValue(), are independent V8
|
|
16
|
+
* string copies on the heap that this code CANNOT wipe and that persist
|
|
17
|
+
* until garbage collection (and possibly beyond, in freed-but-unzeroed
|
|
18
|
+
* memory). Only the internal Buffer is zeroed by wipe().
|
|
13
19
|
*
|
|
14
20
|
* Added by Pantheon Security for hardened fork.
|
|
15
21
|
*/
|
|
@@ -34,7 +40,10 @@ export declare class SecureString {
|
|
|
34
40
|
private wiped;
|
|
35
41
|
constructor(value: string);
|
|
36
42
|
/**
|
|
37
|
-
* Get the string value
|
|
43
|
+
* Get the string value.
|
|
44
|
+
* Note: returns a new immutable V8 string copy that cannot be wiped and
|
|
45
|
+
* persists until garbage collection. Avoid retaining the result longer
|
|
46
|
+
* than necessary.
|
|
38
47
|
*/
|
|
39
48
|
toString(): string;
|
|
40
49
|
/**
|
|
@@ -46,7 +55,9 @@ export declare class SecureString {
|
|
|
46
55
|
*/
|
|
47
56
|
get length(): number;
|
|
48
57
|
/**
|
|
49
|
-
*
|
|
58
|
+
* Wipe the backing Buffer (best effort).
|
|
59
|
+
* Only zeroes the internal Buffer; any string copies previously returned
|
|
60
|
+
* by toString() / the constructor input remain in the V8 heap until GC.
|
|
50
61
|
*/
|
|
51
62
|
wipe(): void;
|
|
52
63
|
/**
|
|
@@ -64,7 +75,9 @@ export declare class SecureCredential {
|
|
|
64
75
|
private autoWipeTimer?;
|
|
65
76
|
constructor(credential: string, maxAgeMs?: number);
|
|
66
77
|
/**
|
|
67
|
-
* Get the credential value
|
|
78
|
+
* Get the credential value.
|
|
79
|
+
* Note: returns an immutable V8 string copy that cannot be wiped and
|
|
80
|
+
* persists until garbage collection.
|
|
68
81
|
*/
|
|
69
82
|
getValue(): string;
|
|
70
83
|
/**
|
|
@@ -91,10 +104,16 @@ export declare function withSecureCredential<T>(credential: string, fn: (cred: S
|
|
|
91
104
|
/**
|
|
92
105
|
* Secure comparison to prevent timing attacks.
|
|
93
106
|
*
|
|
94
|
-
* Both
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
107
|
+
* Both operands are hashed (SHA-256) into a fixed-length digest before the
|
|
108
|
+
* constant-time comparison. This:
|
|
109
|
+
* - makes timingSafeEqual always run on the same number of bytes regardless of
|
|
110
|
+
* input length, leaking nothing about the actual lengths, and
|
|
111
|
+
* - compares the FULL content of each operand (L5): the previous version
|
|
112
|
+
* truncated both inputs to 64 bytes, so two distinct values sharing their
|
|
113
|
+
* first 64 bytes would compare equal. Hashing covers the entire input.
|
|
114
|
+
*
|
|
115
|
+
* The trailing length check is kept as defence-in-depth; SHA-256 already
|
|
116
|
+
* distinguishes different-length inputs.
|
|
98
117
|
*/
|
|
99
118
|
export declare function secureCompare(a: string | Buffer, b: string | Buffer): boolean;
|
|
100
119
|
/**
|
|
@@ -105,4 +124,3 @@ export declare function secureRandomString(length: number, encoding?: BufferEnco
|
|
|
105
124
|
* Mask sensitive data for logging (doesn't expose real length)
|
|
106
125
|
*/
|
|
107
126
|
export declare function maskSensitive(value: string, showChars?: number): string;
|
|
108
|
-
//# sourceMappingURL=secure-memory.d.ts.map
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Secure Memory Utilities for NotebookLM MCP Server
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
5
|
-
* - Zero-fill
|
|
6
|
-
* - Secure string class that
|
|
7
|
-
* -
|
|
4
|
+
* Provides best-effort handling of sensitive data in memory:
|
|
5
|
+
* - Zero-fill backing Buffers after use
|
|
6
|
+
* - Secure string class that wipes its backing Buffer
|
|
7
|
+
* - Time-bounded credential handling
|
|
8
8
|
*
|
|
9
|
-
* Why this matters:
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
9
|
+
* Why this matters — and its limits:
|
|
10
|
+
* - REDUCES the exposure window for credentials in memory; it does not
|
|
11
|
+
* eliminate it.
|
|
12
|
+
* - This is mitigation, NOT prevention, of memory-dump or cold-boot attacks.
|
|
13
|
+
* We cannot guarantee secrets are gone from RAM after wipe().
|
|
14
|
+
* - V8 caveat: JavaScript strings are immutable. The input string passed in,
|
|
15
|
+
* and every value produced by toString() / getValue(), are independent V8
|
|
16
|
+
* string copies on the heap that this code CANNOT wipe and that persist
|
|
17
|
+
* until garbage collection (and possibly beyond, in freed-but-unzeroed
|
|
18
|
+
* memory). Only the internal Buffer is zeroed by wipe().
|
|
13
19
|
*
|
|
14
20
|
* Added by Pantheon Security for hardened fork.
|
|
15
21
|
*/
|
|
@@ -48,7 +54,10 @@ export class SecureString {
|
|
|
48
54
|
this.buffer = Buffer.from(value, "utf-8");
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
|
-
* Get the string value
|
|
57
|
+
* Get the string value.
|
|
58
|
+
* Note: returns a new immutable V8 string copy that cannot be wiped and
|
|
59
|
+
* persists until garbage collection. Avoid retaining the result longer
|
|
60
|
+
* than necessary.
|
|
52
61
|
*/
|
|
53
62
|
toString() {
|
|
54
63
|
if (this.wiped) {
|
|
@@ -72,7 +81,9 @@ export class SecureString {
|
|
|
72
81
|
return this.wiped ? 0 : this.buffer.length;
|
|
73
82
|
}
|
|
74
83
|
/**
|
|
75
|
-
*
|
|
84
|
+
* Wipe the backing Buffer (best effort).
|
|
85
|
+
* Only zeroes the internal Buffer; any string copies previously returned
|
|
86
|
+
* by toString() / the constructor input remain in the V8 heap until GC.
|
|
76
87
|
*/
|
|
77
88
|
wipe() {
|
|
78
89
|
if (!this.wiped) {
|
|
@@ -106,7 +117,9 @@ export class SecureCredential {
|
|
|
106
117
|
this.autoWipeTimer.unref();
|
|
107
118
|
}
|
|
108
119
|
/**
|
|
109
|
-
* Get the credential value
|
|
120
|
+
* Get the credential value.
|
|
121
|
+
* Note: returns an immutable V8 string copy that cannot be wiped and
|
|
122
|
+
* persists until garbage collection.
|
|
110
123
|
*/
|
|
111
124
|
getValue() {
|
|
112
125
|
if (this.isExpired()) {
|
|
@@ -157,26 +170,29 @@ export async function withSecureCredential(credential, fn) {
|
|
|
157
170
|
secureCred.wipe();
|
|
158
171
|
}
|
|
159
172
|
}
|
|
160
|
-
// Canonical comparison length: hex-encoded SHA3-256 output (64 chars = 64 bytes UTF-8)
|
|
161
|
-
const HASH_COMPARE_LEN = 64;
|
|
162
173
|
/**
|
|
163
174
|
* Secure comparison to prevent timing attacks.
|
|
164
175
|
*
|
|
165
|
-
* Both
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
176
|
+
* Both operands are hashed (SHA-256) into a fixed-length digest before the
|
|
177
|
+
* constant-time comparison. This:
|
|
178
|
+
* - makes timingSafeEqual always run on the same number of bytes regardless of
|
|
179
|
+
* input length, leaking nothing about the actual lengths, and
|
|
180
|
+
* - compares the FULL content of each operand (L5): the previous version
|
|
181
|
+
* truncated both inputs to 64 bytes, so two distinct values sharing their
|
|
182
|
+
* first 64 bytes would compare equal. Hashing covers the entire input.
|
|
183
|
+
*
|
|
184
|
+
* The trailing length check is kept as defence-in-depth; SHA-256 already
|
|
185
|
+
* distinguishes different-length inputs.
|
|
169
186
|
*/
|
|
170
187
|
export function secureCompare(a, b) {
|
|
171
188
|
const bufA = typeof a === "string" ? Buffer.from(a) : a;
|
|
172
189
|
const bufB = typeof b === "string" ? Buffer.from(b) : b;
|
|
173
|
-
//
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const contentEqual = crypto.timingSafeEqual(padA, padB);
|
|
190
|
+
// Hash the full content of each operand to a fixed 32-byte digest, so
|
|
191
|
+
// timingSafeEqual always sees equal-length buffers and no input is truncated.
|
|
192
|
+
const digestA = crypto.createHash("sha256").update(bufA).digest();
|
|
193
|
+
const digestB = crypto.createHash("sha256").update(bufB).digest();
|
|
194
|
+
// timingSafeEqual runs first (constant time), length check evaluated after.
|
|
195
|
+
const contentEqual = crypto.timingSafeEqual(digestA, digestB);
|
|
180
196
|
return contentEqual && bufA.length === bufB.length;
|
|
181
197
|
}
|
|
182
198
|
/**
|
|
@@ -195,4 +211,3 @@ export function maskSensitive(value, showChars = 4) {
|
|
|
195
211
|
}
|
|
196
212
|
return value.slice(0, showChars) + "****";
|
|
197
213
|
}
|
|
198
|
-
//# sourceMappingURL=secure-memory.js.map
|
package/dist/utils/security.d.ts
CHANGED
package/dist/utils/security.js
CHANGED
|
@@ -34,28 +34,29 @@ const ALLOWED_NOTEBOOK_DOMAINS = [
|
|
|
34
34
|
// Auth domains (reserved for future use)
|
|
35
35
|
// const ALLOWED_AUTH_DOMAINS = ['accounts.google.com'];
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* Shared validation for HTTPS URLs: trims, rejects empty/dangerous-protocol/unparseable
|
|
38
|
+
* inputs, and enforces HTTPS. Returns the parsed URL for caller-specific checks.
|
|
39
39
|
*
|
|
40
|
-
* @param url - The URL
|
|
41
|
-
* @
|
|
40
|
+
* @param url - The raw URL string
|
|
41
|
+
* @param errors - Caller-specific error messages so each public function keeps its distinct wording
|
|
42
|
+
* @returns Parsed URL object (HTTPS, non-dangerous)
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
+
function parseHttpsUrl(url, errors) {
|
|
44
45
|
if (!url || typeof url !== 'string') {
|
|
45
|
-
throw new SecurityError(
|
|
46
|
+
throw new SecurityError(errors.notString);
|
|
46
47
|
}
|
|
47
48
|
// Trim whitespace
|
|
48
49
|
const trimmed = url.trim();
|
|
49
50
|
// Block empty URLs
|
|
50
51
|
if (trimmed.length === 0) {
|
|
51
|
-
throw new SecurityError(
|
|
52
|
+
throw new SecurityError(errors.empty);
|
|
52
53
|
}
|
|
53
54
|
// Block dangerous protocols
|
|
54
55
|
const lowerUrl = trimmed.toLowerCase();
|
|
55
56
|
const dangerousProtocols = ['javascript:', 'data:', 'vbscript:', 'file:', 'about:'];
|
|
56
57
|
for (const protocol of dangerousProtocols) {
|
|
57
58
|
if (lowerUrl.startsWith(protocol)) {
|
|
58
|
-
throw new SecurityError(
|
|
59
|
+
throw new SecurityError(errors.dangerousProtocol(protocol));
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
// Parse URL
|
|
@@ -64,13 +65,49 @@ export function validateNotebookUrl(url) {
|
|
|
64
65
|
parsed = new URL(trimmed);
|
|
65
66
|
}
|
|
66
67
|
catch (err) {
|
|
67
|
-
log.debug(`security: parsing URL
|
|
68
|
-
throw new SecurityError(
|
|
68
|
+
log.debug(`security: parsing URL: ${err instanceof Error ? err.message : String(err)}`);
|
|
69
|
+
throw new SecurityError(errors.invalidFormat);
|
|
69
70
|
}
|
|
70
71
|
// Enforce HTTPS
|
|
71
72
|
if (parsed.protocol !== 'https:') {
|
|
72
|
-
throw new SecurityError(
|
|
73
|
+
throw new SecurityError(errors.notHttps);
|
|
74
|
+
}
|
|
75
|
+
return parsed;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns true if the hostname targets an obvious internal/loopback/link-local
|
|
79
|
+
* destination. Defense-in-depth against SSRF; intentionally conservative so that
|
|
80
|
+
* arbitrary public source URLs are not blocked.
|
|
81
|
+
*/
|
|
82
|
+
function isInternalHost(hostname) {
|
|
83
|
+
// Strip IPv6 brackets (URL.hostname keeps them, e.g. "[::1]")
|
|
84
|
+
const host = hostname.toLowerCase().replace(/^\[|\]$/g, '');
|
|
85
|
+
if (host === 'localhost' || host === '::1' || host === '0.0.0.0') {
|
|
86
|
+
return true;
|
|
73
87
|
}
|
|
88
|
+
// RFC1918 / loopback / link-local IPv4 ranges (anchored to avoid over-restriction)
|
|
89
|
+
return (/^127\./.test(host) || // loopback 127.0.0.0/8
|
|
90
|
+
/^10\./.test(host) || // private 10.0.0.0/8
|
|
91
|
+
/^192\.168\./.test(host) || // private 192.168.0.0/16
|
|
92
|
+
/^169\.254\./.test(host) || // link-local 169.254.0.0/16
|
|
93
|
+
/^172\.(1[6-9]|2[0-9]|3[01])\./.test(host) // private 172.16.0.0/12
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Validate and sanitize a NotebookLM URL
|
|
98
|
+
* Prevents URL injection, javascript: URLs, and other attacks
|
|
99
|
+
*
|
|
100
|
+
* @param url - The URL to validate
|
|
101
|
+
* @returns Validated URL or throws error
|
|
102
|
+
*/
|
|
103
|
+
export function validateNotebookUrl(url) {
|
|
104
|
+
const parsed = parseHttpsUrl(url, {
|
|
105
|
+
notString: 'URL is required and must be a string',
|
|
106
|
+
empty: 'URL cannot be empty',
|
|
107
|
+
dangerousProtocol: (protocol) => `Dangerous protocol not allowed: ${protocol}`,
|
|
108
|
+
invalidFormat: 'Invalid URL format',
|
|
109
|
+
notHttps: 'Only HTTPS URLs are allowed',
|
|
110
|
+
});
|
|
74
111
|
// Validate domain
|
|
75
112
|
const hostname = parsed.hostname.toLowerCase();
|
|
76
113
|
const isAllowedNotebook = ALLOWED_NOTEBOOK_DOMAINS.some(d => hostname === d || hostname.endsWith('.' + d));
|
|
@@ -90,30 +127,18 @@ export function validateNotebookUrl(url) {
|
|
|
90
127
|
* Enforces HTTPS and blocks dangerous schemes without restricting domain.
|
|
91
128
|
*/
|
|
92
129
|
export function validateSourceUrl(url) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
let parsed;
|
|
108
|
-
try {
|
|
109
|
-
parsed = new URL(trimmed);
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
log.debug(`security: parsing source URL in validateSourceUrl: ${err instanceof Error ? err.message : String(err)}`);
|
|
113
|
-
throw new SecurityError('Invalid source URL format');
|
|
114
|
-
}
|
|
115
|
-
if (parsed.protocol !== 'https:') {
|
|
116
|
-
throw new SecurityError('Only HTTPS source URLs are allowed');
|
|
130
|
+
const parsed = parseHttpsUrl(url, {
|
|
131
|
+
notString: 'Source URL is required and must be a string',
|
|
132
|
+
empty: 'Source URL cannot be empty',
|
|
133
|
+
dangerousProtocol: (protocol) => `Dangerous protocol not allowed in source URL: ${protocol}`,
|
|
134
|
+
invalidFormat: 'Invalid source URL format',
|
|
135
|
+
notHttps: 'Only HTTPS source URLs are allowed',
|
|
136
|
+
});
|
|
137
|
+
// Defense-in-depth SSRF guard: block obvious internal/loopback targets.
|
|
138
|
+
// The URL is fetched server-side downstream, so this only blocks the clearly
|
|
139
|
+
// internal cases — public hosts of any kind remain allowed.
|
|
140
|
+
if (isInternalHost(parsed.hostname)) {
|
|
141
|
+
throw new SecurityError(`Source URL targets an internal address: ${parsed.hostname}`);
|
|
117
142
|
}
|
|
118
143
|
return parsed.href;
|
|
119
144
|
}
|
|
@@ -223,10 +248,13 @@ export function maskEmail(email) {
|
|
|
223
248
|
export function validateFilePath(basePath, filePath) {
|
|
224
249
|
// Resolve to absolute path
|
|
225
250
|
const resolved = path.resolve(basePath, filePath);
|
|
226
|
-
// Ensure it's within the base path
|
|
227
|
-
|
|
251
|
+
// Ensure it's within the base path.
|
|
252
|
+
// Use path.relative to avoid the prefix bug where /x/exports matches /x/exports-evil:
|
|
253
|
+
// an in-base path yields "" (equal) or a relative path that does not start with "..".
|
|
254
|
+
const normalizedBase = path.resolve(basePath);
|
|
228
255
|
const normalizedResolved = path.normalize(resolved);
|
|
229
|
-
|
|
256
|
+
const relative = path.relative(normalizedBase, normalizedResolved);
|
|
257
|
+
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
230
258
|
throw new SecurityError('Path traversal detected: file must be within allowed directory');
|
|
231
259
|
}
|
|
232
260
|
return normalizedResolved;
|
|
@@ -339,4 +367,3 @@ export function checkSecurityContext() {
|
|
|
339
367
|
warnings,
|
|
340
368
|
};
|
|
341
369
|
}
|
|
342
|
-
//# sourceMappingURL=security.js.map
|
|
@@ -19,6 +19,15 @@ export declare class SettingsManager {
|
|
|
19
19
|
* Load settings from file, falling back to defaults
|
|
20
20
|
*/
|
|
21
21
|
private loadSettings;
|
|
22
|
+
/**
|
|
23
|
+
* Sanitize an untrusted customSettings object before it is stored and later
|
|
24
|
+
* spread/merged elsewhere. Strips prototype-pollution vectors
|
|
25
|
+
* ("__proto__"/"constructor"/"prototype"), drops nested objects/arrays
|
|
26
|
+
* (only primitive values are accepted), and bounds the number of keys.
|
|
27
|
+
* Builds the result on a null-prototype object so a poisoned key can never
|
|
28
|
+
* reach Object.prototype.
|
|
29
|
+
*/
|
|
30
|
+
private sanitizeCustomSettings;
|
|
22
31
|
/**
|
|
23
32
|
* Save current settings to file
|
|
24
33
|
*/
|
|
@@ -34,4 +43,3 @@ export declare class SettingsManager {
|
|
|
34
43
|
getSettingsPath(): string;
|
|
35
44
|
getProfiles(): Record<ProfileName, string[]>;
|
|
36
45
|
}
|
|
37
|
-
//# sourceMappingURL=settings-manager.d.ts.map
|
|
@@ -13,6 +13,16 @@ const DEFAULT_SETTINGS = {
|
|
|
13
13
|
profile: "standard",
|
|
14
14
|
disabledTools: [],
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Dangerous keys that must never be copied into customSettings, since the
|
|
18
|
+
* object is later spread/merged and could otherwise poison Object.prototype.
|
|
19
|
+
*/
|
|
20
|
+
const FORBIDDEN_CUSTOM_KEYS = ["__proto__", "constructor", "prototype"];
|
|
21
|
+
/**
|
|
22
|
+
* Upper bound on the number of own keys accepted in customSettings, to prevent
|
|
23
|
+
* an oversized/abusive settings file from bloating in-memory config.
|
|
24
|
+
*/
|
|
25
|
+
const MAX_CUSTOM_SETTINGS_KEYS = 100;
|
|
16
26
|
const PROFILES = {
|
|
17
27
|
minimal: [
|
|
18
28
|
"ask_question",
|
|
@@ -104,7 +114,7 @@ export class SettingsManager {
|
|
|
104
114
|
validated.disabledTools = parsed.disabledTools.filter((t) => typeof t === "string");
|
|
105
115
|
}
|
|
106
116
|
if (parsed.customSettings && typeof parsed.customSettings === "object" && !Array.isArray(parsed.customSettings)) {
|
|
107
|
-
validated.customSettings = parsed.customSettings;
|
|
117
|
+
validated.customSettings = this.sanitizeCustomSettings(parsed.customSettings);
|
|
108
118
|
}
|
|
109
119
|
return { ...DEFAULT_SETTINGS, ...validated };
|
|
110
120
|
}
|
|
@@ -114,6 +124,40 @@ export class SettingsManager {
|
|
|
114
124
|
}
|
|
115
125
|
return { ...DEFAULT_SETTINGS };
|
|
116
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Sanitize an untrusted customSettings object before it is stored and later
|
|
129
|
+
* spread/merged elsewhere. Strips prototype-pollution vectors
|
|
130
|
+
* ("__proto__"/"constructor"/"prototype"), drops nested objects/arrays
|
|
131
|
+
* (only primitive values are accepted), and bounds the number of keys.
|
|
132
|
+
* Builds the result on a null-prototype object so a poisoned key can never
|
|
133
|
+
* reach Object.prototype.
|
|
134
|
+
*/
|
|
135
|
+
sanitizeCustomSettings(raw) {
|
|
136
|
+
const safe = Object.create(null);
|
|
137
|
+
let count = 0;
|
|
138
|
+
for (const key of Object.keys(raw)) {
|
|
139
|
+
// Reject prototype-pollution keys (own keys only via Object.keys).
|
|
140
|
+
if (FORBIDDEN_CUSTOM_KEYS.includes(key)) {
|
|
141
|
+
log.warning(`⚠️ Ignoring forbidden custom setting key: "${key}"`);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (count >= MAX_CUSTOM_SETTINGS_KEYS) {
|
|
145
|
+
log.warning(`⚠️ customSettings exceeds ${MAX_CUSTOM_SETTINGS_KEYS} keys; extra keys ignored.`);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
const value = raw[key];
|
|
149
|
+
const valueType = typeof value;
|
|
150
|
+
// Constrain values to primitives to avoid nested injection vectors.
|
|
151
|
+
if (value === null || valueType === "string" || valueType === "number" || valueType === "boolean") {
|
|
152
|
+
safe[key] = value;
|
|
153
|
+
count++;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
log.warning(`⚠️ Ignoring custom setting "${key}" with unsupported value type: ${valueType}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return safe;
|
|
160
|
+
}
|
|
117
161
|
/**
|
|
118
162
|
* Save current settings to file
|
|
119
163
|
*/
|
|
@@ -173,4 +217,3 @@ export class SettingsManager {
|
|
|
173
217
|
return PROFILES;
|
|
174
218
|
}
|
|
175
219
|
}
|
|
176
|
-
//# sourceMappingURL=settings-manager.js.map
|