effect-browser 0.3.0-beta.24 → 0.3.0-beta.25

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 (345) hide show
  1. package/README.md +333 -157
  2. package/dist/Action.d.mts +1 -1
  3. package/dist/Action.mjs +61 -9
  4. package/dist/Action.mjs.map +1 -1
  5. package/dist/Browser.d.mts +2 -2
  6. package/dist/Browser.mjs +2 -2
  7. package/dist/BrowserError.d.mts +2 -2
  8. package/dist/BrowserError.mjs +194 -41
  9. package/dist/BrowserError.mjs.map +1 -1
  10. package/dist/BrowserEvent.d.mts +1 -1
  11. package/dist/BrowserEvent.mjs +166 -35
  12. package/dist/BrowserEvent.mjs.map +1 -1
  13. package/dist/Cdp.d.mts +15 -0
  14. package/dist/Cdp.mjs +22 -0
  15. package/dist/Cdp.mjs.map +1 -0
  16. package/dist/Change.d.mts +2 -2
  17. package/dist/Change.mjs +33 -6
  18. package/dist/Change.mjs.map +1 -1
  19. package/dist/Frame.d.mts +2 -2
  20. package/dist/Frame.mjs +132 -14
  21. package/dist/Frame.mjs.map +1 -1
  22. package/dist/{Style.d.mts → InputStyle.d.mts} +93 -25
  23. package/dist/{Style.mjs → InputStyle.mjs} +1 -1
  24. package/dist/Layout.d.mts +2 -2
  25. package/dist/Layout.mjs +58 -16
  26. package/dist/Layout.mjs.map +1 -1
  27. package/dist/Overlay.d.mts +2 -2
  28. package/dist/Overlay.mjs +33 -5
  29. package/dist/Overlay.mjs.map +1 -1
  30. package/dist/Page.d.mts +2 -2
  31. package/dist/Page.mjs +2 -2
  32. package/dist/PageTime.d.mts +2 -2
  33. package/dist/PageTime.mjs +13 -3
  34. package/dist/PageTime.mjs.map +1 -1
  35. package/dist/Pose.d.mts +2 -2
  36. package/dist/Pose.mjs +30 -9
  37. package/dist/Pose.mjs.map +1 -1
  38. package/dist/Site.d.mts +288 -18
  39. package/dist/Site.mjs +11 -3
  40. package/dist/Site.mjs.map +1 -1
  41. package/dist/Snapshot.d.mts +2 -2
  42. package/dist/Snapshot.mjs +87 -6
  43. package/dist/Snapshot.mjs.map +1 -1
  44. package/dist/Text.d.mts +2 -0
  45. package/dist/Text.mjs +45 -0
  46. package/dist/Text.mjs.map +1 -0
  47. package/dist/Window.d.mts +2 -2
  48. package/dist/Window.mjs +31 -6
  49. package/dist/Window.mjs.map +1 -1
  50. package/dist/ai/BrowserTools.d.mts +4987 -0
  51. package/dist/ai/BrowserTools.mjs +3 -0
  52. package/dist/ai/PageControl.d.mts +286 -0
  53. package/dist/ai/PageControl.mjs +426 -0
  54. package/dist/ai/PageControl.mjs.map +1 -0
  55. package/dist/ai/PromptCache.d.mts +16 -0
  56. package/dist/ai/PromptCache.mjs +72 -0
  57. package/dist/ai/PromptCache.mjs.map +1 -0
  58. package/dist/ai/Tabs.d.mts +2 -0
  59. package/dist/ai/Tabs.mjs +72 -0
  60. package/dist/ai/Tabs.mjs.map +1 -0
  61. package/dist/ai/ToolError.d.mts +34 -0
  62. package/dist/ai/ToolError.mjs +2 -0
  63. package/dist/ai/index.d.mts +6 -0
  64. package/dist/ai/index.mjs +6 -0
  65. package/dist/index.d.mts +7 -18
  66. package/dist/index.mjs +6 -9
  67. package/dist/{Action-24sLOubi.d.mts → internal/Action-CkanNTUw.d.mts} +64 -4
  68. package/dist/{Browser-DGR6ZEYo.d.mts → internal/Browser-DD9Vm1c-.d.mts} +75 -11
  69. package/dist/{Browser-CAQFhTkM.mjs → internal/Browser-vzD7i2oj.mjs} +174 -237
  70. package/dist/internal/Browser-vzD7i2oj.mjs.map +1 -0
  71. package/dist/{BrowserError-BlcmLVzn.d.mts → internal/BrowserError-CsuRYcDX.d.mts} +187 -28
  72. package/dist/{BrowserEvent-C2p-NwuU.d.mts → internal/BrowserEvent-tGPYYf6R.d.mts} +168 -13
  73. package/dist/internal/BrowserTools-Yi3lOX4h.mjs +497 -0
  74. package/dist/internal/BrowserTools-Yi3lOX4h.mjs.map +1 -0
  75. package/dist/{Style-T3ezDYLI.mjs → internal/InputStyle-CPzxoN4g.mjs} +75 -20
  76. package/dist/internal/InputStyle-CPzxoN4g.mjs.map +1 -0
  77. package/dist/{moment/Moment.mjs → internal/Moment-CstaX1mR.mjs} +49 -16
  78. package/dist/internal/Moment-CstaX1mR.mjs.map +1 -0
  79. package/dist/{moment/Moment.d.mts → internal/Moment-DOcldBdf.d.mts} +53 -20
  80. package/dist/internal/Page-BfGxn7oN.d.mts +1553 -0
  81. package/dist/{Page-BaAOshxo.mjs → internal/Page-DqF-tuTx.mjs} +62 -74
  82. package/dist/internal/Page-DqF-tuTx.mjs.map +1 -0
  83. package/dist/internal/Release-CFONkPDP.d.mts +39 -0
  84. package/dist/internal/Stage-D5ymSXDT.mjs +298 -0
  85. package/dist/internal/Stage-D5ymSXDT.mjs.map +1 -0
  86. package/dist/internal/Stillness-DCPeAN1a.mjs +1124 -0
  87. package/dist/internal/Stillness-DCPeAN1a.mjs.map +1 -0
  88. package/dist/internal/Supervisor-BcY_QNIY.d.mts +108 -0
  89. package/dist/internal/Supervisor-BcglY23c.mjs +531 -0
  90. package/dist/internal/Supervisor-BcglY23c.mjs.map +1 -0
  91. package/dist/internal/Tabs-dXMscIUQ.d.mts +52 -0
  92. package/dist/internal/TestPage-CYiYbh63.d.mts +159 -0
  93. package/dist/internal/ToolError-DArsRS2m.mjs +117 -0
  94. package/dist/internal/ToolError-DArsRS2m.mjs.map +1 -0
  95. package/dist/{plan/index.d.mts → internal/Walk-BNXcfZ2z.d.mts} +59 -35
  96. package/dist/{plan/index.mjs → internal/Walk-C5ky7uSf.mjs} +83 -51
  97. package/dist/internal/Walk-C5ky7uSf.mjs.map +1 -0
  98. package/dist/{ActionPort.mjs → internal/action-port-B5EkeGOR.mjs} +6 -12
  99. package/dist/internal/action-port-B5EkeGOR.mjs.map +1 -0
  100. package/dist/internal/cdp/workerd.d.mts +13 -0
  101. package/dist/internal/cdp/workerd.mjs +19 -0
  102. package/dist/internal/cdp/workerd.mjs.map +1 -0
  103. package/dist/{Clock.mjs → internal/clock-BKSAEf00.mjs} +13 -13
  104. package/dist/internal/clock-BKSAEf00.mjs.map +1 -0
  105. package/dist/{connection-Db-YtlbE.d.mts → internal/connection-BaB0vp1o.d.mts} +6 -6
  106. package/dist/{connection-C_jWYIwe.mjs → internal/connection-C2X4GmXM.mjs} +19 -15
  107. package/dist/internal/connection-C2X4GmXM.mjs.map +1 -0
  108. package/dist/internal/events-DzCrww-y.mjs +72 -0
  109. package/dist/internal/events-DzCrww-y.mjs.map +1 -0
  110. package/dist/internal/fold.inpage-uhrT-dOB.mjs +49 -0
  111. package/dist/internal/fold.inpage-uhrT-dOB.mjs.map +1 -0
  112. package/dist/internal/functions-jBOs6GKv.mjs +27 -0
  113. package/dist/internal/functions-jBOs6GKv.mjs.map +1 -0
  114. package/dist/{Geometry-DJx9qrYy.d.mts → internal/geometry-Dhj_ztJs.d.mts} +3 -3
  115. package/dist/{Geometry.mjs → internal/geometry-Lxyflb9J.mjs} +3 -12
  116. package/dist/internal/geometry-Lxyflb9J.mjs.map +1 -0
  117. package/dist/{Matching.mjs → internal/matching-Cs-UeOY0.mjs} +3 -3
  118. package/dist/internal/matching-Cs-UeOY0.mjs.map +1 -0
  119. package/dist/internal/page-DFQb-YOK.mjs +436 -0
  120. package/dist/internal/page-DFQb-YOK.mjs.map +1 -0
  121. package/dist/{pose.inpage-CLq7Mfdr.mjs → internal/pose.inpage-CBFeWcVa.mjs} +2 -48
  122. package/dist/internal/pose.inpage-CBFeWcVa.mjs.map +1 -0
  123. package/dist/{Url.mjs → internal/url-DB0pQYk6.mjs} +3 -12
  124. package/dist/internal/url-DB0pQYk6.mjs.map +1 -0
  125. package/dist/policy/Policy.d.mts +60 -6
  126. package/dist/policy/Policy.mjs +52 -9
  127. package/dist/policy/Policy.mjs.map +1 -1
  128. package/dist/policy/index.d.mts +2 -0
  129. package/dist/policy/index.mjs +2 -0
  130. package/dist/{film → presentation}/Film.d.mts +83 -16
  131. package/dist/{film → presentation}/Film.mjs +82 -30
  132. package/dist/presentation/Film.mjs.map +1 -0
  133. package/dist/presentation/Motion.d.mts +5 -1
  134. package/dist/presentation/Motion.mjs +16 -2
  135. package/dist/presentation/Motion.mjs.map +1 -1
  136. package/dist/presentation/Presentation.d.mts +42 -7
  137. package/dist/presentation/Presentation.mjs +26 -9
  138. package/dist/presentation/Presentation.mjs.map +1 -1
  139. package/dist/presentation/Stage.d.mts +40 -6
  140. package/dist/presentation/Stage.mjs +1 -262
  141. package/dist/presentation/index.d.mts +5 -0
  142. package/dist/presentation/index.mjs +5 -0
  143. package/dist/supervisor/Release.d.mts +2 -0
  144. package/dist/supervisor/Release.mjs +40 -0
  145. package/dist/supervisor/Release.mjs.map +1 -0
  146. package/dist/supervisor/Supervisor.d.mts +2 -104
  147. package/dist/supervisor/Supervisor.mjs +2 -515
  148. package/dist/supervisor/index.d.mts +3 -0
  149. package/dist/supervisor/index.mjs +3 -0
  150. package/dist/testing/HttpCassette.d.mts +98 -0
  151. package/dist/testing/HttpCassette.mjs +146 -0
  152. package/dist/testing/HttpCassette.mjs.map +1 -0
  153. package/dist/testing/Story.d.mts +31 -0
  154. package/dist/testing/Story.mjs +76 -0
  155. package/dist/testing/Story.mjs.map +1 -0
  156. package/dist/testing/TestBrowser.d.mts +191 -0
  157. package/dist/testing/TestBrowser.mjs +105 -0
  158. package/dist/testing/TestBrowser.mjs.map +1 -0
  159. package/dist/testing/TestModel.d.mts +133 -0
  160. package/dist/testing/TestModel.mjs +209 -0
  161. package/dist/testing/TestModel.mjs.map +1 -0
  162. package/dist/testing/TestPage.d.mts +2 -0
  163. package/dist/testing/TestPage.mjs +47 -0
  164. package/dist/testing/TestPage.mjs.map +1 -0
  165. package/dist/testing/index.d.mts +6 -311
  166. package/dist/testing/index.mjs +6 -521
  167. package/dist/timeline/Moment.d.mts +3 -0
  168. package/dist/timeline/Moment.mjs +3 -0
  169. package/dist/timeline/Stillness.d.mts +34 -0
  170. package/dist/timeline/Stillness.mjs +2 -0
  171. package/dist/timeline/index.d.mts +3 -0
  172. package/dist/timeline/index.mjs +3 -0
  173. package/dist/walk/Walk.d.mts +2 -0
  174. package/dist/walk/Walk.mjs +2 -0
  175. package/dist/walk/index.d.mts +2 -0
  176. package/dist/walk/index.mjs +2 -0
  177. package/package.json +54 -163
  178. package/src/Action.ts +73 -8
  179. package/src/Browser.ts +75 -9
  180. package/src/BrowserError.ts +258 -63
  181. package/src/BrowserEvent.ts +252 -55
  182. package/src/Cdp.ts +42 -0
  183. package/src/Change.ts +68 -3
  184. package/src/Frame.ts +247 -14
  185. package/src/{Style.ts → InputStyle.ts} +98 -22
  186. package/src/Layout.ts +95 -24
  187. package/src/Overlay.ts +42 -3
  188. package/src/Page.ts +144 -320
  189. package/src/PageTime.ts +29 -4
  190. package/src/Pose.ts +38 -7
  191. package/src/Site.ts +15 -3
  192. package/src/Snapshot.ts +179 -3
  193. package/src/Text.ts +60 -0
  194. package/src/Window.ts +53 -3
  195. package/src/ai/BrowserTools.ts +778 -0
  196. package/src/ai/PageControl.ts +702 -0
  197. package/src/ai/PromptCache.ts +87 -0
  198. package/src/ai/Tabs.ts +84 -0
  199. package/src/ai/ToolError.ts +50 -0
  200. package/src/ai/index.ts +36 -0
  201. package/src/ai/internal/crops.ts +38 -0
  202. package/src/ai/internal/points.ts +57 -0
  203. package/src/ai/internal/receipts.ts +107 -0
  204. package/src/index.ts +83 -6
  205. package/src/{ActionPort.ts → internal/action-port.ts} +3 -3
  206. package/src/{providers → internal/cdp}/connection.ts +19 -12
  207. package/src/internal/cdp/workerd.ts +36 -0
  208. package/src/{Clock.ts → internal/clock.ts} +20 -0
  209. package/src/internal/input/actions.ts +1 -1
  210. package/src/internal/input/dispatch.ts +2 -2
  211. package/src/internal/input/guard.inpage.ts +1 -1
  212. package/src/internal/input/guard.ts +1 -1
  213. package/src/internal/input/perform.ts +5 -5
  214. package/src/internal/input/pointer.ts +2 -2
  215. package/src/internal/input/targets.inpage.ts +3 -3
  216. package/src/{Matching.ts → internal/matching.ts} +6 -6
  217. package/src/internal/page/bridge.ts +2 -2
  218. package/src/internal/page/clock.inpage.ts +1 -1
  219. package/src/internal/page/compose.inpage.ts +2 -2
  220. package/src/internal/page/context.ts +2 -2
  221. package/src/internal/page/functions.ts +84 -0
  222. package/src/internal/page/navigation.ts +1 -1
  223. package/src/internal/page/openings.ts +2 -2
  224. package/src/internal/page/page.ts +33 -35
  225. package/src/internal/page/port.ts +14 -8
  226. package/src/internal/page/replies.ts +1 -1
  227. package/src/internal/page/requests.ts +1 -1
  228. package/src/internal/page/scripts.ts +1 -1
  229. package/src/internal/page/time.ts +1 -1
  230. package/src/internal/pictures/capture.ts +1 -4
  231. package/src/internal/pictures/dimensions.ts +1 -1
  232. package/src/internal/pictures/frame.ts +1 -1
  233. package/src/internal/pictures/pictures.ts +53 -61
  234. package/src/internal/reading/context.inpage.ts +2 -2
  235. package/src/internal/reading/expect.inpage.ts +1 -1
  236. package/src/internal/reading/layout.inpage.ts +3 -3
  237. package/src/internal/reading/layout.ts +5 -5
  238. package/src/internal/reading/outline.inpage.ts +3 -3
  239. package/src/internal/reading/reading.ts +11 -19
  240. package/src/internal/reading/ready.inpage.ts +2 -2
  241. package/src/internal/reading/ready.ts +3 -2
  242. package/src/internal/reading/subjects.inpage.ts +3 -3
  243. package/src/internal/reading/text.inpage.ts +2 -2
  244. package/src/internal/reading/walk.inpage.ts +1 -1
  245. package/src/internal/timeline/changes.inpage.ts +2 -2
  246. package/src/internal/timeline/changes.ts +3 -4
  247. package/src/internal/timeline/sight.inpage.ts +2 -2
  248. package/src/internal/timeline/window.ts +3 -4
  249. package/src/policy/Policy.ts +70 -16
  250. package/src/policy/index.ts +12 -0
  251. package/src/{film → presentation}/Film.ts +104 -37
  252. package/src/presentation/Motion.ts +45 -3
  253. package/src/presentation/Presentation.ts +47 -14
  254. package/src/presentation/Stage.ts +73 -35
  255. package/src/presentation/index.ts +30 -0
  256. package/src/presentation/{feed.ts → internal/feed.ts} +1 -1
  257. package/src/supervisor/Release.ts +45 -0
  258. package/src/supervisor/Supervisor.ts +80 -5
  259. package/src/supervisor/index.ts +18 -0
  260. package/src/supervisor/{contract.ts → internal/contract.ts} +14 -10
  261. package/src/supervisor/{lifecycle.ts → internal/lifecycle.ts} +7 -7
  262. package/src/supervisor/{runtime.ts → internal/runtime.ts} +7 -7
  263. package/src/testing/HttpCassette.ts +260 -0
  264. package/src/testing/Story.ts +103 -0
  265. package/src/testing/TestBrowser.ts +14 -4
  266. package/src/testing/TestModel.ts +297 -0
  267. package/src/testing/TestPage.ts +92 -4
  268. package/src/testing/index.ts +35 -1
  269. package/src/testing/{evidence.ts → internal/evidence.ts} +19 -11
  270. package/src/testing/{model.ts → internal/model.ts} +14 -8
  271. package/src/testing/{page.ts → internal/page.ts} +55 -56
  272. package/src/{moment → timeline}/Moment.ts +79 -29
  273. package/src/{stillness → timeline}/Stillness.ts +61 -43
  274. package/src/timeline/index.ts +18 -0
  275. package/src/{stillness/Pixels.ts → timeline/internal/pixels.ts} +2 -2
  276. package/src/{moment → timeline/internal}/words.ts +2 -2
  277. package/src/walk/Walk.ts +165 -0
  278. package/src/walk/index.ts +12 -0
  279. package/src/{plan → walk/internal}/choose.ts +23 -14
  280. package/src/{plan → walk/internal}/data.ts +37 -14
  281. package/src/{plan → walk/internal}/execute.ts +79 -36
  282. package/src/{plan → walk/internal}/record.ts +6 -6
  283. package/src/{plan → walk/internal}/targets.ts +35 -25
  284. package/dist/ActionPort.d.mts +0 -15
  285. package/dist/ActionPort.mjs.map +0 -1
  286. package/dist/Browser-CAQFhTkM.mjs.map +0 -1
  287. package/dist/Change-CxT1mp2e.d.mts +0 -80
  288. package/dist/Clock-Du5nP-nK.d.mts +0 -57
  289. package/dist/Clock.d.mts +0 -2
  290. package/dist/Clock.mjs.map +0 -1
  291. package/dist/Frame-UEH2hO5T.d.mts +0 -124
  292. package/dist/Geometry.d.mts +0 -2
  293. package/dist/Geometry.mjs.map +0 -1
  294. package/dist/Matching-MtcWZ_hA.d.mts +0 -266
  295. package/dist/Matching.d.mts +0 -2
  296. package/dist/Matching.mjs.map +0 -1
  297. package/dist/Overlay-CoGw5tL_.d.mts +0 -27
  298. package/dist/Page-BaAOshxo.mjs.map +0 -1
  299. package/dist/Page-CLzh5E9w.d.mts +0 -718
  300. package/dist/PageTime-68UPUZpZ.d.mts +0 -29
  301. package/dist/Pose-2qqGzPvb.d.mts +0 -32
  302. package/dist/Released-tURbFmal.d.mts +0 -15
  303. package/dist/Snapshot-CtBVOtuu.d.mts +0 -73
  304. package/dist/Stillness-BwP0RdI4.mjs +0 -157
  305. package/dist/Stillness-BwP0RdI4.mjs.map +0 -1
  306. package/dist/Style-T3ezDYLI.mjs.map +0 -1
  307. package/dist/Url-B7P-TWwL.d.mts +0 -26
  308. package/dist/Url.d.mts +0 -2
  309. package/dist/Url.mjs.map +0 -1
  310. package/dist/Window-BDa8MtNP.d.mts +0 -34
  311. package/dist/connection-C_jWYIwe.mjs.map +0 -1
  312. package/dist/film/Film.mjs.map +0 -1
  313. package/dist/moment/Moment.mjs.map +0 -1
  314. package/dist/plan/index.mjs.map +0 -1
  315. package/dist/pose.inpage-CLq7Mfdr.mjs.map +0 -1
  316. package/dist/presentation/Stage.mjs.map +0 -1
  317. package/dist/presentation/feed.d.mts +0 -20
  318. package/dist/presentation/feed.mjs +0 -18
  319. package/dist/presentation/feed.mjs.map +0 -1
  320. package/dist/providers/Cdp.d.mts +0 -9
  321. package/dist/providers/Cdp.mjs +0 -15
  322. package/dist/providers/Cdp.mjs.map +0 -1
  323. package/dist/providers/Chromium.d.mts +0 -32
  324. package/dist/providers/Chromium.mjs +0 -55
  325. package/dist/providers/Chromium.mjs.map +0 -1
  326. package/dist/providers/Released.d.mts +0 -2
  327. package/dist/providers/Released.mjs +0 -12
  328. package/dist/providers/Released.mjs.map +0 -1
  329. package/dist/stillness/Stillness.d.mts +0 -12
  330. package/dist/stillness/Stillness.mjs +0 -2
  331. package/dist/supervisor/Supervisor.mjs.map +0 -1
  332. package/dist/testing/index.mjs.map +0 -1
  333. package/dist/workerd/Cdp.d.mts +0 -8
  334. package/dist/workerd/Cdp.mjs +0 -13
  335. package/dist/workerd/Cdp.mjs.map +0 -1
  336. package/src/plan/index.ts +0 -36
  337. package/src/providers/Cdp.ts +0 -16
  338. package/src/providers/Chromium.ts +0 -99
  339. package/src/providers/Released.ts +0 -13
  340. package/src/workerd/Cdp.ts +0 -11
  341. /package/dist/{fold.inpage-CyVZQHZL.d.mts → internal/fold.inpage-CyVZQHZL.d.mts} +0 -0
  342. /package/dist/{rolldown-runtime-D7D4PA-g.mjs → internal/rolldown-runtime-D7D4PA-g.mjs} +0 -0
  343. /package/src/{Geometry.ts → internal/geometry.ts} +0 -0
  344. /package/src/{Url.ts → internal/url.ts} +0 -0
  345. /package/src/{stillness → timeline/internal}/utilsBundle.d.ts +0 -0
