effect-browser 0.3.0-beta.21 → 0.3.0-beta.23

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 (249) hide show
  1. package/README.md +130 -159
  2. package/dist/Action-24sLOubi.d.mts +110 -0
  3. package/dist/Action.d.mts +2 -0
  4. package/dist/Action.mjs +141 -0
  5. package/dist/Action.mjs.map +1 -0
  6. package/dist/ActionPort.d.mts +15 -0
  7. package/dist/ActionPort.mjs +101 -0
  8. package/dist/ActionPort.mjs.map +1 -0
  9. package/dist/Browser-BKPAbyys.mjs +4076 -0
  10. package/dist/Browser-BKPAbyys.mjs.map +1 -0
  11. package/dist/{Browser-CiXHT1yO.d.mts → Browser-wZhwZSlG.d.mts} +51 -13
  12. package/dist/Browser.d.mts +2 -2
  13. package/dist/Browser.mjs +1 -1
  14. package/dist/{BrowserError-Coy7EW1N.d.mts → BrowserError-BlcmLVzn.d.mts} +22 -7
  15. package/dist/BrowserError.d.mts +2 -2
  16. package/dist/BrowserError.mjs +46 -9
  17. package/dist/BrowserError.mjs.map +1 -1
  18. package/dist/{BrowserEvent-dq6FRT8w.d.mts → BrowserEvent-lLqJ3GJS.d.mts} +93 -37
  19. package/dist/BrowserEvent.d.mts +2 -2
  20. package/dist/BrowserEvent.mjs +29 -24
  21. package/dist/BrowserEvent.mjs.map +1 -1
  22. package/dist/{Change-DqING3tr.d.mts → Change-Ba7INmay.d.mts} +4 -6
  23. package/dist/Change.d.mts +2 -2
  24. package/dist/Change.mjs +97 -2
  25. package/dist/Change.mjs.map +1 -0
  26. package/dist/Clock.d.mts +57 -0
  27. package/dist/Clock.mjs +80 -0
  28. package/dist/Clock.mjs.map +1 -0
  29. package/dist/{Frame-DkNdjjjr.d.mts → Frame-UEH2hO5T.d.mts} +10 -3
  30. package/dist/Frame.d.mts +2 -2
  31. package/dist/Frame.mjs +10 -2
  32. package/dist/Frame.mjs.map +1 -1
  33. package/dist/{Motion-DND6I-64.d.mts → Geometry-DJx9qrYy.d.mts} +7 -10
  34. package/dist/Geometry.d.mts +2 -0
  35. package/dist/Geometry.mjs +32 -0
  36. package/dist/Geometry.mjs.map +1 -0
  37. package/dist/Matching.d.mts +37 -0
  38. package/dist/Matching.mjs +72 -0
  39. package/dist/Matching.mjs.map +1 -0
  40. package/dist/Page-BF5izr8R.mjs +795 -0
  41. package/dist/Page-BF5izr8R.mjs.map +1 -0
  42. package/dist/{Page-ku6j5t-v.d.mts → Page-CvsOEorc.d.mts} +158 -185
  43. package/dist/Page.d.mts +2 -2
  44. package/dist/Page.mjs +1 -1
  45. package/dist/Released-tURbFmal.d.mts +15 -0
  46. package/dist/{Snapshot-B34hZ4Jl.d.mts → Snapshot-CtBVOtuu.d.mts} +6 -1
  47. package/dist/Snapshot.d.mts +1 -1
  48. package/dist/Snapshot.mjs.map +1 -1
  49. package/dist/Stillness-CNlvayIo.mjs +136 -0
  50. package/dist/Stillness-CNlvayIo.mjs.map +1 -0
  51. package/dist/Style-AO4V7Czt.mjs +357 -0
  52. package/dist/Style-AO4V7Czt.mjs.map +1 -0
  53. package/dist/Style.d.mts +72 -0
  54. package/dist/Style.mjs +2 -0
  55. package/dist/Url.d.mts +26 -0
  56. package/dist/Url.mjs +74 -0
  57. package/dist/Url.mjs.map +1 -0
  58. package/dist/Window-CMddGMt1.d.mts +34 -0
  59. package/dist/Window.d.mts +2 -0
  60. package/dist/Window.mjs +35 -0
  61. package/dist/Window.mjs.map +1 -0
  62. package/dist/{cdp-DL7XfEj5.d.mts → connection-2KHI4_KN.d.mts} +4 -4
  63. package/dist/{cdp-BMpYMWYe.mjs → connection-CK83pvqP.mjs} +5 -6
  64. package/dist/connection-CK83pvqP.mjs.map +1 -0
  65. package/dist/index.d.mts +15 -18
  66. package/dist/index.mjs +11 -15
  67. package/dist/moment/Moment.d.mts +86 -0
  68. package/dist/{Moment.mjs → moment/Moment.mjs} +44 -38
  69. package/dist/moment/Moment.mjs.map +1 -0
  70. package/dist/{Plan-DJ4hEEna.d.mts → plan/index.d.mts} +169 -64
  71. package/dist/{Plan-BG1WifW2.mjs → plan/index.mjs} +122 -199
  72. package/dist/plan/index.mjs.map +1 -0
  73. package/dist/{Policy-BGWjbqCl.d.mts → policy/Policy.d.mts} +16 -20
  74. package/dist/{Policy.mjs → policy/Policy.mjs} +11 -21
  75. package/dist/policy/Policy.mjs.map +1 -0
  76. package/dist/presentation/Motion.d.mts +12 -0
  77. package/dist/{Motion.mjs → presentation/Motion.mjs} +4 -27
  78. package/dist/presentation/Motion.mjs.map +1 -0
  79. package/dist/presentation/Presentation.d.mts +30 -0
  80. package/dist/presentation/Presentation.mjs +105 -0
  81. package/dist/presentation/Presentation.mjs.map +1 -0
  82. package/dist/{Stage-NHp8N81k.d.mts → presentation/Stage.d.mts} +12 -15
  83. package/dist/{Stage.mjs → presentation/Stage.mjs} +68 -76
  84. package/dist/presentation/Stage.mjs.map +1 -0
  85. package/dist/presentation/feed.d.mts +20 -0
  86. package/dist/presentation/feed.mjs +18 -0
  87. package/dist/presentation/feed.mjs.map +1 -0
  88. package/dist/providers/Cdp.d.mts +9 -0
  89. package/dist/{Cdp.mjs → providers/Cdp.mjs} +3 -8
  90. package/dist/providers/Cdp.mjs.map +1 -0
  91. package/dist/{Chromium.d.mts → providers/Chromium.d.mts} +6 -7
  92. package/dist/{Chromium.mjs → providers/Chromium.mjs} +6 -15
  93. package/dist/providers/Chromium.mjs.map +1 -0
  94. package/dist/providers/Released.d.mts +2 -0
  95. package/dist/providers/Released.mjs +12 -0
  96. package/dist/providers/Released.mjs.map +1 -0
  97. package/dist/stillness/Stillness.d.mts +12 -0
  98. package/dist/stillness/Stillness.mjs +2 -0
  99. package/dist/supervisor/Supervisor.d.mts +104 -0
  100. package/dist/supervisor/Supervisor.mjs +515 -0
  101. package/dist/supervisor/Supervisor.mjs.map +1 -0
  102. package/dist/testing/index.d.mts +337 -0
  103. package/dist/testing/index.mjs +515 -0
  104. package/dist/testing/index.mjs.map +1 -0
  105. package/dist/workerd/Cdp.d.mts +8 -3
  106. package/dist/workerd/Cdp.mjs +2 -7
  107. package/dist/workerd/Cdp.mjs.map +1 -1
  108. package/package.json +89 -39
  109. package/src/Action.ts +127 -0
  110. package/src/ActionPort.ts +128 -0
  111. package/src/Browser.ts +352 -201
  112. package/src/BrowserError.ts +63 -6
  113. package/src/BrowserEvent.ts +26 -25
  114. package/src/Change.ts +0 -2
  115. package/src/{internal/pictures/clock.ts → Clock.ts} +17 -6
  116. package/src/Frame.ts +14 -0
  117. package/src/Geometry.ts +48 -0
  118. package/src/{internal/reading/match.inpage.ts → Matching.ts} +34 -4
  119. package/src/Page.ts +111 -92
  120. package/src/Snapshot.ts +5 -0
  121. package/src/{internal/input/style.ts → Style.ts} +121 -14
  122. package/src/Window.ts +30 -0
  123. package/src/index.ts +15 -6
  124. package/src/internal/input/actions.ts +61 -119
  125. package/src/internal/input/dispatch.ts +3 -3
  126. package/src/internal/input/gate.ts +21 -18
  127. package/src/internal/input/guard.inpage.ts +25 -58
  128. package/src/internal/input/guard.ts +11 -20
  129. package/src/internal/input/keyboard.ts +12 -3
  130. package/src/internal/input/perform.ts +78 -60
  131. package/src/internal/input/pointer.ts +4 -2
  132. package/src/internal/input/settle.ts +7 -5
  133. package/src/internal/input/targets.inpage.ts +1 -1
  134. package/src/internal/input/targets.ts +4 -9
  135. package/src/internal/page/bridge.ts +209 -113
  136. package/src/internal/page/context.ts +12 -59
  137. package/src/internal/page/dialogs.ts +58 -0
  138. package/src/internal/page/identity.ts +6 -5
  139. package/src/internal/page/lane.ts +14 -15
  140. package/src/internal/page/navigation.ts +50 -42
  141. package/src/internal/page/openings.ts +11 -5
  142. package/src/internal/page/page.ts +44 -81
  143. package/src/internal/page/port.ts +125 -0
  144. package/src/internal/{input → page}/replies.ts +1 -1
  145. package/src/internal/page/request-owner.ts +269 -0
  146. package/src/internal/page/requests.ts +357 -0
  147. package/src/internal/page/scripts.ts +124 -0
  148. package/src/internal/pictures/capture.ts +255 -332
  149. package/src/internal/pictures/dimensions.ts +162 -0
  150. package/src/internal/pictures/frame.ts +68 -0
  151. package/src/internal/pictures/pictures.ts +57 -23
  152. package/src/internal/pictures/quiescence.ts +1 -1
  153. package/src/internal/pictures/state.ts +26 -0
  154. package/src/internal/pictures/transport.ts +21 -4
  155. package/src/internal/reading/controls.inpage.ts +5 -70
  156. package/src/internal/reading/expect.inpage.ts +13 -17
  157. package/src/internal/reading/names.inpage.ts +89 -45
  158. package/src/internal/reading/outline.inpage.ts +6 -7
  159. package/src/internal/reading/reading.ts +144 -176
  160. package/src/internal/reading/ready.inpage.ts +6 -17
  161. package/src/internal/reading/ready.ts +13 -135
  162. package/src/internal/reading/subjects.inpage.ts +83 -43
  163. package/src/internal/reading/walk.inpage.ts +33 -13
  164. package/src/internal/timeline/changes.ts +55 -6
  165. package/src/internal/timeline/events.ts +15 -5
  166. package/src/internal/timeline/history.inpage.ts +1 -1
  167. package/src/internal/timeline/record.inpage.ts +4 -1
  168. package/src/internal/timeline/window.ts +2 -1
  169. package/src/{Moment.ts → moment/Moment.ts} +13 -31
  170. package/src/{internal/timeline → moment}/words.ts +2 -2
  171. package/src/{internal/reading → plan}/choose.ts +3 -3
  172. package/src/plan/data.ts +117 -0
  173. package/src/plan/execute.ts +411 -0
  174. package/src/plan/index.ts +36 -0
  175. package/src/plan/record.ts +71 -0
  176. package/src/plan/targets.ts +71 -0
  177. package/src/{Policy.ts → policy/Policy.ts} +13 -10
  178. package/src/{Motion.ts → presentation/Motion.ts} +12 -46
  179. package/src/presentation/Presentation.ts +176 -0
  180. package/src/{Stage.ts → presentation/Stage.ts} +147 -112
  181. package/src/presentation/feed.ts +21 -0
  182. package/src/{Cdp.ts → providers/Cdp.ts} +2 -2
  183. package/src/{Chromium.ts → providers/Chromium.ts} +7 -10
  184. package/src/providers/Released.ts +13 -0
  185. package/src/{internal/cdp.ts → providers/connection.ts} +2 -2
  186. package/src/{internal/pictures/motion.ts → stillness/Pixels.ts} +1 -1
  187. package/src/stillness/Stillness.ts +166 -0
  188. package/src/supervisor/Supervisor.ts +170 -0
  189. package/src/supervisor/contract.ts +105 -0
  190. package/src/supervisor/lifecycle.ts +272 -0
  191. package/src/supervisor/runtime.ts +238 -0
  192. package/src/testing/TestBrowser.ts +115 -0
  193. package/src/testing/TestPage.ts +10 -0
  194. package/src/testing/evidence.ts +154 -0
  195. package/src/testing/index.ts +3 -0
  196. package/src/testing/model.ts +222 -0
  197. package/src/testing/page.ts +360 -0
  198. package/src/workerd/Cdp.ts +2 -2
  199. package/dist/Browser-CxXUjxOp.mjs +0 -619
  200. package/dist/Browser-CxXUjxOp.mjs.map +0 -1
  201. package/dist/Cdp-CzCRnMlM.d.mts +0 -10
  202. package/dist/Cdp.d.mts +0 -11
  203. package/dist/Cdp.mjs.map +0 -1
  204. package/dist/Change-DNvztNLu.mjs +0 -138
  205. package/dist/Change-DNvztNLu.mjs.map +0 -1
  206. package/dist/Chromium.mjs.map +0 -1
  207. package/dist/Expect-u3P_ENLX.d.mts +0 -62
  208. package/dist/Expect.d.mts +0 -2
  209. package/dist/Expect.mjs +0 -114
  210. package/dist/Expect.mjs.map +0 -1
  211. package/dist/Moment.d.mts +0 -2
  212. package/dist/Moment.mjs.map +0 -1
  213. package/dist/Motion.d.mts +0 -2
  214. package/dist/Motion.mjs.map +0 -1
  215. package/dist/Page-BP02bmNv.mjs +0 -264
  216. package/dist/Page-BP02bmNv.mjs.map +0 -1
  217. package/dist/Plan-BG1WifW2.mjs.map +0 -1
  218. package/dist/Plan.d.mts +0 -2
  219. package/dist/Plan.mjs +0 -2
  220. package/dist/Policy.d.mts +0 -2
  221. package/dist/Policy.mjs.map +0 -1
  222. package/dist/Presentation-DxVikn9_.d.mts +0 -48
  223. package/dist/Presentation.d.mts +0 -2
  224. package/dist/Presentation.mjs +0 -118
  225. package/dist/Presentation.mjs.map +0 -1
  226. package/dist/Stage.d.mts +0 -2
  227. package/dist/Stage.mjs.map +0 -1
  228. package/dist/Supervisor-2mPjIYYs.mjs +0 -676
  229. package/dist/Supervisor-2mPjIYYs.mjs.map +0 -1
  230. package/dist/Supervisor-CfRxbaso.d.mts +0 -317
  231. package/dist/Supervisor.d.mts +0 -2
  232. package/dist/Supervisor.mjs +0 -2
  233. package/dist/cdp-BMpYMWYe.mjs.map +0 -1
  234. package/dist/context-EGhOqjNN.mjs +0 -335
  235. package/dist/context-EGhOqjNN.mjs.map +0 -1
  236. package/dist/page-PTM8m5wC.mjs +0 -4057
  237. package/dist/page-PTM8m5wC.mjs.map +0 -1
  238. package/dist/url-Bsp2y55M.mjs +0 -264
  239. package/dist/url-Bsp2y55M.mjs.map +0 -1
  240. package/dist/workerd/index.d.mts +0 -16
  241. package/dist/workerd/index.mjs +0 -17
  242. package/src/Expect.ts +0 -180
  243. package/src/Plan.ts +0 -674
  244. package/src/Presentation.ts +0 -196
  245. package/src/Supervisor.ts +0 -632
  246. package/src/internal/supervisor/lifecycle.ts +0 -484
  247. package/src/workerd/index.ts +0 -17
  248. /package/src/{internal/page/url.ts → Url.ts} +0 -0
  249. /package/src/{internal/pictures → stillness}/utilsBundle.d.ts +0 -0
