@speedkit/cli 4.51.0-run-control.4 → 4.51.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 +30 -0
- package/README.md +14 -1426
- package/dist/commands/diff.d.ts +1 -7
- package/dist/commands/diff.js +3 -9
- package/dist/commands/login.d.ts +0 -3
- package/dist/commands/login.js +3 -14
- package/dist/commands/onboarding.d.ts +0 -26
- package/dist/commands/onboarding.js +4 -221
- package/dist/commands/origin-request.d.ts +0 -4
- package/dist/commands/origin-request.js +0 -4
- package/dist/services/browser-fetch/device-emulation.d.ts +0 -11
- package/dist/services/browser-fetch/device-emulation.js +0 -14
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -0
- package/dist/services/bundler/bundle-service-factory.js +5 -1
- package/dist/services/bundler/bundle-service.d.ts +10 -1
- package/dist/services/bundler/bundle-service.js +16 -1
- package/dist/services/bundler/error/packjockel-error.d.ts +3 -0
- package/dist/services/bundler/error/packjockel-error.js +3 -0
- package/dist/services/bundler/index.d.ts +1 -0
- package/dist/services/bundler/index.js +1 -0
- package/dist/services/bundler/packjockel-service.d.ts +112 -0
- package/dist/services/bundler/packjockel-service.js +202 -0
- package/dist/services/bundler/spec/packjockel-service.spec.js +186 -0
- package/dist/services/cli/cli-environment-factory.d.ts +0 -3
- package/dist/services/cli/cli-environment-factory.js +0 -1
- package/dist/services/cli/cli-service-build-context.d.ts +0 -3
- package/dist/services/cli/cli-service-factory.js +1 -1
- package/dist/services/cli/cli-service-model.d.ts +10 -29
- package/dist/services/cli/cli-service.d.ts +11 -60
- package/dist/services/cli/cli-service.js +32 -196
- package/dist/services/cli/index.d.ts +0 -2
- package/dist/services/cli/index.js +0 -2
- package/dist/services/cli/spec/cli-service.spec.js +50 -113
- package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +2 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +2 -3
- package/dist/services/deploy/handler/customer-config-handler.d.ts +9 -0
- package/dist/services/deploy/handler/customer-config-handler.js +41 -6
- package/dist/services/deploy/interface/install.d.ts +7 -1
- package/dist/services/deploy/mr/live-state-check.js +21 -2
- package/dist/services/deploy/policy/auto-deploy-policy.js +2 -0
- package/dist/services/deploy/policy/deploy-policy-model.d.ts +4 -0
- package/dist/services/deploy/policy/deploy-policy-model.js +4 -0
- package/dist/services/deploy/policy/testing-deploy-policy.js +2 -0
- package/dist/services/deploy/spec/handler/customer-config-handler.spec.js +98 -0
- package/dist/services/deploy/spec/mr/live-state-check.spec.js +45 -4
- package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +2 -0
- package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +3 -1
- package/dist/services/diff/diff-service-build-context.d.ts +0 -12
- package/dist/services/diff/diff-service-build-context.js +1 -45
- package/dist/services/diff/diff-service-factory.d.ts +0 -2
- package/dist/services/diff/diff-service-factory.js +25 -65
- package/dist/services/diff/diff-service.d.ts +0 -11
- package/dist/services/diff/diff-service.js +11 -37
- package/dist/services/diff/page-source.d.ts +0 -12
- package/dist/services/diff/page-source.js +11 -16
- package/dist/services/diff/sinks/tool-diff-sink.d.ts +2 -3
- package/dist/services/diff/sinks/tool-diff-sink.js +2 -3
- package/dist/services/diff/spec/diff-service-build-context.spec.js +0 -19
- package/dist/services/diff/spec/diff-service.spec.js +0 -95
- package/dist/services/document-handler-runtime/document-handler-browser-mock.d.ts +13 -0
- package/dist/services/document-handler-runtime/document-handler-browser-mock.js +69 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +27 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +112 -19
- package/dist/services/document-handler-runtime/spec/document-handler-browser-mock.spec.js +34 -0
- package/dist/services/git/git-repository.d.ts +0 -2
- package/dist/services/git/git-repository.js +0 -6
- package/dist/services/integration-api/customer-config-flags.js +0 -1
- package/dist/services/integration-api/integration-api-model.d.ts +4 -1
- package/dist/services/integration-api/spec/customer-config-file.spec.js +56 -0
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +68 -8
- package/dist/services/integration-api/struct/customer-config-file.d.ts +15 -0
- package/dist/services/integration-api/struct/customer-config-file.js +42 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +55 -1
- package/dist/services/integration-api/struct/customer-config.js +70 -3
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +11 -4
- package/dist/services/integration-api/struct/speed-kit-config-file.js +31 -10
- package/dist/services/onboarding/browse/browse-service.d.ts +1 -13
- package/dist/services/onboarding/browse/browse-service.js +7 -43
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -17
- package/dist/services/onboarding/browser/baqend-response.js +0 -23
- package/dist/services/onboarding/browser/emulate-device.d.ts +1 -12
- package/dist/services/onboarding/browser/emulate-device.js +13 -68
- package/dist/services/onboarding/browser/executable/executable-validator.js +2 -4
- package/dist/services/onboarding/browser/extension/extension-bridge.js +3 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -17
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -9
- package/dist/services/onboarding/browser/launch-browser.d.ts +1 -2
- package/dist/services/onboarding/browser/launch-browser.js +1 -6
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +2 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +29 -8
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -3
- package/dist/services/onboarding/dashboard/index.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +5 -24
- package/dist/services/onboarding/fetch-event-handler.js +32 -103
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +2 -11
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +0 -14
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +0 -30
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -14
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +10 -29
- package/dist/services/onboarding/file-events/file-watcher.d.ts +4 -43
- package/dist/services/onboarding/file-events/file-watcher.js +21 -119
- package/dist/services/onboarding/inject/inject-service.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +7 -40
- package/dist/services/onboarding/onboarding-model.js +9 -20
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +0 -4
- package/dist/services/onboarding/onboarding-service-build-context.js +1 -7
- package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -17
- package/dist/services/onboarding/onboarding-service-factory.js +35 -152
- package/dist/services/onboarding/onboarding-service.d.ts +1 -40
- package/dist/services/onboarding/onboarding-service.js +23 -139
- package/dist/services/onboarding/request-cache/cache.d.ts +5 -62
- package/dist/services/onboarding/request-cache/cache.js +17 -128
- package/dist/services/onboarding/spec/file-events/file-watcher.spec.js +67 -0
- package/dist/services/onboarding/spec/onboarding-model.spec.js +3 -39
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +1 -25
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +5 -0
- package/dist/services/onboarding/todo-collector.d.ts +2 -7
- package/dist/services/onboarding/todo-collector.js +12 -49
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +0 -38
- package/dist/services/onboarding/virtual-orestes-app/index.js +27 -113
- package/dist/services/origin-request/asset-variations.d.ts +0 -14
- package/dist/services/origin-request/asset-variations.js +4 -11
- package/dist/services/origin-request/origin-fetcher.d.ts +0 -7
- package/dist/services/origin-request/origin-fetcher.js +5 -43
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +0 -17
- package/dist/services/origin-request/origin-request-service-build-context.js +0 -8
- package/dist/services/origin-request/origin-request-service-factory.d.ts +5 -0
- package/dist/services/origin-request/origin-request-service-factory.js +30 -2
- package/dist/services/origin-request/origin-request-service.d.ts +6 -121
- package/dist/services/origin-request/origin-request-service.js +49 -273
- package/dist/services/origin-request/runtime-config-source.d.ts +0 -6
- package/dist/services/origin-request/runtime-config-source.js +4 -15
- package/dist/services/origin-request/spec/asset-variations.spec.js +0 -20
- package/dist/services/origin-request/spec/origin-request-service.spec.js +6 -329
- package/dist/services/pull/pull-service.js +23 -5
- package/dist/services/query-builder/query-builder-factory.js +3 -3
- package/dist/services/setup/os/tool-registry.js +2 -2
- package/oclif.manifest.json +288 -3409
- package/package.json +3 -20
- package/dist/base/run-control-command.d.ts +0 -15
- package/dist/base/run-control-command.js +0 -20
- package/dist/build-info.json +0 -6
- package/dist/commands/onboarding/browser/click.d.ts +0 -75
- package/dist/commands/onboarding/browser/click.js +0 -19
- package/dist/commands/onboarding/browser/emulate.d.ts +0 -105
- package/dist/commands/onboarding/browser/emulate.js +0 -26
- package/dist/commands/onboarding/browser/navigate.d.ts +0 -75
- package/dist/commands/onboarding/browser/navigate.js +0 -19
- package/dist/commands/onboarding/browser/panel.d.ts +0 -63
- package/dist/commands/onboarding/browser/panel.js +0 -12
- package/dist/commands/onboarding/browser/reinstall-sw.d.ts +0 -63
- package/dist/commands/onboarding/browser/reinstall-sw.js +0 -14
- package/dist/commands/onboarding/browser/reset.d.ts +0 -71
- package/dist/commands/onboarding/browser/reset.js +0 -18
- package/dist/commands/onboarding/browser/screenshot.d.ts +0 -77
- package/dist/commands/onboarding/browser/screenshot.js +0 -19
- package/dist/commands/onboarding/browser/state.d.ts +0 -63
- package/dist/commands/onboarding/browser/state.js +0 -12
- package/dist/commands/onboarding/browser/tabs.d.ts +0 -58
- package/dist/commands/onboarding/browser/tabs.js +0 -16
- package/dist/commands/onboarding/cache/clear.d.ts +0 -58
- package/dist/commands/onboarding/cache/clear.js +0 -12
- package/dist/commands/onboarding/cache/errors.d.ts +0 -58
- package/dist/commands/onboarding/cache/errors.js +0 -12
- package/dist/commands/onboarding/cache/evict.d.ts +0 -62
- package/dist/commands/onboarding/cache/evict.js +0 -15
- package/dist/commands/onboarding/cache/get.d.ts +0 -85
- package/dist/commands/onboarding/cache/get.js +0 -17
- package/dist/commands/onboarding/cache/list.d.ts +0 -58
- package/dist/commands/onboarding/cache/list.js +0 -15
- package/dist/commands/onboarding/cache/prewarm.d.ts +0 -73
- package/dist/commands/onboarding/cache/prewarm.js +0 -20
- package/dist/commands/onboarding/cache/refresh.d.ts +0 -62
- package/dist/commands/onboarding/cache/refresh.js +0 -18
- package/dist/commands/onboarding/cdp.d.ts +0 -81
- package/dist/commands/onboarding/cdp.js +0 -18
- package/dist/commands/onboarding/debug/arm.d.ts +0 -83
- package/dist/commands/onboarding/debug/arm.js +0 -19
- package/dist/commands/onboarding/debug/await.d.ts +0 -71
- package/dist/commands/onboarding/debug/await.js +0 -18
- package/dist/commands/onboarding/debug/disarm.d.ts +0 -63
- package/dist/commands/onboarding/debug/disarm.js +0 -12
- package/dist/commands/onboarding/debug/eval.d.ts +0 -75
- package/dist/commands/onboarding/debug/eval.js +0 -16
- package/dist/commands/onboarding/debug/release.d.ts +0 -63
- package/dist/commands/onboarding/debug/release.js +0 -12
- package/dist/commands/onboarding/debug/resume.d.ts +0 -63
- package/dist/commands/onboarding/debug/resume.js +0 -12
- package/dist/commands/onboarding/debug/status.d.ts +0 -63
- package/dist/commands/onboarding/debug/status.js +0 -12
- package/dist/commands/onboarding/debug/step.d.ts +0 -67
- package/dist/commands/onboarding/debug/step.js +0 -15
- package/dist/commands/onboarding/files/list.d.ts +0 -58
- package/dist/commands/onboarding/files/list.js +0 -12
- package/dist/commands/onboarding/files/read.d.ts +0 -73
- package/dist/commands/onboarding/files/read.js +0 -16
- package/dist/commands/onboarding/files/rebuild.d.ts +0 -63
- package/dist/commands/onboarding/files/rebuild.js +0 -18
- package/dist/commands/onboarding/files/validate.d.ts +0 -58
- package/dist/commands/onboarding/files/validate.js +0 -12
- package/dist/commands/onboarding/fouc.d.ts +0 -77
- package/dist/commands/onboarding/fouc.js +0 -16
- package/dist/commands/onboarding/inject/add.d.ts +0 -89
- package/dist/commands/onboarding/inject/add.js +0 -17
- package/dist/commands/onboarding/inject/clear.d.ts +0 -63
- package/dist/commands/onboarding/inject/clear.js +0 -12
- package/dist/commands/onboarding/inject/list.d.ts +0 -63
- package/dist/commands/onboarding/inject/list.js +0 -12
- package/dist/commands/onboarding/inject/read.d.ts +0 -75
- package/dist/commands/onboarding/inject/read.js +0 -18
- package/dist/commands/onboarding/inject/recipes.d.ts +0 -63
- package/dist/commands/onboarding/inject/recipes.js +0 -12
- package/dist/commands/onboarding/inject/remove.d.ts +0 -67
- package/dist/commands/onboarding/inject/remove.js +0 -15
- package/dist/commands/onboarding/list.d.ts +0 -13
- package/dist/commands/onboarding/list.js +0 -12
- package/dist/commands/onboarding/logs.d.ts +0 -41
- package/dist/commands/onboarding/logs.js +0 -257
- package/dist/commands/onboarding/navwalk.d.ts +0 -95
- package/dist/commands/onboarding/navwalk.js +0 -19
- package/dist/commands/onboarding/response.d.ts +0 -67
- package/dist/commands/onboarding/response.js +0 -18
- package/dist/commands/onboarding/rum/beacons.d.ts +0 -75
- package/dist/commands/onboarding/rum/beacons.js +0 -16
- package/dist/commands/onboarding/rum/get.d.ts +0 -77
- package/dist/commands/onboarding/rum/get.js +0 -18
- package/dist/commands/onboarding/rum/key.d.ts +0 -67
- package/dist/commands/onboarding/rum/key.js +0 -13
- package/dist/commands/onboarding/rum/previous.d.ts +0 -63
- package/dist/commands/onboarding/rum/previous.js +0 -12
- package/dist/commands/onboarding/status.d.ts +0 -13
- package/dist/commands/onboarding/status.js +0 -17
- package/dist/commands/onboarding/stop.d.ts +0 -13
- package/dist/commands/onboarding/stop.js +0 -17
- package/dist/commands/onboarding/todo.d.ts +0 -58
- package/dist/commands/onboarding/todo.js +0 -12
- package/dist/commands/onboarding/viewport.d.ts +0 -101
- package/dist/commands/onboarding/viewport.js +0 -18
- package/dist/commands/onboarding/watch.d.ts +0 -93
- package/dist/commands/onboarding/watch.js +0 -16
- package/dist/commands/spec/onboarding.spec.js +0 -127
- package/dist/services/cli/build-info.d.ts +0 -33
- package/dist/services/cli/build-info.js +0 -63
- package/dist/services/cli/sink.d.ts +0 -47
- package/dist/services/cli/sink.js +0 -31
- package/dist/services/cli/spec/build-identity.spec.js +0 -85
- package/dist/services/cli/spec/build-info.spec.js +0 -10
- package/dist/services/cli/spec/cli-service-log.spec.js +0 -133
- package/dist/services/cli/spec/memory-cli.d.ts +0 -9
- package/dist/services/cli/spec/memory-cli.js +0 -9
- package/dist/services/diff/config-at-ref.d.ts +0 -20
- package/dist/services/diff/config-at-ref.js +0 -33
- package/dist/services/diff/run-runtime-config.d.ts +0 -33
- package/dist/services/diff/run-runtime-config.js +0 -74
- package/dist/services/diff/spec/config-at-ref.spec.js +0 -46
- package/dist/services/diff/spec/run-runtime-config.spec.d.ts +0 -1
- package/dist/services/diff/spec/run-runtime-config.spec.js +0 -87
- package/dist/services/onboarding/browser/answer-dialogs.d.ts +0 -12
- package/dist/services/onboarding/browser/answer-dialogs.js +0 -25
- package/dist/services/onboarding/browser/console-log.d.ts +0 -9
- package/dist/services/onboarding/browser/console-log.js +0 -27
- package/dist/services/onboarding/browser/resume-restarted-workers.d.ts +0 -14
- package/dist/services/onboarding/browser/resume-restarted-workers.js +0 -26
- package/dist/services/onboarding/control/body-inspect.d.ts +0 -24
- package/dist/services/onboarding/control/body-inspect.js +0 -106
- package/dist/services/onboarding/control/browser-session.d.ts +0 -547
- package/dist/services/onboarding/control/browser-session.js +0 -1337
- package/dist/services/onboarding/control/config-validation.d.ts +0 -17
- package/dist/services/onboarding/control/config-validation.js +0 -46
- package/dist/services/onboarding/control/control-protocol.d.ts +0 -1430
- package/dist/services/onboarding/control/control-protocol.js +0 -58
- package/dist/services/onboarding/control/control-server.d.ts +0 -292
- package/dist/services/onboarding/control/control-server.js +0 -1629
- package/dist/services/onboarding/control/debug-session.d.ts +0 -219
- package/dist/services/onboarding/control/debug-session.js +0 -897
- package/dist/services/onboarding/control/fouc.d.ts +0 -23
- package/dist/services/onboarding/control/fouc.js +0 -151
- package/dist/services/onboarding/control/index.d.ts +0 -4
- package/dist/services/onboarding/control/index.js +0 -4
- package/dist/services/onboarding/control/navigate-wait.d.ts +0 -33
- package/dist/services/onboarding/control/navigate-wait.js +0 -56
- package/dist/services/onboarding/control/navwalk.d.ts +0 -65
- package/dist/services/onboarding/control/navwalk.js +0 -248
- package/dist/services/onboarding/control/preload-registry.d.ts +0 -150
- package/dist/services/onboarding/control/preload-registry.js +0 -829
- package/dist/services/onboarding/control/response-explainer.d.ts +0 -24
- package/dist/services/onboarding/control/response-explainer.js +0 -257
- package/dist/services/onboarding/control/rum.d.ts +0 -8
- package/dist/services/onboarding/control/rum.js +0 -220
- package/dist/services/onboarding/control/service-worker-tracker.d.ts +0 -68
- package/dist/services/onboarding/control/service-worker-tracker.js +0 -120
- package/dist/services/onboarding/control/viewport.d.ts +0 -45
- package/dist/services/onboarding/control/viewport.js +0 -344
- package/dist/services/onboarding/control/watch.d.ts +0 -26
- package/dist/services/onboarding/control/watch.js +0 -157
- package/dist/services/onboarding/request-cache/asset-key.d.ts +0 -61
- package/dist/services/onboarding/request-cache/asset-key.js +0 -115
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.js +0 -66
- package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/console-log.spec.js +0 -42
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.js +0 -45
- package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/browser-session.spec.js +0 -753
- package/dist/services/onboarding/spec/control/control-server.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/control-server.spec.js +0 -371
- package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/debug-session.spec.js +0 -751
- package/dist/services/onboarding/spec/control/fakes.d.ts +0 -31
- package/dist/services/onboarding/spec/control/fakes.js +0 -67
- package/dist/services/onboarding/spec/control/fouc.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/fouc.spec.js +0 -167
- package/dist/services/onboarding/spec/control/navigate-wait.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navigate-wait.spec.js +0 -47
- package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navwalk.spec.js +0 -222
- package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/preload-registry.spec.js +0 -432
- package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/response-explainer.spec.js +0 -324
- package/dist/services/onboarding/spec/control/rum.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/rum.spec.js +0 -222
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +0 -193
- package/dist/services/onboarding/spec/control/viewport.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/viewport.spec.js +0 -200
- package/dist/services/onboarding/spec/control/watch.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/watch.spec.js +0 -187
- package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-event-handler.spec.js +0 -219
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +0 -41
- package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/request-cache/cache.spec.js +0 -107
- package/dist/services/onboarding/spec/todo-collector.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/todo-collector.spec.js +0 -136
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.js +0 -65
- package/dist/services/query-builder/rules/rule-match.d.ts +0 -35
- package/dist/services/query-builder/rules/rule-match.js +0 -70
- package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +0 -1
- package/dist/services/query-builder/spec/rules/rule-match.spec.js +0 -121
- package/dist/services/run-control/browser/run-browser-contexts.d.ts +0 -557
- package/dist/services/run-control/browser/run-browser-contexts.js +0 -91
- package/dist/services/run-control/browser/run-browser-service-factory.d.ts +0 -5
- package/dist/services/run-control/browser/run-browser-service-factory.js +0 -7
- package/dist/services/run-control/browser/run-browser-service.d.ts +0 -68
- package/dist/services/run-control/browser/run-browser-service.js +0 -206
- package/dist/services/run-control/cache/run-cache-contexts.d.ts +0 -349
- package/dist/services/run-control/cache/run-cache-contexts.js +0 -51
- package/dist/services/run-control/cache/run-cache-service-factory.d.ts +0 -6
- package/dist/services/run-control/cache/run-cache-service-factory.js +0 -12
- package/dist/services/run-control/cache/run-cache-service.d.ts +0 -35
- package/dist/services/run-control/cache/run-cache-service.js +0 -151
- package/dist/services/run-control/control-client.d.ts +0 -36
- package/dist/services/run-control/control-client.js +0 -147
- package/dist/services/run-control/debug/run-debug-contexts.d.ts +0 -416
- package/dist/services/run-control/debug/run-debug-contexts.js +0 -47
- package/dist/services/run-control/debug/run-debug-service-factory.d.ts +0 -5
- package/dist/services/run-control/debug/run-debug-service-factory.js +0 -7
- package/dist/services/run-control/debug/run-debug-service.d.ts +0 -39
- package/dist/services/run-control/debug/run-debug-service.js +0 -164
- package/dist/services/run-control/files/run-files-contexts.d.ts +0 -238
- package/dist/services/run-control/files/run-files-contexts.js +0 -26
- package/dist/services/run-control/files/run-files-service-factory.d.ts +0 -5
- package/dist/services/run-control/files/run-files-service-factory.js +0 -7
- package/dist/services/run-control/files/run-files-service.d.ts +0 -29
- package/dist/services/run-control/files/run-files-service.js +0 -120
- package/dist/services/run-control/index.d.ts +0 -32
- package/dist/services/run-control/index.js +0 -31
- package/dist/services/run-control/inject/run-inject-contexts.d.ts +0 -319
- package/dist/services/run-control/inject/run-inject-contexts.js +0 -38
- package/dist/services/run-control/inject/run-inject-service-factory.d.ts +0 -5
- package/dist/services/run-control/inject/run-inject-service-factory.js +0 -7
- package/dist/services/run-control/inject/run-inject-service.d.ts +0 -31
- package/dist/services/run-control/inject/run-inject-service.js +0 -227
- package/dist/services/run-control/live-run.d.ts +0 -37
- package/dist/services/run-control/live-run.js +0 -56
- package/dist/services/run-control/probe/run-probe-contexts.d.ts +0 -333
- package/dist/services/run-control/probe/run-probe-contexts.js +0 -73
- package/dist/services/run-control/probe/run-probe-service-factory.d.ts +0 -5
- package/dist/services/run-control/probe/run-probe-service-factory.js +0 -7
- package/dist/services/run-control/probe/run-probe-service.d.ts +0 -54
- package/dist/services/run-control/probe/run-probe-service.js +0 -194
- package/dist/services/run-control/rum/run-rum-contexts.d.ts +0 -216
- package/dist/services/run-control/rum/run-rum-contexts.js +0 -34
- package/dist/services/run-control/rum/run-rum-service-factory.d.ts +0 -5
- package/dist/services/run-control/rum/run-rum-service-factory.js +0 -7
- package/dist/services/run-control/rum/run-rum-service.d.ts +0 -36
- package/dist/services/run-control/rum/run-rum-service.js +0 -122
- package/dist/services/run-control/run-answer.d.ts +0 -28
- package/dist/services/run-control/run-answer.js +0 -58
- package/dist/services/run-control/run-control-context.d.ts +0 -102
- package/dist/services/run-control/run-control-context.js +0 -36
- package/dist/services/run-control/run-control-flags.d.ts +0 -12
- package/dist/services/run-control/run-control-flags.js +0 -22
- package/dist/services/run-control/run-control-model.d.ts +0 -9
- package/dist/services/run-control/run-control-model.js +0 -1
- package/dist/services/run-control/run-control-service-factory.d.ts +0 -14
- package/dist/services/run-control/run-control-service-factory.js +0 -26
- package/dist/services/run-control/session/run-session-contexts.d.ts +0 -25
- package/dist/services/run-control/session/run-session-contexts.js +0 -20
- package/dist/services/run-control/session/run-session-service-factory.d.ts +0 -8
- package/dist/services/run-control/session/run-session-service-factory.js +0 -18
- package/dist/services/run-control/session/run-session-service.d.ts +0 -32
- package/dist/services/run-control/session/run-session-service.js +0 -151
- package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/browser/run-browser-service.spec.js +0 -328
- package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/cache/run-cache-service.spec.js +0 -454
- package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/debug/run-debug-service.spec.js +0 -113
- package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/files/run-files-service.spec.js +0 -234
- package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/inject/run-inject-service.spec.js +0 -251
- package/dist/services/run-control/spec/live-run-fixture.d.ts +0 -32
- package/dist/services/run-control/spec/live-run-fixture.js +0 -109
- package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/probe/run-probe-service.spec.js +0 -108
- package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/rum/run-rum-service.spec.js +0 -47
- package/dist/services/run-control/spec/run-answer.spec.d.ts +0 -1
- package/dist/services/run-control/spec/run-answer.spec.js +0 -57
- package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/session/run-session-service.spec.js +0 -150
- package/dist/services/run-log/crash-mirror.d.ts +0 -31
- package/dist/services/run-log/crash-mirror.js +0 -69
- package/dist/services/run-log/index.d.ts +0 -11
- package/dist/services/run-log/index.js +0 -11
- package/dist/services/run-log/jsonl-appender.d.ts +0 -46
- package/dist/services/run-log/jsonl-appender.js +0 -91
- package/dist/services/run-log/log-event-model.d.ts +0 -104
- package/dist/services/run-log/log-event-model.js +0 -56
- package/dist/services/run-log/log-query-service-factory.d.ts +0 -11
- package/dist/services/run-log/log-query-service-factory.js +0 -14
- package/dist/services/run-log/log-query-service.d.ts +0 -59
- package/dist/services/run-log/log-query-service.js +0 -111
- package/dist/services/run-log/log-reader.d.ts +0 -84
- package/dist/services/run-log/log-reader.js +0 -180
- package/dist/services/run-log/log-summary.d.ts +0 -72
- package/dist/services/run-log/log-summary.js +0 -208
- package/dist/services/run-log/redaction.d.ts +0 -34
- package/dist/services/run-log/redaction.js +0 -124
- package/dist/services/run-log/request-log.d.ts +0 -82
- package/dist/services/run-log/request-log.js +0 -69
- package/dist/services/run-log/request-summary.d.ts +0 -76
- package/dist/services/run-log/request-summary.js +0 -0
- package/dist/services/run-log/run-log.d.ts +0 -61
- package/dist/services/run-log/run-log.js +0 -102
- package/dist/services/run-log/spec/log-query-service.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-query-service.spec.js +0 -197
- package/dist/services/run-log/spec/log-reader.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-reader.spec.js +0 -109
- package/dist/services/run-log/spec/log-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-summary.spec.js +0 -153
- package/dist/services/run-log/spec/redaction.spec.d.ts +0 -1
- package/dist/services/run-log/spec/redaction.spec.js +0 -61
- package/dist/services/run-log/spec/request-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-log.spec.js +0 -101
- package/dist/services/run-log/spec/request-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-summary.spec.js +0 -171
- package/dist/services/run-log/spec/run-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/run-log.spec.js +0 -122
- package/dist/services/run-registry/exit-classification.d.ts +0 -39
- package/dist/services/run-registry/exit-classification.js +0 -42
- package/dist/services/run-registry/index.d.ts +0 -3
- package/dist/services/run-registry/index.js +0 -3
- package/dist/services/run-registry/process-identity.d.ts +0 -28
- package/dist/services/run-registry/process-identity.js +0 -80
- package/dist/services/run-registry/run-registry-model.d.ts +0 -128
- package/dist/services/run-registry/run-registry-model.js +0 -16
- package/dist/services/run-registry/run-registry.d.ts +0 -155
- package/dist/services/run-registry/run-registry.js +0 -430
- package/dist/services/run-registry/spec/exit-classification.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/exit-classification.spec.js +0 -82
- package/dist/services/run-registry/spec/run-registry.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/run-registry.spec.js +0 -526
- /package/dist/{commands/spec/onboarding.spec.d.ts → services/bundler/spec/packjockel-service.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-identity.spec.d.ts → deploy/spec/handler/customer-config-handler.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-info.spec.d.ts → document-handler-runtime/spec/document-handler-browser-mock.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/cli-service-log.spec.d.ts → integration-api/spec/customer-config-file.spec.d.ts} +0 -0
- /package/dist/services/{diff/spec/config-at-ref.spec.d.ts → onboarding/spec/file-events/file-watcher.spec.d.ts} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ParsedRuleSets } from "../../query-builder/rules/rule-model.js";
|
|
2
|
-
import { ResponseExplainData, ResponseCacheFacts, ResponsePageFacts } from "./control-protocol.js";
|
|
3
|
-
export interface ExplainInput {
|
|
4
|
-
url: URL;
|
|
5
|
-
rules: ParsedRuleSets;
|
|
6
|
-
cache?: ResponseCacheFacts;
|
|
7
|
-
page?: ResponsePageFacts;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Why did this URL come back the way it did.
|
|
11
|
-
*
|
|
12
|
-
* The question a config raises is never "what is in the cache", it is "why was
|
|
13
|
-
* this page not accelerated" — and the answer is scattered across the rule
|
|
14
|
-
* sets, the cache, and what Speed Kit reported on the page. Each of those is
|
|
15
|
-
* reachable on its own already; none of them answers the question alone, and
|
|
16
|
-
* putting them side by side is most of the work.
|
|
17
|
-
*
|
|
18
|
-
* Nothing here guesses. Where a rule carries a criterion outside the URL, or
|
|
19
|
-
* where the page was not observed, the result says so rather than filling the
|
|
20
|
-
* gap.
|
|
21
|
-
*/
|
|
22
|
-
export declare function explainResponse(input: ExplainInput): ResponseExplainData;
|
|
23
|
-
/** Whether a cached body carries the documentHandler's asset list. */
|
|
24
|
-
export declare function hasAssetList(body: string): boolean;
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import { matchRules } from "../../query-builder/rules/rule-match.js";
|
|
2
|
-
import { DOCUMENT_CONTENT_TYPES, } from "../../query-builder/rules/rule-model.js";
|
|
3
|
-
/**
|
|
4
|
-
* The marker the documentHandler bakes into the HTML it transforms.
|
|
5
|
-
*
|
|
6
|
-
* Change detection compares the *cached* asset list against the live one, and
|
|
7
|
-
* the cached side is not read from the DOM — it comes from this call. If the
|
|
8
|
-
* DH never ran, the call is absent and the comparison returns early with
|
|
9
|
-
* nothing, which reads exactly like "no changes" and is not the same thing.
|
|
10
|
-
*/
|
|
11
|
-
const ASSET_LIST_MARKER = "setAssetList(";
|
|
12
|
-
/**
|
|
13
|
-
* Why did this URL come back the way it did.
|
|
14
|
-
*
|
|
15
|
-
* The question a config raises is never "what is in the cache", it is "why was
|
|
16
|
-
* this page not accelerated" — and the answer is scattered across the rule
|
|
17
|
-
* sets, the cache, and what Speed Kit reported on the page. Each of those is
|
|
18
|
-
* reachable on its own already; none of them answers the question alone, and
|
|
19
|
-
* putting them side by side is most of the work.
|
|
20
|
-
*
|
|
21
|
-
* Nothing here guesses. Where a rule carries a criterion outside the URL, or
|
|
22
|
-
* where the page was not observed, the result says so rather than filling the
|
|
23
|
-
* gap.
|
|
24
|
-
*/
|
|
25
|
-
export function explainResponse(input) {
|
|
26
|
-
const rules = judgeRules(input.url, input.rules);
|
|
27
|
-
// Resolved once and handed to both. The explanation and the notes used to
|
|
28
|
-
// re-derive it from `responseSource` themselves, so a page whose source was
|
|
29
|
-
// not the literal string `Origin` took the cache branch in three places
|
|
30
|
-
// independently — and a bfcached origin page took it in all three.
|
|
31
|
-
const served = servedFrom(input);
|
|
32
|
-
const notes = collectNotes(input, rules, served);
|
|
33
|
-
return {
|
|
34
|
-
url: input.url.href,
|
|
35
|
-
servedFrom: served,
|
|
36
|
-
replayedFromBfCache: replayedFromBfCache(input),
|
|
37
|
-
rules,
|
|
38
|
-
cache: input.cache,
|
|
39
|
-
page: input.page,
|
|
40
|
-
explanation: explain(input, rules, served),
|
|
41
|
-
notes,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Rules that can apply to a navigation.
|
|
46
|
-
*
|
|
47
|
-
* A rule restricted to `script`, `style` or `font` never decides a document
|
|
48
|
-
* request, and the runtime passes `contentType` into every `RuleSet.matches`
|
|
49
|
-
* call. Reading the sets without it reports a font rule as matching a page —
|
|
50
|
-
* and, the way round that actually bit, a `contentType: ["navigate"]`
|
|
51
|
-
* whitelist entry as matching a script. Mirrors the same test in
|
|
52
|
-
* `keepRelevantRules`.
|
|
53
|
-
*/
|
|
54
|
-
function forNavigation(rules) {
|
|
55
|
-
return rules.filter((rule) => !rule.contentTypes ||
|
|
56
|
-
rule.contentTypes.some((type) => DOCUMENT_CONTENT_TYPES.includes(type)));
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Which rule set decided, in the order Speed Kit applies them.
|
|
60
|
-
*
|
|
61
|
-
* `disabledScopes` first because it is not a rule set at all — it is a list of
|
|
62
|
-
* path prefixes the service worker never claims, so nothing downstream of it
|
|
63
|
-
* runs. Then the page sets, then the resource sets.
|
|
64
|
-
*
|
|
65
|
-
* **This judges the url as a navigation**, which is what `appliesAs` reports.
|
|
66
|
-
* The runtime splits on it: `Application.checkWhitelist` returns before
|
|
67
|
-
* `enabledSites` for anything that is not a navigate request, and
|
|
68
|
-
* `disabledSites` is gated the same way, so both sets decide pages only. A
|
|
69
|
-
* reading that applied them to every url answered "excluded by enabledSites"
|
|
70
|
-
* for a script the runtime excludes by `whitelist` — or, where the whitelist
|
|
71
|
-
* carries no content type, for one it accelerates.
|
|
72
|
-
*/
|
|
73
|
-
function judgeRules(url, sets) {
|
|
74
|
-
const disabledScopes = matchRules(sets.disabledScopes, url);
|
|
75
|
-
const enabledSites = matchRules(forNavigation(sets.enabledSites), url);
|
|
76
|
-
const disabledSites = matchRules(forNavigation(sets.disabledSites), url);
|
|
77
|
-
const whitelist = matchRules(forNavigation(sets.whitelist), url);
|
|
78
|
-
const blacklist = matchRules(forNavigation(sets.blacklist), url);
|
|
79
|
-
const verdict = {
|
|
80
|
-
disabledScopes: sources(disabledScopes),
|
|
81
|
-
enabledSites: sources(enabledSites),
|
|
82
|
-
disabledSites: sources(disabledSites),
|
|
83
|
-
whitelist: sources(whitelist),
|
|
84
|
-
blacklist: sources(blacklist),
|
|
85
|
-
// A set that is empty in the config means "no restriction", which is a
|
|
86
|
-
// different thing from "restricts nothing here" and changes how every
|
|
87
|
-
// other line reads.
|
|
88
|
-
enabledSitesConfigured: sets.enabledSites.length > 0,
|
|
89
|
-
whitelistConfigured: sets.whitelist.length > 0,
|
|
90
|
-
uncertain: [
|
|
91
|
-
...disabledScopes,
|
|
92
|
-
...enabledSites,
|
|
93
|
-
...disabledSites,
|
|
94
|
-
...whitelist,
|
|
95
|
-
...blacklist,
|
|
96
|
-
]
|
|
97
|
-
.filter((hit) => hit.uncertain)
|
|
98
|
-
.map((hit) => hit.source),
|
|
99
|
-
appliesAs: "navigate",
|
|
100
|
-
navigationOnlySets: ["enabledSites", "disabledSites"],
|
|
101
|
-
};
|
|
102
|
-
if (disabledScopes.length > 0) {
|
|
103
|
-
return { ...verdict, decision: "excluded", decidedBy: "disabledScopes" };
|
|
104
|
-
}
|
|
105
|
-
if (sets.enabledSites.length > 0 && enabledSites.length === 0) {
|
|
106
|
-
return { ...verdict, decision: "excluded", decidedBy: "enabledSites" };
|
|
107
|
-
}
|
|
108
|
-
if (disabledSites.length > 0) {
|
|
109
|
-
return { ...verdict, decision: "excluded", decidedBy: "disabledSites" };
|
|
110
|
-
}
|
|
111
|
-
if (blacklist.length > 0) {
|
|
112
|
-
return { ...verdict, decision: "excluded", decidedBy: "blacklist" };
|
|
113
|
-
}
|
|
114
|
-
if (sets.whitelist.length > 0 && whitelist.length === 0) {
|
|
115
|
-
return { ...verdict, decision: "excluded", decidedBy: "whitelist" };
|
|
116
|
-
}
|
|
117
|
-
return { ...verdict, decision: "included", decidedBy: null };
|
|
118
|
-
}
|
|
119
|
-
function sources(hits) {
|
|
120
|
-
return hits.map((hit) => hit.source);
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* The response sources that mean Speed Kit served the bytes.
|
|
124
|
-
*
|
|
125
|
-
* Enumerated rather than derived by exclusion, because the two are not the same
|
|
126
|
-
* thing and the difference is the whole of this function's history. Speed Kit
|
|
127
|
-
* ships fifteen `ResponseSource` values and `fromAssetAPI()` is the authority
|
|
128
|
-
* for nine of them; `SwCache`, `SDN` and `Recompress` are the three more that
|
|
129
|
-
* still came from Speed Kit. `Generated`, `Origin` and `BfCache` did not, and
|
|
130
|
-
* each of those is handled on its own below.
|
|
131
|
-
*/
|
|
132
|
-
const SPEED_KIT_SOURCES = new Set([
|
|
133
|
-
// fromAssetAPI(), in the order speed-kit lists it.
|
|
134
|
-
"Edge",
|
|
135
|
-
"AssetAPI",
|
|
136
|
-
"Stream",
|
|
137
|
-
"Collapsed",
|
|
138
|
-
"Shield",
|
|
139
|
-
"Storage",
|
|
140
|
-
"PendingAsset",
|
|
141
|
-
"MissingCachingHeader",
|
|
142
|
-
"Prerender",
|
|
143
|
-
// Speed Kit's own, outside the asset API.
|
|
144
|
-
"SwCache",
|
|
145
|
-
"SDN",
|
|
146
|
-
"Recompress",
|
|
147
|
-
]);
|
|
148
|
-
/**
|
|
149
|
-
* What actually served it, as opposed to what the rules permit.
|
|
150
|
-
*
|
|
151
|
-
* `unknown` is a real answer here and the common one: the tool is usually asked
|
|
152
|
-
* about a URL that is not the page in front of it, and a cache entry proves the
|
|
153
|
-
* documentHandler handled it once, not that this response came from there.
|
|
154
|
-
*
|
|
155
|
-
* It is also the answer for a source this does not recognise. That is the
|
|
156
|
-
* correction: this used to read `responseSource === "Origin" ? "origin" :
|
|
157
|
-
* "cache"`, which made `cache` the default for fourteen of the fifteen sources
|
|
158
|
-
* and for anything Speed Kit adds later. An unrecognised source is something we
|
|
159
|
-
* do not know about, and saying so costs a reader one lookup — saying `cache`
|
|
160
|
-
* costs them the whole origin half of the explanation.
|
|
161
|
-
*/
|
|
162
|
-
function servedFrom(input) {
|
|
163
|
-
const source = input.page?.responseSource;
|
|
164
|
-
if (!source) {
|
|
165
|
-
return "unknown";
|
|
166
|
-
}
|
|
167
|
-
if (source === "BfCache") {
|
|
168
|
-
// The browser replayed a page it had already loaded, so the source that
|
|
169
|
-
// matters is where those bytes came from the first time — which is exactly
|
|
170
|
-
// what `BfCacheResponseCause` records. Reported as the underlying source,
|
|
171
|
-
// with `replayedFromBfCache` saying how it got here, so an origin-served
|
|
172
|
-
// page that came back through the bfcache still reaches the origin branch
|
|
173
|
-
// of the explanation and its notes.
|
|
174
|
-
if (input.page.responseCause === "Origin") {
|
|
175
|
-
return "origin";
|
|
176
|
-
}
|
|
177
|
-
return input.page.responseCause === "AssetAPI" ? "cache" : "unknown";
|
|
178
|
-
}
|
|
179
|
-
if (source === "Generated") {
|
|
180
|
-
// Speed Kit synthesised this — an error page, a redirect. Neither the
|
|
181
|
-
// origin's bytes nor a cached copy of them, and calling it either is how a
|
|
182
|
-
// reader ends up debugging a cache that was never involved.
|
|
183
|
-
return "generated";
|
|
184
|
-
}
|
|
185
|
-
if (source === "Origin") {
|
|
186
|
-
return "origin";
|
|
187
|
-
}
|
|
188
|
-
return SPEED_KIT_SOURCES.has(source) ? "cache" : "unknown";
|
|
189
|
-
}
|
|
190
|
-
/** Whether the browser replayed this from its back/forward cache. */
|
|
191
|
-
function replayedFromBfCache(input) {
|
|
192
|
-
return input.page?.responseSource === "BfCache" ? true : undefined;
|
|
193
|
-
}
|
|
194
|
-
function explain(input, rules, served) {
|
|
195
|
-
if (rules.decision === "excluded") {
|
|
196
|
-
const named = rules[rules.decidedBy];
|
|
197
|
-
const by = named.length > 0
|
|
198
|
-
? `${rules.decidedBy} (${named.join(", ")})`
|
|
199
|
-
: `${rules.decidedBy}, which is configured and matches nothing here`;
|
|
200
|
-
return `Speed Kit does not handle this url: ${by}.`;
|
|
201
|
-
}
|
|
202
|
-
if (served === "origin") {
|
|
203
|
-
const replayed = replayedFromBfCache(input)
|
|
204
|
-
? ", replayed from the browser's back/forward cache"
|
|
205
|
-
: "";
|
|
206
|
-
return `The rules allow this url, but it was served from origin${replayed} (${input.page.responseCause ?? "no responseCause reported"}).`;
|
|
207
|
-
}
|
|
208
|
-
if (served === "generated") {
|
|
209
|
-
return `The rules allow this url, but Speed Kit generated this response itself rather than serving the page — an error or a redirect (${input.page.responseCause ?? "no responseCause reported"}).`;
|
|
210
|
-
}
|
|
211
|
-
if (served === "unknown" && input.page) {
|
|
212
|
-
// Observed, but by a source this build does not know. Saying so is the
|
|
213
|
-
// point: a newer Speed Kit can report one, and a confident wrong branch
|
|
214
|
-
// here is worse than an honest gap.
|
|
215
|
-
return `The rules allow this url. It was served from \`${input.page.responseSource}\`, which this build does not recognise, so whether Speed Kit or the origin answered is not decided here.`;
|
|
216
|
-
}
|
|
217
|
-
if (input.cache) {
|
|
218
|
-
return "The rules allow this url and the documentHandler has a cached entry for it.";
|
|
219
|
-
}
|
|
220
|
-
return "The rules allow this url. Nothing has been cached for it yet, so no page has gone through the local documentHandler.";
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* The traps, stated only when the observations actually support them.
|
|
224
|
-
*
|
|
225
|
-
* Each of these has cost a debugging session, and each reads as a broken config
|
|
226
|
-
* when it is not one.
|
|
227
|
-
*/
|
|
228
|
-
function collectNotes(input, rules, served) {
|
|
229
|
-
const notes = [];
|
|
230
|
-
// Stated on every answer, because it is an assumption and not an
|
|
231
|
-
// observation: a url does not say whether it was fetched as a document, a
|
|
232
|
-
// script or an image, and the runtime decides partly on that. Left unsaid,
|
|
233
|
-
// every verdict here reads as though it covered sub-resources too.
|
|
234
|
-
notes.push(rules.navigationOnlySets.includes(rules.decidedBy)
|
|
235
|
-
? `Judged as a navigation, and ${rules.decidedBy} decided it — a set the runtime consults for pages only. The same url fetched as a script, image or font is not excluded by it.`
|
|
236
|
-
: `Judged as a navigation. ${rules.navigationOnlySets.join(" and ")} decide pages only, and rules restricted to another content type were left out, so the verdict for the same url fetched as a script, image or font can differ.`);
|
|
237
|
-
if (served === "origin") {
|
|
238
|
-
notes.push("On an origin-served page the dynamic fetcher never runs, so change detection compares nothing and its output is empty. That is not a broken config — the first load after a start often serves from origin, so reload once and ask again.");
|
|
239
|
-
}
|
|
240
|
-
if (replayedFromBfCache(input)) {
|
|
241
|
-
notes.push("The browser replayed this from its back/forward cache, so nothing was fetched for it now. `servedFrom` names where the bytes came from when the page was first loaded, which is what `responseCause` records for a bfcache hit — measure again on a fresh navigation before concluding anything about the current config.");
|
|
242
|
-
}
|
|
243
|
-
if (input.cache && !input.cache.assetList) {
|
|
244
|
-
notes.push(`The cached body carries no ${ASSET_LIST_MARKER} call, so the cached side of a change-detection comparison is empty and the comparison returns early. The asset list is baked into the HTML by the documentHandler, not read from the DOM.`);
|
|
245
|
-
}
|
|
246
|
-
if (rules.uncertain.length > 0) {
|
|
247
|
-
notes.push(`These rules carry a criterion outside the url — a cookie, a device, a storage value — so their verdict here is a maximum rather than an answer: ${rules.uncertain.join(", ")}.`);
|
|
248
|
-
}
|
|
249
|
-
if (!input.page) {
|
|
250
|
-
notes.push("This url is not the page in front of the run, so nothing observed it being served. The rule verdict stands on its own; `servedFrom` does not.");
|
|
251
|
-
}
|
|
252
|
-
return notes;
|
|
253
|
-
}
|
|
254
|
-
/** Whether a cached body carries the documentHandler's asset list. */
|
|
255
|
-
export function hasAssetList(body) {
|
|
256
|
-
return body.includes(ASSET_LIST_MARKER);
|
|
257
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PageEvaluator } from "./browser-session.js";
|
|
2
|
-
import { RumData } from "./control-protocol.js";
|
|
3
|
-
export declare function readRum(session: PageEvaluator, request: {
|
|
4
|
-
keys?: string[];
|
|
5
|
-
flush?: boolean;
|
|
6
|
-
key?: string;
|
|
7
|
-
previous?: boolean;
|
|
8
|
-
}): Promise<RumData>;
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Speed Kit's globals, read defensively.
|
|
3
|
-
*
|
|
4
|
-
* They are not always there, and the reasons are worth distinguishing from a
|
|
5
|
-
* bug: the page is **still booting** — much the commonest, and the only one that
|
|
6
|
-
* fixes itself — an older Speed Kit build, or a customer whose own JS strips the
|
|
7
|
-
* globals after merge. The last is a customer-specific anomaly rather than
|
|
8
|
-
* anything general about SSR. Every one of them is a reportable condition with a
|
|
9
|
-
* named cause, not a failure.
|
|
10
|
-
*
|
|
11
|
-
* All five booleans are reported to the caller as {@link RumData.globals}. They
|
|
12
|
-
* are measurements; the reason string is an inference from one of them, and a
|
|
13
|
-
* reader who needs to tell "absent" from "half-built" should not have to parse
|
|
14
|
-
* prose to do it.
|
|
15
|
-
*/
|
|
16
|
-
const PRESENCE = `(() => {
|
|
17
|
-
const sk = window.SpeedKit;
|
|
18
|
-
const controller = sk && sk.rumController;
|
|
19
|
-
const impression = controller && controller.currentRumImpression;
|
|
20
|
-
return {
|
|
21
|
-
present: Boolean(sk),
|
|
22
|
-
trackedData: Boolean(sk && typeof sk.getTrackedData === "function"),
|
|
23
|
-
rumController: Boolean(controller),
|
|
24
|
-
impression: Boolean(impression),
|
|
25
|
-
dataByKey: Boolean(impression && typeof impression.getDataByKey === "function"),
|
|
26
|
-
};
|
|
27
|
-
})()`;
|
|
28
|
-
/**
|
|
29
|
-
* What `getTrackedData()` returns is `init` plus `sentTracking` — **the unsent
|
|
30
|
-
* data is not in it**.
|
|
31
|
-
*
|
|
32
|
-
* `sentTracking` is `Object.create(this.init)` and `getTrackedData` copies own
|
|
33
|
-
* properties of each; `unsentTracking` is never consulted. So anything tracked
|
|
34
|
-
* since the last beacon is invisible here — which is exactly the state you are
|
|
35
|
-
* in right after triggering the interaction you were trying to verify.
|
|
36
|
-
*
|
|
37
|
-
* Hence `flushed` on every result. Silently returning stale data is how this
|
|
38
|
-
* would produce confident wrong answers.
|
|
39
|
-
*/
|
|
40
|
-
const TRACKED_DATA = `(() => {
|
|
41
|
-
const sk = window.SpeedKit;
|
|
42
|
-
if (!sk || typeof sk.getTrackedData !== "function") return null;
|
|
43
|
-
return sk.getTrackedData();
|
|
44
|
-
})()`;
|
|
45
|
-
/** Forces a send so the read sees everything — at the cost of ending an impression. */
|
|
46
|
-
const FLUSH = `(() => {
|
|
47
|
-
const sk = window.SpeedKit;
|
|
48
|
-
if (sk && sk.rumController && typeof sk.rumController.sendCollapsed === "function") {
|
|
49
|
-
sk.rumController.sendCollapsed();
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
})()`;
|
|
54
|
-
/**
|
|
55
|
-
* `getDataByKey` **does** merge unsent with sent, concatenating when both are
|
|
56
|
-
* arrays.
|
|
57
|
-
*
|
|
58
|
-
* That makes it the targeted "did my custom dimension land" check, and it works
|
|
59
|
-
* without forcing a send — which matters when forcing one would end the
|
|
60
|
-
* impression being measured.
|
|
61
|
-
*
|
|
62
|
-
* It is a method of **RumImpression**, not of the controller. Reading it off
|
|
63
|
-
* `rumController` returns undefined on every build, and guarding that with a
|
|
64
|
-
* bare `return null` made a missing method indistinguishable from an absent
|
|
65
|
-
* value — so the tool answered "your dimension did not land" for every field,
|
|
66
|
-
* which is the worst answer it could give. The result is now tagged, and the
|
|
67
|
-
* presence probe reports which of the two it is.
|
|
68
|
-
*/
|
|
69
|
-
const dataByKey = (name) => `(() => {
|
|
70
|
-
const controller = window.SpeedKit && window.SpeedKit.rumController;
|
|
71
|
-
const impression = controller && controller.currentRumImpression;
|
|
72
|
-
if (!impression || typeof impression.getDataByKey !== "function") {
|
|
73
|
-
return { status: "no-method" };
|
|
74
|
-
}
|
|
75
|
-
return { status: "ok", value: impression.getDataByKey(${JSON.stringify(name)}) };
|
|
76
|
-
})()`;
|
|
77
|
-
/**
|
|
78
|
-
* The previous page impression.
|
|
79
|
-
*
|
|
80
|
-
* `getTrackedData` forwards to `currentRumImpression`, and on a soft navigation
|
|
81
|
-
* that is not the hard nav — the two can be different instances. On an SPA
|
|
82
|
-
* customer the current impression is not the one that loaded the page.
|
|
83
|
-
*/
|
|
84
|
-
const PREVIOUS = `(() => {
|
|
85
|
-
const sk = window.SpeedKit;
|
|
86
|
-
if (!sk || !sk.rumController || typeof sk.rumController.getPreviousRumImpression !== "function") return null;
|
|
87
|
-
const previous = sk.rumController.getPreviousRumImpression();
|
|
88
|
-
return previous ? previous.getTrackedData() : null;
|
|
89
|
-
})()`;
|
|
90
|
-
const NO_PRESENCE = {
|
|
91
|
-
present: false,
|
|
92
|
-
trackedData: false,
|
|
93
|
-
rumController: false,
|
|
94
|
-
impression: false,
|
|
95
|
-
dataByKey: false,
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Why the globals cannot be read, hedged in the order the causes are likely.
|
|
99
|
-
*
|
|
100
|
-
* The wording matters more than it looks. This used to open with "SpeedKit is
|
|
101
|
-
* not on this page", which reads as a settled finding, and put "may not have
|
|
102
|
-
* installed yet" behind it — so a reader mid-page-load was told the conclusion
|
|
103
|
-
* first and the true cause second. A test session duly read it, concluded the
|
|
104
|
-
* page had no Speed Kit, and abandoned a check that needed only another minute.
|
|
105
|
-
* Booting now leads, because it is both the commonest cause and the only one
|
|
106
|
-
* that resolves on its own.
|
|
107
|
-
*
|
|
108
|
-
* The second branch could not name booting at all: a page a few hundred ms in,
|
|
109
|
-
* with `window.SpeedKit` up but `getTrackedData` not yet attached, was told it
|
|
110
|
-
* was running an older build or that the customer strips globals. Both wrong,
|
|
111
|
-
* and neither hedged.
|
|
112
|
-
*/
|
|
113
|
-
function absent(globals) {
|
|
114
|
-
return {
|
|
115
|
-
available: false,
|
|
116
|
-
reason: globals.present
|
|
117
|
-
? "Speed Kit is on the page but exposes no getTrackedData yet — it may still be booting, or this is an older build, or a customer whose own JS strips the globals after merge."
|
|
118
|
-
: "no window.SpeedKit on the page yet — it may still be booting, the page may be served from origin, or Speed Kit may not be installed on it.",
|
|
119
|
-
globals,
|
|
120
|
-
flushed: false,
|
|
121
|
-
url: null,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
export async function readRum(session, request) {
|
|
125
|
-
const presence = await session.evaluate(PRESENCE);
|
|
126
|
-
if (!presence?.trackedData) {
|
|
127
|
-
return {
|
|
128
|
-
...absent(presence ?? NO_PRESENCE),
|
|
129
|
-
url: session.url(),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (request.key) {
|
|
133
|
-
if (!presence.impression) {
|
|
134
|
-
return {
|
|
135
|
-
available: false,
|
|
136
|
-
reason: "Speed Kit has no current page impression yet — nothing has been tracked on this page.",
|
|
137
|
-
globals: presence,
|
|
138
|
-
flushed: false,
|
|
139
|
-
url: session.url(),
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
if (!presence.dataByKey) {
|
|
143
|
-
return {
|
|
144
|
-
available: false,
|
|
145
|
-
reason: "This Speed Kit build's RumImpression has no getDataByKey. Use `get` instead, which reads sent data.",
|
|
146
|
-
globals: presence,
|
|
147
|
-
flushed: false,
|
|
148
|
-
url: session.url(),
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
// No flush: this path already sees unsent data, and forcing a send would
|
|
152
|
-
// end the impression the caller is measuring.
|
|
153
|
-
const answer = await session.evaluate(dataByKey(request.key));
|
|
154
|
-
if (answer?.status !== "ok") {
|
|
155
|
-
return {
|
|
156
|
-
available: false,
|
|
157
|
-
reason: "getDataByKey vanished between the probe and the read — the page probably navigated.",
|
|
158
|
-
globals: presence,
|
|
159
|
-
flushed: false,
|
|
160
|
-
url: session.url(),
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
available: true,
|
|
165
|
-
flushed: false,
|
|
166
|
-
url: session.url(),
|
|
167
|
-
key: request.key,
|
|
168
|
-
// Explicitly null rather than omitted: an absent key is a real answer,
|
|
169
|
-
// and dropping the field made the summary read "undefined".
|
|
170
|
-
value: answer.value ?? null,
|
|
171
|
-
mergesUnsent: true,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
if (request.previous) {
|
|
175
|
-
const data = await session.evaluate(PREVIOUS);
|
|
176
|
-
return {
|
|
177
|
-
available: true,
|
|
178
|
-
flushed: false,
|
|
179
|
-
url: session.url(),
|
|
180
|
-
ofPreviousImpression: true,
|
|
181
|
-
data: data ?? null,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
const flushed = request.flush
|
|
185
|
-
? await session.evaluate(FLUSH)
|
|
186
|
-
: false;
|
|
187
|
-
const data = await session.evaluate(TRACKED_DATA);
|
|
188
|
-
const picked = pick(data, request.keys);
|
|
189
|
-
return {
|
|
190
|
-
available: true,
|
|
191
|
-
flushed,
|
|
192
|
-
url: session.url(),
|
|
193
|
-
data: picked.data,
|
|
194
|
-
keys: data ? Object.keys(data) : [],
|
|
195
|
-
notTracked: picked.notTracked,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Narrow the tracked object to the fields that were asked for.
|
|
200
|
-
*
|
|
201
|
-
* A key that is not there comes back as `null` rather than being dropped, and
|
|
202
|
-
* every such key is named in `notTracked`. Filtering them out meant six keys in
|
|
203
|
-
* and five fields out with nothing said about the sixth, so a reader had to
|
|
204
|
-
* diff the request against the response to notice — and three test sessions in
|
|
205
|
-
* a row did not. It is the same rule the single-key path already follows: an
|
|
206
|
-
* absent key is an answer, not a gap.
|
|
207
|
-
*
|
|
208
|
-
* This reads sent data only, so `null` here means "not sent yet or not tracked".
|
|
209
|
-
* `key` is the one that can tell those apart.
|
|
210
|
-
*/
|
|
211
|
-
function pick(data, keys) {
|
|
212
|
-
if (!data || !keys?.length) {
|
|
213
|
-
return { data };
|
|
214
|
-
}
|
|
215
|
-
const notTracked = keys.filter((key) => !(key in data));
|
|
216
|
-
return {
|
|
217
|
-
data: Object.fromEntries(keys.map((key) => [key, key in data ? data[key] : null])),
|
|
218
|
-
notTracked: notTracked.length ? notTracked : undefined,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Protocol } from "puppeteer";
|
|
2
|
-
import { ServiceWorkerState } from "./control-protocol.js";
|
|
3
|
-
/**
|
|
4
|
-
* What service workers the run has seen, kept because nothing can ask.
|
|
5
|
-
*
|
|
6
|
-
* CDP has no "list the registrations" command — `ServiceWorker.enable` starts a
|
|
7
|
-
* stream of `workerRegistrationUpdated` and `workerVersionUpdated` events and
|
|
8
|
-
* that is the only source. A reader arriving later, which every run command is,
|
|
9
|
-
* has missed them. So the run keeps the latest state as it goes.
|
|
10
|
-
*
|
|
11
|
-
* Asking the page instead (`navigator.serviceWorker.getRegistrations()`) looks
|
|
12
|
-
* simpler and answers a different question: it reports scope and script url but
|
|
13
|
-
* no version id and no history, so it cannot tell a locally installed worker
|
|
14
|
-
* from the deployed one that replaced it. That distinction is the reason this
|
|
15
|
-
* exists — a takeover is silent, and with static routing it freezes the routes
|
|
16
|
-
* from the *deployed* config, so locally enabled pages bypass the worker
|
|
17
|
-
* entirely and every navigation reports `SwBooting`. Hours have gone into
|
|
18
|
-
* diagnosing that from the symptom.
|
|
19
|
-
*/
|
|
20
|
-
export declare class ServiceWorkerTracker {
|
|
21
|
-
private readonly registrations;
|
|
22
|
-
private readonly versions;
|
|
23
|
-
private takeovers;
|
|
24
|
-
private lastTakeoverAt?;
|
|
25
|
-
/** From `ServiceWorker.workerRegistrationUpdated`. */
|
|
26
|
-
recordRegistrations(registrations: Protocol.ServiceWorker.ServiceWorkerRegistration[]): void;
|
|
27
|
-
/** From `ServiceWorker.workerVersionUpdated`. */
|
|
28
|
-
recordVersions(versions: Protocol.ServiceWorker.ServiceWorkerVersion[]): void;
|
|
29
|
-
/**
|
|
30
|
-
* The run decided a deployed worker took over.
|
|
31
|
-
*
|
|
32
|
-
* Recorded rather than derived: the decision needs `lastServedAt` from the
|
|
33
|
-
* local sw.js route, which lives in the run and not here. This only keeps the
|
|
34
|
-
* verdict so a reader can see it after the fact.
|
|
35
|
-
*/
|
|
36
|
-
recordTakeover(versionId: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* What is installed, and which of it is in charge of `pageUrl`.
|
|
39
|
-
*
|
|
40
|
-
* The active version has to be chosen against the page, not off the top of
|
|
41
|
-
* the list. This used to be `versions.find(v => v.status === "activated")` —
|
|
42
|
-
* the first activated version in insertion order, across every registration
|
|
43
|
-
* — and on a shop with scoped workers that is never the page's own. atida
|
|
44
|
-
* registers six (`/basket`, `/checkout`, `/login`, …) and the answer was
|
|
45
|
-
* always the customer's empty `wrapper-sw.js` on `/basket`, through two
|
|
46
|
-
* reinstalls that each replaced the worker actually serving the page.
|
|
47
|
-
*
|
|
48
|
-
* `foreign` is read off this version, so picking the wrong one hid the
|
|
49
|
-
* takeover this tracker exists to report: the run marks the right version in
|
|
50
|
-
* {@link recordTakeover}, and the flag was then read from a different one
|
|
51
|
-
* that nobody had marked. `takeovers` still counted, which is the only
|
|
52
|
-
* reason it was visible at all.
|
|
53
|
-
*/
|
|
54
|
-
state(pageUrl?: string | null): ServiceWorkerState;
|
|
55
|
-
/**
|
|
56
|
-
* The activated worker controlling this url.
|
|
57
|
-
*
|
|
58
|
-
* A registration controls a url when its scope is a prefix of it, and the
|
|
59
|
-
* narrowest matching scope wins — the rule the browser itself applies, so a
|
|
60
|
-
* page under `/basket` is answered by the `/basket` worker and the homepage
|
|
61
|
-
* by the root one. A deleted registration controls nothing.
|
|
62
|
-
*
|
|
63
|
-
* `undefined` is a real answer: mid-reinstall the new version is still
|
|
64
|
-
* `activating` and no activated worker controls the page. Falling back to
|
|
65
|
-
* "any activated version" would put the original bug back, quietly.
|
|
66
|
-
*/
|
|
67
|
-
private activeVersionFor;
|
|
68
|
-
}
|