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
@@ -1,718 +0,0 @@
1
- import { a as PressOptions$1, o as ScrollOptions$1, r as ClickOptions$1, s as TypeOptions$1, t as Action } from "./Action-24sLOubi.mjs";
2
- import { p as PolicyDenied, t as BrowserError } from "./BrowserError-BlcmLVzn.mjs";
3
- import { i as BrowserEvent, p as PageLoaded, r as Box, x as Subject } from "./BrowserEvent-C2p-NwuU.mjs";
4
- import { r as Changes } from "./Change-CxT1mp2e.mjs";
5
- import { a as Image, n as CaptureStats, o as ScreencastOptions, r as Frame } from "./Frame-UEH2hO5T.mjs";
6
- import { i as Point$1, t as Geometry_d_exports } from "./Geometry-DJx9qrYy.mjs";
7
- import { n as Overlay } from "./Overlay-CoGw5tL_.mjs";
8
- import { r as Poses } from "./Pose-2qqGzPvb.mjs";
9
- import { t as Held } from "./PageTime-68UPUZpZ.mjs";
10
- import { n as Snapshot, r as SnapshotOptions } from "./Snapshot-CtBVOtuu.mjs";
11
- import { t as Window } from "./Window-BDa8MtNP.mjs";
12
- import { Clock, Duration, Effect, Schema, Scope, Stream } from "effect";
13
- declare namespace Layout_d_exports {
14
- export { Layout, Pick$1 as Pick, Picks, Place, Rehearsal, Word, place, rehearse };
15
- }
16
- declare const Word_base: Schema.Class<Word, Schema.Struct<{
17
- readonly text: Schema.String;
18
- readonly box: Schema.Struct<{
19
- readonly x: Schema.Finite;
20
- readonly y: Schema.Finite;
21
- readonly width: Schema.Finite;
22
- readonly height: Schema.Finite;
23
- }>;
24
- readonly page: Schema.Struct<{
25
- readonly x: Schema.Finite;
26
- readonly y: Schema.Finite;
27
- readonly width: Schema.Finite;
28
- readonly height: Schema.Finite;
29
- }>;
30
- }>, {}>;
31
- /** A match of a pick's `words`, by its box in the viewport and in the document. */
32
- declare class Word extends Word_base {}
33
- declare const Place_base: Schema.Class<Place, Schema.Struct<{
34
- /** The pick's own name. */
35
- readonly id: Schema.String;
36
- readonly ref: Schema.String;
37
- readonly subject: typeof Subject;
38
- /** Its box in viewport CSS pixels, unrounded, as an `at` point or a frame's pixels place it. */
39
- readonly box: Schema.Struct<{
40
- readonly x: Schema.Finite;
41
- readonly y: Schema.Finite;
42
- readonly width: Schema.Finite;
43
- readonly height: Schema.Finite;
44
- }>;
45
- /** The same box in document CSS pixels: `box` moved by the scroll it was read at. */
46
- readonly page: Schema.Struct<{
47
- readonly x: Schema.Finite;
48
- readonly y: Schema.Finite;
49
- readonly width: Schema.Finite;
50
- readonly height: Schema.Finite;
51
- }>;
52
- /** It keeps its place in the viewport as the page scrolls, so `page` holds only at this scroll. */
53
- readonly fixed: Schema.Boolean;
54
- /** The matches of the pick's `words`, when it gave them, in text order. */
55
- readonly words: Schema.optional<Schema.$Array<typeof Word>>;
56
- }>, {}>;
57
- /** What one pick found. */
58
- declare class Place extends Place_base {}
59
- declare const Layout_base: Schema.Class<Layout, Schema.Struct<{
60
- readonly page: Schema.String;
61
- /** The tracking connection that owns the document counter. */
62
- readonly connection: Schema.String;
63
- /** The document it read, as `Navigated` counts them. */
64
- readonly document: Schema.Int;
65
- readonly url: Schema.String;
66
- /** Host monotonic milliseconds, when it was read. */
67
- readonly at: Schema.Finite;
68
- /** The viewport's size in CSS pixels. */
69
- readonly viewport: Schema.Struct<{
70
- readonly width: Schema.Finite;
71
- readonly height: Schema.Finite;
72
- }>;
73
- /** How far the document was scrolled, in CSS pixels. */
74
- readonly scroll: Schema.Struct<{
75
- readonly x: Schema.Finite;
76
- readonly y: Schema.Finite;
77
- }>;
78
- /** Device pixels to a CSS pixel: a `scale: "device"` picture's pixels per CSS pixel. */
79
- readonly scale: Schema.Finite;
80
- /** One for each pick that found something, in the order the picks were given. */
81
- readonly places: Schema.$Array<typeof Place>;
82
- /** The picks that found nothing. */
83
- readonly missing: Schema.$Array<Schema.String>;
84
- }>, {}>;
85
- /** A page's picked places, and the viewport, scroll and scale they were read at. */
86
- declare class Layout extends Layout_base {}
87
- /**
88
- * A `find` query that names one thing. Its scope defaults to the whole document. Every element it
89
- * finds is a candidate, and `choose` takes one: the first in tree order (the default), the last,
90
- * or the smallest or largest by area. With a selector, the candidates are what it selects that
91
- * shows and meets the other rules, a drawing's elements among them, which `find` leaves out.
92
- */
93
- interface Pick$1 extends FindQuery {
94
- readonly choose?: "first" | "last" | "smallest" | "largest" | undefined;
95
- /**
96
- * Words to box inside it: text, found ignoring case, or a pattern; each match gets its own box,
97
- * across the elements the text is split into. At most 200 for a pick.
98
- */
99
- readonly words?: string | RegExp | undefined;
100
- }
101
- /** Picks by the names their places will carry. */
102
- type Picks = Readonly<Record<string, Pick$1>>;
103
- /** The place a pick named, if it found one. */
104
- declare const place: (layout: Layout, id: string) => Place | undefined;
105
- /** What a rehearsal does, measures, and does to put the page back. */
106
- interface Rehearsal {
107
- readonly act: ReadonlyArray<Action>;
108
- readonly picks: Picks;
109
- readonly undo: ReadonlyArray<Action>;
110
- }
111
- /**
112
- * Measure what exists only after an interaction: perform `act`, wait for the page to be ready,
113
- * read the layout, then perform `undo`, which runs whether or not acting and reading succeeded,
114
- * and is not interrupted. A failure to act or read is the rehearsal's; otherwise one to undo is.
115
- */
116
- declare const rehearse: (page: Page, rehearsal: Rehearsal) => Effect.Effect<Layout, BrowserError>;
117
- declare namespace Page_d_exports {
118
- export { ActOptions, Capture, ChangesOptions, ClickOptions, ElementState, Fact, FindQuery, Found, FrameOptions, InputGuard, InputRequest, Page, Paint, Point, PressOptions, ReadyOptions, Region, ResolvedTarget, ScreenshotOptions, ScriptOptions, ScrollOptions, State, Target, Text, TextOptions, TypeOptions, UntilResult, UntilWant, WindowOptions, Zoom, correlate, failFast, redacted };
119
- }
120
- type Point = Point$1;
121
- /** A ref from a snapshot, such as `"e12"`, or a viewport point. */
122
- type Target = string | Point;
123
- declare const Region_base: Schema.Class<Region, Schema.Struct<{
124
- readonly x: Schema.Int;
125
- readonly y: Schema.Int;
126
- readonly width: Schema.Int;
127
- readonly height: Schema.Int;
128
- }>, {}>;
129
- /** An integer rectangle in viewport CSS pixels. */
130
- declare class Region extends Region_base {}
131
- declare const Zoom_base: Schema.Class<Zoom, Schema.Struct<{
132
- readonly page: Schema.String;
133
- readonly region: typeof Region;
134
- readonly image: typeof Image;
135
- }>, {}>;
136
- /** A crop and its viewport origin: add that origin to a point read from the crop. */
137
- declare class Zoom extends Zoom_base {}
138
- declare const ResolvedTarget_base: Schema.Class<ResolvedTarget, Schema.Struct<{
139
- readonly role: Schema.NullOr<Schema.String>;
140
- readonly name: Schema.String;
141
- readonly tag: Schema.String;
142
- readonly context: Schema.Struct<{
143
- readonly row: Schema.optional<Schema.String>;
144
- readonly column: Schema.optional<Schema.String>;
145
- readonly label: Schema.optional<Schema.String>;
146
- readonly heading: Schema.optional<Schema.String>;
147
- }>;
148
- readonly point: Schema.Struct<{
149
- readonly x: Schema.Finite;
150
- readonly y: Schema.Finite;
151
- }>;
152
- readonly element: Schema.String;
153
- /** For a point target, the box of what it found there. */
154
- readonly box: Schema.optional<Schema.Struct<{
155
- readonly x: Schema.Finite;
156
- readonly y: Schema.Finite;
157
- readonly width: Schema.Finite;
158
- readonly height: Schema.Finite;
159
- }>>;
160
- readonly cursor: Schema.String;
161
- readonly href: Schema.optional<Schema.String>;
162
- }>, {}>;
163
- /** The target as it read before input. Point coordinates are never snapped to another position. */
164
- declare class ResolvedTarget extends ResolvedTarget_base {}
165
- /** Action options share the execution codec. */
166
- type ClickOptions = typeof ClickOptions$1.Type;
167
- type TypeOptions = typeof TypeOptions$1.Type;
168
- type PressOptions = typeof PressOptions$1.Type;
169
- type ScrollOptions = typeof ScrollOptions$1.Type;
170
- /**
171
- * How current a picture must be. The newest screencast frame serves when it qualifies, at no cost;
172
- * otherwise a new screenshot is taken.
173
- */
174
- interface FrameOptions {
175
- /**
176
- * The oldest a reused frame may be, from its paint, at the earliest its timing allows, to now.
177
- * Defaults to 250 milliseconds; 0 always takes a new screenshot.
178
- */
179
- readonly maxAge?: Duration.Input | undefined;
180
- /**
181
- * `"input"`: reuse only a frame painted after this page's latest input, including input of an
182
- * interrupted action, and never while an action is changing the page. For a caller that has
183
- * just acted on the page.
184
- */
185
- readonly after?: "input" | undefined;
186
- }
187
- /** A screenshot reuses only a frame painted after the page's latest input, as `after: "input"`. */
188
- interface ScreenshotOptions {
189
- /** The oldest a reused frame may be, as for `frame`. Defaults to 250 milliseconds. */
190
- readonly maxAge?: Duration.Input | undefined;
191
- /** A region of the viewport, captured in CSS pixels at the viewport's own scale; always new. */
192
- readonly clip?: Box | undefined;
193
- /** JPEG quality, 0 to 100. Defaults to 80. */
194
- readonly quality?: number | undefined;
195
- /** `"jpeg"`, the default, or `"png"`, which is always a new picture. */
196
- readonly format?: "jpeg" | "png" | undefined;
197
- /**
198
- * `"css"`, the default, a picture pixel per CSS pixel; `"device"`, the screen's own pixels, as
199
- * many to a CSS pixel as its device scale factor, which is always a new picture.
200
- */
201
- readonly scale?: "css" | "device" | undefined;
202
- }
203
- /** How a page paints for a scope; see `Page.paint`. */
204
- interface Paint {
205
- /** Device pixels to each CSS pixel, more than 0 and at most 4. The layout keeps its size. */
206
- readonly scale?: number | undefined;
207
- /** False hides the page's scrollbars from its next document on, and its layout takes their room. */
208
- readonly scrollbars?: boolean | undefined;
209
- }
210
- /**
211
- * What `find` looks for. Every rule given must hold; with none, it finds every element in scope
212
- * that has a role or is a control.
213
- */
214
- interface FindQuery {
215
- /** Narrow matching to this CSS selector. Invalid CSS fails InvalidRequest. */
216
- readonly selector?: string | undefined;
217
- /** Require a visible match, optionally enabled. */
218
- readonly state?: "visible" | "enabled" | undefined;
219
- /** An ARIA role, such as `"button"` or `"heading"`, ignoring case. */
220
- readonly role?: string | undefined;
221
- /**
222
- * The accessible name: a string that reads the same once spaces are collapsed and case folded,
223
- * or a pattern found in it.
224
- */
225
- readonly name?: string | RegExp | undefined;
226
- /**
227
- * Text it shows, ignoring case and spacing, or a pattern. Text inside a control or a heading is
228
- * that control's or heading's, and only the smallest element showing it matches, not every
229
- * element around it.
230
- */
231
- readonly text?: string | RegExp | undefined;
232
- /** Whole words in its context (row, column, label or heading), ignoring case and spacing. */
233
- readonly near?: string | undefined;
234
- /** Only what a point action at this viewport point would reach: the control there, or else what is painted there. */
235
- readonly at?: Point | undefined;
236
- /** The viewport (the default), or the whole document. */
237
- readonly scope?: "viewport" | "document" | undefined;
238
- }
239
- /**
240
- * An element's state as its markup gives it: `checked` for what can be checked, `expanded`,
241
- * `selected` and `pressed` where the page says either way, and `level` for headings.
242
- */
243
- declare const ElementState: Schema.Struct<{
244
- readonly disabled: Schema.Boolean;
245
- readonly focused: Schema.Boolean;
246
- readonly checked: Schema.optional<Schema.Boolean>;
247
- readonly expanded: Schema.optional<Schema.Boolean>;
248
- readonly selected: Schema.optional<Schema.Boolean>;
249
- readonly pressed: Schema.optional<Schema.Boolean>;
250
- readonly level: Schema.optional<Schema.Int>;
251
- }>;
252
- type ElementState = typeof ElementState.Type;
253
- declare const Found_base: Schema.Class<Found, Schema.Struct<{
254
- readonly ref: Schema.String;
255
- readonly subject: typeof Subject;
256
- /** Its box, rounded. Reading the document, it may be out of view. */
257
- readonly box: Schema.Struct<{
258
- readonly x: Schema.Finite;
259
- readonly y: Schema.Finite;
260
- readonly width: Schema.Finite;
261
- readonly height: Schema.Finite;
262
- }>;
263
- readonly inViewport: Schema.Boolean;
264
- readonly state: Schema.Struct<{
265
- readonly disabled: Schema.Boolean;
266
- readonly focused: Schema.Boolean;
267
- readonly checked: Schema.optional<Schema.Boolean>;
268
- readonly expanded: Schema.optional<Schema.Boolean>;
269
- readonly selected: Schema.optional<Schema.Boolean>;
270
- readonly pressed: Schema.optional<Schema.Boolean>;
271
- readonly level: Schema.optional<Schema.Int>;
272
- }>;
273
- }>, {}>;
274
- /** An element `find` found: a ref for the actions, what it is, where it is and its state. */
275
- declare class Found extends Found_base {}
276
- interface TextOptions {
277
- /** `"viewport"` (the default) reads what the viewport shows; a ref reads that element whole. */
278
- readonly scope?: string | undefined;
279
- /** Bound on the text's length, cut at a line. Defaults to 12,000 characters. */
280
- readonly maxChars?: number | undefined;
281
- /** Show what fields hold; a secret field still reads `••••`. Defaults to false. */
282
- readonly unmask?: boolean | undefined;
283
- }
284
- declare const Text_base: Schema.Class<Text, Schema.Struct<{
285
- readonly url: Schema.String;
286
- readonly title: Schema.String;
287
- readonly text: Schema.String;
288
- /** True when `text` was cut at `maxChars`. */
289
- readonly truncated: Schema.Boolean;
290
- /** Host monotonic milliseconds from the browser's captured Effect Clock. */
291
- readonly at: Schema.Finite;
292
- }>, {}>;
293
- /** What a page showed as text: a line per block, with table cells apart by tabs. */
294
- declare class Text extends Text_base {}
295
- interface ReadyOptions {
296
- /** How long recorded content must stay unchanged. Screen stillness is a separate feature. */
297
- readonly quietMillis?: number | undefined;
298
- readonly timeout?: Duration.Input | undefined;
299
- }
300
- /** The window `changes` reads, and whether to show what fields hold. */
301
- interface ChangesOptions {
302
- /**
303
- * Where the window starts: the changes a previous read returned, to continue exactly where they
304
- * ended; a frame, at its paint; or host monotonic milliseconds, which mapped to the page's clock
305
- * may miss or repeat changes near the start if the browser's clock mapping changed since. Defaults
306
- * to the start of the record.
307
- */
308
- readonly since?: Changes | Frame | number | undefined;
309
- /**
310
- * Where it ends: a frame, at its paint, so a delayed frame's window holds nothing it does not
311
- * show; or host monotonic milliseconds. Defaults to now, and is never later.
312
- */
313
- readonly until?: Frame | number | undefined;
314
- /** Show what fields hold; a secret field still reads `••••`. Defaults to false. */
315
- readonly unmask?: boolean | undefined;
316
- }
317
- /** The window `window` reads, and whether to show what fields hold. */
318
- interface WindowOptions {
319
- /**
320
- * Where the window starts: a previous window, to continue exactly where it ended; a frame, at its
321
- * paint; host monotonic milliseconds; or a `Duration` back from `until`. A start after `until`
322
- * leaves the window empty there.
323
- */
324
- readonly since: Window | Frame | Duration.Duration | number;
325
- /**
326
- * Where it ends: a frame, at its paint, such as one a delayed consumer airs now; or host
327
- * monotonic milliseconds. Defaults to now, and is never later.
328
- */
329
- readonly until?: Frame | number | undefined;
330
- /** Show what fields hold in its changes; a secret field still reads `••••`. Defaults to false. */
331
- readonly unmask?: boolean | undefined;
332
- }
333
- declare const State_base: Schema.Class<State, Schema.Struct<{
334
- readonly page: Schema.String;
335
- /** The tracking connection that owns this document counter. */
336
- readonly connection: Schema.String;
337
- /** When this was taken. */
338
- readonly at: Schema.Finite;
339
- /** Where the main frame last committed or moved, without userinfo or known secret parameters. */
340
- readonly url: Schema.String;
341
- /** The page's document, as `Navigated` counts them. */
342
- readonly document: Schema.Int;
343
- /** When the main frame committed it; absent for the one the browser began tracking it with. */
344
- readonly committedAt: Schema.optional<Schema.Finite>;
345
- /** How far that document has loaded, as the page's own session heard; absent until parsed. */
346
- readonly load: Schema.optional<typeof PageLoaded>;
347
- /** The newest screencast frame, of whichever document it names. */
348
- readonly frame: Schema.optional<typeof Frame>;
349
- /** Where the overlay's drawing was last drawn, in viewport CSS pixels; absent with none shown. */
350
- readonly overlay: Schema.optional<Schema.$Array<Schema.Struct<{
351
- readonly x: Schema.Finite;
352
- readonly y: Schema.Finite;
353
- readonly width: Schema.Finite;
354
- readonly height: Schema.Finite;
355
- }>>>;
356
- /** The viewport's text as it was last read, with the page's title then. */
357
- readonly text: Schema.optional<typeof Text>;
358
- }>, {}>;
359
- /**
360
- * What the library knows of a page now, without asking it, each part with when it learned it, in
361
- * host monotonic milliseconds: a part's age is `at` less its time. Text read before the current
362
- * document began is left out, since it tells of a document that has gone.
363
- */
364
- declare class State extends State_base {}
365
- /**
366
- * What the page's structure establishes about an input, or says it cannot establish:
367
- *
368
- * - `form-submit`: it submits a form, which sends the form's fields.
369
- * - `cross-origin`: it navigates or submits to another origin.
370
- * - `download`: it follows a download link.
371
- * - `upload`: it opens a file chooser.
372
- * - `secret`: it types, with `type`, into a field marked as a password, a one-time code or a
373
- * card's number, code or expiry, or submits a form holding a filled one.
374
- * - `scripted`: it activates something the browser gives no effect of its own, such as a
375
- * `type="button"` button, a `role="button"` element or a canvas, so only the page's script
376
- * decides what happens.
377
- * - `opaque`: nothing names what receives it: a canvas, a frame or an unnamed element.
378
- *
379
- * Facts never come from what an element's text says. What an input means, such as a payment
380
- * or a deletion, takes a judge that reads the evidence in the {@link InputRequest}.
381
- */
382
- declare const Fact: Schema.Literals<readonly ["form-submit", "cross-origin", "download", "upload", "secret", "scripted", "opaque"]>;
383
- type Fact = typeof Fact.Type;
384
- declare const InputRequest_base: Schema.Class<InputRequest, Schema.Struct<{
385
- readonly page: Schema.String;
386
- /**
387
- * The page's URL, without a fragment that only names a place on the page. This and the other
388
- * addresses keep no userinfo or known secret parameters.
389
- */
390
- readonly url: Schema.String;
391
- /** The page's title, at most 120 characters. */
392
- readonly title: Schema.String;
393
- readonly action: Schema.TaggedUnion<{
394
- readonly Act: Schema.TaggedStruct<"Act", {
395
- readonly document: Schema.Int;
396
- }>;
397
- readonly Back: Schema.TaggedStruct<"Back", {}>;
398
- readonly Click: Schema.TaggedStruct<"Click", {
399
- readonly target: Schema.Union<readonly [Schema.String, Schema.Struct<{
400
- readonly x: Schema.Finite;
401
- readonly y: Schema.Finite;
402
- }>]>;
403
- readonly options: Schema.optional<Schema.Struct<{
404
- readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
405
- readonly clickCount: Schema.optional<Schema.Finite>;
406
- readonly holdMillis: Schema.optional<Schema.Finite>;
407
- }>>;
408
- }>;
409
- readonly Drag: Schema.TaggedStruct<"Drag", {
410
- readonly from: Schema.Union<readonly [Schema.String, Schema.Struct<{
411
- readonly x: Schema.Finite;
412
- readonly y: Schema.Finite;
413
- }>]>;
414
- readonly to: Schema.Union<readonly [Schema.String, Schema.Struct<{
415
- readonly x: Schema.Finite;
416
- readonly y: Schema.Finite;
417
- }>]>;
418
- }>;
419
- readonly Goto: Schema.TaggedStruct<"Goto", {
420
- readonly url: Schema.String;
421
- }>;
422
- readonly Hover: Schema.TaggedStruct<"Hover", {
423
- readonly target: Schema.Union<readonly [Schema.String, Schema.Struct<{
424
- readonly x: Schema.Finite;
425
- readonly y: Schema.Finite;
426
- }>]>;
427
- }>;
428
- readonly Press: Schema.TaggedStruct<"Press", {
429
- readonly keys: Schema.String;
430
- readonly options: Schema.optional<Schema.Struct<{
431
- readonly on: Schema.optional<Schema.String>;
432
- readonly times: Schema.optional<Schema.Finite>;
433
- readonly holdMillis: Schema.optional<Schema.Finite>;
434
- }>>;
435
- }>;
436
- readonly Reload: Schema.TaggedStruct<"Reload", {}>;
437
- readonly Scroll: Schema.TaggedStruct<"Scroll", {
438
- readonly options: Schema.optional<Schema.Struct<{
439
- readonly at: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
440
- readonly x: Schema.Finite;
441
- readonly y: Schema.Finite;
442
- }>]>>;
443
- readonly dx: Schema.optional<Schema.Finite>;
444
- readonly dy: Schema.optional<Schema.Finite>;
445
- }>>;
446
- }>;
447
- readonly Select: Schema.TaggedStruct<"Select", {
448
- readonly ref: Schema.String;
449
- readonly values: Schema.$Array<Schema.String>;
450
- }>;
451
- readonly Type: Schema.TaggedStruct<"Type", {
452
- readonly text: Schema.String;
453
- readonly options: Schema.optional<Schema.Struct<{
454
- readonly into: Schema.optional<Schema.String>;
455
- readonly replace: Schema.optional<Schema.Boolean>;
456
- readonly submit: Schema.optional<Schema.Boolean>;
457
- readonly secret: Schema.optional<Schema.Boolean>;
458
- }>>;
459
- }>;
460
- }>;
461
- readonly target: Schema.optional<Schema.String>;
462
- readonly element: Schema.optional<Schema.String>;
463
- /** Literal pixel targets only; ref coordinates are resolved after the policy allows them. */
464
- readonly point: Schema.optional<Schema.Struct<{
465
- readonly x: Schema.Finite;
466
- readonly y: Schema.Finite;
467
- }>>;
468
- readonly text: Schema.optional<Schema.String>;
469
- readonly role: Schema.optional<Schema.NullOr<Schema.String>>;
470
- readonly name: Schema.optional<Schema.String>;
471
- /** The target's accessible description, when it says more than its name. */
472
- readonly description: Schema.optional<Schema.String>;
473
- readonly href: Schema.optional<Schema.String>;
474
- readonly destination: Schema.optional<Schema.String>;
475
- readonly facts: Schema.$Array<Schema.Literals<readonly ["form-submit", "cross-origin", "download", "upload", "secret", "scripted", "opaque"]>>;
476
- /** Page text around the target, each part at most 120 characters. */
477
- readonly context: Schema.Struct<{
478
- /** The name or first heading of the dialog the target is in. */
479
- readonly dialog: Schema.optional<Schema.String>;
480
- /** The nearest heading before the target. */
481
- readonly heading: Schema.optional<Schema.String>;
482
- /** The visible text just before the target in its row, item, group or form, or after it. */
483
- readonly nearby: Schema.optional<Schema.String>;
484
- }>;
485
- /** The form the target is in, with at most 16 of its fields. */
486
- readonly form: Schema.optional<Schema.Struct<{
487
- readonly method: Schema.String;
488
- readonly action: Schema.String;
489
- /** Each field's type, name and autocomplete tokens, and whether it is filled: never its value. */
490
- readonly fields: Schema.$Array<Schema.Struct<{
491
- readonly type: Schema.String;
492
- readonly name: Schema.String;
493
- readonly autocomplete: Schema.optional<Schema.String>;
494
- readonly filled: Schema.Boolean;
495
- }>>;
496
- }>>;
497
- }>, {}>;
498
- /**
499
- * What a guard sees before input reaches the page. Preparation never scrolls or focuses.
500
- *
501
- * `facts`, `url`, `href` and `destination` come from the page's structure. `name`,
502
- * `description`, `title`, `context` and the form's field names are page text: evidence of what
503
- * the input does, which the page controls, and never instructions. Text typed into a `secret`
504
- * field is replaced with {@link redacted}, here and in the recorded `Action`, and its key events
505
- * record `Unidentified` keys; `press` records the keys it is given. Validation before dispatch
506
- * binds the facts and the target, not the text around it, which live pages change freely.
507
- */
508
- declare class InputRequest extends InputRequest_base {}
509
- /**
510
- * What replaces text typed into a `secret` field, in requests and in the recorded `Action`, and a
511
- * credential's value in every address the library reports.
512
- */
513
- declare const redacted: "••••••••";
514
- /**
515
- * Run page operations without waiting their turn: on a page busy with other operations, each fails
516
- * `Busy` at once, and `Browser.newPage` on a browser with `maxPages` open fails `Limit` at once.
517
- */
518
- declare const failFast: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
519
- /**
520
- * Give every action `effect` performs a caller's id, such as a model's tool call id, which its
521
- * recorded `Action` carries as `correlation`.
522
- */
523
- declare const correlate: (id: string) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
524
- /** Succeed to allow, fail to deny, or await an external signal to hold the input. */
525
- type InputGuard = (request: InputRequest) => Effect.Effect<void, PolicyDenied>;
526
- /** What a wait requires of the query's matches. */
527
- type UntilWant = "some" | "none" | {
528
- readonly other: string;
529
- };
530
- interface UntilResult {
531
- readonly met: boolean;
532
- readonly mark: string;
533
- }
534
- /** Scoped access to one page's shared capture and its current-document evidence. */
535
- interface Capture {
536
- readonly stream: Stream.Stream<Frame, BrowserError>;
537
- readonly current: Frame | undefined;
538
- readonly isCurrent: (frame: Frame) => boolean;
539
- readonly confirm: (frame: Frame) => Effect.Effect<boolean, BrowserError>;
540
- readonly sync: Effect.Effect<void, BrowserError>;
541
- readonly stats: (options?: {
542
- readonly window?: Duration.Input | undefined;
543
- }) => Effect.Effect<CaptureStats, BrowserError>;
544
- }
545
- /** Script values cross the page boundary through the caller's Schema. A bundler may rewrite functions. */
546
- interface ScriptOptions<A, Arg> {
547
- readonly arg: Arg;
548
- readonly result: Schema.Codec<A, unknown>;
549
- }
550
- interface ActOptions<A, Arg> extends ScriptOptions<A, Arg> {
551
- readonly document: number;
552
- /** Supplying the read's connection also refuses a document counter from another connection. */
553
- readonly connection?: string | undefined;
554
- }
555
- interface Page {
556
- /** Decode and perform a data action through the same policy and lane as the named methods. */
557
- readonly perform: (action: Action) => Effect.Effect<ResolvedTarget | string | void, BrowserError>;
558
- /** Read declared side-effect-free code in the main world, retrying one replaced document. */
559
- readonly read: <A, Arg>(script: (arg: Arg) => unknown, options: ScriptOptions<A, Arg>) => Effect.Effect<{
560
- readonly value: A;
561
- readonly document: number;
562
- readonly connection: string;
563
- }, BrowserError>;
564
- /**
565
- * Run code as a guarded, recorded action bound to the caller's document.
566
- * A timeout or cancellation cannot stop JavaScript already running: later input waits for its
567
- * actual reply. Close the page and open a replacement if the script never settles.
568
- */
569
- readonly act: <A, Arg>(script: (arg: Arg) => unknown, options: ActOptions<A, Arg>) => Effect.Effect<A, BrowserError>;
570
- /** Owning browser clock: deadlines and all frame/event timestamps use this clock. */
571
- readonly clock: Clock.Clock;
572
- /** Wait for admitted input and retain a bounded read turn through effect. */
573
- readonly afterInput: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | BrowserError, R>;
574
- /** A scoped lease starts capture immediately, independently of its first frame. */
575
- readonly capture: (options?: ScreencastOptions) => Effect.Effect<Capture, BrowserError, Scope.Scope>;
576
- /** One page-side wait; replaced documents share one deadline. Unmet is met:false; an empty mark means no stable document could be sampled. */
577
- readonly until: (query: FindQuery, want: UntilWant, millis: number) => Effect.Effect<UntilResult, BrowserError>;
578
- /** The page's CDP target id: the same page has it again after a reconnect to its browser. */
579
- readonly id: string;
580
- /** The page's address, without its userinfo or known secret parameters. */
581
- readonly url: Effect.Effect<string>;
582
- /**
583
- * The document's title as the page last set it, empty for an untitled page. The browser answers
584
- * it, in one call, so a page busy with a script cannot hold it up.
585
- */
586
- readonly title: Effect.Effect<string, BrowserError>;
587
- readonly goto: (url: string) => Effect.Effect<void, BrowserError>;
588
- /** The previous history entry, including one only a frame created; `NotFound` when none. */
589
- readonly back: Effect.Effect<void, BrowserError>;
590
- readonly reload: Effect.Effect<void, BrowserError>;
591
- /** Make this the visible tab. Background tabs paint rarely and send few screencast frames. */
592
- readonly bringToFront: Effect.Effect<void, BrowserError>;
593
- /** Close the tab, succeeding once it has closed, or at once when it already had. */
594
- readonly close: Effect.Effect<void, BrowserError>;
595
- readonly snapshot: (options?: SnapshotOptions) => Effect.Effect<Snapshot, BrowserError>;
596
- /**
597
- * A picture of the viewport, in CSS pixels: a screencast frame painted since the page's latest
598
- * input, if one qualifies, or a new one. A caller that has just acted sees what its action did.
599
- */
600
- readonly screenshot: (options?: ScreenshotOptions) => Effect.Effect<Image, BrowserError>;
601
- /**
602
- * The viewport with its timing: the newest screencast frame if it qualifies, else a new
603
- * screenshot timed by the host interval in which it was taken.
604
- */
605
- readonly frame: (options?: FrameOptions) => Effect.Effect<Frame, BrowserError>;
606
- /**
607
- * A crop in CSS pixels, unmagnified, with the origin that keeps later input in viewport pixels.
608
- * With `scale: "device"` its picture has the screen's own pixels, as a screenshot's would.
609
- */
610
- readonly zoom: (region: Region, options?: Pick<ScreenshotOptions, "scale">) => Effect.Effect<Zoom, BrowserError>;
611
- /**
612
- * The viewport's size in CSS pixels, the space of points, crops and page scrolls. Over CDP the
613
- * page reports it, within the action timeout.
614
- */
615
- readonly viewport: Effect.Effect<{
616
- readonly width: number;
617
- readonly height: number;
618
- }, BrowserError>;
619
- /**
620
- * The elements that match a query, in tree order, with refs the actions take, in one call to the
621
- * page. All that match are returned, so a caller tells them apart by their context; none is an
622
- * empty result, not a failure.
623
- */
624
- readonly find: (query?: FindQuery) => Effect.Effect<ReadonlyArray<Found>, BrowserError>;
625
- /**
626
- * Where each pick is, in one call to the page: its box unrounded, in the viewport and in the
627
- * document, the boxes of words in it, and the viewport, scroll and scale they were read at. A
628
- * pick that finds nothing is listed as missing, not a failure. See `Layout`.
629
- */
630
- readonly layout: (picks: Picks) => Effect.Effect<Layout, BrowserError>;
631
- /**
632
- * A layer over the page to draw into, for the scope, that the library's readers never read.
633
- * One at a time: a second while one is open fails `InvalidRequest`. See `Overlay`.
634
- */
635
- readonly overlay: Effect.Effect<Overlay, BrowserError, Scope.Scope>;
636
- /**
637
- * Pose the page's own elements for the scope, moved, turned and scaled as a caller says, and put
638
- * back when the scope closes. One lease at a time: a second while one is open fails
639
- * `InvalidRequest`. See `Pose`.
640
- */
641
- readonly poses: Effect.Effect<Poses, BrowserError, Scope.Scope>;
642
- /**
643
- * Hold the page's own time for the scope, to step it on with `advance`; real time resumes when
644
- * the scope closes. Needs the browser's `pageTime` option; one hold at a time. See `PageTime`.
645
- */
646
- readonly hold: Effect.Effect<Held, BrowserError, Scope.Scope>;
647
- /**
648
- * The text the viewport shows, or one element whole, in one call to the page. Field values read
649
- * `••••` unless `unmask`, and a secret field's always do, as does one that was secret when the
650
- * library saw it.
651
- */
652
- readonly text: (options?: TextOptions) => Effect.Effect<Text, BrowserError>;
653
- /**
654
- * What visibly changed over a window, in one call to the page. The first read starts the page's
655
- * record, so it finds none; from then the page records, and from the start of each later
656
- * document, until nobody has read it for two minutes. See `Change`.
657
- */
658
- readonly changes: (options?: ChangesOptions) => Effect.Effect<Changes, BrowserError>;
659
- /**
660
- * The page's events, changes and frames over a window: the frames and events it keeps, at no
661
- * call, and its changes, in one call, the first starting its record as `changes` does. A part
662
- * that cannot be read is missing, with why; the window fails only for bounds that are not finite.
663
- */
664
- readonly window: (options: WindowOptions) => Effect.Effect<Window, BrowserError>;
665
- /**
666
- * What the library knows of the page now, at no call and with no wait for its turn: where it is,
667
- * its document and how far it has loaded, its newest frame, and its text and title as last read.
668
- */
669
- readonly state: Effect.Effect<State>;
670
- /**
671
- * Paint the page at `scale` device pixels to each CSS pixel, or without its scrollbars, for a
672
- * scope: a screenshot with `scale: "device"` then has that many more pixels, while the layout,
673
- * its boxes and input keep their CSS pixels. Scrollbars go from the next document on, and come
674
- * back from the next after the scope, so paint, then load the page, then measure it. One at a
675
- * time. A browser this library launched paints at the scale of its launch (Chromium's
676
- * `deviceScaleFactor`), and refuses another.
677
- */
678
- readonly paint: (options: Paint) => Effect.Effect<void, BrowserError, Scope.Scope>;
679
- readonly click: (target: Target, options?: ClickOptions) => Effect.Effect<ResolvedTarget, BrowserError>;
680
- readonly hover: (target: Target) => Effect.Effect<void, BrowserError>;
681
- readonly drag: (from: Target, to: Target) => Effect.Effect<void, BrowserError>;
682
- /** Type into a text field, or to whatever has focus unless a typed key could activate it. */
683
- readonly type: (text: string, options?: TypeOptions) => Effect.Effect<void, BrowserError>;
684
- /** Keys such as `"Enter"`, `"Space"`, `"ArrowLeft"` or `"Control+A"`. */
685
- readonly press: (keys: string, options?: PressOptions) => Effect.Effect<void, BrowserError>;
686
- readonly scroll: (options?: ScrollOptions) => Effect.Effect<void, BrowserError>;
687
- /**
688
- * Choose options of a `<select>` by value or label; returns the chosen labels. A refusal, such
689
- * as no matching option, is undispatched.
690
- */
691
- readonly select: (ref: string, values: ReadonlyArray<string>) => Effect.Effect<string, BrowserError>;
692
- /**
693
- * Wait for document evidence, polling every 50 ms: parsed, painted, visible, fonts and visible
694
- * images loaded, and finite animations finished. Optional quietMillis requires recorded content
695
- * to stay unchanged. Screen or foreground stillness belongs to the Stillness feature.
696
- * Fails Timeout after timeout, 15 seconds by default.
697
- */
698
- readonly ready: (options?: ReadyOptions) => Effect.Effect<void, BrowserError>;
699
- /**
700
- * Screencast frames for as long as the stream runs. Concurrent streams share one screencast and
701
- * its settings; explicit options that differ from a running screencast's fail with InvalidRequest.
702
- */
703
- readonly screencast: (options?: ScreencastOptions) => Stream.Stream<Frame, BrowserError>;
704
- /**
705
- * What this page's captures received, delivered and dropped, over its life or the latest
706
- * `window`, which reaches back at most a minute; a longer one is an `InvalidRequest`.
707
- */
708
- readonly captureStats: (options?: {
709
- readonly window?: Duration.Input | undefined;
710
- }) => Effect.Effect<CaptureStats, BrowserError>;
711
- /** Screencast frames painted within `frameHistory` of the newest, oldest first. */
712
- readonly recentFrames: Effect.Effect<ReadonlyArray<Frame>>;
713
- /** This page's events among the browser's latest `eventHistory`, oldest first. */
714
- readonly recentEvents: Effect.Effect<ReadonlyArray<BrowserEvent>>;
715
- }
716
- //#endregion
717
- export { WindowOptions as A, Rehearsal as B, State as C, TypeOptions as D, TextOptions as E, Layout as F, place as H, Layout_d_exports as I, Pick$1 as L, correlate as M, failFast as N, UntilResult as O, redacted as P, Picks as R, ScrollOptions as S, Text as T, rehearse as U, Word as V, ReadyOptions as _, ElementState as a, ScreenshotOptions as b, Found as c, InputRequest as d, Page as f, PressOptions as g, Point as h, ClickOptions as i, Zoom as j, UntilWant as k, FrameOptions as l, Paint as m, Capture as n, Fact as o, Page_d_exports as p, ChangesOptions as r, FindQuery as s, ActOptions as t, InputGuard as u, Region as v, Target as w, ScriptOptions as x, ResolvedTarget as y, Place as z };
718
- //# sourceMappingURL=Page-CLzh5E9w.d.mts.map