@speedkit/cli 4.50.4 → 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 (416) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1369 -10
  3. package/dist/base/run-control-command.d.ts +15 -0
  4. package/dist/base/run-control-command.js +20 -0
  5. package/dist/build-info.json +6 -0
  6. package/dist/commands/diff.d.ts +6 -1
  7. package/dist/commands/diff.js +9 -3
  8. package/dist/commands/onboarding/browser/click.d.ts +75 -0
  9. package/dist/commands/onboarding/browser/click.js +19 -0
  10. package/dist/commands/onboarding/browser/emulate.d.ts +93 -0
  11. package/dist/commands/onboarding/browser/emulate.js +23 -0
  12. package/dist/commands/onboarding/browser/navigate.d.ts +67 -0
  13. package/dist/commands/onboarding/browser/navigate.js +18 -0
  14. package/dist/commands/onboarding/browser/panel.d.ts +63 -0
  15. package/dist/commands/onboarding/browser/panel.js +12 -0
  16. package/dist/commands/onboarding/browser/reinstall-sw.d.ts +63 -0
  17. package/dist/commands/onboarding/browser/reinstall-sw.js +14 -0
  18. package/dist/commands/onboarding/browser/reset.d.ts +71 -0
  19. package/dist/commands/onboarding/browser/reset.js +18 -0
  20. package/dist/commands/onboarding/browser/screenshot.d.ts +77 -0
  21. package/dist/commands/onboarding/browser/screenshot.js +19 -0
  22. package/dist/commands/onboarding/browser/state.d.ts +63 -0
  23. package/dist/commands/onboarding/browser/state.js +12 -0
  24. package/dist/commands/onboarding/browser/tabs.d.ts +58 -0
  25. package/dist/commands/onboarding/browser/tabs.js +16 -0
  26. package/dist/commands/onboarding/cache/clear.d.ts +58 -0
  27. package/dist/commands/onboarding/cache/clear.js +12 -0
  28. package/dist/commands/onboarding/cache/errors.d.ts +58 -0
  29. package/dist/commands/onboarding/cache/errors.js +12 -0
  30. package/dist/commands/onboarding/cache/evict.d.ts +62 -0
  31. package/dist/commands/onboarding/cache/evict.js +15 -0
  32. package/dist/commands/onboarding/cache/get.d.ts +85 -0
  33. package/dist/commands/onboarding/cache/get.js +17 -0
  34. package/dist/commands/onboarding/cache/list.d.ts +58 -0
  35. package/dist/commands/onboarding/cache/list.js +15 -0
  36. package/dist/commands/onboarding/cache/prewarm.d.ts +73 -0
  37. package/dist/commands/onboarding/cache/prewarm.js +20 -0
  38. package/dist/commands/onboarding/cache/refresh.d.ts +62 -0
  39. package/dist/commands/onboarding/cache/refresh.js +18 -0
  40. package/dist/commands/onboarding/cdp.d.ts +81 -0
  41. package/dist/commands/onboarding/cdp.js +18 -0
  42. package/dist/commands/onboarding/debug/arm.d.ts +77 -0
  43. package/dist/commands/onboarding/debug/arm.js +18 -0
  44. package/dist/commands/onboarding/debug/await.d.ts +71 -0
  45. package/dist/commands/onboarding/debug/await.js +18 -0
  46. package/dist/commands/onboarding/debug/disarm.d.ts +63 -0
  47. package/dist/commands/onboarding/debug/disarm.js +12 -0
  48. package/dist/commands/onboarding/debug/eval.d.ts +75 -0
  49. package/dist/commands/onboarding/debug/eval.js +16 -0
  50. package/dist/commands/onboarding/debug/release.d.ts +63 -0
  51. package/dist/commands/onboarding/debug/release.js +12 -0
  52. package/dist/commands/onboarding/debug/resume.d.ts +63 -0
  53. package/dist/commands/onboarding/debug/resume.js +12 -0
  54. package/dist/commands/onboarding/debug/status.d.ts +63 -0
  55. package/dist/commands/onboarding/debug/status.js +12 -0
  56. package/dist/commands/onboarding/debug/step.d.ts +67 -0
  57. package/dist/commands/onboarding/debug/step.js +15 -0
  58. package/dist/commands/onboarding/files/list.d.ts +58 -0
  59. package/dist/commands/onboarding/files/list.js +12 -0
  60. package/dist/commands/onboarding/files/read.d.ts +73 -0
  61. package/dist/commands/onboarding/files/read.js +16 -0
  62. package/dist/commands/onboarding/files/rebuild.d.ts +63 -0
  63. package/dist/commands/onboarding/files/rebuild.js +18 -0
  64. package/dist/commands/onboarding/files/validate.d.ts +58 -0
  65. package/dist/commands/onboarding/files/validate.js +12 -0
  66. package/dist/commands/onboarding/fouc.d.ts +77 -0
  67. package/dist/commands/onboarding/fouc.js +16 -0
  68. package/dist/commands/onboarding/inject/add.d.ts +89 -0
  69. package/dist/commands/onboarding/inject/add.js +17 -0
  70. package/dist/commands/onboarding/inject/clear.d.ts +63 -0
  71. package/dist/commands/onboarding/inject/clear.js +12 -0
  72. package/dist/commands/onboarding/inject/list.d.ts +63 -0
  73. package/dist/commands/onboarding/inject/list.js +12 -0
  74. package/dist/commands/onboarding/inject/read.d.ts +75 -0
  75. package/dist/commands/onboarding/inject/read.js +18 -0
  76. package/dist/commands/onboarding/inject/recipes.d.ts +63 -0
  77. package/dist/commands/onboarding/inject/recipes.js +12 -0
  78. package/dist/commands/onboarding/inject/remove.d.ts +67 -0
  79. package/dist/commands/onboarding/inject/remove.js +15 -0
  80. package/dist/commands/onboarding/list.d.ts +13 -0
  81. package/dist/commands/onboarding/list.js +12 -0
  82. package/dist/commands/onboarding/logs.d.ts +41 -0
  83. package/dist/commands/onboarding/logs.js +256 -0
  84. package/dist/commands/onboarding/navwalk.d.ts +95 -0
  85. package/dist/commands/onboarding/navwalk.js +19 -0
  86. package/dist/commands/onboarding/response.d.ts +67 -0
  87. package/dist/commands/onboarding/response.js +18 -0
  88. package/dist/commands/onboarding/rum/beacons.d.ts +75 -0
  89. package/dist/commands/onboarding/rum/beacons.js +16 -0
  90. package/dist/commands/onboarding/rum/get.d.ts +77 -0
  91. package/dist/commands/onboarding/rum/get.js +18 -0
  92. package/dist/commands/onboarding/rum/key.d.ts +67 -0
  93. package/dist/commands/onboarding/rum/key.js +13 -0
  94. package/dist/commands/onboarding/rum/previous.d.ts +63 -0
  95. package/dist/commands/onboarding/rum/previous.js +12 -0
  96. package/dist/commands/onboarding/status.d.ts +13 -0
  97. package/dist/commands/onboarding/status.js +17 -0
  98. package/dist/commands/onboarding/todo.d.ts +58 -0
  99. package/dist/commands/onboarding/todo.js +12 -0
  100. package/dist/commands/onboarding/viewport.d.ts +101 -0
  101. package/dist/commands/onboarding/viewport.js +18 -0
  102. package/dist/commands/onboarding/watch.d.ts +93 -0
  103. package/dist/commands/onboarding/watch.js +16 -0
  104. package/dist/commands/onboarding.d.ts +26 -0
  105. package/dist/commands/onboarding.js +220 -3
  106. package/dist/commands/origin-request.d.ts +4 -0
  107. package/dist/commands/origin-request.js +4 -0
  108. package/dist/commands/spec/onboarding.spec.d.ts +1 -0
  109. package/dist/commands/spec/onboarding.spec.js +127 -0
  110. package/dist/services/cli/build-info.d.ts +33 -0
  111. package/dist/services/cli/build-info.js +63 -0
  112. package/dist/services/cli/cli-environment-factory.d.ts +3 -0
  113. package/dist/services/cli/cli-environment-factory.js +1 -0
  114. package/dist/services/cli/cli-service-build-context.d.ts +3 -0
  115. package/dist/services/cli/cli-service-factory.js +1 -1
  116. package/dist/services/cli/cli-service-model.d.ts +29 -10
  117. package/dist/services/cli/cli-service.d.ts +60 -11
  118. package/dist/services/cli/cli-service.js +196 -32
  119. package/dist/services/cli/index.d.ts +2 -0
  120. package/dist/services/cli/index.js +2 -0
  121. package/dist/services/cli/sink.d.ts +47 -0
  122. package/dist/services/cli/sink.js +31 -0
  123. package/dist/services/cli/spec/build-identity.spec.d.ts +1 -0
  124. package/dist/services/cli/spec/build-identity.spec.js +85 -0
  125. package/dist/services/cli/spec/build-info.spec.d.ts +1 -0
  126. package/dist/services/cli/spec/build-info.spec.js +10 -0
  127. package/dist/services/cli/spec/cli-service-log.spec.d.ts +1 -0
  128. package/dist/services/cli/spec/cli-service-log.spec.js +133 -0
  129. package/dist/services/cli/spec/cli-service.spec.js +113 -50
  130. package/dist/services/cli/spec/memory-cli.d.ts +9 -0
  131. package/dist/services/cli/spec/memory-cli.js +9 -0
  132. package/dist/services/diff/config-at-ref.d.ts +20 -0
  133. package/dist/services/diff/config-at-ref.js +33 -0
  134. package/dist/services/diff/diff-service-build-context.d.ts +8 -0
  135. package/dist/services/diff/diff-service-build-context.js +40 -1
  136. package/dist/services/diff/diff-service-factory.d.ts +2 -0
  137. package/dist/services/diff/diff-service-factory.js +48 -20
  138. package/dist/services/diff/diff-service.d.ts +11 -0
  139. package/dist/services/diff/diff-service.js +37 -11
  140. package/dist/services/diff/page-source.d.ts +12 -0
  141. package/dist/services/diff/page-source.js +16 -11
  142. package/dist/services/diff/sinks/tool-diff-sink.d.ts +3 -2
  143. package/dist/services/diff/sinks/tool-diff-sink.js +3 -2
  144. package/dist/services/diff/spec/config-at-ref.spec.d.ts +1 -0
  145. package/dist/services/diff/spec/config-at-ref.spec.js +46 -0
  146. package/dist/services/diff/spec/diff-service-build-context.spec.js +19 -0
  147. package/dist/services/diff/spec/diff-service.spec.js +95 -0
  148. package/dist/services/git/git-repository.d.ts +2 -0
  149. package/dist/services/git/git-repository.js +6 -0
  150. package/dist/services/integration-api/customer-config-flags.js +1 -0
  151. package/dist/services/onboarding/browser/baqend-response.d.ts +17 -1
  152. package/dist/services/onboarding/browser/baqend-response.js +23 -0
  153. package/dist/services/onboarding/browser/console-log.d.ts +9 -0
  154. package/dist/services/onboarding/browser/console-log.js +27 -0
  155. package/dist/services/onboarding/browser/executable/executable-validator.js +4 -2
  156. package/dist/services/onboarding/browser/extension/extension-bridge.js +5 -3
  157. package/dist/services/onboarding/browser/extension/extension-downloader.js +17 -8
  158. package/dist/services/onboarding/browser/extension/extension-validator.js +9 -4
  159. package/dist/services/onboarding/control/body-inspect.d.ts +24 -0
  160. package/dist/services/onboarding/control/body-inspect.js +106 -0
  161. package/dist/services/onboarding/control/browser-session.d.ts +521 -0
  162. package/dist/services/onboarding/control/browser-session.js +1273 -0
  163. package/dist/services/onboarding/control/config-validation.d.ts +17 -0
  164. package/dist/services/onboarding/control/config-validation.js +46 -0
  165. package/dist/services/onboarding/control/control-protocol.d.ts +1390 -0
  166. package/dist/services/onboarding/control/control-protocol.js +69 -0
  167. package/dist/services/onboarding/control/control-server.d.ts +284 -0
  168. package/dist/services/onboarding/control/control-server.js +1609 -0
  169. package/dist/services/onboarding/control/debug-session.d.ts +190 -0
  170. package/dist/services/onboarding/control/debug-session.js +801 -0
  171. package/dist/services/onboarding/control/fouc.d.ts +23 -0
  172. package/dist/services/onboarding/control/fouc.js +151 -0
  173. package/dist/services/onboarding/control/index.d.ts +4 -0
  174. package/dist/services/onboarding/control/index.js +4 -0
  175. package/dist/services/onboarding/control/navwalk.d.ts +65 -0
  176. package/dist/services/onboarding/control/navwalk.js +248 -0
  177. package/dist/services/onboarding/control/preload-registry.d.ts +150 -0
  178. package/dist/services/onboarding/control/preload-registry.js +829 -0
  179. package/dist/services/onboarding/control/response-explainer.d.ts +24 -0
  180. package/dist/services/onboarding/control/response-explainer.js +257 -0
  181. package/dist/services/onboarding/control/rum.d.ts +8 -0
  182. package/dist/services/onboarding/control/rum.js +220 -0
  183. package/dist/services/onboarding/control/service-worker-tracker.d.ts +68 -0
  184. package/dist/services/onboarding/control/service-worker-tracker.js +119 -0
  185. package/dist/services/onboarding/control/viewport.d.ts +45 -0
  186. package/dist/services/onboarding/control/viewport.js +344 -0
  187. package/dist/services/onboarding/control/watch.d.ts +26 -0
  188. package/dist/services/onboarding/control/watch.js +149 -0
  189. package/dist/services/onboarding/dashboard/diff-against-current-page.js +3 -1
  190. package/dist/services/onboarding/dashboard/index.js +7 -2
  191. package/dist/services/onboarding/fetch-event-handler.d.ts +24 -5
  192. package/dist/services/onboarding/fetch-event-handler.js +94 -32
  193. package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +4 -25
  194. package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +11 -2
  195. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +14 -0
  196. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +30 -0
  197. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +13 -0
  198. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +28 -1
  199. package/dist/services/onboarding/file-events/file-watcher.d.ts +42 -1
  200. package/dist/services/onboarding/file-events/file-watcher.js +117 -12
  201. package/dist/services/onboarding/html-charset.d.ts +28 -0
  202. package/dist/services/onboarding/html-charset.js +57 -0
  203. package/dist/services/onboarding/onboarding-model.d.ts +30 -1
  204. package/dist/services/onboarding/onboarding-model.js +10 -1
  205. package/dist/services/onboarding/onboarding-service-build-context.d.ts +4 -0
  206. package/dist/services/onboarding/onboarding-service-build-context.js +6 -0
  207. package/dist/services/onboarding/onboarding-service-factory.d.ts +17 -1
  208. package/dist/services/onboarding/onboarding-service-factory.js +131 -17
  209. package/dist/services/onboarding/onboarding-service.d.ts +40 -1
  210. package/dist/services/onboarding/onboarding-service.js +135 -22
  211. package/dist/services/onboarding/request-cache/asset-key.d.ts +61 -0
  212. package/dist/services/onboarding/request-cache/asset-key.js +115 -0
  213. package/dist/services/onboarding/request-cache/cache.d.ts +62 -5
  214. package/dist/services/onboarding/request-cache/cache.js +128 -17
  215. package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +1 -0
  216. package/dist/services/onboarding/spec/browser/console-log.spec.js +42 -0
  217. package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +1 -0
  218. package/dist/services/onboarding/spec/control/browser-session.spec.js +526 -0
  219. package/dist/services/onboarding/spec/control/control-server.spec.d.ts +1 -0
  220. package/dist/services/onboarding/spec/control/control-server.spec.js +338 -0
  221. package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +1 -0
  222. package/dist/services/onboarding/spec/control/debug-session.spec.js +693 -0
  223. package/dist/services/onboarding/spec/control/fakes.d.ts +31 -0
  224. package/dist/services/onboarding/spec/control/fakes.js +66 -0
  225. package/dist/services/onboarding/spec/control/fouc.spec.d.ts +1 -0
  226. package/dist/services/onboarding/spec/control/fouc.spec.js +167 -0
  227. package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +1 -0
  228. package/dist/services/onboarding/spec/control/navwalk.spec.js +222 -0
  229. package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +1 -0
  230. package/dist/services/onboarding/spec/control/preload-registry.spec.js +432 -0
  231. package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +1 -0
  232. package/dist/services/onboarding/spec/control/response-explainer.spec.js +324 -0
  233. package/dist/services/onboarding/spec/control/rum.spec.d.ts +1 -0
  234. package/dist/services/onboarding/spec/control/rum.spec.js +222 -0
  235. package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +1 -0
  236. package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +193 -0
  237. package/dist/services/onboarding/spec/control/viewport.spec.d.ts +1 -0
  238. package/dist/services/onboarding/spec/control/viewport.spec.js +200 -0
  239. package/dist/services/onboarding/spec/control/watch.spec.d.ts +1 -0
  240. package/dist/services/onboarding/spec/control/watch.spec.js +172 -0
  241. package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +1 -0
  242. package/dist/services/onboarding/spec/fetch-event-handler.spec.js +202 -0
  243. package/dist/services/onboarding/spec/fetch-events/customer-domain-document-response.spec.d.ts +1 -0
  244. package/dist/services/onboarding/spec/fetch-events/customer-domain-document-response.spec.js +39 -0
  245. package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +1 -0
  246. package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +41 -0
  247. package/dist/services/onboarding/spec/html-charset.spec.d.ts +1 -0
  248. package/dist/services/onboarding/spec/html-charset.spec.js +58 -0
  249. package/dist/services/onboarding/spec/onboarding-model.spec.js +37 -0
  250. package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +1 -0
  251. package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +1 -0
  252. package/dist/services/onboarding/spec/request-cache/cache.spec.js +107 -0
  253. package/dist/services/onboarding/spec/todo-collector.spec.d.ts +1 -0
  254. package/dist/services/onboarding/spec/todo-collector.spec.js +136 -0
  255. package/dist/services/onboarding/spec/virtual-orestes-app/index.spec.d.ts +1 -0
  256. package/dist/services/onboarding/spec/virtual-orestes-app/index.spec.js +19 -0
  257. package/dist/services/onboarding/todo-collector.d.ts +7 -2
  258. package/dist/services/onboarding/todo-collector.js +49 -12
  259. package/dist/services/onboarding/virtual-orestes-app/index.d.ts +34 -0
  260. package/dist/services/onboarding/virtual-orestes-app/index.js +85 -53
  261. package/dist/services/origin-request/asset-variations.d.ts +14 -0
  262. package/dist/services/origin-request/asset-variations.js +11 -4
  263. package/dist/services/origin-request/origin-fetcher.d.ts +7 -0
  264. package/dist/services/origin-request/origin-fetcher.js +43 -5
  265. package/dist/services/origin-request/origin-request-service-build-context.d.ts +17 -0
  266. package/dist/services/origin-request/origin-request-service-build-context.js +8 -0
  267. package/dist/services/origin-request/origin-request-service-factory.d.ts +0 -5
  268. package/dist/services/origin-request/origin-request-service-factory.js +2 -30
  269. package/dist/services/origin-request/origin-request-service.d.ts +121 -6
  270. package/dist/services/origin-request/origin-request-service.js +273 -49
  271. package/dist/services/origin-request/runtime-config-source.js +9 -4
  272. package/dist/services/origin-request/spec/asset-variations.spec.js +20 -0
  273. package/dist/services/origin-request/spec/origin-request-service.spec.js +329 -6
  274. package/dist/services/query-builder/rules/rule-match.d.ts +35 -0
  275. package/dist/services/query-builder/rules/rule-match.js +70 -0
  276. package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +1 -0
  277. package/dist/services/query-builder/spec/rules/rule-match.spec.js +121 -0
  278. package/dist/services/run-control/browser/run-browser-contexts.d.ts +541 -0
  279. package/dist/services/run-control/browser/run-browser-contexts.js +78 -0
  280. package/dist/services/run-control/browser/run-browser-service-factory.d.ts +5 -0
  281. package/dist/services/run-control/browser/run-browser-service-factory.js +7 -0
  282. package/dist/services/run-control/browser/run-browser-service.d.ts +64 -0
  283. package/dist/services/run-control/browser/run-browser-service.js +199 -0
  284. package/dist/services/run-control/cache/run-cache-contexts.d.ts +349 -0
  285. package/dist/services/run-control/cache/run-cache-contexts.js +51 -0
  286. package/dist/services/run-control/cache/run-cache-service-factory.d.ts +6 -0
  287. package/dist/services/run-control/cache/run-cache-service-factory.js +12 -0
  288. package/dist/services/run-control/cache/run-cache-service.d.ts +35 -0
  289. package/dist/services/run-control/cache/run-cache-service.js +151 -0
  290. package/dist/services/run-control/control-client.d.ts +36 -0
  291. package/dist/services/run-control/control-client.js +147 -0
  292. package/dist/services/run-control/debug/run-debug-contexts.d.ts +411 -0
  293. package/dist/services/run-control/debug/run-debug-contexts.js +44 -0
  294. package/dist/services/run-control/debug/run-debug-service-factory.d.ts +5 -0
  295. package/dist/services/run-control/debug/run-debug-service-factory.js +7 -0
  296. package/dist/services/run-control/debug/run-debug-service.d.ts +38 -0
  297. package/dist/services/run-control/debug/run-debug-service.js +161 -0
  298. package/dist/services/run-control/files/run-files-contexts.d.ts +238 -0
  299. package/dist/services/run-control/files/run-files-contexts.js +26 -0
  300. package/dist/services/run-control/files/run-files-service-factory.d.ts +5 -0
  301. package/dist/services/run-control/files/run-files-service-factory.js +7 -0
  302. package/dist/services/run-control/files/run-files-service.d.ts +29 -0
  303. package/dist/services/run-control/files/run-files-service.js +120 -0
  304. package/dist/services/run-control/index.d.ts +32 -0
  305. package/dist/services/run-control/index.js +31 -0
  306. package/dist/services/run-control/inject/run-inject-contexts.d.ts +319 -0
  307. package/dist/services/run-control/inject/run-inject-contexts.js +32 -0
  308. package/dist/services/run-control/inject/run-inject-service-factory.d.ts +5 -0
  309. package/dist/services/run-control/inject/run-inject-service-factory.js +7 -0
  310. package/dist/services/run-control/inject/run-inject-service.d.ts +31 -0
  311. package/dist/services/run-control/inject/run-inject-service.js +203 -0
  312. package/dist/services/run-control/live-run.d.ts +37 -0
  313. package/dist/services/run-control/live-run.js +56 -0
  314. package/dist/services/run-control/probe/run-probe-contexts.d.ts +333 -0
  315. package/dist/services/run-control/probe/run-probe-contexts.js +73 -0
  316. package/dist/services/run-control/probe/run-probe-service-factory.d.ts +5 -0
  317. package/dist/services/run-control/probe/run-probe-service-factory.js +7 -0
  318. package/dist/services/run-control/probe/run-probe-service.d.ts +54 -0
  319. package/dist/services/run-control/probe/run-probe-service.js +193 -0
  320. package/dist/services/run-control/rum/run-rum-contexts.d.ts +216 -0
  321. package/dist/services/run-control/rum/run-rum-contexts.js +34 -0
  322. package/dist/services/run-control/rum/run-rum-service-factory.d.ts +5 -0
  323. package/dist/services/run-control/rum/run-rum-service-factory.js +7 -0
  324. package/dist/services/run-control/rum/run-rum-service.d.ts +36 -0
  325. package/dist/services/run-control/rum/run-rum-service.js +122 -0
  326. package/dist/services/run-control/run-answer.d.ts +28 -0
  327. package/dist/services/run-control/run-answer.js +58 -0
  328. package/dist/services/run-control/run-control-context.d.ts +102 -0
  329. package/dist/services/run-control/run-control-context.js +36 -0
  330. package/dist/services/run-control/run-control-flags.d.ts +12 -0
  331. package/dist/services/run-control/run-control-flags.js +22 -0
  332. package/dist/services/run-control/run-control-model.d.ts +9 -0
  333. package/dist/services/run-control/run-control-model.js +1 -0
  334. package/dist/services/run-control/run-control-service-factory.d.ts +14 -0
  335. package/dist/services/run-control/run-control-service-factory.js +26 -0
  336. package/dist/services/run-control/session/run-session-contexts.d.ts +25 -0
  337. package/dist/services/run-control/session/run-session-contexts.js +20 -0
  338. package/dist/services/run-control/session/run-session-service-factory.d.ts +8 -0
  339. package/dist/services/run-control/session/run-session-service-factory.js +18 -0
  340. package/dist/services/run-control/session/run-session-service.d.ts +25 -0
  341. package/dist/services/run-control/session/run-session-service.js +95 -0
  342. package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +1 -0
  343. package/dist/services/run-control/spec/browser/run-browser-service.spec.js +327 -0
  344. package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +1 -0
  345. package/dist/services/run-control/spec/cache/run-cache-service.spec.js +454 -0
  346. package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +1 -0
  347. package/dist/services/run-control/spec/debug/run-debug-service.spec.js +113 -0
  348. package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +1 -0
  349. package/dist/services/run-control/spec/files/run-files-service.spec.js +234 -0
  350. package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +1 -0
  351. package/dist/services/run-control/spec/inject/run-inject-service.spec.js +224 -0
  352. package/dist/services/run-control/spec/live-run-fixture.d.ts +32 -0
  353. package/dist/services/run-control/spec/live-run-fixture.js +109 -0
  354. package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +1 -0
  355. package/dist/services/run-control/spec/probe/run-probe-service.spec.js +108 -0
  356. package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +1 -0
  357. package/dist/services/run-control/spec/rum/run-rum-service.spec.js +47 -0
  358. package/dist/services/run-control/spec/run-answer.spec.d.ts +1 -0
  359. package/dist/services/run-control/spec/run-answer.spec.js +57 -0
  360. package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +1 -0
  361. package/dist/services/run-control/spec/session/run-session-service.spec.js +101 -0
  362. package/dist/services/run-log/crash-mirror.d.ts +31 -0
  363. package/dist/services/run-log/crash-mirror.js +69 -0
  364. package/dist/services/run-log/index.d.ts +11 -0
  365. package/dist/services/run-log/index.js +11 -0
  366. package/dist/services/run-log/jsonl-appender.d.ts +46 -0
  367. package/dist/services/run-log/jsonl-appender.js +91 -0
  368. package/dist/services/run-log/log-event-model.d.ts +104 -0
  369. package/dist/services/run-log/log-event-model.js +56 -0
  370. package/dist/services/run-log/log-query-service-factory.d.ts +11 -0
  371. package/dist/services/run-log/log-query-service-factory.js +14 -0
  372. package/dist/services/run-log/log-query-service.d.ts +59 -0
  373. package/dist/services/run-log/log-query-service.js +111 -0
  374. package/dist/services/run-log/log-reader.d.ts +84 -0
  375. package/dist/services/run-log/log-reader.js +180 -0
  376. package/dist/services/run-log/log-summary.d.ts +72 -0
  377. package/dist/services/run-log/log-summary.js +208 -0
  378. package/dist/services/run-log/redaction.d.ts +34 -0
  379. package/dist/services/run-log/redaction.js +124 -0
  380. package/dist/services/run-log/request-log.d.ts +80 -0
  381. package/dist/services/run-log/request-log.js +69 -0
  382. package/dist/services/run-log/request-summary.d.ts +76 -0
  383. package/dist/services/run-log/request-summary.js +0 -0
  384. package/dist/services/run-log/run-log.d.ts +61 -0
  385. package/dist/services/run-log/run-log.js +102 -0
  386. package/dist/services/run-log/spec/log-query-service.spec.d.ts +1 -0
  387. package/dist/services/run-log/spec/log-query-service.spec.js +197 -0
  388. package/dist/services/run-log/spec/log-reader.spec.d.ts +1 -0
  389. package/dist/services/run-log/spec/log-reader.spec.js +109 -0
  390. package/dist/services/run-log/spec/log-summary.spec.d.ts +1 -0
  391. package/dist/services/run-log/spec/log-summary.spec.js +153 -0
  392. package/dist/services/run-log/spec/redaction.spec.d.ts +1 -0
  393. package/dist/services/run-log/spec/redaction.spec.js +61 -0
  394. package/dist/services/run-log/spec/request-log.spec.d.ts +1 -0
  395. package/dist/services/run-log/spec/request-log.spec.js +101 -0
  396. package/dist/services/run-log/spec/request-summary.spec.d.ts +1 -0
  397. package/dist/services/run-log/spec/request-summary.spec.js +171 -0
  398. package/dist/services/run-log/spec/run-log.spec.d.ts +1 -0
  399. package/dist/services/run-log/spec/run-log.spec.js +122 -0
  400. package/dist/services/run-registry/exit-classification.d.ts +39 -0
  401. package/dist/services/run-registry/exit-classification.js +42 -0
  402. package/dist/services/run-registry/index.d.ts +3 -0
  403. package/dist/services/run-registry/index.js +3 -0
  404. package/dist/services/run-registry/process-identity.d.ts +28 -0
  405. package/dist/services/run-registry/process-identity.js +80 -0
  406. package/dist/services/run-registry/run-registry-model.d.ts +128 -0
  407. package/dist/services/run-registry/run-registry-model.js +16 -0
  408. package/dist/services/run-registry/run-registry.d.ts +150 -0
  409. package/dist/services/run-registry/run-registry.js +409 -0
  410. package/dist/services/run-registry/spec/exit-classification.spec.d.ts +1 -0
  411. package/dist/services/run-registry/spec/exit-classification.spec.js +82 -0
  412. package/dist/services/run-registry/spec/run-registry.spec.d.ts +1 -0
  413. package/dist/services/run-registry/spec/run-registry.spec.js +509 -0
  414. package/dist/services/setup/os/tool-registry.js +2 -2
  415. package/oclif.manifest.json +3293 -272
  416. package/package.json +21 -3
