@pan-sec/notebooklm-mcp 2026.3.3 → 2026.4.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/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 +7 -16
- package/dist/notebook-creation/audio-manager.js +115 -58
- 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 +8 -14
- package/dist/notebook-creation/data-table-manager.js +64 -37
- 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-shared.d.ts +75 -0
- package/dist/notebook-creation/source-manager-shared.js +86 -0
- package/dist/notebook-creation/source-manager.d.ts +29 -2
- package/dist/notebook-creation/source-manager.js +0 -0
- package/dist/notebook-creation/studio-manager-base.d.ts +57 -0
- package/dist/notebook-creation/studio-manager-base.js +67 -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 +3 -16
- package/dist/notebook-creation/video-manager.js +94 -53
- 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
|
@@ -37,8 +37,6 @@ function generateQueryId() {
|
|
|
37
37
|
return crypto.randomBytes(8).toString("hex");
|
|
38
38
|
}
|
|
39
39
|
const MAX_LOG_FILE_BYTES = 100 * 1024 * 1024; // 100 MB per daily file (I232)
|
|
40
|
-
const TRUNCATED_FIELD_LENGTH = 500;
|
|
41
|
-
const TRUNCATED_SUFFIX = "...[truncated]";
|
|
42
40
|
/**
|
|
43
41
|
* Query Logger Class
|
|
44
42
|
*
|
|
@@ -56,6 +54,19 @@ export class QueryLogger {
|
|
|
56
54
|
* severity so we don't redact legitimate base64 payloads (images, PDFs,
|
|
57
55
|
* JWT payloads) that frequently appear in NotebookLM answers. Real
|
|
58
56
|
* credentials live at critical/high/medium severity.
|
|
57
|
+
*
|
|
58
|
+
* ACCEPTED RISK (L11): the only `severity: "low"` rule in the scanner is the
|
|
59
|
+
* "High Entropy String" pattern (/\b[A-Za-z0-9+/]{32,}={0,2}\b/, see
|
|
60
|
+
* secrets-scanner.ts). It is DELIBERATELY NOT redacted at rest because
|
|
61
|
+
* NotebookLM answers routinely contain long, high-entropy base64 that is NOT
|
|
62
|
+
* a secret — inline image/PDF data-URIs, JWT payload segments, GCS object
|
|
63
|
+
* names, CSRF tokens, document hashes. Redacting at "low" would shred this
|
|
64
|
+
* legitimate research content (high false-positive rate) for marginal gain:
|
|
65
|
+
* genuine credentials (API keys, bearer tokens, private keys, connection
|
|
66
|
+
* strings) already match dedicated critical/high/medium rules and are
|
|
67
|
+
* redacted regardless. The base64 false-positive cost outweighs the residual
|
|
68
|
+
* risk of an unstructured low-confidence entropy hit slipping through, so the
|
|
69
|
+
* threshold stays at "medium" by design.
|
|
59
70
|
*/
|
|
60
71
|
scanner = new SecretsScanner({ minSeverity: "medium" });
|
|
61
72
|
stats = {
|
|
@@ -91,14 +102,25 @@ export class QueryLogger {
|
|
|
91
102
|
cleanOldLogs() {
|
|
92
103
|
try {
|
|
93
104
|
const files = fs.readdirSync(this.config.logDir);
|
|
105
|
+
// Filenames are UTC dates (toISOString) and new Date("YYYY-MM-DD") parses as
|
|
106
|
+
// UTC midnight, so compute the cutoff at UTC midnight too — using local
|
|
107
|
+
// setDate/getDate would skew the comparison by up to a day near TZ boundaries (L13).
|
|
94
108
|
const cutoffDate = new Date();
|
|
95
|
-
cutoffDate.
|
|
109
|
+
cutoffDate.setUTCHours(0, 0, 0, 0);
|
|
110
|
+
cutoffDate.setUTCDate(cutoffDate.getUTCDate() - this.config.retentionDays);
|
|
96
111
|
let deletedCount = 0;
|
|
97
112
|
for (const file of files) {
|
|
98
113
|
if (!file.startsWith("query-log-") || !file.endsWith(".jsonl"))
|
|
99
114
|
continue;
|
|
100
|
-
// Extract date from filename (query-log-YYYY-MM-DD.jsonl)
|
|
115
|
+
// Extract date from filename (query-log-YYYY-MM-DD.jsonl). The fixed-width
|
|
116
|
+
// slice(10,20) yields "YYYY-MM-DD" for both base and rotated
|
|
117
|
+
// (query-log-DATE.NNN.jsonl) names, so this guard does NOT exclude rotated files
|
|
118
|
+
// from retention — it only rejects genuinely malformed names before feeding
|
|
119
|
+
// new Date, which would otherwise parse to Invalid Date or a misread cutoff (L13).
|
|
120
|
+
// Matches audit-logger's guard.
|
|
101
121
|
const dateStr = file.slice(10, 20);
|
|
122
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateStr))
|
|
123
|
+
continue;
|
|
102
124
|
const fileDate = new Date(dateStr);
|
|
103
125
|
if (fileDate < cutoffDate) {
|
|
104
126
|
fs.unlinkSync(path.join(this.config.logDir, file));
|
|
@@ -131,7 +153,13 @@ export class QueryLogger {
|
|
|
131
153
|
if (this.currentLogFile !== expectedFile) {
|
|
132
154
|
this.currentLogFile = expectedFile;
|
|
133
155
|
}
|
|
134
|
-
// Enforce per-file size cap (I232)
|
|
156
|
+
// Enforce per-file size cap (I232). When the cap would be exceeded we ROTATE to
|
|
157
|
+
// a sequence-suffixed file (query-log-DATE.NNN.jsonl) instead of silently
|
|
158
|
+
// truncating Q&A content (M9) — the old behaviour permanently lost research
|
|
159
|
+
// data with no record. Each rotation emits a mandatory log.warning so the event
|
|
160
|
+
// is visible. The current file size is re-read after each rotation; the next
|
|
161
|
+
// suffix is determined by scanning the directory so the cap holds across writers
|
|
162
|
+
// and process restarts (per-process counters did not).
|
|
135
163
|
let currentFileSize = (() => {
|
|
136
164
|
try {
|
|
137
165
|
return fs.statSync(this.currentLogFile).size;
|
|
@@ -140,29 +168,65 @@ export class QueryLogger {
|
|
|
140
168
|
return 0;
|
|
141
169
|
}
|
|
142
170
|
})();
|
|
143
|
-
const
|
|
171
|
+
const linesToWrite = [];
|
|
172
|
+
for (const e of batch) {
|
|
144
173
|
const serialized = JSON.stringify(e);
|
|
145
174
|
const entryBytes = Buffer.byteLength(serialized + "\n");
|
|
146
|
-
if (currentFileSize + entryBytes > MAX_LOG_FILE_BYTES) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
175
|
+
if (currentFileSize > 0 && currentFileSize + entryBytes > MAX_LOG_FILE_BYTES) {
|
|
176
|
+
// Flush what we have to the current file before rotating.
|
|
177
|
+
if (linesToWrite.length > 0) {
|
|
178
|
+
appendFileSecure(this.currentLogFile, linesToWrite.join("\n") + "\n", PERMISSION_MODES.OWNER_READ_WRITE);
|
|
179
|
+
linesToWrite.length = 0;
|
|
180
|
+
}
|
|
181
|
+
const rotatedFile = this.nextRotatedFile(today);
|
|
182
|
+
log.warning(`⚠️ Query log ${path.basename(this.currentLogFile)} reached ${MAX_LOG_FILE_BYTES} byte cap — rotating to ${path.basename(rotatedFile)} (no content truncated)`);
|
|
183
|
+
this.currentLogFile = rotatedFile;
|
|
184
|
+
currentFileSize = (() => {
|
|
185
|
+
try {
|
|
186
|
+
return fs.statSync(this.currentLogFile).size;
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
return 0;
|
|
190
|
+
}
|
|
191
|
+
})();
|
|
155
192
|
}
|
|
193
|
+
linesToWrite.push(serialized);
|
|
156
194
|
currentFileSize += entryBytes;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
195
|
+
}
|
|
196
|
+
if (linesToWrite.length > 0) {
|
|
197
|
+
appendFileSecure(this.currentLogFile, linesToWrite.join("\n") + "\n", PERMISSION_MODES.OWNER_READ_WRITE);
|
|
198
|
+
}
|
|
160
199
|
}
|
|
161
200
|
}
|
|
162
201
|
finally {
|
|
163
202
|
this.isWriting = false;
|
|
164
203
|
}
|
|
165
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Determine the next sequence-suffixed log file for `date` when the base file (or a
|
|
207
|
+
* prior rotation) has hit the size cap (M9). Scans the directory for the highest
|
|
208
|
+
* existing query-log-DATE.NNN.jsonl suffix and returns the next one, so rotation is
|
|
209
|
+
* correct across writers and restarts rather than relying on a per-process counter.
|
|
210
|
+
*/
|
|
211
|
+
nextRotatedFile(date) {
|
|
212
|
+
let maxSeq = 0;
|
|
213
|
+
try {
|
|
214
|
+
const re = new RegExp(`^query-log-${date}\\.(\\d{3})\\.jsonl$`);
|
|
215
|
+
for (const f of fs.readdirSync(this.config.logDir)) {
|
|
216
|
+
const m = f.match(re);
|
|
217
|
+
if (m) {
|
|
218
|
+
const seq = parseInt(m[1], 10);
|
|
219
|
+
if (seq > maxSeq)
|
|
220
|
+
maxSeq = seq;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
log.debug(`query-logger: scanning for rotated files: ${err instanceof Error ? err.message : String(err)}`);
|
|
226
|
+
}
|
|
227
|
+
const nextSeq = String(maxSeq + 1).padStart(3, "0");
|
|
228
|
+
return path.join(this.config.logDir, `query-log-${date}.${nextSeq}.jsonl`);
|
|
229
|
+
}
|
|
166
230
|
/**
|
|
167
231
|
* Log a query (Q&A pair).
|
|
168
232
|
*
|
|
@@ -216,8 +280,23 @@ export class QueryLogger {
|
|
|
216
280
|
* Get all queries for a specific date (YYYY-MM-DD)
|
|
217
281
|
*/
|
|
218
282
|
async getQueriesForDate(date) {
|
|
219
|
-
|
|
220
|
-
|
|
283
|
+
// Include any size-cap rotations for the day (query-log-DATE.NNN.jsonl), not just
|
|
284
|
+
// the base file, so rotated entries are not missed (M9).
|
|
285
|
+
const baseFile = path.join(this.config.logDir, `query-log-${date}.jsonl`);
|
|
286
|
+
const entries = this.readLogFile(baseFile);
|
|
287
|
+
const rotatedRe = new RegExp(`^query-log-${date}\\.\\d{3}\\.jsonl$`);
|
|
288
|
+
try {
|
|
289
|
+
const rotated = fs.readdirSync(this.config.logDir)
|
|
290
|
+
.filter(f => rotatedRe.test(f))
|
|
291
|
+
.sort();
|
|
292
|
+
for (const f of rotated) {
|
|
293
|
+
entries.push(...this.readLogFile(path.join(this.config.logDir, f)));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
catch (err) {
|
|
297
|
+
log.debug(`query-logger: reading rotated files for date ${date}: ${err instanceof Error ? err.message : String(err)}`);
|
|
298
|
+
}
|
|
299
|
+
return entries;
|
|
221
300
|
}
|
|
222
301
|
/**
|
|
223
302
|
* Get recent queries
|
|
@@ -279,6 +358,11 @@ export class QueryLogger {
|
|
|
279
358
|
return;
|
|
280
359
|
process.on("beforeExit", () => QueryLogger.flushAllSync());
|
|
281
360
|
process.on("SIGTERM", () => QueryLogger.flushAllSync());
|
|
361
|
+
// Mirror SIGTERM for SIGINT (Ctrl-C) and SIGHUP so buffered Q&A is flushed
|
|
362
|
+
// synchronously on those signals too (M5). Additive flush-only safety nets — the
|
|
363
|
+
// process entry point owns termination, so these do not suppress exit or hang.
|
|
364
|
+
process.on("SIGINT", () => QueryLogger.flushAllSync());
|
|
365
|
+
process.on("SIGHUP", () => QueryLogger.flushAllSync());
|
|
282
366
|
QueryLogger.processHandlersRegistered = true;
|
|
283
367
|
}
|
|
284
368
|
static flushAllSync() {
|
|
@@ -361,4 +445,3 @@ export function getQueryLogger() {
|
|
|
361
445
|
export async function logQuery(entry) {
|
|
362
446
|
return getQueryLogger().logQuery(entry);
|
|
363
447
|
}
|
|
364
|
-
//# sourceMappingURL=query-logger.js.map
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* Manages audio overview generation in NotebookLM notebooks.
|
|
5
5
|
* Audio overviews are AI-generated podcast-style summaries of notebook content.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import { SharedContextManager } from "../session/shared-context-manager.js";
|
|
7
|
+
import { StudioManagerBase } from "./studio-manager-base.js";
|
|
9
8
|
export interface AudioStatus {
|
|
10
9
|
status: "not_started" | "generating" | "ready" | "failed" | "unknown";
|
|
11
10
|
progress?: number;
|
|
@@ -23,15 +22,12 @@ export interface DownloadAudioResult {
|
|
|
23
22
|
size?: number;
|
|
24
23
|
error?: string;
|
|
25
24
|
}
|
|
26
|
-
export declare class AudioManager {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* Navigate to a notebook and ensure we're on the right page
|
|
33
|
-
*/
|
|
34
|
-
private navigateToNotebook;
|
|
25
|
+
export declare class AudioManager extends StudioManagerBase {
|
|
26
|
+
protected readonly logName = "audio-manager";
|
|
27
|
+
protected readonly navigateDelay: {
|
|
28
|
+
min: number;
|
|
29
|
+
max: number;
|
|
30
|
+
};
|
|
35
31
|
/**
|
|
36
32
|
* Generate an audio overview for a notebook
|
|
37
33
|
*/
|
|
@@ -48,9 +44,4 @@ export declare class AudioManager {
|
|
|
48
44
|
* Download the generated audio file
|
|
49
45
|
*/
|
|
50
46
|
downloadAudio(notebookUrl: string, outputPath?: string): Promise<DownloadAudioResult>;
|
|
51
|
-
/**
|
|
52
|
-
* Close the page if open
|
|
53
|
-
*/
|
|
54
|
-
private closePage;
|
|
55
47
|
}
|
|
56
|
-
//# sourceMappingURL=audio-manager.d.ts.map
|
|
@@ -6,8 +6,71 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { log } from "../utils/logger.js";
|
|
8
8
|
import { randomDelay } from "../utils/stealth-utils.js";
|
|
9
|
+
import { StudioManagerBase, } from "./studio-manager-base.js";
|
|
9
10
|
import fs from "fs";
|
|
10
11
|
import path from "path";
|
|
12
|
+
import os from "os";
|
|
13
|
+
/**
|
|
14
|
+
* Maximum size for a downloaded audio file. Caps unbounded in-memory buffering
|
|
15
|
+
* (response.body() reads the whole response) and arbitrary disk writes (H14).
|
|
16
|
+
*/
|
|
17
|
+
const MAX_AUDIO_BYTES = 200 * 1024 * 1024; // 200 MiB
|
|
18
|
+
/**
|
|
19
|
+
* Allowed origins for audio download URLs scraped from the page DOM.
|
|
20
|
+
* Prevents SSRF: the download URL (downloadBtn.href / data-url / audio.src) is
|
|
21
|
+
* attacker-influenceable content, so it must be confined to Google/NotebookLM
|
|
22
|
+
* hosts before page.goto() (C3). Mirrors the host-matching used by
|
|
23
|
+
* validateNotebookUrl in utils/security.ts.
|
|
24
|
+
*/
|
|
25
|
+
const ALLOWED_AUDIO_DOWNLOAD_DOMAINS = [
|
|
26
|
+
"google.com",
|
|
27
|
+
"googleusercontent.com",
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Resolve and validate the audio output path, confining it to an allowed base
|
|
31
|
+
* directory (C2). Mirrors resolveExportPath in tools/handlers/system.ts:
|
|
32
|
+
* 1. NLMCP_EXPORT_DIR env override
|
|
33
|
+
* 2. user home directory
|
|
34
|
+
* Rejects absolute paths and '..' traversal that escape the base dir.
|
|
35
|
+
*/
|
|
36
|
+
function resolveAudioOutputPath(userPath, defaultName) {
|
|
37
|
+
const envDir = process.env.NLMCP_EXPORT_DIR?.trim();
|
|
38
|
+
const baseDirRaw = envDir && envDir.length > 0 ? envDir : os.homedir();
|
|
39
|
+
const baseDir = path.resolve(baseDirRaw);
|
|
40
|
+
const candidate = userPath && userPath.trim().length > 0
|
|
41
|
+
? path.resolve(baseDir, userPath)
|
|
42
|
+
: path.resolve(baseDir, defaultName);
|
|
43
|
+
// Defence in depth: ensure resolved path is still inside the base dir.
|
|
44
|
+
const rel = path.relative(baseDir, candidate);
|
|
45
|
+
if (rel.startsWith("..") || path.isAbsolute(rel)) {
|
|
46
|
+
throw new Error(`output_path must resolve inside ${baseDir} (got '${candidate}'). ` +
|
|
47
|
+
`Set NLMCP_EXPORT_DIR to allow another base directory.`);
|
|
48
|
+
}
|
|
49
|
+
return candidate;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Validate a DOM-sourced audio download URL before navigating to it (C3, SSRF).
|
|
53
|
+
* Enforces https and an allowed Google/NotebookLM host. Returns the normalized
|
|
54
|
+
* URL or throws.
|
|
55
|
+
*/
|
|
56
|
+
function validateAudioDownloadUrl(url) {
|
|
57
|
+
let parsed;
|
|
58
|
+
try {
|
|
59
|
+
parsed = new URL(url);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
throw new Error("Audio download URL is not a valid absolute URL");
|
|
63
|
+
}
|
|
64
|
+
if (parsed.protocol !== "https:") {
|
|
65
|
+
throw new Error(`Audio download URL must be https (got '${parsed.protocol}')`);
|
|
66
|
+
}
|
|
67
|
+
const hostname = parsed.hostname.toLowerCase();
|
|
68
|
+
const allowed = ALLOWED_AUDIO_DOWNLOAD_DOMAINS.some((d) => hostname === d || hostname.endsWith("." + d));
|
|
69
|
+
if (!allowed) {
|
|
70
|
+
throw new Error(`Audio download host not allowed: ${hostname}`);
|
|
71
|
+
}
|
|
72
|
+
return parsed.href;
|
|
73
|
+
}
|
|
11
74
|
// Selectors for audio controls (may need refinement based on actual UI)
|
|
12
75
|
const AUDIO_SELECTORS = {
|
|
13
76
|
// Generate button
|
|
@@ -38,47 +101,27 @@ const AUDIO_SELECTORS = {
|
|
|
38
101
|
text: '[class*="progress-text"], [class*="eta"]',
|
|
39
102
|
},
|
|
40
103
|
};
|
|
41
|
-
export class AudioManager {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
page = null;
|
|
45
|
-
constructor(authManager, contextManager) {
|
|
46
|
-
this.authManager = authManager;
|
|
47
|
-
this.contextManager = contextManager;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Navigate to a notebook and ensure we're on the right page
|
|
51
|
-
*/
|
|
52
|
-
async navigateToNotebook(notebookUrl) {
|
|
53
|
-
const context = await this.contextManager.getOrCreateContext();
|
|
54
|
-
const isAuth = await this.authManager.validateWithRetry(context);
|
|
55
|
-
if (!isAuth) {
|
|
56
|
-
throw new Error("Not authenticated. Run setup_auth first.");
|
|
57
|
-
}
|
|
58
|
-
this.page = await context.newPage();
|
|
59
|
-
await this.page.goto(notebookUrl, { waitUntil: "domcontentloaded" });
|
|
60
|
-
await this.page.waitForLoadState("networkidle").catch(() => { });
|
|
61
|
-
await randomDelay(1500, 2500);
|
|
62
|
-
return this.page;
|
|
63
|
-
}
|
|
104
|
+
export class AudioManager extends StudioManagerBase {
|
|
105
|
+
logName = "audio-manager";
|
|
106
|
+
navigateDelay = { min: 1500, max: 2500 };
|
|
64
107
|
/**
|
|
65
108
|
* Generate an audio overview for a notebook
|
|
66
109
|
*/
|
|
67
110
|
async generateAudioOverview(notebookUrl) {
|
|
68
|
-
log.info(
|
|
111
|
+
log.info(`Generating audio overview for: ${notebookUrl}`);
|
|
69
112
|
const page = await this.navigateToNotebook(notebookUrl);
|
|
70
113
|
try {
|
|
71
114
|
// First, check current status
|
|
72
115
|
const currentStatus = await this.checkAudioStatusInternal(page);
|
|
73
116
|
if (currentStatus.status === "generating") {
|
|
74
|
-
log.info("
|
|
117
|
+
log.info(" Audio generation already in progress");
|
|
75
118
|
return {
|
|
76
119
|
success: true,
|
|
77
120
|
status: currentStatus,
|
|
78
121
|
};
|
|
79
122
|
}
|
|
80
123
|
if (currentStatus.status === "ready") {
|
|
81
|
-
log.info("
|
|
124
|
+
log.info(" Audio already generated");
|
|
82
125
|
return {
|
|
83
126
|
success: true,
|
|
84
127
|
status: currentStatus,
|
|
@@ -127,7 +170,7 @@ export class AudioManager {
|
|
|
127
170
|
});
|
|
128
171
|
}
|
|
129
172
|
if (!generateClicked) {
|
|
130
|
-
log.warning("
|
|
173
|
+
log.warning(" Could not find audio generation button");
|
|
131
174
|
return {
|
|
132
175
|
success: false,
|
|
133
176
|
status: { status: "unknown" },
|
|
@@ -138,7 +181,7 @@ export class AudioManager {
|
|
|
138
181
|
// Check if generation started
|
|
139
182
|
const newStatus = await this.checkAudioStatusInternal(page);
|
|
140
183
|
if (newStatus.status === "generating" || newStatus.status === "ready") {
|
|
141
|
-
log.success(`
|
|
184
|
+
log.success(` Audio generation ${newStatus.status === "ready" ? "completed" : "started"}`);
|
|
142
185
|
return {
|
|
143
186
|
success: true,
|
|
144
187
|
status: newStatus,
|
|
@@ -158,7 +201,7 @@ export class AudioManager {
|
|
|
158
201
|
* Check the current audio status for a notebook
|
|
159
202
|
*/
|
|
160
203
|
async getAudioStatus(notebookUrl) {
|
|
161
|
-
log.info(
|
|
204
|
+
log.info(`Checking audio status for: ${notebookUrl}`);
|
|
162
205
|
const page = await this.navigateToNotebook(notebookUrl);
|
|
163
206
|
try {
|
|
164
207
|
const status = await this.checkAudioStatusInternal(page);
|
|
@@ -222,7 +265,7 @@ export class AudioManager {
|
|
|
222
265
|
* Download the generated audio file
|
|
223
266
|
*/
|
|
224
267
|
async downloadAudio(notebookUrl, outputPath) {
|
|
225
|
-
log.info(
|
|
268
|
+
log.info(`Downloading audio from: ${notebookUrl}`);
|
|
226
269
|
const page = await this.navigateToNotebook(notebookUrl);
|
|
227
270
|
try {
|
|
228
271
|
// First check if audio is ready
|
|
@@ -266,12 +309,12 @@ export class AudioManager {
|
|
|
266
309
|
return false;
|
|
267
310
|
});
|
|
268
311
|
if (clicked) {
|
|
269
|
-
//
|
|
312
|
+
// The button was clicked but we cannot capture the file via this code
|
|
313
|
+
// path, so no file is written. Do not report success (M27).
|
|
270
314
|
await randomDelay(2000, 3000);
|
|
271
|
-
// Note: Actual file download handling would require more complex logic
|
|
272
315
|
return {
|
|
273
|
-
success:
|
|
274
|
-
error: "Download
|
|
316
|
+
success: false,
|
|
317
|
+
error: "Download could not be completed automatically; no file was saved. Try downloading the audio manually from the notebook.",
|
|
275
318
|
};
|
|
276
319
|
}
|
|
277
320
|
return {
|
|
@@ -279,29 +322,59 @@ export class AudioManager {
|
|
|
279
322
|
error: "Could not find download button or audio source",
|
|
280
323
|
};
|
|
281
324
|
}
|
|
282
|
-
//
|
|
283
|
-
|
|
325
|
+
// Confine output to an allowed base directory (C2). When no output_path
|
|
326
|
+
// is supplied, the generated default also lands inside the base dir.
|
|
327
|
+
const defaultName = `notebooklm-audio-${Date.now()}.mp3`;
|
|
328
|
+
const finalPath = resolveAudioOutputPath(outputPath, defaultName);
|
|
329
|
+
// Validate the DOM-sourced download URL before navigating (C3, SSRF).
|
|
330
|
+
const safeDownloadUrl = validateAudioDownloadUrl(downloadInfo.url);
|
|
284
331
|
// Download the file using the page context
|
|
285
|
-
const response = await page.goto(
|
|
332
|
+
const response = await page.goto(safeDownloadUrl);
|
|
286
333
|
if (!response) {
|
|
287
334
|
return {
|
|
288
335
|
success: false,
|
|
289
336
|
error: "Failed to fetch audio file",
|
|
290
337
|
};
|
|
291
338
|
}
|
|
339
|
+
// Enforce size cap early via Content-Length if present (H14).
|
|
340
|
+
const contentLengthHeader = response.headers()["content-length"];
|
|
341
|
+
if (contentLengthHeader) {
|
|
342
|
+
const declared = parseInt(contentLengthHeader, 10);
|
|
343
|
+
if (Number.isFinite(declared) && declared > MAX_AUDIO_BYTES) {
|
|
344
|
+
return {
|
|
345
|
+
success: false,
|
|
346
|
+
error: `Audio file too large: ${declared} bytes exceeds limit of ${MAX_AUDIO_BYTES} bytes`,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// Warn (do not hard-fail) if content-type is not audio/* — NotebookLM may
|
|
351
|
+
// serve application/octet-stream.
|
|
352
|
+
const contentType = response.headers()["content-type"];
|
|
353
|
+
if (contentType && !contentType.startsWith("audio/") && !contentType.startsWith("application/octet-stream")) {
|
|
354
|
+
log.warning(` Unexpected audio content-type: ${contentType}`);
|
|
355
|
+
}
|
|
356
|
+
// patchright's response.body() has no streaming cap, so buffer then
|
|
357
|
+
// enforce the cap before writing (H14). Content-Length can be absent or
|
|
358
|
+
// inaccurate, so this check is authoritative.
|
|
292
359
|
const buffer = await response.body();
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
360
|
+
if (buffer.length > MAX_AUDIO_BYTES) {
|
|
361
|
+
return {
|
|
362
|
+
success: false,
|
|
363
|
+
error: `Audio file too large: ${buffer.length} bytes exceeds limit of ${MAX_AUDIO_BYTES} bytes`,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
// Async write to avoid blocking the event loop (H14).
|
|
367
|
+
await fs.promises.writeFile(finalPath, buffer);
|
|
368
|
+
log.success(` Audio downloaded: ${finalPath} (${buffer.length} bytes)`);
|
|
296
369
|
return {
|
|
297
370
|
success: true,
|
|
298
371
|
filePath: finalPath,
|
|
299
|
-
size:
|
|
372
|
+
size: buffer.length,
|
|
300
373
|
};
|
|
301
374
|
}
|
|
302
375
|
catch (error) {
|
|
303
376
|
const msg = error instanceof Error ? error.message : String(error);
|
|
304
|
-
log.error(`
|
|
377
|
+
log.error(` Failed to download audio: ${msg}`);
|
|
305
378
|
return {
|
|
306
379
|
success: false,
|
|
307
380
|
error: msg,
|
|
@@ -311,20 +384,4 @@ export class AudioManager {
|
|
|
311
384
|
await this.closePage();
|
|
312
385
|
}
|
|
313
386
|
}
|
|
314
|
-
/**
|
|
315
|
-
* Close the page if open
|
|
316
|
-
*/
|
|
317
|
-
async closePage() {
|
|
318
|
-
if (this.page) {
|
|
319
|
-
try {
|
|
320
|
-
await this.page.close();
|
|
321
|
-
}
|
|
322
|
-
catch (err) {
|
|
323
|
-
log.debug(`audio-manager: closing page: ${err instanceof Error ? err.message : String(err)}`);
|
|
324
|
-
// Ignore close errors
|
|
325
|
-
}
|
|
326
|
-
this.page = null;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
387
|
}
|
|
330
|
-
//# sourceMappingURL=audio-manager.js.map
|
|
@@ -25,4 +25,3 @@ export interface BrowserOptions {
|
|
|
25
25
|
* Apply browser options to CONFIG (returns modified copy, doesn't mutate global CONFIG).
|
|
26
26
|
*/
|
|
27
27
|
export declare function applyBrowserOptions(options?: BrowserOptions, legacyShowBrowser?: boolean): Config;
|
|
28
|
-
//# sourceMappingURL=browser-options.d.ts.map
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* - Artifact title during generation: "Generating data table…"
|
|
15
15
|
* - Chat-embedded tables use standard <table><tr><th>/<td> (no <tbody>)
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
18
|
-
import { SharedContextManager } from "../session/shared-context-manager.js";
|
|
17
|
+
import { StudioManagerBase } from "./studio-manager-base.js";
|
|
19
18
|
export interface DataTable {
|
|
20
19
|
headers: string[];
|
|
21
20
|
rows: string[][];
|
|
@@ -36,15 +35,8 @@ export interface GetDataTableResult {
|
|
|
36
35
|
table?: DataTable;
|
|
37
36
|
error?: string;
|
|
38
37
|
}
|
|
39
|
-
export declare class DataTableManager {
|
|
40
|
-
|
|
41
|
-
private contextManager;
|
|
42
|
-
private page;
|
|
43
|
-
constructor(authManager: AuthManager, contextManager: SharedContextManager);
|
|
44
|
-
/**
|
|
45
|
-
* Navigate to a notebook and ensure we're on the right page
|
|
46
|
-
*/
|
|
47
|
-
private navigateToNotebook;
|
|
38
|
+
export declare class DataTableManager extends StudioManagerBase {
|
|
39
|
+
protected readonly logName = "data-table-manager";
|
|
48
40
|
/**
|
|
49
41
|
* Ensure the Studio panel is visible (expand if collapsed).
|
|
50
42
|
*
|
|
@@ -88,8 +80,10 @@ export declare class DataTableManager {
|
|
|
88
80
|
*/
|
|
89
81
|
private extractTableData;
|
|
90
82
|
/**
|
|
91
|
-
*
|
|
83
|
+
* Sanitize extracted table content through the shared response validator.
|
|
84
|
+
* Each cell originates from untrusted document sources, so any prompt
|
|
85
|
+
* injection / malicious content is redacted before the table is returned
|
|
86
|
+
* to the calling model.
|
|
92
87
|
*/
|
|
93
|
-
private
|
|
88
|
+
private sanitizeTable;
|
|
94
89
|
}
|
|
95
|
-
//# sourceMappingURL=data-table-manager.d.ts.map
|