browser-debugger-cli 0.3.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -126
- package/dist/__tests__/smoke/error-handling.smoke.test.d.ts +8 -0
- package/dist/__tests__/smoke/error-handling.smoke.test.d.ts.map +1 -0
- package/dist/__tests__/smoke/error-handling.smoke.test.js +106 -0
- package/dist/__tests__/smoke/error-handling.smoke.test.js.map +1 -0
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.d.ts +8 -0
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.d.ts.map +1 -0
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.js +109 -0
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.js.map +1 -0
- package/dist/__testutils__/commandRunner.d.ts +45 -0
- package/dist/__testutils__/commandRunner.d.ts.map +1 -0
- package/dist/__testutils__/commandRunner.js +108 -0
- package/dist/__testutils__/commandRunner.js.map +1 -0
- package/dist/__testutils__/daemonHelpers.d.ts +81 -0
- package/dist/__testutils__/daemonHelpers.d.ts.map +1 -0
- package/dist/__testutils__/daemonHelpers.js +206 -0
- package/dist/__testutils__/daemonHelpers.js.map +1 -0
- package/dist/__testutils__/index.d.ts +1 -0
- package/dist/__testutils__/index.d.ts.map +1 -1
- package/dist/__testutils__/index.js +1 -0
- package/dist/__testutils__/index.js.map +1 -1
- package/dist/__testutils__/testCleanup.d.ts +45 -0
- package/dist/__testutils__/testCleanup.d.ts.map +1 -0
- package/dist/__testutils__/testCleanup.js +87 -0
- package/dist/__testutils__/testCleanup.js.map +1 -0
- package/dist/__testutils__/testHome.d.ts +26 -0
- package/dist/__testutils__/testHome.d.ts.map +1 -0
- package/dist/__testutils__/testHome.js +57 -0
- package/dist/__testutils__/testHome.js.map +1 -0
- package/dist/__testutils__/testProcess.d.ts.map +1 -1
- package/dist/__testutils__/testProcess.js +11 -3
- package/dist/__testutils__/testProcess.js.map +1 -1
- package/dist/cli/commands/__tests__/start.unit.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/start.unit.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/start.unit.test.js +131 -0
- package/dist/cli/commands/__tests__/start.unit.test.js.map +1 -0
- package/dist/cli/commands/cleanup.d.ts +1 -0
- package/dist/cli/commands/cleanup.d.ts.map +1 -1
- package/dist/cli/commands/cleanup.js +80 -61
- package/dist/cli/commands/cleanup.js.map +1 -1
- package/dist/cli/commands/details.d.ts +2 -1
- package/dist/cli/commands/details.d.ts.map +1 -1
- package/dist/cli/commands/details.js +104 -52
- package/dist/cli/commands/details.js.map +1 -1
- package/dist/cli/commands/peek.d.ts +2 -1
- package/dist/cli/commands/peek.d.ts.map +1 -1
- package/dist/cli/commands/peek.js +22 -67
- package/dist/cli/commands/peek.js.map +1 -1
- package/dist/cli/commands/query.d.ts +9 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +125 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/start.d.ts +74 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +147 -38
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +37 -49
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/stop.d.ts +1 -0
- package/dist/cli/commands/stop.d.ts.map +1 -1
- package/dist/cli/commands/stop.js +106 -120
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/formatters/detailsFormatter.d.ts +1 -1
- package/dist/cli/formatters/previewFormatter.d.ts +7 -7
- package/dist/cli/formatters/previewFormatter.d.ts.map +1 -1
- package/dist/cli/formatters/previewFormatter.js +5 -10
- package/dist/cli/formatters/previewFormatter.js.map +1 -1
- package/dist/cli/formatters/statusFormatter.d.ts +13 -10
- package/dist/cli/formatters/statusFormatter.d.ts.map +1 -1
- package/dist/cli/formatters/statusFormatter.js +26 -53
- package/dist/cli/formatters/statusFormatter.js.map +1 -1
- package/dist/cli/handlers/ChromeBootstrap.d.ts +24 -0
- package/dist/cli/handlers/ChromeBootstrap.d.ts.map +1 -0
- package/dist/cli/handlers/ChromeBootstrap.js +50 -0
- package/dist/cli/handlers/ChromeBootstrap.js.map +1 -0
- package/dist/cli/handlers/OutputBuilder.d.ts +2 -3
- package/dist/cli/handlers/OutputBuilder.d.ts.map +1 -1
- package/dist/cli/handlers/OutputBuilder.js +2 -4
- package/dist/cli/handlers/OutputBuilder.js.map +1 -1
- package/dist/cli/handlers/OutputWriter.d.ts +15 -0
- package/dist/cli/handlers/OutputWriter.d.ts.map +1 -0
- package/dist/cli/handlers/OutputWriter.js +34 -0
- package/dist/cli/handlers/OutputWriter.js.map +1 -0
- package/dist/cli/handlers/PreviewWriter.d.ts +52 -0
- package/dist/cli/handlers/PreviewWriter.d.ts.map +1 -0
- package/dist/cli/handlers/PreviewWriter.js +118 -0
- package/dist/cli/handlers/PreviewWriter.js.map +1 -0
- package/dist/cli/handlers/SessionLock.d.ts +16 -0
- package/dist/cli/handlers/SessionLock.d.ts.map +1 -0
- package/dist/cli/handlers/SessionLock.js +35 -0
- package/dist/cli/handlers/SessionLock.js.map +1 -0
- package/dist/cli/handlers/SessionLoop.d.ts +19 -0
- package/dist/cli/handlers/SessionLoop.d.ts.map +1 -0
- package/dist/cli/handlers/SessionLoop.js +47 -0
- package/dist/cli/handlers/SessionLoop.js.map +1 -0
- package/dist/cli/handlers/ShutdownController.d.ts +41 -0
- package/dist/cli/handlers/ShutdownController.d.ts.map +1 -0
- package/dist/cli/handlers/ShutdownController.js +94 -0
- package/dist/cli/handlers/ShutdownController.js.map +1 -0
- package/dist/cli/handlers/SignalHandler.d.ts +35 -0
- package/dist/cli/handlers/SignalHandler.d.ts.map +1 -0
- package/dist/cli/handlers/SignalHandler.js +81 -0
- package/dist/cli/handlers/SignalHandler.js.map +1 -0
- package/dist/cli/handlers/TargetSetup.d.ts +42 -0
- package/dist/cli/handlers/TargetSetup.d.ts.map +1 -0
- package/dist/cli/handlers/TargetSetup.js +87 -0
- package/dist/cli/handlers/TargetSetup.js.map +1 -0
- package/dist/cli/handlers/sessionController.d.ts +41 -0
- package/dist/cli/handlers/sessionController.d.ts.map +1 -1
- package/dist/cli/handlers/sessionController.js +266 -5
- package/dist/cli/handlers/sessionController.js.map +1 -1
- package/dist/cli/registry.d.ts +2 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/registry.js +12 -37
- package/dist/cli/registry.js.map +1 -1
- package/dist/collectors/console.d.ts +1 -1
- package/dist/collectors/console.js +2 -2
- package/dist/collectors/console.js.map +1 -1
- package/dist/collectors/dom.d.ts +1 -1
- package/dist/collectors/network.d.ts +1 -2
- package/dist/collectors/network.d.ts.map +1 -1
- package/dist/collectors/network.js +3 -3
- package/dist/collectors/network.js.map +1 -1
- package/dist/commands/cdp.js +1 -1
- package/dist/commands/cdp.js.map +1 -1
- package/dist/commands/cleanup.d.ts.map +1 -1
- package/dist/commands/cleanup.js +12 -15
- package/dist/commands/cleanup.js.map +1 -1
- package/dist/commands/dom.d.ts.map +1 -1
- package/dist/commands/dom.js +13 -19
- package/dist/commands/dom.js.map +1 -1
- package/dist/commands/domEvalHelpers.d.ts +1 -1
- package/dist/commands/domEvalHelpers.d.ts.map +1 -1
- package/dist/commands/domEvalHelpers.js +56 -7
- package/dist/commands/domEvalHelpers.js.map +1 -1
- package/dist/commands/domOptionsBuilder.d.ts +32 -0
- package/dist/commands/domOptionsBuilder.d.ts.map +1 -1
- package/dist/commands/domOptionsBuilder.js +35 -0
- package/dist/commands/domOptionsBuilder.js.map +1 -1
- package/dist/commands/machineReadableHelp.d.ts +98 -0
- package/dist/commands/machineReadableHelp.d.ts.map +1 -0
- package/dist/commands/machineReadableHelp.js +137 -0
- package/dist/commands/machineReadableHelp.js.map +1 -0
- package/dist/commands/shared/CommandRunner.d.ts.map +1 -1
- package/dist/commands/shared/CommandRunner.js +2 -3
- package/dist/commands/shared/CommandRunner.js.map +1 -1
- package/dist/commands/shared/OutputBuilder.js +1 -1
- package/dist/commands/shared/OutputBuilder.js.map +1 -1
- package/dist/commands/shared/commonOptions.d.ts.map +1 -1
- package/dist/commands/shared/commonOptions.js +9 -3
- package/dist/commands/shared/commonOptions.js.map +1 -1
- package/dist/commands/shared/daemonSessionController.d.ts +2 -0
- package/dist/commands/shared/daemonSessionController.d.ts.map +1 -1
- package/dist/commands/shared/daemonSessionController.js +13 -16
- package/dist/commands/shared/daemonSessionController.js.map +1 -1
- package/dist/commands/shared/sessionController.js +1 -1
- package/dist/commands/shared/sessionController.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +16 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +72 -55
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/stop.d.ts.map +1 -1
- package/dist/commands/stop.js +11 -25
- package/dist/commands/stop.js.map +1 -1
- package/dist/commands/tail.d.ts +11 -0
- package/dist/commands/tail.d.ts.map +1 -0
- package/dist/commands/tail.js +114 -0
- package/dist/commands/tail.js.map +1 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +2 -0
- package/dist/commands.js.map +1 -1
- package/dist/connection/cdp.d.ts +46 -2
- package/dist/connection/cdp.d.ts.map +1 -1
- package/dist/connection/cdp.js +71 -5
- package/dist/connection/cdp.js.map +1 -1
- package/dist/connection/diagnostics.d.ts +16 -0
- package/dist/connection/diagnostics.d.ts.map +1 -0
- package/dist/connection/diagnostics.js +37 -0
- package/dist/connection/diagnostics.js.map +1 -0
- package/dist/connection/errors.d.ts +74 -0
- package/dist/connection/errors.d.ts.map +1 -0
- package/dist/connection/errors.js +83 -0
- package/dist/connection/errors.js.map +1 -0
- package/dist/connection/handlers.d.ts +31 -0
- package/dist/connection/handlers.d.ts.map +1 -0
- package/dist/connection/handlers.js +38 -0
- package/dist/connection/handlers.js.map +1 -0
- package/dist/connection/launcher.d.ts +3 -20
- package/dist/connection/launcher.d.ts.map +1 -1
- package/dist/connection/launcher.js +130 -32
- package/dist/connection/launcher.js.map +1 -1
- package/dist/connection/pageReadiness.d.ts +46 -0
- package/dist/connection/pageReadiness.d.ts.map +1 -0
- package/dist/connection/pageReadiness.js +270 -0
- package/dist/connection/pageReadiness.js.map +1 -0
- package/dist/connection/tabs.d.ts +52 -0
- package/dist/connection/tabs.d.ts.map +1 -0
- package/dist/connection/tabs.js +227 -0
- package/dist/connection/tabs.js.map +1 -0
- package/dist/constants.d.ts +20 -40
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +26 -40
- package/dist/constants.js.map +1 -1
- package/dist/daemon/ipcServer.d.ts +5 -7
- package/dist/daemon/ipcServer.d.ts.map +1 -1
- package/dist/daemon/ipcServer.js +178 -143
- package/dist/daemon/ipcServer.js.map +1 -1
- package/dist/daemon/launcher.js +1 -1
- package/dist/daemon/launcher.js.map +1 -1
- package/dist/daemon/server/SocketServer.d.ts +22 -0
- package/dist/daemon/server/SocketServer.d.ts.map +1 -0
- package/dist/daemon/server/SocketServer.js +67 -0
- package/dist/daemon/server/SocketServer.js.map +1 -0
- package/dist/daemon/server/WorkerManager.d.ts +36 -0
- package/dist/daemon/server/WorkerManager.d.ts.map +1 -0
- package/dist/daemon/server/WorkerManager.js +98 -0
- package/dist/daemon/server/WorkerManager.js.map +1 -0
- package/dist/daemon/startSession.d.ts +2 -0
- package/dist/daemon/startSession.d.ts.map +1 -1
- package/dist/daemon/startSession.js +4 -2
- package/dist/daemon/startSession.js.map +1 -1
- package/dist/daemon/worker/TelemetryStore.d.ts +18 -0
- package/dist/daemon/worker/TelemetryStore.d.ts.map +1 -0
- package/dist/daemon/worker/TelemetryStore.js +49 -0
- package/dist/daemon/worker/TelemetryStore.js.map +1 -0
- package/dist/daemon/worker/collectors.d.ts +8 -0
- package/dist/daemon/worker/collectors.d.ts.map +1 -0
- package/dist/daemon/worker/collectors.js +19 -0
- package/dist/daemon/worker/collectors.js.map +1 -0
- package/dist/daemon/worker/commandRegistry.d.ts +10 -0
- package/dist/daemon/worker/commandRegistry.d.ts.map +1 -0
- package/dist/daemon/worker/commandRegistry.js +289 -0
- package/dist/daemon/worker/commandRegistry.js.map +1 -0
- package/dist/daemon/worker/plugins.d.ts +21 -0
- package/dist/daemon/worker/plugins.d.ts.map +1 -0
- package/dist/daemon/worker/plugins.js +71 -0
- package/dist/daemon/worker/plugins.js.map +1 -0
- package/dist/daemon/worker/types.d.ts +13 -0
- package/dist/daemon/worker/types.d.ts.map +1 -0
- package/dist/daemon/worker/types.js +2 -0
- package/dist/daemon/worker/types.js.map +1 -0
- package/dist/daemon/worker.js +206 -529
- package/dist/daemon/worker.js.map +1 -1
- package/dist/help/machineReadableHelp.d.ts +100 -0
- package/dist/help/machineReadableHelp.d.ts.map +1 -0
- package/dist/help/machineReadableHelp.js +139 -0
- package/dist/help/machineReadableHelp.js.map +1 -0
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/ipc/__tests__/client.contract.test.js +2 -2
- package/dist/ipc/__tests__/client.contract.test.js.map +1 -1
- package/dist/ipc/client.d.ts +3 -1
- package/dist/ipc/client.d.ts.map +1 -1
- package/dist/ipc/client.js +27 -14
- package/dist/ipc/client.js.map +1 -1
- package/dist/ipc/commands.d.ts +1 -0
- package/dist/ipc/commands.d.ts.map +1 -1
- package/dist/ipc/commands.js.map +1 -1
- package/dist/ipc/types.d.ts +2 -0
- package/dist/ipc/types.d.ts.map +1 -1
- package/dist/session/BdgSession.d.ts +91 -0
- package/dist/session/BdgSession.d.ts.map +1 -0
- package/dist/session/BdgSession.js +230 -0
- package/dist/session/BdgSession.js.map +1 -0
- package/dist/session/cleanup.d.ts.map +1 -1
- package/dist/session/cleanup.js +67 -65
- package/dist/session/cleanup.js.map +1 -1
- package/dist/session/fileOps.d.ts +25 -0
- package/dist/session/fileOps.d.ts.map +1 -0
- package/dist/session/fileOps.js +39 -0
- package/dist/session/fileOps.js.map +1 -0
- package/dist/session/metadata.js +2 -2
- package/dist/session/metadata.js.map +1 -1
- package/dist/session/paths.d.ts +2 -7
- package/dist/session/paths.d.ts.map +1 -1
- package/dist/session/paths.js +8 -8
- package/dist/session/paths.js.map +1 -1
- package/dist/session/queryCache.js +1 -1
- package/dist/session/queryCache.js.map +1 -1
- package/dist/telemetry/__tests__/filters.unit.test.d.ts +2 -0
- package/dist/telemetry/__tests__/filters.unit.test.d.ts.map +1 -0
- package/dist/telemetry/__tests__/filters.unit.test.js +239 -0
- package/dist/telemetry/__tests__/filters.unit.test.js.map +1 -0
- package/dist/telemetry/console.d.ts +1 -1
- package/dist/telemetry/console.d.ts.map +1 -1
- package/dist/telemetry/console.js +5 -3
- package/dist/telemetry/console.js.map +1 -1
- package/dist/telemetry/dialogs.d.ts +27 -0
- package/dist/telemetry/dialogs.d.ts.map +1 -0
- package/dist/telemetry/dialogs.js +51 -0
- package/dist/telemetry/dialogs.js.map +1 -0
- package/dist/telemetry/filters.d.ts +148 -0
- package/dist/telemetry/filters.d.ts.map +1 -0
- package/dist/telemetry/filters.js +358 -0
- package/dist/telemetry/filters.js.map +1 -0
- package/dist/telemetry/navigation.d.ts +49 -0
- package/dist/telemetry/navigation.d.ts.map +1 -0
- package/dist/telemetry/navigation.js +69 -0
- package/dist/telemetry/navigation.js.map +1 -0
- package/dist/telemetry/network.d.ts +1 -0
- package/dist/telemetry/network.d.ts.map +1 -1
- package/dist/telemetry/network.js +23 -34
- package/dist/telemetry/network.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/errors/CommandError.d.ts +39 -0
- package/dist/ui/errors/CommandError.d.ts.map +1 -0
- package/dist/ui/errors/CommandError.js +48 -0
- package/dist/ui/errors/CommandError.js.map +1 -0
- package/dist/ui/errors/SystemErrors.d.ts +22 -0
- package/dist/ui/errors/SystemErrors.d.ts.map +1 -0
- package/dist/ui/errors/SystemErrors.js +23 -0
- package/dist/ui/errors/SystemErrors.js.map +1 -0
- package/dist/ui/errors/index.d.ts +9 -0
- package/dist/ui/errors/index.d.ts.map +1 -0
- package/dist/ui/errors/index.js +12 -0
- package/dist/ui/errors/index.js.map +1 -0
- package/dist/ui/errors/utils.d.ts +24 -0
- package/dist/ui/errors/utils.d.ts.map +1 -0
- package/dist/ui/errors/utils.js +28 -0
- package/dist/ui/errors/utils.js.map +1 -0
- package/dist/ui/formatters/status.d.ts.map +1 -1
- package/dist/ui/formatters/status.js +1 -1
- package/dist/ui/formatters/status.js.map +1 -1
- package/dist/ui/logging/index.d.ts +7 -0
- package/dist/ui/logging/index.d.ts.map +1 -0
- package/dist/ui/logging/index.js +7 -0
- package/dist/ui/logging/index.js.map +1 -0
- package/dist/ui/logging/logger.d.ts +98 -0
- package/dist/ui/logging/logger.d.ts.map +1 -0
- package/dist/ui/logging/logger.js +93 -0
- package/dist/ui/logging/logger.js.map +1 -0
- package/dist/ui/messages/chrome.d.ts +50 -1
- package/dist/ui/messages/chrome.d.ts.map +1 -1
- package/dist/ui/messages/chrome.js +77 -0
- package/dist/ui/messages/chrome.js.map +1 -1
- package/dist/ui/messages/deprecation.d.ts +30 -0
- package/dist/ui/messages/deprecation.d.ts.map +1 -0
- package/dist/ui/messages/deprecation.js +49 -0
- package/dist/ui/messages/deprecation.js.map +1 -0
- package/dist/ui/messages/preview.js +1 -1
- package/dist/ui/messages/preview.js.map +1 -1
- package/dist/ui/messages/session.d.ts.map +1 -1
- package/dist/ui/messages/session.js +21 -7
- package/dist/ui/messages/session.js.map +1 -1
- package/dist/utils/__tests__/session.contract.test.js +15 -1
- package/dist/utils/__tests__/session.contract.test.js.map +1 -1
- package/dist/utils/filters.d.ts +40 -0
- package/dist/utils/filters.d.ts.map +1 -1
- package/dist/utils/filters.js +54 -0
- package/dist/utils/filters.js.map +1 -1
- package/dist/utils/pageReadiness.js +24 -25
- package/dist/utils/pageReadiness.js.map +1 -1
- package/dist/utils/session.d.ts +200 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/dist/utils/session.js +498 -0
- package/dist/utils/session.js.map +1 -0
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +10 -0
- package/dist/utils/url.js.map +1 -1
- package/dist/utils/validation.d.ts +12 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +20 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +2 -1
- package/dist/cli/commands/__tests__/cdp.contract.test.d.ts +0 -24
- package/dist/cli/commands/__tests__/cdp.contract.test.d.ts.map +0 -1
- package/dist/cli/commands/__tests__/cdp.contract.test.js +0 -467
- package/dist/cli/commands/__tests__/cdp.contract.test.js.map +0 -1
- package/dist/cli/commands/cdp.d.ts +0 -8
- package/dist/cli/commands/cdp.d.ts.map +0 -1
- package/dist/cli/commands/cdp.js +0 -45
- package/dist/cli/commands/cdp.js.map +0 -1
- package/dist/cli/commands/console.d.ts +0 -8
- package/dist/cli/commands/console.d.ts.map +0 -1
- package/dist/cli/commands/console.js +0 -97
- package/dist/cli/commands/console.js.map +0 -1
- package/dist/cli/commands/dom/helpers/domCache.d.ts +0 -36
- package/dist/cli/commands/dom/helpers/domCache.d.ts.map +0 -1
- package/dist/cli/commands/dom/helpers/domCache.js +0 -65
- package/dist/cli/commands/dom/helpers/domCache.js.map +0 -1
- package/dist/cli/commands/dom/helpers/domQuery.d.ts +0 -48
- package/dist/cli/commands/dom/helpers/domQuery.d.ts.map +0 -1
- package/dist/cli/commands/dom/helpers/domQuery.js +0 -104
- package/dist/cli/commands/dom/helpers/domQuery.js.map +0 -1
- package/dist/cli/commands/dom/helpers/errorHandler.d.ts +0 -45
- package/dist/cli/commands/dom/helpers/errorHandler.d.ts.map +0 -1
- package/dist/cli/commands/dom/helpers/errorHandler.js +0 -71
- package/dist/cli/commands/dom/helpers/errorHandler.js.map +0 -1
- package/dist/cli/commands/dom/helpers/evalHelpers.d.ts +0 -52
- package/dist/cli/commands/dom/helpers/evalHelpers.d.ts.map +0 -1
- package/dist/cli/commands/dom/helpers/evalHelpers.js +0 -75
- package/dist/cli/commands/dom/helpers/evalHelpers.js.map +0 -1
- package/dist/cli/commands/dom/helpers/optionsBuilder.d.ts +0 -35
- package/dist/cli/commands/dom/helpers/optionsBuilder.d.ts.map +0 -1
- package/dist/cli/commands/dom/helpers/optionsBuilder.js +0 -51
- package/dist/cli/commands/dom/helpers/optionsBuilder.js.map +0 -1
- package/dist/cli/commands/dom/helpers/selectorParser.d.ts +0 -20
- package/dist/cli/commands/dom/helpers/selectorParser.d.ts.map +0 -1
- package/dist/cli/commands/dom/helpers/selectorParser.js +0 -20
- package/dist/cli/commands/dom/helpers/selectorParser.js.map +0 -1
- package/dist/cli/commands/dom/index.d.ts +0 -8
- package/dist/cli/commands/dom/index.d.ts.map +0 -1
- package/dist/cli/commands/dom/index.js +0 -257
- package/dist/cli/commands/dom/index.js.map +0 -1
- package/dist/cli/commands/dom.d.ts +0 -8
- package/dist/cli/commands/dom.d.ts.map +0 -1
- package/dist/cli/commands/dom.js +0 -257
- package/dist/cli/commands/dom.js.map +0 -1
- package/dist/cli/commands/domErrorHandler.d.ts +0 -45
- package/dist/cli/commands/domErrorHandler.d.ts.map +0 -1
- package/dist/cli/commands/domErrorHandler.js +0 -71
- package/dist/cli/commands/domErrorHandler.js.map +0 -1
- package/dist/cli/commands/domEvalHelpers.d.ts +0 -52
- package/dist/cli/commands/domEvalHelpers.d.ts.map +0 -1
- package/dist/cli/commands/domEvalHelpers.js +0 -76
- package/dist/cli/commands/domEvalHelpers.js.map +0 -1
- package/dist/cli/commands/domOptionsBuilder.d.ts +0 -35
- package/dist/cli/commands/domOptionsBuilder.d.ts.map +0 -1
- package/dist/cli/commands/domOptionsBuilder.js +0 -51
- package/dist/cli/commands/domOptionsBuilder.js.map +0 -1
- package/dist/cli/commands/domSelectorParser.d.ts +0 -20
- package/dist/cli/commands/domSelectorParser.d.ts.map +0 -1
- package/dist/cli/commands/domSelectorParser.js +0 -20
- package/dist/cli/commands/domSelectorParser.js.map +0 -1
- package/dist/cli/commands/network.d.ts +0 -8
- package/dist/cli/commands/network.d.ts.map +0 -1
- package/dist/cli/commands/network.js +0 -43
- package/dist/cli/commands/network.js.map +0 -1
- package/dist/cli/handlers/CommandRunner.d.ts +0 -60
- package/dist/cli/handlers/CommandRunner.d.ts.map +0 -1
- package/dist/cli/handlers/CommandRunner.js +0 -81
- package/dist/cli/handlers/CommandRunner.js.map +0 -1
- package/dist/cli/handlers/commonOptions.d.ts +0 -54
- package/dist/cli/handlers/commonOptions.d.ts.map +0 -1
- package/dist/cli/handlers/commonOptions.js +0 -64
- package/dist/cli/handlers/commonOptions.js.map +0 -1
- package/dist/cli/handlers/daemonSessionController.d.ts +0 -23
- package/dist/cli/handlers/daemonSessionController.d.ts.map +0 -1
- package/dist/cli/handlers/daemonSessionController.js +0 -79
- package/dist/cli/handlers/daemonSessionController.js.map +0 -1
- package/dist/cli/handlers/landingPage.d.ts +0 -8
- package/dist/cli/handlers/landingPage.d.ts.map +0 -1
- package/dist/cli/handlers/landingPage.js +0 -8
- package/dist/cli/handlers/landingPage.js.map +0 -1
- package/dist/collectors/__tests__/network.contract.test.d.ts +0 -28
- package/dist/collectors/__tests__/network.contract.test.d.ts.map +0 -1
- package/dist/collectors/__tests__/network.contract.test.js +0 -540
- package/dist/collectors/__tests__/network.contract.test.js.map +0 -1
- package/dist/commandRegistry.d.ts +0 -11
- package/dist/commandRegistry.d.ts.map +0 -1
- package/dist/commandRegistry.js +0 -45
- package/dist/commandRegistry.js.map +0 -1
- package/dist/commands/domErrorHandler.d.ts +0 -45
- package/dist/commands/domErrorHandler.d.ts.map +0 -1
- package/dist/commands/domErrorHandler.js +0 -71
- package/dist/commands/domErrorHandler.js.map +0 -1
- package/dist/dom/cache.d.ts +0 -36
- package/dist/dom/cache.d.ts.map +0 -1
- package/dist/dom/cache.js +0 -65
- package/dist/dom/cache.js.map +0 -1
- package/dist/dom/index.d.ts +0 -9
- package/dist/dom/index.d.ts.map +0 -1
- package/dist/dom/index.js +0 -9
- package/dist/dom/index.js.map +0 -1
- package/dist/dom/query.d.ts +0 -48
- package/dist/dom/query.d.ts.map +0 -1
- package/dist/dom/query.js +0 -104
- package/dist/dom/query.js.map +0 -1
- package/dist/utils/formatters/network.d.ts +0 -23
- package/dist/utils/formatters/network.d.ts.map +0 -1
- package/dist/utils/formatters/network.js +0 -35
- package/dist/utils/formatters/network.js.map +0 -1
- package/dist/utils/ui.d.ts +0 -36
- package/dist/utils/ui.d.ts.map +0 -1
- package/dist/utils/ui.js +0 -47
- package/dist/utils/ui.js.map +0 -1
- package/dist/utils/url/safeParseUrl.d.ts +0 -63
- package/dist/utils/url/safeParseUrl.d.ts.map +0 -1
- package/dist/utils/url/safeParseUrl.js +0 -84
- package/dist/utils/url/safeParseUrl.js.map +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handle command errors with consistent formatting
|
|
3
|
-
*
|
|
4
|
-
* Outputs error message in JSON or human-readable format and exits with error code.
|
|
5
|
-
* This function never returns - it always calls process.exit().
|
|
6
|
-
*
|
|
7
|
-
* @param error - Error object or message
|
|
8
|
-
* @param json - Whether to output JSON format
|
|
9
|
-
* @param exitCode - Exit code to use (defaults to UNHANDLED_EXCEPTION)
|
|
10
|
-
* @throws never This function always exits the process
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* try {
|
|
15
|
-
* await someOperation();
|
|
16
|
-
* } catch (error) {
|
|
17
|
-
* handleCommandError(error, options.json);
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function handleCommandError(error: unknown, json: boolean, exitCode?: number): never;
|
|
22
|
-
/**
|
|
23
|
-
* Handle command errors with additional context
|
|
24
|
-
*
|
|
25
|
-
* Similar to handleCommandError but allows adding suggestion or note metadata
|
|
26
|
-
* to JSON error output for better user guidance.
|
|
27
|
-
*
|
|
28
|
-
* @param error - Error object or message
|
|
29
|
-
* @param json - Whether to output JSON format
|
|
30
|
-
* @param metadata - Additional context (suggestion, note, etc.)
|
|
31
|
-
* @param exitCode - Exit code to use (defaults to UNHANDLED_EXCEPTION)
|
|
32
|
-
* @throws never This function always exits the process
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* handleCommandErrorWithContext(
|
|
37
|
-
* 'Session not found',
|
|
38
|
-
* options.json,
|
|
39
|
-
* { suggestion: 'Start a session with: bdg <url>' },
|
|
40
|
-
* EXIT_CODES.RESOURCE_NOT_FOUND
|
|
41
|
-
* );
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function handleCommandErrorWithContext(error: unknown, json: boolean, metadata: Record<string, string>, exitCode?: number): never;
|
|
45
|
-
//# sourceMappingURL=domErrorHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"domErrorHandler.d.ts","sourceRoot":"","sources":["../../src/commands/domErrorHandler.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,OAAO,EACb,QAAQ,GAAE,MAAuC,GAChD,KAAK,CAQP;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,QAAQ,GAAE,MAAuC,GAChD,KAAK,CAYP"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { OutputBuilder } from '../commands/shared/OutputBuilder.js';
|
|
2
|
-
import { genericError } from '../ui/messages/errors.js';
|
|
3
|
-
import { getErrorMessage } from '../utils/errors.js';
|
|
4
|
-
import { EXIT_CODES } from '../utils/exitCodes.js';
|
|
5
|
-
/**
|
|
6
|
-
* Handle command errors with consistent formatting
|
|
7
|
-
*
|
|
8
|
-
* Outputs error message in JSON or human-readable format and exits with error code.
|
|
9
|
-
* This function never returns - it always calls process.exit().
|
|
10
|
-
*
|
|
11
|
-
* @param error - Error object or message
|
|
12
|
-
* @param json - Whether to output JSON format
|
|
13
|
-
* @param exitCode - Exit code to use (defaults to UNHANDLED_EXCEPTION)
|
|
14
|
-
* @throws never This function always exits the process
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* try {
|
|
19
|
-
* await someOperation();
|
|
20
|
-
* } catch (error) {
|
|
21
|
-
* handleCommandError(error, options.json);
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export function handleCommandError(error, json, exitCode = EXIT_CODES.UNHANDLED_EXCEPTION) {
|
|
26
|
-
const errorMsg = getErrorMessage(error);
|
|
27
|
-
if (json) {
|
|
28
|
-
console.log(JSON.stringify(OutputBuilder.buildJsonError(errorMsg), null, 2));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
console.error(genericError(errorMsg));
|
|
32
|
-
}
|
|
33
|
-
process.exit(exitCode);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Handle command errors with additional context
|
|
37
|
-
*
|
|
38
|
-
* Similar to handleCommandError but allows adding suggestion or note metadata
|
|
39
|
-
* to JSON error output for better user guidance.
|
|
40
|
-
*
|
|
41
|
-
* @param error - Error object or message
|
|
42
|
-
* @param json - Whether to output JSON format
|
|
43
|
-
* @param metadata - Additional context (suggestion, note, etc.)
|
|
44
|
-
* @param exitCode - Exit code to use (defaults to UNHANDLED_EXCEPTION)
|
|
45
|
-
* @throws never This function always exits the process
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* handleCommandErrorWithContext(
|
|
50
|
-
* 'Session not found',
|
|
51
|
-
* options.json,
|
|
52
|
-
* { suggestion: 'Start a session with: bdg <url>' },
|
|
53
|
-
* EXIT_CODES.RESOURCE_NOT_FOUND
|
|
54
|
-
* );
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export function handleCommandErrorWithContext(error, json, metadata, exitCode = EXIT_CODES.UNHANDLED_EXCEPTION) {
|
|
58
|
-
const errorMsg = getErrorMessage(error);
|
|
59
|
-
if (json) {
|
|
60
|
-
console.log(JSON.stringify(OutputBuilder.buildJsonError(errorMsg, metadata), null, 2));
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
console.error(genericError(errorMsg));
|
|
64
|
-
// Output metadata as additional help text
|
|
65
|
-
for (const value of Object.values(metadata)) {
|
|
66
|
-
console.error(`${value}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
process.exit(exitCode);
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=domErrorHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"domErrorHandler.js","sourceRoot":"","sources":["../../src/commands/domErrorHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,IAAa,EACb,WAAmB,UAAU,CAAC,mBAAmB;IAEjD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,6BAA6B,CAC3C,KAAc,EACd,IAAa,EACb,QAAgC,EAChC,WAAmB,UAAU,CAAC,mBAAmB;IAEjD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtC,0CAA0C;QAC1C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC"}
|
package/dist/dom/cache.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DOM query cache structure
|
|
3
|
-
* Stores results from last DOM query for index-based lookups
|
|
4
|
-
*/
|
|
5
|
-
export interface DomQueryCache {
|
|
6
|
-
selector: string;
|
|
7
|
-
timestamp: string;
|
|
8
|
-
sessionId?: string;
|
|
9
|
-
nodes: Array<{
|
|
10
|
-
index: number;
|
|
11
|
-
nodeId: number;
|
|
12
|
-
tag?: string;
|
|
13
|
-
classes?: string[];
|
|
14
|
-
preview?: string;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Write DOM query results to cache
|
|
19
|
-
*
|
|
20
|
-
* @param cache - DOM query cache data to write
|
|
21
|
-
*/
|
|
22
|
-
export declare function writeQueryCache(cache: DomQueryCache): void;
|
|
23
|
-
/**
|
|
24
|
-
* Read DOM query cache
|
|
25
|
-
*
|
|
26
|
-
* @returns DOM query cache or null if not available/expired
|
|
27
|
-
*/
|
|
28
|
-
export declare function readQueryCache(): DomQueryCache | null;
|
|
29
|
-
/**
|
|
30
|
-
* Get nodeId from cache by index
|
|
31
|
-
*
|
|
32
|
-
* @param index - Index from query results (1-based)
|
|
33
|
-
* @returns nodeId if found, null otherwise
|
|
34
|
-
*/
|
|
35
|
-
export declare function getNodeIdByIndex(index: number): number | null;
|
|
36
|
-
//# sourceMappingURL=cache.d.ts.map
|
package/dist/dom/cache.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/dom/cache.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;CACJ;AAOD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAQ1D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,aAAa,GAAG,IAAI,CA0BrD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ7D"}
|
package/dist/dom/cache.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import { getDomQueryCachePath } from '../session/paths.js';
|
|
3
|
-
import { getErrorMessage } from '../utils/errors.js';
|
|
4
|
-
/**
|
|
5
|
-
* Cache expiration time (5 minutes)
|
|
6
|
-
*/
|
|
7
|
-
const CACHE_EXPIRY_MS = 5 * 60 * 1000;
|
|
8
|
-
/**
|
|
9
|
-
* Write DOM query results to cache
|
|
10
|
-
*
|
|
11
|
-
* @param cache - DOM query cache data to write
|
|
12
|
-
*/
|
|
13
|
-
export function writeQueryCache(cache) {
|
|
14
|
-
try {
|
|
15
|
-
const cachePath = getDomQueryCachePath();
|
|
16
|
-
fs.writeFileSync(cachePath, JSON.stringify(cache, null, 2), 'utf8');
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
// Silently fail - cache is optional and non-critical for CLI operation
|
|
20
|
-
console.error(`Warning: Failed to write DOM cache: ${getErrorMessage(error)}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Read DOM query cache
|
|
25
|
-
*
|
|
26
|
-
* @returns DOM query cache or null if not available/expired
|
|
27
|
-
*/
|
|
28
|
-
export function readQueryCache() {
|
|
29
|
-
try {
|
|
30
|
-
const cachePath = getDomQueryCachePath();
|
|
31
|
-
if (!fs.existsSync(cachePath)) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const data = fs.readFileSync(cachePath, 'utf8');
|
|
35
|
-
const cache = JSON.parse(data);
|
|
36
|
-
// Check if cache is expired
|
|
37
|
-
const cacheTime = new Date(cache.timestamp).getTime();
|
|
38
|
-
const now = Date.now();
|
|
39
|
-
if (now - cacheTime > CACHE_EXPIRY_MS) {
|
|
40
|
-
// Cache expired - delete it
|
|
41
|
-
fs.unlinkSync(cachePath);
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
return cache;
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
// Silently fail - cache is optional, missing/corrupt cache doesn't affect core functionality
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get nodeId from cache by index
|
|
53
|
-
*
|
|
54
|
-
* @param index - Index from query results (1-based)
|
|
55
|
-
* @returns nodeId if found, null otherwise
|
|
56
|
-
*/
|
|
57
|
-
export function getNodeIdByIndex(index) {
|
|
58
|
-
const cache = readQueryCache();
|
|
59
|
-
if (!cache) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
const node = cache.nodes.find((n) => n.index === index);
|
|
63
|
-
return node?.nodeId ?? null;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=cache.js.map
|
package/dist/dom/cache.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/dom/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAmBpD;;GAEG;AACH,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAoB;IAClD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,oBAAoB,EAAE,CAAC;QACzC,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,uEAAuE;QACvE,OAAO,CAAC,KAAK,CAAC,uCAAuC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,oBAAoB,EAAE,CAAC;QAEzC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAkB,CAAC;QAEhD,4BAA4B;QAC5B,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;QACtD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEvB,IAAI,GAAG,GAAG,SAAS,GAAG,eAAe,EAAE,CAAC;YACtC,4BAA4B;YAC5B,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;QACP,6FAA6F;QAC7F,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACxD,OAAO,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC;AAC9B,CAAC"}
|
package/dist/dom/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared DOM utilities used across CLI and daemon layers.
|
|
3
|
-
*
|
|
4
|
-
* This module provides low-level DOM operations via Chrome DevTools Protocol (CDP)
|
|
5
|
-
* and query result caching for index-based lookups.
|
|
6
|
-
*/
|
|
7
|
-
export * from './cache.js';
|
|
8
|
-
export * from './query.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/dom/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/dom/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared DOM utilities used across CLI and daemon layers.
|
|
3
|
-
*
|
|
4
|
-
* This module provides low-level DOM operations via Chrome DevTools Protocol (CDP)
|
|
5
|
-
* and query result caching for index-based lookups.
|
|
6
|
-
*/
|
|
7
|
-
export * from './cache.js';
|
|
8
|
-
export * from './query.js';
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/dom/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/dom/query.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { CDPConnection } from '../connection/cdp.js';
|
|
2
|
-
/**
|
|
3
|
-
* DOM node information from CDP
|
|
4
|
-
*/
|
|
5
|
-
export interface DomNodeInfo {
|
|
6
|
-
nodeId: number;
|
|
7
|
-
tag?: string;
|
|
8
|
-
classes?: string[];
|
|
9
|
-
attributes?: Record<string, string>;
|
|
10
|
-
outerHTML?: string;
|
|
11
|
-
textContent?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get document root node ID
|
|
15
|
-
*
|
|
16
|
-
* @param cdp - CDP connection instance
|
|
17
|
-
* @returns Root node ID
|
|
18
|
-
* @throws Error When CDP command fails or connection is lost
|
|
19
|
-
*/
|
|
20
|
-
export declare function getDocumentRoot(cdp: CDPConnection): Promise<number>;
|
|
21
|
-
/**
|
|
22
|
-
* Query DOM by CSS selector
|
|
23
|
-
*
|
|
24
|
-
* @param cdp - CDP connection instance
|
|
25
|
-
* @param selector - CSS selector to query
|
|
26
|
-
* @param rootNodeId - Optional root node ID (defaults to document root)
|
|
27
|
-
* @returns Array of node IDs matching the selector
|
|
28
|
-
* @throws Error When CDP command fails or selector is invalid
|
|
29
|
-
*/
|
|
30
|
-
export declare function queryBySelector(cdp: CDPConnection, selector: string, rootNodeId?: number): Promise<number[]>;
|
|
31
|
-
/**
|
|
32
|
-
* Get node information
|
|
33
|
-
*
|
|
34
|
-
* @param cdp - CDP connection instance
|
|
35
|
-
* @param nodeId - Node ID to query
|
|
36
|
-
* @returns Node information including tag, classes, attributes
|
|
37
|
-
* @throws Error When CDP command fails or nodeId is invalid
|
|
38
|
-
*/
|
|
39
|
-
export declare function getNodeInfo(cdp: CDPConnection, nodeId: number): Promise<DomNodeInfo>;
|
|
40
|
-
/**
|
|
41
|
-
* Create preview text for a node
|
|
42
|
-
*
|
|
43
|
-
* @param nodeInfo - Node information
|
|
44
|
-
* @param maxLength - Maximum preview length (default: 50)
|
|
45
|
-
* @returns Preview text
|
|
46
|
-
*/
|
|
47
|
-
export declare function createNodePreview(nodeInfo: DomNodeInfo, maxLength?: number): string;
|
|
48
|
-
//# sourceMappingURL=query.d.ts.map
|
package/dist/dom/query.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/dom/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAKzE;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnB;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAoD1F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,SAAK,GAAG,MAAM,CAoB/E"}
|
package/dist/dom/query.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get document root node ID
|
|
3
|
-
*
|
|
4
|
-
* @param cdp - CDP connection instance
|
|
5
|
-
* @returns Root node ID
|
|
6
|
-
* @throws Error When CDP command fails or connection is lost
|
|
7
|
-
*/
|
|
8
|
-
export async function getDocumentRoot(cdp) {
|
|
9
|
-
const result = (await cdp.send('DOM.getDocument', { depth: -1 }));
|
|
10
|
-
return result.root.nodeId;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Query DOM by CSS selector
|
|
14
|
-
*
|
|
15
|
-
* @param cdp - CDP connection instance
|
|
16
|
-
* @param selector - CSS selector to query
|
|
17
|
-
* @param rootNodeId - Optional root node ID (defaults to document root)
|
|
18
|
-
* @returns Array of node IDs matching the selector
|
|
19
|
-
* @throws Error When CDP command fails or selector is invalid
|
|
20
|
-
*/
|
|
21
|
-
export async function queryBySelector(cdp, selector, rootNodeId) {
|
|
22
|
-
// Get root node if not provided
|
|
23
|
-
const nodeId = rootNodeId ?? (await getDocumentRoot(cdp));
|
|
24
|
-
const result = (await cdp.send('DOM.querySelectorAll', {
|
|
25
|
-
nodeId,
|
|
26
|
-
selector,
|
|
27
|
-
}));
|
|
28
|
-
return result.nodeIds;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get node information
|
|
32
|
-
*
|
|
33
|
-
* @param cdp - CDP connection instance
|
|
34
|
-
* @param nodeId - Node ID to query
|
|
35
|
-
* @returns Node information including tag, classes, attributes
|
|
36
|
-
* @throws Error When CDP command fails or nodeId is invalid
|
|
37
|
-
*/
|
|
38
|
-
export async function getNodeInfo(cdp, nodeId) {
|
|
39
|
-
// Get node description
|
|
40
|
-
const describeResult = (await cdp.send('DOM.describeNode', {
|
|
41
|
-
nodeId,
|
|
42
|
-
}));
|
|
43
|
-
const node = describeResult.node;
|
|
44
|
-
// Parse attributes array into object
|
|
45
|
-
const attributes = {};
|
|
46
|
-
if (node.attributes) {
|
|
47
|
-
for (let i = 0; i < node.attributes.length; i += 2) {
|
|
48
|
-
const key = node.attributes[i];
|
|
49
|
-
const value = node.attributes[i + 1];
|
|
50
|
-
if (key !== undefined && value !== undefined) {
|
|
51
|
-
attributes[key] = value;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// Extract classes from class attribute
|
|
56
|
-
const classes = attributes['class']?.split(/\s+/).filter((c) => c.length > 0) ?? [];
|
|
57
|
-
// Get outer HTML
|
|
58
|
-
const htmlResult = (await cdp.send('DOM.getOuterHTML', {
|
|
59
|
-
nodeId,
|
|
60
|
-
}));
|
|
61
|
-
// Extract text content by removing HTML tags
|
|
62
|
-
// Uses simple regex to strip tags while preserving text content including < and > in text
|
|
63
|
-
// SAFETY: This HTML comes from Chrome's internal DOM via CDP, not user input.
|
|
64
|
-
// It's trusted browser-generated content used only for display/analysis in CLI output.
|
|
65
|
-
// The regex is intentionally simple because we're extracting text, not sanitizing for XSS.
|
|
66
|
-
const textContent = htmlResult.outerHTML
|
|
67
|
-
.replace(/<[^>]*>/g, '') // Remove HTML tags
|
|
68
|
-
.replace(/\s+/g, ' ') // Collapse whitespace
|
|
69
|
-
.trim();
|
|
70
|
-
return {
|
|
71
|
-
nodeId,
|
|
72
|
-
tag: node.nodeName.toLowerCase(),
|
|
73
|
-
classes,
|
|
74
|
-
attributes,
|
|
75
|
-
outerHTML: htmlResult.outerHTML,
|
|
76
|
-
textContent,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Create preview text for a node
|
|
81
|
-
*
|
|
82
|
-
* @param nodeInfo - Node information
|
|
83
|
-
* @param maxLength - Maximum preview length (default: 50)
|
|
84
|
-
* @returns Preview text
|
|
85
|
-
*/
|
|
86
|
-
export function createNodePreview(nodeInfo, maxLength = 50) {
|
|
87
|
-
// If we have text content, use that
|
|
88
|
-
if (nodeInfo.textContent && nodeInfo.textContent.length > 0) {
|
|
89
|
-
const text = nodeInfo.textContent;
|
|
90
|
-
if (text.length > maxLength) {
|
|
91
|
-
return text.slice(0, maxLength) + '...';
|
|
92
|
-
}
|
|
93
|
-
return text;
|
|
94
|
-
}
|
|
95
|
-
// Otherwise show the opening tag
|
|
96
|
-
const tag = nodeInfo.tag ?? 'unknown';
|
|
97
|
-
const classAttr = nodeInfo.classes && nodeInfo.classes.length > 0 ? ` class="${nodeInfo.classes.join(' ')}"` : '';
|
|
98
|
-
const preview = `<${tag}${classAttr}>`;
|
|
99
|
-
if (preview.length > maxLength) {
|
|
100
|
-
return preview.slice(0, maxLength) + '...';
|
|
101
|
-
}
|
|
102
|
-
return preview;
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=query.js.map
|
package/dist/dom/query.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/dom/query.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Network data formatters for human-readable output
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* CDP Cookie type
|
|
6
|
-
*/
|
|
7
|
-
export interface Cookie {
|
|
8
|
-
name: string;
|
|
9
|
-
value: string;
|
|
10
|
-
domain: string;
|
|
11
|
-
path: string;
|
|
12
|
-
expires?: number;
|
|
13
|
-
httpOnly: boolean;
|
|
14
|
-
secure: boolean;
|
|
15
|
-
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Format cookies for human-readable output
|
|
19
|
-
*
|
|
20
|
-
* @param cookies - Array of CDP cookies
|
|
21
|
-
*/
|
|
22
|
-
export declare function formatCookies(cookies: Cookie[]): void;
|
|
23
|
-
//# sourceMappingURL=network.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters/network.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CA6BrD"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Network data formatters for human-readable output
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Format cookies for human-readable output
|
|
6
|
-
*
|
|
7
|
-
* @param cookies - Array of CDP cookies
|
|
8
|
-
*/
|
|
9
|
-
export function formatCookies(cookies) {
|
|
10
|
-
if (cookies.length === 0) {
|
|
11
|
-
console.log('No cookies found');
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
console.log(`Cookies (${cookies.length}):\n`);
|
|
15
|
-
cookies.forEach((cookie, index) => {
|
|
16
|
-
console.log(`[${index + 1}] ${cookie.name}`);
|
|
17
|
-
console.log(` Value: ${cookie.value}`);
|
|
18
|
-
console.log(` Domain: ${cookie.domain}`);
|
|
19
|
-
console.log(` Path: ${cookie.path}`);
|
|
20
|
-
if (cookie.expires && cookie.expires !== -1) {
|
|
21
|
-
const expiresDate = new Date(cookie.expires * 1000);
|
|
22
|
-
console.log(` Expires: ${expiresDate.toISOString()}`);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
console.log(` Expires: Session`);
|
|
26
|
-
}
|
|
27
|
-
console.log(` HttpOnly: ${cookie.httpOnly ? 'Yes' : 'No'}`);
|
|
28
|
-
console.log(` Secure: ${cookie.secure ? 'Yes' : 'No'}`);
|
|
29
|
-
console.log(` SameSite: ${cookie.sameSite ?? 'None'}`);
|
|
30
|
-
if (index < cookies.length - 1) {
|
|
31
|
-
console.log('');
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=network.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../../src/utils/formatters/network.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAiB;IAC7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChC,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC;IAE9C,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAEtC,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;YAC5C,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YACpD,OAAO,CAAC,GAAG,CAAC,cAAc,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAC;QAExD,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/utils/ui.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI utilities for enhanced terminal output.
|
|
3
|
-
*
|
|
4
|
-
* WHY: Provides visual feedback and branding for CLI operations.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Options for the landing page display.
|
|
8
|
-
*/
|
|
9
|
-
export interface LandingPageOptions {
|
|
10
|
-
/** Target URL being monitored */
|
|
11
|
-
url: string;
|
|
12
|
-
/** Worker process ID */
|
|
13
|
-
workerPid: number;
|
|
14
|
-
/** Chrome process ID */
|
|
15
|
-
chromePid: number;
|
|
16
|
-
/** Collectors enabled */
|
|
17
|
-
collectors: string[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Generate the landing page display for session start.
|
|
21
|
-
*
|
|
22
|
-
* @param options - Landing page options
|
|
23
|
-
* @returns Formatted landing page string
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* landingPage({
|
|
28
|
-
* url: 'http://localhost:3000',
|
|
29
|
-
* workerPid: 12345,
|
|
30
|
-
* chromePid: 12346,
|
|
31
|
-
* collectors: ['network', 'console', 'dom']
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare function landingPage(options: LandingPageOptions): string;
|
|
36
|
-
//# sourceMappingURL=ui.d.ts.map
|
package/dist/utils/ui.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CA2B/D"}
|
package/dist/utils/ui.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI utilities for enhanced terminal output.
|
|
3
|
-
*
|
|
4
|
-
* WHY: Provides visual feedback and branding for CLI operations.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Generate the landing page display for session start.
|
|
8
|
-
*
|
|
9
|
-
* @param options - Landing page options
|
|
10
|
-
* @returns Formatted landing page string
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* landingPage({
|
|
15
|
-
* url: 'http://localhost:3000',
|
|
16
|
-
* workerPid: 12345,
|
|
17
|
-
* chromePid: 12346,
|
|
18
|
-
* collectors: ['network', 'console', 'dom']
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export function landingPage(options) {
|
|
23
|
-
const { url, workerPid, chromePid, collectors } = options;
|
|
24
|
-
const lines = [];
|
|
25
|
-
lines.push('');
|
|
26
|
-
lines.push(' bdg');
|
|
27
|
-
lines.push('');
|
|
28
|
-
lines.push(' ▲ Session Started');
|
|
29
|
-
lines.push('');
|
|
30
|
-
lines.push(` ○ Target ${url}`);
|
|
31
|
-
lines.push(` ○ Chrome PID ${chromePid}`);
|
|
32
|
-
lines.push(` ○ Worker PID ${workerPid}`);
|
|
33
|
-
lines.push(` ○ Collecting ${collectors.join(', ')}`);
|
|
34
|
-
lines.push('');
|
|
35
|
-
lines.push(' Ready — use these commands:');
|
|
36
|
-
lines.push('');
|
|
37
|
-
lines.push(' bdg status Session info');
|
|
38
|
-
lines.push(' bdg peek Preview data');
|
|
39
|
-
lines.push(' bdg cdp <method> [params] Execute CDP commands');
|
|
40
|
-
lines.push(' bdg stop Stop & save');
|
|
41
|
-
lines.push('');
|
|
42
|
-
lines.push(' 💡 Run any Chrome DevTools Protocol command:');
|
|
43
|
-
lines.push(' bdg cdp Runtime.evaluate \'{"expression": "document.title"}\'');
|
|
44
|
-
lines.push('');
|
|
45
|
-
return lines.join('\n');
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=ui.js.map
|
package/dist/utils/ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW,CAAC,OAA2B;IACrD,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAE1D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC,qBAAqB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC7C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC7D,KAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC7D,KAAK,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACrE,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC5D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAC9D,KAAK,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IAClF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe URL parsing utilities with automatic protocol detection.
|
|
3
|
-
*
|
|
4
|
-
* Provides centralized URL parsing that gracefully handles:
|
|
5
|
-
* - Missing protocols (adds http://)
|
|
6
|
-
* - Malformed URLs (returns null)
|
|
7
|
-
* - Localhost and bare hostnames
|
|
8
|
-
*
|
|
9
|
-
* WHY: Eliminates duplicated try/catch blocks across 4+ files
|
|
10
|
-
* (filters.ts, url.ts, collectors, connection layer).
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Safely parse a URL string with automatic protocol detection.
|
|
14
|
-
*
|
|
15
|
-
* Attempts to parse the URL in two passes:
|
|
16
|
-
* 1. As-is (supports full URLs with protocols)
|
|
17
|
-
* 2. With 'http://' prefix (supports localhost:3000, example.com, etc.)
|
|
18
|
-
*
|
|
19
|
-
* @param input - URL string to parse (may lack protocol)
|
|
20
|
-
* @returns Parsed URL object, or null if parsing fails both attempts
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* safeParseUrl('https://example.com') // → URL { ... }
|
|
25
|
-
* safeParseUrl('localhost:3000') // → URL { protocol: 'http:', ... }
|
|
26
|
-
* safeParseUrl('example.com/path') // → URL { protocol: 'http:', ... }
|
|
27
|
-
* safeParseUrl('not a url') // → null
|
|
28
|
-
* safeParseUrl('file:///path/to/file.html') // → URL { protocol: 'file:', ... }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function safeParseUrl(input: string): URL | null;
|
|
32
|
-
/**
|
|
33
|
-
* Extract hostname from a URL string safely.
|
|
34
|
-
*
|
|
35
|
-
* @param input - URL string to extract hostname from
|
|
36
|
-
* @returns Hostname (e.g., 'example.com'), or original input if parsing fails
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* extractHostname('https://example.com/path') // → 'example.com'
|
|
41
|
-
* extractHostname('localhost:3000') // → 'localhost'
|
|
42
|
-
* extractHostname('invalid') // → 'invalid'
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare function extractHostname(input: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Extract hostname with pathname from a URL string safely.
|
|
48
|
-
*
|
|
49
|
-
* Useful for pattern matching that needs both hostname and path segments.
|
|
50
|
-
*
|
|
51
|
-
* @param input - URL string to extract hostname+pathname from
|
|
52
|
-
* @returns Hostname with pathname (e.g., 'example.com/api/users'), or original input if parsing fails
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* extractHostnameWithPath('https://api.example.com/v1/users?id=123')
|
|
57
|
-
* // → 'api.example.com/v1/users'
|
|
58
|
-
* extractHostnameWithPath('localhost:3000/dashboard')
|
|
59
|
-
* // → 'localhost/dashboard'
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
export declare function extractHostnameWithPath(input: string): string;
|
|
63
|
-
//# sourceMappingURL=safeParseUrl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safeParseUrl.d.ts","sourceRoot":"","sources":["../../../src/utils/url/safeParseUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAatD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG7D"}
|