@@ -8,10 +8,17 @@ import { Duration, Effect, Option, Result, Schedule, Schema, type Scope } from "
8
8
  import { Base64 } from "effect/encoding";
9
9
 
10
10
  import { BrowserError, Failed, InvalidRequest } from "../../BrowserError.ts";
11
- import * as BrowserClock from "../../Clock.ts";
12
- import { Frame, Image, Screenshot } from "../../Frame.ts";
13
- import type { Point } from "../../Geometry.ts";
14
- import { type FrameOptions, type Paint, Region, type ScreenshotOptions, Zoom } from "../../Page.ts";
11
+ import {
12
+ Frame,
13
+ type FrameOptions,
14
+ Image,
15
+ type Paint,
16
+ Region,
17
+ Screenshot,
18
+ Zoom,
19
+ } from "../../Frame.ts";
20
+ import * as BrowserClock from "../clock.ts";
21
+ import type { Point } from "../geometry.ts";
15
22
  import { type Bridge, scriptCall } from "../page/bridge.ts";
16
23
  import {
17
24
  decodeWith,
@@ -61,7 +68,7 @@ export const pngSize = (bytes: Uint8Array): Size | undefined => {
61
68
  export type Format = "jpeg" | "png";
62
69
 
63
70
  // A picture's pixels: CSS pixels, or the screen's own.
64
- type Scale = NonNullable<ScreenshotOptions["scale"]>;
71
+ type Scale = NonNullable<FrameOptions["scale"]>;
65
72
 
66
73
  // The part of `Page.getLayoutMetrics` a clip needs: the visual viewport's place in the document and
67
74
  // its pinch scale, and the content's size in device and CSS pixels, whose ratio is the device's.
@@ -382,25 +389,23 @@ const camera = (
382
389
  }).pipe(capture.excluding, within(operation));
383
390
  };
