@speedkit/cli 4.50.5 → 4.51.0-run-control.2
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 +1425 -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/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 +40 -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 +33 -6
- 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 +3 -1
- 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 +535 -0
- package/dist/services/onboarding/control/browser-session.js +1300 -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 +1428 -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 +30 -0
- package/dist/services/onboarding/onboarding-model.js +12 -1
- 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 +136 -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/control/browser-session.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/control/browser-session.spec.js +651 -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 +66 -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 +327 -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 +3409 -288
- package/package.json +20 -2
|
@@ -4,6 +4,8 @@ import { INTEGRATION_FILES } from "../../models/files.js";
|
|
|
4
4
|
import { AthenaServiceBuildContext, AthenaServiceFactory, } from "../athena/index.js";
|
|
5
5
|
import { BundleServiceFactory } from "../bundler/index.js";
|
|
6
6
|
import { createDiffEngine, PageSource } from "../diff/index.js";
|
|
7
|
+
import { BrowserSession, ControlServer } from "./control/index.js";
|
|
8
|
+
import { validateLoadedConfig } from "./control/config-validation.js";
|
|
7
9
|
import { DocumentHandlerRuntimeServiceBuildContext } from "../document-handler-runtime/document-handler-runtime-service-build-context.js";
|
|
8
10
|
import DocumentHandlerRuntimeServiceFactory from "../document-handler-runtime/factory/document-handler-runtime-service-factory.js";
|
|
9
11
|
import { documentHandlerRuntimeFiles } from "../document-handler-runtime/runtime-files.js";
|
|
@@ -42,12 +44,16 @@ import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api
|
|
|
42
44
|
import { ExtensionBridge } from "./browser/extension/extension-bridge.js";
|
|
43
45
|
import { TodoCollector } from "./todo-collector.js";
|
|
44
46
|
import { installBrowserOriginFetch } from "../browser-fetch/index.js";
|
|
45
|
-
import { OriginFetcher, RuntimeConfigSource } from "../origin-request/index.js";
|
|
47
|
+
import { NO_RUNTIME_CONFIG_WARNING, OriginFetcher, RuntimeConfigSource, } from "../origin-request/index.js";
|
|
46
48
|
import { VirtualOrestesApp } from "./virtual-orestes-app/index.js";
|
|
47
49
|
import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
|
|
48
50
|
import * as fs from "node:fs";
|
|
49
51
|
import * as path from "node:path";
|
|
52
|
+
import { join } from "node:path";
|
|
53
|
+
import { mkdtempSync } from "node:fs";
|
|
54
|
+
import { tmpdir } from "node:os";
|
|
50
55
|
import { StaticRecipe } from "../integration-api/virtual/static-recipe.js";
|
|
56
|
+
import FileList from "../integration-api/file-list.js";
|
|
51
57
|
import { DiffAgainstCurrentPage } from "./dashboard/diff-against-current-page.js";
|
|
52
58
|
import { ExtensionDownloader } from "./browser/extension/extension-downloader.js";
|
|
53
59
|
import { ExecutableValidator } from "./browser/executable/executable-validator.js";
|
|
@@ -57,8 +63,19 @@ import { ParameterQueryServiceBuildContext } from "../query-builder/query-builde
|
|
|
57
63
|
import { formatChromeFeatureFinding, formatChromeFlagDuplicate, } from "../../helpers/chrome-flags.js";
|
|
58
64
|
export class OnboardingServiceFactory {
|
|
59
65
|
context;
|
|
60
|
-
|
|
66
|
+
run;
|
|
67
|
+
requestLog;
|
|
68
|
+
constructor(context,
|
|
69
|
+
/** Recorded by the command; filled in here once the config is known. */
|
|
70
|
+
run,
|
|
71
|
+
/**
|
|
72
|
+
* Where intercepted requests go. Owned by the command, because it is the
|
|
73
|
+
* one place that decides whether this run writes anything to disk.
|
|
74
|
+
*/
|
|
75
|
+
requestLog) {
|
|
61
76
|
this.context = context;
|
|
77
|
+
this.run = run;
|
|
78
|
+
this.requestLog = requestLog;
|
|
62
79
|
}
|
|
63
80
|
/**
|
|
64
81
|
* The service `sk onboarding` runs: the browse service under `--browse`, the inject service under
|
|
@@ -98,7 +115,13 @@ export class OnboardingServiceFactory {
|
|
|
98
115
|
];
|
|
99
116
|
return new InjectService({
|
|
100
117
|
browserContext,
|
|
101
|
-
fetchEventHandler: new FetchEventHandler(
|
|
118
|
+
fetchEventHandler: new FetchEventHandler({
|
|
119
|
+
browserFetchEvents: handlers,
|
|
120
|
+
customerConfig,
|
|
121
|
+
cli,
|
|
122
|
+
client: this.getConfigApi(customerConfig.app),
|
|
123
|
+
requestLog: this.requestLog,
|
|
124
|
+
}),
|
|
102
125
|
installation,
|
|
103
126
|
scope: customerConfig.scope,
|
|
104
127
|
cli,
|
|
@@ -113,7 +136,18 @@ export class OnboardingServiceFactory {
|
|
|
113
136
|
applyOriginProxy(customerConfig?.chromeFlags, cli);
|
|
114
137
|
const url = resolveBrowseUrl(this.context.domain, customerConfig);
|
|
115
138
|
const { browserContext } = await this.prepareBrowser(url, customerConfig?.chromeFlags);
|
|
116
|
-
|
|
139
|
+
// Browse mode has no cache and no files; the ops that read them answer empty.
|
|
140
|
+
const session = new BrowserSession();
|
|
141
|
+
const controlServer = this.run
|
|
142
|
+
? new ControlServer(this.run.dir, this.run.id, {
|
|
143
|
+
cache: new Cache(cli, join(this.run.dir, "dh-cache")),
|
|
144
|
+
cli,
|
|
145
|
+
files: new FileList(),
|
|
146
|
+
session,
|
|
147
|
+
origin: browserContext.domain,
|
|
148
|
+
})
|
|
149
|
+
: undefined;
|
|
150
|
+
return new BrowseService(browserContext, cli, controlServer, session);
|
|
117
151
|
}
|
|
118
152
|
/**
|
|
119
153
|
* What inject mode injects, and where. The app and the domain come from the flags, else from a
|
|
@@ -195,11 +229,21 @@ export class OnboardingServiceFactory {
|
|
|
195
229
|
for (const finding of browserContext.findFeatureFindings()) {
|
|
196
230
|
cli.writeWarning(formatChromeFeatureFinding(finding));
|
|
197
231
|
}
|
|
198
|
-
if (this.context.debuggingPort
|
|
199
|
-
cli.writeWarning(`Chrome remote debugging enabled on port ${this.context.debugPort}
|
|
232
|
+
if (this.context.debuggingPort) {
|
|
233
|
+
cli.writeWarning(`Chrome remote debugging enabled on port ${this.context.debugPort}.`, false,
|
|
234
|
+
// Yellow on the terminal because it changes how Chrome behaves, but it
|
|
235
|
+
// is not a problem — and `--summary` lists every warning as one.
|
|
236
|
+
{
|
|
237
|
+
scope: "browser",
|
|
238
|
+
level: "info",
|
|
239
|
+
data: { debugPort: this.context.debugPort },
|
|
240
|
+
});
|
|
200
241
|
}
|
|
201
242
|
if (this.context.headless) {
|
|
202
|
-
cli.writeWarning("Running in headless mode."
|
|
243
|
+
cli.writeWarning("Running in headless mode.", false, {
|
|
244
|
+
scope: "browser",
|
|
245
|
+
data: { headless: true },
|
|
246
|
+
});
|
|
203
247
|
}
|
|
204
248
|
if (browserContext.emulation) {
|
|
205
249
|
const { device, userAgent, viewport } = browserContext.emulation;
|
|
@@ -215,6 +259,7 @@ export class OnboardingServiceFactory {
|
|
|
215
259
|
const cli = this.context.environment.cli;
|
|
216
260
|
const files = await this.getIntegrationFiles(cli);
|
|
217
261
|
const customerConfig = files.getCustomerConfig().config;
|
|
262
|
+
this.run?.update({ app: customerConfig.app });
|
|
218
263
|
// Before any origin request, so Chrome and the CLI agree on the route out.
|
|
219
264
|
applyOriginProxy(customerConfig.chromeFlags, cli);
|
|
220
265
|
// Also before any origin request: an origin behind bot protection refuses the CLI outright,
|
|
@@ -228,7 +273,19 @@ export class OnboardingServiceFactory {
|
|
|
228
273
|
cli.writeWarning("Fetching every origin document through a second headless Chrome.");
|
|
229
274
|
}
|
|
230
275
|
const domainToStart = await this.getUrlForTest(customerConfig, cli);
|
|
231
|
-
|
|
276
|
+
// Recorded, not derived: a customer with several origins and no `domain`
|
|
277
|
+
// has nothing in its config that says which site this run is on, and
|
|
278
|
+
// `origins[0]` is a guess that is wrong for anyone started with `-d` or who
|
|
279
|
+
// picked the second entry at the prompt. `sk origin-request` reads it back to
|
|
280
|
+
// resolve a relative url the way the control socket already does for a live
|
|
281
|
+
// run — and from here it survives the run, so a post-mortem resolves too.
|
|
282
|
+
this.run?.update({ domain: domainToStart });
|
|
283
|
+
// Inside the run directory, so the run's own retention prunes the bodies
|
|
284
|
+
// and a finished run's cache is still readable. Without a run — a test
|
|
285
|
+
// harness — a temp directory keeps it to one code path.
|
|
286
|
+
const cache = new Cache(cli, this.run
|
|
287
|
+
? join(this.run.dir, "dh-cache")
|
|
288
|
+
: mkdtempSync(join(tmpdir(), "sk-dh-cache-")));
|
|
232
289
|
const documentHandler = await new DocumentHandlerRuntimeServiceFactory(new DocumentHandlerRuntimeServiceBuildContext({
|
|
233
290
|
environment: this.context.environment,
|
|
234
291
|
configName: this.context.configName,
|
|
@@ -242,13 +299,68 @@ export class OnboardingServiceFactory {
|
|
|
242
299
|
const { browserContext, browserExtensions } = await this.prepareBrowser(domainToStart, customerConfig.chromeFlags);
|
|
243
300
|
const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
|
|
244
301
|
const athenaClient = (await this.getAthenaClient(customerConfig.app)) || null;
|
|
245
|
-
|
|
302
|
+
// One collector, read by both consumers: the devtools panel gets it as a
|
|
303
|
+
// message, `sk onboarding todo` reads it over the control socket. Two instances would
|
|
304
|
+
// drift the moment either started caching.
|
|
305
|
+
const todos = new TodoCollector(files.getInstallResources());
|
|
306
|
+
const messageHandler = await this.prepareMessagehandler(athenaClient, files, customerConfig, todos);
|
|
246
307
|
const speedKitServiceWorkerJs = new SpeedKitServiceWorkerJs(customerConfig, files.getByName(INTEGRATION_FILES.CUSTOM.SW));
|
|
247
|
-
const fetchHandler = await this.getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient, messageHandler, fileWatcher, speedKitServiceWorkerJs);
|
|
308
|
+
const { fetchHandler, orestesApp, rumPi, runtimeConfig } = await this.getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient, messageHandler, fileWatcher, speedKitServiceWorkerJs);
|
|
248
309
|
const extensionBridge = new ExtensionBridge(cli, browserExtensions.hasDevtoolsExtension);
|
|
249
|
-
|
|
310
|
+
// Constructed here so it holds the same Cache the run does, not a second
|
|
311
|
+
// one. Its lifetime is the run's: OnboardingService starts it against the
|
|
312
|
+
// shutdown signal.
|
|
313
|
+
// The run fills this in once it has a page; until then every op that needs
|
|
314
|
+
// one answers NO_PAGE rather than hanging on something that is not there.
|
|
315
|
+
const browserSession = new BrowserSession();
|
|
316
|
+
const controlServer = this.run
|
|
317
|
+
? new ControlServer(this.run.dir, this.run.id, {
|
|
318
|
+
cache,
|
|
319
|
+
cli,
|
|
320
|
+
files,
|
|
321
|
+
session: browserSession,
|
|
322
|
+
todos,
|
|
323
|
+
// `browserContext.domain`, not `customerConfig.domain`: the latter is
|
|
324
|
+
// a bare host in every config_customer, and `new URL(input, base)`
|
|
325
|
+
// parses the base first and throws when it has no scheme — even for
|
|
326
|
+
// an absolute input. That made every `sk onboarding response` call fail with
|
|
327
|
+
// BAD_URL blaming the url the caller passed. This one is
|
|
328
|
+
// `ensureHttps`-ed and honours `-d` and the multi-origin prompt, so
|
|
329
|
+
// it is also the origin the run is actually driving — `origins[0]`
|
|
330
|
+
// would resolve a relative url against the wrong site for a customer
|
|
331
|
+
// started on their second origin.
|
|
332
|
+
origin: browserContext.domain,
|
|
333
|
+
// Undefined without `--local`, and the op says so rather than
|
|
334
|
+
// failing obscurely: there is no local documentHandler to build with.
|
|
335
|
+
prewarm: orestesApp
|
|
336
|
+
? (url, variation) => orestesApp.prewarm(url, variation)
|
|
337
|
+
: undefined,
|
|
338
|
+
variations: orestesApp
|
|
339
|
+
? () => orestesApp.namedVariations()
|
|
340
|
+
: undefined,
|
|
341
|
+
rumBeacons: rumPi ? () => rumPi.beacons() : undefined,
|
|
342
|
+
cacheErrors: orestesApp
|
|
343
|
+
? () => orestesApp.getLocalCacheErrors()
|
|
344
|
+
: undefined,
|
|
345
|
+
// The watcher's own rebuild groups, so an on-demand rebuild has the
|
|
346
|
+
// same blast radius as the file change that would have triggered it.
|
|
347
|
+
// It answers NO_REBUILD until the run has wired its watchers, which
|
|
348
|
+
// is after the page is ready.
|
|
349
|
+
rebuild: (target) => fileWatcher.rebuild(target),
|
|
350
|
+
validate: () => validateLoadedConfig(customerConfig, files),
|
|
351
|
+
// `sk diff` follows the run with the config it loaded, and refuses without one.
|
|
352
|
+
runtimeConfig: () => runtimeConfig,
|
|
353
|
+
// Evaluated per call, not captured: the config is the thing being
|
|
354
|
+
// edited, and explaining a url against the version loaded at startup
|
|
355
|
+
// would answer about a file the user has since changed.
|
|
356
|
+
speedKitConfig: () => files
|
|
357
|
+
.getSpeedKitConfig()
|
|
358
|
+
.evaluate(customerConfig.app, customerConfig.origins[0]),
|
|
359
|
+
})
|
|
360
|
+
: undefined;
|
|
361
|
+
return new OnboardingService(browserContext, customerConfig, fetchHandler, fileWatcher, cli, messageHandler, extensionBridge, speedKitServiceWorkerJs, browserFetch, controlServer, browserSession, this.run);
|
|
250
362
|
}
|
|
251
|
-
async prepareMessagehandler(athenaClient, files, customerConfig) {
|
|
363
|
+
async prepareMessagehandler(athenaClient, files, customerConfig, todos) {
|
|
252
364
|
const messageHandler = new DevtoolsExtensionApi();
|
|
253
365
|
messageHandler.addMessage({
|
|
254
366
|
id: "skCli",
|
|
@@ -261,10 +373,9 @@ export class OnboardingServiceFactory {
|
|
|
261
373
|
id: "athena",
|
|
262
374
|
data: { client: !!athenaClient },
|
|
263
375
|
});
|
|
264
|
-
const fileTodoCollector = new TodoCollector(files.getInstallResources());
|
|
265
376
|
messageHandler.addMessage({
|
|
266
377
|
id: "todo",
|
|
267
|
-
data: [...
|
|
378
|
+
data: [...todos.getOpenTasks()],
|
|
268
379
|
});
|
|
269
380
|
const appToken = await this.getAppToken(customerConfig.app);
|
|
270
381
|
if (appToken) {
|
|
@@ -288,15 +399,21 @@ export class OnboardingServiceFactory {
|
|
|
288
399
|
return result.data.token ?? null;
|
|
289
400
|
}
|
|
290
401
|
async buildInstallResource(speedKitInstallContext, files, cli) {
|
|
291
|
-
cli.startAction("ONBOARDING:BUILD:INSTALL_RESOURCE", "build file install_resource");
|
|
402
|
+
cli.startAction("ONBOARDING:BUILD:INSTALL_RESOURCE", "build file install_resource", { scope: "config" });
|
|
292
403
|
const installResourceFile = new VirtualFile(INTEGRATION_FILES.BUILD.INSTALL, new InstallFileRecipe(speedKitInstallContext));
|
|
293
404
|
const result = await safe(installResourceFile.buildContent());
|
|
294
405
|
if (result.success === true) {
|
|
295
406
|
files.addFile(installResourceFile);
|
|
296
|
-
cli.successAction("ONBOARDING:BUILD:INSTALL_RESOURCE"
|
|
407
|
+
cli.successAction("ONBOARDING:BUILD:INSTALL_RESOURCE", undefined, {
|
|
408
|
+
scope: "config",
|
|
409
|
+
data: { file: INTEGRATION_FILES.BUILD.INSTALL },
|
|
410
|
+
});
|
|
297
411
|
return;
|
|
298
412
|
}
|
|
299
|
-
cli.failAction("ONBOARDING:BUILD:INSTALL_RESOURCE", result.error
|
|
413
|
+
cli.failAction("ONBOARDING:BUILD:INSTALL_RESOURCE", result.error, {
|
|
414
|
+
scope: "config",
|
|
415
|
+
data: { file: INTEGRATION_FILES.BUILD.INSTALL, error: result.error },
|
|
416
|
+
});
|
|
300
417
|
}
|
|
301
418
|
async getAthenaClient(app) {
|
|
302
419
|
// no promptForLogin: onboarding shows the Athena data when a login is
|
|
@@ -321,9 +438,7 @@ export class OnboardingServiceFactory {
|
|
|
321
438
|
configApi,
|
|
322
439
|
}).load();
|
|
323
440
|
if (!runtimeConfig) {
|
|
324
|
-
|
|
325
|
-
// override of a device variation. Those still resolve, from their built-in defaults only.
|
|
326
|
-
cli.writeWarning("without the runtime config, origin fetches carry no basic auth, no custom variation and no configured override of default, mobile or tablet — those fall back to the built-in defaults.");
|
|
441
|
+
cli.writeWarning(NO_RUNTIME_CONFIG_WARNING);
|
|
327
442
|
}
|
|
328
443
|
const originFetcher = new OriginFetcher({ cli, config: runtimeConfig });
|
|
329
444
|
const parameterQueryBuilder = await new QueryBuilderFactory(new ParameterQueryServiceBuildContext({
|
|
@@ -350,8 +465,20 @@ export class OnboardingServiceFactory {
|
|
|
350
465
|
const orestesApp = new VirtualOrestesApp(customerConfig, originFetcher, documentHandler, cache, cli, messageHandler, this.context.ignoreContentSecurityPolicy);
|
|
351
466
|
// let config-file changes re-warm the dh-cache in the background
|
|
352
467
|
fileWatcher.setCacheRefresher(orestesApp);
|
|
353
|
-
|
|
354
|
-
|
|
468
|
+
const rumPi = new SpeedKitRumPiRequest(customerConfig, orestesApp);
|
|
469
|
+
handlers.push(new SpeedKitAssetRequest(customerConfig, orestesApp), rumPi);
|
|
470
|
+
return {
|
|
471
|
+
rumPi,
|
|
472
|
+
fetchHandler: new FetchEventHandler({
|
|
473
|
+
browserFetchEvents: handlers,
|
|
474
|
+
customerConfig,
|
|
475
|
+
cli,
|
|
476
|
+
client: configApi,
|
|
477
|
+
requestLog: this.requestLog,
|
|
478
|
+
}),
|
|
479
|
+
orestesApp,
|
|
480
|
+
runtimeConfig,
|
|
481
|
+
};
|
|
355
482
|
}
|
|
356
483
|
async getIntegrationFiles(cli) {
|
|
357
484
|
const projectRoot = path.resolve(this.context.customerPath, "../..");
|
|
@@ -376,7 +503,7 @@ export class OnboardingServiceFactory {
|
|
|
376
503
|
];
|
|
377
504
|
// if speed-kit is npm-linked, use linked local files else fetch latest released sw and df
|
|
378
505
|
if (isSpeedKitLinked) {
|
|
379
|
-
cli.writeWarning(`Linked Speed-Kit found in node_modules. Using built sw, df and loader
|
|
506
|
+
cli.writeWarning(`Linked Speed-Kit found in node_modules. Using built sw, df and loader.`, false, { scope: "config", data: { speedKitLinked: true } });
|
|
380
507
|
integrationApiArray.push({
|
|
381
508
|
name: INTEGRATION_FILES.CUSTOM.SW,
|
|
382
509
|
recipe: new StaticRecipe(fs.readFileSync(swPath, "utf-8")),
|
|
@@ -7,6 +7,8 @@ import { CliServiceInterface } from "../cli/index.js";
|
|
|
7
7
|
import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
|
|
8
8
|
import { ExtensionBridge } from "./browser/extension/extension-bridge.js";
|
|
9
9
|
import { BrowserOriginFetchHandle } from "../browser-fetch/index.js";
|
|
10
|
+
import { BrowserSession, ControlServer } from "./control/index.js";
|
|
11
|
+
import { RunHandle } from "../run-registry/index.js";
|
|
10
12
|
/**
|
|
11
13
|
* Represents the OnboardingService which is responsible for setting up the browser to test a config using Puppeteer.
|
|
12
14
|
*/
|
|
@@ -20,10 +22,22 @@ export declare class OnboardingService {
|
|
|
20
22
|
private extensionBridge;
|
|
21
23
|
private speedKitServiceWorkerJs;
|
|
22
24
|
private browserFetch?;
|
|
25
|
+
/** Absent when the run was not recorded, e.g. in a test harness. */
|
|
26
|
+
private controlServer?;
|
|
27
|
+
/** Filled in once the page is ready, so control ops can reach it. */
|
|
28
|
+
private browserSession?;
|
|
29
|
+
/** So the run can be stamped where the reason for ending is known. */
|
|
30
|
+
private runHandle?;
|
|
23
31
|
private reinstallOnNextNavigate;
|
|
24
32
|
private lastForeignSwReinstall;
|
|
25
33
|
private readonly activatedSwVersions;
|
|
26
|
-
constructor(browserContext: BrowserContext, customerConfig: CustomerConfig, fetchEventHandler: FetchEventHandler, fileWatcher: FileWatcher, cli: CliServiceInterface, developmentToolsMessages: DevtoolsExtensionApi, extensionBridge: ExtensionBridge, speedKitServiceWorkerJs: SpeedKitServiceWorkerJs, browserFetch?: BrowserOriginFetchHandle
|
|
34
|
+
constructor(browserContext: BrowserContext, customerConfig: CustomerConfig, fetchEventHandler: FetchEventHandler, fileWatcher: FileWatcher, cli: CliServiceInterface, developmentToolsMessages: DevtoolsExtensionApi, extensionBridge: ExtensionBridge, speedKitServiceWorkerJs: SpeedKitServiceWorkerJs, browserFetch?: BrowserOriginFetchHandle,
|
|
35
|
+
/** Absent when the run was not recorded, e.g. in a test harness. */
|
|
36
|
+
controlServer?: ControlServer,
|
|
37
|
+
/** Filled in once the page is ready, so control ops can reach it. */
|
|
38
|
+
browserSession?: BrowserSession,
|
|
39
|
+
/** So the run can be stamped where the reason for ending is known. */
|
|
40
|
+
runHandle?: RunHandle);
|
|
27
41
|
/**
|
|
28
42
|
* Prepare the puppeteer browser, wire event listeners, navigate to the
|
|
29
43
|
* install page, then block until either the caller aborts the signal
|
|
@@ -31,6 +45,13 @@ export declare class OnboardingService {
|
|
|
31
45
|
* any still-open resources. File watchers close themselves via `signal`.
|
|
32
46
|
*/
|
|
33
47
|
run(externalSignal: AbortSignal): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Open the control socket, if this run has a directory to put it in.
|
|
50
|
+
*
|
|
51
|
+
* Non-fatal: a run that cannot be controlled from outside is still a run, and
|
|
52
|
+
* failing the developer's session over it would be the wrong trade.
|
|
53
|
+
*/
|
|
54
|
+
private startControlServer;
|
|
34
55
|
private prepareBrowser;
|
|
35
56
|
private preparePage;
|
|
36
57
|
/**
|
|
@@ -41,6 +62,19 @@ export declare class OnboardingService {
|
|
|
41
62
|
* sk-cli. Without a loaded devtools extension there is nothing to attach
|
|
42
63
|
* to — ExtensionValidator already reported why — so it is skipped.
|
|
43
64
|
*/
|
|
65
|
+
/**
|
|
66
|
+
* Say what an agent is doing, for the devtools extension to show.
|
|
67
|
+
*
|
|
68
|
+
* Reported, not drawn. The tab strip is browser UI with no CDP surface at
|
|
69
|
+
* all, so only an extension can colour it — and the one already loaded into
|
|
70
|
+
* the run owns that, keyed off this message. See `lib/agent-tab-state.ts` in
|
|
71
|
+
* team-pi/devtools.
|
|
72
|
+
*
|
|
73
|
+
* Upserted rather than appended: this is current state, not an event log, and
|
|
74
|
+
* a panel that had to dedupe a history to find the live value would be doing
|
|
75
|
+
* work this side can simply not create.
|
|
76
|
+
*/
|
|
77
|
+
private reportAgentActivity;
|
|
44
78
|
/**
|
|
45
79
|
* Open the run's DevTools on the Speed Kit panel rather than on Elements.
|
|
46
80
|
*
|
|
@@ -51,6 +85,11 @@ export declare class OnboardingService {
|
|
|
51
85
|
private showDevtoolsPanelOnStart;
|
|
52
86
|
private attachExtensionBridge;
|
|
53
87
|
private findPage;
|
|
88
|
+
/**
|
|
89
|
+
* What service workers this run has seen. Nothing else records it — CDP only
|
|
90
|
+
* streams the events, so a reader arriving later has missed them.
|
|
91
|
+
*/
|
|
92
|
+
private readonly serviceWorkers;
|
|
54
93
|
private prepareCleanState;
|
|
55
94
|
/**
|
|
56
95
|
* Detects when the DEPLOYED service worker takes over the local session and
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BROWSER_EVENTS, CDP_SESSION, } from "./onboarding-model.js";
|
|
2
|
-
import { PanelNotFoundError, showDevtoolsPanel, } from "./browser/extension/devtools-panel.js";
|
|
3
2
|
import { safe } from "../../helpers/safe.js";
|
|
4
3
|
import { isEmptyServiceWorkerUrl } from "./empty-service-worker.js";
|
|
5
4
|
import { launchBrowser, resetBrowserState } from "./browser/launch-browser.js";
|
|
5
|
+
import { recordConsole } from "./browser/console-log.js";
|
|
6
|
+
import { ServiceWorkerTracker, } from "./control/index.js";
|
|
6
7
|
// A SW version activating later than this after the last locally served sw.js
|
|
7
8
|
// cannot originate from our interception — it is a deployed-build takeover.
|
|
8
9
|
const LOCAL_SW_SERVE_GRACE_MS = 10_000;
|
|
@@ -21,10 +22,19 @@ export class OnboardingService {
|
|
|
21
22
|
extensionBridge;
|
|
22
23
|
speedKitServiceWorkerJs;
|
|
23
24
|
browserFetch;
|
|
25
|
+
controlServer;
|
|
26
|
+
browserSession;
|
|
27
|
+
runHandle;
|
|
24
28
|
reinstallOnNextNavigate = false;
|
|
25
29
|
lastForeignSwReinstall = 0;
|
|
26
30
|
activatedSwVersions = new Set();
|
|
27
|
-
constructor(browserContext, customerConfig, fetchEventHandler, fileWatcher, cli, developmentToolsMessages, extensionBridge, speedKitServiceWorkerJs, browserFetch
|
|
31
|
+
constructor(browserContext, customerConfig, fetchEventHandler, fileWatcher, cli, developmentToolsMessages, extensionBridge, speedKitServiceWorkerJs, browserFetch,
|
|
32
|
+
/** Absent when the run was not recorded, e.g. in a test harness. */
|
|
33
|
+
controlServer,
|
|
34
|
+
/** Filled in once the page is ready, so control ops can reach it. */
|
|
35
|
+
browserSession,
|
|
36
|
+
/** So the run can be stamped where the reason for ending is known. */
|
|
37
|
+
runHandle) {
|
|
28
38
|
this.browserContext = browserContext;
|
|
29
39
|
this.customerConfig = customerConfig;
|
|
30
40
|
this.fetchEventHandler = fetchEventHandler;
|
|
@@ -34,6 +44,9 @@ export class OnboardingService {
|
|
|
34
44
|
this.extensionBridge = extensionBridge;
|
|
35
45
|
this.speedKitServiceWorkerJs = speedKitServiceWorkerJs;
|
|
36
46
|
this.browserFetch = browserFetch;
|
|
47
|
+
this.controlServer = controlServer;
|
|
48
|
+
this.browserSession = browserSession;
|
|
49
|
+
this.runHandle = runHandle;
|
|
37
50
|
}
|
|
38
51
|
/**
|
|
39
52
|
* Prepare the puppeteer browser, wire event listeners, navigate to the
|
|
@@ -42,36 +55,87 @@ export class OnboardingService {
|
|
|
42
55
|
* any still-open resources. File watchers close themselves via `signal`.
|
|
43
56
|
*/
|
|
44
57
|
async run(externalSignal) {
|
|
45
|
-
this.cli.startAction("ONBOARDING:PREPARE:BROWSER", `prepare browser ${this.cli.style.bold(this.browserContext.browserVersionString)}
|
|
58
|
+
this.cli.startAction("ONBOARDING:PREPARE:BROWSER", `prepare browser ${this.cli.style.bold(this.browserContext.browserVersionString)}`, {
|
|
59
|
+
scope: "browser",
|
|
60
|
+
data: { browser: this.browserContext.browserVersionString },
|
|
61
|
+
});
|
|
46
62
|
const localController = new AbortController();
|
|
47
63
|
const shutdownSignal = AbortSignal.any([
|
|
48
64
|
externalSignal,
|
|
49
65
|
localController.signal,
|
|
50
66
|
]);
|
|
67
|
+
await this.startControlServer(shutdownSignal);
|
|
51
68
|
const browser = await this.prepareBrowser(localController);
|
|
52
69
|
await this.attachExtensionBridge(browser);
|
|
53
70
|
const page = await this.preparePage(browser, shutdownSignal);
|
|
54
|
-
|
|
71
|
+
// The browser ops need more than a handle: the origins they may act on, and
|
|
72
|
+
// the run's own way of reinstalling. Both belong to the run, so they are
|
|
73
|
+
// lent rather than rediscovered.
|
|
74
|
+
//
|
|
75
|
+
// Every origin, not only the one this run started on. Storage is
|
|
76
|
+
// partitioned per origin, so an op that assumed the startup domain would
|
|
77
|
+
// act on the wrong site the moment the page moved to a sibling — and a
|
|
78
|
+
// multi-domain app is the normal case, not the exception.
|
|
79
|
+
this.browserSession?.attach(browser, page, {
|
|
80
|
+
origin: this.browserContext.domain,
|
|
81
|
+
origins: this.customerConfig.origins ?? [],
|
|
82
|
+
reinstall: () => this.reinstallSpeedKit(page, new URL(page.url()).pathname),
|
|
83
|
+
serviceWorkers: this.serviceWorkers,
|
|
84
|
+
setWorkerUserAgent: (userAgent) => {
|
|
85
|
+
this.speedKitServiceWorkerJs.userAgent = userAgent ?? undefined;
|
|
86
|
+
},
|
|
87
|
+
reportAgentActivity: (label, breakpoints, releasedAt) => this.reportAgentActivity(label, breakpoints, releasedAt),
|
|
88
|
+
extensionArms: () => this.extensionBridge.available,
|
|
89
|
+
devtoolsExtensionId: () => this.extensionBridge.devtoolsExtensionId,
|
|
90
|
+
});
|
|
91
|
+
this.cli.successAction("ONBOARDING:PREPARE:BROWSER", undefined, {
|
|
92
|
+
scope: "browser",
|
|
93
|
+
});
|
|
55
94
|
// Not awaited: the panel registers a moment after DevTools opens, and the
|
|
56
95
|
// run has no reason to wait for a convenience.
|
|
57
|
-
void this.showDevtoolsPanelOnStart(
|
|
96
|
+
void this.showDevtoolsPanelOnStart();
|
|
58
97
|
await this.navigate(page, `${this.customerConfig.scope}speed-kit-install.html?url=${this.customerConfig.scope}`);
|
|
59
98
|
await waitForAbort(shutdownSignal);
|
|
99
|
+
// Before the browser closes, so nothing can evaluate against a page that is
|
|
100
|
+
// on its way out.
|
|
101
|
+
this.browserSession?.detach();
|
|
60
102
|
await safe(browser.close());
|
|
61
103
|
// The fetch browser only exists if an origin refused a direct request, but closing an unused
|
|
62
104
|
// handle is free and leaving a Chrome behind is not.
|
|
63
105
|
if (this.browserFetch)
|
|
64
106
|
await safe(this.browserFetch.close());
|
|
65
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Open the control socket, if this run has a directory to put it in.
|
|
110
|
+
*
|
|
111
|
+
* Non-fatal: a run that cannot be controlled from outside is still a run, and
|
|
112
|
+
* failing the developer's session over it would be the wrong trade.
|
|
113
|
+
*/
|
|
114
|
+
async startControlServer(signal) {
|
|
115
|
+
if (!this.controlServer) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const result = await safe(this.controlServer.listen(signal));
|
|
119
|
+
if (result.success !== true) {
|
|
120
|
+
this.cli.writeWarning(`control socket unavailable, external tools cannot reach this run: ${result.error}`, false, { data: { error: result.error } });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
66
123
|
async prepareBrowser(localController) {
|
|
67
|
-
const browser = await launchBrowser(this.browserContext);
|
|
124
|
+
const browser = await launchBrowser(this.browserContext, this.cli);
|
|
68
125
|
for (const target of browser.targets()) {
|
|
69
126
|
if (target.type() === "browser") {
|
|
70
127
|
await this.fetchEventHandler.handleRequestFetchEvents(target);
|
|
71
128
|
}
|
|
72
129
|
}
|
|
73
130
|
browser.on(BROWSER_EVENTS.DISCONNECTED, () => {
|
|
74
|
-
this.cli.writeError("Browser disconnected, shutting down"
|
|
131
|
+
this.cli.writeError("Browser disconnected, shutting down", false, {
|
|
132
|
+
scope: "browser",
|
|
133
|
+
});
|
|
134
|
+
// Stamped here because this is the only place that knows *why* the run is
|
|
135
|
+
// ending. The command's exit handler cannot tell a closed window from a
|
|
136
|
+
// crash, and it can win the race to write first — recording it here means
|
|
137
|
+
// first-write-wins works for us rather than against us.
|
|
138
|
+
this.runHandle?.finish("stopped", "browser disconnected");
|
|
75
139
|
localController.abort();
|
|
76
140
|
});
|
|
77
141
|
return browser;
|
|
@@ -81,6 +145,7 @@ export class OnboardingService {
|
|
|
81
145
|
await safe(this.prepareCleanState(page));
|
|
82
146
|
this.registerFileWatcher(page, shutdownSignal);
|
|
83
147
|
this.registerReinstallSpeedKitOnNavigate(page);
|
|
148
|
+
recordConsole(page, this.cli);
|
|
84
149
|
return page;
|
|
85
150
|
}
|
|
86
151
|
/**
|
|
@@ -91,6 +156,32 @@ export class OnboardingService {
|
|
|
91
156
|
* sk-cli. Without a loaded devtools extension there is nothing to attach
|
|
92
157
|
* to — ExtensionValidator already reported why — so it is skipped.
|
|
93
158
|
*/
|
|
159
|
+
/**
|
|
160
|
+
* Say what an agent is doing, for the devtools extension to show.
|
|
161
|
+
*
|
|
162
|
+
* Reported, not drawn. The tab strip is browser UI with no CDP surface at
|
|
163
|
+
* all, so only an extension can colour it — and the one already loaded into
|
|
164
|
+
* the run owns that, keyed off this message. See `lib/agent-tab-state.ts` in
|
|
165
|
+
* team-pi/devtools.
|
|
166
|
+
*
|
|
167
|
+
* Upserted rather than appended: this is current state, not an event log, and
|
|
168
|
+
* a panel that had to dedupe a history to find the live value would be doing
|
|
169
|
+
* work this side can simply not create.
|
|
170
|
+
*/
|
|
171
|
+
async reportAgentActivity(label, breakpoints = [], releasedAt) {
|
|
172
|
+
this.developmentToolsMessages.upsertMessage({
|
|
173
|
+
id: "agent",
|
|
174
|
+
data: {
|
|
175
|
+
active: label !== null,
|
|
176
|
+
label,
|
|
177
|
+
breakpoints,
|
|
178
|
+
// The panel drops every breakpoint switch once per new value. See
|
|
179
|
+
// `mirrorArmedBreakpoints` in team-pi/devtools.
|
|
180
|
+
...(releasedAt ? { releasedAt } : {}),
|
|
181
|
+
...(label === null ? {} : { since: new Date().toISOString() }),
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
}
|
|
94
185
|
/**
|
|
95
186
|
* Open the run's DevTools on the Speed Kit panel rather than on Elements.
|
|
96
187
|
*
|
|
@@ -98,22 +189,16 @@ export class OnboardingService {
|
|
|
98
189
|
* tab, and where someone is looking at it. The selection reaches into
|
|
99
190
|
* DevTools' internals, so a failure is a warning and nothing more.
|
|
100
191
|
*/
|
|
101
|
-
async showDevtoolsPanelOnStart(
|
|
102
|
-
|
|
103
|
-
|
|
192
|
+
async showDevtoolsPanelOnStart() {
|
|
193
|
+
if (this.browserContext.headless ||
|
|
194
|
+
!this.browserSession ||
|
|
195
|
+
!this.extensionBridge.available) {
|
|
104
196
|
return;
|
|
105
197
|
}
|
|
106
|
-
const result = await safe(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (!(error instanceof PanelNotFoundError))
|
|
110
|
-
throw error;
|
|
111
|
-
throw new Error(`${error.message} — DevTools shows ${error.tabs.join(", ") || "no tabs at all"}`);
|
|
112
|
-
}));
|
|
113
|
-
if (result.success === true) {
|
|
114
|
-
return;
|
|
198
|
+
const result = await safe(this.browserSession.showPanel());
|
|
199
|
+
if (result.success !== true) {
|
|
200
|
+
this.cli.writeWarning(`DevTools did not open on the Speed Kit panel: ${result.error}`, false, { scope: "extension", data: { error: result.error } });
|
|
115
201
|
}
|
|
116
|
-
this.cli.writeWarning(`DevTools did not open on the Speed Kit panel: ${result.error}`);
|
|
117
202
|
}
|
|
118
203
|
async attachExtensionBridge(browser) {
|
|
119
204
|
if (!this.extensionBridge.isAvailable) {
|
|
@@ -121,7 +206,7 @@ export class OnboardingService {
|
|
|
121
206
|
}
|
|
122
207
|
const result = await safe(this.extensionBridge.init(browser));
|
|
123
208
|
if (result.success !== true) {
|
|
124
|
-
this.cli.writeWarning(`ExtensionBridge unavailable, devtools panel will not receive live updates: ${result.error}
|
|
209
|
+
this.cli.writeWarning(`ExtensionBridge unavailable, devtools panel will not receive live updates: ${result.error}`, false, { scope: "extension", data: { error: result.error } });
|
|
125
210
|
return;
|
|
126
211
|
}
|
|
127
212
|
this.developmentToolsMessages.setBridge(this.extensionBridge);
|
|
@@ -135,19 +220,32 @@ export class OnboardingService {
|
|
|
135
220
|
}
|
|
136
221
|
return browser.newPage();
|
|
137
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* What service workers this run has seen. Nothing else records it — CDP only
|
|
225
|
+
* streams the events, so a reader arriving later has missed them.
|
|
226
|
+
*/
|
|
227
|
+
serviceWorkers = new ServiceWorkerTracker();
|
|
138
228
|
async prepareCleanState(page) {
|
|
139
229
|
const cdpSession = await page.target().createCDPSession();
|
|
140
230
|
await resetBrowserState(cdpSession, this.browserContext.domain);
|
|
141
231
|
this.registerForeignSwGuard(page, cdpSession);
|
|
142
232
|
safe(() => {
|
|
143
233
|
cdpSession.on(CDP_SESSION.EVENTS.SERVICE_WORKER.REGISTRATION_UPDATED, ({ registrations, }) => {
|
|
234
|
+
this.serviceWorkers.recordRegistrations(registrations);
|
|
144
235
|
for (const registration of registrations) {
|
|
145
236
|
if (registration.isDeleted) {
|
|
146
237
|
this.developmentToolsMessages.addMessage({
|
|
147
238
|
id: "serviceWorker",
|
|
148
239
|
data: `Unregistered Service Worker at ${registration.scopeURL} id: ${registration.registrationId}`,
|
|
149
240
|
});
|
|
150
|
-
this.cli.writeWarning(`${this.cli.style.yellow("Unregistered Service Worker")} at ${this.cli.style.bold(registration.scopeURL)} (${registration.registrationId})
|
|
241
|
+
this.cli.writeWarning(`${this.cli.style.yellow("Unregistered Service Worker")} at ${this.cli.style.bold(registration.scopeURL)} (${registration.registrationId})`, false, {
|
|
242
|
+
scope: "sw",
|
|
243
|
+
data: {
|
|
244
|
+
scopeURL: registration.scopeURL,
|
|
245
|
+
registrationId: registration.registrationId,
|
|
246
|
+
unregistered: true,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
151
249
|
}
|
|
152
250
|
}
|
|
153
251
|
});
|
|
@@ -173,11 +271,26 @@ export class OnboardingService {
|
|
|
173
271
|
*/
|
|
174
272
|
registerForeignSwGuard(page, cdpSession) {
|
|
175
273
|
cdpSession.on(CDP_SESSION.EVENTS.SERVICE_WORKER.VERSION_UPDATED, async ({ versions, }) => {
|
|
274
|
+
this.serviceWorkers.recordVersions(versions);
|
|
176
275
|
for (const version of versions) {
|
|
177
276
|
if (!this.isForeignSwVersion(version)) {
|
|
178
277
|
continue;
|
|
179
278
|
}
|
|
180
|
-
|
|
279
|
+
// Recorded before the repair, so the takeover is visible even when
|
|
280
|
+
// the reinstall below is skipped by the cooldown.
|
|
281
|
+
this.serviceWorkers.recordTakeover(version.versionId);
|
|
282
|
+
// The field a reader counts on. A takeover is silent in the browser
|
|
283
|
+
// — with static routing the routes freeze at install time from the
|
|
284
|
+
// deployed config — so the only evidence it happened is this line,
|
|
285
|
+
// and `foreign` is what makes it findable without matching prose.
|
|
286
|
+
this.cli.writeWarning(`${this.cli.style.yellow("Deployed Service Worker took over")} (version ${version.versionId}) — an update check bypassed the local interception. Reinstalling the local build.`, false, {
|
|
287
|
+
scope: "sw",
|
|
288
|
+
data: {
|
|
289
|
+
versionId: version.versionId,
|
|
290
|
+
foreign: true,
|
|
291
|
+
takeover: true,
|
|
292
|
+
},
|
|
293
|
+
});
|
|
181
294
|
this.developmentToolsMessages.addMessage({
|
|
182
295
|
id: "serviceWorker",
|
|
183
296
|
data: `Deployed Service Worker took over (version ${version.versionId}); reinstalling the local build`,
|