package/README.md CHANGED
@@ -24,12 +24,12 @@ with it, since its pipe closes, but leaves Playwright's temporary profile behind
24
24
 
25
25
  | Module | What it holds |
26
26
  | -------------- | --------------------------------------------------------------------------------- |
27
- | `Browser` | The `Browser` service: tabs, recent events and the Playwright context |
27
+ | `Browser` | The `Browser` service: tabs, recent events, lifetime and input suspension |
28
28
  | `Chromium` | A local Chromium as a `Browser` layer |
29
29
  | `Cdp` | Any DevTools endpoint as a `Browser` layer |
30
30
  | `Page` | One tab: navigation, reads, screenshots, input, waits and the screencast |
31
31
  | `Snapshot` | The model-readable outline of a page, with refs for its controls |
32
- | `Frame` | A screencast frame |
32
+ | `Frame` | Pictures, timing evidence and capture identity |
33
33
  | `BrowserEvent` | Tabs, documents, loads, actions, dialogs, pointer motion and the browser's end |
34
34
  | `Motion` | A bounded pointer planner, as a value, and the tuned sigma-lognormal one |
35
35
  | `Presentation` | Input performed for viewers: a presenter, and its views of pages |
@@ -41,6 +41,12 @@ with it, since its pipe closes, but leaves Playwright's temporary profile behind
41
41
  | `Plan` | A walk recorded from a page's events, replayed on a fresh page by subject |