@@ -0,0 +1,1390 @@
1
+ /**
2
+ * The seam between a live `sk onboarding` run and anything outside it.
3
+ *
4
+ * Both sides import this file. Same package, same build — so "keep these in
5
+ * lockstep" is a compiler guarantee rather than a comment, which is the one
6
+ * thing an IPC layer has to get right and the thing hand-kept copies never do.
7
+ *
8
+ * Deliberately small: newline-delimited JSON, one request and one answer per
9
+ * line, an id to match them. The clients are short-lived `sk onboarding <tool>`
10
+ * commands, and anything richer would be machinery they never use.
11
+ */
12
+ /** Bumped whenever a change would make an older peer misread a message. */
13
+ export declare const CONTROL_PROTOCOL_VERSION = 1;
14
+ /** Filename inside the run directory. Unix socket, mode 0600. */
15
+ export declare const CONTROL_SOCKET = "control.sock";
16
+ export type ControlRequest = ControlRequestBody & {
17
+ /**
18
+ * Which tab a page op acts on: its index in `browser.tabs`, or part of its
19
+ * url. Absent means the run's own page. Ops about the run rather than a page
20
+ * — the cache, the files — ignore it.
21
+ */
22
+ tab?: string;
23
+ };
24
+ type ControlRequestBody = {
25
+ id: string;
26
+ op: "hello";
27
+ version: number;
28
+ } | {
29
+ id: string;
30
+ op: "cache.list";
31
+ } | {
32
+ id: string;
33
+ op: "cache.prewarm";
34
+ /** Absolute, or relative to the origin the run is on. */
35
+ url: string;
36
+ /**
37
+ * Which variations to build. Empty or absent means the default alone.
38
+ *
39
+ * A list rather than one per call because the question is almost always
40
+ * comparative — mobile against desktop — and two round trips to build two
41
+ * halves of one comparison is two chances for the origin to answer
42
+ * differently in between.
43
+ */
44
+ variations?: string[];
45
+ /**
46
+ * Default, every variation the page has produced in this run, and every
47
+ * one the runtime config names. Wins over `variations`.
48
+ */
49
+ all?: boolean;
50
+ } | {
51
+ id: string;
52
+ op: "cache.get";
53
+ /** A cache key, or an origin url that identifies exactly one entry. */
54
+ key: string;
55
+ /** Only this variation's entries; `default` for the one without. */
56
+ variation?: string;
57
+ /** CSS selector to count and sample in the body. */
58
+ select?: string;
59
+ /** Regular expression to match against the body, line by line. */
60
+ grep?: string;
61
+ maxMatches?: number;
62
+ } | {
63
+ id: string;
64
+ op: "cache.clear";
65
+ } | {
66
+ id: string;
67
+ op: "cache.evict";
68
+ /**
69
+ * A cache key, or any substring of one.
70
+ *
71
+ * Substring, not exact — that is what `Cache.removeEntry` does and it
72
+ * surprises people, so the result names every key it actually removed
73
+ * rather than leaving the caller to assume it was the one they meant.
74
+ */
75
+ key: string;
76
+ } | {
77
+ id: string;
78
+ op: "cache.refresh";
79
+ /**
80
+ * Which entries to rebuild: a cache key, or an origin url. Absent
81
+ * refreshes every cached entry.
82
+ */
83
+ key?: string;
84
+ } | {
85
+ id: string;
86
+ op: "cache.errors";
87
+ } | {
88
+ id: string;
89
+ op: "rum.get";
90
+ /** Only these keys, when the whole object is more than you need. */
91
+ keys?: string[];
92
+ /** Force a send first. Completes the picture; ends the impression. */
93
+ flush?: boolean;
94
+ } | {
95
+ id: string;
96
+ op: "rum.key";
97
+ key: string;
98
+ } | {
99
+ id: string;
100
+ op: "rum.previous";
101
+ } | {
102
+ id: string;
103
+ op: "rum.beacons";
104
+ /** Only beacons after this sequence number: the cursor to follow by. */
105
+ sinceSeq?: number;
106
+ /** Only beacons carrying this field, anywhere in the payload. */
107
+ key?: string;
108
+ } | {
109
+ id: string;
110
+ op: "files.list";
111
+ } | {
112
+ id: string;
113
+ op: "files.read";
114
+ /** A logical name from INTEGRATION_FILES, e.g. `custom_documentHandler`. */
115
+ name: string;
116
+ grep?: string;
117
+ maxMatches?: number;
118
+ } | {
119
+ id: string;
120
+ op: "files.rebuild";
121
+ /**
122
+ * Which group to rebuild. Absent means `all`.
123
+ *
124
+ * Named after the watcher's own groups because those are the real units:
125
+ * a file change triggers one of them whole, and they have different blast
126
+ * radii. Asking for "the documentHandler" and getting the browser's
127
+ * Speed Kit caches cleared as well is not a surprise to hide — it is what
128
+ * the run does on every edit to those files, and a rebuild that did less
129
+ * would not be reproducing the thing being tested.
130
+ */
131
+ target?: RebuildTarget;
132
+ } | {
133
+ id: string;
134
+ op: "files.validate";
135
+ } | {
136
+ id: string;
137
+ op: "browser.state";
138
+ } | {
139
+ id: string;
140
+ op: "browser.reset";
141
+ /**
142
+ * How much to clear. `cache` is the one to reach for: a logged-in session
143
+ * is expensive to re-establish and a custom variation often needs one, so
144
+ * a full wipe to test a cache change costs more than it proves.
145
+ */
146
+ scope?: BrowserResetScope;
147
+ } | {
148
+ id: string;
149
+ op: "browser.reinstall-sw";
150
+ } | {
151
+ id: string;
152
+ op: "browser.navigate";
153
+ url: string;
154
+ } | {
155
+ id: string;
156
+ op: "browser.panel";
157
+ } | {
158
+ id: string;
159
+ op: "browser.emulate";
160
+ /** A device preset, or `off` to put the browser back as it was. */
161
+ device: EmulatedDevice | "off";
162
+ /** Overrides the preset's metrics. */
163
+ width?: number;
164
+ height?: number;
165
+ dpr?: number;
166
+ /**
167
+ * Load the page again under the emulation. Default true: a document
168
+ * already loaded was laid out, detected and served as the old device.
169
+ */
170
+ reload?: boolean;
171
+ } | {
172
+ id: string;
173
+ op: "browser.tabs";
174
+ } | {
175
+ id: string;
176
+ op: "browser.click";
177
+ /** A CSS selector. Exclusive with `text`. */
178
+ selector?: string;
179
+ /** The visible text, aria-label or value of a link or button. */
180
+ text?: string;
181
+ } | {
182
+ id: string;
183
+ op: "cdp";
184
+ /** A CDP method, e.g. `DOM.getDocument`. */
185
+ method: string;
186
+ params?: Record<string, unknown>;
187
+ } | {
188
+ id: string;
189
+ op: "browser.screenshot";
190
+ /** The whole page rather than the viewport. */
191
+ fullPage?: boolean;
192
+ /** Only this element. */
193
+ selector?: string;
194
+ } | {
195
+ id: string;
196
+ op: "todo.list";
197
+ } | {
198
+ id: string;
199
+ op: "response.explain";
200
+ /** Absolute, or relative to the customer origin. Defaults to the page. */
201
+ url?: string;
202
+ } | {
203
+ id: string;
204
+ op: "inject.recipes";
205
+ } | {
206
+ id: string;
207
+ op: "inject.add";
208
+ /** A name from `inject.recipes`. Mutually exclusive with `source`. */
209
+ recipe?: string;
210
+ /** The recipe's arguments, validated against its declared params. */
211
+ params?: Record<string, unknown>;
212
+ /** Raw JavaScript, run inside the envelope. Exclusive with `recipe`. */
213
+ source?: string;
214
+ /**
215
+ * Minutes until it removes itself. Absent means the default; `0` means
216
+ * never.
217
+ *
218
+ * A preload outlives the turn that added it, survives navigations and is
219
+ * invisible to the human watching the run — so the default is an expiry
220
+ * rather than forever, and a script that is still wanted can be added
221
+ * again. `0` is deliberately spellable: a sampler chasing an intermittent
222
+ * fault is the case where a surprise expiry destroys the evidence.
223
+ */
224
+ ttlMinutes?: number;
225
+ } | {
226
+ id: string;
227
+ op: "inject.list";
228
+ } | {
229
+ id: string;
230
+ op: "inject.read";
231
+ /** The preload id, as `inject.add` and `inject.list` report it. */
232
+ preload: string;
233
+ /** How many records to return, newest last. Default 100. */
234
+ limit?: number;
235
+ } | {
236
+ id: string;
237
+ op: "inject.remove";
238
+ preload: string;
239
+ } | {
240
+ id: string;
241
+ op: "inject.clear";
242
+ } | {
243
+ id: string;
244
+ op: "debug.arm";
245
+ /** Which of BP1–BP4. Absent or empty arms all four. */
246
+ bps?: number[];
247
+ /** What to do once armed, so one call is the whole setup. */
248
+ then?: DebugThen;
249
+ } | {
250
+ id: string;
251
+ op: "debug.disarm";
252
+ } | {
253
+ id: string;
254
+ op: "debug.release";
255
+ } | {
256
+ id: string;
257
+ op: "debug.status";
258
+ } | {
259
+ id: string;
260
+ op: "debug.await";
261
+ /** How long to wait for a pause. The op answers either way. */
262
+ timeoutMs?: number;
263
+ } | {
264
+ id: string;
265
+ op: "debug.resume";
266
+ } | {
267
+ id: string;
268
+ op: "debug.step";
269
+ kind: DebugStepKind;
270
+ } | {
271
+ id: string;
272
+ op: "debug.eval";
273
+ /**
274
+ * Evaluated on the paused call frame when the page is paused, and in the
275
+ * page otherwise. The distinction is the whole reason this op exists:
276
+ * a paused V8 never settles the promise `page.evaluate` waits on, and
277
+ * only the call-frame path can see the locals worth pausing for.
278
+ */
279
+ expression: string;
280
+ } | {
281
+ id: string;
282
+ op: "watch";
283
+ /** JavaScript expression, sampled in the page. */
284
+ expression: string;
285
+ intervalMs?: number;
286
+ durationMs?: number;
287
+ /** Reload first, so the timeline starts at t=0 of a fresh load. */
288
+ reload?: boolean;
289
+ /** Every sample rather than only the values that changed. */
290
+ full?: boolean;
291
+ } | {
292
+ id: string;
293
+ op: "navwalk";
294
+ /** A built-in trigger, or absent when `click` names one. */
295
+ flow?: NavwalkFlow;
296
+ /** CSS selector, or text to match against links and buttons. */
297
+ click?: string;
298
+ /** Navigate here first, so the walk starts from a known page. */
299
+ url?: string;
300
+ /** How long to collect after the trigger. */
301
+ waitMs?: number;
302
+ } | {
303
+ id: string;
304
+ op: "fouc";
305
+ /**
306
+ * An element whose styling decides whether the paint was styled.
307
+ * Absent samples the body's own background and the sheet count alone.
308
+ */
309
+ selector?: string;
310
+ durationMs?: number;
311
+ } | {
312
+ id: string;
313
+ op: "viewport";
314
+ min?: number;
315
+ max?: number;
316
+ /** Width increment for the coarse sweep, before pinning to the pixel. */
317
+ step?: number;
318
+ /** How long to let the page react to each resize. */
319
+ settleMs?: number;
320
+ height?: number;
321
+ /** Navigate here first, so the sweep is of a known page. */
322
+ url?: string;
323
+ };
324
+ export type NavwalkFlow = "login" | "checkout";
325
+ export interface NavwalkHit {
326
+ url: string;
327
+ /** The path alone, which is what a `disabledScopes` entry is written from. */
328
+ path: string;
329
+ /** Null when only the request was seen and no response came back. */
330
+ status: number | null;
331
+ /** Whether it happened in the main tab or in a popup the flow opened. */
332
+ target: "main" | "popup";
333
+ sameOrigin: boolean;
334
+ }
335
+ export interface NavwalkData {
336
+ host: string;
337
+ /** What the trigger matched and clicked, so a miss is readable. */
338
+ clicked: string;
339
+ flow: NavwalkFlow | null;
340
+ waitedMs: number;
341
+ /** The scope candidates. */
342
+ sameOrigin: NavwalkHit[];
343
+ /** Context only — a scope cannot be written for another origin. */
344
+ offOrigin: NavwalkHit[];
345
+ /**
346
+ * Prefixes worth considering, by path depth.
347
+ *
348
+ * The right one is the shortest that does not also catch a page that must
349
+ * stay accelerated, which is a judgement about the config rather than about
350
+ * this capture — so both depths are offered rather than one being chosen.
351
+ */
352
+ candidateScopes: {
353
+ depth1: string[];
354
+ depth2: string[];
355
+ };
356
+ /**
357
+ * Prefixes taken out of `candidateScopes` because they would also disable a
358
+ * page known to be accelerated, with that page — so a dropped one can still
359
+ * be weighed rather than silently missing.
360
+ */
361
+ droppedScopes: {
362
+ scope: string;
363
+ covers: string;
364
+ }[];
365
+ /** The page the walk started from. */
366
+ startedOn: string | null;
367
+ /** Where the flow left the tab, before the walk put it back. */
368
+ endedOn: string | null;
369
+ /** Whether the tab was put back on `startedOn`. */
370
+ returned: boolean;
371
+ }
372
+ export interface FoucSample {
373
+ t: number;
374
+ /** Stylesheets the document had applied at this instant. */
375
+ sheets: number;
376
+ /** Whether a contentful paint had happened. */
377
+ painted: boolean;
378
+ /** When it happened, on the same clock as `t`; null before it has. */
379
+ fcp?: number | null;
380
+ /**
381
+ * Stylesheets already in the document that had not loaded yet — the ones a
382
+ * paint at this instant went without. Those for another `media` are left
383
+ * out, since nothing waits for them. The first five.
384
+ */
385
+ pending?: string[];
386
+ pendingCount?: number;
387
+ /** The sampled element's background, or the body's when none was named. */
388
+ background: string | null;
389
+ /** Whether the sampled element existed yet. */
390
+ present: boolean;
391
+ }
392
+ export interface FoucData {
393
+ selector: string | null;
394
+ durationMs: number;
395
+ /** True when a contentful paint happened before the last sheet applied. */
396
+ unstyledPaint: boolean;
397
+ /** When the first contentful paint was observed, in ms from navigation. */
398
+ paintedAt: number | null;
399
+ /** When the stylesheet count stopped growing. */
400
+ settledAt: number | null;
401
+ /** Sheets at the paint, against sheets at the end. */
402
+ sheetsAtPaint: number | null;
403
+ sheetsFinal: number | null;
404
+ /**
405
+ * The stylesheets in the document at the first paint that had not loaded:
406
+ * what made it unstyled. Empty on a clean load.
407
+ */
408
+ pendingAtPaint: string[];
409
+ /**
410
+ * Sheets added after the first paint — a widget inserting its own, as
411
+ * LiveStory does. A paint cannot have waited for them, so they are reported
412
+ * rather than counted against it.
413
+ */
414
+ lateSheets: number | null;
415
+ /** The backgrounds seen, in order, so a flash is visible as a value change. */
416
+ backgrounds: {
417
+ t: number;
418
+ value: string | null;
419
+ }[];
420
+ samples: FoucSample[];
421
+ verdict: string;
422
+ }
423
+ export interface ViewportBreakpoint {
424
+ /** The exact width at which the page's JS changed the DOM. */
425
+ width: number;
426
+ /** Whether crossing back down reversed it. */
427
+ confirmed: boolean;
428
+ /** What changed, in the observer's own terms. The first eight. */
429
+ changed: string[];
430
+ /** How many keys changed, of which `changed` is the start. */
431
+ changedTotal: number;
432
+ /** A guess at what kind of change it is, when one is recognisable. */
433
+ hint: string | null;
434
+ }
435
+ export interface ViewportData {
436
+ min: number;
437
+ max: number;
438
+ step: number;
439
+ breakpoints: ViewportBreakpoint[];
440
+ /**
441
+ * Intervals that changed but were not pinned, because the sweep pins at most
442
+ * twelve. Empty on any page with real breakpoints rather than churn.
443
+ */
444
+ unpinned: {
445
+ from: number;
446
+ to: number;
447
+ }[];
448
+ /** Mutation keys that fire on their own, learned before the sweep. Capped. */
449
+ noise: string[];
450
+ /**
451
+ * Layout keys that changed at most coarse steps — the page following the
452
+ * width, like a slider's active class. Ignored as breakpoints. Capped.
453
+ */
454
+ fluid: string[];
455
+ /** Coarse steps where only inline style changed: fluid layout, not counted. */
456
+ styleOnlySteps: number;
457
+ /** How many coarse steps the sweep took, so `styleOnlySteps` reads as a share. */
458
+ steps: number;
459
+ /**
460
+ * Whether the page renders differently when *loaded* at each end.
461
+ *
462
+ * Frontend that reads the width once at mount and never re-renders shows no
463
+ * resize mutation at all, so the sweep cannot see it. This is the separate
464
+ * signal for that case, and it is a yes/no rather than a width.
465
+ */
466
+ bootOnlyBranching: boolean | null;
467
+ verdict: string;
468
+ }
469
+ /** What `debug.arm` does once the hooks are installed. */
470
+ export type DebugThen = "reload" | "next-nav" | "none";
471
+ export type DebugStepKind = "over" | "into" | "out";
472
+ /** One of the four anchors in Speed Kit's page lifecycle. */
473
+ export interface DebugBreakpointInfo {
474
+ bp: number;
475
+ /** The `performance.mark` the pause hangs off. */
476
+ mark: string;
477
+ description: string;
478
+ armed: boolean;
479
+ /**
480
+ * Whether this document emitted the mark at all.
481
+ *
482
+ * The field that tells "armed and legitimately skipped" from "never
483
+ * reached", which are the two readings of a silent breakpoint that call for
484
+ * opposite next moves.
485
+ */
486
+ seen: boolean;
487
+ /**
488
+ * Whether this breakpoint has already paused on the document loaded now.
489
+ *
490
+ * The difference between a hook that is missing and one that has done its
491
+ * job: both leave the mark written and nothing paused *right now*, and only
492
+ * this tells them apart.
493
+ */
494
+ fired: boolean;
495
+ /** Anchors on the SSR pass, so a document that was not pre-rendered has none. */
496
+ ssrOnly: boolean;
497
+ }
498
+ export interface DebugPausedState {
499
+ htmlClass: string | null;
500
+ skGroup: string | null;
501
+ marks: {
502
+ name: string;
503
+ t: number;
504
+ }[];
505
+ lastBp: string | null;
506
+ }
507
+ export interface DebugPause {
508
+ /** `BP1`–`BP4`, or `unknown` for a pause this run did not arm. */
509
+ bp: string;
510
+ reason: string;
511
+ /** The page's url, read off the paused frame's `location.href`. */
512
+ url: string | null;
513
+ /**
514
+ * The script {@link location} points into. `null` for the CLI's own wrapper,
515
+ * which is injected without a url — the page is in {@link url}, not here.
516
+ */
517
+ scriptUrl: string | null;
518
+ location?: {
519
+ lineNumber: number;
520
+ columnNumber?: number;
521
+ };
522
+ state: DebugPausedState;
523
+ at: string;
524
+ }
525
+ /**
526
+ * Where the page's JavaScript thread is.
527
+ *
528
+ * - `running` — it answers, and its microtasks run.
529
+ * - `paused` — it answers a plain evaluation but never settles a promise: the
530
+ * inspector serves CDP from a nested loop while V8 is stopped, and the
531
+ * microtask queue is frozen.
532
+ * - `unresponsive` — it answers nothing: busy, hung, or mid-navigation.
533
+ */
534
+ export type PageThreadState = "running" | "paused" | "unresponsive";
535
+ export interface DebugStatusData {
536
+ /** Whether `Debugger.enable` is held on the page right now. */
537
+ attached: boolean;
538
+ armed: number[];
539
+ /** Null when not {@link attached}: a pause is only seen by a session that holds the debugger. */
540
+ paused: boolean | null;
541
+ /** The pause the page is stopped in now — null once it resumed. */
542
+ pause: DebugPause | null;
543
+ /**
544
+ * Where the page's thread is, measured rather than remembered — it sees a
545
+ * pause this run did not cause and cannot hear about. Null without a page.
546
+ */
547
+ thread: PageThreadState | null;
548
+ /**
549
+ * Who holds the pause when there is one. `elsewhere` is DevTools: a switch
550
+ * lit in the devtools panel, or a breakpoint in the Sources panel.
551
+ */
552
+ pausedBy: "this-run" | "elsewhere" | null;
553
+ /**
554
+ * The devtools panel's breakpoint switches set in the page's sessionStorage,
555
+ * by storage key. The extension arms from these whoever wrote them, so a
556
+ * switch listed here pauses the next load with DevTools open even when
557
+ * {@link armed} is empty. Null when the page could not be read.
558
+ */
559
+ pageArmed: string[] | null;
560
+ breakpoints: DebugBreakpointInfo[];
561
+ /**
562
+ * Whether the document loaded now came from the SSR pass.
563
+ *
564
+ * Null when it could not be read. A heuristic, from the pre-rendered class
565
+ * and the shadow root — but the one that decides whether BP3 and BP4 had any
566
+ * chance of firing, which is otherwise indistinguishable from a broken arm.
567
+ */
568
+ prerendered: boolean | null;
569
+ /**
570
+ * How the document loaded: `navigate`, `reload`, `back_forward`, `prerender`.
571
+ * A reload matters here — Speed Kit's worker does not serve one the way it
572
+ * serves a navigation. Null when it could not be read.
573
+ */
574
+ navigationType: string | null;
575
+ /**
576
+ * Why the SSR comparison did not run, when the page said so.
577
+ *
578
+ * BP3 hangs off a mark Speed Kit writes only around a comparison that
579
+ * happened, so a skipped comparison leaves BP3 armed and silent. Without
580
+ * this, that silence reads as a broken hook.
581
+ */
582
+ changeDetectionSkipped: string | null;
583
+ }
584
+ export interface DebugAwaitData extends DebugStatusData {
585
+ fired: boolean;
586
+ timedOut: boolean;
587
+ waitedMs: number;
588
+ /** What the silence most likely means, when nothing fired. */
589
+ diagnosis?: string;
590
+ }
591
+ export interface DebugActionData {
592
+ paused: boolean;
593
+ did: string;
594
+ }
595
+ export interface DebugReleaseData {
596
+ /** What this run had armed and disarmed on the way. */
597
+ disarmed: number[];
598
+ /** The panel switches cleared from the page's sessionStorage, by storage key. */
599
+ cleared: string[];
600
+ /** Whether a pause held elsewhere was resumed. */
601
+ resumedForeignPause: boolean;
602
+ /** Where the thread is after the release — `paused` means it stopped again. */
603
+ thread: PageThreadState | null;
604
+ did: string;
605
+ }
606
+ export interface DebugEvalData {
607
+ /**
608
+ * Whether it ran on the paused call frame.
609
+ *
610
+ * False means the page was not paused and it ran as an ordinary evaluation,
611
+ * which sees globals but none of the locals a pause exists to inspect.
612
+ */
613
+ onCallFrame: boolean;
614
+ value: unknown;
615
+ /** The exception text, verbatim. Never swallowed, never reworded. */
616
+ exception?: string;
617
+ }
618
+ export interface WatchSample {
619
+ t: number;
620
+ v?: unknown;
621
+ /** The expression threw on this tick. */
622
+ error?: string;
623
+ }
624
+ export interface WatchMessage {
625
+ t: number;
626
+ level: string;
627
+ text: string;
628
+ }
629
+ export interface WatchData {
630
+ expression: string;
631
+ intervalMs: number;
632
+ durationMs: number;
633
+ reloaded: boolean;
634
+ /** Collapsed to the ticks where the value changed, unless `full`. */
635
+ mode: "transitions" | "full";
636
+ samples: WatchSample[];
637
+ /** Every tick taken, before collapsing. */
638
+ totalSamples: number;
639
+ /** Ticks the page buffer refused, so a gap in the timeline is visible. */
640
+ dropped: number;
641
+ console: WatchMessage[];
642
+ exceptions: WatchMessage[];
643
+ truncated: boolean;
644
+ }
645
+ /** One argument a recipe takes. */
646
+ export interface InjectRecipeParam {
647
+ name: string;
648
+ required: boolean;
649
+ description: string;
650
+ /** Rendered as a literal, so the default is what the source will carry. */
651
+ default?: string | number;
652
+ /**
653
+ * Whether the value is inlined as JavaScript rather than as a literal.
654
+ *
655
+ * True for exactly one param today — `sample`'s expression — and it is the
656
+ * one place a recipe is as sharp as raw source. Named on the wire so a caller
657
+ * knows which of its arguments it is about to have evaluated in the page.
658
+ */
659
+ code?: boolean;
660
+ }
661
+ export interface InjectRecipeInfo {
662
+ name: string;
663
+ summary: string;
664
+ params: InjectRecipeParam[];
665
+ /** What it puts in the buffer `inject.read` drains. */
666
+ observes: string;
667
+ /**
668
+ * Whether it only bites from the next navigation.
669
+ *
670
+ * Every preload runs before the page's own scripts, which is the whole point
671
+ * — so anything that wraps a seam the page has already passed needs a reload
672
+ * to mean anything, and a caller that reads an empty buffer without knowing
673
+ * that will conclude the seam is never reached.
674
+ */
675
+ needsReload: boolean;
676
+ }
677
+ export interface InjectRecipesData {
678
+ recipes: InjectRecipeInfo[];
679
+ }
680
+ export interface InjectEntry {
681
+ /** `p1`, `p2` …: what `read` and `remove` take. */
682
+ id: string;
683
+ /** The recipe's name, or `raw`. */
684
+ origin: string;
685
+ addedAt: string;
686
+ /** Null when it was added with `ttlMinutes: 0`. */
687
+ expiresAt: string | null;
688
+ /** Content hash of the wrapped source, so two adds of one script match. */
689
+ sourceSha: string;
690
+ bytes: number;
691
+ needsReload: boolean;
692
+ /**
693
+ * Whether it has actually run in the document that is loaded now.
694
+ *
695
+ * False on a preload added since the last navigation — it is registered and
696
+ * will run next time. Read off the page rather than assumed, because
697
+ * "registered" and "running" are different states and only one of them
698
+ * produces records.
699
+ */
700
+ active: boolean;
701
+ /** Records buffered in the current document; null when nothing has run it. */
702
+ buffered: number | null;
703
+ /** Set when the script threw while installing itself. */
704
+ error?: string;
705
+ /**
706
+ * Whether another tool owns this one.
707
+ *
708
+ * `sk onboarding debug` installs its pause hooks the same way an injected script is
709
+ * installed, so listing them here is what keeps "what is running in this
710
+ * page" a complete answer. They do not count against the limit and `clear`
711
+ * leaves them alone — disarming a debugger as a side effect of tidying up
712
+ * preloads is not something anyone would ask for.
713
+ */
714
+ reserved?: boolean;
715
+ }
716
+ export interface InjectListData {
717
+ preloads: InjectEntry[];
718
+ /** Removed by their TTL since the last call, so an absence is explained. */
719
+ expired: string[];
720
+ /** How many may be registered at once. */
721
+ limit: number;
722
+ }
723
+ export interface InjectAddData {
724
+ preload: InjectEntry;
725
+ /** The recipe that produced it, absent for raw source. */
726
+ recipe?: string;
727
+ expired: string[];
728
+ }
729
+ /** One RUM beacon as it left the page, before Speed Kit merged it. */
730
+ export interface RumBeacon {
731
+ seq: number;
732
+ /** ISO, when the run intercepted it. */
733
+ at: string;
734
+ /** The beacon request's url. */
735
+ url: string;
736
+ bytes: number;
737
+ /** The payload, parsed; null when it was not JSON. */
738
+ data: Record<string, unknown> | null;
739
+ }
740
+ export interface RumBeaconsData {
741
+ beacons: (RumBeacon & {
742
+ /** With `key`: where in this beacon it was, and what it said. */
743
+ matches?: {
744
+ path: string;
745
+ value: unknown;
746
+ }[];
747
+ })[];
748
+ /** The newest beacon's sequence number: pass it back as `sinceSeq`. */
749
+ lastSeq: number;
750
+ /** How many the run keeps; older ones are gone. */
751
+ kept: number;
752
+ }
753
+ /** One thing a preload recorded. */
754
+ export interface InjectRecord {
755
+ /** ms on the page's clock. */
756
+ t: number;
757
+ v: unknown;
758
+ /**
759
+ * The page load it came from: the document's time origin, with `.n` for the
760
+ * n-th single-page-app navigation or back/forward restore within it.
761
+ */
762
+ load?: string;
763
+ /** The page's url when it was recorded. */
764
+ url?: string;
765
+ }
766
+ export interface InjectReadData {
767
+ preload: string;
768
+ origin: string;
769
+ /** Null when this document has never run the script — see `active`. */
770
+ records: InjectRecord[] | null;
771
+ active: boolean;
772
+ total: number;
773
+ truncated: boolean;
774
+ /**
775
+ * Records the page buffer refused because it was full.
776
+ *
777
+ * The buffer is bounded in the page, so a sampler left running does not grow
778
+ * a tab until it dies. A non-zero count means the timeline has a hole in it
779
+ * rather than merely being long.
780
+ */
781
+ dropped: number;
782
+ /** Set when the script threw while installing itself. */
783
+ error?: string;
784
+ }
785
+ export interface InjectRemoveData {
786
+ removed: string[];
787
+ remaining: number;
788
+ /**
789
+ * Whether the document that is loaded now was also told to stop.
790
+ *
791
+ * Unregistering stops the *next* navigation; the copy already running in this
792
+ * document is switched off through the page. With no page there is nothing
793
+ * running, so false here is not a failure — but on a live page it would mean
794
+ * a spy that keeps recording after it was removed.
795
+ */
796
+ stoppedInPage: boolean;
797
+ }
798
+ /** `cache` clears the caches; `all` also takes cookies and every other store. */
799
+ export type BrowserResetScope = "cache" | "all";
800
+ /**
801
+ * Which of the run's rebuild groups to trigger.
802
+ *
803
+ * `install` is what a change to `config_SpeedKit`, `config_loadHandler`,
804
+ * `custom_loader` or `custom_sw` does; `documentHandler` is what a change to
805
+ * `config_dynamicBlocks`, `config_documentHandler`, `custom_dynamicFetcher` or
806
+ * `custom_documentHandler` does. `all` does both, install last, which is the
807
+ * order a run would reach them in.
808
+ */
809
+ export type RebuildTarget = "install" | "documentHandler" | "all";
810
+ export type ControlOp = ControlRequest["op"];
811
+ /**
812
+ * A request without its correlation id, for a caller that lets the client
813
+ * allocate one. Distributive on purpose: a plain `Omit<ControlRequest, "id">`
814
+ * collapses the union to the fields every member shares, which drops `version`
815
+ * off `hello`.
816
+ */
817
+ export type ControlCommand = ControlRequest extends infer R ? R extends {
818
+ id: string;
819
+ } ? Omit<R, "id"> : never : never;
820
+ export interface ControlError {
821
+ code: string;
822
+ message: string;
823
+ /** Whatever the caller needs to act — the versions that exist, the op to use. */
824
+ [key: string]: unknown;
825
+ }
826
+ /**
827
+ * `status` rather than an `ok` boolean, and not by taste: this repo compiles
828
+ * with `strict: false`, and without `strictNullChecks` TypeScript does not use
829
+ * boolean literals as discriminants — `if (response.ok)` leaves the union
830
+ * un-narrowed and every field access after it fails to compile. A string
831
+ * discriminant narrows regardless, and reads better on the wire besides.
832
+ */
833
+ export type ControlResponse<T = unknown> = {
834
+ id: string;
835
+ status: "ok";
836
+ generation: number;
837
+ data: T;
838
+ } | {
839
+ id: string;
840
+ status: "error";
841
+ generation: number;
842
+ error: ControlError;
843
+ };
844
+ /**
845
+ * A counter the run bumps on every mutating op.
846
+ *
847
+ * Carried on every response, including errors, so a reader can tell that a
848
+ * measurement it took earlier predates its own `rebuild` — which is otherwise a
849
+ * silent source of confident wrong conclusions.
850
+ */
851
+ export type Generation = number;
852
+ export interface HelloData {
853
+ /** Cross-checked against meta.json: a socket that answers is not proof. */
854
+ pid: number;
855
+ runId: string;
856
+ version: number;
857
+ }
858
+ export interface CacheEntry {
859
+ /** The raw cache key, for ops that take one. */
860
+ key: string;
861
+ originUrl: string;
862
+ variation: string | null;
863
+ status: number;
864
+ contentType: string | null;
865
+ bytes: number;
866
+ }
867
+ export interface CacheListData {
868
+ entries: CacheEntry[];
869
+ }
870
+ export interface SelectResult {
871
+ selector: string;
872
+ count: number;
873
+ /** Up to `maxMatches` of them, each clamped. */
874
+ matches: string[];
875
+ truncated: boolean;
876
+ /** Set when the selector itself was not valid. */
877
+ error?: string;
878
+ }
879
+ export interface GrepResult {
880
+ pattern: string;
881
+ count: number;
882
+ matches: {
883
+ line: number;
884
+ text: string;
885
+ }[];
886
+ truncated: boolean;
887
+ error?: string;
888
+ }
889
+ export interface CacheGetData extends CacheEntry {
890
+ /**
891
+ * Where the body was written, inside the run directory.
892
+ *
893
+ * The body is **never** sent back inline. Cached HTML runs to megabytes, and
894
+ * one unguarded read would cost more context than every other answer in a
895
+ * session put together. A path can be opened by whoever actually needs the
896
+ * bytes; `select` and `grep` answer the question without anyone needing them.
897
+ */
898
+ bodyPath: string;
899
+ /** Content hash, so two reads of the same body are recognisably the same. */
900
+ bodySha: string;
901
+ select?: SelectResult;
902
+ grep?: GrepResult;
903
+ }
904
+ export interface CachePrewarmEntry extends CacheEntry {
905
+ bodyPath: string;
906
+ bodySha: string;
907
+ /** False when it was already cached and this call left it alone. */
908
+ built: boolean;
909
+ }
910
+ /** A variation that could not be built, and why. Never fails the whole call. */
911
+ export interface CachePrewarmFailure {
912
+ variation: string;
913
+ error: string;
914
+ }
915
+ export interface CachePrewarmData {
916
+ /** The url as resolved, so a relative one says what it became. */
917
+ url: string;
918
+ entries: CachePrewarmEntry[];
919
+ failed: CachePrewarmFailure[];
920
+ }
921
+ export interface CacheClearData {
922
+ /** How many entries went. Zero is a real and common answer. */
923
+ cleared: number;
924
+ }
925
+ export interface CacheEvictData {
926
+ /** What was asked for, so the substring match is readable against it. */
927
+ key: string;
928
+ /** Every key that actually went — see the substring note on the request. */
929
+ removed: string[];
930
+ /** What is left, so "did that take more than I meant" is answerable. */
931
+ remaining: number;
932
+ }
933
+ export interface CacheRefreshEntry {
934
+ key: string;
935
+ originUrl: string;
936
+ variation: string | null;
937
+ bodySha: string;
938
+ bodyPath: string;
939
+ /**
940
+ * Whether the origin answered with something different this time.
941
+ *
942
+ * The question this op exists for. It is a comparison of the content hash
943
+ * before and after, so it is an answer about the bytes rather than about
944
+ * headers or timing.
945
+ */
946
+ changed: boolean;
947
+ /** The hash it replaced, present only when it changed. */
948
+ previousSha?: string;
949
+ bytes: number;
950
+ status: number;
951
+ }
952
+ export interface CacheRefreshData {
953
+ entries: CacheRefreshEntry[];
954
+ /** Entries whose rebuild threw, named rather than silently dropped. */
955
+ failed: CachePrewarmFailure[];
956
+ /** How many of `entries` came back with different bytes. */
957
+ changed: number;
958
+ }
959
+ /**
960
+ * A url and variation the local documentHandler could not build.
961
+ *
962
+ * Already collected by the run and already shipped to the devtools panel; this
963
+ * is the same list, for a reader that has no panel. An entry disappears when
964
+ * the same url and variation later builds, so the list is the state now, not a
965
+ * history.
966
+ */
967
+ export interface LocalCacheErrorEntry {
968
+ url: string;
969
+ assetUrl: string;
970
+ variation: string;
971
+ error: string;
972
+ stack: string | null;
973
+ /** ISO, converted from the epoch milliseconds the run stores. */
974
+ occurredAt: string;
975
+ }
976
+ export interface CacheErrorsData {
977
+ errors: LocalCacheErrorEntry[];
978
+ }
979
+ export interface FileEntry {
980
+ /** The logical name, which is how every other op refers to it. */
981
+ name: string;
982
+ /** FILE_TYPE — config, install, module, server, virtual, readonly, customer. */
983
+ type: string;
984
+ /** Absent for a virtual file, which has none. */
985
+ path?: string;
986
+ /**
987
+ * A virtual file exists only in memory until something builds it — and the
988
+ * onboarding watcher skips it, so "I edited it and nothing happened" has a
989
+ * legitimate cause worth seeing here.
990
+ */
991
+ virtual: boolean;
992
+ bytes: number;
993
+ /** Whether the run has written changes to it since it was loaded. */
994
+ updated?: boolean;
995
+ }
996
+ export interface FileListData {
997
+ files: FileEntry[];
998
+ }
999
+ /** One rebuild group's effects, in the words the run itself uses for them. */
1000
+ export interface RebuildStep {
1001
+ target: Exclude<RebuildTarget, "all">;
1002
+ /**
1003
+ * What was rebuilt and what that invalidated.
1004
+ *
1005
+ * Spelled out because the blast radius is the part a caller cannot infer and
1006
+ * the part that decides whether their previous measurements still stand. A
1007
+ * rebuild that silently cleared the dh-cache turns the next comparison into
1008
+ * one against a cold cache without anyone noticing.
1009
+ */
1010
+ did: string[];
1011
+ /** Set when the group could not run — no page, nothing to build. */
1012
+ skipped?: string;
1013
+ }
1014
+ export interface FileRebuildData {
1015
+ target: RebuildTarget;
1016
+ steps: RebuildStep[];
1017
+ /**
1018
+ * Whether the dh-cache was emptied as part of this.
1019
+ *
1020
+ * The single fact most likely to invalidate a measurement taken before the
1021
+ * call, so it is lifted out of the prose rather than left to be read out of
1022
+ * it.
1023
+ */
1024
+ cacheCleared: boolean;
1025
+ /** Whether the service worker will be reinstalled on the next navigation. */
1026
+ reinstallsServiceWorker: boolean;
1027
+ }
1028
+ export interface ValidationProblem {
1029
+ validator: "customerConfig" | "mandatoryFiles";
1030
+ message: string;
1031
+ /** The error's own code, where it carries one. */
1032
+ code?: string;
1033
+ /** What the error itself proposes doing about it. */
1034
+ suggestions?: string[];
1035
+ }
1036
+ export interface FileValidateData {
1037
+ valid: boolean;
1038
+ problems: ValidationProblem[];
1039
+ /**
1040
+ * Both validators stop at their first problem.
1041
+ *
1042
+ * So a clean pass is a genuine all-clear, while a failure is "at least this"
1043
+ * — fixing the named problem and asking again may well produce another. Said
1044
+ * on the wire because the asymmetry is invisible otherwise, and a caller that
1045
+ * reads one problem as the whole list will report a config as one fix away
1046
+ * when it is not.
1047
+ */
1048
+ firstProblemPerValidator: true;
1049
+ }
1050
+ export interface FileReadData extends FileEntry {
1051
+ /** Written to the run directory, never returned inline. See CacheGetData. */
1052
+ bodyPath: string;
1053
+ bodySha: string;
1054
+ grep?: GrepResult;
1055
+ }
1056
+ /**
1057
+ * Which of Speed Kit's globals the page actually had, as the presence probe
1058
+ * measured them.
1059
+ *
1060
+ * Reported rather than collapsed into a sentence. The probe reads five things
1061
+ * and the reason string can only ever describe one of them, so a caller that
1062
+ * wants to tell "not there at all" from "there but half-built" reads this.
1063
+ */
1064
+ export interface RumGlobals {
1065
+ /** `window.SpeedKit` exists. */
1066
+ present: boolean;
1067
+ /** `SpeedKit.getTrackedData` is callable — what a whole-object read needs. */
1068
+ trackedData: boolean;
1069
+ rumController: boolean;
1070
+ /** `rumController.currentRumImpression` exists. */
1071
+ impression: boolean;
1072
+ /** `currentRumImpression.getDataByKey` is callable. */
1073
+ dataByKey: boolean;
1074
+ }
1075
+ export interface RumData {
1076
+ /** False when Speed Kit's globals are not on the page — with a reason. */
1077
+ available: boolean;
1078
+ reason?: string;
1079
+ /**
1080
+ * What the presence probe saw, on an unavailable answer.
1081
+ *
1082
+ * The reason names the likeliest cause; this is the measurement it was
1083
+ * derived from, so a caller never has to take the prose on trust.
1084
+ */
1085
+ globals?: RumGlobals;
1086
+ /**
1087
+ * Whether a send was forced before reading.
1088
+ *
1089
+ * Always reported, because `getTrackedData` returns sent data only. Without
1090
+ * this a caller cannot tell "nothing was tracked" from "it has not been sent
1091
+ * yet", and those look identical while meaning opposite things.
1092
+ */
1093
+ flushed: boolean;
1094
+ url: string | null;
1095
+ data?: Record<string, unknown> | null;
1096
+ keys?: string[];
1097
+ /**
1098
+ * Requested keys that the tracked object does not carry.
1099
+ *
1100
+ * Present only when `keys` was given and something in it was missing. Those
1101
+ * keys are still in `data`, set to null — this names them so a caller does
1102
+ * not have to diff its own request against the answer to find out.
1103
+ */
1104
+ notTracked?: string[];
1105
+ /** Set for a single-key read. */
1106
+ key?: string;
1107
+ value?: unknown;
1108
+ /** Single-key reads see unsent data; whole-object reads do not. */
1109
+ mergesUnsent?: boolean;
1110
+ /**
1111
+ * Set when the previous impression was asked for.
1112
+ *
1113
+ * Named for the question, not the answer: whether one *exists* is `data`
1114
+ * being non-null. `previous: true` with `data: null` reads like a
1115
+ * contradiction otherwise.
1116
+ */
1117
+ ofPreviousImpression?: boolean;
1118
+ }
1119
+ export interface ServiceWorkerRegistrationInfo {
1120
+ registrationId: string;
1121
+ scopeURL: string;
1122
+ /** Kept after deletion: "there was one and it is gone" is a real answer. */
1123
+ deleted: boolean;
1124
+ }
1125
+ export interface ServiceWorkerVersionInfo {
1126
+ versionId: string;
1127
+ registrationId: string;
1128
+ scriptURL: string;
1129
+ /** installing, installed, activating, activated, redundant. */
1130
+ status: string;
1131
+ runningStatus: string;
1132
+ /** Set when the run decided this version was the deployed one taking over. */
1133
+ foreign?: boolean;
1134
+ }
1135
+ export interface ServiceWorkerState {
1136
+ registrations: ServiceWorkerRegistrationInfo[];
1137
+ versions: ServiceWorkerVersionInfo[];
1138
+ /** The activated one, when there is one. */
1139
+ activeVersionId?: string;
1140
+ /**
1141
+ * Whether the active worker is the deployed build rather than the local one.
1142
+ *
1143
+ * The catastrophic-but-silent case. With static routing the routes are frozen
1144
+ * at install time from the *deployed* config, so a page only enabled locally
1145
+ * bypasses the worker entirely and every navigation reports `SwBooting`.
1146
+ * False means no takeover was *seen* — a reader that attached late would not
1147
+ * know about one before it.
1148
+ */
1149
+ foreign: boolean;
1150
+ takeovers: number;
1151
+ lastTakeoverAt?: string;
1152
+ }
1153
+ export interface BrowserStateData {
1154
+ url: string | null;
1155
+ serviceWorkers: ServiceWorkerState;
1156
+ /** The device emulation in force, or null when the browser is itself. */
1157
+ emulation?: EmulationState | null;
1158
+ }
1159
+ /** The devices `browser.emulate` presents — one per Speed Kit device variation. */
1160
+ export type EmulatedDevice = "mobile" | "tablet" | "desktop";
1161
+ /** A device emulation that lasts until it is switched off. */
1162
+ export interface EmulationState {
1163
+ device: EmulatedDevice;
1164
+ width: number;
1165
+ height: number;
1166
+ dpr: number;
1167
+ mobile: boolean;
1168
+ touch: boolean;
1169
+ /** Null when the running Chrome's version could not be read. */
1170
+ userAgent: string | null;
1171
+ since: string;
1172
+ }
1173
+ /**
1174
+ * What a service worker sees as its user agent, read back after the override.
1175
+ *
1176
+ * Speed Kit decides the device in its worker, and a page-level override never
1177
+ * reaches a worker. This is the evidence that the emulation reached the place
1178
+ * the decision is made, rather than an assumption that it did.
1179
+ */
1180
+ export interface ServiceWorkerUserAgent {
1181
+ url: string;
1182
+ userAgent: string | null;
1183
+ /** Whether it is the emulated one. */
1184
+ emulated: boolean;
1185
+ /** Whether it is the worker in charge of the page: the one that decides. */
1186
+ active: boolean;
1187
+ }
1188
+ export interface BrowserEmulateData extends BrowserActionData {
1189
+ emulation: EmulationState | null;
1190
+ serviceWorkers: ServiceWorkerUserAgent[];
1191
+ }
1192
+ export interface BrowserClickData extends BrowserActionData {
1193
+ /** What was clicked, e.g. `button#add-to-cart.primary`. */
1194
+ element: string | null;
1195
+ /** Where, in viewport pixels. */
1196
+ at: {
1197
+ x: number;
1198
+ y: number;
1199
+ };
1200
+ /** The page before the click, so a navigation it caused reads as one. */
1201
+ urlBefore: string | null;
1202
+ }
1203
+ /** One tab of the run's browser, as `--tab` addresses it. */
1204
+ export interface TabInfo {
1205
+ /** What `--tab` takes. Stable while no tab opens or closes before it. */
1206
+ index: number;
1207
+ url: string;
1208
+ title: string | null;
1209
+ /** The run's own page: what every op acts on without `--tab`. */
1210
+ main: boolean;
1211
+ }
1212
+ export interface BrowserTabsData {
1213
+ tabs: TabInfo[];
1214
+ }
1215
+ export interface CdpData {
1216
+ method: string;
1217
+ /** What the browser answered, as it answered it. */
1218
+ result: unknown;
1219
+ /** The tab it was sent to. */
1220
+ url: string | null;
1221
+ }
1222
+ export interface BrowserScreenshotData {
1223
+ /** The PNG, in the run's artifact directory. */
1224
+ path: string;
1225
+ url: string | null;
1226
+ width: number;
1227
+ height: number;
1228
+ bytes: number;
1229
+ fullPage: boolean;
1230
+ selector: string | null;
1231
+ /** The device it was taken as, so a screenshot says what it shows. */
1232
+ emulation: EmulationState | null;
1233
+ }
1234
+ /** Which rule set decided, named so the answer points at a line in the config. */
1235
+ export type RuleSetName = "disabledScopes" | "enabledSites" | "disabledSites" | "whitelist" | "blacklist";
1236
+ export interface ResponseRuleVerdict {
1237
+ decision: "included" | "excluded";
1238
+ /** Null when nothing excluded it. */
1239
+ decidedBy: RuleSetName | null;
1240
+ disabledScopes: string[];
1241
+ enabledSites: string[];
1242
+ disabledSites: string[];
1243
+ whitelist: string[];
1244
+ blacklist: string[];
1245
+ /**
1246
+ * Whether the set exists in the config at all. An empty `enabledSites` means
1247
+ * "every page", not "no page", and the same line of output reads the
1248
+ * opposite way depending on which it is.
1249
+ */
1250
+ enabledSitesConfigured: boolean;
1251
+ whitelistConfigured: boolean;
1252
+ /** Matching rules that also carry a criterion outside the url. */
1253
+ uncertain: string[];
1254
+ /**
1255
+ * The request kind this verdict is for.
1256
+ *
1257
+ * Always a navigation: the question the tool answers is "why was this page
1258
+ * not accelerated", and a url alone does not say whether it is fetched as a
1259
+ * document, a script or an image. The runtime decides partly on that, so the
1260
+ * assumption has to be stated rather than left for the reader to supply.
1261
+ */
1262
+ appliesAs: "navigate";
1263
+ /**
1264
+ * Sets the runtime consults only for a navigation, listed so a reader asking
1265
+ * about a sub-resource knows which lines above do not apply to it.
1266
+ */
1267
+ navigationOnlySets: RuleSetName[];
1268
+ }
1269
+ export interface ResponseCacheFacts {
1270
+ key: string;
1271
+ status: number;
1272
+ variation: string | null;
1273
+ contentType: string | null;
1274
+ bytes: number;
1275
+ /** Whether the body carries the documentHandler's baked-in asset list. */
1276
+ assetList: boolean;
1277
+ }
1278
+ export interface ResponsePageFacts {
1279
+ url: string;
1280
+ responseSource?: string;
1281
+ responseCause?: string;
1282
+ swBooted?: boolean;
1283
+ }
1284
+ export interface ResponseExplainData {
1285
+ url: string;
1286
+ /**
1287
+ * Who produced the bytes: Speed Kit, the customer's origin, or Speed Kit
1288
+ * itself synthesising an error or a redirect.
1289
+ *
1290
+ * `unknown` unless the url is the page the run is actually on — and also when
1291
+ * the page reported a `responseSource` this build does not recognise. Speed
1292
+ * Kit ships fifteen of them and adds to the list; an unrecognised one is a
1293
+ * gap to look up, not a reason to guess `cache`.
1294
+ */
1295
+ servedFrom: "cache" | "origin" | "generated" | "unknown";
1296
+ /**
1297
+ * Set when the browser replayed the page from its back/forward cache.
1298
+ *
1299
+ * `servedFrom` then describes where the bytes came from on the original
1300
+ * load, since that is what `responseCause` records for a bfcache hit. Nothing
1301
+ * was fetched now, so no conclusion about the current config follows from it.
1302
+ */
1303
+ replayedFromBfCache?: boolean;
1304
+ rules: ResponseRuleVerdict;
1305
+ cache?: ResponseCacheFacts;
1306
+ page?: ResponsePageFacts;
1307
+ explanation: string;
1308
+ /** Traps that apply to this answer, stated only when they do. */
1309
+ notes: string[];
1310
+ }
1311
+ export interface TodoEntry {
1312
+ todo: string;
1313
+ /** The three lines beneath it, decoded — the collector stores them encoded. */
1314
+ context: string;
1315
+ /** Absolute path, so an editor can be pointed at it. */
1316
+ file: string;
1317
+ line: number;
1318
+ }
1319
+ export interface TodoListData {
1320
+ tasks: TodoEntry[];
1321
+ }
1322
+ export interface BrowserActionData {
1323
+ url: string | null;
1324
+ /** What was done, in the words the caller can repeat back. */
1325
+ did: string;
1326
+ /**
1327
+ * The origin the op actually acted on.
1328
+ *
1329
+ * Reported because it is not always the one the caller has in mind. A
1330
+ * multi-origin app has the page on one origin and the run started on
1331
+ * another, and every storage op is scoped to exactly one — so an answer that
1332
+ * did not name it could describe clearing a cache that is still there.
1333
+ */
1334
+ origin?: string;
1335
+ }
1336
+ export declare const CONTROL_ERRORS: {
1337
+ /** The peer speaks a version this run does not. */
1338
+ readonly versionMismatch: "PROTOCOL_VERSION_MISMATCH";
1339
+ /** Something was sent before `hello`. */
1340
+ readonly helloRequired: "HELLO_REQUIRED";
1341
+ /** No such op — the run is older or newer than the caller thinks. */
1342
+ readonly unknownOp: "UNKNOWN_OP";
1343
+ /** The frame did not parse. */
1344
+ readonly malformed: "MALFORMED_REQUEST";
1345
+ /** The handler threw. */
1346
+ readonly handlerFailed: "HANDLER_FAILED";
1347
+ /** No cache entry matched the key. */
1348
+ readonly noSuchEntry: "NO_SUCH_CACHE_ENTRY";
1349
+ /** The key matched more than one entry. */
1350
+ readonly ambiguousEntry: "AMBIGUOUS_CACHE_KEY";
1351
+ /** No file with that logical name in this run. */
1352
+ readonly noSuchFile: "NO_SUCH_FILE";
1353
+ /** The run has no page — not started yet, or the browser has gone. */
1354
+ readonly noPage: "NO_PAGE";
1355
+ /** The expression threw, or the page did not answer. */
1356
+ readonly evaluationFailed: "PAGE_EVALUATION_FAILED";
1357
+ /** A browser op this run cannot perform — no browser, or no install page. */
1358
+ readonly browserUnavailable: "BROWSER_UNAVAILABLE";
1359
+ /** A navigate target that is not a url, or points off the customer origin. */
1360
+ readonly badUrl: "BAD_URL";
1361
+ /** The SpeedKit config could not be evaluated, so no rule verdict is possible. */
1362
+ readonly configUnreadable: "CONFIG_UNREADABLE";
1363
+ /** This run cannot build cache entries — not `--local`, or older than the op. */
1364
+ readonly noLocalCache: "NO_LOCAL_CACHE";
1365
+ /** Every requested variation failed to build. */
1366
+ readonly prewarmFailed: "PREWARM_FAILED";
1367
+ /** This run cannot rebuild — it was started without the watcher wiring. */
1368
+ readonly noRebuild: "NO_REBUILD";
1369
+ /** No preload with that id is registered on this run. */
1370
+ readonly noSuchPreload: "NO_SUCH_PRELOAD";
1371
+ /** `inject.add` got neither a recipe nor source, or both. */
1372
+ readonly injectSourceRequired: "INJECT_SOURCE_REQUIRED";
1373
+ /** No recipe by that name — the answer names the ones that exist. */
1374
+ readonly unknownRecipe: "UNKNOWN_RECIPE";
1375
+ /** A recipe was called without a required param, or with an unknown one. */
1376
+ readonly badRecipeParams: "BAD_RECIPE_PARAMS";
1377
+ /** The registry is full. The answer names what to remove. */
1378
+ readonly tooManyPreloads: "TOO_MANY_PRELOADS";
1379
+ /** A step or resume was asked for while the page was not paused. */
1380
+ readonly notPaused: "NOT_PAUSED";
1381
+ /** A debug op that needs the hooks installed, on a run that has not armed. */
1382
+ readonly notArmed: "NOT_ARMED";
1383
+ /** No such breakpoint number. */
1384
+ readonly noSuchBreakpoint: "NO_SUCH_BREAKPOINT";
1385
+ /** The trigger matched no control on the page. */
1386
+ readonly noTrigger: "NO_TRIGGER";
1387
+ /** A width range that cannot be swept. */
1388
+ readonly badRange: "BAD_RANGE";
1389
+ };
1390
+ export {};