@speedkit/cli 4.51.0-run-control.5 → 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,61 +0,0 @@
|
|
|
1
|
-
import { LogEvent, LogEventInput } from "./log-event-model.js";
|
|
2
|
-
/** The live log. One JSON object per line, appended, never rewritten. */
|
|
3
|
-
export declare const LOG_FILE = "log.jsonl";
|
|
4
|
-
/** The one generation kept after a rotation. */
|
|
5
|
-
export declare const LOG_PREVIOUS_FILE = "log.1.jsonl";
|
|
6
|
-
/**
|
|
7
|
-
* When to rotate. Two generations, so a pathological site costs twice this and
|
|
8
|
-
* not the disk. Well inside the 512 MB budget the registry enforces across all
|
|
9
|
-
* runs, which is what stops a hundred rotated logs adding up.
|
|
10
|
-
*/
|
|
11
|
-
export declare const LOG_MAX_BYTES: number;
|
|
12
|
-
/**
|
|
13
|
-
* Somewhere for a run to record what it did.
|
|
14
|
-
*
|
|
15
|
-
* An interface because `CliService` holds one, and `CliService` must not depend
|
|
16
|
-
* on the run directory existing — most commands have no run at all, and the
|
|
17
|
-
* onboarding run's directory is deliberately not created until the collision
|
|
18
|
-
* question has been answered.
|
|
19
|
-
*/
|
|
20
|
-
export interface RunLogInterface {
|
|
21
|
-
event(input: LogEventInput): void;
|
|
22
|
-
close(): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Appends a run's events to `log.jsonl` in its run directory.
|
|
26
|
-
*
|
|
27
|
-
* **Writes are synchronous, on purpose.** The log's whole claim is that a run
|
|
28
|
-
* which crashed is still explainable, and buffered writes lose exactly the
|
|
29
|
-
* lines that matter — the ones just before the crash. The cost is a write
|
|
30
|
-
* syscall per line, which is the right price for narration; per-request records
|
|
31
|
-
* are far too many for that and have their own file, see `RequestLog`.
|
|
32
|
-
*
|
|
33
|
-
* Durability, rotation and the refusal to let a write failure reach the run all
|
|
34
|
-
* live in {@link JsonlAppender}, which the two streams share.
|
|
35
|
-
*/
|
|
36
|
-
export declare class RunLog implements RunLogInterface {
|
|
37
|
-
private seq;
|
|
38
|
-
private readonly file;
|
|
39
|
-
constructor(dir: string, maxBytes?: number);
|
|
40
|
-
/** Absolute path of the file being appended to. */
|
|
41
|
-
get path(): string;
|
|
42
|
-
/** What went wrong the first time a write failed, if one did. */
|
|
43
|
-
get error(): string | undefined;
|
|
44
|
-
event(input: LogEventInput): void;
|
|
45
|
-
/**
|
|
46
|
-
* Shapes the record. ANSI comes off here rather than at the call site,
|
|
47
|
-
* because every message in this CLI is composed with inline chalk and a
|
|
48
|
-
* caller that had to remember would eventually not — leaving escape codes in
|
|
49
|
-
* the middle of a field every downstream `grep` is matching against.
|
|
50
|
-
*/
|
|
51
|
-
private build;
|
|
52
|
-
close(): void;
|
|
53
|
-
}
|
|
54
|
-
/** Keeps every event in memory. For tests, and for asserting on what was logged. */
|
|
55
|
-
export declare class MemoryRunLog implements RunLogInterface {
|
|
56
|
-
readonly events: LogEvent[];
|
|
57
|
-
private seq;
|
|
58
|
-
event(input: LogEventInput): void;
|
|
59
|
-
/** Nothing to release: an in-memory log holds no handle. */
|
|
60
|
-
close(): void;
|
|
61
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { stripVTControlCharacters } from "node:util";
|
|
2
|
-
import { JsonlAppender } from "./jsonl-appender.js";
|
|
3
|
-
import { redactData, redactText } from "./redaction.js";
|
|
4
|
-
/** The live log. One JSON object per line, appended, never rewritten. */
|
|
5
|
-
export const LOG_FILE = "log.jsonl";
|
|
6
|
-
/** The one generation kept after a rotation. */
|
|
7
|
-
export const LOG_PREVIOUS_FILE = "log.1.jsonl";
|
|
8
|
-
/**
|
|
9
|
-
* When to rotate. Two generations, so a pathological site costs twice this and
|
|
10
|
-
* not the disk. Well inside the 512 MB budget the registry enforces across all
|
|
11
|
-
* runs, which is what stops a hundred rotated logs adding up.
|
|
12
|
-
*/
|
|
13
|
-
export const LOG_MAX_BYTES = 32 * 1024 * 1024;
|
|
14
|
-
/**
|
|
15
|
-
* Appends a run's events to `log.jsonl` in its run directory.
|
|
16
|
-
*
|
|
17
|
-
* **Writes are synchronous, on purpose.** The log's whole claim is that a run
|
|
18
|
-
* which crashed is still explainable, and buffered writes lose exactly the
|
|
19
|
-
* lines that matter — the ones just before the crash. The cost is a write
|
|
20
|
-
* syscall per line, which is the right price for narration; per-request records
|
|
21
|
-
* are far too many for that and have their own file, see `RequestLog`.
|
|
22
|
-
*
|
|
23
|
-
* Durability, rotation and the refusal to let a write failure reach the run all
|
|
24
|
-
* live in {@link JsonlAppender}, which the two streams share.
|
|
25
|
-
*/
|
|
26
|
-
export class RunLog {
|
|
27
|
-
seq = 0;
|
|
28
|
-
file;
|
|
29
|
-
constructor(dir, maxBytes = LOG_MAX_BYTES) {
|
|
30
|
-
this.file = new JsonlAppender(dir, LOG_FILE, LOG_PREVIOUS_FILE, maxBytes);
|
|
31
|
-
}
|
|
32
|
-
/** Absolute path of the file being appended to. */
|
|
33
|
-
get path() {
|
|
34
|
-
return this.file.path;
|
|
35
|
-
}
|
|
36
|
-
/** What went wrong the first time a write failed, if one did. */
|
|
37
|
-
get error() {
|
|
38
|
-
return this.file.error;
|
|
39
|
-
}
|
|
40
|
-
event(input) {
|
|
41
|
-
// The sequence number is spent whether or not the write lands, so two
|
|
42
|
-
// readers of the same file never disagree about which line was which.
|
|
43
|
-
this.file.append(this.build(input));
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Shapes the record. ANSI comes off here rather than at the call site,
|
|
47
|
-
* because every message in this CLI is composed with inline chalk and a
|
|
48
|
-
* caller that had to remember would eventually not — leaving escape codes in
|
|
49
|
-
* the middle of a field every downstream `grep` is matching against.
|
|
50
|
-
*/
|
|
51
|
-
build(input) {
|
|
52
|
-
const event = {
|
|
53
|
-
seq: ++this.seq,
|
|
54
|
-
ts: new Date().toISOString(),
|
|
55
|
-
level: input.level,
|
|
56
|
-
scope: input.scope ?? "cli",
|
|
57
|
-
// Trimmed as well as stripped: `browserVersionString` carries the
|
|
58
|
-
// newline `execSync` returned, and a field that ends in whitespace does
|
|
59
|
-
// not round-trip — it prints a stray blank line and compares unequal to
|
|
60
|
-
// the same message typed by hand. The terminal keeps its own spacing,
|
|
61
|
-
// because the sink is handed the original string.
|
|
62
|
-
msg: redactText(stripVTControlCharacters(input.msg)).trim(),
|
|
63
|
-
};
|
|
64
|
-
if (input.data && Object.keys(input.data).length > 0) {
|
|
65
|
-
event.data = redactData(input.data);
|
|
66
|
-
}
|
|
67
|
-
if (input.action) {
|
|
68
|
-
event.action = input.action;
|
|
69
|
-
}
|
|
70
|
-
if (input.interaction) {
|
|
71
|
-
const { question, answer, ...rest } = input.interaction;
|
|
72
|
-
event.interaction = {
|
|
73
|
-
...rest,
|
|
74
|
-
question: redactText(stripVTControlCharacters(question)),
|
|
75
|
-
...(answer === undefined
|
|
76
|
-
? {}
|
|
77
|
-
: { answer: redactData({ answer }).answer }),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
return event;
|
|
81
|
-
}
|
|
82
|
-
close() {
|
|
83
|
-
this.file.close();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/** Keeps every event in memory. For tests, and for asserting on what was logged. */
|
|
87
|
-
export class MemoryRunLog {
|
|
88
|
-
events = [];
|
|
89
|
-
seq = 0;
|
|
90
|
-
event(input) {
|
|
91
|
-
this.events.push({
|
|
92
|
-
seq: ++this.seq,
|
|
93
|
-
ts: new Date().toISOString(),
|
|
94
|
-
scope: "cli",
|
|
95
|
-
...input,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/** Nothing to release: an in-memory log holds no handle. */
|
|
99
|
-
close() {
|
|
100
|
-
// Intentionally empty.
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { afterEach, beforeEach, describe, it } from "mocha";
|
|
3
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
import { META_FILE, RUNS_DIRECTORY, } from "../../run-registry/run-registry-model.js";
|
|
7
|
-
import { RunRegistry } from "../../run-registry/index.js";
|
|
8
|
-
import { LogQueryServiceFactory } from "../log-query-service-factory.js";
|
|
9
|
-
import { BadLogFilterError } from "../log-reader.js";
|
|
10
|
-
import { REQUESTS_FILE } from "../request-log.js";
|
|
11
|
-
import { LOG_FILE } from "../run-log.js";
|
|
12
|
-
/**
|
|
13
|
-
* What `sk onboarding logs` reads, through the service rather than the
|
|
14
|
-
* command, so the rendering is not what is under test.
|
|
15
|
-
*/
|
|
16
|
-
describe("LogQueryService", () => {
|
|
17
|
-
let cacheDirectory;
|
|
18
|
-
let seq = 0;
|
|
19
|
-
const runDirectory = (id) => join(cacheDirectory, RUNS_DIRECTORY, id);
|
|
20
|
-
const writeRun = (id, startedAt = new Date().toISOString()) => {
|
|
21
|
-
const meta = {
|
|
22
|
-
id,
|
|
23
|
-
customer: id.split("-")[0],
|
|
24
|
-
customerPath: `customers/${id.split("-")[0]}`,
|
|
25
|
-
configName: "production",
|
|
26
|
-
pid: process.pid,
|
|
27
|
-
startedAt,
|
|
28
|
-
status: "finished",
|
|
29
|
-
flags: {
|
|
30
|
-
local: false,
|
|
31
|
-
headless: false,
|
|
32
|
-
useTestConfig: false,
|
|
33
|
-
ignoreContentSecurityPolicy: false,
|
|
34
|
-
},
|
|
35
|
-
cliVersion: "0.0.0",
|
|
36
|
-
};
|
|
37
|
-
mkdirSync(runDirectory(id), { recursive: true });
|
|
38
|
-
writeFileSync(join(runDirectory(id), META_FILE), JSON.stringify(meta));
|
|
39
|
-
};
|
|
40
|
-
const writeLog = (id, events) => writeFileSync(join(runDirectory(id), LOG_FILE), `${events
|
|
41
|
-
.map((event) => JSON.stringify({
|
|
42
|
-
seq: ++seq,
|
|
43
|
-
ts: "2026-09-18T08:00:00.000Z",
|
|
44
|
-
level: "info",
|
|
45
|
-
scope: "cli",
|
|
46
|
-
msg: "a line",
|
|
47
|
-
...event,
|
|
48
|
-
}))
|
|
49
|
-
.join("\n")}\n`);
|
|
50
|
-
const writeRequests = (id, records) => writeFileSync(join(runDirectory(id), REQUESTS_FILE), `${records
|
|
51
|
-
.map((record) => JSON.stringify({
|
|
52
|
-
seq: ++seq,
|
|
53
|
-
ts: "2026-09-18T08:00:00.000Z",
|
|
54
|
-
url: "https://x.test/",
|
|
55
|
-
method: "GET",
|
|
56
|
-
resourceType: "Document",
|
|
57
|
-
stage: "Request",
|
|
58
|
-
outcome: "continued",
|
|
59
|
-
...record,
|
|
60
|
-
}))
|
|
61
|
-
.join("\n")}\n`);
|
|
62
|
-
const logs = () => new LogQueryServiceFactory(new RunRegistry(cacheDirectory)).getService();
|
|
63
|
-
beforeEach(() => {
|
|
64
|
-
cacheDirectory = mkdtempSync(join(tmpdir(), "sk-log-query-"));
|
|
65
|
-
seq = 0;
|
|
66
|
-
});
|
|
67
|
-
afterEach(() => {
|
|
68
|
-
rmSync(cacheDirectory, { recursive: true, force: true });
|
|
69
|
-
});
|
|
70
|
-
it("should answer about a run that has ended", () => {
|
|
71
|
-
// Every other question about a run needs the live process; this one reads
|
|
72
|
-
// a file, so a run that crashed last week answers as well as one running.
|
|
73
|
-
writeRun("atida-production-1");
|
|
74
|
-
writeLog("atida-production-1", [{ msg: "started" }]);
|
|
75
|
-
const service = logs();
|
|
76
|
-
const run = service.resolve("atida");
|
|
77
|
-
expect(run.status).to.equal("finished");
|
|
78
|
-
expect(service.summarise(run).events).to.equal(1);
|
|
79
|
-
});
|
|
80
|
-
it("should count and deduplicate what went wrong", () => {
|
|
81
|
-
writeRun("atida-production-1");
|
|
82
|
-
writeLog("atida-production-1", [
|
|
83
|
-
{ level: "info", msg: "started" },
|
|
84
|
-
{ level: "error", msg: "could not reach the origin" },
|
|
85
|
-
{ level: "error", msg: "could not reach the origin" },
|
|
86
|
-
]);
|
|
87
|
-
const service = logs();
|
|
88
|
-
const summary = service.summarise(service.resolve("atida"));
|
|
89
|
-
expect(summary.byLevel.error).to.equal(2);
|
|
90
|
-
expect(summary.problems).to.have.lengthOf(1);
|
|
91
|
-
expect(summary.problems[0].count).to.equal(2);
|
|
92
|
-
});
|
|
93
|
-
it("should surface a question the run is still waiting on", () => {
|
|
94
|
-
writeRun("atida-production-1");
|
|
95
|
-
writeLog("atida-production-1", [
|
|
96
|
-
{
|
|
97
|
-
msg: "Which config?",
|
|
98
|
-
interaction: {
|
|
99
|
-
kind: "select",
|
|
100
|
-
question: "Which config?",
|
|
101
|
-
pending: true,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
]);
|
|
105
|
-
const service = logs();
|
|
106
|
-
const [asked] = service.summarise(service.resolve("atida")).interactions;
|
|
107
|
-
expect(asked.question).to.equal("Which config?");
|
|
108
|
-
expect(asked.unanswered).to.equal(true);
|
|
109
|
-
});
|
|
110
|
-
it("should return a cursor a caller can read on from", () => {
|
|
111
|
-
writeRun("atida-production-1");
|
|
112
|
-
writeLog("atida-production-1", [{ msg: "one" }, { msg: "two" }]);
|
|
113
|
-
const service = logs();
|
|
114
|
-
const run = service.resolve("atida");
|
|
115
|
-
expect(service.read(run).lastSeq).to.equal(2);
|
|
116
|
-
const second = service.read(run, { sinceSeq: 2 });
|
|
117
|
-
expect(second.events).to.eql([]);
|
|
118
|
-
// The cursor still names the newest line in the file, so a caller polling
|
|
119
|
-
// an idle run does not walk it backwards.
|
|
120
|
-
expect(second.lastSeq).to.equal(2);
|
|
121
|
-
});
|
|
122
|
-
it("should filter by level and by scope", () => {
|
|
123
|
-
writeRun("atida-production-1");
|
|
124
|
-
writeLog("atida-production-1", [
|
|
125
|
-
{ level: "info", scope: "cli", msg: "narration" },
|
|
126
|
-
{ level: "warn", scope: "sw", msg: "took over" },
|
|
127
|
-
]);
|
|
128
|
-
const service = logs();
|
|
129
|
-
const { events } = service.read(service.resolve("atida"), {
|
|
130
|
-
level: "warn",
|
|
131
|
-
scope: ["sw"],
|
|
132
|
-
});
|
|
133
|
-
expect(events.map((event) => event.msg)).to.eql(["took over"]);
|
|
134
|
-
});
|
|
135
|
-
it("should separate a run with no log from a run with nothing to say", () => {
|
|
136
|
-
// The same empty answer, opposite next moves: one was never recording, the
|
|
137
|
-
// other was simply quiet.
|
|
138
|
-
writeRun("atida-production-1");
|
|
139
|
-
const service = logs();
|
|
140
|
-
expect(service.hasLog(service.resolve("atida"))).to.equal(false);
|
|
141
|
-
});
|
|
142
|
-
it("should refuse a filter it cannot read, naming it", () => {
|
|
143
|
-
writeRun("atida-production-1");
|
|
144
|
-
writeLog("atida-production-1", [{ msg: "started" }]);
|
|
145
|
-
const service = logs();
|
|
146
|
-
const run = service.resolve("atida");
|
|
147
|
-
expect(() => service.read(run, { since: "last tuesday" })).to.throw(BadLogFilterError);
|
|
148
|
-
});
|
|
149
|
-
it("should read and filter the requests a run intercepted", () => {
|
|
150
|
-
writeRun("atida-production-1");
|
|
151
|
-
writeLog("atida-production-1", [{ msg: "started" }]);
|
|
152
|
-
writeRequests("atida-production-1", [
|
|
153
|
-
{
|
|
154
|
-
url: "https://x.test/a",
|
|
155
|
-
outcome: "fulfilled",
|
|
156
|
-
handler: "AssetRequest",
|
|
157
|
-
},
|
|
158
|
-
{ url: "https://x.test/checkout", outcome: "continued" },
|
|
159
|
-
]);
|
|
160
|
-
const service = logs();
|
|
161
|
-
const run = service.resolve("atida");
|
|
162
|
-
expect(service.readRequests(run).records.map((r) => r.outcome)).to.eql([
|
|
163
|
-
"fulfilled",
|
|
164
|
-
"continued",
|
|
165
|
-
]);
|
|
166
|
-
expect(service
|
|
167
|
-
.readRequests(run, { outcome: "continued" })
|
|
168
|
-
.records.map((r) => r.url)).to.eql(["https://x.test/checkout"]);
|
|
169
|
-
});
|
|
170
|
-
it("should count the requests in the summary, alongside the narration", () => {
|
|
171
|
-
writeRun("atida-production-1");
|
|
172
|
-
writeLog("atida-production-1", [{ msg: "started" }]);
|
|
173
|
-
writeRequests("atida-production-1", [
|
|
174
|
-
{ outcome: "fulfilled" },
|
|
175
|
-
{ outcome: "continued" },
|
|
176
|
-
{ outcome: "continued" },
|
|
177
|
-
]);
|
|
178
|
-
const service = logs();
|
|
179
|
-
const summary = service.summarise(service.resolve("atida"));
|
|
180
|
-
expect(summary.requests?.byOutcome).to.eql({ fulfilled: 1, continued: 2 });
|
|
181
|
-
});
|
|
182
|
-
it("should separate a run that recorded no requests from one that saw none", () => {
|
|
183
|
-
writeRun("atida-production-1");
|
|
184
|
-
writeLog("atida-production-1", [{ msg: "started" }]);
|
|
185
|
-
const service = logs();
|
|
186
|
-
expect(service.hasRequests(service.resolve("atida"))).to.equal(false);
|
|
187
|
-
});
|
|
188
|
-
it("should fall back to the newest run when none is live", () => {
|
|
189
|
-
// Post-mortem is the common case, so an unqualified read on a machine with
|
|
190
|
-
// no live run answers about the last one rather than refusing.
|
|
191
|
-
writeRun("atida-production-1", "2026-09-17T08:00:00.000Z");
|
|
192
|
-
writeLog("atida-production-1", [{ msg: "older run" }]);
|
|
193
|
-
writeRun("shirtinator-production-2", "2026-09-18T08:00:00.000Z");
|
|
194
|
-
writeLog("shirtinator-production-2", [{ msg: "newer run" }]);
|
|
195
|
-
expect(logs().resolve().meta.id).to.equal("shirtinator-production-2");
|
|
196
|
-
});
|
|
197
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { afterEach, beforeEach, describe, it } from "mocha";
|
|
3
|
-
import { appendFileSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
import { LogReader, parseSince, readLog } from "../log-reader.js";
|
|
7
|
-
import { LOG_FILE, LOG_PREVIOUS_FILE } from "../run-log.js";
|
|
8
|
-
let seq = 0;
|
|
9
|
-
function event(patch = {}) {
|
|
10
|
-
return {
|
|
11
|
-
seq: ++seq,
|
|
12
|
-
ts: "2026-09-18T08:00:00.000Z",
|
|
13
|
-
level: "info",
|
|
14
|
-
scope: "cli",
|
|
15
|
-
msg: "a line",
|
|
16
|
-
...patch,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
describe("LogReader", () => {
|
|
20
|
-
let dir;
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
dir = mkdtempSync(join(tmpdir(), "sk-log-reader-"));
|
|
23
|
-
seq = 0;
|
|
24
|
-
});
|
|
25
|
-
afterEach(() => {
|
|
26
|
-
rmSync(dir, { recursive: true, force: true });
|
|
27
|
-
});
|
|
28
|
-
const write = (events, file = LOG_FILE) => writeFileSync(join(dir, file), `${events.map((entry) => JSON.stringify(entry)).join("\n")}\n`);
|
|
29
|
-
it("reads the rotated generation before the live one", () => {
|
|
30
|
-
write([event({ msg: "older" })], LOG_PREVIOUS_FILE);
|
|
31
|
-
write([event({ msg: "newer" })]);
|
|
32
|
-
expect(readLog(dir).events.map((entry) => entry.msg)).to.eql([
|
|
33
|
-
"older",
|
|
34
|
-
"newer",
|
|
35
|
-
]);
|
|
36
|
-
});
|
|
37
|
-
it("returns only what was appended since the last read", () => {
|
|
38
|
-
write([event({ msg: "first" })]);
|
|
39
|
-
const reader = new LogReader(dir);
|
|
40
|
-
expect(reader.read().records).to.have.length(1);
|
|
41
|
-
appendFileSync(join(dir, LOG_FILE), `${JSON.stringify(event({ msg: "second" }))}\n`);
|
|
42
|
-
expect(reader.read().records.map((entry) => entry.msg)).to.eql(["second"]);
|
|
43
|
-
});
|
|
44
|
-
it("carries a half-written line over instead of counting it as broken", () => {
|
|
45
|
-
const complete = JSON.stringify(event({ msg: "whole" }));
|
|
46
|
-
const partial = JSON.stringify(event({ msg: "split" }));
|
|
47
|
-
writeFileSync(join(dir, LOG_FILE), `${complete}\n${partial.slice(0, 20)}`);
|
|
48
|
-
const reader = new LogReader(dir);
|
|
49
|
-
const first = reader.read();
|
|
50
|
-
expect(first.records.map((entry) => entry.msg)).to.eql(["whole"]);
|
|
51
|
-
expect(first.malformed).to.equal(0);
|
|
52
|
-
appendFileSync(join(dir, LOG_FILE), `${partial.slice(20)}\n`);
|
|
53
|
-
expect(reader.read().records.map((entry) => entry.msg)).to.eql(["split"]);
|
|
54
|
-
});
|
|
55
|
-
it("starts over when the file it was reading got shorter", () => {
|
|
56
|
-
write([event({ msg: "before" }), event({ msg: "and" })]);
|
|
57
|
-
const reader = new LogReader(dir);
|
|
58
|
-
reader.read();
|
|
59
|
-
// What a rotation looks like from a reader's side.
|
|
60
|
-
seq = 0;
|
|
61
|
-
write([event({ msg: "after" })]);
|
|
62
|
-
expect(reader.read().records.map((entry) => entry.msg)).to.eql(["after"]);
|
|
63
|
-
});
|
|
64
|
-
it("keeps a level and everything above it", () => {
|
|
65
|
-
write([
|
|
66
|
-
event({ level: "debug", msg: "d" }),
|
|
67
|
-
event({ level: "info", msg: "i" }),
|
|
68
|
-
event({ level: "warn", msg: "w" }),
|
|
69
|
-
event({ level: "error", msg: "e" }),
|
|
70
|
-
]);
|
|
71
|
-
expect(readLog(dir, { level: "warn" }).events.map((entry) => entry.msg)).to.eql(["w", "e"]);
|
|
72
|
-
});
|
|
73
|
-
it("matches a url in the data as well as in the message", () => {
|
|
74
|
-
write([
|
|
75
|
-
event({ msg: "no url here" }),
|
|
76
|
-
event({ msg: "nothing in the prose", data: { url: "/checkout" } }),
|
|
77
|
-
]);
|
|
78
|
-
expect(readLog(dir, { url: "/checkout" }).events.map((entry) => entry.seq)).to.eql([2]);
|
|
79
|
-
});
|
|
80
|
-
it("reports the total behind a tail, and the cursor", () => {
|
|
81
|
-
write([event(), event(), event(), event()]);
|
|
82
|
-
const result = readLog(dir, { tail: 2 });
|
|
83
|
-
expect(result.events).to.have.length(2);
|
|
84
|
-
expect(result.total).to.equal(4);
|
|
85
|
-
expect(result.truncated).to.equal(true);
|
|
86
|
-
// The cursor is the newest line in the file, not the newest one returned:
|
|
87
|
-
// a caller passing it back must not be handed the two it just skipped.
|
|
88
|
-
expect(result.lastSeq).to.equal(4);
|
|
89
|
-
});
|
|
90
|
-
it("counts a line that is not JSON rather than failing the read", () => {
|
|
91
|
-
writeFileSync(join(dir, LOG_FILE), `${JSON.stringify(event())}\nnot json at all\n`);
|
|
92
|
-
const result = readLog(dir);
|
|
93
|
-
expect(result.events).to.have.length(1);
|
|
94
|
-
expect(result.malformed).to.equal(1);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
describe("parseSince", () => {
|
|
98
|
-
const now = new Date("2026-09-18T12:00:00.000Z");
|
|
99
|
-
it("reads a relative span", () => {
|
|
100
|
-
expect(parseSince("90m", now).toISOString()).to.equal("2026-09-18T10:30:00.000Z");
|
|
101
|
-
expect(parseSince("2h", now).toISOString()).to.equal("2026-09-18T10:00:00.000Z");
|
|
102
|
-
});
|
|
103
|
-
it("reads an ISO timestamp", () => {
|
|
104
|
-
expect(parseSince("2026-09-18T08:15:00.000Z", now).toISOString()).to.equal("2026-09-18T08:15:00.000Z");
|
|
105
|
-
});
|
|
106
|
-
it("says what it could not read, and what it would accept", () => {
|
|
107
|
-
expect(() => parseSince("last tuesday", now)).to.throw(/5m, 2h or 1d/);
|
|
108
|
-
});
|
|
109
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import { normalise, renderSummary, summariseLog } from "../log-summary.js";
|
|
4
|
-
let seq = 0;
|
|
5
|
-
function event(patch = {}) {
|
|
6
|
-
return {
|
|
7
|
-
seq: ++seq,
|
|
8
|
-
ts: "2026-09-18T08:00:00.000Z",
|
|
9
|
-
level: "info",
|
|
10
|
-
scope: "cli",
|
|
11
|
-
msg: "a line",
|
|
12
|
-
...patch,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
describe("summariseLog", () => {
|
|
16
|
-
it("counts by level and by scope", () => {
|
|
17
|
-
const summary = summariseLog([
|
|
18
|
-
event({ level: "info", scope: "cli" }),
|
|
19
|
-
event({ level: "warn", scope: "sw" }),
|
|
20
|
-
event({ level: "warn", scope: "sw" }),
|
|
21
|
-
]);
|
|
22
|
-
expect(summary.byLevel).to.eql({ info: 1, warn: 2 });
|
|
23
|
-
expect(summary.byScope).to.eql({ cli: 1, sw: 2 });
|
|
24
|
-
});
|
|
25
|
-
it("collapses a message that repeats, keeping the count and the span", () => {
|
|
26
|
-
const summary = summariseLog([
|
|
27
|
-
event({
|
|
28
|
-
level: "error",
|
|
29
|
-
msg: "fetch failed for https://x.test/a?v=1",
|
|
30
|
-
ts: "2026-09-18T08:00:00.000Z",
|
|
31
|
-
}),
|
|
32
|
-
event({
|
|
33
|
-
level: "error",
|
|
34
|
-
msg: "fetch failed for https://x.test/a?v=2",
|
|
35
|
-
ts: "2026-09-18T08:04:00.000Z",
|
|
36
|
-
}),
|
|
37
|
-
]);
|
|
38
|
-
expect(summary.problems).to.have.length(1);
|
|
39
|
-
expect(summary.problems[0].count).to.equal(2);
|
|
40
|
-
expect(summary.problems[0].firstAt).to.equal("2026-09-18T08:00:00.000Z");
|
|
41
|
-
expect(summary.problems[0].lastAt).to.equal("2026-09-18T08:04:00.000Z");
|
|
42
|
-
// One real message survives, so a reader is never left with the pattern.
|
|
43
|
-
expect(summary.problems[0].example).to.contain("?v=1");
|
|
44
|
-
});
|
|
45
|
-
it("leaves info out of the problems, however often it repeats", () => {
|
|
46
|
-
const summary = summariseLog([
|
|
47
|
-
event({ msg: "loaded" }),
|
|
48
|
-
event({ msg: "loaded" }),
|
|
49
|
-
]);
|
|
50
|
-
expect(summary.problems).to.eql([]);
|
|
51
|
-
});
|
|
52
|
-
it("puts errors above warnings, then the most frequent first", () => {
|
|
53
|
-
const summary = summariseLog([
|
|
54
|
-
event({ level: "warn", msg: "warned" }),
|
|
55
|
-
event({ level: "warn", msg: "warned" }),
|
|
56
|
-
event({ level: "warn", msg: "warned" }),
|
|
57
|
-
event({ level: "error", msg: "broke" }),
|
|
58
|
-
]);
|
|
59
|
-
expect(summary.problems.map((problem) => problem.example)).to.eql([
|
|
60
|
-
"broke",
|
|
61
|
-
"warned",
|
|
62
|
-
]);
|
|
63
|
-
});
|
|
64
|
-
it("names the actions that failed", () => {
|
|
65
|
-
const summary = summariseLog([
|
|
66
|
-
event({
|
|
67
|
-
level: "success",
|
|
68
|
-
msg: "installed",
|
|
69
|
-
action: { name: "install", state: "success" },
|
|
70
|
-
}),
|
|
71
|
-
event({
|
|
72
|
-
level: "error",
|
|
73
|
-
msg: "could not reach the origin",
|
|
74
|
-
action: { name: "prewarm", state: "fail" },
|
|
75
|
-
}),
|
|
76
|
-
]);
|
|
77
|
-
expect(summary.failedActions).to.eql([
|
|
78
|
-
{
|
|
79
|
-
name: "prewarm",
|
|
80
|
-
msg: "could not reach the origin",
|
|
81
|
-
at: "2026-09-18T08:00:00.000Z",
|
|
82
|
-
},
|
|
83
|
-
]);
|
|
84
|
-
});
|
|
85
|
-
it("reports a question that was answered, once", () => {
|
|
86
|
-
const question = "Start anyway?";
|
|
87
|
-
const summary = summariseLog([
|
|
88
|
-
event({
|
|
89
|
-
msg: question,
|
|
90
|
-
interaction: { kind: "confirm", question, pending: true },
|
|
91
|
-
}),
|
|
92
|
-
event({
|
|
93
|
-
msg: question,
|
|
94
|
-
interaction: { kind: "confirm", question, answer: false },
|
|
95
|
-
}),
|
|
96
|
-
]);
|
|
97
|
-
expect(summary.interactions).to.eql([
|
|
98
|
-
{ question, answer: false, defaulted: undefined },
|
|
99
|
-
]);
|
|
100
|
-
});
|
|
101
|
-
it("reports a question the run never got an answer to", () => {
|
|
102
|
-
const question = "Which config?";
|
|
103
|
-
const summary = summariseLog([
|
|
104
|
-
event({
|
|
105
|
-
msg: question,
|
|
106
|
-
interaction: { kind: "select", question, pending: true },
|
|
107
|
-
}),
|
|
108
|
-
]);
|
|
109
|
-
// This is why the run stopped where it did, and it is worth more than any
|
|
110
|
-
// answered question in the file.
|
|
111
|
-
expect(summary.interactions).to.eql([{ question, unanswered: true }]);
|
|
112
|
-
});
|
|
113
|
-
it("counts a structured field across the run", () => {
|
|
114
|
-
const summary = summariseLog([
|
|
115
|
-
event({ scope: "fetch", data: { responseCause: "SwBooting" } }),
|
|
116
|
-
event({ scope: "fetch", data: { responseCause: "Cached" } }),
|
|
117
|
-
event({ scope: "fetch", data: { responseCause: "Cached" } }),
|
|
118
|
-
]);
|
|
119
|
-
expect(summary.histograms.responseCause).to.eql({
|
|
120
|
-
SwBooting: 1,
|
|
121
|
-
Cached: 2,
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
it("has no histogram for a field nothing annotated", () => {
|
|
125
|
-
const summary = summariseLog([event({ msg: "served from cache" })]);
|
|
126
|
-
// Empty is a statement about the producers, not about the run. Inventing a
|
|
127
|
-
// histogram out of the prose would be a guess presented as a measurement.
|
|
128
|
-
expect(summary.histograms).to.eql({});
|
|
129
|
-
});
|
|
130
|
-
it("measures the span it was given", () => {
|
|
131
|
-
const summary = summariseLog([
|
|
132
|
-
event({ ts: "2026-09-18T08:00:00.000Z" }),
|
|
133
|
-
event({ ts: "2026-09-18T08:02:30.000Z" }),
|
|
134
|
-
]);
|
|
135
|
-
expect(summary.span.durationMs).to.equal(150_000);
|
|
136
|
-
});
|
|
137
|
-
it("summarises nothing without falling over", () => {
|
|
138
|
-
const summary = summariseLog([]);
|
|
139
|
-
expect(summary.events).to.equal(0);
|
|
140
|
-
expect(summary.span).to.eql({});
|
|
141
|
-
expect(renderSummary(summary)).to.contain("0 events");
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
describe("normalise", () => {
|
|
145
|
-
it("collapses the parts that vary per occurrence", () => {
|
|
146
|
-
expect(normalise("timed out after 4500 ms on /p?id=9")).to.equal("timed out after # ms on /p?…");
|
|
147
|
-
});
|
|
148
|
-
it("leaves a short number alone", () => {
|
|
149
|
-
// Collapsing every digit merges "HTTP 404" into "HTTP 500", which hides a
|
|
150
|
-
// second failure behind the first.
|
|
151
|
-
expect(normalise("HTTP 5 retries")).to.equal("HTTP 5 retries");
|
|
152
|
-
});
|
|
153
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|