42
42
  | `Supervisor` | A browser kept open across losses and session ends, as generations |
43
43
 
44
+ Providers and features use explicit subpaths, such as `effect-browser/Chromium` and
45
+ `effect-browser/Plan`. The root exports the kernel. `Action`, `ActionPort`, `Clock`, `Geometry`,
46
+ `Matching`, `Style` and `Window` provide its execution, timing, matching and observation contracts.
47
+ `effect-browser/Stillness` owns screen/content quiet waits. `effect-browser/testing` exports
48
+ seeded TestPage/TestBrowser services; they execute explicit test data and refuse page scripts.
49
+
44
50
  ## Runtime CDP connectors
45
51
 
46
52
  `Cdp.open` and `Cdp.layer` accept `connect: Cdp.Connector`, a callback receiving the endpoint and
@@ -114,7 +120,7 @@ Pass `nativeConnect` as `connect` to `Cdp.open` or `Cdp.layer`, or to the Browse
114
120
  The `workerd` export condition selects a CDP entry without the Node transport. It requires
115
121
  `connect`; omitting it fails with `BrowserError` reason `InvalidRequest`. The Workers root entry
116
122
  excludes local `Chromium`; import `effect-browser/Cdp` for remote connections. Bundlers must select
117
- the `workerd` condition, and Workers must enable `nodejs_compat`. The consumer still supplies and qualifies the runtime's Playwright
123
+ the `workerd` condition. Local Worker/CDP checks also pass without `nodejs_compat`; the consumer still supplies and qualifies the runtime's Playwright
118
124
  implementation against this package's Playwright peer; the seam does not certify a different
119
125
  Playwright version or provide a Cloudflare connector.
120
126
 
@@ -128,13 +134,40 @@ keep them out of logs and model inputs. Connect failures retain typed reasons an
128
134
  endpoint's userinfo, path and query. A failure diagnostic that echoes a nonempty supplied header
129
135
  value is withheld entirely, including in serialized errors.
130
136
 
137
+ `page.perform(action)` and the named input methods share the `Action` schema. Guards receive
138
+ that value as `InputRequest.action`; event records and plans preserve it with secret text redacted.
139
+ `page.read(fn, { arg, result })` returns `{ value, document, connection }` after schema decoding.
140
+ `page.act(fn, { arg, result, document, connection })` validates the document and optional connection,
141
+ passes the input guard as an opaque scripted action, and records dispatch before evaluation.
142
+ Scripts run in the main world; keep them self-contained because bundlers can rewrite functions.
143
+ Neither source nor arguments are recorded. A timed-out or cancelled `act` may still execute;
144
+ later input retains its ordering by waiting for that script's actual reply. If it never settles,
145
+ use `page.close` and open a replacement page. A caller timeout is not script cancellation.
146
+ `Browser.Options.viewport` is fixed at registration;
147
+ `requests` installs bounded allow/refuse/fulfill decisions for its context before pages open,
148
+ including each redirect hop. A decision sees the exact UTF-8 request body, or `null` when absent;
149
+ incomplete or binary body evidence refuses the request and ends the connection's authority.
150
+ Installation refuses contexts with preexisting workers because Chrome does not expose their
151
+ traffic to a newly enabled browser interceptor. Workers created after installation are covered.
152
+ Policies receive only their own context's traffic. Refusal events include the containing page only
153
+ when established; worker and out-of-process iframe requests can omit it. Decision failure, timeout, unknown ownership
154
+ and saturated queues end authority. Closing the scope attempts to settle paused traffic first; when ownership
155
+ cannot be established it closes only that context's targets. Failed cleanup remains observable,
156
+ but detachment can release unresolved traffic. Enforcement lasts for this connection's scope; CDP disconnection removes interception, so this
157
+ request-control API does not provide a network firewall for an external browser after disconnect.
158
+ Raw Playwright pages and contexts are no longer public members.
159
+
131
160
  A snapshot outlines the viewport, or the whole page, with a ref such as `e12` on each control, and
