@speedkit/cli 4.50.5 → 4.51.0-run-control.1

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