@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
|
@@ -227,13 +227,15 @@ export function getSelectors(key) {
|
|
|
227
227
|
const info = NOTEBOOKLM_SELECTORS[key];
|
|
228
228
|
return [info.primary, ...info.fallbacks].filter(Boolean);
|
|
229
229
|
}
|
|
230
|
-
// I146
|
|
231
|
-
|
|
230
|
+
// I146 / L32: surface unconfirmed selectors so UI drift is visible, but as a
|
|
231
|
+
// debug-only message gated behind NLMCP_DEBUG. Previously this ran at import
|
|
232
|
+
// time as a log.warning side effect, producing constant unsuppressable startup
|
|
233
|
+
// noise on every server boot.
|
|
234
|
+
if (process.env.NLMCP_DEBUG) {
|
|
232
235
|
const unconfirmed = Object.entries(NOTEBOOKLM_SELECTORS)
|
|
233
236
|
.filter(([, v]) => !v.confirmed)
|
|
234
237
|
.map(([k]) => k);
|
|
235
238
|
if (unconfirmed.length > 0) {
|
|
236
|
-
log.
|
|
239
|
+
log.debug(`Unconfirmed selectors in use (run discovery to validate): ${unconfirmed.join(", ")}`);
|
|
237
240
|
}
|
|
238
241
|
}
|
|
239
|
-
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source Manager — shared primitives
|
|
3
|
+
*
|
|
4
|
+
* Helpers genuinely shared between the two source managers in
|
|
5
|
+
* `source-manager.ts`:
|
|
6
|
+
* - SourceManager (legacy: list/add/remove on an existing
|
|
7
|
+
* notebook)
|
|
8
|
+
* - NotebookCreationSourceManager (the creation flow)
|
|
9
|
+
*
|
|
10
|
+
* Only logic that is byte-equivalent between the two classes lives here; the
|
|
11
|
+
* managers' distinct flows (source-type selection, submit/insert clicks, error
|
|
12
|
+
* alert handling, waitForSourceProcessing) intentionally differ and stay in
|
|
13
|
+
* place. These helpers are a pure de-duplication and are behavior-preserving.
|
|
14
|
+
*/
|
|
15
|
+
import type { Page } from "patchright";
|
|
16
|
+
export type BrowserDomElement = unknown;
|
|
17
|
+
export type BrowserSourceItem = {
|
|
18
|
+
textContent?: string | null;
|
|
19
|
+
className?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
getAttribute(name: string): string | null;
|
|
22
|
+
querySelector(selector: string): BrowserDomElement | null;
|
|
23
|
+
click(): void;
|
|
24
|
+
};
|
|
25
|
+
export type BrowserVisibleElement = {
|
|
26
|
+
textContent?: string | null;
|
|
27
|
+
className?: string;
|
|
28
|
+
offsetParent?: unknown;
|
|
29
|
+
parentElement?: BrowserVisibleElement | null;
|
|
30
|
+
getAttribute(name: string): string | null;
|
|
31
|
+
click(): void;
|
|
32
|
+
};
|
|
33
|
+
export type BrowserTextVisibleElement = BrowserVisibleElement & {
|
|
34
|
+
className?: string;
|
|
35
|
+
};
|
|
36
|
+
export type BrowserTextAreaCandidate = BrowserVisibleElement & {
|
|
37
|
+
value?: string;
|
|
38
|
+
};
|
|
39
|
+
export type BrowserInnerTextHandle = {
|
|
40
|
+
innerText(): Promise<string>;
|
|
41
|
+
};
|
|
42
|
+
export type BrowserDocumentContext = {
|
|
43
|
+
document: {
|
|
44
|
+
querySelector(selector: string): BrowserDomElement | null;
|
|
45
|
+
querySelectorAll(selector: string): Iterable<BrowserDomElement>;
|
|
46
|
+
};
|
|
47
|
+
window: {
|
|
48
|
+
innerWidth: number;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Find the first `textInput` selector that resolves to a visible textarea which
|
|
53
|
+
* is NOT the "discover sources" / "search the web" / query-box control.
|
|
54
|
+
*
|
|
55
|
+
* This is the exact, equivalent logic that both SourceManager and
|
|
56
|
+
* NotebookCreationSourceManager used (their two private copies differed only in
|
|
57
|
+
* an unused `rejected` field and the debug-log wording — callers read only the
|
|
58
|
+
* boolean match). The three exclusion substrings are kept byte-identical.
|
|
59
|
+
*
|
|
60
|
+
* @param debugLabel preserves each caller's original debug log line verbatim.
|
|
61
|
+
*/
|
|
62
|
+
export declare function findValidTextInputSelector(page: Page, debugLabel: string): Promise<string | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Set the text-source content via the direct DOM-value path only.
|
|
65
|
+
* The value is passed as a serialized page.evaluate argument (never
|
|
66
|
+
* string-interpolated). We deliberately do NOT use the OS copy/paste
|
|
67
|
+
* buffer: writing to it leaks/overwrites the host's copied data and, when
|
|
68
|
+
* the relevant browser permission is denied (common in headless), a paste
|
|
69
|
+
* keystroke would inject STALE buffered contents and corrupt the source.
|
|
70
|
+
*
|
|
71
|
+
* This is the byte-identical evaluate block both classes used. The differing
|
|
72
|
+
* focus/click step that precedes it (textArea.focus() in the legacy manager,
|
|
73
|
+
* textarea.click() in the creation manager) stays with each caller.
|
|
74
|
+
*/
|
|
75
|
+
export declare function setTextSourceValue(page: Page, selector: string, value: string): Promise<void>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source Manager — shared primitives
|
|
3
|
+
*
|
|
4
|
+
* Helpers genuinely shared between the two source managers in
|
|
5
|
+
* `source-manager.ts`:
|
|
6
|
+
* - SourceManager (legacy: list/add/remove on an existing
|
|
7
|
+
* notebook)
|
|
8
|
+
* - NotebookCreationSourceManager (the creation flow)
|
|
9
|
+
*
|
|
10
|
+
* Only logic that is byte-equivalent between the two classes lives here; the
|
|
11
|
+
* managers' distinct flows (source-type selection, submit/insert clicks, error
|
|
12
|
+
* alert handling, waitForSourceProcessing) intentionally differ and stay in
|
|
13
|
+
* place. These helpers are a pure de-duplication and are behavior-preserving.
|
|
14
|
+
*/
|
|
15
|
+
import { log } from "../utils/logger.js";
|
|
16
|
+
import { getSelectors } from "./selectors.js";
|
|
17
|
+
/**
|
|
18
|
+
* Find the first `textInput` selector that resolves to a visible textarea which
|
|
19
|
+
* is NOT the "discover sources" / "search the web" / query-box control.
|
|
20
|
+
*
|
|
21
|
+
* This is the exact, equivalent logic that both SourceManager and
|
|
22
|
+
* NotebookCreationSourceManager used (their two private copies differed only in
|
|
23
|
+
* an unused `rejected` field and the debug-log wording — callers read only the
|
|
24
|
+
* boolean match). The three exclusion substrings are kept byte-identical.
|
|
25
|
+
*
|
|
26
|
+
* @param debugLabel preserves each caller's original debug log line verbatim.
|
|
27
|
+
*/
|
|
28
|
+
export async function findValidTextInputSelector(page, debugLabel) {
|
|
29
|
+
for (const selector of getSelectors("textInput")) {
|
|
30
|
+
try {
|
|
31
|
+
const state = await page.evaluate((targetSelector) => {
|
|
32
|
+
const browser = globalThis;
|
|
33
|
+
const textarea = browser.document.querySelector(targetSelector);
|
|
34
|
+
if (!textarea || textarea.offsetParent === null) {
|
|
35
|
+
return { matches: false };
|
|
36
|
+
}
|
|
37
|
+
const aria = textarea.getAttribute("aria-label")?.toLowerCase() || "";
|
|
38
|
+
const placeholder = textarea.getAttribute("placeholder")?.toLowerCase() || "";
|
|
39
|
+
const className = textarea.className?.toLowerCase() || "";
|
|
40
|
+
const haystack = `${aria} ${placeholder} ${className}`;
|
|
41
|
+
return {
|
|
42
|
+
matches: !haystack.includes("discover sources") &&
|
|
43
|
+
!haystack.includes("search the web") &&
|
|
44
|
+
!haystack.includes("query-box"),
|
|
45
|
+
};
|
|
46
|
+
}, selector);
|
|
47
|
+
if (state.matches) {
|
|
48
|
+
return selector;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
log.debug(`${debugLabel}: ${err instanceof Error ? err.message : String(err)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Set the text-source content via the direct DOM-value path only.
|
|
59
|
+
* The value is passed as a serialized page.evaluate argument (never
|
|
60
|
+
* string-interpolated). We deliberately do NOT use the OS copy/paste
|
|
61
|
+
* buffer: writing to it leaks/overwrites the host's copied data and, when
|
|
62
|
+
* the relevant browser permission is denied (common in headless), a paste
|
|
63
|
+
* keystroke would inject STALE buffered contents and corrupt the source.
|
|
64
|
+
*
|
|
65
|
+
* This is the byte-identical evaluate block both classes used. The differing
|
|
66
|
+
* focus/click step that precedes it (textArea.focus() in the legacy manager,
|
|
67
|
+
* textarea.click() in the creation manager) stays with each caller.
|
|
68
|
+
*/
|
|
69
|
+
export async function setTextSourceValue(page, selector, value) {
|
|
70
|
+
await page.evaluate(({ selector, value }) => {
|
|
71
|
+
const browser = globalThis;
|
|
72
|
+
const textarea = browser.document.querySelector(selector);
|
|
73
|
+
if (!textarea)
|
|
74
|
+
return false;
|
|
75
|
+
textarea.focus();
|
|
76
|
+
if (typeof textarea.value === "string") {
|
|
77
|
+
textarea.value = value;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
textarea.textContent = value;
|
|
81
|
+
}
|
|
82
|
+
textarea.dispatchEvent(new browser.Event("input", { bubbles: true }));
|
|
83
|
+
textarea.dispatchEvent(new browser.Event("change", { bubbles: true }));
|
|
84
|
+
return true;
|
|
85
|
+
}, { selector, value });
|
|
86
|
+
}
|
|
@@ -32,7 +32,22 @@ export declare class SourceManager {
|
|
|
32
32
|
private authManager;
|
|
33
33
|
private contextManager;
|
|
34
34
|
private page;
|
|
35
|
+
private opChain;
|
|
35
36
|
constructor(authManager: AuthManager, contextManager: SharedContextManager);
|
|
37
|
+
/**
|
|
38
|
+
* Serialize a public operation onto the op chain so concurrent invocations do
|
|
39
|
+
* not race on the shared this.page field. Failures of one operation must not
|
|
40
|
+
* poison the chain for the next, so the chain link always resolves.
|
|
41
|
+
*/
|
|
42
|
+
private runExclusive;
|
|
43
|
+
/**
|
|
44
|
+
* Derive a STABLE source id from a DOM identity attribute when available,
|
|
45
|
+
* otherwise from a hash of the (title, occurrence) pair. Hashing the title
|
|
46
|
+
* gives an id that denotes the same source across sessions far better than a
|
|
47
|
+
* raw enumeration index, while staying opaque/stable for the removeSource
|
|
48
|
+
* contract. Occurrence disambiguates equal-titled rows within one listing.
|
|
49
|
+
*/
|
|
50
|
+
private deriveSourceId;
|
|
36
51
|
/**
|
|
37
52
|
* Navigate to a notebook and ensure we're on the right page
|
|
38
53
|
*/
|
|
@@ -41,14 +56,17 @@ export declare class SourceManager {
|
|
|
41
56
|
* List all sources in a notebook
|
|
42
57
|
*/
|
|
43
58
|
listSources(notebookUrl: string): Promise<ListSourcesResult>;
|
|
59
|
+
private listSourcesInternal;
|
|
44
60
|
/**
|
|
45
61
|
* Add a source to an existing notebook
|
|
46
62
|
*/
|
|
47
63
|
addSource(notebookUrl: string, source: NotebookSource): Promise<AddSourceResult>;
|
|
64
|
+
private addSourceInternal;
|
|
48
65
|
/**
|
|
49
66
|
* Remove a source from a notebook
|
|
50
67
|
*/
|
|
51
68
|
removeSource(notebookUrl: string, sourceId: string): Promise<RemoveSourceResult>;
|
|
69
|
+
private removeSourceInternal;
|
|
52
70
|
/**
|
|
53
71
|
* Internal: Add URL source
|
|
54
72
|
*/
|
|
@@ -65,9 +83,19 @@ export declare class SourceManager {
|
|
|
65
83
|
*/
|
|
66
84
|
private addFileSourceInternal;
|
|
67
85
|
/**
|
|
68
|
-
* Wait for source processing to complete
|
|
86
|
+
* Wait for source processing to complete.
|
|
87
|
+
*
|
|
88
|
+
* Returns an honest status:
|
|
89
|
+
* - "failed" — an error alert/toast appeared
|
|
90
|
+
* - "ready" — the processing indicator cleared (positive completion)
|
|
91
|
+
* - "processing" — we timed out before any conclusion (do NOT report "ready")
|
|
69
92
|
*/
|
|
70
93
|
private waitForSourceProcessing;
|
|
94
|
+
/**
|
|
95
|
+
* Detect an error alert/toast for a source. Returns the error text if found,
|
|
96
|
+
* otherwise null. Mirrors NotebookCreationSourceManager.throwIfSourceErrorAlert.
|
|
97
|
+
*/
|
|
98
|
+
private detectSourceErrorAlert;
|
|
71
99
|
/**
|
|
72
100
|
* Close the page if open
|
|
73
101
|
*/
|
|
@@ -96,4 +124,3 @@ export declare class NotebookCreationSourceManager {
|
|
|
96
124
|
private waitForSourceProcessing;
|
|
97
125
|
private throwIfSourceErrorAlert;
|
|
98
126
|
}
|
|
99
|
-
//# sourceMappingURL=source-manager.d.ts.map
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio Manager Base
|
|
3
|
+
*
|
|
4
|
+
* Shared page-lifecycle plumbing for the NotebookLM "Studio" managers
|
|
5
|
+
* (audio, video, data table). These managers all open a notebook page,
|
|
6
|
+
* validate authentication, drive a Studio-panel artifact flow, then close
|
|
7
|
+
* the page. The navigation and teardown logic is identical across them and
|
|
8
|
+
* lives here; the artifact-specific flows stay in each subclass.
|
|
9
|
+
*
|
|
10
|
+
* Behavior is preserved exactly:
|
|
11
|
+
* - navigateToNotebook: getOrCreateContext → validateWithRetry (throws
|
|
12
|
+
* "Not authenticated. Run setup_auth first." when false) → newPage →
|
|
13
|
+
* goto(domcontentloaded) → waitForLoadState("networkidle") (errors
|
|
14
|
+
* swallowed) → per-subclass randomDelay → return page.
|
|
15
|
+
* - closePage: close the page, swallowing errors, then null the handle.
|
|
16
|
+
*
|
|
17
|
+
* Per-subclass differences are expressed as protected properties so that no
|
|
18
|
+
* call site needs to thread arguments:
|
|
19
|
+
* - navigateDelay: video & data table use 2000–3000ms, audio uses 1500–2500ms.
|
|
20
|
+
* - logName: the log-prefix used in the swallowed close-error debug line.
|
|
21
|
+
*/
|
|
22
|
+
import type { Page } from "patchright";
|
|
23
|
+
import { AuthManager } from "../auth/auth-manager.js";
|
|
24
|
+
import { SharedContextManager } from "../session/shared-context-manager.js";
|
|
25
|
+
/** Opaque DOM element handle used only in `as`-casts inside page.evaluate bodies. */
|
|
26
|
+
export type BrowserDomElement = unknown;
|
|
27
|
+
/** Minimal `document` shape used inside page.evaluate bodies. Common to all managers. */
|
|
28
|
+
export interface BrowserDocumentContext {
|
|
29
|
+
document: {
|
|
30
|
+
querySelector(selector: string): BrowserDomElement | null;
|
|
31
|
+
querySelectorAll(selector: string): Iterable<BrowserDomElement>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare abstract class StudioManagerBase {
|
|
35
|
+
protected authManager: AuthManager;
|
|
36
|
+
protected contextManager: SharedContextManager;
|
|
37
|
+
protected page: Page | null;
|
|
38
|
+
/**
|
|
39
|
+
* Trailing delay applied after navigation settles. Video & data table use the
|
|
40
|
+
* default (2000–3000ms); audio overrides to 1500–2500ms.
|
|
41
|
+
*/
|
|
42
|
+
protected readonly navigateDelay: {
|
|
43
|
+
min: number;
|
|
44
|
+
max: number;
|
|
45
|
+
};
|
|
46
|
+
/** Log prefix used in the swallowed close-error debug line (kept per-manager). */
|
|
47
|
+
protected abstract readonly logName: string;
|
|
48
|
+
constructor(authManager: AuthManager, contextManager: SharedContextManager);
|
|
49
|
+
/**
|
|
50
|
+
* Navigate to a notebook and ensure we're on the right page
|
|
51
|
+
*/
|
|
52
|
+
protected navigateToNotebook(notebookUrl: string): Promise<Page>;
|
|
53
|
+
/**
|
|
54
|
+
* Close the page if open
|
|
55
|
+
*/
|
|
56
|
+
protected closePage(): Promise<void>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio Manager Base
|
|
3
|
+
*
|
|
4
|
+
* Shared page-lifecycle plumbing for the NotebookLM "Studio" managers
|
|
5
|
+
* (audio, video, data table). These managers all open a notebook page,
|
|
6
|
+
* validate authentication, drive a Studio-panel artifact flow, then close
|
|
7
|
+
* the page. The navigation and teardown logic is identical across them and
|
|
8
|
+
* lives here; the artifact-specific flows stay in each subclass.
|
|
9
|
+
*
|
|
10
|
+
* Behavior is preserved exactly:
|
|
11
|
+
* - navigateToNotebook: getOrCreateContext → validateWithRetry (throws
|
|
12
|
+
* "Not authenticated. Run setup_auth first." when false) → newPage →
|
|
13
|
+
* goto(domcontentloaded) → waitForLoadState("networkidle") (errors
|
|
14
|
+
* swallowed) → per-subclass randomDelay → return page.
|
|
15
|
+
* - closePage: close the page, swallowing errors, then null the handle.
|
|
16
|
+
*
|
|
17
|
+
* Per-subclass differences are expressed as protected properties so that no
|
|
18
|
+
* call site needs to thread arguments:
|
|
19
|
+
* - navigateDelay: video & data table use 2000–3000ms, audio uses 1500–2500ms.
|
|
20
|
+
* - logName: the log-prefix used in the swallowed close-error debug line.
|
|
21
|
+
*/
|
|
22
|
+
import { log } from "../utils/logger.js";
|
|
23
|
+
import { randomDelay } from "../utils/stealth-utils.js";
|
|
24
|
+
export class StudioManagerBase {
|
|
25
|
+
authManager;
|
|
26
|
+
contextManager;
|
|
27
|
+
page = null;
|
|
28
|
+
/**
|
|
29
|
+
* Trailing delay applied after navigation settles. Video & data table use the
|
|
30
|
+
* default (2000–3000ms); audio overrides to 1500–2500ms.
|
|
31
|
+
*/
|
|
32
|
+
navigateDelay = { min: 2000, max: 3000 };
|
|
33
|
+
constructor(authManager, contextManager) {
|
|
34
|
+
this.authManager = authManager;
|
|
35
|
+
this.contextManager = contextManager;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Navigate to a notebook and ensure we're on the right page
|
|
39
|
+
*/
|
|
40
|
+
async navigateToNotebook(notebookUrl) {
|
|
41
|
+
const context = await this.contextManager.getOrCreateContext();
|
|
42
|
+
const isAuth = await this.authManager.validateWithRetry(context);
|
|
43
|
+
if (!isAuth) {
|
|
44
|
+
throw new Error("Not authenticated. Run setup_auth first.");
|
|
45
|
+
}
|
|
46
|
+
this.page = await context.newPage();
|
|
47
|
+
await this.page.goto(notebookUrl, { waitUntil: "domcontentloaded" });
|
|
48
|
+
await this.page.waitForLoadState("networkidle").catch(() => { });
|
|
49
|
+
await randomDelay(this.navigateDelay.min, this.navigateDelay.max);
|
|
50
|
+
return this.page;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Close the page if open
|
|
54
|
+
*/
|
|
55
|
+
async closePage() {
|
|
56
|
+
if (this.page) {
|
|
57
|
+
try {
|
|
58
|
+
await this.page.close();
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
log.debug(`${this.logName}: closing page: ${err instanceof Error ? err.message : String(err)}`);
|
|
62
|
+
// Ignore close errors
|
|
63
|
+
}
|
|
64
|
+
this.page = null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* - Artifacts appear in .artifact-library-container with .artifact-item-button
|
|
15
15
|
* - Generating state: .shimmer-blue class + .rotate icon + "Generating" title
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
18
|
-
import { SharedContextManager } from "../session/shared-context-manager.js";
|
|
17
|
+
import { StudioManagerBase } from "./studio-manager-base.js";
|
|
19
18
|
/**
|
|
20
19
|
* Visual styles for video overviews (matches actual NotebookLM UI)
|
|
21
20
|
*/
|
|
@@ -34,15 +33,8 @@ export interface GenerateVideoResult {
|
|
|
34
33
|
status: VideoStatus;
|
|
35
34
|
error?: string;
|
|
36
35
|
}
|
|
37
|
-
export declare class VideoManager {
|
|
38
|
-
|
|
39
|
-
private contextManager;
|
|
40
|
-
private page;
|
|
41
|
-
constructor(authManager: AuthManager, contextManager: SharedContextManager);
|
|
42
|
-
/**
|
|
43
|
-
* Navigate to a notebook and ensure we're on the right page
|
|
44
|
-
*/
|
|
45
|
-
private navigateToNotebook;
|
|
36
|
+
export declare class VideoManager extends StudioManagerBase {
|
|
37
|
+
protected readonly logName = "video-manager";
|
|
46
38
|
/**
|
|
47
39
|
* Ensure the Studio panel is visible (expand if collapsed).
|
|
48
40
|
*
|
|
@@ -93,9 +85,4 @@ export declare class VideoManager {
|
|
|
93
85
|
* Check the current video status for a notebook
|
|
94
86
|
*/
|
|
95
87
|
getVideoStatus(notebookUrl: string): Promise<VideoStatus>;
|
|
96
|
-
/**
|
|
97
|
-
* Close the page if open
|
|
98
|
-
*/
|
|
99
|
-
private closePage;
|
|
100
88
|
}
|
|
101
|
-
//# sourceMappingURL=video-manager.d.ts.map
|
|
@@ -16,29 +16,32 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { log } from "../utils/logger.js";
|
|
18
18
|
import { randomDelay } from "../utils/stealth-utils.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
import { StudioManagerBase, } from "./studio-manager-base.js";
|
|
20
|
+
/**
|
|
21
|
+
* Allowlisted style values. Single source of truth used to validate untrusted
|
|
22
|
+
* input before it is passed into the page context (prevents attribute-selector
|
|
23
|
+
* injection in selectStyle).
|
|
24
|
+
*/
|
|
25
|
+
const VALID_VIDEO_STYLES = [
|
|
26
|
+
"auto-select",
|
|
27
|
+
"custom",
|
|
28
|
+
"classic",
|
|
29
|
+
"whiteboard",
|
|
30
|
+
"kawaii",
|
|
31
|
+
"anime",
|
|
32
|
+
"watercolour",
|
|
33
|
+
"retro-print",
|
|
34
|
+
"heritage",
|
|
35
|
+
"paper-craft",
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* Allowlisted format values. Single source of truth used to validate untrusted
|
|
39
|
+
* input before it is passed into the page context (prevents attribute-selector
|
|
40
|
+
* injection in selectFormat).
|
|
41
|
+
*/
|
|
42
|
+
const VALID_VIDEO_FORMATS = ["explainer", "brief"];
|
|
43
|
+
export class VideoManager extends StudioManagerBase {
|
|
44
|
+
logName = "video-manager";
|
|
42
45
|
/**
|
|
43
46
|
* Ensure the Studio panel is visible (expand if collapsed).
|
|
44
47
|
*
|
|
@@ -117,6 +120,18 @@ export class VideoManager {
|
|
|
117
120
|
item.classList?.contains("shimmer-green")) {
|
|
118
121
|
return { status: "generating", progress: 0 };
|
|
119
122
|
}
|
|
123
|
+
// Detect an explicit failure state on THIS artifact before assuming ready.
|
|
124
|
+
// A failed generation leaves a non-shimmer artifact, which would otherwise be
|
|
125
|
+
// misreported as "ready". Scope the check to the matched item only — a page-global
|
|
126
|
+
// alert query could match unrelated UI. Class names are best-effort (unconfirmed
|
|
127
|
+
// by live inspection); [role="alert"]/error child is the locale-independent signal.
|
|
128
|
+
const hasErrorChild = !!item.querySelector('[role="alert"], .error-state, .artifact-error');
|
|
129
|
+
if (hasErrorChild ||
|
|
130
|
+
item.classList?.contains("error-state") ||
|
|
131
|
+
item.classList?.contains("artifact-error") ||
|
|
132
|
+
item.classList?.contains("failed")) {
|
|
133
|
+
return { status: "failed" };
|
|
134
|
+
}
|
|
120
135
|
// Otherwise it's ready
|
|
121
136
|
return { status: "ready" };
|
|
122
137
|
}
|
|
@@ -181,17 +196,28 @@ export class VideoManager {
|
|
|
181
196
|
* Select a video format in the dialog (Explainer or Brief)
|
|
182
197
|
*/
|
|
183
198
|
async selectFormat(page, format) {
|
|
199
|
+
// Validate against the allowlist BEFORE the value crosses into the page
|
|
200
|
+
// context. Without this, a value containing `"]` could break out of the
|
|
201
|
+
// attribute selector below (selector injection).
|
|
202
|
+
if (!VALID_VIDEO_FORMATS.includes(format)) {
|
|
203
|
+
log.warning(`video-manager: ignoring non-allowlisted format "${format}"`);
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
184
206
|
return await page.evaluate((fmt) => {
|
|
185
207
|
const browser = globalThis;
|
|
186
208
|
// Format is in mat-radio-group.tile-group
|
|
187
209
|
const radioGroup = browser.document.querySelector("mat-radio-group.tile-group");
|
|
188
210
|
if (!radioGroup)
|
|
189
211
|
return false;
|
|
190
|
-
// Primary: value attribute (locale-independent if Angular Material uses stable values)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
212
|
+
// Primary: value attribute (locale-independent if Angular Material uses stable values).
|
|
213
|
+
// Iterate radio options and compare values with === rather than building a
|
|
214
|
+
// selector from the value, so untrusted text can never alter the selector.
|
|
215
|
+
const options = Array.from(radioGroup.querySelectorAll("[value]"));
|
|
216
|
+
for (const option of options) {
|
|
217
|
+
if (option.getAttribute?.("value") === fmt) {
|
|
218
|
+
option.click();
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
195
221
|
}
|
|
196
222
|
// Fallback: text match (English only — may not work in non-English locales,
|
|
197
223
|
// but selectFormat is best-effort; generation will use default format if this fails)
|
|
@@ -210,17 +236,28 @@ export class VideoManager {
|
|
|
210
236
|
* Select a video style in the dialog carousel
|
|
211
237
|
*/
|
|
212
238
|
async selectStyle(page, style) {
|
|
239
|
+
// Validate against the allowlist BEFORE the value crosses into the page
|
|
240
|
+
// context. Without this, a value containing `"]` could break out of the
|
|
241
|
+
// attribute selector below (selector injection).
|
|
242
|
+
if (!VALID_VIDEO_STYLES.includes(style)) {
|
|
243
|
+
log.warning(`video-manager: ignoring non-allowlisted style "${style}"`);
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
213
246
|
return await page.evaluate((styleName) => {
|
|
214
247
|
const browser = globalThis;
|
|
215
248
|
// Style is in mat-radio-group.carousel-group
|
|
216
249
|
const radioGroup = browser.document.querySelector("mat-radio-group.carousel-group");
|
|
217
250
|
if (!radioGroup)
|
|
218
251
|
return false;
|
|
219
|
-
// Primary: value attribute (locale-independent)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
252
|
+
// Primary: value attribute (locale-independent).
|
|
253
|
+
// Iterate radio options and compare values with === rather than building a
|
|
254
|
+
// selector from the value, so untrusted text can never alter the selector.
|
|
255
|
+
const options = Array.from(radioGroup.querySelectorAll("[value]"));
|
|
256
|
+
for (const option of options) {
|
|
257
|
+
if (option.getAttribute?.("value") === styleName) {
|
|
258
|
+
option.click();
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
224
261
|
}
|
|
225
262
|
// Fallback: text match (English only — style labels are translated in non-English UIs,
|
|
226
263
|
// but selectStyle is best-effort; generation will use default style if this fails)
|
|
@@ -243,14 +280,26 @@ export class VideoManager {
|
|
|
243
280
|
async clickDialogGenerate(page) {
|
|
244
281
|
return await page.evaluate(() => {
|
|
245
282
|
const browser = globalThis;
|
|
246
|
-
// Primary: button
|
|
283
|
+
// Primary: the primary-color action button inside mat-dialog-actions.
|
|
284
|
+
// NEVER blindly click the FIRST button — Material dialogs conventionally place
|
|
285
|
+
// Cancel/Close first and the primary action last, so clicking [0] can hit Cancel
|
|
286
|
+
// and silently abort generation. Match the primary-color class/attribute first,
|
|
287
|
+
// then fall back to the LAST enabled button within the actions container.
|
|
247
288
|
const dialogActions = browser.document.querySelector("mat-dialog-actions");
|
|
248
289
|
if (dialogActions) {
|
|
249
|
-
const
|
|
250
|
-
if (
|
|
251
|
-
|
|
290
|
+
const primaryInActions = dialogActions.querySelector('button.button-color--primary, button[color="primary"]');
|
|
291
|
+
if (primaryInActions) {
|
|
292
|
+
primaryInActions.click();
|
|
252
293
|
return true;
|
|
253
294
|
}
|
|
295
|
+
const actionButtons = Array.from(dialogActions.querySelectorAll("button"));
|
|
296
|
+
for (let i = actionButtons.length - 1; i >= 0; i--) {
|
|
297
|
+
const button = actionButtons[i];
|
|
298
|
+
if (!button.disabled) {
|
|
299
|
+
button.click();
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
254
303
|
}
|
|
255
304
|
// Fallback: button with primary color in any dialog
|
|
256
305
|
const primaryBtn = browser.document.querySelector('.dialog-actions button, button.button-color--primary');
|
|
@@ -341,6 +390,14 @@ export class VideoManager {
|
|
|
341
390
|
await randomDelay(500, 800);
|
|
342
391
|
// Check if generation started
|
|
343
392
|
const newStatus = await this.checkVideoStatusInternal(page);
|
|
393
|
+
if (newStatus.status === "failed") {
|
|
394
|
+
log.warning(" Video generation reported a failed state");
|
|
395
|
+
return {
|
|
396
|
+
success: false,
|
|
397
|
+
status: newStatus,
|
|
398
|
+
error: "Video generation failed.",
|
|
399
|
+
};
|
|
400
|
+
}
|
|
344
401
|
if (newStatus.status === "generating" || newStatus.status === "ready") {
|
|
345
402
|
log.success(` Video generation ${newStatus.status === "ready" ? "completed" : "started"}`);
|
|
346
403
|
return { success: true, status: newStatus };
|
|
@@ -372,20 +429,4 @@ export class VideoManager {
|
|
|
372
429
|
await this.closePage();
|
|
373
430
|
}
|
|
374
431
|
}
|
|
375
|
-
/**
|
|
376
|
-
* Close the page if open
|
|
377
|
-
*/
|
|
378
|
-
async closePage() {
|
|
379
|
-
if (this.page) {
|
|
380
|
-
try {
|
|
381
|
-
await this.page.close();
|
|
382
|
-
}
|
|
383
|
-
catch (err) {
|
|
384
|
-
log.debug(`video-manager: closing page: ${err instanceof Error ? err.message : String(err)}`);
|
|
385
|
-
// Ignore close errors
|
|
386
|
-
}
|
|
387
|
-
this.page = null;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
432
|
}
|
|
391
|
-
//# sourceMappingURL=video-manager.js.map
|
package/dist/quota/index.d.ts
CHANGED
package/dist/quota/index.js
CHANGED