browser-debugger-cli 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/cdp/protocol.d.ts +1 -1
- package/dist/cdp/protocol.js +1 -1
- package/dist/cdp/schema.d.ts +10 -0
- package/dist/cdp/schema.js +13 -0
- package/dist/commands/cdp.js +75 -23
- package/dist/commands/cleanup.js +31 -23
- package/dist/commands/console.d.ts +18 -1
- package/dist/commands/console.js +98 -53
- package/dist/commands/details.js +13 -3
- package/dist/commands/dom/DomElementResolver.d.ts +24 -69
- package/dist/commands/dom/DomElementResolver.js +71 -162
- package/dist/commands/dom/a11y.js +52 -33
- package/dist/commands/dom/eval.d.ts +13 -0
- package/dist/commands/dom/eval.js +43 -0
- package/dist/commands/dom/form.js +103 -147
- package/dist/commands/dom/formInteraction.d.ts +6 -1
- package/dist/commands/dom/formInteraction.js +223 -305
- package/dist/commands/dom/frames.d.ts +12 -0
- package/dist/commands/dom/frames.js +28 -0
- package/dist/commands/dom/get.d.ts +20 -0
- package/dist/commands/dom/get.js +141 -0
- package/dist/commands/dom/helpers/index.d.ts +11 -0
- package/dist/commands/dom/helpers/index.js +10 -0
- package/dist/commands/dom/helpers/query.d.ts +78 -0
- package/dist/commands/dom/helpers/query.js +457 -0
- package/dist/commands/dom/helpers/runElementCommand.d.ts +56 -0
- package/dist/commands/dom/helpers/runElementCommand.js +63 -0
- package/dist/commands/dom/helpers/screenshot.d.ts +30 -0
- package/dist/commands/dom/helpers/screenshot.js +374 -0
- package/dist/commands/dom/index.d.ts +15 -3
- package/dist/commands/dom/index.js +45 -511
- package/dist/commands/dom/listeners.d.ts +16 -0
- package/dist/commands/dom/listeners.js +54 -0
- package/dist/commands/dom/query.d.ts +14 -0
- package/dist/commands/dom/query.js +36 -0
- package/dist/commands/dom/screenshot.d.ts +21 -0
- package/dist/commands/dom/screenshot.js +248 -0
- package/dist/commands/dom/semanticUtils.d.ts +44 -0
- package/dist/commands/dom/semanticUtils.js +102 -0
- package/dist/commands/helpJson.d.ts +4 -2
- package/dist/commands/helpJson.js +12 -32
- package/dist/commands/helpTopic.d.ts +32 -0
- package/dist/commands/helpTopic.js +58 -0
- package/dist/commands/network/har.js +50 -24
- package/dist/commands/network/list.js +96 -63
- package/dist/commands/network/shared.d.ts +9 -15
- package/dist/commands/network/shared.js +30 -51
- package/dist/commands/optionBehaviors.d.ts +1 -9
- package/dist/commands/optionBehaviors.js +46 -25
- package/dist/commands/page.d.ts +11 -0
- package/dist/commands/page.js +112 -0
- package/dist/commands/peek.js +62 -48
- package/dist/commands/shared/CommandRunner.d.ts +18 -1
- package/dist/commands/shared/CommandRunner.js +83 -26
- package/dist/commands/shared/commonOptions.d.ts +10 -0
- package/dist/commands/shared/commonOptions.js +12 -0
- package/dist/commands/shared/daemonErrorHandler.d.ts +9 -0
- package/dist/commands/shared/daemonErrorHandler.js +31 -11
- package/dist/commands/shared/dataFetcher.d.ts +33 -10
- package/dist/commands/shared/dataFetcher.js +57 -20
- package/dist/commands/shared/followMode.d.ts +0 -3
- package/dist/commands/shared/followMode.js +6 -11
- package/dist/commands/shared/handleValidationError.d.ts +14 -0
- package/dist/commands/shared/handleValidationError.js +39 -0
- package/dist/commands/shared/optionTypes.d.ts +42 -22
- package/dist/commands/shared/outputFile.d.ts +33 -0
- package/dist/commands/shared/outputFile.js +78 -0
- package/dist/commands/shared/startHelpers.d.ts +5 -8
- package/dist/commands/shared/startHelpers.js +226 -37
- package/dist/commands/shared/validation.d.ts +42 -0
- package/dist/commands/shared/validation.js +101 -22
- package/dist/commands/start.d.ts +28 -1
- package/dist/commands/start.js +226 -38
- package/dist/commands/status.js +48 -11
- package/dist/commands/stop.js +16 -26
- package/dist/commands/tail.js +20 -35
- package/dist/commands.js +2 -0
- package/dist/connection/cdp.d.ts +12 -6
- package/dist/connection/cdp.js +59 -16
- package/dist/connection/diagnostics.d.ts +0 -9
- package/dist/connection/diagnostics.js +0 -13
- package/dist/connection/errors.d.ts +36 -1
- package/dist/connection/errors.js +43 -3
- package/dist/connection/handlers.d.ts +5 -5
- package/dist/connection/handlers.js +1 -1
- package/dist/connection/inFlightRequests.d.ts +33 -0
- package/dist/connection/inFlightRequests.js +52 -0
- package/dist/connection/launcher/binaryResolver.js +20 -7
- package/dist/connection/launcher/flagsBuilder.d.ts +24 -54
- package/dist/connection/launcher/flagsBuilder.js +65 -40
- package/dist/connection/launcher/preferencesLoader.js +27 -8
- package/dist/connection/launcher.d.ts +2 -0
- package/dist/connection/launcher.js +48 -29
- package/dist/connection/pageReadiness.d.ts +5 -6
- package/dist/connection/pageReadiness.js +63 -120
- package/dist/connection/portReservation.d.ts +10 -0
- package/dist/connection/portReservation.js +37 -2
- package/dist/connection/startupExit.d.ts +37 -0
- package/dist/connection/startupExit.js +107 -0
- package/dist/connection/typed-cdp.d.ts +8 -6
- package/dist/connection/typed-cdp.js +5 -3
- package/dist/connection/types.d.ts +3 -0
- package/dist/constants.d.ts +21 -22
- package/dist/constants.js +28 -25
- package/dist/daemon/SessionController.d.ts +125 -0
- package/dist/daemon/SessionController.js +472 -0
- package/dist/daemon/errors.d.ts +15 -19
- package/dist/daemon/errors.js +18 -21
- package/dist/daemon/ipcServer.d.ts +44 -30
- package/dist/daemon/ipcServer.js +164 -132
- package/dist/daemon/launcher.d.ts +13 -21
- package/dist/daemon/launcher.js +94 -101
- package/dist/daemon/messages.d.ts +29 -0
- package/dist/daemon/messages.js +35 -0
- package/dist/daemon/patternDefinitions.d.ts +1 -1
- package/dist/daemon/patternDefinitions.js +3 -2
- package/dist/daemon/patternDetector.d.ts +13 -29
- package/dist/daemon/patternDetector.js +26 -47
- package/dist/daemon/server/SocketServer.d.ts +56 -2
- package/dist/daemon/server/SocketServer.js +131 -30
- package/dist/daemon/session/Session.d.ts +137 -0
- package/dist/daemon/session/Session.js +288 -0
- package/dist/daemon/session/TelemetryStore.d.ts +30 -0
- package/dist/daemon/session/TelemetryStore.js +44 -0
- package/dist/daemon/session/cdpSetup.d.ts +47 -0
- package/dist/daemon/session/cdpSetup.js +94 -0
- package/dist/daemon/session/chromeConnection.d.ts +38 -0
- package/dist/daemon/session/chromeConnection.js +178 -0
- package/dist/daemon/{worker → session}/collectors.d.ts +3 -3
- package/dist/daemon/{worker → session}/collectors.js +3 -3
- package/dist/daemon/session/commandRegistry.js +445 -0
- package/dist/daemon/session/interactions.d.ts +27 -0
- package/dist/daemon/session/interactions.js +44 -0
- package/dist/daemon/{worker → session}/plugins.d.ts +3 -3
- package/dist/daemon/session/plugins.js +219 -0
- package/dist/daemon/session/targetMismatch.d.ts +34 -0
- package/dist/daemon/session/targetMismatch.js +83 -0
- package/dist/daemon/session/teardown.d.ts +27 -0
- package/dist/daemon/session/teardown.js +128 -0
- package/dist/daemon/{worker → session}/types.d.ts +2 -2
- package/dist/daemon.d.ts +3 -4
- package/dist/daemon.js +15356 -24
- package/dist/{ui/errors → errors}/CommandError.js +1 -1
- package/dist/{ui/errors → errors}/index.d.ts +2 -0
- package/dist/errors/issues.d.ts +16 -0
- package/dist/errors/issues.js +11 -0
- package/dist/errors/messages.d.ts +545 -0
- package/dist/errors/messages.js +959 -0
- package/dist/errors/notices.d.ts +30 -0
- package/dist/errors/notices.js +11 -0
- package/dist/{ui/errors → errors}/utils.js +1 -1
- package/dist/index.js +16410 -168
- package/dist/ipc/client.d.ts +44 -8
- package/dist/ipc/client.js +95 -18
- package/dist/ipc/index.d.ts +2 -2
- package/dist/ipc/index.js +2 -2
- package/dist/ipc/protocol/commands.d.ts +220 -59
- package/dist/ipc/protocol/commands.js +27 -21
- package/dist/ipc/protocol/domTypes.d.ts +236 -0
- package/dist/ipc/protocol/domTypes.js +10 -0
- package/dist/ipc/protocol/guards.d.ts +4 -4
- package/dist/ipc/protocol/guards.js +4 -4
- package/dist/ipc/protocol/messages.d.ts +9 -33
- package/dist/ipc/protocol/messages.js +1 -1
- package/dist/ipc/session/errors.d.ts +10 -2
- package/dist/ipc/session/errors.js +10 -2
- package/dist/ipc/session/lifecycle.d.ts +20 -22
- package/dist/ipc/session/queries.d.ts +21 -4
- package/dist/ipc/session/types.d.ts +1 -1
- package/dist/ipc/session/types.js +1 -1
- package/dist/ipc/transport/IPCError.d.ts +3 -3
- package/dist/ipc/transport/IPCError.js +3 -3
- package/dist/ipc/transport/index.d.ts +7 -1
- package/dist/ipc/transport/index.js +7 -2
- package/dist/ipc/transport/jsonl.d.ts +28 -2
- package/dist/ipc/transport/jsonl.js +57 -10
- package/dist/ipc/utils/errors.d.ts +4 -2
- package/dist/ipc/utils/errors.js +10 -4
- package/dist/ipc/utils/index.d.ts +0 -1
- package/dist/ipc/utils/index.js +0 -1
- package/dist/ipc/utils/responseValidator.d.ts +5 -1
- package/dist/ipc/utils/responseValidator.js +7 -3
- package/dist/runtime/dom/evalHelpers.d.ts +76 -0
- package/dist/runtime/dom/evalHelpers.js +406 -0
- package/dist/runtime/dom/eventListeners.d.ts +23 -0
- package/dist/runtime/dom/eventListeners.js +252 -0
- package/dist/runtime/dom/formDiscovery.d.ts +26 -0
- package/dist/{commands → runtime}/dom/formDiscovery.js +48 -9
- package/dist/runtime/dom/formFillHelpers/fill.d.ts +29 -0
- package/dist/runtime/dom/formFillHelpers/fill.js +299 -0
- package/dist/runtime/dom/formFillHelpers/index.d.ts +17 -0
- package/dist/runtime/dom/formFillHelpers/index.js +17 -0
- package/dist/runtime/dom/formFillHelpers/pressKey.d.ts +28 -0
- package/dist/runtime/dom/formFillHelpers/pressKey.js +195 -0
- package/dist/runtime/dom/formFillHelpers/scroll.d.ts +24 -0
- package/dist/runtime/dom/formFillHelpers/scroll.js +188 -0
- package/dist/runtime/dom/formFillHelpers/shared.d.ts +43 -0
- package/dist/runtime/dom/formFillHelpers/shared.js +100 -0
- package/dist/runtime/dom/formFillHelpers/stability.d.ts +14 -0
- package/dist/runtime/dom/formFillHelpers/stability.js +40 -0
- package/dist/runtime/dom/formSubmitHelpers.d.ts +29 -0
- package/dist/runtime/dom/formSubmitHelpers.js +252 -0
- package/dist/runtime/dom/formTypes.d.ts +8 -0
- package/dist/runtime/dom/frameSelection.d.ts +27 -0
- package/dist/runtime/dom/frameSelection.js +66 -0
- package/dist/runtime/dom/frames.d.ts +38 -0
- package/dist/runtime/dom/frames.js +305 -0
- package/dist/runtime/dom/keyMapping.d.ts +103 -0
- package/dist/runtime/dom/keyMapping.js +232 -0
- package/dist/runtime/dom/listenerSummary.d.ts +72 -0
- package/dist/runtime/dom/listenerSummary.js +150 -0
- package/dist/runtime/dom/reactEventHelpers.d.ts +61 -0
- package/dist/runtime/dom/reactEventHelpers.js +470 -0
- package/dist/runtime/dom/targetNode.d.ts +78 -0
- package/dist/runtime/dom/targetNode.js +154 -0
- package/dist/runtime/page/navigation.d.ts +34 -0
- package/dist/runtime/page/navigation.js +249 -0
- package/dist/session/QueryCacheManager.d.ts +25 -82
- package/dist/session/QueryCacheManager.js +41 -133
- package/dist/session/chrome.d.ts +21 -16
- package/dist/session/chrome.js +28 -44
- package/dist/session/cleanup/staleSession.d.ts +49 -0
- package/dist/session/cleanup/staleSession.js +124 -0
- package/dist/session/cleanup/userCommands.d.ts +36 -0
- package/dist/session/cleanup/userCommands.js +95 -0
- package/dist/session/daemonSocket.d.ts +25 -0
- package/dist/session/daemonSocket.js +40 -0
- package/dist/session/lastSession.d.ts +29 -0
- package/dist/session/lastSession.js +45 -0
- package/dist/session/metadata.d.ts +3 -1
- package/dist/session/paths.d.ts +2 -4
- package/dist/session/paths.js +2 -4
- package/dist/session/pid.d.ts +9 -38
- package/dist/session/pid.js +14 -64
- package/dist/session/port.d.ts +0 -5
- package/dist/session/port.js +9 -19
- package/dist/telemetry/a11y.d.ts +26 -20
- package/dist/telemetry/a11y.js +237 -104
- package/dist/telemetry/attachedTargets.d.ts +36 -0
- package/dist/telemetry/attachedTargets.js +163 -0
- package/dist/telemetry/console.d.ts +21 -4
- package/dist/telemetry/console.js +122 -11
- package/dist/telemetry/dialogs.d.ts +4 -2
- package/dist/telemetry/dialogs.js +3 -1
- package/dist/telemetry/dom.d.ts +1 -11
- package/dist/telemetry/dom.js +0 -102
- package/dist/telemetry/filterDsl.d.ts +9 -1
- package/dist/telemetry/filterDsl.js +101 -31
- package/dist/telemetry/filterPresets.js +12 -2
- package/dist/telemetry/filters.d.ts +1 -1
- package/dist/telemetry/filters.js +38 -3
- package/dist/telemetry/har/builder.js +190 -160
- package/dist/telemetry/har/types.d.ts +21 -4
- package/dist/telemetry/navigation.d.ts +13 -29
- package/dist/telemetry/navigation.js +12 -46
- package/dist/telemetry/network.d.ts +37 -1
- package/dist/telemetry/network.js +343 -130
- package/dist/telemetry/networkExtraInfo.d.ts +106 -0
- package/dist/telemetry/networkExtraInfo.js +241 -0
- package/dist/telemetry/objectExpander.d.ts +14 -5
- package/dist/telemetry/objectExpander.js +13 -6
- package/dist/telemetry/remoteObject.d.ts +10 -2
- package/dist/telemetry/remoteObject.js +59 -2
- package/dist/telemetry/remoteObjectUtils.js +22 -3
- package/dist/types.d.ts +64 -44
- package/dist/types.js +1 -33
- package/dist/ui/OutputBuilder.d.ts +17 -14
- package/dist/ui/OutputBuilder.js +18 -87
- package/dist/ui/formatters/a11y.js +72 -9
- package/dist/ui/formatters/console/chronological.d.ts +14 -0
- package/dist/ui/formatters/console/chronological.js +58 -0
- package/dist/ui/formatters/console/follow.d.ts +18 -0
- package/dist/ui/formatters/console/follow.js +36 -0
- package/dist/ui/formatters/console/json.d.ts +21 -0
- package/dist/ui/formatters/console/json.js +53 -0
- package/dist/ui/formatters/console/shared.d.ts +136 -0
- package/dist/ui/formatters/console/shared.js +158 -0
- package/dist/ui/formatters/console/summarize.d.ts +10 -0
- package/dist/ui/formatters/console/summarize.js +63 -0
- package/dist/ui/formatters/console.d.ts +16 -137
- package/dist/ui/formatters/console.js +17 -418
- package/dist/ui/formatters/cookies.js +3 -3
- package/dist/ui/formatters/details.d.ts +5 -2
- package/dist/ui/formatters/details.js +183 -24
- package/dist/ui/formatters/dom.d.ts +27 -6
- package/dist/ui/formatters/dom.js +80 -28
- package/dist/ui/formatters/form.js +35 -56
- package/dist/ui/formatters/helpFormatters.js +5 -4
- package/dist/ui/formatters/listeners.d.ts +24 -0
- package/dist/ui/formatters/listeners.js +96 -0
- package/dist/ui/formatters/networkHeaders.d.ts +3 -3
- package/dist/ui/formatters/networkHeaders.js +7 -4
- package/dist/ui/formatters/networkList.d.ts +14 -2
- package/dist/ui/formatters/networkList.js +80 -35
- package/dist/ui/formatters/preview.d.ts +21 -3
- package/dist/ui/formatters/preview.js +53 -72
- package/dist/ui/formatters/requestStatus.d.ts +34 -0
- package/dist/ui/formatters/requestStatus.js +55 -0
- package/dist/ui/formatters/semantic.d.ts +1 -1
- package/dist/ui/formatters/semantic.js +1 -1
- package/dist/ui/formatters/sessionFormatters.js +11 -8
- package/dist/ui/formatters/status.d.ts +23 -5
- package/dist/ui/formatters/status.js +48 -24
- package/dist/ui/formatting.d.ts +35 -0
- package/dist/ui/formatting.js +122 -23
- package/dist/ui/logging/logger.d.ts +1 -1
- package/dist/ui/messages/chrome.d.ts +35 -100
- package/dist/ui/messages/chrome.js +102 -136
- package/dist/ui/messages/commands.d.ts +121 -3
- package/dist/ui/messages/commands.js +153 -6
- package/dist/ui/messages/consoleMessages.d.ts +0 -6
- package/dist/ui/messages/consoleMessages.js +0 -8
- package/dist/ui/messages/hints.d.ts +9 -15
- package/dist/ui/messages/hints.js +17 -16
- package/dist/ui/messages/networkMessages.d.ts +0 -6
- package/dist/ui/messages/networkMessages.js +0 -8
- package/dist/ui/messages/preview.js +2 -2
- package/dist/ui/messages/session.d.ts +24 -3
- package/dist/ui/messages/session.js +38 -7
- package/dist/ui/messages/validation.d.ts +15 -26
- package/dist/ui/messages/validation.js +33 -38
- package/dist/utils/atomicFile.js +1 -1
- package/dist/utils/decisionTrees.js +1 -1
- package/dist/utils/errorMapping.js +15 -4
- package/dist/utils/errors.d.ts +13 -0
- package/dist/utils/errors.js +21 -0
- package/dist/utils/exitCodes.d.ts +5 -0
- package/dist/utils/exitCodes.js +36 -2
- package/dist/utils/http.d.ts +35 -4
- package/dist/utils/http.js +59 -6
- package/dist/utils/packageRoot.d.ts +12 -0
- package/dist/utils/packageRoot.js +33 -0
- package/dist/utils/process.d.ts +10 -0
- package/dist/utils/process.js +35 -3
- package/dist/utils/selectorFilters.d.ts +45 -0
- package/dist/utils/selectorFilters.js +224 -0
- package/dist/utils/suggestions.js +1 -1
- package/dist/utils/taskMappings.js +7 -2
- package/dist/utils/typeGuards.js +2 -2
- package/dist/utils/url.d.ts +13 -5
- package/dist/utils/url.js +53 -52
- package/dist/utils/validation.d.ts +15 -93
- package/dist/utils/validation.js +10 -118
- package/dist/utils/version.js +3 -5
- package/package.json +39 -30
- package/dist/__testfixtures__/cdpMessages.d.ts +0 -43
- package/dist/__testfixtures__/cdpMessages.d.ts.map +0 -1
- package/dist/__testfixtures__/cdpMessages.js +0 -118
- package/dist/__testfixtures__/cdpMessages.js.map +0 -1
- package/dist/__testfixtures__/connectionTargets.d.ts +0 -21
- package/dist/__testfixtures__/connectionTargets.d.ts.map +0 -1
- package/dist/__testfixtures__/connectionTargets.js +0 -59
- package/dist/__testfixtures__/connectionTargets.js.map +0 -1
- package/dist/__tests__/fixtures/schema-v0.2.1.golden.json +0 -47
- package/dist/__tests__/integration/session-files.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/session-files.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/session-files.integration.test.js +0 -66
- package/dist/__tests__/integration/session-files.integration.test.js.map +0 -1
- package/dist/__tests__/schema.contract.test.d.ts +0 -19
- package/dist/__tests__/schema.contract.test.d.ts.map +0 -1
- package/dist/__tests__/schema.contract.test.js +0 -236
- package/dist/__tests__/schema.contract.test.js.map +0 -1
- package/dist/__tests__/smoke/error-handling.smoke.test.d.ts +0 -8
- package/dist/__tests__/smoke/error-handling.smoke.test.d.ts.map +0 -1
- package/dist/__tests__/smoke/error-handling.smoke.test.js +0 -66
- package/dist/__tests__/smoke/error-handling.smoke.test.js.map +0 -1
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.d.ts +0 -8
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.d.ts.map +0 -1
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.js +0 -112
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.js.map +0 -1
- package/dist/__tests__/telemetry/filterDsl.unit.test.d.ts +0 -12
- package/dist/__tests__/telemetry/filterDsl.unit.test.d.ts.map +0 -1
- package/dist/__tests__/telemetry/filterDsl.unit.test.js +0 -374
- package/dist/__tests__/telemetry/filterDsl.unit.test.js.map +0 -1
- package/dist/__tests__/telemetry/filterPresets.unit.test.d.ts +0 -10
- package/dist/__tests__/telemetry/filterPresets.unit.test.d.ts.map +0 -1
- package/dist/__tests__/telemetry/filterPresets.unit.test.js +0 -89
- package/dist/__tests__/telemetry/filterPresets.unit.test.js.map +0 -1
- package/dist/__testutils__/FakeClock.d.ts +0 -67
- package/dist/__testutils__/FakeClock.d.ts.map +0 -1
- package/dist/__testutils__/FakeClock.js +0 -132
- package/dist/__testutils__/FakeClock.js.map +0 -1
- package/dist/__testutils__/FakeWebSocket.d.ts +0 -106
- package/dist/__testutils__/FakeWebSocket.d.ts.map +0 -1
- package/dist/__testutils__/FakeWebSocket.js +0 -213
- package/dist/__testutils__/FakeWebSocket.js.map +0 -1
- package/dist/__testutils__/assertions.d.ts +0 -33
- package/dist/__testutils__/assertions.d.ts.map +0 -1
- package/dist/__testutils__/assertions.js +0 -57
- package/dist/__testutils__/assertions.js.map +0 -1
- package/dist/__testutils__/commandRunner.d.ts +0 -45
- package/dist/__testutils__/commandRunner.d.ts.map +0 -1
- package/dist/__testutils__/commandRunner.js +0 -108
- package/dist/__testutils__/commandRunner.js.map +0 -1
- package/dist/__testutils__/daemonHelpers.d.ts +0 -93
- package/dist/__testutils__/daemonHelpers.d.ts.map +0 -1
- package/dist/__testutils__/daemonHelpers.js +0 -255
- package/dist/__testutils__/daemonHelpers.js.map +0 -1
- package/dist/__testutils__/index.d.ts +0 -16
- package/dist/__testutils__/index.d.ts.map +0 -1
- package/dist/__testutils__/index.js +0 -16
- package/dist/__testutils__/index.js.map +0 -1
- package/dist/__testutils__/testCleanup.d.ts +0 -45
- package/dist/__testutils__/testCleanup.d.ts.map +0 -1
- package/dist/__testutils__/testCleanup.js +0 -87
- package/dist/__testutils__/testCleanup.js.map +0 -1
- package/dist/__testutils__/testClock.d.ts +0 -28
- package/dist/__testutils__/testClock.d.ts.map +0 -1
- package/dist/__testutils__/testClock.js +0 -81
- package/dist/__testutils__/testClock.js.map +0 -1
- package/dist/__testutils__/testFixtures.d.ts +0 -15
- package/dist/__testutils__/testFixtures.d.ts.map +0 -1
- package/dist/__testutils__/testFixtures.js +0 -23
- package/dist/__testutils__/testFixtures.js.map +0 -1
- package/dist/__testutils__/testHome.d.ts +0 -26
- package/dist/__testutils__/testHome.d.ts.map +0 -1
- package/dist/__testutils__/testHome.js +0 -57
- package/dist/__testutils__/testHome.js.map +0 -1
- package/dist/__testutils__/testProcess.d.ts +0 -46
- package/dist/__testutils__/testProcess.d.ts.map +0 -1
- package/dist/__testutils__/testProcess.js +0 -85
- package/dist/__testutils__/testProcess.js.map +0 -1
- package/dist/cdp/protocol.d.ts.map +0 -1
- package/dist/cdp/protocol.js.map +0 -1
- package/dist/cdp/schema.d.ts.map +0 -1
- package/dist/cdp/schema.js.map +0 -1
- package/dist/cdp/types.d.ts.map +0 -1
- package/dist/cdp/types.js.map +0 -1
- package/dist/commands/__tests__/cdp.contract.test.d.ts +0 -24
- package/dist/commands/__tests__/cdp.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/cdp.contract.test.js +0 -466
- package/dist/commands/__tests__/cdp.contract.test.js.map +0 -1
- package/dist/commands/__tests__/console.contract.test.d.ts +0 -9
- package/dist/commands/__tests__/console.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/console.contract.test.js +0 -118
- package/dist/commands/__tests__/console.contract.test.js.map +0 -1
- package/dist/commands/__tests__/domEval.contract.test.d.ts +0 -17
- package/dist/commands/__tests__/domEval.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/domEval.contract.test.js +0 -235
- package/dist/commands/__tests__/domEval.contract.test.js.map +0 -1
- package/dist/commands/__tests__/helpJson.contract.test.d.ts +0 -12
- package/dist/commands/__tests__/helpJson.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/helpJson.contract.test.js +0 -121
- package/dist/commands/__tests__/helpJson.contract.test.js.map +0 -1
- package/dist/commands/__tests__/machineReadableHelp.contract.test.d.ts +0 -12
- package/dist/commands/__tests__/machineReadableHelp.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/machineReadableHelp.contract.test.js +0 -121
- package/dist/commands/__tests__/machineReadableHelp.contract.test.js.map +0 -1
- package/dist/commands/cdp.d.ts.map +0 -1
- package/dist/commands/cdp.js.map +0 -1
- package/dist/commands/cleanup.d.ts.map +0 -1
- package/dist/commands/cleanup.js.map +0 -1
- package/dist/commands/console.d.ts.map +0 -1
- package/dist/commands/console.js.map +0 -1
- package/dist/commands/details.d.ts.map +0 -1
- package/dist/commands/details.js.map +0 -1
- package/dist/commands/dom/DomElementResolver.d.ts.map +0 -1
- package/dist/commands/dom/DomElementResolver.js.map +0 -1
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.d.ts +0 -2
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.d.ts.map +0 -1
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.js +0 -184
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.js.map +0 -1
- package/dist/commands/dom/a11y.d.ts.map +0 -1
- package/dist/commands/dom/a11y.js.map +0 -1
- package/dist/commands/dom/evalHelpers.d.ts +0 -38
- package/dist/commands/dom/evalHelpers.d.ts.map +0 -1
- package/dist/commands/dom/evalHelpers.js +0 -121
- package/dist/commands/dom/evalHelpers.js.map +0 -1
- package/dist/commands/dom/form.d.ts.map +0 -1
- package/dist/commands/dom/form.js.map +0 -1
- package/dist/commands/dom/formDiscovery.d.ts +0 -26
- package/dist/commands/dom/formDiscovery.d.ts.map +0 -1
- package/dist/commands/dom/formDiscovery.js.map +0 -1
- package/dist/commands/dom/formFillHelpers.d.ts +0 -186
- package/dist/commands/dom/formFillHelpers.d.ts.map +0 -1
- package/dist/commands/dom/formFillHelpers.js +0 -650
- package/dist/commands/dom/formFillHelpers.js.map +0 -1
- package/dist/commands/dom/formInteraction.d.ts.map +0 -1
- package/dist/commands/dom/formInteraction.js.map +0 -1
- package/dist/commands/dom/formSubmitHelpers.d.ts +0 -59
- package/dist/commands/dom/formSubmitHelpers.d.ts.map +0 -1
- package/dist/commands/dom/formSubmitHelpers.js +0 -163
- package/dist/commands/dom/formSubmitHelpers.js.map +0 -1
- package/dist/commands/dom/formTypes.d.ts +0 -75
- package/dist/commands/dom/formTypes.d.ts.map +0 -1
- package/dist/commands/dom/formTypes.js.map +0 -1
- package/dist/commands/dom/helpers.d.ts +0 -86
- package/dist/commands/dom/helpers.d.ts.map +0 -1
- package/dist/commands/dom/helpers.js +0 -656
- package/dist/commands/dom/helpers.js.map +0 -1
- package/dist/commands/dom/index.d.ts.map +0 -1
- package/dist/commands/dom/index.js.map +0 -1
- package/dist/commands/dom/keyMapping.d.ts +0 -56
- package/dist/commands/dom/keyMapping.d.ts.map +0 -1
- package/dist/commands/dom/keyMapping.js +0 -110
- package/dist/commands/dom/keyMapping.js.map +0 -1
- package/dist/commands/dom/reactEventHelpers.d.ts +0 -79
- package/dist/commands/dom/reactEventHelpers.d.ts.map +0 -1
- package/dist/commands/dom/reactEventHelpers.js +0 -239
- package/dist/commands/dom/reactEventHelpers.js.map +0 -1
- package/dist/commands/dom/screenshotResize.d.ts.map +0 -1
- package/dist/commands/dom/screenshotResize.js.map +0 -1
- package/dist/commands/helpJson.d.ts.map +0 -1
- package/dist/commands/helpJson.js.map +0 -1
- package/dist/commands/machineReadableHelp.d.ts +0 -165
- package/dist/commands/machineReadableHelp.d.ts.map +0 -1
- package/dist/commands/machineReadableHelp.js +0 -252
- package/dist/commands/machineReadableHelp.js.map +0 -1
- package/dist/commands/network/har.d.ts.map +0 -1
- package/dist/commands/network/har.js.map +0 -1
- package/dist/commands/network/index.d.ts.map +0 -1
- package/dist/commands/network/index.js.map +0 -1
- package/dist/commands/network/list.d.ts.map +0 -1
- package/dist/commands/network/list.js.map +0 -1
- package/dist/commands/network/shared.d.ts.map +0 -1
- package/dist/commands/network/shared.js.map +0 -1
- package/dist/commands/network.d.ts +0 -8
- package/dist/commands/network.d.ts.map +0 -1
- package/dist/commands/network.js +0 -216
- package/dist/commands/network.js.map +0 -1
- package/dist/commands/optionBehaviors.d.ts.map +0 -1
- package/dist/commands/optionBehaviors.js.map +0 -1
- package/dist/commands/peek.d.ts.map +0 -1
- package/dist/commands/peek.js.map +0 -1
- package/dist/commands/shared/CommandRunner.d.ts.map +0 -1
- package/dist/commands/shared/CommandRunner.js.map +0 -1
- package/dist/commands/shared/__tests__/validation.unit.test.d.ts +0 -7
- package/dist/commands/shared/__tests__/validation.unit.test.d.ts.map +0 -1
- package/dist/commands/shared/__tests__/validation.unit.test.js +0 -141
- package/dist/commands/shared/__tests__/validation.unit.test.js.map +0 -1
- package/dist/commands/shared/commonOptions.d.ts.map +0 -1
- package/dist/commands/shared/commonOptions.js.map +0 -1
- package/dist/commands/shared/daemonErrorHandler.d.ts.map +0 -1
- package/dist/commands/shared/daemonErrorHandler.js.map +0 -1
- package/dist/commands/shared/dataFetcher.d.ts.map +0 -1
- package/dist/commands/shared/dataFetcher.js.map +0 -1
- package/dist/commands/shared/followMode.d.ts.map +0 -1
- package/dist/commands/shared/followMode.js.map +0 -1
- package/dist/commands/shared/landingPage.d.ts.map +0 -1
- package/dist/commands/shared/landingPage.js.map +0 -1
- package/dist/commands/shared/optionTypes.d.ts.map +0 -1
- package/dist/commands/shared/optionTypes.js.map +0 -1
- package/dist/commands/shared/startHelpers.d.ts.map +0 -1
- package/dist/commands/shared/startHelpers.js.map +0 -1
- package/dist/commands/shared/validation.d.ts.map +0 -1
- package/dist/commands/shared/validation.js.map +0 -1
- package/dist/commands/start.d.ts.map +0 -1
- package/dist/commands/start.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/stop.d.ts.map +0 -1
- package/dist/commands/stop.js.map +0 -1
- package/dist/commands/tail.d.ts.map +0 -1
- package/dist/commands/tail.js.map +0 -1
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands/types.js.map +0 -1
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js.map +0 -1
- package/dist/connection/__tests__/cdp.contract.test.d.ts +0 -16
- package/dist/connection/__tests__/cdp.contract.test.d.ts.map +0 -1
- package/dist/connection/__tests__/cdp.contract.test.js +0 -377
- package/dist/connection/__tests__/cdp.contract.test.js.map +0 -1
- package/dist/connection/__tests__/flagsBuilder.unit.test.d.ts +0 -9
- package/dist/connection/__tests__/flagsBuilder.unit.test.d.ts.map +0 -1
- package/dist/connection/__tests__/flagsBuilder.unit.test.js +0 -94
- package/dist/connection/__tests__/flagsBuilder.unit.test.js.map +0 -1
- package/dist/connection/__tests__/handlers.unit.test.d.ts +0 -11
- package/dist/connection/__tests__/handlers.unit.test.d.ts.map +0 -1
- package/dist/connection/__tests__/handlers.unit.test.js +0 -220
- package/dist/connection/__tests__/handlers.unit.test.js.map +0 -1
- package/dist/connection/__tests__/pageReadiness.contract.test.d.ts +0 -14
- package/dist/connection/__tests__/pageReadiness.contract.test.d.ts.map +0 -1
- package/dist/connection/__tests__/pageReadiness.contract.test.js +0 -382
- package/dist/connection/__tests__/pageReadiness.contract.test.js.map +0 -1
- package/dist/connection/__tests__/portReservation.contract.test.d.ts +0 -14
- package/dist/connection/__tests__/portReservation.contract.test.d.ts.map +0 -1
- package/dist/connection/__tests__/portReservation.contract.test.js +0 -250
- package/dist/connection/__tests__/portReservation.contract.test.js.map +0 -1
- package/dist/connection/cdp.d.ts.map +0 -1
- package/dist/connection/cdp.js.map +0 -1
- package/dist/connection/config.d.ts.map +0 -1
- package/dist/connection/config.js.map +0 -1
- package/dist/connection/diagnostics.d.ts.map +0 -1
- package/dist/connection/diagnostics.js.map +0 -1
- package/dist/connection/errors.d.ts.map +0 -1
- package/dist/connection/errors.js.map +0 -1
- package/dist/connection/events.d.ts.map +0 -1
- package/dist/connection/events.js.map +0 -1
- package/dist/connection/handlers.d.ts.map +0 -1
- package/dist/connection/handlers.js.map +0 -1
- package/dist/connection/launcher/binaryResolver.d.ts.map +0 -1
- package/dist/connection/launcher/binaryResolver.js.map +0 -1
- package/dist/connection/launcher/flagsBuilder.d.ts.map +0 -1
- package/dist/connection/launcher/flagsBuilder.js.map +0 -1
- package/dist/connection/launcher/preferencesLoader.d.ts.map +0 -1
- package/dist/connection/launcher/preferencesLoader.js.map +0 -1
- package/dist/connection/launcher.d.ts.map +0 -1
- package/dist/connection/launcher.js.map +0 -1
- package/dist/connection/pageReadiness.d.ts.map +0 -1
- package/dist/connection/pageReadiness.js.map +0 -1
- package/dist/connection/portReservation.d.ts.map +0 -1
- package/dist/connection/portReservation.js.map +0 -1
- package/dist/connection/typed-cdp.d.ts.map +0 -1
- package/dist/connection/typed-cdp.js.map +0 -1
- package/dist/connection/types.d.ts.map +0 -1
- package/dist/connection/types.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/daemon/__tests__/JsonlParser.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/JsonlParser.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/JsonlParser.unit.test.js +0 -140
- package/dist/daemon/__tests__/JsonlParser.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.js +0 -276
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/TelemetryStore.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/TelemetryStore.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/TelemetryStore.unit.test.js +0 -290
- package/dist/daemon/__tests__/TelemetryStore.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/commandRegistry.contract.test.d.ts +0 -8
- package/dist/daemon/__tests__/commandRegistry.contract.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/commandRegistry.contract.test.js +0 -647
- package/dist/daemon/__tests__/commandRegistry.contract.test.js.map +0 -1
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.d.ts +0 -19
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.js +0 -212
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/ipcServer.contract.test.d.ts +0 -23
- package/dist/daemon/__tests__/ipcServer.contract.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/ipcServer.contract.test.js +0 -416
- package/dist/daemon/__tests__/ipcServer.contract.test.js.map +0 -1
- package/dist/daemon/__tests__/launcher.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/launcher.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/launcher.unit.test.js +0 -20
- package/dist/daemon/__tests__/launcher.unit.test.js.map +0 -1
- package/dist/daemon/errors.d.ts.map +0 -1
- package/dist/daemon/errors.js.map +0 -1
- package/dist/daemon/handlers/BaseHandler.d.ts +0 -75
- package/dist/daemon/handlers/BaseHandler.d.ts.map +0 -1
- package/dist/daemon/handlers/BaseHandler.js +0 -103
- package/dist/daemon/handlers/BaseHandler.js.map +0 -1
- package/dist/daemon/handlers/CommandHandlers.d.ts +0 -36
- package/dist/daemon/handlers/CommandHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/CommandHandlers.js +0 -60
- package/dist/daemon/handlers/CommandHandlers.js.map +0 -1
- package/dist/daemon/handlers/QueryHandlers.d.ts +0 -37
- package/dist/daemon/handlers/QueryHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/QueryHandlers.js +0 -126
- package/dist/daemon/handlers/QueryHandlers.js.map +0 -1
- package/dist/daemon/handlers/SessionHandlers.d.ts +0 -32
- package/dist/daemon/handlers/SessionHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/SessionHandlers.js +0 -213
- package/dist/daemon/handlers/SessionHandlers.js.map +0 -1
- package/dist/daemon/handlers/pendingRequests.d.ts +0 -50
- package/dist/daemon/handlers/pendingRequests.d.ts.map +0 -1
- package/dist/daemon/handlers/pendingRequests.js +0 -57
- package/dist/daemon/handlers/pendingRequests.js.map +0 -1
- package/dist/daemon/handlers/requestHandlers.d.ts +0 -55
- package/dist/daemon/handlers/requestHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/requestHandlers.js +0 -66
- package/dist/daemon/handlers/requestHandlers.js.map +0 -1
- package/dist/daemon/handlers/responseHandler.d.ts +0 -42
- package/dist/daemon/handlers/responseHandler.d.ts.map +0 -1
- package/dist/daemon/handlers/responseHandler.js +0 -217
- package/dist/daemon/handlers/responseHandler.js.map +0 -1
- package/dist/daemon/ipcServer.d.ts.map +0 -1
- package/dist/daemon/ipcServer.js.map +0 -1
- package/dist/daemon/launcher.d.ts.map +0 -1
- package/dist/daemon/launcher.js.map +0 -1
- package/dist/daemon/lifecycle/cdpSetup.d.ts +0 -24
- package/dist/daemon/lifecycle/cdpSetup.d.ts.map +0 -1
- package/dist/daemon/lifecycle/cdpSetup.js +0 -55
- package/dist/daemon/lifecycle/cdpSetup.js.map +0 -1
- package/dist/daemon/lifecycle/chromeConnection.d.ts +0 -17
- package/dist/daemon/lifecycle/chromeConnection.d.ts.map +0 -1
- package/dist/daemon/lifecycle/chromeConnection.js +0 -79
- package/dist/daemon/lifecycle/chromeConnection.js.map +0 -1
- package/dist/daemon/lifecycle/signalHandlers.d.ts +0 -14
- package/dist/daemon/lifecycle/signalHandlers.d.ts.map +0 -1
- package/dist/daemon/lifecycle/signalHandlers.js +0 -48
- package/dist/daemon/lifecycle/signalHandlers.js.map +0 -1
- package/dist/daemon/lifecycle/workerCleanup.d.ts +0 -27
- package/dist/daemon/lifecycle/workerCleanup.d.ts.map +0 -1
- package/dist/daemon/lifecycle/workerCleanup.js +0 -143
- package/dist/daemon/lifecycle/workerCleanup.js.map +0 -1
- package/dist/daemon/lifecycle/workerConfig.d.ts +0 -14
- package/dist/daemon/lifecycle/workerConfig.d.ts.map +0 -1
- package/dist/daemon/lifecycle/workerConfig.js +0 -69
- package/dist/daemon/lifecycle/workerConfig.js.map +0 -1
- package/dist/daemon/lifecycle/workerIpc.d.ts +0 -14
- package/dist/daemon/lifecycle/workerIpc.d.ts.map +0 -1
- package/dist/daemon/lifecycle/workerIpc.js +0 -86
- package/dist/daemon/lifecycle/workerIpc.js.map +0 -1
- package/dist/daemon/patternDefinitions.d.ts.map +0 -1
- package/dist/daemon/patternDefinitions.js.map +0 -1
- package/dist/daemon/patternDetector.d.ts.map +0 -1
- package/dist/daemon/patternDetector.js.map +0 -1
- package/dist/daemon/server/JsonlParser.d.ts +0 -31
- package/dist/daemon/server/JsonlParser.d.ts.map +0 -1
- package/dist/daemon/server/JsonlParser.js +0 -55
- package/dist/daemon/server/JsonlParser.js.map +0 -1
- package/dist/daemon/server/SocketServer.d.ts.map +0 -1
- package/dist/daemon/server/SocketServer.js.map +0 -1
- package/dist/daemon/server/WorkerManager.d.ts +0 -36
- package/dist/daemon/server/WorkerManager.d.ts.map +0 -1
- package/dist/daemon/server/WorkerManager.js +0 -89
- package/dist/daemon/server/WorkerManager.js.map +0 -1
- package/dist/daemon/services/SessionService.d.ts +0 -87
- package/dist/daemon/services/SessionService.d.ts.map +0 -1
- package/dist/daemon/services/SessionService.js +0 -45
- package/dist/daemon/services/SessionService.js.map +0 -1
- package/dist/daemon/startSession.d.ts +0 -55
- package/dist/daemon/startSession.d.ts.map +0 -1
- package/dist/daemon/startSession.js +0 -168
- package/dist/daemon/startSession.js.map +0 -1
- package/dist/daemon/worker/TelemetryStore.d.ts +0 -19
- package/dist/daemon/worker/TelemetryStore.d.ts.map +0 -1
- package/dist/daemon/worker/TelemetryStore.js +0 -53
- package/dist/daemon/worker/TelemetryStore.js.map +0 -1
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.d.ts +0 -11
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.d.ts.map +0 -1
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.js +0 -136
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.js.map +0 -1
- package/dist/daemon/worker/collectors.d.ts.map +0 -1
- package/dist/daemon/worker/collectors.js.map +0 -1
- package/dist/daemon/worker/commandRegistry.d.ts.map +0 -1
- package/dist/daemon/worker/commandRegistry.js +0 -236
- package/dist/daemon/worker/commandRegistry.js.map +0 -1
- package/dist/daemon/worker/plugins.d.ts.map +0 -1
- package/dist/daemon/worker/plugins.js +0 -75
- package/dist/daemon/worker/plugins.js.map +0 -1
- package/dist/daemon/worker/types.d.ts.map +0 -1
- package/dist/daemon/worker/types.js.map +0 -1
- package/dist/daemon/worker.d.ts +0 -9
- package/dist/daemon/worker.d.ts.map +0 -1
- package/dist/daemon/worker.js +0 -98
- package/dist/daemon/worker.js.map +0 -1
- package/dist/daemon/workerIpc.d.ts +0 -33
- package/dist/daemon/workerIpc.d.ts.map +0 -1
- package/dist/daemon/workerIpc.js +0 -8
- package/dist/daemon/workerIpc.js.map +0 -1
- package/dist/daemon.d.ts.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ipc/__tests__/client.contract.test.d.ts +0 -8
- package/dist/ipc/__tests__/client.contract.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/client.contract.test.js +0 -693
- package/dist/ipc/__tests__/client.contract.test.js.map +0 -1
- package/dist/ipc/__tests__/errors.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/errors.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/errors.unit.test.js +0 -77
- package/dist/ipc/__tests__/errors.unit.test.js.map +0 -1
- package/dist/ipc/__tests__/guards.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/guards.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/guards.unit.test.js +0 -73
- package/dist/ipc/__tests__/guards.unit.test.js.map +0 -1
- package/dist/ipc/__tests__/jsonl.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/jsonl.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/jsonl.unit.test.js +0 -103
- package/dist/ipc/__tests__/jsonl.unit.test.js.map +0 -1
- package/dist/ipc/__tests__/validation.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/validation.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/validation.unit.test.js +0 -60
- package/dist/ipc/__tests__/validation.unit.test.js.map +0 -1
- package/dist/ipc/client.d.ts.map +0 -1
- package/dist/ipc/client.js.map +0 -1
- package/dist/ipc/index.d.ts.map +0 -1
- package/dist/ipc/index.js.map +0 -1
- package/dist/ipc/protocol/commands.d.ts.map +0 -1
- package/dist/ipc/protocol/commands.js.map +0 -1
- package/dist/ipc/protocol/guards.d.ts.map +0 -1
- package/dist/ipc/protocol/guards.js.map +0 -1
- package/dist/ipc/protocol/index.d.ts.map +0 -1
- package/dist/ipc/protocol/index.js.map +0 -1
- package/dist/ipc/protocol/messages.d.ts.map +0 -1
- package/dist/ipc/protocol/messages.js.map +0 -1
- package/dist/ipc/session/errors.d.ts.map +0 -1
- package/dist/ipc/session/errors.js.map +0 -1
- package/dist/ipc/session/index.d.ts.map +0 -1
- package/dist/ipc/session/index.js.map +0 -1
- package/dist/ipc/session/lifecycle.d.ts.map +0 -1
- package/dist/ipc/session/lifecycle.js.map +0 -1
- package/dist/ipc/session/queries.d.ts.map +0 -1
- package/dist/ipc/session/queries.js.map +0 -1
- package/dist/ipc/session/types.d.ts.map +0 -1
- package/dist/ipc/session/types.js.map +0 -1
- package/dist/ipc/transport/IPCError.d.ts.map +0 -1
- package/dist/ipc/transport/IPCError.js.map +0 -1
- package/dist/ipc/transport/errors.d.ts.map +0 -1
- package/dist/ipc/transport/errors.js.map +0 -1
- package/dist/ipc/transport/index.d.ts.map +0 -1
- package/dist/ipc/transport/index.js.map +0 -1
- package/dist/ipc/transport/jsonl.d.ts.map +0 -1
- package/dist/ipc/transport/jsonl.js.map +0 -1
- package/dist/ipc/transport/socket.d.ts.map +0 -1
- package/dist/ipc/transport/socket.js.map +0 -1
- package/dist/ipc/transport/validation.d.ts.map +0 -1
- package/dist/ipc/transport/validation.js.map +0 -1
- package/dist/ipc/utils/errors.d.ts.map +0 -1
- package/dist/ipc/utils/errors.js.map +0 -1
- package/dist/ipc/utils/index.d.ts.map +0 -1
- package/dist/ipc/utils/index.js.map +0 -1
- package/dist/ipc/utils/requestId.d.ts +0 -23
- package/dist/ipc/utils/requestId.d.ts.map +0 -1
- package/dist/ipc/utils/requestId.js +0 -27
- package/dist/ipc/utils/requestId.js.map +0 -1
- package/dist/ipc/utils/responseValidator.d.ts.map +0 -1
- package/dist/ipc/utils/responseValidator.js.map +0 -1
- package/dist/ipc/utils/session.d.ts.map +0 -1
- package/dist/ipc/utils/session.js.map +0 -1
- package/dist/ipc/utils/types.d.ts.map +0 -1
- package/dist/ipc/utils/types.js.map +0 -1
- package/dist/session/QueryCacheManager.d.ts.map +0 -1
- package/dist/session/QueryCacheManager.js.map +0 -1
- package/dist/session/__tests__/chrome-cache.contract.test.d.ts +0 -7
- package/dist/session/__tests__/chrome-cache.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/chrome-cache.contract.test.js +0 -77
- package/dist/session/__tests__/chrome-cache.contract.test.js.map +0 -1
- package/dist/session/__tests__/cleanup.contract.test.d.ts +0 -7
- package/dist/session/__tests__/cleanup.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/cleanup.contract.test.js +0 -84
- package/dist/session/__tests__/cleanup.contract.test.js.map +0 -1
- package/dist/session/__tests__/lock.contract.test.d.ts +0 -7
- package/dist/session/__tests__/lock.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/lock.contract.test.js +0 -77
- package/dist/session/__tests__/lock.contract.test.js.map +0 -1
- package/dist/session/__tests__/metadata.contract.test.d.ts +0 -7
- package/dist/session/__tests__/metadata.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/metadata.contract.test.js +0 -87
- package/dist/session/__tests__/metadata.contract.test.js.map +0 -1
- package/dist/session/chrome.d.ts.map +0 -1
- package/dist/session/chrome.js.map +0 -1
- package/dist/session/cleanup.d.ts +0 -141
- package/dist/session/cleanup.d.ts.map +0 -1
- package/dist/session/cleanup.js +0 -514
- package/dist/session/cleanup.js.map +0 -1
- package/dist/session/lock.d.ts +0 -57
- package/dist/session/lock.d.ts.map +0 -1
- package/dist/session/lock.js +0 -165
- package/dist/session/lock.js.map +0 -1
- package/dist/session/metadata.d.ts.map +0 -1
- package/dist/session/metadata.js.map +0 -1
- package/dist/session/output.d.ts +0 -18
- package/dist/session/output.d.ts.map +0 -1
- package/dist/session/output.js +0 -24
- package/dist/session/output.js.map +0 -1
- package/dist/session/paths.d.ts.map +0 -1
- package/dist/session/paths.js.map +0 -1
- package/dist/session/pid.d.ts.map +0 -1
- package/dist/session/pid.js.map +0 -1
- package/dist/session/port.d.ts.map +0 -1
- package/dist/session/port.js.map +0 -1
- package/dist/session/process.d.ts +0 -8
- package/dist/session/process.d.ts.map +0 -1
- package/dist/session/process.js +0 -8
- package/dist/session/process.js.map +0 -1
- package/dist/session/queryCache.d.ts +0 -46
- package/dist/session/queryCache.d.ts.map +0 -1
- package/dist/session/queryCache.js +0 -54
- package/dist/session/queryCache.js.map +0 -1
- package/dist/session/statusData.d.ts.map +0 -1
- package/dist/session/statusData.js.map +0 -1
- package/dist/telemetry/__tests__/a11y.unit.test.d.ts +0 -10
- package/dist/telemetry/__tests__/a11y.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/a11y.unit.test.js +0 -265
- package/dist/telemetry/__tests__/a11y.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/filters.unit.test.d.ts +0 -2
- package/dist/telemetry/__tests__/filters.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/filters.unit.test.js +0 -357
- package/dist/telemetry/__tests__/filters.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/navigation.contract.test.d.ts +0 -8
- package/dist/telemetry/__tests__/navigation.contract.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/navigation.contract.test.js +0 -211
- package/dist/telemetry/__tests__/navigation.contract.test.js.map +0 -1
- package/dist/telemetry/__tests__/network.contract.test.d.ts +0 -8
- package/dist/telemetry/__tests__/network.contract.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/network.contract.test.js +0 -623
- package/dist/telemetry/__tests__/network.contract.test.js.map +0 -1
- package/dist/telemetry/__tests__/remoteObject.unit.test.d.ts +0 -2
- package/dist/telemetry/__tests__/remoteObject.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/remoteObject.unit.test.js +0 -261
- package/dist/telemetry/__tests__/remoteObject.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/roleInference.unit.test.d.ts +0 -9
- package/dist/telemetry/__tests__/roleInference.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/roleInference.unit.test.js +0 -138
- package/dist/telemetry/__tests__/roleInference.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/utils.unit.test.d.ts +0 -7
- package/dist/telemetry/__tests__/utils.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/utils.unit.test.js +0 -91
- package/dist/telemetry/__tests__/utils.unit.test.js.map +0 -1
- package/dist/telemetry/a11y.d.ts.map +0 -1
- package/dist/telemetry/a11y.js.map +0 -1
- package/dist/telemetry/console.d.ts.map +0 -1
- package/dist/telemetry/console.js.map +0 -1
- package/dist/telemetry/dialogs.d.ts.map +0 -1
- package/dist/telemetry/dialogs.js.map +0 -1
- package/dist/telemetry/dom.d.ts.map +0 -1
- package/dist/telemetry/dom.js.map +0 -1
- package/dist/telemetry/filterDsl.d.ts.map +0 -1
- package/dist/telemetry/filterDsl.js.map +0 -1
- package/dist/telemetry/filterPresets.d.ts.map +0 -1
- package/dist/telemetry/filterPresets.js.map +0 -1
- package/dist/telemetry/filters.d.ts.map +0 -1
- package/dist/telemetry/filters.js.map +0 -1
- package/dist/telemetry/har/__tests__/builder.unit.test.d.ts +0 -8
- package/dist/telemetry/har/__tests__/builder.unit.test.d.ts.map +0 -1
- package/dist/telemetry/har/__tests__/builder.unit.test.js +0 -694
- package/dist/telemetry/har/__tests__/builder.unit.test.js.map +0 -1
- package/dist/telemetry/har/builder.d.ts.map +0 -1
- package/dist/telemetry/har/builder.js.map +0 -1
- package/dist/telemetry/har/types.d.ts.map +0 -1
- package/dist/telemetry/har/types.js.map +0 -1
- package/dist/telemetry/navigation.d.ts.map +0 -1
- package/dist/telemetry/navigation.js.map +0 -1
- package/dist/telemetry/network.d.ts.map +0 -1
- package/dist/telemetry/network.js.map +0 -1
- package/dist/telemetry/objectExpander.d.ts.map +0 -1
- package/dist/telemetry/objectExpander.js.map +0 -1
- package/dist/telemetry/remoteObject.d.ts.map +0 -1
- package/dist/telemetry/remoteObject.js.map +0 -1
- package/dist/telemetry/remoteObjectUtils.d.ts.map +0 -1
- package/dist/telemetry/remoteObjectUtils.js.map +0 -1
- package/dist/telemetry/roleInference.d.ts.map +0 -1
- package/dist/telemetry/roleInference.js.map +0 -1
- package/dist/telemetry/utils.d.ts.map +0 -1
- package/dist/telemetry/utils.js.map +0 -1
- package/dist/types/dom.d.ts +0 -77
- package/dist/types/dom.d.ts.map +0 -1
- package/dist/types/dom.js +0 -8
- package/dist/types/dom.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/ui/OutputBuilder.d.ts.map +0 -1
- package/dist/ui/OutputBuilder.js.map +0 -1
- package/dist/ui/errors/CommandError.d.ts.map +0 -1
- package/dist/ui/errors/CommandError.js.map +0 -1
- package/dist/ui/errors/index.d.ts.map +0 -1
- package/dist/ui/errors/index.js.map +0 -1
- package/dist/ui/errors/utils.d.ts.map +0 -1
- package/dist/ui/errors/utils.js.map +0 -1
- package/dist/ui/formatters/__tests__/preview.unit.test.d.ts +0 -13
- package/dist/ui/formatters/__tests__/preview.unit.test.d.ts.map +0 -1
- package/dist/ui/formatters/__tests__/preview.unit.test.js +0 -180
- package/dist/ui/formatters/__tests__/preview.unit.test.js.map +0 -1
- package/dist/ui/formatters/__tests__/semantic.unit.test.d.ts +0 -2
- package/dist/ui/formatters/__tests__/semantic.unit.test.d.ts.map +0 -1
- package/dist/ui/formatters/__tests__/semantic.unit.test.js +0 -111
- package/dist/ui/formatters/__tests__/semantic.unit.test.js.map +0 -1
- package/dist/ui/formatters/a11y.d.ts.map +0 -1
- package/dist/ui/formatters/a11y.js.map +0 -1
- package/dist/ui/formatters/console.d.ts.map +0 -1
- package/dist/ui/formatters/console.js.map +0 -1
- package/dist/ui/formatters/cookies.d.ts.map +0 -1
- package/dist/ui/formatters/cookies.js.map +0 -1
- package/dist/ui/formatters/details.d.ts.map +0 -1
- package/dist/ui/formatters/details.js.map +0 -1
- package/dist/ui/formatters/dom.d.ts.map +0 -1
- package/dist/ui/formatters/dom.js.map +0 -1
- package/dist/ui/formatters/form.d.ts.map +0 -1
- package/dist/ui/formatters/form.js.map +0 -1
- package/dist/ui/formatters/helpFormatters.d.ts.map +0 -1
- package/dist/ui/formatters/helpFormatters.js.map +0 -1
- package/dist/ui/formatters/index.d.ts.map +0 -1
- package/dist/ui/formatters/index.js.map +0 -1
- package/dist/ui/formatters/networkHeaders.d.ts.map +0 -1
- package/dist/ui/formatters/networkHeaders.js.map +0 -1
- package/dist/ui/formatters/networkList.d.ts.map +0 -1
- package/dist/ui/formatters/networkList.js.map +0 -1
- package/dist/ui/formatters/preview.d.ts.map +0 -1
- package/dist/ui/formatters/preview.js.map +0 -1
- package/dist/ui/formatters/semantic.d.ts.map +0 -1
- package/dist/ui/formatters/semantic.js.map +0 -1
- package/dist/ui/formatters/sessionFormatters.d.ts.map +0 -1
- package/dist/ui/formatters/sessionFormatters.js.map +0 -1
- package/dist/ui/formatters/status.d.ts.map +0 -1
- package/dist/ui/formatters/status.js.map +0 -1
- package/dist/ui/formatting.d.ts.map +0 -1
- package/dist/ui/formatting.js.map +0 -1
- package/dist/ui/logging/index.d.ts.map +0 -1
- package/dist/ui/logging/index.js.map +0 -1
- package/dist/ui/logging/logger.d.ts.map +0 -1
- package/dist/ui/logging/logger.js.map +0 -1
- package/dist/ui/messages/chrome.d.ts.map +0 -1
- package/dist/ui/messages/chrome.js.map +0 -1
- package/dist/ui/messages/commands.d.ts.map +0 -1
- package/dist/ui/messages/commands.js.map +0 -1
- package/dist/ui/messages/consoleMessages.d.ts.map +0 -1
- package/dist/ui/messages/consoleMessages.js.map +0 -1
- package/dist/ui/messages/debug.d.ts +0 -168
- package/dist/ui/messages/debug.d.ts.map +0 -1
- package/dist/ui/messages/debug.js +0 -219
- package/dist/ui/messages/debug.js.map +0 -1
- package/dist/ui/messages/dom.d.ts +0 -14
- package/dist/ui/messages/dom.d.ts.map +0 -1
- package/dist/ui/messages/dom.js +0 -28
- package/dist/ui/messages/dom.js.map +0 -1
- package/dist/ui/messages/errors.d.ts +0 -233
- package/dist/ui/messages/errors.d.ts.map +0 -1
- package/dist/ui/messages/errors.js +0 -395
- package/dist/ui/messages/errors.js.map +0 -1
- package/dist/ui/messages/hints.d.ts.map +0 -1
- package/dist/ui/messages/hints.js.map +0 -1
- package/dist/ui/messages/internal.d.ts +0 -23
- package/dist/ui/messages/internal.d.ts.map +0 -1
- package/dist/ui/messages/internal.js +0 -27
- package/dist/ui/messages/internal.js.map +0 -1
- package/dist/ui/messages/networkMessages.d.ts.map +0 -1
- package/dist/ui/messages/networkMessages.js.map +0 -1
- package/dist/ui/messages/preview.d.ts.map +0 -1
- package/dist/ui/messages/preview.js.map +0 -1
- package/dist/ui/messages/session.d.ts.map +0 -1
- package/dist/ui/messages/session.js.map +0 -1
- package/dist/ui/messages/validation.d.ts.map +0 -1
- package/dist/ui/messages/validation.js.map +0 -1
- package/dist/utils/__tests__/atomicFile.test.d.ts +0 -2
- package/dist/utils/__tests__/atomicFile.test.d.ts.map +0 -1
- package/dist/utils/__tests__/atomicFile.test.js +0 -43
- package/dist/utils/__tests__/atomicFile.test.js.map +0 -1
- package/dist/utils/__tests__/errors.unit.test.d.ts +0 -12
- package/dist/utils/__tests__/errors.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/errors.unit.test.js +0 -255
- package/dist/utils/__tests__/errors.unit.test.js.map +0 -1
- package/dist/utils/__tests__/http.unit.test.d.ts +0 -12
- package/dist/utils/__tests__/http.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/http.unit.test.js +0 -218
- package/dist/utils/__tests__/http.unit.test.js.map +0 -1
- package/dist/utils/__tests__/objects.test.d.ts +0 -2
- package/dist/utils/__tests__/objects.test.d.ts.map +0 -1
- package/dist/utils/__tests__/objects.test.js +0 -50
- package/dist/utils/__tests__/objects.test.js.map +0 -1
- package/dist/utils/__tests__/process.unit.test.d.ts +0 -14
- package/dist/utils/__tests__/process.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/process.unit.test.js +0 -124
- package/dist/utils/__tests__/process.unit.test.js.map +0 -1
- package/dist/utils/__tests__/session.contract.test.d.ts +0 -2
- package/dist/utils/__tests__/session.contract.test.d.ts.map +0 -1
- package/dist/utils/__tests__/session.contract.test.js +0 -258
- package/dist/utils/__tests__/session.contract.test.js.map +0 -1
- package/dist/utils/__tests__/shellDetection.unit.test.d.ts +0 -12
- package/dist/utils/__tests__/shellDetection.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/shellDetection.unit.test.js +0 -220
- package/dist/utils/__tests__/shellDetection.unit.test.js.map +0 -1
- package/dist/utils/__tests__/url.test.d.ts +0 -2
- package/dist/utils/__tests__/url.test.d.ts.map +0 -1
- package/dist/utils/__tests__/url.test.js +0 -42
- package/dist/utils/__tests__/url.test.js.map +0 -1
- package/dist/utils/async.d.ts.map +0 -1
- package/dist/utils/async.js.map +0 -1
- package/dist/utils/atomicFile.d.ts.map +0 -1
- package/dist/utils/atomicFile.js.map +0 -1
- package/dist/utils/concurrency.d.ts.map +0 -1
- package/dist/utils/concurrency.js.map +0 -1
- package/dist/utils/daemonErrors.d.ts +0 -60
- package/dist/utils/daemonErrors.d.ts.map +0 -1
- package/dist/utils/daemonErrors.js +0 -58
- package/dist/utils/daemonErrors.js.map +0 -1
- package/dist/utils/decisionTrees.d.ts.map +0 -1
- package/dist/utils/decisionTrees.js.map +0 -1
- package/dist/utils/errorMapping.d.ts.map +0 -1
- package/dist/utils/errorMapping.js.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exitCodes.d.ts.map +0 -1
- package/dist/utils/exitCodes.js.map +0 -1
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/file.js.map +0 -1
- package/dist/utils/http.d.ts.map +0 -1
- package/dist/utils/http.js.map +0 -1
- package/dist/utils/levenshtein.d.ts.map +0 -1
- package/dist/utils/levenshtein.js.map +0 -1
- package/dist/utils/objects.d.ts.map +0 -1
- package/dist/utils/objects.js.map +0 -1
- package/dist/utils/process.d.ts.map +0 -1
- package/dist/utils/process.js.map +0 -1
- package/dist/utils/shellDetection.d.ts.map +0 -1
- package/dist/utils/shellDetection.js.map +0 -1
- package/dist/utils/strings.d.ts.map +0 -1
- package/dist/utils/strings.js.map +0 -1
- package/dist/utils/suggestions.d.ts.map +0 -1
- package/dist/utils/suggestions.js.map +0 -1
- package/dist/utils/taskMappings.d.ts.map +0 -1
- package/dist/utils/taskMappings.js.map +0 -1
- package/dist/utils/typeGuards.d.ts.map +0 -1
- package/dist/utils/typeGuards.js.map +0 -1
- package/dist/utils/url.d.ts.map +0 -1
- package/dist/utils/url.js.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js.map +0 -1
- /package/dist/daemon/{worker → session}/commandRegistry.d.ts +0 -0
- /package/dist/daemon/{worker → session}/types.js +0 -0
- /package/dist/{ui/errors → errors}/CommandError.d.ts +0 -0
- /package/dist/{ui/errors → errors}/index.js +0 -0
- /package/dist/{ui/errors → errors}/utils.d.ts +0 -0
- /package/dist/{commands → runtime}/dom/formTypes.js +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Chrome DevTools Protocol in your terminal. Opens a persistent connection to Chro
|
|
|
9
9
|
|
|
10
10
|
## Why bdg?
|
|
11
11
|
|
|
12
|
-
- **Raw CDP access** -
|
|
12
|
+
- **Raw CDP access** - Every [protocol method](https://chromedevtools.github.io/devtools-protocol/) available directly
|
|
13
13
|
- **Token efficient** - No overhead from MCP tool definitions; progressive discovery loads only what's needed
|
|
14
14
|
- **Self-correcting** - Errors clearly exposed with semantic exit codes and suggestions
|
|
15
15
|
- **Composable** - Unix philosophy: pipes, jq, shell scripts work naturally
|
|
@@ -33,9 +33,11 @@ We benchmarked bdg against Chrome DevTools MCP Server on real developer debuggin
|
|
|
33
33
|
## Install
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npm install -g browser-debugger-cli
|
|
36
|
+
npm install -g browser-debugger-cli
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
**Requirements:** Node.js 22.12+ and Chrome (or Chromium).
|
|
40
|
+
|
|
39
41
|
**Platform Support:**
|
|
40
42
|
- ✅ macOS and Linux
|
|
41
43
|
- ✅ Windows via WSL
|
|
@@ -50,25 +52,31 @@ bdg https://localhost:5173 --chrome-flags="--disable-web-security" # Disab
|
|
|
50
52
|
bdg cdp --search cookie # Discover commands
|
|
51
53
|
bdg cdp Network.getCookies # Run any CDP method
|
|
52
54
|
bdg dom query "button" # High-level helpers
|
|
55
|
+
bdg dom fill 'input[name="q"]' "shoes"
|
|
56
|
+
bdg dom click 'button:has-text("Search")'
|
|
57
|
+
bdg page navigate example.com/about
|
|
58
|
+
bdg eval "document.title" # Run JavaScript in the page (--frame for iframes)
|
|
59
|
+
bdg network list --preset errors # Network requests, console: bdg console
|
|
60
|
+
bdg dom listeners "#save" # Which event listeners run for an element
|
|
53
61
|
bdg stop # End session
|
|
54
62
|
```
|
|
55
63
|
|
|
56
64
|
## Current State
|
|
57
65
|
|
|
58
|
-
**Raw CDP access is complete.**
|
|
66
|
+
**Raw CDP access is complete.** Every protocol method works now. High-level commands cover the common work: page navigation, DOM queries and interaction (click, fill, hover, keys, forms, shadow DOM and iframes), accessibility tree, screenshots, network requests and HAR export, console messages and event listeners. See the [CLI reference](docs/CLI_REFERENCE.md) for every command, and `bdg --help --json` for the machine-readable version.
|
|
59
67
|
|
|
60
68
|
## Agent Discovery Pattern
|
|
61
69
|
|
|
62
70
|
```bash
|
|
63
71
|
# Agent explores what's possible (no docs needed)
|
|
64
|
-
bdg cdp --list #
|
|
65
|
-
bdg cdp Network --list #
|
|
72
|
+
bdg cdp --list # All domains
|
|
73
|
+
bdg cdp Network --list # Methods in one domain
|
|
66
74
|
bdg cdp Network.getCookies --describe # Full schema + examples
|
|
67
75
|
bdg cdp Network.getCookies # Execute
|
|
68
76
|
|
|
69
77
|
# Search across all domains
|
|
70
78
|
bdg cdp --search screenshot # Find relevant methods
|
|
71
|
-
bdg cdp --search cookie #
|
|
79
|
+
bdg cdp --search cookie # methods mentioning cookies
|
|
72
80
|
```
|
|
73
81
|
|
|
74
82
|
## Documentation
|
package/dist/cdp/protocol.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type { ProtocolSchema, Domain, Command } from './types.js';
|
|
|
20
20
|
* ```typescript
|
|
21
21
|
* const protocol = loadProtocol();
|
|
22
22
|
* console.log(`Protocol version: ${protocol.version.major}.${protocol.version.minor}`);
|
|
23
|
-
* console.log(`Domains: ${protocol.domains.length}`); //
|
|
23
|
+
* console.log(`Domains: ${protocol.domains.length}`); // browser + JS domains
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export declare function loadProtocol(): ProtocolSchema;
|
package/dist/cdp/protocol.js
CHANGED
|
@@ -24,7 +24,7 @@ let cachedProtocol = null;
|
|
|
24
24
|
* ```typescript
|
|
25
25
|
* const protocol = loadProtocol();
|
|
26
26
|
* console.log(`Protocol version: ${protocol.version.major}.${protocol.version.minor}`);
|
|
27
|
-
* console.log(`Domains: ${protocol.domains.length}`); //
|
|
27
|
+
* console.log(`Domains: ${protocol.domains.length}`); // browser + JS domains
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export function loadProtocol() {
|
package/dist/cdp/schema.d.ts
CHANGED
|
@@ -141,6 +141,16 @@ export declare function getDomainSummary(domainName: string): DomainSummary | un
|
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
143
|
export declare function getAllDomainSummaries(): DomainSummary[];
|
|
144
|
+
/**
|
|
145
|
+
* Domain and method counts of the bundled protocol (for help text).
|
|
146
|
+
*
|
|
147
|
+
* @returns Number of domains, of methods overall, and of methods per domain
|
|
148
|
+
*/
|
|
149
|
+
export declare function getProtocolCounts(): {
|
|
150
|
+
domains: number;
|
|
151
|
+
methods: number;
|
|
152
|
+
methodsIn: (domain: string) => number;
|
|
153
|
+
};
|
|
144
154
|
/**
|
|
145
155
|
* Search methods by keyword (case-insensitive).
|
|
146
156
|
*
|
package/dist/cdp/schema.js
CHANGED
|
@@ -220,6 +220,19 @@ export function getAllDomainSummaries() {
|
|
|
220
220
|
const protocol = loadProtocol();
|
|
221
221
|
return protocol.domains.map(buildDomainSummary);
|
|
222
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Domain and method counts of the bundled protocol (for help text).
|
|
225
|
+
*
|
|
226
|
+
* @returns Number of domains, of methods overall, and of methods per domain
|
|
227
|
+
*/
|
|
228
|
+
export function getProtocolCounts() {
|
|
229
|
+
const summaries = getAllDomainSummaries();
|
|
230
|
+
return {
|
|
231
|
+
domains: summaries.length,
|
|
232
|
+
methods: summaries.reduce((total, domain) => total + domain.commandCount, 0),
|
|
233
|
+
methodsIn: (domain) => summaries.find((d) => d.name === domain)?.commandCount ?? 0,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
223
236
|
/**
|
|
224
237
|
* Search methods by keyword (case-insensitive).
|
|
225
238
|
*
|
package/dist/commands/cdp.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { normalizeMethod } from '../cdp/protocol.js';
|
|
2
|
-
import { getAllDomainSummaries, getDomainMethods, getDomainSummary, getMethodSchema, } from '../cdp/schema.js';
|
|
3
|
-
import { runCommand } from '
|
|
2
|
+
import { getAllDomainSummaries, getDomainMethods, getProtocolCounts, getDomainSummary, getMethodSchema, } from '../cdp/schema.js';
|
|
3
|
+
import { runCommand } from './shared/CommandRunner.js';
|
|
4
|
+
import { jsonOption } from './shared/commonOptions.js';
|
|
5
|
+
import { CommandError } from '../errors/index.js';
|
|
4
6
|
import { callCDP } from '../ipc/client.js';
|
|
5
7
|
import { validateIPCResponse } from '../ipc/index.js';
|
|
6
|
-
import {
|
|
8
|
+
import { formatHint } from '../ui/messages/hints.js';
|
|
7
9
|
import { getErrorMessage } from '../utils/errors.js';
|
|
8
10
|
import { EXIT_CODES } from '../utils/exitCodes.js';
|
|
9
11
|
import { findSimilar } from '../utils/suggestions.js';
|
|
@@ -23,12 +25,19 @@ const DOMAIN_NOTES = {
|
|
|
23
25
|
Tracing: 'Performance tracing. Call Tracing.start, perform actions, then Tracing.end. ' +
|
|
24
26
|
'Data arrives via Tracing.dataCollected events.',
|
|
25
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Domain and method counts of the bundled protocol, for the help text.
|
|
30
|
+
*
|
|
31
|
+
* @returns e.g. "59 domains, 675 methods"
|
|
32
|
+
*/
|
|
33
|
+
function cdpCountsText() {
|
|
34
|
+
const counts = getProtocolCounts();
|
|
35
|
+
return `${counts.domains} domains, ${counts.methods} methods`;
|
|
36
|
+
}
|
|
26
37
|
/**
|
|
27
38
|
* Method-specific notes for methods with non-obvious behavior.
|
|
28
39
|
*/
|
|
29
40
|
const METHOD_NOTES = {
|
|
30
|
-
'Audits.checkContrast': 'This method triggers contrast analysis but results are sent via Audits.issueAdded events. ' +
|
|
31
|
-
'Alternative: bdg dom eval with getComputedStyle() for direct contrast checking.',
|
|
32
41
|
'Audits.enable': 'Enables the Audits domain. Issues will arrive via Audits.issueAdded events.',
|
|
33
42
|
'Overlay.highlightNode': 'Highlights a node visually. Returns empty on success. Use Overlay.hideHighlight to clear.',
|
|
34
43
|
'Profiler.start': 'Starts CPU profiling. Returns empty. Call Profiler.stop to get the profile data.',
|
|
@@ -76,7 +85,7 @@ function getMethodHint(methodName, result) {
|
|
|
76
85
|
export function registerCdpCommand(program) {
|
|
77
86
|
program
|
|
78
87
|
.command('cdp')
|
|
79
|
-
.description('CDP protocol introspection and execution
|
|
88
|
+
.description('CDP protocol introspection and execution\n' +
|
|
80
89
|
' Discovery: --list, --search, --describe\n' +
|
|
81
90
|
' Execution: case-insensitive (network.getcookies works)')
|
|
82
91
|
.argument('[method]', 'CDP method name (e.g., Network.getCookies, network.getcookies)')
|
|
@@ -84,10 +93,12 @@ export function registerCdpCommand(program) {
|
|
|
84
93
|
.option('--list', 'List all domains or methods in a domain')
|
|
85
94
|
.option('--describe', 'Show method signature and parameters')
|
|
86
95
|
.option('--search <query>', 'Search methods by keyword')
|
|
96
|
+
.addOption(jsonOption().hideHelp())
|
|
97
|
+
.addHelpText('after', () => `\nBundled protocol: ${cdpCountsText()}`)
|
|
87
98
|
.action(async (method, options) => {
|
|
88
99
|
await runCommand(async (opts) => {
|
|
89
100
|
if (opts.search) {
|
|
90
|
-
return await handleSearch(opts.search);
|
|
101
|
+
return await handleSearch(opts.search, method);
|
|
91
102
|
}
|
|
92
103
|
if (opts.list && !method) {
|
|
93
104
|
return handleListDomains();
|
|
@@ -135,15 +146,46 @@ function findSimilarMethods(methodName, domain) {
|
|
|
135
146
|
caseInsensitive: true,
|
|
136
147
|
});
|
|
137
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Did-you-mean for an unknown domain, or how to list them.
|
|
151
|
+
*
|
|
152
|
+
* @param domainName - Domain as typed
|
|
153
|
+
* @returns Suggestion
|
|
154
|
+
*/
|
|
155
|
+
function domainSuggestion(domainName) {
|
|
156
|
+
const [closest] = findSimilar(domainName, getAllDomainSummaries().map((summary) => summary.name));
|
|
157
|
+
return closest
|
|
158
|
+
? `Did you mean: bdg cdp ${closest} --list?`
|
|
159
|
+
: 'Use: bdg cdp --list (to see all domains)';
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* For a method bdg refuses to run, what to use instead (shown as its example).
|
|
163
|
+
*
|
|
164
|
+
* @param methodName - Full method name, e.g. Page.captureScreenshot
|
|
165
|
+
* @returns Alternative command, or undefined for methods that run
|
|
166
|
+
*/
|
|
167
|
+
function blockedAlternative(methodName) {
|
|
168
|
+
const blocked = BLOCKED_CDP_METHODS[methodName];
|
|
169
|
+
return blocked && `${blocked.alternative} (raw ${methodName} is blocked)`;
|
|
170
|
+
}
|
|
138
171
|
/**
|
|
139
172
|
* Handle search mode: Find methods by keyword.
|
|
140
173
|
*
|
|
141
174
|
* @param query - Search query
|
|
175
|
+
* @param domain - Domain to search in (`bdg cdp Network --search cookie`)
|
|
142
176
|
* @returns Success result with matching methods
|
|
143
177
|
*/
|
|
144
|
-
async function handleSearch(query) {
|
|
178
|
+
async function handleSearch(query, domain) {
|
|
179
|
+
if (domain !== undefined && !getDomainSummary(domain)) {
|
|
180
|
+
return {
|
|
181
|
+
success: false,
|
|
182
|
+
error: `Domain '${domain}' not found`,
|
|
183
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
184
|
+
errorContext: { suggestion: domainSuggestion(domain) },
|
|
185
|
+
};
|
|
186
|
+
}
|
|
145
187
|
const { searchMethods } = await import('../cdp/schema.js');
|
|
146
|
-
const results = searchMethods(query);
|
|
188
|
+
const results = searchMethods(query).filter((m) => domain === undefined || m.domain.toLowerCase() === domain.toLowerCase());
|
|
147
189
|
return {
|
|
148
190
|
success: true,
|
|
149
191
|
data: {
|
|
@@ -157,7 +199,7 @@ async function handleSearch(query) {
|
|
|
157
199
|
experimental: m.experimental,
|
|
158
200
|
deprecated: m.deprecated,
|
|
159
201
|
parameterCount: m.parameters.length,
|
|
160
|
-
example: m.example?.command,
|
|
202
|
+
example: blockedAlternative(m.name) ?? m.example?.command,
|
|
161
203
|
})),
|
|
162
204
|
},
|
|
163
205
|
};
|
|
@@ -199,7 +241,7 @@ function handleListDomainMethods(domainName) {
|
|
|
199
241
|
error: `Domain '${domainName}' not found`,
|
|
200
242
|
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
201
243
|
errorContext: {
|
|
202
|
-
suggestion:
|
|
244
|
+
suggestion: domainSuggestion(domainName),
|
|
203
245
|
},
|
|
204
246
|
};
|
|
205
247
|
}
|
|
@@ -226,7 +268,7 @@ function handleListDomainMethods(domainName) {
|
|
|
226
268
|
name: r.name,
|
|
227
269
|
type: r.type,
|
|
228
270
|
})),
|
|
229
|
-
example: m.example?.command,
|
|
271
|
+
example: blockedAlternative(m.name) ?? m.example?.command,
|
|
230
272
|
})),
|
|
231
273
|
},
|
|
232
274
|
};
|
|
@@ -322,19 +364,29 @@ function handleDescribeMethod(methodName) {
|
|
|
322
364
|
description: r.description,
|
|
323
365
|
items: r.items,
|
|
324
366
|
})),
|
|
325
|
-
example: schema.
|
|
367
|
+
example: blockedAlternative(schema.name)
|
|
368
|
+
? { command: blockedAlternative(schema.name) }
|
|
369
|
+
: schema.example,
|
|
326
370
|
},
|
|
327
371
|
};
|
|
328
372
|
}
|
|
329
373
|
/**
|
|
330
|
-
* CDP methods blocked from raw execution
|
|
331
|
-
*
|
|
374
|
+
* CDP methods blocked from raw execution: they return large binary data that
|
|
375
|
+
* corrupts terminal/agent sessions, or end the session behind bdg's back.
|
|
332
376
|
*/
|
|
333
377
|
const BLOCKED_CDP_METHODS = {
|
|
334
378
|
'Page.captureScreenshot': {
|
|
335
379
|
alternative: 'bdg dom screenshot [path]',
|
|
336
380
|
reason: 'Returns large base64 data that corrupts terminal sessions',
|
|
337
381
|
},
|
|
382
|
+
'Page.close': {
|
|
383
|
+
alternative: 'bdg stop',
|
|
384
|
+
reason: 'Closes the page under the session, which then ends',
|
|
385
|
+
},
|
|
386
|
+
'Browser.close': {
|
|
387
|
+
alternative: 'bdg stop',
|
|
388
|
+
reason: 'Closes Chrome under the session, which then ends without saving its state',
|
|
389
|
+
},
|
|
338
390
|
};
|
|
339
391
|
/**
|
|
340
392
|
* Handle execute method mode: Call CDP method.
|
|
@@ -345,14 +397,14 @@ const BLOCKED_CDP_METHODS = {
|
|
|
345
397
|
*/
|
|
346
398
|
async function handleExecuteMethod(methodName, paramsJson) {
|
|
347
399
|
const normalized = normalizeMethod(methodName);
|
|
348
|
-
// Block methods that return large binary data
|
|
349
|
-
// Output error to stderr only and exit - no JSON output to avoid confusing pipelines
|
|
350
400
|
if (normalized && BLOCKED_CDP_METHODS[normalized]) {
|
|
351
401
|
const blocked = BLOCKED_CDP_METHODS[normalized];
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
402
|
+
return {
|
|
403
|
+
success: false,
|
|
404
|
+
error: `${normalized} is blocked via raw CDP: ${blocked.reason}`,
|
|
405
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
406
|
+
errorContext: { suggestion: `Use: ${blocked.alternative}` },
|
|
407
|
+
};
|
|
356
408
|
}
|
|
357
409
|
if (!normalized) {
|
|
358
410
|
const similar = findSimilarMethods(methodName);
|
|
@@ -379,7 +431,7 @@ async function handleExecuteMethod(methodName, paramsJson) {
|
|
|
379
431
|
catch (error) {
|
|
380
432
|
return {
|
|
381
433
|
success: false,
|
|
382
|
-
error: `
|
|
434
|
+
error: `Invalid --params JSON: ${getErrorMessage(error)}`,
|
|
383
435
|
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
384
436
|
errorContext: {
|
|
385
437
|
suggestion: `Use: bdg cdp ${normalized} --describe (to see parameter schema)`,
|
|
@@ -398,7 +450,7 @@ async function handleExecuteMethod(methodName, paramsJson) {
|
|
|
398
450
|
},
|
|
399
451
|
};
|
|
400
452
|
if (response.data?.hint) {
|
|
401
|
-
result.hint = response.data.hint;
|
|
453
|
+
result.hint = formatHint(response.data.hint);
|
|
402
454
|
}
|
|
403
455
|
const methodHint = getMethodHint(normalized, cdpResult);
|
|
404
456
|
if (methodHint) {
|
package/dist/commands/cleanup.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import { runCommand } from './shared/CommandRunner.js';
|
|
3
|
+
import { jsonOption } from './shared/commonOptions.js';
|
|
4
|
+
import { sessionDirIsFileError } from '../errors/messages.js';
|
|
5
|
+
import { performSessionCleanup } from '../session/cleanup/userCommands.js';
|
|
6
|
+
import { isDaemonAlive } from '../session/daemonSocket.js';
|
|
7
|
+
import { getSessionDir } from '../session/paths.js';
|
|
8
|
+
import { readDaemonPid } from '../session/pid.js';
|
|
5
9
|
import { joinLines } from '../ui/formatting.js';
|
|
6
10
|
import { sessionFilesCleanedMessage, sessionOutputRemovedMessage, sessionDirectoryCleanMessage, noSessionFilesMessage, sessionStillActiveError, warningMessage, } from '../ui/messages/commands.js';
|
|
7
11
|
import { EXIT_CODES } from '../utils/exitCodes.js';
|
|
8
|
-
import { isProcessAlive } from '../utils/process.js';
|
|
9
12
|
/**
|
|
10
13
|
* Format cleanup result for human-readable output.
|
|
11
14
|
*
|
|
@@ -24,30 +27,35 @@ export function registerCleanupCommand(program) {
|
|
|
24
27
|
program
|
|
25
28
|
.command('cleanup')
|
|
26
29
|
.description('Clean up stale session files')
|
|
27
|
-
.option('-f, --force', '
|
|
30
|
+
.option('-f, --force', 'Kill a running (possibly hung) session, then clean up', false)
|
|
28
31
|
.option('--remove-output', 'Also remove session.json output file', false)
|
|
29
|
-
.option('--aggressive', '
|
|
32
|
+
.option('--aggressive', 'Alias for --force (kept for compatibility)', false)
|
|
30
33
|
.addOption(jsonOption())
|
|
31
34
|
.action(async (options) => {
|
|
32
35
|
await runCommand(async (opts) => {
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
const dir = getSessionDir();
|
|
37
|
+
if (fs.existsSync(dir) && !fs.statSync(dir).isDirectory()) {
|
|
38
|
+
const err = sessionDirIsFileError(dir);
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: err.message,
|
|
42
|
+
exitCode: EXIT_CODES.SESSION_FILE_ERROR,
|
|
43
|
+
errorContext: { suggestion: err.suggestion },
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (!opts.force && !opts.aggressive && (await isDaemonAlive())) {
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
error: sessionStillActiveError(readDaemonPid() ?? 0),
|
|
50
|
+
exitCode: EXIT_CODES.RESOURCE_BUSY,
|
|
51
|
+
errorContext: {
|
|
52
|
+
suggestion: 'Stop gracefully: bdg stop\nForce cleanup: bdg cleanup --force',
|
|
53
|
+
warning: 'Force cleanup kills the running daemon and its Chrome',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
47
56
|
}
|
|
48
57
|
const cleanupResult = await performSessionCleanup({
|
|
49
|
-
force: opts.force,
|
|
50
|
-
aggressive: opts.aggressive,
|
|
58
|
+
force: Boolean(opts.force) || Boolean(opts.aggressive),
|
|
51
59
|
removeOutput: opts.removeOutput,
|
|
52
60
|
});
|
|
53
61
|
const didCleanup = cleanupResult.cleaned.session ||
|
|
@@ -4,7 +4,24 @@
|
|
|
4
4
|
import { type Command } from 'commander';
|
|
5
5
|
import type { ConsoleMessage } from '../types.js';
|
|
6
6
|
import { type ConsoleLevel } from '../ui/formatters/console.js';
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Keep the messages of the page currently loaded.
|
|
9
|
+
*
|
|
10
|
+
* @param messages - All captured messages
|
|
11
|
+
* @param currentNavigationId - Navigation id of the current page; when unknown,
|
|
12
|
+
* the newest navigation id among the messages is used
|
|
13
|
+
* @returns Messages of the current page (empty if it logged nothing)
|
|
14
|
+
*/
|
|
15
|
+
export declare function filterByCurrentNavigation(messages: ConsoleMessage[], currentNavigationId?: number): ConsoleMessage[];
|
|
8
16
|
export declare function filterByLevel(messages: ConsoleMessage[], level: ConsoleLevel): ConsoleMessage[];
|
|
17
|
+
/**
|
|
18
|
+
* Identity of each message across polls (its index can shift when an earlier
|
|
19
|
+
* message is inserted late). Identical messages logged in the same
|
|
20
|
+
* millisecond are told apart by their order.
|
|
21
|
+
*
|
|
22
|
+
* @param messages - Messages in order
|
|
23
|
+
* @returns One key per message
|
|
24
|
+
*/
|
|
25
|
+
export declare function messageKeys(messages: ConsoleMessage[]): string[];
|
|
9
26
|
export declare function registerConsoleCommand(program: Command): void;
|
|
10
27
|
//# sourceMappingURL=console.d.ts.map
|
package/dist/commands/console.js
CHANGED
|
@@ -2,61 +2,41 @@
|
|
|
2
2
|
* Console command for inspecting and filtering console messages.
|
|
3
3
|
*/
|
|
4
4
|
import { Option } from 'commander';
|
|
5
|
-
import { runCommand } from '
|
|
6
|
-
import { jsonOption } from '
|
|
7
|
-
import { handleDaemonConnectionError } from '
|
|
8
|
-
import { fetchConsoleMessages, createErrorResult } from '
|
|
9
|
-
import { setupFollowMode } from '
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { formatConsole,
|
|
5
|
+
import { runCommand } from './shared/CommandRunner.js';
|
|
6
|
+
import { jsonOption } from './shared/commonOptions.js';
|
|
7
|
+
import { handleDaemonConnectionError, noteFollowConnected, } from './shared/daemonErrorHandler.js';
|
|
8
|
+
import { fetchConsoleMessages, createErrorResult } from './shared/dataFetcher.js';
|
|
9
|
+
import { setupFollowMode } from './shared/followMode.js';
|
|
10
|
+
import { handleValidationError } from './shared/handleValidationError.js';
|
|
11
|
+
import { consoleLevelOption, positiveIntRule } from './shared/validation.js';
|
|
12
|
+
import { buildSuccessResponse } from '../ui/OutputBuilder.js';
|
|
13
|
+
import { buildConsoleJsonOutput, formatConsole, formatConsoleFollowLines, LEVEL_MAP, } from '../ui/formatters/console.js';
|
|
14
14
|
import { followingConsoleMessage, stoppedFollowingConsoleMessage, } from '../ui/messages/consoleMessages.js';
|
|
15
|
-
import { EXIT_CODES } from '../utils/exitCodes.js';
|
|
16
15
|
const MIN_LAST = 0;
|
|
17
16
|
const MAX_LAST = 10000;
|
|
18
17
|
const DEFAULT_LAST = 100;
|
|
19
|
-
const
|
|
20
|
-
const VALID_LEVELS = ['error', 'warning', 'info', 'debug'];
|
|
21
|
-
const consoleLastOption = new Option('--last <n>', `Show last N console messages (0 = all, default: ${DEFAULT_LAST})`).default(String(DEFAULT_LAST));
|
|
18
|
+
const consoleLastOption = new Option('--last <n>', 'Show last N console messages (0 = all)').default(String(DEFAULT_LAST));
|
|
22
19
|
/**
|
|
23
|
-
*
|
|
20
|
+
* Keep the messages of the page currently loaded.
|
|
24
21
|
*
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
22
|
+
* @param messages - All captured messages
|
|
23
|
+
* @param currentNavigationId - Navigation id of the current page; when unknown,
|
|
24
|
+
* the newest navigation id among the messages is used
|
|
25
|
+
* @returns Messages of the current page (empty if it logged nothing)
|
|
27
26
|
*/
|
|
28
|
-
function
|
|
29
|
-
if (error instanceof CommandError) {
|
|
30
|
-
if (json) {
|
|
31
|
-
const errorOptions = {
|
|
32
|
-
exitCode: error.exitCode,
|
|
33
|
-
};
|
|
34
|
-
if (error.metadata.suggestion) {
|
|
35
|
-
errorOptions.suggestion = error.metadata.suggestion;
|
|
36
|
-
}
|
|
37
|
-
console.log(JSON.stringify(OutputBuilder.buildJsonError(error.message, errorOptions)));
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
console.error(error.message);
|
|
41
|
-
if (error.metadata.suggestion)
|
|
42
|
-
console.error(error.metadata.suggestion);
|
|
43
|
-
}
|
|
44
|
-
process.exit(error.exitCode);
|
|
45
|
-
}
|
|
46
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
47
|
-
process.exit(EXIT_CODES.INVALID_ARGUMENTS);
|
|
48
|
-
}
|
|
49
|
-
export function filterByCurrentNavigation(messages) {
|
|
27
|
+
export function filterByCurrentNavigation(messages, currentNavigationId) {
|
|
50
28
|
if (messages.length === 0)
|
|
51
29
|
return messages;
|
|
52
|
-
const
|
|
53
|
-
return messages.filter((m) => m.navigationId ===
|
|
30
|
+
const navId = currentNavigationId ?? Math.max(...messages.map((m) => m.navigationId ?? 0));
|
|
31
|
+
return messages.filter((m) => (m.navigationId ?? 0) === navId);
|
|
54
32
|
}
|
|
55
33
|
export function filterByLevel(messages, level) {
|
|
56
34
|
return messages.filter((m) => LEVEL_MAP[m.type] === level);
|
|
57
35
|
}
|
|
58
|
-
function applyFilters(messages, options) {
|
|
59
|
-
let filtered = options.history
|
|
36
|
+
function applyFilters(messages, options, currentNavigationId) {
|
|
37
|
+
let filtered = options.history
|
|
38
|
+
? messages
|
|
39
|
+
: filterByCurrentNavigation(messages, currentNavigationId);
|
|
60
40
|
if (options.level)
|
|
61
41
|
filtered = filterByLevel(filtered, options.level);
|
|
62
42
|
return filtered;
|
|
@@ -71,7 +51,17 @@ function buildFormatOptions(options, lastN) {
|
|
|
71
51
|
level: options.level,
|
|
72
52
|
};
|
|
73
53
|
}
|
|
74
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Stream console messages: the last `lastN` at start, then each new message
|
|
56
|
+
* once (like `tail -f`), with a separator when the page navigates.
|
|
57
|
+
*
|
|
58
|
+
* @param options - Command options
|
|
59
|
+
* @param lastN - Messages to show at start (0 = all)
|
|
60
|
+
*/
|
|
61
|
+
async function runFollowMode(options, lastN) {
|
|
62
|
+
const shown = new Set();
|
|
63
|
+
let navigationId;
|
|
64
|
+
let started = false;
|
|
75
65
|
const showConsole = async () => {
|
|
76
66
|
const result = await fetchConsoleMessages();
|
|
77
67
|
if (!result.success) {
|
|
@@ -85,9 +75,32 @@ async function runFollowMode(options) {
|
|
|
85
75
|
process.exit(errorResult.exitCode);
|
|
86
76
|
return;
|
|
87
77
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
noteFollowConnected();
|
|
79
|
+
const { messages, currentNavigationId } = result.data;
|
|
80
|
+
const matching = applyFilters(messages, options, currentNavigationId);
|
|
81
|
+
const keys = messageKeys(matching);
|
|
82
|
+
const fresh = matching.filter((_message, i) => !shown.has(keys[i]));
|
|
83
|
+
const backlog = started || lastN === 0 ? fresh : fresh.slice(-lastN);
|
|
84
|
+
shown.clear();
|
|
85
|
+
keys.forEach((key) => shown.add(key));
|
|
86
|
+
const navigated = started && navigationId !== currentNavigationId;
|
|
87
|
+
navigationId = currentNavigationId;
|
|
88
|
+
if (options.json) {
|
|
89
|
+
if (!started || backlog.length > 0) {
|
|
90
|
+
const data = buildConsoleJsonOutput(backlog, { list: true, last: 0 });
|
|
91
|
+
console.log(JSON.stringify(buildSuccessResponse(data), null, 2));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const text = formatConsoleFollowLines(backlog, {
|
|
96
|
+
header: !started,
|
|
97
|
+
...(navigated &&
|
|
98
|
+
currentNavigationId !== undefined && { navigationId: currentNavigationId }),
|
|
99
|
+
});
|
|
100
|
+
if (text)
|
|
101
|
+
console.log(text);
|
|
102
|
+
}
|
|
103
|
+
started = true;
|
|
91
104
|
};
|
|
92
105
|
await setupFollowMode(showConsole, {
|
|
93
106
|
startMessage: followingConsoleMessage,
|
|
@@ -95,6 +108,23 @@ async function runFollowMode(options) {
|
|
|
95
108
|
intervalMs: 1000,
|
|
96
109
|
});
|
|
97
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Identity of each message across polls (its index can shift when an earlier
|
|
113
|
+
* message is inserted late). Identical messages logged in the same
|
|
114
|
+
* millisecond are told apart by their order.
|
|
115
|
+
*
|
|
116
|
+
* @param messages - Messages in order
|
|
117
|
+
* @returns One key per message
|
|
118
|
+
*/
|
|
119
|
+
export function messageKeys(messages) {
|
|
120
|
+
const seen = new Map();
|
|
121
|
+
return messages.map((message) => {
|
|
122
|
+
const base = `${message.timestamp}|${message.type}|${message.navigationId ?? ''}|${message.text}`;
|
|
123
|
+
const occurrence = (seen.get(base) ?? 0) + 1;
|
|
124
|
+
seen.set(base, occurrence);
|
|
125
|
+
return `${base}#${occurrence}`;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
98
128
|
export function registerConsoleCommand(program) {
|
|
99
129
|
program
|
|
100
130
|
.command('console')
|
|
@@ -102,29 +132,44 @@ export function registerConsoleCommand(program) {
|
|
|
102
132
|
.addOption(new Option('-l, --list', 'List all messages chronologically').default(false))
|
|
103
133
|
.addOption(new Option('-f, --follow', 'Stream console messages in real-time').default(false))
|
|
104
134
|
.addOption(new Option('-H, --history', 'Show messages from all page loads (default: current only)').default(false))
|
|
105
|
-
.addOption(new Option('--level <level>', 'Filter by message level
|
|
135
|
+
.addOption(new Option('--level <level>', 'Filter by message level: error, warning, info (includes log), debug; any case').argParser(consoleLevelOption))
|
|
106
136
|
.addOption(consoleLastOption)
|
|
107
137
|
.addOption(jsonOption())
|
|
108
138
|
.action(async (options) => {
|
|
109
139
|
let lastN;
|
|
110
140
|
try {
|
|
111
|
-
lastN = positiveIntRule({
|
|
141
|
+
lastN = positiveIntRule({
|
|
142
|
+
name: '--last',
|
|
143
|
+
min: MIN_LAST,
|
|
144
|
+
max: MAX_LAST,
|
|
145
|
+
default: DEFAULT_LAST,
|
|
146
|
+
}).validate(options.last);
|
|
112
147
|
}
|
|
113
148
|
catch (error) {
|
|
114
149
|
handleValidationError(error, options.json ?? false);
|
|
115
150
|
}
|
|
116
151
|
if (options.follow) {
|
|
117
|
-
await runFollowMode(options);
|
|
152
|
+
await runFollowMode(options, lastN);
|
|
118
153
|
return;
|
|
119
154
|
}
|
|
120
155
|
await runCommand(async () => {
|
|
121
156
|
const result = await fetchConsoleMessages();
|
|
122
157
|
if (!result.success) {
|
|
123
|
-
return createErrorResult(result.error, result.exitCode);
|
|
158
|
+
return createErrorResult(result.error, result.exitCode, result.suggestion);
|
|
159
|
+
}
|
|
160
|
+
const { messages, currentNavigationId } = result.data;
|
|
161
|
+
const filtered = applyFilters(messages, options, currentNavigationId);
|
|
162
|
+
if (options.json) {
|
|
163
|
+
return {
|
|
164
|
+
success: true,
|
|
165
|
+
data: buildConsoleJsonOutput(filtered, buildFormatOptions(options, lastN)),
|
|
166
|
+
};
|
|
124
167
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
168
|
+
return { success: true, data: { messages, filtered } };
|
|
169
|
+
}, options, (data) => {
|
|
170
|
+
const { filtered } = data;
|
|
171
|
+
return formatConsole(filtered, buildFormatOptions(options, lastN));
|
|
172
|
+
});
|
|
128
173
|
});
|
|
129
174
|
}
|
|
130
175
|
//# sourceMappingURL=console.js.map
|