@speedkit/cli 4.51.1 → 4.52.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/CHANGELOG.md +7 -0
- package/README.md +1426 -14
- package/dist/base/run-control-command.d.ts +15 -0
- package/dist/base/run-control-command.js +20 -0
- package/dist/build-info.json +6 -0
- package/dist/commands/diff.d.ts +7 -1
- package/dist/commands/diff.js +9 -3
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.js +14 -3
- package/dist/commands/onboarding/browser/click.d.ts +75 -0
- package/dist/commands/onboarding/browser/click.js +19 -0
- package/dist/commands/onboarding/browser/emulate.d.ts +105 -0
- package/dist/commands/onboarding/browser/emulate.js +26 -0
- package/dist/commands/onboarding/browser/navigate.d.ts +75 -0
- package/dist/commands/onboarding/browser/navigate.js +19 -0
- package/dist/commands/onboarding/browser/panel.d.ts +63 -0
- package/dist/commands/onboarding/browser/panel.js +12 -0
- package/dist/commands/onboarding/browser/reinstall-sw.d.ts +63 -0
- package/dist/commands/onboarding/browser/reinstall-sw.js +14 -0
- package/dist/commands/onboarding/browser/reset.d.ts +71 -0
- package/dist/commands/onboarding/browser/reset.js +18 -0
- package/dist/commands/onboarding/browser/screenshot.d.ts +77 -0
- package/dist/commands/onboarding/browser/screenshot.js +19 -0
- package/dist/commands/onboarding/browser/state.d.ts +63 -0
- package/dist/commands/onboarding/browser/state.js +12 -0
- package/dist/commands/onboarding/browser/tabs.d.ts +58 -0
- package/dist/commands/onboarding/browser/tabs.js +16 -0
- package/dist/commands/onboarding/cache/clear.d.ts +58 -0
- package/dist/commands/onboarding/cache/clear.js +12 -0
- package/dist/commands/onboarding/cache/errors.d.ts +58 -0
- package/dist/commands/onboarding/cache/errors.js +12 -0
- package/dist/commands/onboarding/cache/evict.d.ts +62 -0
- package/dist/commands/onboarding/cache/evict.js +15 -0
- package/dist/commands/onboarding/cache/get.d.ts +85 -0
- package/dist/commands/onboarding/cache/get.js +17 -0
- package/dist/commands/onboarding/cache/list.d.ts +58 -0
- package/dist/commands/onboarding/cache/list.js +15 -0
- package/dist/commands/onboarding/cache/prewarm.d.ts +73 -0
- package/dist/commands/onboarding/cache/prewarm.js +20 -0
- package/dist/commands/onboarding/cache/refresh.d.ts +62 -0
- package/dist/commands/onboarding/cache/refresh.js +18 -0
- package/dist/commands/onboarding/cdp.d.ts +81 -0
- package/dist/commands/onboarding/cdp.js +18 -0
- package/dist/commands/onboarding/debug/arm.d.ts +83 -0
- package/dist/commands/onboarding/debug/arm.js +19 -0
- package/dist/commands/onboarding/debug/await.d.ts +71 -0
- package/dist/commands/onboarding/debug/await.js +18 -0
- package/dist/commands/onboarding/debug/disarm.d.ts +63 -0
- package/dist/commands/onboarding/debug/disarm.js +12 -0
- package/dist/commands/onboarding/debug/eval.d.ts +75 -0
- package/dist/commands/onboarding/debug/eval.js +16 -0
- package/dist/commands/onboarding/debug/release.d.ts +63 -0
- package/dist/commands/onboarding/debug/release.js +12 -0
- package/dist/commands/onboarding/debug/resume.d.ts +63 -0
- package/dist/commands/onboarding/debug/resume.js +12 -0
- package/dist/commands/onboarding/debug/status.d.ts +63 -0
- package/dist/commands/onboarding/debug/status.js +12 -0
- package/dist/commands/onboarding/debug/step.d.ts +67 -0
- package/dist/commands/onboarding/debug/step.js +15 -0
- package/dist/commands/onboarding/files/list.d.ts +58 -0
- package/dist/commands/onboarding/files/list.js +12 -0
- package/dist/commands/onboarding/files/read.d.ts +73 -0
- package/dist/commands/onboarding/files/read.js +16 -0
- package/dist/commands/onboarding/files/rebuild.d.ts +63 -0
- package/dist/commands/onboarding/files/rebuild.js +18 -0
- package/dist/commands/onboarding/files/validate.d.ts +58 -0
- package/dist/commands/onboarding/files/validate.js +12 -0
- package/dist/commands/onboarding/fouc.d.ts +77 -0
- package/dist/commands/onboarding/fouc.js +16 -0
- package/dist/commands/onboarding/inject/add.d.ts +89 -0
- package/dist/commands/onboarding/inject/add.js +17 -0
- package/dist/commands/onboarding/inject/clear.d.ts +63 -0
- package/dist/commands/onboarding/inject/clear.js +12 -0
- package/dist/commands/onboarding/inject/list.d.ts +63 -0
- package/dist/commands/onboarding/inject/list.js +12 -0
- package/dist/commands/onboarding/inject/read.d.ts +75 -0
- package/dist/commands/onboarding/inject/read.js +18 -0
- package/dist/commands/onboarding/inject/recipes.d.ts +63 -0
- package/dist/commands/onboarding/inject/recipes.js +12 -0
- package/dist/commands/onboarding/inject/remove.d.ts +67 -0
- package/dist/commands/onboarding/inject/remove.js +15 -0
- package/dist/commands/onboarding/list.d.ts +13 -0
- package/dist/commands/onboarding/list.js +12 -0
- package/dist/commands/onboarding/logs.d.ts +41 -0
- package/dist/commands/onboarding/logs.js +257 -0
- package/dist/commands/onboarding/navwalk.d.ts +95 -0
- package/dist/commands/onboarding/navwalk.js +19 -0
- package/dist/commands/onboarding/response.d.ts +67 -0
- package/dist/commands/onboarding/response.js +18 -0
- package/dist/commands/onboarding/rum/beacons.d.ts +75 -0
- package/dist/commands/onboarding/rum/beacons.js +16 -0
- package/dist/commands/onboarding/rum/get.d.ts +77 -0
- package/dist/commands/onboarding/rum/get.js +18 -0
- package/dist/commands/onboarding/rum/key.d.ts +67 -0
- package/dist/commands/onboarding/rum/key.js +13 -0
- package/dist/commands/onboarding/rum/previous.d.ts +63 -0
- package/dist/commands/onboarding/rum/previous.js +12 -0
- package/dist/commands/onboarding/status.d.ts +13 -0
- package/dist/commands/onboarding/status.js +17 -0
- package/dist/commands/onboarding/stop.d.ts +13 -0
- package/dist/commands/onboarding/stop.js +17 -0
- package/dist/commands/onboarding/todo.d.ts +58 -0
- package/dist/commands/onboarding/todo.js +12 -0
- package/dist/commands/onboarding/viewport.d.ts +101 -0
- package/dist/commands/onboarding/viewport.js +18 -0
- package/dist/commands/onboarding/watch.d.ts +93 -0
- package/dist/commands/onboarding/watch.js +16 -0
- package/dist/commands/onboarding.d.ts +26 -0
- package/dist/commands/onboarding.js +221 -4
- package/dist/commands/origin-request.d.ts +4 -0
- package/dist/commands/origin-request.js +4 -0
- package/dist/commands/spec/onboarding.spec.d.ts +1 -0
- package/dist/commands/spec/onboarding.spec.js +127 -0
- package/dist/services/browser-fetch/device-emulation.d.ts +11 -0
- package/dist/services/browser-fetch/device-emulation.js +14 -0
- package/dist/services/cli/build-info.d.ts +33 -0
- package/dist/services/cli/build-info.js +63 -0
- package/dist/services/cli/cli-environment-factory.d.ts +3 -0
- package/dist/services/cli/cli-environment-factory.js +1 -0
- package/dist/services/cli/cli-service-build-context.d.ts +3 -0
- package/dist/services/cli/cli-service-factory.js +1 -1
- package/dist/services/cli/cli-service-model.d.ts +29 -10
- package/dist/services/cli/cli-service.d.ts +60 -11
- package/dist/services/cli/cli-service.js +196 -32
- package/dist/services/cli/index.d.ts +2 -0
- package/dist/services/cli/index.js +2 -0
- package/dist/services/cli/sink.d.ts +47 -0
- package/dist/services/cli/sink.js +31 -0
- package/dist/services/cli/spec/build-identity.spec.d.ts +1 -0
- package/dist/services/cli/spec/build-identity.spec.js +85 -0
- package/dist/services/cli/spec/build-info.spec.d.ts +1 -0
- package/dist/services/cli/spec/build-info.spec.js +10 -0
- package/dist/services/cli/spec/cli-service-log.spec.d.ts +1 -0
- package/dist/services/cli/spec/cli-service-log.spec.js +133 -0
- package/dist/services/cli/spec/cli-service.spec.js +113 -50
- package/dist/services/cli/spec/memory-cli.d.ts +9 -0
- package/dist/services/cli/spec/memory-cli.js +9 -0
- package/dist/services/diff/config-at-ref.d.ts +20 -0
- package/dist/services/diff/config-at-ref.js +33 -0
- package/dist/services/diff/diff-service-build-context.d.ts +12 -0
- package/dist/services/diff/diff-service-build-context.js +45 -1
- package/dist/services/diff/diff-service-factory.d.ts +2 -0
- package/dist/services/diff/diff-service-factory.js +65 -25
- package/dist/services/diff/diff-service.d.ts +11 -0
- package/dist/services/diff/diff-service.js +37 -11
- package/dist/services/diff/page-source.d.ts +12 -0
- package/dist/services/diff/page-source.js +16 -11
- package/dist/services/diff/run-runtime-config.d.ts +33 -0
- package/dist/services/diff/run-runtime-config.js +74 -0
- package/dist/services/diff/sinks/tool-diff-sink.d.ts +3 -2
- package/dist/services/diff/sinks/tool-diff-sink.js +3 -2
- package/dist/services/diff/spec/config-at-ref.spec.d.ts +1 -0
- package/dist/services/diff/spec/config-at-ref.spec.js +46 -0
- package/dist/services/diff/spec/diff-service-build-context.spec.js +19 -0
- package/dist/services/diff/spec/diff-service.spec.js +95 -0
- package/dist/services/diff/spec/run-runtime-config.spec.d.ts +1 -0
- package/dist/services/diff/spec/run-runtime-config.spec.js +87 -0
- package/dist/services/git/git-repository.d.ts +2 -0
- package/dist/services/git/git-repository.js +6 -0
- package/dist/services/integration-api/customer-config-flags.js +1 -0
- package/dist/services/onboarding/browse/browse-service.d.ts +13 -1
- package/dist/services/onboarding/browse/browse-service.js +43 -7
- package/dist/services/onboarding/browser/answer-dialogs.d.ts +12 -0
- package/dist/services/onboarding/browser/answer-dialogs.js +25 -0
- package/dist/services/onboarding/browser/baqend-response.d.ts +17 -1
- package/dist/services/onboarding/browser/baqend-response.js +23 -0
- package/dist/services/onboarding/browser/console-log.d.ts +9 -0
- package/dist/services/onboarding/browser/console-log.js +27 -0
- package/dist/services/onboarding/browser/emulate-device.d.ts +12 -1
- package/dist/services/onboarding/browser/emulate-device.js +68 -13
- package/dist/services/onboarding/browser/executable/executable-validator.js +4 -2
- package/dist/services/onboarding/browser/extension/extension-bridge.js +5 -3
- package/dist/services/onboarding/browser/extension/extension-downloader.js +17 -8
- package/dist/services/onboarding/browser/extension/extension-validator.js +9 -4
- package/dist/services/onboarding/browser/launch-browser.d.ts +2 -1
- package/dist/services/onboarding/browser/launch-browser.js +6 -1
- package/dist/services/onboarding/browser/resume-restarted-workers.d.ts +14 -0
- package/dist/services/onboarding/browser/resume-restarted-workers.js +26 -0
- package/dist/services/onboarding/control/body-inspect.d.ts +24 -0
- package/dist/services/onboarding/control/body-inspect.js +106 -0
- package/dist/services/onboarding/control/browser-session.d.ts +547 -0
- package/dist/services/onboarding/control/browser-session.js +1337 -0
- package/dist/services/onboarding/control/config-validation.d.ts +17 -0
- package/dist/services/onboarding/control/config-validation.js +46 -0
- package/dist/services/onboarding/control/control-protocol.d.ts +1430 -0
- package/dist/services/onboarding/control/control-protocol.js +58 -0
- package/dist/services/onboarding/control/control-server.d.ts +292 -0
- package/dist/services/onboarding/control/control-server.js +1629 -0
- package/dist/services/onboarding/control/debug-session.d.ts +219 -0
- package/dist/services/onboarding/control/debug-session.js +897 -0
- package/dist/services/onboarding/control/fouc.d.ts +23 -0
- package/dist/services/onboarding/control/fouc.js +151 -0
- package/dist/services/onboarding/control/index.d.ts +4 -0
- package/dist/services/onboarding/control/index.js +4 -0
- package/dist/services/onboarding/control/navigate-wait.d.ts +33 -0
- package/dist/services/onboarding/control/navigate-wait.js +56 -0
- package/dist/services/onboarding/control/navwalk.d.ts +65 -0
- package/dist/services/onboarding/control/navwalk.js +248 -0
- package/dist/services/onboarding/control/preload-registry.d.ts +150 -0
- package/dist/services/onboarding/control/preload-registry.js +829 -0
- package/dist/services/onboarding/control/response-explainer.d.ts +24 -0
- package/dist/services/onboarding/control/response-explainer.js +257 -0
- package/dist/services/onboarding/control/rum.d.ts +8 -0
- package/dist/services/onboarding/control/rum.js +220 -0
- package/dist/services/onboarding/control/service-worker-tracker.d.ts +68 -0
- package/dist/services/onboarding/control/service-worker-tracker.js +120 -0
- package/dist/services/onboarding/control/viewport.d.ts +45 -0
- package/dist/services/onboarding/control/viewport.js +344 -0
- package/dist/services/onboarding/control/watch.d.ts +26 -0
- package/dist/services/onboarding/control/watch.js +157 -0
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +3 -1
- package/dist/services/onboarding/dashboard/index.js +7 -2
- package/dist/services/onboarding/fetch-event-handler.d.ts +24 -5
- package/dist/services/onboarding/fetch-event-handler.js +103 -32
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +11 -2
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +14 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +30 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +13 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +28 -1
- package/dist/services/onboarding/file-events/file-watcher.d.ts +42 -1
- package/dist/services/onboarding/file-events/file-watcher.js +117 -12
- package/dist/services/onboarding/inject/inject-service.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +40 -7
- package/dist/services/onboarding/onboarding-model.js +20 -9
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +4 -0
- package/dist/services/onboarding/onboarding-service-build-context.js +7 -1
- package/dist/services/onboarding/onboarding-service-factory.d.ts +17 -1
- package/dist/services/onboarding/onboarding-service-factory.js +150 -23
- package/dist/services/onboarding/onboarding-service.d.ts +40 -1
- package/dist/services/onboarding/onboarding-service.js +139 -23
- package/dist/services/onboarding/request-cache/asset-key.d.ts +61 -0
- package/dist/services/onboarding/request-cache/asset-key.js +115 -0
- package/dist/services/onboarding/request-cache/cache.d.ts +62 -5
- package/dist/services/onboarding/request-cache/cache.js +128 -17
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.js +66 -0
- package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/browser/console-log.spec.js +42 -0
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.js +45 -0
- package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/browser-session.spec.js +753 -0
- package/dist/services/onboarding/spec/control/control-server.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/control-server.spec.js +371 -0
- package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/debug-session.spec.js +751 -0
- package/dist/services/onboarding/spec/control/fakes.d.ts +31 -0
- package/dist/services/onboarding/spec/control/fakes.js +67 -0
- package/dist/services/onboarding/spec/control/fouc.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/fouc.spec.js +167 -0
- package/dist/services/onboarding/spec/control/navigate-wait.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/navigate-wait.spec.js +47 -0
- package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/navwalk.spec.js +222 -0
- package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/preload-registry.spec.js +432 -0
- package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/response-explainer.spec.js +324 -0
- package/dist/services/onboarding/spec/control/rum.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/rum.spec.js +222 -0
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +193 -0
- package/dist/services/onboarding/spec/control/viewport.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/viewport.spec.js +200 -0
- package/dist/services/onboarding/spec/control/watch.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/watch.spec.js +187 -0
- package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/fetch-event-handler.spec.js +219 -0
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +41 -0
- package/dist/services/onboarding/spec/onboarding-model.spec.js +39 -3
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +25 -1
- package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/request-cache/cache.spec.js +107 -0
- package/dist/services/onboarding/spec/todo-collector.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/todo-collector.spec.js +136 -0
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.js +65 -0
- package/dist/services/onboarding/todo-collector.d.ts +7 -2
- package/dist/services/onboarding/todo-collector.js +49 -12
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +38 -0
- package/dist/services/onboarding/virtual-orestes-app/index.js +113 -27
- package/dist/services/origin-request/asset-variations.d.ts +14 -0
- package/dist/services/origin-request/asset-variations.js +11 -4
- package/dist/services/origin-request/origin-fetcher.d.ts +7 -0
- package/dist/services/origin-request/origin-fetcher.js +43 -5
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +17 -0
- package/dist/services/origin-request/origin-request-service-build-context.js +8 -0
- package/dist/services/origin-request/origin-request-service-factory.d.ts +0 -5
- package/dist/services/origin-request/origin-request-service-factory.js +2 -30
- package/dist/services/origin-request/origin-request-service.d.ts +121 -6
- package/dist/services/origin-request/origin-request-service.js +273 -49
- package/dist/services/origin-request/runtime-config-source.d.ts +6 -0
- package/dist/services/origin-request/runtime-config-source.js +15 -4
- package/dist/services/origin-request/spec/asset-variations.spec.js +20 -0
- package/dist/services/origin-request/spec/origin-request-service.spec.js +329 -6
- package/dist/services/query-builder/rules/rule-match.d.ts +35 -0
- package/dist/services/query-builder/rules/rule-match.js +70 -0
- package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +1 -0
- package/dist/services/query-builder/spec/rules/rule-match.spec.js +121 -0
- package/dist/services/run-control/browser/run-browser-contexts.d.ts +557 -0
- package/dist/services/run-control/browser/run-browser-contexts.js +91 -0
- package/dist/services/run-control/browser/run-browser-service-factory.d.ts +5 -0
- package/dist/services/run-control/browser/run-browser-service-factory.js +7 -0
- package/dist/services/run-control/browser/run-browser-service.d.ts +68 -0
- package/dist/services/run-control/browser/run-browser-service.js +206 -0
- package/dist/services/run-control/cache/run-cache-contexts.d.ts +349 -0
- package/dist/services/run-control/cache/run-cache-contexts.js +51 -0
- package/dist/services/run-control/cache/run-cache-service-factory.d.ts +6 -0
- package/dist/services/run-control/cache/run-cache-service-factory.js +12 -0
- package/dist/services/run-control/cache/run-cache-service.d.ts +35 -0
- package/dist/services/run-control/cache/run-cache-service.js +151 -0
- package/dist/services/run-control/control-client.d.ts +36 -0
- package/dist/services/run-control/control-client.js +147 -0
- package/dist/services/run-control/debug/run-debug-contexts.d.ts +416 -0
- package/dist/services/run-control/debug/run-debug-contexts.js +47 -0
- package/dist/services/run-control/debug/run-debug-service-factory.d.ts +5 -0
- package/dist/services/run-control/debug/run-debug-service-factory.js +7 -0
- package/dist/services/run-control/debug/run-debug-service.d.ts +39 -0
- package/dist/services/run-control/debug/run-debug-service.js +164 -0
- package/dist/services/run-control/files/run-files-contexts.d.ts +238 -0
- package/dist/services/run-control/files/run-files-contexts.js +26 -0
- package/dist/services/run-control/files/run-files-service-factory.d.ts +5 -0
- package/dist/services/run-control/files/run-files-service-factory.js +7 -0
- package/dist/services/run-control/files/run-files-service.d.ts +29 -0
- package/dist/services/run-control/files/run-files-service.js +120 -0
- package/dist/services/run-control/index.d.ts +32 -0
- package/dist/services/run-control/index.js +31 -0
- package/dist/services/run-control/inject/run-inject-contexts.d.ts +319 -0
- package/dist/services/run-control/inject/run-inject-contexts.js +38 -0
- package/dist/services/run-control/inject/run-inject-service-factory.d.ts +5 -0
- package/dist/services/run-control/inject/run-inject-service-factory.js +7 -0
- package/dist/services/run-control/inject/run-inject-service.d.ts +31 -0
- package/dist/services/run-control/inject/run-inject-service.js +227 -0
- package/dist/services/run-control/live-run.d.ts +37 -0
- package/dist/services/run-control/live-run.js +56 -0
- package/dist/services/run-control/probe/run-probe-contexts.d.ts +333 -0
- package/dist/services/run-control/probe/run-probe-contexts.js +73 -0
- package/dist/services/run-control/probe/run-probe-service-factory.d.ts +5 -0
- package/dist/services/run-control/probe/run-probe-service-factory.js +7 -0
- package/dist/services/run-control/probe/run-probe-service.d.ts +54 -0
- package/dist/services/run-control/probe/run-probe-service.js +194 -0
- package/dist/services/run-control/rum/run-rum-contexts.d.ts +216 -0
- package/dist/services/run-control/rum/run-rum-contexts.js +34 -0
- package/dist/services/run-control/rum/run-rum-service-factory.d.ts +5 -0
- package/dist/services/run-control/rum/run-rum-service-factory.js +7 -0
- package/dist/services/run-control/rum/run-rum-service.d.ts +36 -0
- package/dist/services/run-control/rum/run-rum-service.js +122 -0
- package/dist/services/run-control/run-answer.d.ts +28 -0
- package/dist/services/run-control/run-answer.js +58 -0
- package/dist/services/run-control/run-control-context.d.ts +102 -0
- package/dist/services/run-control/run-control-context.js +36 -0
- package/dist/services/run-control/run-control-flags.d.ts +12 -0
- package/dist/services/run-control/run-control-flags.js +22 -0
- package/dist/services/run-control/run-control-model.d.ts +9 -0
- package/dist/services/run-control/run-control-model.js +1 -0
- package/dist/services/run-control/run-control-service-factory.d.ts +14 -0
- package/dist/services/run-control/run-control-service-factory.js +26 -0
- package/dist/services/run-control/session/run-session-contexts.d.ts +25 -0
- package/dist/services/run-control/session/run-session-contexts.js +20 -0
- package/dist/services/run-control/session/run-session-service-factory.d.ts +8 -0
- package/dist/services/run-control/session/run-session-service-factory.js +18 -0
- package/dist/services/run-control/session/run-session-service.d.ts +32 -0
- package/dist/services/run-control/session/run-session-service.js +151 -0
- package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/browser/run-browser-service.spec.js +328 -0
- package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/cache/run-cache-service.spec.js +454 -0
- package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/debug/run-debug-service.spec.js +113 -0
- package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/files/run-files-service.spec.js +234 -0
- package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/inject/run-inject-service.spec.js +251 -0
- package/dist/services/run-control/spec/live-run-fixture.d.ts +32 -0
- package/dist/services/run-control/spec/live-run-fixture.js +109 -0
- package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/probe/run-probe-service.spec.js +108 -0
- package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/rum/run-rum-service.spec.js +47 -0
- package/dist/services/run-control/spec/run-answer.spec.d.ts +1 -0
- package/dist/services/run-control/spec/run-answer.spec.js +57 -0
- package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +1 -0
- package/dist/services/run-control/spec/session/run-session-service.spec.js +150 -0
- package/dist/services/run-log/crash-mirror.d.ts +31 -0
- package/dist/services/run-log/crash-mirror.js +69 -0
- package/dist/services/run-log/index.d.ts +11 -0
- package/dist/services/run-log/index.js +11 -0
- package/dist/services/run-log/jsonl-appender.d.ts +46 -0
- package/dist/services/run-log/jsonl-appender.js +91 -0
- package/dist/services/run-log/log-event-model.d.ts +104 -0
- package/dist/services/run-log/log-event-model.js +56 -0
- package/dist/services/run-log/log-query-service-factory.d.ts +11 -0
- package/dist/services/run-log/log-query-service-factory.js +14 -0
- package/dist/services/run-log/log-query-service.d.ts +59 -0
- package/dist/services/run-log/log-query-service.js +111 -0
- package/dist/services/run-log/log-reader.d.ts +84 -0
- package/dist/services/run-log/log-reader.js +180 -0
- package/dist/services/run-log/log-summary.d.ts +72 -0
- package/dist/services/run-log/log-summary.js +208 -0
- package/dist/services/run-log/redaction.d.ts +34 -0
- package/dist/services/run-log/redaction.js +124 -0
- package/dist/services/run-log/request-log.d.ts +82 -0
- package/dist/services/run-log/request-log.js +69 -0
- package/dist/services/run-log/request-summary.d.ts +76 -0
- package/dist/services/run-log/request-summary.js +0 -0
- package/dist/services/run-log/run-log.d.ts +61 -0
- package/dist/services/run-log/run-log.js +102 -0
- package/dist/services/run-log/spec/log-query-service.spec.d.ts +1 -0
- package/dist/services/run-log/spec/log-query-service.spec.js +197 -0
- package/dist/services/run-log/spec/log-reader.spec.d.ts +1 -0
- package/dist/services/run-log/spec/log-reader.spec.js +109 -0
- package/dist/services/run-log/spec/log-summary.spec.d.ts +1 -0
- package/dist/services/run-log/spec/log-summary.spec.js +153 -0
- package/dist/services/run-log/spec/redaction.spec.d.ts +1 -0
- package/dist/services/run-log/spec/redaction.spec.js +61 -0
- package/dist/services/run-log/spec/request-log.spec.d.ts +1 -0
- package/dist/services/run-log/spec/request-log.spec.js +101 -0
- package/dist/services/run-log/spec/request-summary.spec.d.ts +1 -0
- package/dist/services/run-log/spec/request-summary.spec.js +171 -0
- package/dist/services/run-log/spec/run-log.spec.d.ts +1 -0
- package/dist/services/run-log/spec/run-log.spec.js +122 -0
- package/dist/services/run-registry/exit-classification.d.ts +39 -0
- package/dist/services/run-registry/exit-classification.js +42 -0
- package/dist/services/run-registry/index.d.ts +3 -0
- package/dist/services/run-registry/index.js +3 -0
- package/dist/services/run-registry/process-identity.d.ts +28 -0
- package/dist/services/run-registry/process-identity.js +80 -0
- package/dist/services/run-registry/run-registry-model.d.ts +128 -0
- package/dist/services/run-registry/run-registry-model.js +16 -0
- package/dist/services/run-registry/run-registry.d.ts +155 -0
- package/dist/services/run-registry/run-registry.js +430 -0
- package/dist/services/run-registry/spec/exit-classification.spec.d.ts +1 -0
- package/dist/services/run-registry/spec/exit-classification.spec.js +82 -0
- package/dist/services/run-registry/spec/run-registry.spec.d.ts +1 -0
- package/dist/services/run-registry/spec/run-registry.spec.js +526 -0
- package/dist/services/setup/os/tool-registry.js +2 -2
- package/oclif.manifest.json +3493 -372
- package/package.json +20 -2
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { Browser, Page, Protocol } from "puppeteer";
|
|
2
|
+
import { BrowserActionData, BrowserResetScope, BrowserStateData, PageThreadState, BrowserClickData, BrowserEmulateData, CdpData, EmulatedDevice, TabInfo, EmulationState } from "./control-protocol.js";
|
|
3
|
+
import { DebugSession, DebugTransport } from "./debug-session.js";
|
|
4
|
+
import { NavigateWaitPoint } from "./navigate-wait.js";
|
|
5
|
+
import { NavwalkBrowser, RawDocumentHit } from "./navwalk.js";
|
|
6
|
+
import { ViewportBrowser } from "./viewport.js";
|
|
7
|
+
import { PreloadRegistry, PreloadTransport } from "./preload-registry.js";
|
|
8
|
+
import { ServiceWorkerTracker } from "./service-worker-tracker.js";
|
|
9
|
+
/** What `emulate` was asked for. */
|
|
10
|
+
export interface EmulationRequest {
|
|
11
|
+
device: EmulatedDevice | "off";
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
dpr?: number;
|
|
15
|
+
/** Replaces the preset's user agent, without client hints: Safari sends none. */
|
|
16
|
+
userAgent?: string;
|
|
17
|
+
touch?: boolean;
|
|
18
|
+
reload?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** What `click` clicks: a CSS selector, or a control's visible text. */
|
|
21
|
+
export interface ClickTarget {
|
|
22
|
+
selector?: string;
|
|
23
|
+
text?: string;
|
|
24
|
+
}
|
|
25
|
+
/** What `screenshot` captures. */
|
|
26
|
+
export interface ScreenshotRequest {
|
|
27
|
+
fullPage?: boolean;
|
|
28
|
+
selector?: string;
|
|
29
|
+
}
|
|
30
|
+
/** A capture, before anyone has written it anywhere. */
|
|
31
|
+
export interface Screenshot {
|
|
32
|
+
/** Base64 PNG, as CDP hands it over. */
|
|
33
|
+
data: string;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
emulation: EmulationState | null;
|
|
37
|
+
}
|
|
38
|
+
export declare class NoSuchElementError extends Error {
|
|
39
|
+
readonly code = "NO_SUCH_ELEMENT";
|
|
40
|
+
}
|
|
41
|
+
export declare class NoSuchTabError extends Error {
|
|
42
|
+
readonly tabs: TabInfo[];
|
|
43
|
+
readonly code = "NO_SUCH_TAB";
|
|
44
|
+
constructor(message: string, tabs: TabInfo[]);
|
|
45
|
+
}
|
|
46
|
+
/** A passthrough call the run refuses, because it would break the run itself. */
|
|
47
|
+
export declare class CdpRefusedError extends Error {
|
|
48
|
+
readonly code = "CDP_REFUSED";
|
|
49
|
+
}
|
|
50
|
+
/** What the browser answered a passthrough call with, when it was an error. */
|
|
51
|
+
export declare class CdpCallError extends Error {
|
|
52
|
+
readonly code = "CDP_ERROR";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* What a control handler is allowed to do to the page.
|
|
56
|
+
*
|
|
57
|
+
* Deliberately *not* the `Page` itself. Handed a `Page`, every handler would
|
|
58
|
+
* reach for `page.evaluate`, and `page.evaluate` hangs forever while the V8
|
|
59
|
+
* inspector is paused — it waits on a promise the paused VM will never settle.
|
|
60
|
+
* With a breakpoint armed, which is exactly when someone wants to look at the
|
|
61
|
+
* page, the handler would never return and the tool call would never answer.
|
|
62
|
+
*
|
|
63
|
+
* Exposing an evaluator instead closes that door by construction rather than by
|
|
64
|
+
* a rule someone has to remember.
|
|
65
|
+
*/
|
|
66
|
+
export interface PageEvaluator {
|
|
67
|
+
/** Whether there is a page to talk to at all. */
|
|
68
|
+
readonly available: boolean;
|
|
69
|
+
/** The page's current url, or null when there is no page. */
|
|
70
|
+
url(): string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Evaluate an expression in the page and return its value.
|
|
73
|
+
*
|
|
74
|
+
* @throws NoPageError when the run has no page, e.g. before it opens one or
|
|
75
|
+
* after the browser has gone.
|
|
76
|
+
*/
|
|
77
|
+
evaluate<T>(expression: string, timeoutMs?: number): Promise<T>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* What the run has to lend the session for a browser op to mean anything.
|
|
81
|
+
*
|
|
82
|
+
* The origin, because every storage op is scoped to one and guessing it from
|
|
83
|
+
* `page.url()` would clear the wrong site the moment a run navigates away. And
|
|
84
|
+
* `reinstall`, because reinstalling Speed Kit means going through the install
|
|
85
|
+
* page, whose address comes from the customer's own `scope` — that belongs to
|
|
86
|
+
* the run's config, not to a handle on a browser.
|
|
87
|
+
*/
|
|
88
|
+
export interface BrowserRunContext {
|
|
89
|
+
/**
|
|
90
|
+
* The origin the run was started on.
|
|
91
|
+
*
|
|
92
|
+
* A fallback rather than the answer: it is whichever of the app's origins the
|
|
93
|
+
* command resolved at startup, and the page moves.
|
|
94
|
+
*/
|
|
95
|
+
origin: string;
|
|
96
|
+
/**
|
|
97
|
+
* Every origin this app covers, from the customer config.
|
|
98
|
+
*
|
|
99
|
+
* A Speed Kit app is regularly several sites — one brand with a second
|
|
100
|
+
* domain, a market per country — and they are one app with one service
|
|
101
|
+
* worker build and separate storage. Without the list, an op scoped to "the
|
|
102
|
+
* origin" acts on whichever one the run happened to start on, which is the
|
|
103
|
+
* wrong one as soon as the page is on a sibling.
|
|
104
|
+
*/
|
|
105
|
+
origins: string[];
|
|
106
|
+
reinstall(): Promise<void>;
|
|
107
|
+
serviceWorkers: ServiceWorkerTracker;
|
|
108
|
+
/**
|
|
109
|
+
* Have the served Speed Kit worker report this user agent as its own, or
|
|
110
|
+
* stop with null. Takes effect from the next install, which is why
|
|
111
|
+
* `emulate` reinstalls.
|
|
112
|
+
*/
|
|
113
|
+
setWorkerUserAgent?(userAgent: string | null): void;
|
|
114
|
+
/**
|
|
115
|
+
* Publish what an agent is doing, for the devtools extension to show.
|
|
116
|
+
*
|
|
117
|
+
* The extension turns the tab strip blue for an onboarding run and red while
|
|
118
|
+
* this says something is active. The CLI reports rather than draws: the tab
|
|
119
|
+
* strip is browser UI with no CDP surface, so only an extension can touch it,
|
|
120
|
+
* and the one already loaded into the run owns the drawing.
|
|
121
|
+
*/
|
|
122
|
+
reportAgentActivity?(label: string | null, breakpoints?: number[],
|
|
123
|
+
/**
|
|
124
|
+
* When `sk onboarding debug release` last ran. Current state rather than an event, so
|
|
125
|
+
* the panel can act on it once per value and a report it missed is not a
|
|
126
|
+
* release it misses.
|
|
127
|
+
*/
|
|
128
|
+
releasedAt?: string): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the devtools extension is loaded and will arm breakpoints itself.
|
|
131
|
+
*
|
|
132
|
+
* Decides which of the two arming tiers `sk onboarding debug` uses. Both can arm and
|
|
133
|
+
* only one can arm well: the extension rewrites the mark call in the script
|
|
134
|
+
* source, putting the pause inside Speed Kit's own frame, where a
|
|
135
|
+
* `performance.mark` wrapper can only stop beside it.
|
|
136
|
+
*/
|
|
137
|
+
extensionArms?(): boolean;
|
|
138
|
+
/** Whether the run launched with touch emulation, as `--device mobile` does. */
|
|
139
|
+
touch?: boolean;
|
|
140
|
+
/** The screen the run launched with, from `--device`. `emulate off` puts it back. */
|
|
141
|
+
deviceMetrics?: Protocol.Emulation.SetDeviceMetricsOverrideRequest | null;
|
|
142
|
+
/** Switches the touch of `--device` itself. Its CDP session re-applies its own on every navigation. */
|
|
143
|
+
setDeviceTouch?(touch: boolean): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* The devtools extension's ID, or null when the run has none.
|
|
146
|
+
*
|
|
147
|
+
* What `showPanel` looks for among DevTools' tabs: the panel's tab id is the
|
|
148
|
+
* extension's origin followed by the panel title, and another extension
|
|
149
|
+
* loaded alongside may have a panel of its own.
|
|
150
|
+
*/
|
|
151
|
+
devtoolsExtensionId?(): string | null;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The browser ops a control handler may perform, named one by one.
|
|
155
|
+
*
|
|
156
|
+
* The same rule as {@link PageEvaluator}, for the same reason: handing a
|
|
157
|
+
* handler the `Page` would let it reach for anything, and two of the things it
|
|
158
|
+
* could reach for hang or clear the wrong origin. Each op here is the whole of
|
|
159
|
+
* what it does.
|
|
160
|
+
*/
|
|
161
|
+
export interface BrowserController extends PageEvaluator {
|
|
162
|
+
/**
|
|
163
|
+
* The scripts this run has injected into every navigation.
|
|
164
|
+
*
|
|
165
|
+
* Reachable without a page on purpose. A registration outlives the document
|
|
166
|
+
* it was made against, so "what is injected" has an answer between
|
|
167
|
+
* navigations and after a tab closes — and that is exactly when an agent
|
|
168
|
+
* inheriting a session needs to ask.
|
|
169
|
+
*/
|
|
170
|
+
readonly preloads: PreloadRegistry;
|
|
171
|
+
/**
|
|
172
|
+
* Breakpoints in the Speed Kit lifecycle, and control of the pause.
|
|
173
|
+
*
|
|
174
|
+
* A capability rather than a CDP handle, for the reason above: the debugger
|
|
175
|
+
* is the one part of this that needs a conversation with the browser, and
|
|
176
|
+
* keeping that conversation inside {@link DebugSession} is what stops every
|
|
177
|
+
* other handler from having one too.
|
|
178
|
+
*/
|
|
179
|
+
readonly debug: DebugSession;
|
|
180
|
+
/** Reload the page, without the origin check `navigate` applies. */
|
|
181
|
+
reload(): Promise<void>;
|
|
182
|
+
/** Override the viewport size, for a width sweep. */
|
|
183
|
+
resize(width: number, height: number): Promise<void>;
|
|
184
|
+
/** Put the viewport back under the window's own control. */
|
|
185
|
+
clearResize(): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Watch every target for Document requests, until the returned stop is
|
|
188
|
+
* called.
|
|
189
|
+
*
|
|
190
|
+
* Browser-wide rather than page-scoped on purpose: the hops worth capturing
|
|
191
|
+
* happen in popups the flow opens, and a capture scoped to the main page
|
|
192
|
+
* misses exactly those.
|
|
193
|
+
*/
|
|
194
|
+
collectDocumentRequests(onHit: (hit: RawDocumentHit) => void): Promise<() => Promise<void>>;
|
|
195
|
+
state(): Promise<BrowserStateData>;
|
|
196
|
+
reset(scope: BrowserResetScope): Promise<BrowserActionData>;
|
|
197
|
+
reinstallServiceWorker(): Promise<BrowserActionData>;
|
|
198
|
+
navigate(url: string, wait?: NavigateWaitPoint, waitMs?: number): Promise<BrowserActionData>;
|
|
199
|
+
/** Open DevTools for the page on the Speed Kit panel. */
|
|
200
|
+
showPanel(): Promise<BrowserActionData>;
|
|
201
|
+
/** Present the page as a device until switched off, workers included. */
|
|
202
|
+
emulate(request: EmulationRequest): Promise<BrowserEmulateData>;
|
|
203
|
+
/** A PNG of the viewport, the whole page or one element. */
|
|
204
|
+
screenshot(request: ScreenshotRequest): Promise<Screenshot>;
|
|
205
|
+
/** The run's tabs, as `--tab` addresses them. */
|
|
206
|
+
tabs(): Promise<TabInfo[]>;
|
|
207
|
+
/** A real, trusted click on an element, found by selector or by its text. */
|
|
208
|
+
click(target: ClickTarget): Promise<BrowserClickData>;
|
|
209
|
+
/** The controller for one tab: by index from {@link tabs}, or part of its url. */
|
|
210
|
+
tab(selector: string): Promise<BrowserController>;
|
|
211
|
+
/** One CDP call on this tab, on a session of its own. */
|
|
212
|
+
rawCdp(method: string, params?: Record<string, unknown>): Promise<CdpData>;
|
|
213
|
+
}
|
|
214
|
+
export declare class NoBrowserError extends Error {
|
|
215
|
+
readonly code = "BROWSER_UNAVAILABLE";
|
|
216
|
+
}
|
|
217
|
+
export declare class BadUrlError extends Error {
|
|
218
|
+
readonly code = "BAD_URL";
|
|
219
|
+
}
|
|
220
|
+
export declare class NoPageError extends Error {
|
|
221
|
+
readonly code = "NO_PAGE";
|
|
222
|
+
constructor(message?: string);
|
|
223
|
+
}
|
|
224
|
+
export declare class PageEvaluationError extends Error {
|
|
225
|
+
readonly expression: string;
|
|
226
|
+
readonly code: string;
|
|
227
|
+
constructor(message: string, expression: string);
|
|
228
|
+
}
|
|
229
|
+
/** A CDP call that did not answer. Names the method, which is the whole lead. */
|
|
230
|
+
export declare class CdpTimeoutError extends Error {
|
|
231
|
+
readonly method: string;
|
|
232
|
+
readonly code = "CDP_TIMEOUT";
|
|
233
|
+
constructor(method: string, ms: number);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The page's JavaScript thread is stopped in a debugger.
|
|
237
|
+
*
|
|
238
|
+
* Its own code because the cure is not the one for a failed evaluation: nothing
|
|
239
|
+
* that waits on the page will answer until the pause ends, whoever holds it —
|
|
240
|
+
* this run's `sk onboarding debug`, a switch left lit in the devtools panel, a breakpoint
|
|
241
|
+
* in DevTools' Sources panel.
|
|
242
|
+
*/
|
|
243
|
+
export declare class PagePausedError extends PageEvaluationError {
|
|
244
|
+
readonly code: string;
|
|
245
|
+
constructor(expression: string);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Holds the browser and page a run opened, so something other than `run()` can
|
|
249
|
+
* reach them.
|
|
250
|
+
*
|
|
251
|
+
* `OnboardingService.run` keeps its browser and page as locals, which is right
|
|
252
|
+
* for the run itself and useless for anything outside it. This is the seam: the
|
|
253
|
+
* run attaches when the page is ready and detaches when it goes, and the
|
|
254
|
+
* control handlers see an evaluator whose answer to "there is no page" is a
|
|
255
|
+
* typed error rather than a puppeteer stack trace.
|
|
256
|
+
*/
|
|
257
|
+
export declare class BrowserSession implements BrowserController, PreloadTransport, DebugTransport, NavwalkBrowser, ViewportBrowser {
|
|
258
|
+
private readonly cdpAnswerMs;
|
|
259
|
+
private browser?;
|
|
260
|
+
private page?;
|
|
261
|
+
private cdp?;
|
|
262
|
+
private context?;
|
|
263
|
+
/** The emulation in force, re-applied whenever the page's session is remade. */
|
|
264
|
+
private emulation?;
|
|
265
|
+
/**
|
|
266
|
+
* One session per service worker carrying the user-agent override. Kept
|
|
267
|
+
* open: an override lasts as long as the session that set it.
|
|
268
|
+
*/
|
|
269
|
+
private workers;
|
|
270
|
+
/** The browser-wide auto-attach that overrides every service worker as it starts. */
|
|
271
|
+
private workerAttach?;
|
|
272
|
+
/** One session per other tab a caller has asked about, made on demand. */
|
|
273
|
+
private readonly tabSessions;
|
|
274
|
+
/**
|
|
275
|
+
* The passthrough's own CDP session: what a caller enables there stays on
|
|
276
|
+
* between calls, and cannot touch the session the debugger and the preloads
|
|
277
|
+
* live in.
|
|
278
|
+
*/
|
|
279
|
+
private passthrough?;
|
|
280
|
+
/**
|
|
281
|
+
* Built here rather than injected: the registry needs a transport, and this
|
|
282
|
+
* is the only thing that has one. Handing it out through
|
|
283
|
+
* {@link BrowserController} keeps the ownership in one direction.
|
|
284
|
+
*/
|
|
285
|
+
readonly preloads: PreloadRegistry;
|
|
286
|
+
readonly debug: DebugSession;
|
|
287
|
+
/**
|
|
288
|
+
* @param cdpAnswerMs how long a CDP call may take — {@link CDP_ANSWER_MS}
|
|
289
|
+
* unless a spec needs to see a hang in less than four seconds
|
|
290
|
+
*/
|
|
291
|
+
constructor(cdpAnswerMs?: number);
|
|
292
|
+
/** When `sk onboarding debug release` last ran, for every report after it. */
|
|
293
|
+
private releasedAt?;
|
|
294
|
+
private markReleased;
|
|
295
|
+
/**
|
|
296
|
+
* Subscriptions that must outlive the session they were made on.
|
|
297
|
+
*
|
|
298
|
+
* A CDP session takes its listeners with it when it detaches, and the page
|
|
299
|
+
* remakes one. A pause handler that did not survive that would miss the pause
|
|
300
|
+
* it was waiting for, and report a timeout as though nothing had happened.
|
|
301
|
+
*/
|
|
302
|
+
private readonly listeners;
|
|
303
|
+
get available(): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Put the reported agent activity in step with what is installed.
|
|
306
|
+
*
|
|
307
|
+
* Fire and forget on purpose. The report is cosmetic and the run is not: a
|
|
308
|
+
* headless run has no tab strip to colour and an extension that never loaded
|
|
309
|
+
* has nothing to read this, and neither is a reason for an injection to fail.
|
|
310
|
+
*/
|
|
311
|
+
private refreshTabMark;
|
|
312
|
+
/** {@link PreloadTransport}'s name for {@link available}. */
|
|
313
|
+
get pageAvailable(): boolean;
|
|
314
|
+
attach(browser: Browser, page: Page, context?: BrowserRunContext): void;
|
|
315
|
+
/**
|
|
316
|
+
* The run is over, or its page has gone.
|
|
317
|
+
*
|
|
318
|
+
* The preloads go with it. Every registration lives in a CDP session that is
|
|
319
|
+
* about to stop existing, so keeping the entries would mean `list` reporting
|
|
320
|
+
* scripts on a dead run that can never run again.
|
|
321
|
+
*/
|
|
322
|
+
detach(): void;
|
|
323
|
+
url(): string | null;
|
|
324
|
+
/** {@link DebugTransport}: a named CDP call, for {@link DebugSession} only. */
|
|
325
|
+
send<T = unknown>(method: string, params?: object, ms?: number): Promise<T>;
|
|
326
|
+
/**
|
|
327
|
+
* A CDP call on the page's session, bounded — getting the session included,
|
|
328
|
+
* since remaking one re-applies every preload.
|
|
329
|
+
*/
|
|
330
|
+
private call;
|
|
331
|
+
/** {@link DebugTransport}: a subscription that survives a remade session. */
|
|
332
|
+
onCdp(event: string, handler: (payload: never) => void): void;
|
|
333
|
+
/**
|
|
334
|
+
* Reload, without the origin check `navigate` applies.
|
|
335
|
+
*
|
|
336
|
+
* A reload cannot leave the origin by definition, and `arm` needs one: a
|
|
337
|
+
* preload only runs at document start, so arming without reloading arms for
|
|
338
|
+
* a load that has already happened.
|
|
339
|
+
*/
|
|
340
|
+
reload(): Promise<void>;
|
|
341
|
+
/** Pin the viewport, for {@link runViewportSweep}. */
|
|
342
|
+
resize(width: number, height: number): Promise<void>;
|
|
343
|
+
clearResize(): Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Enable Network on every target, now and as they appear.
|
|
346
|
+
*
|
|
347
|
+
* A popup is its own target, so this attaches per target rather than per
|
|
348
|
+
* page. The race is real and worth naming: a target that navigates before
|
|
349
|
+
* the session is up would not be seen, and the first hop is the one that
|
|
350
|
+
* matters most — which is why the sweep discards what it caught before the
|
|
351
|
+
* trigger rather than relying on timing.
|
|
352
|
+
*/
|
|
353
|
+
collectDocumentRequests(onHit: (hit: RawDocumentHit) => void): Promise<() => Promise<void>>;
|
|
354
|
+
/** `Page.addScriptToEvaluateOnNewDocument`, for {@link PreloadRegistry}. */
|
|
355
|
+
addScript(source: string): Promise<string>;
|
|
356
|
+
removeScript(identifier: string): Promise<void>;
|
|
357
|
+
evaluate<T>(expression: string, timeoutMs?: number): Promise<T>;
|
|
358
|
+
/**
|
|
359
|
+
* Whether the page's JavaScript thread is running, paused or stuck.
|
|
360
|
+
*
|
|
361
|
+
* Two evaluations, because a pause is the one state that answers one and not
|
|
362
|
+
* the other: a plain value comes back from the inspector's nested loop, a
|
|
363
|
+
* settled promise does not, since its continuation is a microtask. It needs
|
|
364
|
+
* no debugger attached, so it sees a pause held by anyone. Null without a
|
|
365
|
+
* page.
|
|
366
|
+
*/
|
|
367
|
+
threadState(): Promise<PageThreadState | null>;
|
|
368
|
+
/** Rejects with {@link PagePausedError} when a slow evaluation is due to a pause; never resolves otherwise. */
|
|
369
|
+
private failWhenPaused;
|
|
370
|
+
/**
|
|
371
|
+
* What service workers are on this origin, and whose build they are.
|
|
372
|
+
*
|
|
373
|
+
* Read out of the run's tracker rather than off the page, because the
|
|
374
|
+
* question that matters — is the *deployed* worker in charge — cannot be
|
|
375
|
+
* answered by `navigator.serviceWorker.getRegistrations()`. See
|
|
376
|
+
* {@link ServiceWorkerTracker}.
|
|
377
|
+
*/
|
|
378
|
+
state(): Promise<BrowserStateData>;
|
|
379
|
+
/**
|
|
380
|
+
* Present the page as a device until switched off — what DevTools' device
|
|
381
|
+
* toolbar does, and the reason it is not enough on its own here.
|
|
382
|
+
*
|
|
383
|
+
* Speed Kit decides the device in its service worker, and an override set on
|
|
384
|
+
* the page never reaches a worker. So the user agent is overridden on every
|
|
385
|
+
* service worker target too, now and as they appear, and read back from each
|
|
386
|
+
* one: the answer says whether the worker sees the device, rather than
|
|
387
|
+
* assuming it does.
|
|
388
|
+
*/
|
|
389
|
+
emulate(request: EmulationRequest): Promise<BrowserEmulateData>;
|
|
390
|
+
/** A PNG of the viewport, the whole page, or one element. */
|
|
391
|
+
screenshot(request: ScreenshotRequest): Promise<Screenshot>;
|
|
392
|
+
tabs(): Promise<TabInfo[]>;
|
|
393
|
+
/**
|
|
394
|
+
* The controller for another tab — a popup a login opened, a second window.
|
|
395
|
+
*
|
|
396
|
+
* Each tab gets a session of its own, so what is injected, armed or emulated
|
|
397
|
+
* in one stays there, the way Chrome scopes it anyway. It shares the run's
|
|
398
|
+
* context, but reports no tab mark: that belongs to the run's own page.
|
|
399
|
+
*/
|
|
400
|
+
tab(selector: string): Promise<BrowserController>;
|
|
401
|
+
/**
|
|
402
|
+
* One CDP call, without a debug port: the run already holds the connection.
|
|
403
|
+
*
|
|
404
|
+
* On a session of its own, so a domain a caller enables stays enabled
|
|
405
|
+
* between calls without reaching the run's own session. Refuses what would
|
|
406
|
+
* break the run — see {@link CDP_REFUSED}.
|
|
407
|
+
*/
|
|
408
|
+
rawCdp(method: string, params?: Record<string, unknown>): Promise<CdpData>;
|
|
409
|
+
/**
|
|
410
|
+
* Click an element the way a person does: scrolled into view, then a mouse
|
|
411
|
+
* press and release at its centre, dispatched by the browser. Under touch
|
|
412
|
+
* emulation it is a tap instead: Chrome makes the touchstart, touchend,
|
|
413
|
+
* mousedown, mouseup and click from it, as on a phone.
|
|
414
|
+
*
|
|
415
|
+
* Not `element.click()`: that event is untrusted, and a consent banner or an
|
|
416
|
+
* add-to-cart handler that checks `isTrusted` ignores it — which is exactly
|
|
417
|
+
* the tracking this exists to verify.
|
|
418
|
+
*
|
|
419
|
+
* Not a mouse press under touch emulation: `--device` turns on
|
|
420
|
+
* `Emulation.setEmitTouchEventsForMouse`, and Chrome then never answers
|
|
421
|
+
* `Input.dispatchMouseEvent` for the press.
|
|
422
|
+
*/
|
|
423
|
+
click(target: ClickTarget): Promise<BrowserClickData>;
|
|
424
|
+
/**
|
|
425
|
+
* The element a selector or a text names, through CDP's DOM domain: it
|
|
426
|
+
* answers while the page is paused, where a page evaluation cannot.
|
|
427
|
+
*/
|
|
428
|
+
private nodeFor;
|
|
429
|
+
/**
|
|
430
|
+
* Every shadow root in the page, nested ones included, as node ids.
|
|
431
|
+
*
|
|
432
|
+
* The whole tree with `pierce`, which reissues the node ids — so this is
|
|
433
|
+
* asked only once the light DOM has come up empty.
|
|
434
|
+
*/
|
|
435
|
+
private shadowRoots;
|
|
436
|
+
/** The element's border box, in viewport coordinates. */
|
|
437
|
+
private boxOf;
|
|
438
|
+
/** The tabs a person would call tabs: no DevTools, no extension pages. */
|
|
439
|
+
private openPages;
|
|
440
|
+
/** The device metrics, touch and user agent, on the page's session. */
|
|
441
|
+
private applyEmulation;
|
|
442
|
+
private clearEmulation;
|
|
443
|
+
/**
|
|
444
|
+
* Serve Speed Kit's worker with this user agent, and reinstall it so the
|
|
445
|
+
* worker that runs is that one. A worker already installed keeps the script it
|
|
446
|
+
* was installed from, so without the reinstall the override would wait for
|
|
447
|
+
* Chrome's next update check.
|
|
448
|
+
*/
|
|
449
|
+
private serveWorkerAs;
|
|
450
|
+
/**
|
|
451
|
+
* Override the user agent and its client hints on every service worker, and
|
|
452
|
+
* on each one that starts later, before its first line runs: a stopped worker
|
|
453
|
+
* has no target, and the next fetch starts it fresh.
|
|
454
|
+
*/
|
|
455
|
+
private emulateWorkers;
|
|
456
|
+
private overrideWorker;
|
|
457
|
+
/**
|
|
458
|
+
* What the worker in charge of the page says its user agent is, read in the
|
|
459
|
+
* worker, once one is active.
|
|
460
|
+
*
|
|
461
|
+
* Only that one: it decides the device. A run collects stale registrations,
|
|
462
|
+
* and asking each of them, one stopped worker after the other, ran past the
|
|
463
|
+
* op's budget. An empty list means no worker is in charge yet.
|
|
464
|
+
*/
|
|
465
|
+
private workerUserAgents;
|
|
466
|
+
/**
|
|
467
|
+
* The version of the worker in charge of the page, waiting briefly for one
|
|
468
|
+
* to activate after a reinstall. Null when none did in time.
|
|
469
|
+
*/
|
|
470
|
+
private activeWorker;
|
|
471
|
+
private forgetWorkers;
|
|
472
|
+
/**
|
|
473
|
+
* Load the page again, as a navigation: a document already loaded was laid
|
|
474
|
+
* out, detected and served as the old device.
|
|
475
|
+
*/
|
|
476
|
+
private reloadUnder;
|
|
477
|
+
/**
|
|
478
|
+
* Put the origin back to a known state.
|
|
479
|
+
*
|
|
480
|
+
* `cache` clears the caches and nothing else, which is the one to reach for:
|
|
481
|
+
* a logged-in session costs real effort to re-establish and a custom
|
|
482
|
+
* variation often needs one, so wiping cookies to test a caching change
|
|
483
|
+
* throws away more than it proves. `all` is the full clean start the run
|
|
484
|
+
* performs for itself — storage, cookies, and the worker registration with
|
|
485
|
+
* them.
|
|
486
|
+
*/
|
|
487
|
+
reset(scope: BrowserResetScope): Promise<BrowserActionData>;
|
|
488
|
+
/**
|
|
489
|
+
* The origin a storage op should act on.
|
|
490
|
+
*
|
|
491
|
+
* The page's, when the app covers it. An app is regularly several domains and
|
|
492
|
+
* the run starts on one of them; scoping to that one is right exactly until
|
|
493
|
+
* someone navigates, which is the first thing anyone does.
|
|
494
|
+
*/
|
|
495
|
+
private targetOrigin;
|
|
496
|
+
private pageOrigin;
|
|
497
|
+
/** The app's origins, normalised, with the run's own always among them. */
|
|
498
|
+
private appOrigins;
|
|
499
|
+
/**
|
|
500
|
+
* Reinstall the local Speed Kit build through the install page.
|
|
501
|
+
*
|
|
502
|
+
* Delegated to the run, which owns the install page's address and the
|
|
503
|
+
* bookkeeping around navigating to it. This is the repair for a deployed
|
|
504
|
+
* worker that took over — going back through the install page puts the fetch
|
|
505
|
+
* back on the intercepted path.
|
|
506
|
+
*/
|
|
507
|
+
reinstallServiceWorker(): Promise<BrowserActionData>;
|
|
508
|
+
/**
|
|
509
|
+
* Go somewhere this app covers.
|
|
510
|
+
*
|
|
511
|
+
* Any of the app's origins, not only the one the run started on: a customer
|
|
512
|
+
* with a second brand domain or a market per country is one app, and
|
|
513
|
+
* refusing its siblings would make the tool useless on exactly the setups
|
|
514
|
+
* that need it most. Anything else is still refused, because every storage op
|
|
515
|
+
* here is scoped to an origin and a page parked on a third party would make
|
|
516
|
+
* all of them quietly answer about the wrong site.
|
|
517
|
+
*
|
|
518
|
+
* A relative url resolves against the page's current origin, which is where
|
|
519
|
+
* the caller is looking.
|
|
520
|
+
*/
|
|
521
|
+
navigate(url: string, wait?: NavigateWaitPoint, waitMs?: number): Promise<BrowserActionData>;
|
|
522
|
+
/**
|
|
523
|
+
* Looks at the page until `point`'s mark lands, or until it cannot land any more, or until
|
|
524
|
+
* `deadline`. Never pauses the page.
|
|
525
|
+
*/
|
|
526
|
+
private waitForMark;
|
|
527
|
+
/**
|
|
528
|
+
* Bring the devtools extension's panel to the front, opening DevTools for
|
|
529
|
+
* the page if it is closed.
|
|
530
|
+
*
|
|
531
|
+
* Not read-only, although it changes nothing about the page by itself:
|
|
532
|
+
* DevTools being open does. A breakpoint switch lit in the panel pauses
|
|
533
|
+
* every load only while DevTools is open, and a ticked "Disable cache" in
|
|
534
|
+
* the Network panel only applies then — so opening it can change what the
|
|
535
|
+
* next measurement sees.
|
|
536
|
+
*/
|
|
537
|
+
showPanel(): Promise<BrowserActionData>;
|
|
538
|
+
/** The page and the run context, or the typed reason there is none. */
|
|
539
|
+
private require;
|
|
540
|
+
/**
|
|
541
|
+
* One CDP session, made on demand and remade when the page replaces it.
|
|
542
|
+
*
|
|
543
|
+
* A navigation can invalidate the session, so a cached handle is not
|
|
544
|
+
* something to trust for the life of the run.
|
|
545
|
+
*/
|
|
546
|
+
private cdpSession;
|
|
547
|
+
}
|