@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,10 +1,8 @@
|
|
|
1
1
|
import { ChalkInstance } from "chalk";
|
|
2
2
|
import { Options } from "cli-progress";
|
|
3
3
|
import { CliServiceInterface, CliTableColumns } from "./cli-service-model.js";
|
|
4
|
-
import { LogLevel, LogMeta, RunLogInterface } from "../run-log/index.js";
|
|
5
4
|
import { ClipboardService } from "./clipboard/index.js";
|
|
6
5
|
import type { CliEnvironment } from "./cli-environment.js";
|
|
7
|
-
import { CliSink } from "./sink.js";
|
|
8
6
|
import { ExecSyncOptions } from "node:child_process";
|
|
9
7
|
/** What the CLI needs to know about where it runs. */
|
|
10
8
|
export type CliTerminal = Pick<CliEnvironment, "isCI" | "nonInteractive">;
|
|
@@ -12,7 +10,6 @@ export declare class CliService implements CliServiceInterface {
|
|
|
12
10
|
private readonly clipboard;
|
|
13
11
|
private readonly terminal;
|
|
14
12
|
readonly quiet: boolean;
|
|
15
|
-
private readonly sink;
|
|
16
13
|
style: ChalkInstance;
|
|
17
14
|
private buffer;
|
|
18
15
|
private progressBar?;
|
|
@@ -29,8 +26,6 @@ export declare class CliService implements CliServiceInterface {
|
|
|
29
26
|
private readonly animates;
|
|
30
27
|
/** The text of each running action, for the log line that replaces it. */
|
|
31
28
|
private readonly actions;
|
|
32
|
-
/** Where a structured copy of the output goes, once a run owns one. */
|
|
33
|
-
private log?;
|
|
34
29
|
/**
|
|
35
30
|
* True when this shell cannot be asked a question: CI, no TTY on either end,
|
|
36
31
|
* or SK_NON_INTERACTIVE. Callers that would otherwise block on a prompt check
|
|
@@ -38,54 +33,15 @@ export declare class CliService implements CliServiceInterface {
|
|
|
38
33
|
* than being re-derived wherever a prompt happens to be.
|
|
39
34
|
*/
|
|
40
35
|
get nonInteractive(): boolean;
|
|
41
|
-
constructor(clipboard: ClipboardService, terminal: CliTerminal, quiet?: boolean
|
|
42
|
-
|
|
43
|
-
* Put the terminal back the way it was found.
|
|
44
|
-
*
|
|
45
|
-
* Spinnies hides the cursor while a spinner runs and shows it again only
|
|
46
|
-
* when the last one ends. A shutdown that happens mid-spinner would otherwise
|
|
47
|
-
* leave the user with an invisible cursor — which is what spinnies' own
|
|
48
|
-
* SIGINT handler existed to prevent, and that handler is gone for the reasons
|
|
49
|
-
* in {@link createSpinners}. Owning the cleanup is the price of owning the
|
|
50
|
-
* signal.
|
|
51
|
-
*/
|
|
52
|
-
restoreTerminal(): void;
|
|
53
|
-
attachLog(log: RunLogInterface): void;
|
|
54
|
-
logOnly(level: LogLevel, message: string, meta?: LogMeta): void;
|
|
55
|
-
/**
|
|
56
|
-
* Record one line, if a run is listening.
|
|
57
|
-
*
|
|
58
|
-
* Everything the CLI prints goes through here as well as through the sink,
|
|
59
|
-
* which is what makes the log a copy of the session rather than a second
|
|
60
|
-
* account of it. The level comes from the method that was called — a
|
|
61
|
-
* `writeWarning` is a `warn` — and a caller that knows better overrides it in
|
|
62
|
-
* `meta`.
|
|
63
|
-
*
|
|
64
|
-
* **Deliberately upstream of `quiet`.** A quiet run prints nothing and still
|
|
65
|
-
* happened; the log is not the terminal, and a `--quiet` session with an
|
|
66
|
-
* empty log would be the most misleading file in the directory.
|
|
67
|
-
*/
|
|
68
|
-
private record;
|
|
69
|
-
code(code: string, buffered?: boolean, meta?: LogMeta): void;
|
|
36
|
+
constructor(clipboard: ClipboardService, terminal: CliTerminal, quiet?: boolean);
|
|
37
|
+
code(code: string, buffered?: boolean): void;
|
|
70
38
|
codeStyle(code: string): string;
|
|
71
|
-
comment(message: string, buffered?: boolean
|
|
39
|
+
comment(message: string, buffered?: boolean): void;
|
|
72
40
|
confirm(message: string, defaultAnswer?: boolean): Promise<boolean>;
|
|
73
|
-
/**
|
|
74
|
-
* A question that is now on screen, waiting.
|
|
75
|
-
*
|
|
76
|
-
* Logged before the answer exists, and again once it arrives, because an
|
|
77
|
-
* append-only file cannot go back and fill one in — and a run that died
|
|
78
|
-
* waiting at a prompt is exactly the run whose log has to show the question.
|
|
79
|
-
* The cost is two lines per prompt; the alternative is a log that ends in
|
|
80
|
-
* silence with no indication that anything was being asked.
|
|
81
|
-
*/
|
|
82
|
-
private asked;
|
|
83
|
-
private answered;
|
|
84
41
|
exit(code?: number): void;
|
|
85
42
|
prompt(message: string, options?: {
|
|
86
43
|
defaultAnswer?: any;
|
|
87
44
|
validator?: any;
|
|
88
|
-
sensitive?: boolean;
|
|
89
45
|
}): Promise<string>;
|
|
90
46
|
select(message: string, choices: any, defaultValue?: string): Promise<string>;
|
|
91
47
|
multiSelect<T>(message: string, choices: {
|
|
@@ -124,10 +80,10 @@ export declare class CliService implements CliServiceInterface {
|
|
|
124
80
|
*/
|
|
125
81
|
note(message: string): void;
|
|
126
82
|
spacer(): void;
|
|
127
|
-
startAction(name: string, message: string
|
|
128
|
-
endAction(name: string, message?: string
|
|
129
|
-
failAction(name: string, message?: string
|
|
130
|
-
successAction(name: string, message?: string
|
|
83
|
+
startAction(name: string, message: string): void;
|
|
84
|
+
endAction(name: string, message?: string): void;
|
|
85
|
+
failAction(name: string, message?: string): void;
|
|
86
|
+
successAction(name: string, message?: string): void;
|
|
131
87
|
/**
|
|
132
88
|
* One line for an action that ended, where a spinner cannot be drawn. The
|
|
133
89
|
* text comes from the action that started, so a caller that ends one without
|
|
@@ -138,16 +94,11 @@ export declare class CliService implements CliServiceInterface {
|
|
|
138
94
|
updateProgress(current: number, payload?: object): void;
|
|
139
95
|
stopProgress(): void;
|
|
140
96
|
table<T extends Record<string, unknown>>(data: T[], columns: CliTableColumns<T>): void;
|
|
141
|
-
write(message: string, buffered?: boolean
|
|
142
|
-
/**
|
|
143
|
-
* Flush what was buffered. Nothing is recorded here: each line was logged
|
|
144
|
-
* with its own level when it was buffered, and logging the joined block
|
|
145
|
-
* again would report a page of mixed warnings and successes as one `info`.
|
|
146
|
-
*/
|
|
97
|
+
write(message: string, buffered?: boolean): void;
|
|
147
98
|
writeBuffer(): void;
|
|
148
|
-
writeError(message: string, buffered?: boolean
|
|
149
|
-
writeSuccess(message: string, buffered?: boolean
|
|
150
|
-
writeWarning(message: string, buffered?: boolean
|
|
99
|
+
writeError(message: string, buffered?: boolean): void;
|
|
100
|
+
writeSuccess(message: string, buffered?: boolean): void;
|
|
101
|
+
writeWarning(message: string, buffered?: boolean): void;
|
|
151
102
|
execSync(command: string, options?: ExecSyncOptions): string;
|
|
152
103
|
private getFormattedMessage;
|
|
153
104
|
}
|
|
@@ -3,12 +3,9 @@ import { Chalk } from "chalk";
|
|
|
3
3
|
import Table from "tty-table";
|
|
4
4
|
import { Presets, SingleBar } from "cli-progress";
|
|
5
5
|
import Spinnies from "spinnies";
|
|
6
|
-
import { ConsoleSink } from "./sink.js";
|
|
7
6
|
import { safe } from "../../helpers/safe.js";
|
|
8
7
|
import { execSync } from "node:child_process";
|
|
9
8
|
import ApplicationError from "../error-handling/error/application-error.js";
|
|
10
|
-
/** How many table rows reach the log. A terminal table is never longer than this. */
|
|
11
|
-
const TABLE_ROWS = 100;
|
|
12
9
|
/** The padding and the gutter that a table draws inside every column. */
|
|
13
10
|
const CELL_OVERHEAD = 3;
|
|
14
11
|
/** The left margin and the outer borders of a table. */
|
|
@@ -46,38 +43,10 @@ function columnWidths(entries, rows) {
|
|
|
46
43
|
}
|
|
47
44
|
return widths;
|
|
48
45
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Construct Spinnies without letting it take SIGINT.
|
|
51
|
-
*
|
|
52
|
-
* Its constructor calls `bindSigint()` unconditionally, and that begins with
|
|
53
|
-
* `process.removeAllListeners("SIGINT")` before installing one that calls
|
|
54
|
-
* `process.exit(0)`. There is no option to turn it off. So a CLI that
|
|
55
|
-
* registered a SIGINT handler — `sk onboarding` does, before the browser
|
|
56
|
-
* launches — silently loses it the moment anything constructs a CliService,
|
|
57
|
-
* and its shutdown is replaced by a bare exit. That cost three test sessions to
|
|
58
|
-
* find, because every symptom pointed at the CLI's own handler being wrong.
|
|
59
|
-
*
|
|
60
|
-
* Registering later cannot help: `removeAllListeners` deletes whatever exists
|
|
61
|
-
* at that moment. So the listeners are snapshotted and put back, and spinnies'
|
|
62
|
-
* own is dropped. `rawListeners` rather than `listeners`, so a `once`
|
|
63
|
-
* registration goes back as a `once`.
|
|
64
|
-
*/
|
|
65
|
-
function createSpinners() {
|
|
66
|
-
const ours = process.rawListeners("SIGINT");
|
|
67
|
-
const spinners = new Spinnies();
|
|
68
|
-
for (const listener of process.rawListeners("SIGINT")) {
|
|
69
|
-
process.off("SIGINT", listener);
|
|
70
|
-
}
|
|
71
|
-
for (const listener of ours) {
|
|
72
|
-
process.on("SIGINT", listener);
|
|
73
|
-
}
|
|
74
|
-
return spinners;
|
|
75
|
-
}
|
|
76
46
|
export class CliService {
|
|
77
47
|
clipboard;
|
|
78
48
|
terminal;
|
|
79
49
|
quiet;
|
|
80
|
-
sink;
|
|
81
50
|
style;
|
|
82
51
|
buffer = [];
|
|
83
52
|
progressBar;
|
|
@@ -94,8 +63,6 @@ export class CliService {
|
|
|
94
63
|
animates;
|
|
95
64
|
/** The text of each running action, for the log line that replaces it. */
|
|
96
65
|
actions = new Map();
|
|
97
|
-
/** Where a structured copy of the output goes, once a run owns one. */
|
|
98
|
-
log;
|
|
99
66
|
/**
|
|
100
67
|
* True when this shell cannot be asked a question: CI, no TTY on either end,
|
|
101
68
|
* or SK_NON_INTERACTIVE. Callers that would otherwise block on a prompt check
|
|
@@ -105,138 +72,51 @@ export class CliService {
|
|
|
105
72
|
get nonInteractive() {
|
|
106
73
|
return this.terminal.nonInteractive;
|
|
107
74
|
}
|
|
108
|
-
constructor(clipboard, terminal, quiet = false
|
|
75
|
+
constructor(clipboard, terminal, quiet = false) {
|
|
109
76
|
this.clipboard = clipboard;
|
|
110
77
|
this.terminal = terminal;
|
|
111
78
|
this.quiet = quiet;
|
|
112
|
-
this.sink = sink;
|
|
113
79
|
this.animates = Boolean(!terminal.isCI && process.stderr && process.stderr.isTTY);
|
|
114
|
-
this.spinners =
|
|
80
|
+
this.spinners = new Spinnies();
|
|
115
81
|
this.style = new Chalk();
|
|
116
82
|
}
|
|
117
|
-
|
|
118
|
-
* Put the terminal back the way it was found.
|
|
119
|
-
*
|
|
120
|
-
* Spinnies hides the cursor while a spinner runs and shows it again only
|
|
121
|
-
* when the last one ends. A shutdown that happens mid-spinner would otherwise
|
|
122
|
-
* leave the user with an invisible cursor — which is what spinnies' own
|
|
123
|
-
* SIGINT handler existed to prevent, and that handler is gone for the reasons
|
|
124
|
-
* in {@link createSpinners}. Owning the cleanup is the price of owning the
|
|
125
|
-
* signal.
|
|
126
|
-
*/
|
|
127
|
-
restoreTerminal() {
|
|
128
|
-
if (this.animates) {
|
|
129
|
-
this.spinners.stopAll();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
attachLog(log) {
|
|
133
|
-
this.log = log;
|
|
134
|
-
}
|
|
135
|
-
logOnly(level, message, meta) {
|
|
136
|
-
this.record(level, message, meta);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Record one line, if a run is listening.
|
|
140
|
-
*
|
|
141
|
-
* Everything the CLI prints goes through here as well as through the sink,
|
|
142
|
-
* which is what makes the log a copy of the session rather than a second
|
|
143
|
-
* account of it. The level comes from the method that was called — a
|
|
144
|
-
* `writeWarning` is a `warn` — and a caller that knows better overrides it in
|
|
145
|
-
* `meta`.
|
|
146
|
-
*
|
|
147
|
-
* **Deliberately upstream of `quiet`.** A quiet run prints nothing and still
|
|
148
|
-
* happened; the log is not the terminal, and a `--quiet` session with an
|
|
149
|
-
* empty log would be the most misleading file in the directory.
|
|
150
|
-
*/
|
|
151
|
-
record(level, message, meta, extra) {
|
|
152
|
-
this.log?.event({
|
|
153
|
-
level: meta?.level ?? level,
|
|
154
|
-
scope: meta?.scope,
|
|
155
|
-
msg: message,
|
|
156
|
-
data: meta?.data,
|
|
157
|
-
...extra,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
code(code, buffered = false, meta) {
|
|
161
|
-
this.record("info", code, meta);
|
|
83
|
+
code(code, buffered = false) {
|
|
162
84
|
code = ` ${code} `;
|
|
163
85
|
if (buffered) {
|
|
164
86
|
this.buffer.push(this.style.bgBlack.white(code));
|
|
165
87
|
return;
|
|
166
88
|
}
|
|
167
|
-
|
|
89
|
+
console.log(this.style.bgBlack.white(code));
|
|
168
90
|
}
|
|
169
91
|
codeStyle(code) {
|
|
170
92
|
const padding = " ";
|
|
171
93
|
return this.style.bgGray.rgb(230, 126, 0)(`${padding}${code}${padding}`);
|
|
172
94
|
}
|
|
173
|
-
comment(message, buffered = false
|
|
174
|
-
this.record("info", message, meta);
|
|
95
|
+
comment(message, buffered = false) {
|
|
175
96
|
if (buffered) {
|
|
176
97
|
this.buffer.push(this.style.grey.italic(message));
|
|
177
98
|
return;
|
|
178
99
|
}
|
|
179
|
-
|
|
180
|
-
// same line a second time — once as a comment and once as a bare write.
|
|
181
|
-
this.sink.line(this.style.grey.italic(message));
|
|
100
|
+
this.write(this.style.grey.italic(message));
|
|
182
101
|
}
|
|
183
102
|
async confirm(message, defaultAnswer = true) {
|
|
184
103
|
if (this.quiet) {
|
|
185
|
-
this.answered("confirm", message, defaultAnswer, { defaulted: true });
|
|
186
104
|
return defaultAnswer;
|
|
187
105
|
}
|
|
188
|
-
|
|
189
|
-
const answer = await confirm({
|
|
106
|
+
return confirm({
|
|
190
107
|
default: defaultAnswer,
|
|
191
108
|
message: this.getFormattedMessage(message),
|
|
192
109
|
});
|
|
193
|
-
this.answered("confirm", message, answer);
|
|
194
|
-
return answer;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* A question that is now on screen, waiting.
|
|
198
|
-
*
|
|
199
|
-
* Logged before the answer exists, and again once it arrives, because an
|
|
200
|
-
* append-only file cannot go back and fill one in — and a run that died
|
|
201
|
-
* waiting at a prompt is exactly the run whose log has to show the question.
|
|
202
|
-
* The cost is two lines per prompt; the alternative is a log that ends in
|
|
203
|
-
* silence with no indication that anything was being asked.
|
|
204
|
-
*/
|
|
205
|
-
asked(kind, question) {
|
|
206
|
-
this.record("info", question, undefined, {
|
|
207
|
-
interaction: { kind, question, pending: true },
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
answered(kind, question, answer, options) {
|
|
211
|
-
this.record("info", question, undefined, {
|
|
212
|
-
interaction: {
|
|
213
|
-
kind,
|
|
214
|
-
question,
|
|
215
|
-
answer: options?.sensitive ? undefined : answer,
|
|
216
|
-
...options,
|
|
217
|
-
},
|
|
218
|
-
});
|
|
219
110
|
}
|
|
220
111
|
exit(code = 0) {
|
|
221
112
|
process.exit(code);
|
|
222
113
|
}
|
|
223
114
|
async prompt(message, options) {
|
|
224
|
-
// `sensitive` is declared here, by the caller collecting the value, and
|
|
225
|
-
// never inferred from the wording of the question. A redactor that guessed
|
|
226
|
-
// would eventually guess wrong in the direction that writes a password to
|
|
227
|
-
// disk, and this file is read by agents.
|
|
228
|
-
const sensitive = Boolean(options?.sensitive);
|
|
229
115
|
if (this.quiet) {
|
|
230
|
-
|
|
231
|
-
this.answered("prompt", message, defaulted, {
|
|
232
|
-
defaulted: true,
|
|
233
|
-
sensitive,
|
|
234
|
-
});
|
|
235
|
-
return defaulted;
|
|
116
|
+
return options?.defaultAnswer || "";
|
|
236
117
|
}
|
|
237
118
|
const { defaultAnswer, validator } = options;
|
|
238
|
-
|
|
239
|
-
const answer = await input({
|
|
119
|
+
return input({
|
|
240
120
|
default: defaultAnswer,
|
|
241
121
|
message: this.getFormattedMessage(message),
|
|
242
122
|
validate: (input) => {
|
|
@@ -249,37 +129,25 @@ export class CliService {
|
|
|
249
129
|
return this.style.red(`${errorMessage}. Please try again.`);
|
|
250
130
|
},
|
|
251
131
|
});
|
|
252
|
-
this.answered("prompt", message, answer, { sensitive });
|
|
253
|
-
return answer;
|
|
254
132
|
}
|
|
255
133
|
async select(message, choices, defaultValue) {
|
|
256
|
-
|
|
257
|
-
// `choices` is untyped here, so inquirer infers `unknown` for the answer;
|
|
258
|
-
// the signature has always promised a string and the callers rely on it.
|
|
259
|
-
const answer = (await select({
|
|
134
|
+
return select({
|
|
260
135
|
choices,
|
|
261
136
|
default: defaultValue,
|
|
262
137
|
message: this.getFormattedMessage(message),
|
|
263
|
-
})
|
|
264
|
-
this.answered("select", message, answer);
|
|
265
|
-
return answer;
|
|
138
|
+
});
|
|
266
139
|
}
|
|
267
140
|
async multiSelect(message, choices, validate) {
|
|
268
141
|
if (this.quiet) {
|
|
269
|
-
|
|
270
|
-
this.answered("multiSelect", message, defaulted, { defaulted: true });
|
|
271
|
-
return defaulted;
|
|
142
|
+
return choices.filter((c) => c.checked).map((c) => c.value);
|
|
272
143
|
}
|
|
273
|
-
|
|
274
|
-
const answer = await checkbox({
|
|
144
|
+
return checkbox({
|
|
275
145
|
choices,
|
|
276
146
|
message: this.getFormattedMessage(message),
|
|
277
147
|
validate: validate
|
|
278
148
|
? (chosen) => validate(chosen.map((choice) => choice.value))
|
|
279
149
|
: undefined,
|
|
280
150
|
});
|
|
281
|
-
this.answered("multiSelect", message, answer);
|
|
282
|
-
return answer;
|
|
283
151
|
}
|
|
284
152
|
/**
|
|
285
153
|
* Put text on the system clipboard.
|
|
@@ -305,12 +173,7 @@ export class CliService {
|
|
|
305
173
|
* for a terminal) or `note` (stderr, alongside a payload).
|
|
306
174
|
*/
|
|
307
175
|
pipe(data) {
|
|
308
|
-
|
|
309
|
-
// is routinely a whole SQL query or a config file — the log records that
|
|
310
|
-
// one was produced and how big it was, and the caller redirecting stdout
|
|
311
|
-
// already has the bytes.
|
|
312
|
-
this.record("debug", `payload written (${data.length} bytes)`);
|
|
313
|
-
this.sink.payload(data);
|
|
176
|
+
process.stdout.write(data);
|
|
314
177
|
}
|
|
315
178
|
/**
|
|
316
179
|
* A human-facing line that must stay out of the data channel.
|
|
@@ -319,15 +182,12 @@ export class CliService {
|
|
|
319
182
|
* being redirected — and so it can never corrupt the payload.
|
|
320
183
|
*/
|
|
321
184
|
note(message) {
|
|
322
|
-
|
|
185
|
+
process.stderr.write(`${message}\n`);
|
|
323
186
|
}
|
|
324
187
|
spacer() {
|
|
325
|
-
|
|
188
|
+
console.log("");
|
|
326
189
|
}
|
|
327
|
-
startAction(name, message
|
|
328
|
-
this.record("info", message, meta, {
|
|
329
|
-
action: { name, state: "start" },
|
|
330
|
-
});
|
|
190
|
+
startAction(name, message) {
|
|
331
191
|
if (this.quiet) {
|
|
332
192
|
return;
|
|
333
193
|
}
|
|
@@ -339,10 +199,7 @@ export class CliService {
|
|
|
339
199
|
}
|
|
340
200
|
this.spinners.add(name, { text: message });
|
|
341
201
|
}
|
|
342
|
-
endAction(name, message
|
|
343
|
-
this.record("info", message ?? this.actions.get(name) ?? name, meta, {
|
|
344
|
-
action: { name, state: "end" },
|
|
345
|
-
});
|
|
202
|
+
endAction(name, message) {
|
|
346
203
|
if (this.quiet) {
|
|
347
204
|
return;
|
|
348
205
|
}
|
|
@@ -355,10 +212,7 @@ export class CliService {
|
|
|
355
212
|
}
|
|
356
213
|
this.spinners.update(name, { status: "stopped", text: message });
|
|
357
214
|
}
|
|
358
|
-
failAction(name, message
|
|
359
|
-
this.record("error", message ?? this.actions.get(name) ?? name, meta, {
|
|
360
|
-
action: { name, state: "fail" },
|
|
361
|
-
});
|
|
215
|
+
failAction(name, message) {
|
|
362
216
|
if (this.quiet) {
|
|
363
217
|
return;
|
|
364
218
|
}
|
|
@@ -371,10 +225,7 @@ export class CliService {
|
|
|
371
225
|
}
|
|
372
226
|
this.spinners.fail(name, { text: message });
|
|
373
227
|
}
|
|
374
|
-
successAction(name, message
|
|
375
|
-
this.record("success", message ?? this.actions.get(name) ?? name, meta, {
|
|
376
|
-
action: { name, state: "success" },
|
|
377
|
-
});
|
|
228
|
+
successAction(name, message) {
|
|
378
229
|
if (this.quiet) {
|
|
379
230
|
return;
|
|
380
231
|
}
|
|
@@ -397,7 +248,7 @@ export class CliService {
|
|
|
397
248
|
if (!this.actions.delete(name) && !message) {
|
|
398
249
|
return;
|
|
399
250
|
}
|
|
400
|
-
|
|
251
|
+
console.log(`${symbol} ${text}`);
|
|
401
252
|
}
|
|
402
253
|
startProgress(total, start = 0, payload, config) {
|
|
403
254
|
if (this.quiet) {
|
|
@@ -419,12 +270,6 @@ export class CliService {
|
|
|
419
270
|
this.progressBar.stop();
|
|
420
271
|
}
|
|
421
272
|
table(data, columns) {
|
|
422
|
-
// The rows go in as data, not as the rendered grid: box-drawing characters
|
|
423
|
-
// and column padding are for a terminal, and anything reading the log wants
|
|
424
|
-
// the values. Capped, because a table is occasionally a whole url list.
|
|
425
|
-
this.record("info", `table of ${data.length} rows`, {
|
|
426
|
-
data: { columns: Object.keys(columns), rows: data.slice(0, TABLE_ROWS) },
|
|
427
|
-
});
|
|
428
273
|
this.spacer();
|
|
429
274
|
const entries = Object.entries(columns);
|
|
430
275
|
const rows = data.map((row) => entries.map(([key, col]) => String(col?.get ? col.get(row) : (row[key] ?? ""))));
|
|
@@ -437,50 +282,41 @@ export class CliService {
|
|
|
437
282
|
width: widths[index],
|
|
438
283
|
}));
|
|
439
284
|
const t = Table(header, rows, { compact: true });
|
|
440
|
-
|
|
285
|
+
console.log(t.render());
|
|
441
286
|
this.spacer();
|
|
442
287
|
}
|
|
443
|
-
write(message, buffered = false
|
|
444
|
-
this.record("info", message, meta);
|
|
288
|
+
write(message, buffered = false) {
|
|
445
289
|
if (buffered) {
|
|
446
290
|
this.buffer.push(this.style.white(message));
|
|
447
291
|
return;
|
|
448
292
|
}
|
|
449
|
-
|
|
293
|
+
console.log(message);
|
|
450
294
|
}
|
|
451
|
-
/**
|
|
452
|
-
* Flush what was buffered. Nothing is recorded here: each line was logged
|
|
453
|
-
* with its own level when it was buffered, and logging the joined block
|
|
454
|
-
* again would report a page of mixed warnings and successes as one `info`.
|
|
455
|
-
*/
|
|
456
295
|
writeBuffer() {
|
|
457
|
-
|
|
458
|
-
|
|
296
|
+
console.log(this.buffer.join(`\n`));
|
|
297
|
+
console.log();
|
|
459
298
|
this.buffer = [];
|
|
460
299
|
}
|
|
461
|
-
writeError(message, buffered = false
|
|
462
|
-
this.record("error", message, meta);
|
|
300
|
+
writeError(message, buffered = false) {
|
|
463
301
|
if (buffered) {
|
|
464
302
|
this.buffer.push(this.style.red(message));
|
|
465
303
|
return;
|
|
466
304
|
}
|
|
467
|
-
this.
|
|
305
|
+
this.write(this.style.red(message));
|
|
468
306
|
}
|
|
469
|
-
writeSuccess(message, buffered = false
|
|
470
|
-
this.record("success", message, meta);
|
|
307
|
+
writeSuccess(message, buffered = false) {
|
|
471
308
|
if (buffered) {
|
|
472
309
|
this.buffer.push(this.style.green(message));
|
|
473
310
|
return;
|
|
474
311
|
}
|
|
475
|
-
this.
|
|
312
|
+
this.write(this.style.green(message));
|
|
476
313
|
}
|
|
477
|
-
writeWarning(message, buffered = false
|
|
478
|
-
this.record("warn", message, meta);
|
|
314
|
+
writeWarning(message, buffered = false) {
|
|
479
315
|
if (buffered) {
|
|
480
316
|
this.buffer.push(this.style.yellow(message));
|
|
481
317
|
return;
|
|
482
318
|
}
|
|
483
|
-
this.
|
|
319
|
+
this.write(this.style.yellow(message));
|
|
484
320
|
}
|
|
485
321
|
execSync(command, options) {
|
|
486
322
|
const result = safe(() => {
|