132
161
  lists those controls as values, `Snapshot.Control`: each one's ref, kind, name and what it holds,
133
162
  a select's options, and whether it is disabled, checked or takes typed text. `within` reads only
134
163
  inside the elements a CSS selector matches, and `query` keeps the lines that hold some text.
135
- `Page.waitFor` waits, in one call the page answers as it comes, until what a selector matches
136
- shows, hides or is enabled, with some text if asked. `press` takes `on`, a ref it focuses before the
137
- first key, such as a link only the keyboard reaches. `Change.describe` tells a change in the words
164
+ `Page.until(query, want, millis)` waits using `find` matching, including CSS `selector` and
165
+ `state: "enabled"`. It searches the document by default. `want` is `"some"`, `"none"`, or
166
+ `{ other: previous.mark }`; comparison marks reveal no text or values and ignore focus.
167
+ A finite nonnegative deadline returns `{ met, mark }`; document replacements share that deadline.
168
+ If no document answers before it, an unmet positive wait has `mark: ""`, meaning no baseline was
169
+ sampled. A zero-duration baseline reads once and fails if its document disappears. `press` takes
170
+ `on`, a ref it focuses before the first key, such as a link only the keyboard reaches. `Moment.describeChange` tells a change in the words
138
171
  a moment uses. The actions a call performs record a caller's id as their `correlation` when it runs
139
172
  under `Page.correlate(id)`, such as a model's tool call.
140
173
 
@@ -187,12 +220,14 @@ out of view, away from those points or ignoring the pointer, is missed. The outl
187
220
  is, or until the time is up: its document is parsed and has painted since, nothing that ends is
188
221
  animating in view, its fonts and the images in view have loaded, nothing in view is marked busy
189
222
  (`aria-busy`), and the viewport shows something: text, a canvas drawn on, a picture or drawing
190
- larger than an icon, a video or a frame. A canvas mounted blank, as chart libraries mount theirs,
223
+ larger than an icon, a video or a frame. It polls every 50 ms and follows document replacements
224
+ within one timeout. `quietMillis` also checks changes when a recorder is already running; it does
225
+ not start a recorder or a capture. A canvas mounted blank, as chart libraries mount theirs,
191
226
  or a spinner alone is still loading. A screen that only says "Loading…" in words reads as ready,
192
227
  and a WebGL canvas drawn once, without keeping its drawing, reads as blank. A hidden tab, which
193
228
  paints nothing, is never ready.
194
229
 
195
- With `quietMillis`, the screen must then also stay still that long: no screencast frame comes,
230
+ `Stillness.wait(page, { quietMillis, still: "screen" })` waits for a ready screen to stay still that long: no screencast frame comes,
196
231
  counted from the first frame of a capture the wait starts itself, since a hosted browser sends that
197
232
  frame over half a second late. A capture's silence alone proves little: a stalled connection holds
198
233
  frames on their way, and Chromium sends frames only while few acknowledgements are unanswered. So
@@ -209,13 +244,13 @@ longer than `quietMillis` between phases reads as still. On the slot machine fix
209
244
  connection stalled for 450 to 900 ms toward either end while the reels spun, none of 132 waits
210
245
  ended early, where all 36 did before.
211
246
 
212
- `Page.ready({ still: "foreground", quietMillis })` allows motion already seen in the 1.5 seconds
247
+ `Stillness.wait(page, { still: "foreground", quietMillis })` allows motion already seen in the 1.5 seconds
213
248
  before the page's latest input, such as idle decoration. Motion elsewhere restarts the quiet
214
249
  interval. It compares newly accepted frames, including brief motion between polls and frames
215
250
  accepted after a viewport-size check; missing history or more than eight new frames in one poll
216
251
  restarts the interval conservatively. Without pre-input frame history, all motion counts.
217
252
 
218
- `Page.ready({ still: "content", quietMillis })` instead observes a full interval without visible
253
+ `Stillness.wait(page, { still: "content", quietMillis })` instead observes a full interval without visible
219
254
  recorded DOM changes. It starts the recorder itself and starts the interval again in each new
220
255
  document; navigation retries share the original timeout. Canvas animation can continue while DOM
221
256
  content is ready. This does not prove pixel or screencast stillness and inherits the change
@@ -242,10 +277,11 @@ What a busy page costs is the credit for an effect out of a click's reach, which
242
277
  tells as a step; on a still page, an unrelated line 250 ms after a click is still credited.
243
278
 
244
279
  A page records once something reads its changes: the first read starts it, and finds nothing yet.
245
- From then the page's own session starts the recorder at the start of each later document, once it
246
- is parsed, until nobody has read it for two minutes; a page nobody reads records nothing and costs
247
- nothing. The first read also registers the recorder, in the same round trip, and every later read
248
- is one call. A browser whose clock no capture has mapped yet maps it on its first read of changes,
280
+ From then the page's own session starts the recorder in later documents once parsed. Two minutes
281
+ after the last read on the owning clock, it stops the current recorder and unregisters future
282
+ starts, even across navigation; a page nobody reads records nothing. The first read also
283
+ registers the recorder; every later read is one call. A browser whose clock no capture has mapped
284
+ yet maps it on its first read of changes,
249
285
  once, in four round trips more. While it runs, a MutationObserver marks what changed: a text-only
250
286
  element, as most prices are, is read at once, and anything else, with whether it was in view, as
251
287
  the page renders it, through an IntersectionObserver that forces no layout. A change counts as seen
@@ -281,8 +317,8 @@ rest, each showing what it settled at, as a price that ticked and stopped does.
281
317
  how long the page had been still, by the last change in view its record shows or the last paint
282
318
  among its screencast frames; a screenshot shows the page, not when it changed. Frames show paint
283
319
  only while a capture runs, and the record does not see a canvas, so a canvas that draws with no
284
- capture running reads as still. A wait for a still screen is `Page.ready({ quietMillis })`, which
285
- also holds through a stalled connection.
320
+ capture running reads as still. Use `Stillness.wait(page, { still: "screen", quietMillis })`
321
+ when a wait must observe screen quiet and hold through a stalled capture connection.
286
322
 
287
323
  `Moment.capture` is a window that ends at a picture of the page now. It takes the picture first,
288
324
  then the window up to its paint, from where a previous window or moment ended, so the changes hold
@@ -310,7 +346,8 @@ what was typed as an input slot named for its field, never the text itself. A na
310
346
  address with a credential withheld is an input slot too, `address`, so replay goes where the caller
311
347
  says, never to the address without its credential. `Plan.replay(page,
312
348
  plan, { inputs })` takes the steps in turn: before each step except an opening navigate, back or