384
391
 
385
- // A duration in milliseconds, or NaN for an input that is no duration.
386
- const millisOf = (input: Duration.Input) =>
387
- Option.match(Duration.fromInput(input), { onNone: () => Number.NaN, onSome: Duration.toMillis });
388
-
389
392
  // The newest screencast frame, if it shows the page as the caller asked: painted at most `maxAge`
390
393
  // ago at the earliest its timing allows, after the current document began, and with
391
394
  // `after: "input"` after the page's latest input, which a read asks in its turn, once the action
392
395
  // in flight has ended. It must have the viewport's size, as a new picture would. A screencast sends
393
396
  // only changes and can miss a final paint, so a frame is only ever as current as its age, and a
394
397
  // page that keeps painting while the next document loads leaves its own frames newest when the
395
- // navigation returns.
398
+ // navigation returns. A screencast frame is a JPEG of the viewport's CSS size, so a PNG or a
399
+ // picture in device pixels is always new.
396
400
  const reuse =
397
401
  (page: PageContext, bridge: Bridge, viewport: Viewport, capture: Capture.Controller) =>
398
- (operation: string, options: FrameOptions) =>
402
+ (options: FrameOptions) =>
399
403
  Effect.gen(function* () {
400
- const maxAge = millisOf(options.maxAge ?? defaultMaxAge);
404
+ const maxAge = BrowserClock.millisOf(options.maxAge ?? defaultMaxAge);
401
405
 
402
406
  if (!(maxAge >= 0))
403
- return yield* refuse(operation, "maxAge must be a duration of zero or more");
407
+ return yield* refuse("frame", "maxAge must be a duration of zero or more");
408
+ if (options.format === "png" || options.scale === "device") return Option.none<Frame>();
404
409
  const latest = yield* capture.latest;
405
410
  const known = viewport.knownViewport();
406
411
  const { activity } = page;
@@ -476,57 +481,31 @@ export const make = Effect.fnUntraced(function* (
476
481
  const picture = camera(page, viewport, capture, emulated);
477
482
  const reusable = reuse(page, bridge, viewport, capture);
478
483
  // Pictures in flight are shared, never kept: their callers say how old one may be.
479
- const screenshots = lane.shared<Image>("screenshot", false);
480
484
  const frames = lane.shared<Frame>("frame", false);
481
485
 
482
- // A caller that acts and then looks must see what its action did, so a screenshot waits for the
483
- // action in flight and reuses only a frame painted after the page's latest input.
484
- const screenshot = (options: ScreenshotOptions = {}) =>
485
- screenshots(
486
- JSON.stringify([
487
- millisOf(options.maxAge ?? defaultMaxAge),
488
- options.clip,
489
- options.quality,
490
- options.format,
491
- options.scale,
492
- ]),
493
- Effect.gen(function* () {
494
- // A reused frame is a JPEG of the viewport's CSS size, so a PNG or a device picture is new.
495
- const reused =
496
- options.clip === undefined && options.format !== "png" && options.scale !== "device"
497
- ? yield* reusable("screenshot", { maxAge: options.maxAge, after: "input" })
498
- : Option.none<Frame>();
499
-
500
- const image = Option.isSome(reused)
501
- ? reused.value.image
502
- : yield* picture(
503
- "screenshot",
504
- options.quality ?? 80,
505
- options.clip,
506
- options.format,
507
- options.scale,
508
- );
509
-
510
- yield* Effect.annotateCurrentSpan({ source: sourceOf(reused), bytes: image.data.length });
511
-
512
- return image;
513
- }),
514
- ).pipe(span("Page.screenshot"), owned);
515
-
516
486
  // A new screenshot has no paint time, only the host interval in which it was taken.
517
487
  const taken = (options: FrameOptions) =>
518
488
  Effect.gen(function* () {
519
- const reused = yield* reusable("frame", options);
489
+ const reused = yield* reusable(options);
520
490
 
521
491
  yield* Effect.annotateCurrentSpan("source", sourceOf(reused));
522
492
  if (Option.isSome(reused)) return reused.value;
523
493
  const startedAt = now();
524
- const image = yield* picture("frame", 80);
494
+
495
+ const image = yield* picture(
496
+ "frame",
497
+ options.quality ?? 80,
498
+ undefined,
499
+ options.format,
500
+ options.scale,
501
+ );
502
+
525
503
  const finishedAt = now();
526
504
 
527
505
  return new Frame({
528
506
  page: id,
529
507
  data: image.data,
508
+ mediaType: image.mediaType,
530
509
  timing: new Screenshot({
531
510
  hostTime: startedAt + (finishedAt - startedAt) / 2,
532
511
  uncertaintyMillis: (finishedAt - startedAt) / 2,
@@ -541,25 +520,31 @@ export const make = Effect.fnUntraced(function* (
541
520
  // A frame of a stated age that the screencast has costs nothing and waits for no action; one
542
521
  // that must follow the latest input, or a new screenshot, waits for the action in flight.
543
522
  const frame = (options: FrameOptions = {}) =>
544
- (options.after === "input"
545
- ? Effect.succeed(Option.none<Frame>())
546
- : reusable("frame", options)
547
- ).pipe(
523
+ (options.after === "input" ? Effect.succeed(Option.none<Frame>()) : reusable(options)).pipe(
548
524
  Effect.flatMap(
549
525
  Option.match({
550
526
  onSome: (reused) => Effect.as(Effect.annotateCurrentSpan("source", "frame"), reused),
551
527
  onNone: () =>
552
528
  frames(
553
- JSON.stringify([millisOf(options.maxAge ?? defaultMaxAge), options.after]),
529
+ JSON.stringify([
530
+ BrowserClock.millisOf(options.maxAge ?? defaultMaxAge),
531
+ options.after,
532
+ options.quality,
533
+ options.format,
534
+ options.scale,
535
+ ]),
554
536
  taken(options),
555
537
  ),
556
538
  }),
557
539
  ),
558
- span("Page.frame"),
540
+ span("Frame.read"),
559
541
  owned,
560
542
  );
561
543
 
562
- const zoom = (requested: Region, options: Pick<ScreenshotOptions, "scale"> = {}) =>
544
+ const zoom = (
545
+ requested: Region,
546
+ options: Pick<FrameOptions, "quality" | "format" | "scale"> = {},
547
+ ) =>
563
548
  lane
564
549
  .read("zoom")(
565
550
  Effect.gen(function* () {
@@ -574,16 +559,23 @@ export const make = Effect.fnUntraced(function* (
574
559
 
575
560
  if (region.x + region.width > size.width || region.y + region.height > size.height)
576
561
  return yield* refuse("zoom", "the crop must fit entirely within the viewport");
577
- const image = yield* picture("zoom", 80, region, "jpeg", options.scale);
562
+
563
+ const image = yield* picture(
564
+ "zoom",
565
+ options.quality ?? 80,
566
+ region,
567
+ options.format,
568
+ options.scale,
569
+ );
578
570
 
579
571
  return new Zoom({ page: id, region, image });
580
572
  }).pipe(within("zoom")),
581
573
  )
582
- .pipe(span("Page.zoom"), owned);
574
+ .pipe(span("Frame.zoom"), owned);
583
575
 
584
576
  const captureStats = (options: { readonly window?: Duration.Input | undefined } = {}) => {
585
577
  if (options.window === undefined) return capture.stats();
586
- const millis = millisOf(options.window);
578
+ const millis = BrowserClock.millisOf(options.window);
587
579
 
588
580
  return millis > 0 && millis <= Duration.toMillis(countsKept)
589
581
  ? capture.stats(millis)
@@ -594,5 +586,5 @@ export const make = Effect.fnUntraced(function* (
594
586
  // change record's times need it.
595
587
  const estimate = mapping.current(calibrateClock);
596
588
 
597
- return { capture, screenshot, frame, zoom, captureStats, estimate, paint: emulated.paint };
589
+ return { capture, frame, zoom, captureStats, estimate, paint: emulated.paint };
598
590
  });
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import type { SubjectContext } from "../../BrowserEvent.ts";
13
13
  import type { Names } from "./names.inpage.ts";
14
- import type { Walk } from "./walk.inpage.ts";
14
+ import type { Walked } from "./walk.inpage.ts";
15
15
 
16
16
  /** What one read has learnt of the page: each table's header row and each tree's headings. */
17
17
  export interface Known {
@@ -19,7 +19,7 @@ export interface Known {
19
19
  readonly headings: Map<Node, ReadonlyArray<Element>>;
20
20
  }
21
21
 
22
- export const context = (names: Names, walked: Walk) => {
22
+ export const context = (names: Names, walked: Walked) => {
23
23
  const { clean, isButton, isDocument, isHtml, isInput, isRoot } = names;
24
24
  const { isSelect, isTextArea, roleOf, textOf } = names;
25
25
  const { visible } = walked;
@@ -2,7 +2,7 @@
2
2
  * In the page: the wait an expectation takes on what `find` matches, and the mark that stands for
3
3
  * what the matches show. See `names.inpage.ts` for what a page-side part may use.
4
4
  */
5
- import type { FindRequest, Match } from "../../Matching.ts";
5
+ import type { FindRequest, Match } from "../matching.ts";
6
6
  import type { Names } from "./names.inpage.ts";
7
7
  import type { Subjects } from "./subjects.inpage.ts";
8
8
 
@@ -6,11 +6,11 @@
6
6
  * call, so the boxes and the scroll describe one moment. See `names.inpage.ts` for what a
7
7
  * page-side part may use.
8
8
  */
9
- import type { FindRequest, Match, Wanted } from "../../Matching.ts";
9
+ import type { FindRequest, Match, Wanted } from "../matching.ts";
10
10
  import type { ContextReader } from "./context.inpage.ts";
11
11
  import type { Names } from "./names.inpage.ts";
12
12
  import type { Subjects } from "./subjects.inpage.ts";
13
- import type { Walk } from "./walk.inpage.ts";
13
+ import type { Walked } from "./walk.inpage.ts";
14
14
 
15
15
  export interface PickRequest extends FindRequest {
16
16
  readonly id: string;
@@ -20,7 +20,7 @@ export interface PickRequest extends FindRequest {
20
20
 
21
21
  export const layout = (
22
22
  names: Names,
23
- walked: Walk,
23
+ walked: Walked,
24
24
  subjected: Subjects,
25
25
  matching: Match,
26
26
  placing: ContextReader,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Reading where things are: `Page.layout`, in one call to the page that takes its turn as other
2
+ * Reading where things are: `Layout.measure`, in one call to the page that takes its turn as other
3
3
  * reads do and shares its work with identical ones. The page gives each place's viewport box; the
4
4
  * document box is that box moved by the scroll read with it.
5
5
  */
@@ -7,12 +7,12 @@ import { Effect, Schema } from "effect";
7
7
 
8
8
  import { NotActionable } from "../../BrowserError.ts";
9
9
  import { Box, Subject } from "../../BrowserEvent.ts";
10
- import { Point } from "../../Geometry.ts";
11
10
  import { Layout, type Picks, Place, Word } from "../../Layout.ts";
12
- import { pickRequests } from "../../Matching.ts";
13
- import * as Url from "../../Url.ts";
11
+ import { Point } from "../geometry.ts";
12
+ import { pickRequests } from "../matching.ts";
14
13
  import { type Bridge, scriptCall } from "../page/bridge.ts";
15
14
  import { contextGone, decodeWith, failWith, type PageContext, refuse } from "../page/context.ts";
15
+ import * as Url from "../url.ts";
16
16
 
17
17
  // What `layout` reads back, before its document boxes are added.
18
18
  const LayoutResult = Schema.Union([
@@ -94,7 +94,7 @@ export const make = (page: PageContext, bridge: Bridge) => {
94
94
  }),
95
95
  within("layout"),
96
96
  ),
97
- ).pipe(span("Page.layout", { picks: asked.length }), owned);
97
+ ).pipe(span("Layout.measure", { picks: asked.length }), owned);
98
98
  };
99
99
 
100
100
  return layout;
@@ -4,13 +4,13 @@
4
4
  */
5
5
 
6
6
  import type { Control } from "../../Snapshot.ts";
7
- import type { addresses } from "../../Url.ts";
7
+ import type { addresses } from "../url.ts";
8
8
  import type { Controls } from "./controls.inpage.ts";
9
9
  import type { Names } from "./names.inpage.ts";
10
10
  import type { SnapshotResult } from "./reading.ts";
11
11
  import type { Subjects } from "./subjects.inpage.ts";
12
12
  import type { Texts } from "./text.inpage.ts";
13
- import type { Walk } from "./walk.inpage.ts";
13
+ import type { Walked } from "./walk.inpage.ts";
14
14
 
15
15
  export interface SnapshotRequest {
16
16
  readonly full: boolean;
@@ -27,7 +27,7 @@ type Url = ReturnType<typeof addresses>;
27
27
 
28
28
  export const outline = (
29
29
  names: Names,
30
- walked: Walk,
30
+ walked: Walked,
31
31
  subjects: Subjects,
32
32
  texts: Texts,
33
33
  controlling: Controls,
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Reading a page: its outline with refs, the elements a query finds and the text it shows. Each
3
3
  * read takes its turn on the page and shares its work with identical reads, as `lane.ts`
4
- * describes. The viewport's text as it was last read is kept, for `Page.state`.
4
+ * describes.
5
5
  */
6
6
  import { Duration, Effect, Schedule, Schema } from "effect";
7
7
 
8
8
  import { StaleRef } from "../../BrowserError.ts";
9
- import { request as askedOf, type FindRequest } from "../../Matching.ts";
10
- import { type FindQuery, Found, Text, type TextOptions } from "../../Page.ts";
11
- import { Snapshot, type SnapshotOptions } from "../../Snapshot.ts";
12
- import * as Url from "../../Url.ts";
9
+ import { type FindQuery, Found, Snapshot, type SnapshotOptions } from "../../Snapshot.ts";
10
+ import { Text, type TextOptions } from "../../Text.ts";
11
+ import { request as askedOf, type FindRequest } from "../matching.ts";
13
12
  import { type Bridge, scriptCall } from "../page/bridge.ts";
14
13
  import { contextGone, decodeWith, failWith, type PageContext, refuse } from "../page/context.ts";
14
+ import * as Url from "../url.ts";
15
15
  import type { Want } from "./expect.inpage.ts";
16
16
  import type { SnapshotRequest } from "./outline.inpage.ts";
17
17
  import type { TextRequest } from "./text.inpage.ts";
@@ -54,7 +54,6 @@ export const make = (page: PageContext, bridge: Bridge) =>
54
54
  const snapshots = lane.shared<Snapshot>("snapshot", true);
55
55
  const finds = lane.shared<ReadonlyArray<Found>>("find", true);
56
56
  const texts = lane.shared<Text>("text", true);
57
- let viewed: Text | undefined;
58
57
 
59
58
  const snapshot = (snapshotOptions: SnapshotOptions = {}) => {
60
59
  const asked = {
@@ -81,7 +80,7 @@ export const make = (page: PageContext, bridge: Bridge) =>
81
80
 
82
81
  return new Snapshot({ ...result.snapshot, url: Url.redact(url) });
83
82
  }).pipe(within("snapshot")),
84
- ).pipe(span("Page.snapshot", { full: asked.full }), owned);
83
+ ).pipe(span("Snapshot.read", { full: asked.full }), owned);
85
84
  };
86
85
 
87
86
  const find = (query: FindQuery = {}) => {
@@ -104,7 +103,7 @@ export const make = (page: PageContext, bridge: Bridge) =>
104
103
  }).pipe(within("find")),
105
104
  ).pipe(
106
105
  // The query's words are the caller's, and may be anything; only its shape is traced.
107
- span("Page.find", { scope: asked.scope, role: asked.role ?? "" }),
106
+ span("Snapshot.find", { scope: asked.scope, role: asked.role ?? "" }),
108
107
  owned,
109
108
  );
110
109
  };
@@ -133,14 +132,11 @@ export const make = (page: PageContext, bridge: Bridge) =>
133
132
  chars: result.text.length,
134
133
  truncated: result.truncated,
135
134
  });
136
- const shown = new Text({ ...result, url: Url.redact(result.url), at: now() });
137
135
 
138
- if (request.ref === null) viewed = shown;
139
-
140
- return shown;
136
+ return new Text({ ...result, url: Url.redact(result.url), at: now() });
141
137
  }).pipe(within("text")),
142
138
  )
143
- ).pipe(span("Page.text", { scope: scope === "viewport" ? "viewport" : "ref" }), owned);
139
+ ).pipe(span("Text.read", { scope: scope === "viewport" ? "viewport" : "ref" }), owned);
144
140
  };
145
141
 
146
142
  // One call, which the page answers once `want` holds of what `query` matches, the whole document
@@ -181,16 +177,12 @@ export const make = (page: PageContext, bridge: Bridge) =>
181
177
  .pipe(
182
178
  Effect.andThen(look),
183
179
  within("expect", Duration.sum(Duration.millis(millis), page.settings.actionTimeout)),
184
- span("Page.expect", { want: typeof want === "string" ? want : "other" }),
180
+ span("Snapshot.until", { want: typeof want === "string" ? want : "other" }),
185
181
  owned,
186
182
  );
187
183
  };
188
184
 
189
- /** The viewport's text as it was last read, if after `since`, as a document began. */
190
- const viewedSince = (since: number) =>
191
- viewed !== undefined && viewed.at > since ? viewed : undefined;
192
-
193
- return { snapshot, find, text, until, viewedSince };
185
+ return { snapshot, find, text, until };
194
186
  });
195
187
 
196
188
  export type Reading = Effect.Success<ReturnType<typeof make>>;
@@ -13,9 +13,9 @@
13
13
  import type { History } from "../timeline/history.inpage.ts";
14
14
  import type { Readiness } from "./ready.ts";
15
15
  import type { Texts } from "./text.inpage.ts";
16
- import type { Walk } from "./walk.inpage.ts";
16
+ import type { Walked } from "./walk.inpage.ts";
17
17
 
18
- export const ready = (walked: Walk, texts: Texts, kept: History) => {
18
+ export const ready = (walked: Walked, texts: Texts, kept: History) => {
19
19
  const { inView, visible } = walked;
20
20
  // A canvas is read through a small copy: reading it directly would give it a context of ours.
21
21
  let copy: OffscreenCanvasRenderingContext2D | null | undefined;
@@ -3,6 +3,7 @@ import { Duration, Effect, Schedule, Schema } from "effect";
3
3
 
4
4
  import { Timeout, failWith, refuse } from "../../BrowserError.ts";
5
5
  import type { ReadyOptions } from "../../Page.ts";
6
+ import { millisOf } from "../clock.ts";
6
7
  import { type Bridge, scriptCall } from "../page/bridge.ts";
7
8
  import { contextGone, decodeWith, type PageContext } from "../page/context.ts";
8
9
 
@@ -25,10 +26,10 @@ export type Readiness = typeof ReadinessSchema.Type;
25
26
  export const make =
26
27
  (page: PageContext, bridge: Bridge) =>
27
28
  (options: ReadyOptions = {}) => {
28
- const quietMillis = options.quietMillis ?? 0;
29
+ const quietMillis = millisOf(options.quiet ?? 0);
29
30
 
30
31
  if (!Number.isFinite(quietMillis) || quietMillis < 0)
31
- return refuse("ready", "quietMillis must be finite and nonnegative");
32
+ return refuse("ready", "quiet must be a finite nonnegative duration");
32
33
  const timeout = options.timeout ?? Duration.seconds(15);
33
34
 
34
35
  // The page's own evidence, checked in the page until nothing is left or `until` has come.
@@ -4,10 +4,10 @@
4
4
  * beside it. See `names.inpage.ts` for what a page-side part may use.
5
5
  */
6
6
  import type { SubjectContext } from "../../BrowserEvent.ts";
7
- import type { FindRequest, Match } from "../../Matching.ts";
7
+ import type { FindRequest, Match } from "../matching.ts";
8
8
  import type { ContextReader } from "./context.inpage.ts";
9
9
  import type { Names } from "./names.inpage.ts";
10
- import type { Walk } from "./walk.inpage.ts";
10
+ import type { Walked } from "./walk.inpage.ts";
11
11
 
12
12
  export const states = (names: Names) => (element: Element, role: string | null) => {
13
13
  const { isDisabled, isInput } = names;
@@ -44,7 +44,7 @@ export const states = (names: Names) => (element: Element, role: string | null)
44
44
 
45
45
  export const subjects = (
46
46
  names: Names,
47
- walked: Walk,
47
+ walked: Walked,
48
48
  matching: Match,
49
49
  placing: ContextReader,
50
50
  stateOf: ReturnType<typeof states>,
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { Names } from "./names.inpage.ts";
8
8
  import type { TextResult } from "./reading.ts";
9
- import type { Walk } from "./walk.inpage.ts";
9
+ import type { Walked } from "./walk.inpage.ts";
10
10
 
11
11
  export interface TextRequest {
12
12
  /** An element to read whole, or null for what the viewport shows. */
@@ -15,7 +15,7 @@ export interface TextRequest {
15
15
  readonly unmask: boolean;
16
16
  }
17
17
 
18
- export const text = (names: Names, walked: Walk) => {
18
+ export const text = (names: Names, walked: Walked) => {
19
19
  const { isHtml, isInput, isSecret, isSelect, isTextArea, lookup } = names;
20
20
 
21
21
  // Input types whose value is a label or a choice rather than something entered.
@@ -237,4 +237,4 @@ export const walk = (names: Names) => {
237
237
  return { acts, boxOf, controlOf, hitAt, inView, visible, visit };
238
238
  };
239
239
 
240
- export type Walk = ReturnType<typeof walk>;
240
+ export type Walked = ReturnType<typeof walk>;
@@ -12,7 +12,7 @@
12
12
  import type { Change } from "../../Change.ts";
13
13
  import type { Known, ContextReader } from "../reading/context.inpage.ts";
14
14
  import type { Names } from "../reading/names.inpage.ts";
15
- import type { Walk } from "../reading/walk.inpage.ts";
15
+ import type { Walked } from "../reading/walk.inpage.ts";
16
16
  import type { ChangesResult } from "./changes.ts";
17
17
  import type { Folded } from "./fold.inpage.ts";
18
18
  import type { History } from "./history.inpage.ts";
@@ -29,7 +29,7 @@ export interface ChangesRequest {
29
29
 
30
30
  export const changes = (
31
31
  names: Names,
32
- walked: Walk,
32
+ walked: Walked,
33
33
  placing: ContextReader,
34
34
  kept: History,
35
35
  seeing: Sight,
@@ -11,10 +11,9 @@
11
11
  import { Clock, Duration, Effect, type Fiber, Schema, Semaphore } from "effect";
12
12
 
13
13
  import type { BrowserError } from "../../BrowserError.ts";
14
- import { Change, Changes } from "../../Change.ts";
15
- import * as BrowserClock from "../../Clock.ts";
14
+ import { Change, Changes, type ChangesOptions } from "../../Change.ts";
16
15
  import type { Frame } from "../../Frame.ts";
17
- import type { ChangesOptions } from "../../Page.ts";
16
+ import * as BrowserClock from "../clock.ts";
18
17
  import { type Bridge, scriptCall } from "../page/bridge.ts";
19
18
  import { decodeWith, type PageContext } from "../page/context.ts";
20
19
  import type { ChangesRequest } from "./changes.inpage.ts";
@@ -158,5 +157,5 @@ export const make = (
158
157
  ),
159
158
  });
160
159
  }).pipe(page.within("changes")),
161
- ).pipe(page.span("Page.changes"), page.owned);
160
+ ).pipe(page.span("Change.read"), page.owned);
162
161
  };
@@ -10,11 +10,11 @@
10
10
  */
11
11
  import type { Names } from "../reading/names.inpage.ts";
12
12
  import type { Texts } from "../reading/text.inpage.ts";
13
- import type { Walk } from "../reading/walk.inpage.ts";
13
+ import type { Walked } from "../reading/walk.inpage.ts";
14
14
  import type { Sample, Shown } from "./fold.inpage.ts";
15
15
  import type { History } from "./history.inpage.ts";
16
16
 
17
- export const sight = (names: Names, walked: Walk, texts: Texts, kept: History) => {
17
+ export const sight = (names: Names, walked: Walked, texts: Texts, kept: History) => {
18
18
  const { clean } = names;
19
19
  const { visible } = walked;
20
20
  // Whether each watched element was in view as the page last rendered it, and whether the style
@@ -7,10 +7,9 @@ import { Duration, Effect, Option, Result, Schema } from "effect";
7
7
 
8
8
  import type { BrowserError } from "../../BrowserError.ts";
9
9
  import { type BrowserEvent, TrackEvent } from "../../BrowserEvent.ts";
10
- import type { Changes } from "../../Change.ts";
10
+ import type { Changes, ChangesOptions } from "../../Change.ts";
11
11
  import { Frame } from "../../Frame.ts";
12
- import type { ChangesOptions, WindowOptions } from "../../Page.ts";
13
- import { Window } from "../../Window.ts";
12
+ import { Window, type WindowOptions } from "../../Window.ts";
14
13
  import { type PageContext, refuse } from "../page/context.ts";
15
14
 
16
15
  const isWindow = Schema.is(Window);
@@ -89,4 +88,4 @@ export const make =
89
88
  changes: Result.getOrUndefined(changes),
90
89
  missing: Option.toArray(Result.getFailure(changes)),
91
90
  });
92
- }).pipe(page.span("Page.window"), page.owned);
91
+ }).pipe(page.span("Window.read"), page.owned);