313
- reload, it waits for `Page.ready` (`settle` sets how, or `false` not to wait), finds the element with
349
+ reload, it waits for readiness (`settle` sets how, or `false` skips it). A `quietMillis` option uses
350
+ `Stillness.wait` for content quiet; otherwise it calls `Page.ready`. It finds the element with
314
351
  `Plan.locate`, and acts on it. An element that does not repeat every part of the recorded context
315
352
  is another subject: its row read whole, so a row named "Wrapped BTC" is not the row "BTC" (laid out
316
353
  again without rows, as cards, one of its fields must start with the row's words), its column where
@@ -334,8 +371,8 @@ of later actions after its earlier navigation has expired.
334
371
 
335
372
  `Plan.take(page, plan, index)` takes one step and returns a `Receipt`: the step index, host-clock
336
373
  `startedAt` and `at`, and `taken`, `verified` or `skipped`. Readiness is a precondition of the next
337
- step, including later navigation, never a wait after the last step. Call `page.ready` after replay
338
- when the final page must be still. `Plan.replay` returns those receipts;
374
+ step, including later navigation, never a wait after the last step. After replay, call `page.ready`
375
+ for document readiness or `Stillness.wait` for a quiet final page. `Plan.replay` returns those receipts;
339
376
  a `ReplayError` includes completed receipts and a serializable `stopped` value with the next step
340
377
  and whether its input is `unsent` or `unknown`. Resume with `{ from: error.stopped }`. A numeric
341
378
  index means fresh input, so never convert an unresolved stopping point into a number to retry it.
@@ -361,11 +398,10 @@ back, reload, insertion, presses, drags and ordinary clicks cannot. `Plan.repeat
361
398
  which applies. `Plan.restore(page, plan, { upTo, inputs })` reconstructs earlier steps on a fresh
362
399
  page using those same rules and refuses unresolved commitments. `upTo` is exclusive.
363
400
 
364
- `Plan.Plan.new(steps)` selects the stored version: recordings without expected checks remain
365
- version 1; checks require version 2. Both decode, with version and contents validated together.
366
- From beta.13, decoding rejects `durable: true` on `Gone` or URL-less `Navigated`, including older
367
- version 2 payloads that used these unsupported recovery claims. Execution independently refuses
368
- to recover through them. Old 0.2 plans and unknown versions do not decode.
401
+ `Plan.Plan.new(steps)` emits version 3 with canonical typed Actions. Prior version 1/2
402
+ string-action plans and unknown versions do not decode. This is a hard cutover; rerecord or
403
+ explicitly convert an older plan before replay. Decoding rejects `durable: true` on `Gone` or
404
+ URL-less `Navigated`; execution also refuses recovery through those unsupported claims.
369
405
 
370
406
  `Browser.Options.guard` is the input policy. Its `InputRequest` schema contains the action, the
371
407
  resolved element, the page's URL and title, and the `facts` the page's structure establishes:
@@ -432,9 +468,8 @@ The task comes from `Policy.Task`, which `effect-agent-browser`'s tools provide
432
468
  from the run's `task`; elsewhere, provide it yourself, or risky input is denied for want of one. A judge sees the task, the action, the typed
433
469
  text and the facts as trusted, and the page's text only as evidence. It never sees the agent's own
434
470
  words. A judgement only adds to structure: a `secret` fact counts whatever the judge reads. A judge
435
- that fails or exceeds `timeout` (30 seconds) leaves the input unjudged. `make` then denies the input
436
- if it has any fact, with the judge's failure as the `PolicyDenied` cause, and lets an input without
437
- facts, such as a same-origin link, go ahead. With `@effect/ai-openrouter`, set
471
+ that fails or exceeds `timeout` (30 seconds) fails closed with `PolicyDenied`, including inputs
472
+ without structural facts. Script actions also pass the guard as opaque scripted input. With `@effect/ai-openrouter`, set
438
473
  `strictJsonSchema: true` in the model's config for structured judge outputs.
439
474
 
440
475
  Holds use `policyTimeout`, a finite positive duration defaulting to five minutes, separately from
@@ -554,16 +589,17 @@ change, 600 ms after a new document and 1 second on another page; the pointer gl
554
589
  viewers last saw it, on whichever page; a field is clicked before typing; and the wheel turns in
555
590
  100 px notches, in bursts of up to nine. One view acts at a time. The time a view spends showing an
556
591
  action, its glides, holds and typing, has a budget of its own outside `actionTimeout`. `page`
557
- itself stays plain, and plain input on any page never waits for a view. `view.aim(target)` starts
558
- the glide as soon as a target is known, as when it appears in a model's streamed tool call; the
559
- view's next action completes it if it acts on that target, and stops it where it is otherwise. An
560
- aim records no action, and does nothing under an input guard.
592
+ itself stays plain, and plain input on any page never waits for a view. Styles flow through
593
+ `Style.Current`, including to followed tabs. Hand acquisition honours `failFast` and the action's
594
+ wait bound after approval. Planned typing and scrolling have a separate 10-second cap and fail
595
+ `InvalidRequest` before input when the schedule exceeds it.
561
596
 
562
597
  A stage is one per live output. `stage.cue(page)` starts capture now; `cue.ready` waits for a
563
598
  current frame, and `cue.commit({ at })` switches on the host time of an event that actually
564
599
  happened. Preparing belongs to the caller's scope; once committed, capture belongs to the stage.
565
600
  Closing an abandoned cue stops its capture. `present(page, { at })` is the convenience for cueing
566
- and committing in one call.
601
+ and committing in one call. A stage uses the first page's owning clock; cueing a page with a
602
+ different clock fails `InvalidRequest`, since host times from those clocks cannot be compared.
567
603
 
568
604
  ```ts
569
605
  // Inside a scoped program: lineSent yields Some(hostTime) when the line goes out, or None if dropped.
@@ -632,7 +668,10 @@ Compare these stamps only within that clock: they are not epoch dates or compara
632
668
  `Frame.timing` distinguishes `BrowserPaint` from `Screenshot`. Native frames retain browser epoch
633
669
  milliseconds in `timestamp` and map them to `hostTime`, with an explicit clock uncertainty.
634
670
  Screenshot fallbacks have only a host capture interval; their `timestamp` getter is undefined.
635
- Windows and a moment's frame captions use `hostTime`, so delayed delivery cannot make old paint current.
671
+ Windows and a moment's frame captions use `hostTime`, so delayed delivery cannot make old paint current. `Frame.sameCapture(a, b)` compares
672
+ page/session/connection/document/generation/sequence lineage, so an image copy can retain its
673
+ capture evidence. Untagged pictures match only by object identity. Currency additionally requires
674
+ an active capture and the page's current document.
636
675
  A picture states how old it may be. `Page.frame({ maxAge, after })` serves the newest screencast
637
676
  frame when it has the viewport's size and was painted at most `maxAge` ago, at the earliest its
638
677
  timing allows: 250 ms by default, while 0 always takes a new screenshot. With `after: "input"` the
@@ -776,25 +815,18 @@ reached the browser; `check` its effect first, as it may have taken place; `poin
776
815
  such as with a stale ref; or `resume` reading events from a newer cursor. `message` is a sentence
777
816
  for operators, and the browser tools tell a model what to do about the failure.
778
817
 
779
- `Expect` is that check, for an action whose effect the page shows. An attempt names what the action
780
- is for, `appeared(query)`, `gone(query)`, `changed(query)` or `navigated(url?)`, with `Page.find`'s
781
- queries over the whole document, and takes its baseline as it begins. Each `run` checks first and
782
- sends nothing where the expectation holds already, `AlreadyDone`; otherwise it acts and waits for
783
- it, `Done`, or `NotDone` after `wait`, 5 seconds by default. An action that fails after its input
784
- went is checked too: `Done` if its effect came, else its own failure, so the next `run` of the same
785
- attempt, on the same page or the one a reconnect finds by its id, acts only if nothing came.
818
+ `Plan.take` checks an authored expected effect before input and after a dispatched failure.
819
+ Unknown consequential input requires positive durable evidence before continuation; the Plan
820
+ section above describes that recovery contract. `Page.until` provides the underlying bounded
821
+ observation without deciding whether an action may be repeated:
786
822
 
787
823
  ```ts
788
- const placing = yield * Expect.attempt(page, Expect.appeared({ text: "Order placed" }));
789
- const outcome = yield * placing.run(page, (page) => page.click(ref));
824
+ const observed = yield * page.until({ text: "Order 42" }, "some", 5000);
790
825
  ```
791
826
 
792
- A check is one call to the page, and so is a wait, which the page answers as the effect comes;
793
- `navigated` reads what the page already knows, at no call. `changed` compares what the query found
794
- at the start, its elements' text, field values and states but focus, by a mark the page keeps, so
795
- none of it leaves the page. On a page a reconnect found, `navigated` without an address tells only
796
- a move to another address, as the new connection counts documents afresh. A presenter's view is
797
- checked as its page is; a page a `Browser` did not make is refused.
827
+ The mark from `until` compares matching elements' text, values and states except focus. Keep it
828
+ only as an observation baseline; an unmet or changed observation does not authorize repeating
829
+ unknown consequential input.
798
830
 
799
831
  Every address the library reports, in events, frames, reads, errors, a guard's request and the
800
832
  outline's links, keeps its identity and loses its userinfo and its credentials' values, which read
@@ -833,10 +865,11 @@ submission, including cleanup releases. Cursor shape comes from resolved target
833
865
  events. Compositing remains the consumer’s job.
834
866
 
835
867
  A page waits only for itself. Its operations take turns in one lane of its own: an action, which
836
- sends input or navigates, has the page to itself, in the order actions were asked; reads (the
837
- outline, `find`, `text`, `changes`, pictures, zooms, `title` and the viewport) share it, after the action in
838
- flight and every action asked before them, so a read describes the page an action left, never one
839
- an action is still changing. `ready` follows the action in flight too, and holds none back while it
868
+ sends input or navigates, has the page to itself in FIFO order once it asks for admission.
869
+ Policy preparation reads the page first and a guard can wait outside that queue, so a later
870
+ approved action may enter before an earlier held one. Reads (the outline, `find`, `text`, `changes`,
871
+ pictures, zooms, `title` and the viewport) share the lane after the earlier queued writes, so they
872
+ describe the page those actions left. `ready` follows the action in flight too, and holds none back while it
840
873
  watches. An action then waits for its page's unresolved input replies. Its timeout bounds those
841
874
  waits before a full timeout bounds the action itself: a turn not given in time fails `Busy`, with
842
875
  how long it waited and how many operations were ahead, and replies not answered in time fail
@@ -875,8 +908,8 @@ The consumer owns the operator's decisions and any durable workflow journal.
875
908
  Reads keep their work. An identical read asked while one is in flight on the page, with no action
876
909
  asked between them, joins it, and costs no call of its own. Each read runs in the page's scope under
877
910
  the action timeout whoever gives up, so a caller's own `Effect.timeout` loses nothing: a read that
878
- ends after all its callers gave up serves the next caller to ask the same within an action timeout,
879
- unless an action or a new document came first. An action stops the reads nobody awaits rather than
911
+ ends after all its callers gave up serves the next caller to ask the same within 250 milliseconds
912
+ of completion, unless an action or a new document came first. An action stops the reads nobody awaits rather than
880
913
  wait for them. Pictures and `changes` only join: a picture's caller says how old it may be, and a
881
914
  window of changes ends as it is read.
882
915
 
@@ -896,13 +929,13 @@ its first glide starts mid-viewport, and each later one where the one before end
896
929
  input on another tab does meanwhile. Every sent move updates the position, including a partially
897
930
  cancelled glide. A later viewport clamps the starting point to its bounds if necessary.
898
931
 
899
- ## Supervising browser generations
932
+ ## Supervising resource generations
900
933
 
901
- `Supervisor.make` keeps a browser open across losses and session ends. Its `open` builds each
902
- generation in a scope of its own and can return `{ browser, value }`: the application's pages,
903
- tools or other resources belong to that generation. A caller that stops waiting never interrupts
904
- the shared acquisition. Browser-only providers can continue returning `{ browser }`, with a
905
- `void` value. Pages and values do not carry over when a new generation opens.
934
+ `effect-browser/Supervisor` owns a scoped resource through acquisition failures, loss and rotation.
935
+ Its generic core does not inspect browsers. `open(number)` acquires a generation in its own scope
936
+ and returns `{ value, lost?, release? }`; `lost` produces a reason string, and `release(why)` reports
937
+ `Settled` or `Unconfirmed` through `effect-browser/Released`. Without a release hook, closing
938
+ the generation's scope ends its resource.
906
939
 
907
940
  ```ts
908
941
  import { Effect } from "effect";
@@ -910,111 +943,49 @@ import * as Chromium from "effect-browser/Chromium";
910
943
  import * as Supervisor from "effect-browser/Supervisor";
911
944
 
912
945
  const program = Effect.gen(function* () {
913
- const browsers = yield* Supervisor.make({
914
- open: Effect.gen(function* () {
915
- const browser = yield* Chromium.open();
916
- const page = yield* browser.firstPage;
946
+ const sessions = yield* Supervisor.make({
947
+ open: () =>
948
+ Effect.gen(function* () {
949
+ const browser = yield* Chromium.open();
917
950
 
918
- return { browser, value: page };
919
- }),
951
+ return { value: browser, lost: browser.disconnected };
952
+ }),
920
953
  });
921
- return yield* browsers.use(({ value: page }) => page.snapshot());
922
- });
923
- ```
924
954
 
925
- `use(work, { wait })` atomically borrows the serving generation and runs `work` in a scope of its
926
- own. The lease gives its `generation`, `browser`, `value`, an `ending` notice, `retain` and `lose`.
927
- `wait` defaults to `waitTimeout` (two minutes); zero either borrows immediately or fails
928
- `Unavailable`. Cancelling the caller closes its work scope and lets its hold go. Ordinary work
929
- errors stay ordinary work errors. `browser` still returns an unheld browser: use it only when the
930
- caller can tolerate that generation being released underneath it.
931
-
932
- A retained scope transfers a hold beyond the `use` call. Acquire anything that must travel with
933
- that hold in its scope, and close it when the receiver is finished. Within a scoped program with
934
- `browsers` as above and `Exit` and `Scope` imported from `effect`:
935
-
936
- ```ts
937
- const prepared =
938
- yield *
939
- browsers.use((lease) =>
940
- Effect.gen(function* () {
941
- const hold = yield* lease.retain;
942
- const page = yield* Effect.acquireRelease(lease.browser.newPage(), (page) =>
943
- page.close.pipe(Effect.ignore),
944
- ).pipe(Scope.provide(hold));
945
-
946
- return { page, hold, ending: lease.ending };
947
- }),
955
+ return yield* sessions.use(({ value: browser }) =>
956
+ Effect.flatMap(browser.firstPage, (page) => page.text()),
948
957
  );
949
- // Hand `prepared` to its next owner; that owner eventually lets it go.
950
- yield * Scope.close(prepared.hold, Exit.void);
958
+ }).pipe(Effect.scoped);
951
959
  ```
952
960
 
953
- Rotation publishes `Draining` for the outgoing generation. It stays alive until its last hold
954
- closes or `handover` expires, 30 seconds by default. `ending` is the first notice that it stopped
955
- serving, with a `Superseded` reason and monotonic `revokeAt`; loss or retirement can revoke sooner.
956
- At revocation, `use` interrupts work still running, waits for its finalizers and fails
957
- `Superseded`. New `retain` calls refuse a revoked or releasing generation, and a retained scope
958
- cannot extend the deadline. Retained scopes and work scopes close before the provider's
959
- `release`; the generation's own scope closes last. Cleanup can therefore extend the time taken to
960
- finish revocation. `Superseded` does not say whether an input reached the site: use the action's
961
- receipt and plan stopping point to resolve that uncertainty.
962
-
963
- Nonexclusive `rotate`, including `rotateBefore` timed rotation, opens the next generation while
964
- old holds drain. Handover does not delay later rotations; multiple old generations can remain
965
- owned, so the consumer chooses its rotation and overlap budget. Calls share one acquisition in
966
- progress. Under `exclusive`, the current generation drains and finishes its provider release
967
- before acquisition starts. Call `rotate` outside `use` for a clean cut: an exclusive rotation
968
- inside `use` waits for its own hold to end or be revoked.
969
-
970
- A loss publishes `Lost` with the browser's `disconnected` cause and revokes its holds immediately.
971
- When the consumer detects an unusable page or capture while the browser stays connected,
972
- `lease.lose(detail)` applies the same transition with `cause: "declared"` and that detail. It stops
973
- serving the generation and revokes work without a handover wait, including work declaring its own
974
- loss and returning immediately. Declaring loss does not wait for work cleanup or provider release.
975
- Repeated declarations and declarations from draining or closed generations do nothing.
976
- It reopens on `reopen`, which also retries an open failure until the schedule ends. A provider's
977
- `definite` failure goes `Down` at once, with the cause also available through `Unavailable`.
978
-
979
- `admit({ number, after })` runs before every open attempt, including the first and each retry,
980
- inside the opening scope. `after` covers every earlier session that stopped serving: all older
981
- generations still draining or releasing, and sessions whose acquisition or application build
982
- failed. It waits for all of their pending releases. If any end is `Unconfirmed`, that outcome
983
- remains visible on every later admission, even after newer releases settle. The supervisor keeps
984
- the first unconfirmed outcome as its witness, without retaining completed generations' resources.
985
-
986
- Before any release there is no `after`; completed confirmed releases resolve immediately. A
987
- nonexclusive rotation excludes its still-serving predecessor, so awaiting `after` preserves
988
- make-before-break rotation unless an older release remains pending or unconfirmed. The facts are
989
- checked again before every retry. Exclusive acquisition also waits for all pending releases.
990
- Admission failures follow `reopen` and `definite`, and retirement interrupts admission while
991
- releases run to their outcomes. Ignoring `after` adds no release wait for nonexclusive acquisition.
992
-
993
- Provider adapters can read the optional `Supervisor.Releasing` service during `open`. When an
994
- attempt fails, its cleanup reports the actual outcome with `released(outcome)` before finishing;
995
- the original acquisition failure stays a failure. Successful generations return `Opened.release`
996
- as usual. `Browserbase.supervise` supplies failed-connect and failed-build outcomes this way, so
997
- consumers do not need to wrap or repeat a provider release.
998
-
999
- `retire` revokes immediately, stops acquisition and waits for every generation to release.
1000
- Closing the supervisor's scope does the same unless `keep` is set: then only the serving
1001
- generation skips provider release, `Kept`; its application scopes still close. Other generations
1002
- are released normally.
1003
-
1004
- `states` streams `Opening`, `Reopening`, `Open`, `Draining`, `Lost`, `Down`, `Closed` and `Kept`.
1005
- `Down.released` and an opening generation's `Closed.released` publish that generation's reported
1006
- failed-try cleanup, even when no later admission follows. The first `Unconfirmed` stays visible
1007
- after later tries settle; no reported cleanup leaves `released` undefined. A successful `Open`
1008
- ends this opening record, while `Admission.after` keeps earlier uncertainty. `Closed.released`
1009
- also preserves the serving generation's provider release. `Unconfirmed` does not establish that
1010
- a provider stopped the browser or its billing. `Generation.at` is wall-clock epoch milliseconds;
1011
- `hostTime` and `revokeAt` are host monotonic milliseconds from the supervisor's Effect `Clock`.
1012
- They can be compared with browser event and frame times when those use that same clock and host,
1013
- not across processes or against a provider's wall-clock timestamps. A generation event is
1014
- lifetime evidence, not proof that a frame was shown. `Browserbase.supervise` supplies hosted
1015
- generations and, with `keep`, can adopt one it previously kept.
1016
-
1017
- Every module is also an entry point, such as `effect-browser/Page`. The
961
+ `use` holds one generation through the callback and its scoped cleanup. Its lease has `generation`,
962
+ `value`, `ending` and `lose(detail)`. Rotation and loss revoke work with typed `Superseded`; a stale
963
+ loss declaration does nothing. The caller owns application decisions about retrying interrupted work
964
+ and reading its input receipts. `use(work, { wait })` accepts a finite nonnegative admission budget on the
965
+ supervisor's owning clock; zero peeks, and omission waits. Invalid budgets fail with typed `InvalidWait`. A permanent acquisition failure or
966
+ retirement fails waiting callers with `Unavailable`.
967
+
968
+ `rotate(from?)` opens a replacement, ignoring a stale generation number. By default a healthy
969
+ predecessor serves while its replacement opens. With `exclusive: true`, revocation, callback cleanup
970
+ and provider release complete before replacement acquisition. A lost generation always revokes
971
+ immediately. Its release starts after all admitted callbacks finish cleanup. Generation resources
972
+ created by `open` close after the release hook.
973
+
974
+ Failed acquisitions close their scope before retrying. Every attempt publishes its own typed error;
975
+ cleanup evidence stays attached to that error rather than being combined with later attempts.
976
+ `reopen` supplies the retry schedule, exponential from one second for at most five minutes by default;
977
+ `definite(error)` stops retries for permanent errors. An acquisition already running finishes and
978
+ cleans up during retirement, while a retry delay stops immediately. `retire` and scope closure await
979
+ all acquisition and release work. Cancelling a caller waiting for `retire` leaves retirement running.
980
+
981
+ `states` replays the latest 64 changes: `Opening`, `Failed`, `Open`, `Ending`, `Down` and `Closed`.
982
+ `Closed.released` reports that generation's outcome, including failed scope closure. `at` is epoch
983
+ milliseconds and `hostTime` is monotonic milliseconds on the owning Effect clock. They are lifecycle
984
+ evidence, separate from evidence that a frame reached a viewer. Provider scheduling, accounting,
985
+ process restart adoption and application retention remain caller composition. Browserbase supplies
986
+ `Browserbase.generations(...)` for this same core.
987
+
988
+ Public modules have explicit entry points, such as `effect-browser/Page`. The
1018
989
  [repository README](https://github.com/mannyc2/effect-agent-browserbase#readme) has examples.
1019
990
 
1020
991
  The published build embeds the complete page script as a closed JavaScript source string. Consumer
@@ -0,0 +1,110 @@
1
+ import { Schema } from "effect";
2
+ declare namespace Action_d_exports {
3
+ export { Action, ClickOptions, Name, PressOptions, ScrollOptions, TypeOptions, nameOf, recorded, targetOf };
4
+ }
5
+ declare const ClickOptions: Schema.Struct<{
6
+ readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
7
+ readonly clickCount: Schema.optional<Schema.Finite>;
8
+ readonly holdMillis: Schema.optional<Schema.Finite>;
9
+ }>;
10
+ declare const TypeOptions: Schema.Struct<{
11
+ readonly into: Schema.optional<Schema.String>;
12
+ readonly replace: Schema.optional<Schema.Boolean>;
13
+ readonly submit: Schema.optional<Schema.Boolean>;
14
+ readonly secret: Schema.optional<Schema.Boolean>;
15
+ }>;
16
+ declare const PressOptions: Schema.Struct<{
17
+ readonly on: Schema.optional<Schema.String>;
18
+ readonly times: Schema.optional<Schema.Finite>;
19
+ readonly holdMillis: Schema.optional<Schema.Finite>;
20
+ }>;
21
+ declare const ScrollOptions: Schema.Struct<{
22
+ readonly at: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
23
+ readonly x: Schema.Finite;
24
+ readonly y: Schema.Finite;
25
+ }>]>>;
26
+ readonly dx: Schema.optional<Schema.Finite>;
27
+ readonly dy: Schema.optional<Schema.Finite>;
28
+ }>;
29
+ declare const Action: Schema.TaggedUnion<{
30
+ readonly Act: Schema.TaggedStruct<"Act", {
31
+ readonly document: Schema.Int;
32
+ }>;
33
+ readonly Back: Schema.TaggedStruct<"Back", {}>;
34
+ readonly Click: Schema.TaggedStruct<"Click", {
35
+ readonly target: Schema.Union<readonly [Schema.String, Schema.Struct<{
36
+ readonly x: Schema.Finite;
37
+ readonly y: Schema.Finite;
38
+ }>]>;
39
+ readonly options: Schema.optional<Schema.Struct<{
40
+ readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
41
+ readonly clickCount: Schema.optional<Schema.Finite>;
42
+ readonly holdMillis: Schema.optional<Schema.Finite>;
43
+ }>>;
44
+ }>;
45
+ readonly Drag: Schema.TaggedStruct<"Drag", {
46
+ readonly from: Schema.Union<readonly [Schema.String, Schema.Struct<{
47
+ readonly x: Schema.Finite;
48
+ readonly y: Schema.Finite;
49
+ }>]>;
50
+ readonly to: Schema.Union<readonly [Schema.String, Schema.Struct<{
51
+ readonly x: Schema.Finite;
52
+ readonly y: Schema.Finite;
53
+ }>]>;
54
+ }>;
55
+ readonly Goto: Schema.TaggedStruct<"Goto", {
56
+ readonly url: Schema.String;
57
+ }>;
58
+ readonly Hover: Schema.TaggedStruct<"Hover", {
59
+ readonly target: Schema.Union<readonly [Schema.String, Schema.Struct<{
60
+ readonly x: Schema.Finite;
61
+ readonly y: Schema.Finite;
62
+ }>]>;
63
+ }>;
64
+ readonly Press: Schema.TaggedStruct<"Press", {
65
+ readonly keys: Schema.String;
66
+ readonly options: Schema.optional<Schema.Struct<{
67
+ readonly on: Schema.optional<Schema.String>;
68
+ readonly times: Schema.optional<Schema.Finite>;
69
+ readonly holdMillis: Schema.optional<Schema.Finite>;
70
+ }>>;
71
+ }>;
72
+ readonly Reload: Schema.TaggedStruct<"Reload", {}>;
73
+ readonly Scroll: Schema.TaggedStruct<"Scroll", {
74
+ readonly options: Schema.optional<Schema.Struct<{
75
+ readonly at: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
76
+ readonly x: Schema.Finite;
77
+ readonly y: Schema.Finite;
78
+ }>]>>;
79
+ readonly dx: Schema.optional<Schema.Finite>;
80
+ readonly dy: Schema.optional<Schema.Finite>;
81
+ }>>;
82
+ }>;
83
+ readonly Select: Schema.TaggedStruct<"Select", {
84
+ readonly ref: Schema.String;
85
+ readonly values: Schema.$Array<Schema.String>;
86
+ }>;
87
+ readonly Type: Schema.TaggedStruct<"Type", {
88
+ readonly text: Schema.String;
89
+ readonly options: Schema.optional<Schema.Struct<{
90
+ readonly into: Schema.optional<Schema.String>;
91
+ readonly replace: Schema.optional<Schema.Boolean>;
92
+ readonly submit: Schema.optional<Schema.Boolean>;
93
+ readonly secret: Schema.optional<Schema.Boolean>;
94
+ }>>;
95
+ }>;
96
+ }>;
97
+ type Action = typeof Action.Type;
98
+ declare const Name: Schema.Literals<readonly ["click", "hover", "drag", "type", "press", "scroll", "select", "navigate", "back", "reload", "act"]>;
99
+ type Name = typeof Name.Type;
100
+ /** Effective semantics suitable for policy and records; credentials never survive. */
101
+ declare const recorded: (value: Action, revealed: boolean) => Action;
102
+ declare const nameOf: (action: Action) => Name;
103
+ /** The primary target, if this action addresses an element or point. */
104
+ declare const targetOf: (action: Action) => string | {
105
+ readonly x: number;
106
+ readonly y: number;
107
+ } | undefined;
108
+ //#endregion
109
+ export { PressOptions as a, nameOf as c, Name as i, recorded as l, Action_d_exports as n, ScrollOptions as o, ClickOptions as r, TypeOptions as s, Action as t, targetOf as u };
110
+ //# sourceMappingURL=Action-24sLOubi.d.mts.map
@@ -0,0 +1,2 @@
1
+ import { a as PressOptions, c as nameOf, i as Name, l as recorded, o as ScrollOptions, r as ClickOptions, s as TypeOptions, t as Action, u as targetOf } from "./Action-24sLOubi.mjs";
2
+ export { Action, ClickOptions, Name, PressOptions, ScrollOptions, TypeOptions, nameOf, recorded, targetOf };