effect-browser 0.3.0-beta.20 → 0.3.0-beta.22

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 (243) hide show
  1. package/README.md +221 -158
  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-Cq2K1FEA.mjs +4075 -0
  10. package/dist/Browser-Cq2K1FEA.mjs.map +1 -0
  11. package/dist/Browser-wZhwZSlG.d.mts +167 -0
  12. package/dist/Browser.d.mts +2 -129
  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/LICENSE-jpeg-js +28 -0
  38. package/dist/Matching.d.mts +37 -0
  39. package/dist/{match.inpage-xOe9LNO0.mjs → Matching.mjs} +28 -4
  40. package/dist/Matching.mjs.map +1 -0
  41. package/dist/{Page-CfB6Zn1p.mjs → Page-BF5izr8R.mjs} +216 -31
  42. package/dist/Page-BF5izr8R.mjs.map +1 -0
  43. package/dist/{Page-ku6j5t-v.d.mts → Page-CvsOEorc.d.mts} +158 -185
  44. package/dist/Page.d.mts +2 -2
  45. package/dist/Page.mjs +1 -1
  46. package/dist/Released-tURbFmal.d.mts +15 -0
  47. package/dist/{Snapshot-B34hZ4Jl.d.mts → Snapshot-CtBVOtuu.d.mts} +6 -1
  48. package/dist/Snapshot.d.mts +1 -1
  49. package/dist/Snapshot.mjs.map +1 -1
  50. package/dist/Stillness-CNlvayIo.mjs +136 -0
  51. package/dist/Stillness-CNlvayIo.mjs.map +1 -0
  52. package/dist/Style-AO4V7Czt.mjs +357 -0
  53. package/dist/Style-AO4V7Czt.mjs.map +1 -0
  54. package/dist/Style.d.mts +72 -0
  55. package/dist/Style.mjs +2 -0
  56. package/dist/Url.d.mts +26 -0
  57. package/dist/Url.mjs +74 -0
  58. package/dist/Url.mjs.map +1 -0
  59. package/dist/Window-CMddGMt1.d.mts +34 -0
  60. package/dist/Window.d.mts +2 -0
  61. package/dist/Window.mjs +35 -0
  62. package/dist/Window.mjs.map +1 -0
  63. package/dist/connection-2KHI4_KN.d.mts +41 -0
  64. package/dist/connection-BTeO0Hiz.mjs +68 -0
  65. package/dist/connection-BTeO0Hiz.mjs.map +1 -0
  66. package/dist/index.d.mts +15 -17
  67. package/dist/index.mjs +11 -14
  68. package/dist/moment/Moment.d.mts +86 -0
  69. package/dist/{Moment.mjs → moment/Moment.mjs} +44 -38
  70. package/dist/moment/Moment.mjs.map +1 -0
  71. package/dist/{Plan-DJ4hEEna.d.mts → plan/index.d.mts} +169 -64
  72. package/dist/{Plan-C-d5QYS8.mjs → plan/index.mjs} +122 -155
  73. package/dist/plan/index.mjs.map +1 -0
  74. package/dist/{Policy.d.mts → policy/Policy.d.mts} +5 -9
  75. package/dist/{Policy.mjs → policy/Policy.mjs} +11 -21
  76. package/dist/policy/Policy.mjs.map +1 -0
  77. package/dist/presentation/Motion.d.mts +12 -0
  78. package/dist/{Motion.mjs → presentation/Motion.mjs} +4 -27
  79. package/dist/presentation/Motion.mjs.map +1 -0
  80. package/dist/presentation/Presentation.d.mts +30 -0
  81. package/dist/presentation/Presentation.mjs +105 -0
  82. package/dist/presentation/Presentation.mjs.map +1 -0
  83. package/dist/{Stage.d.mts → presentation/Stage.d.mts} +5 -8
  84. package/dist/{Stage.mjs → presentation/Stage.mjs} +68 -76
  85. package/dist/presentation/Stage.mjs.map +1 -0
  86. package/dist/presentation/feed.d.mts +20 -0
  87. package/dist/presentation/feed.mjs +18 -0
  88. package/dist/presentation/feed.mjs.map +1 -0
  89. package/dist/providers/Cdp.d.mts +9 -0
  90. package/dist/providers/Cdp.mjs +15 -0
  91. package/dist/providers/Cdp.mjs.map +1 -0
  92. package/dist/{Chromium.d.mts → providers/Chromium.d.mts} +6 -7
  93. package/dist/{Chromium.mjs → providers/Chromium.mjs} +7 -16
  94. package/dist/providers/Chromium.mjs.map +1 -0
  95. package/dist/providers/Released.d.mts +2 -0
  96. package/dist/providers/Released.mjs +12 -0
  97. package/dist/providers/Released.mjs.map +1 -0
  98. package/dist/stillness/Stillness.d.mts +12 -0
  99. package/dist/stillness/Stillness.mjs +2 -0
  100. package/dist/supervisor/Supervisor.d.mts +104 -0
  101. package/dist/supervisor/Supervisor.mjs +513 -0
  102. package/dist/supervisor/Supervisor.mjs.map +1 -0
  103. package/dist/testing/index.d.mts +337 -0
  104. package/dist/testing/index.mjs +515 -0
  105. package/dist/testing/index.mjs.map +1 -0
  106. package/dist/workerd/Cdp.d.mts +8 -0
  107. package/dist/workerd/Cdp.mjs +13 -0
  108. package/dist/workerd/Cdp.mjs.map +1 -0
  109. package/package.json +94 -33
  110. package/src/Action.ts +127 -0
  111. package/src/ActionPort.ts +128 -0
  112. package/src/Browser.ts +366 -225
  113. package/src/BrowserError.ts +63 -6
  114. package/src/BrowserEvent.ts +26 -25
  115. package/src/Change.ts +0 -2
  116. package/src/{internal/pictures/clock.ts → Clock.ts} +17 -6
  117. package/src/Frame.ts +14 -0
  118. package/src/Geometry.ts +48 -0
  119. package/src/{internal/reading/match.inpage.ts → Matching.ts} +34 -4
  120. package/src/Page.ts +111 -92
  121. package/src/Snapshot.ts +5 -0
  122. package/src/{internal/input/style.ts → Style.ts} +121 -14
  123. package/src/Window.ts +30 -0
  124. package/src/index.ts +8 -13
  125. package/src/internal/input/actions.ts +61 -119
  126. package/src/internal/input/dispatch.ts +3 -3
  127. package/src/internal/input/gate.ts +21 -18
  128. package/src/internal/input/guard.inpage.ts +25 -58
  129. package/src/internal/input/guard.ts +11 -20
  130. package/src/internal/input/keyboard.ts +12 -3
  131. package/src/internal/input/perform.ts +78 -60
  132. package/src/internal/input/pointer.ts +4 -2
  133. package/src/internal/input/settle.ts +7 -5
  134. package/src/internal/input/targets.inpage.ts +1 -1
  135. package/src/internal/input/targets.ts +4 -9
  136. package/src/internal/page/bridge.ts +210 -114
  137. package/src/internal/page/context.ts +23 -73
  138. package/src/internal/page/dialogs.ts +58 -0
  139. package/src/internal/page/identity.ts +6 -23
  140. package/src/internal/page/lane.ts +14 -15
  141. package/src/internal/page/navigation.ts +50 -42
  142. package/src/internal/page/openings.ts +11 -5
  143. package/src/internal/page/page.ts +44 -81
  144. package/src/internal/page/port.ts +125 -0
  145. package/src/internal/{input → page}/replies.ts +1 -1
  146. package/src/internal/page/request-owner.ts +269 -0
  147. package/src/internal/page/requests.ts +357 -0
  148. package/src/internal/page/scripts.ts +124 -0
  149. package/src/internal/pictures/capture.ts +255 -332
  150. package/src/internal/pictures/dimensions.ts +162 -0
  151. package/src/internal/pictures/frame.ts +68 -0
  152. package/src/internal/pictures/pictures.ts +57 -23
  153. package/src/internal/pictures/quiescence.ts +1 -1
  154. package/src/internal/pictures/state.ts +26 -0
  155. package/src/internal/pictures/transport.ts +21 -4
  156. package/src/internal/reading/controls.inpage.ts +5 -70
  157. package/src/internal/reading/expect.inpage.ts +13 -17
  158. package/src/internal/reading/names.inpage.ts +89 -45
  159. package/src/internal/reading/outline.inpage.ts +6 -7
  160. package/src/internal/reading/reading.ts +144 -176
  161. package/src/internal/reading/ready.inpage.ts +6 -17
  162. package/src/internal/reading/ready.ts +13 -135
  163. package/src/internal/reading/subjects.inpage.ts +83 -43
  164. package/src/internal/reading/walk.inpage.ts +33 -13
  165. package/src/internal/timeline/changes.ts +55 -6
  166. package/src/internal/timeline/events.ts +15 -5
  167. package/src/internal/timeline/history.inpage.ts +1 -1
  168. package/src/internal/timeline/record.inpage.ts +4 -1
  169. package/src/internal/timeline/window.ts +2 -1
  170. package/src/{Moment.ts → moment/Moment.ts} +13 -31
  171. package/src/{internal/timeline → moment}/words.ts +2 -2
  172. package/src/{internal/reading → plan}/choose.ts +3 -3
  173. package/src/plan/data.ts +117 -0
  174. package/src/plan/execute.ts +411 -0
  175. package/src/plan/index.ts +36 -0
  176. package/src/plan/record.ts +71 -0
  177. package/src/plan/targets.ts +71 -0
  178. package/src/{Policy.ts → policy/Policy.ts} +13 -10
  179. package/src/{Motion.ts → presentation/Motion.ts} +12 -46
  180. package/src/presentation/Presentation.ts +176 -0
  181. package/src/{Stage.ts → presentation/Stage.ts} +147 -112
  182. package/src/presentation/feed.ts +21 -0
  183. package/src/providers/Cdp.ts +16 -0
  184. package/src/{Chromium.ts → providers/Chromium.ts} +7 -10
  185. package/src/providers/Released.ts +13 -0
  186. package/src/providers/connection.ts +134 -0
  187. package/src/{internal/pictures/motion.ts → stillness/Pixels.ts} +4 -4
  188. package/src/stillness/Stillness.ts +166 -0
  189. package/src/supervisor/Supervisor.ts +170 -0
  190. package/src/supervisor/contract.ts +105 -0
  191. package/src/supervisor/lifecycle.ts +272 -0
  192. package/src/supervisor/runtime.ts +234 -0
  193. package/src/testing/TestBrowser.ts +115 -0
  194. package/src/testing/TestPage.ts +10 -0
  195. package/src/testing/evidence.ts +154 -0
  196. package/src/testing/index.ts +3 -0
  197. package/src/testing/model.ts +222 -0
  198. package/src/testing/page.ts +360 -0
  199. package/src/workerd/Cdp.ts +11 -0
  200. package/dist/Browser-BwCldIff.mjs +0 -629
  201. package/dist/Browser-BwCldIff.mjs.map +0 -1
  202. package/dist/Cdp.d.mts +0 -32
  203. package/dist/Cdp.mjs +0 -61
  204. package/dist/Cdp.mjs.map +0 -1
  205. package/dist/Change-DNvztNLu.mjs +0 -138
  206. package/dist/Change-DNvztNLu.mjs.map +0 -1
  207. package/dist/Chromium.mjs.map +0 -1
  208. package/dist/Expect.d.mts +0 -62
  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-CfB6Zn1p.mjs.map +0 -1
  216. package/dist/Plan-C-d5QYS8.mjs.map +0 -1
  217. package/dist/Plan.d.mts +0 -2
  218. package/dist/Plan.mjs +0 -2
  219. package/dist/Policy.mjs.map +0 -1
  220. package/dist/Presentation.d.mts +0 -48
  221. package/dist/Presentation.mjs +0 -118
  222. package/dist/Presentation.mjs.map +0 -1
  223. package/dist/Stage.mjs.map +0 -1
  224. package/dist/Supervisor-2mPjIYYs.mjs +0 -676
  225. package/dist/Supervisor-2mPjIYYs.mjs.map +0 -1
  226. package/dist/Supervisor-mVPeEUp8.d.mts +0 -317
  227. package/dist/Supervisor.d.mts +0 -2
  228. package/dist/Supervisor.mjs +0 -2
  229. package/dist/context-w3NJPRLo.mjs +0 -335
  230. package/dist/context-w3NJPRLo.mjs.map +0 -1
  231. package/dist/match.inpage-xOe9LNO0.mjs.map +0 -1
  232. package/dist/page-BKwfF6z-.mjs +0 -5099
  233. package/dist/page-BKwfF6z-.mjs.map +0 -1
  234. package/dist/url-Cd04Okid.mjs +0 -264
  235. package/dist/url-Cd04Okid.mjs.map +0 -1
  236. package/src/Cdp.ts +0 -101
  237. package/src/Expect.ts +0 -180
  238. package/src/Plan.ts +0 -674
  239. package/src/Presentation.ts +0 -196
  240. package/src/Supervisor.ts +0 -632
  241. package/src/internal/supervisor/lifecycle.ts +0 -484
  242. /package/src/{internal/page/url.ts → Url.ts} +0 -0
  243. /package/src/{internal/pictures → stillness}/utilsBundle.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  declare namespace BrowserEvent_d_exports {
3
- export { Action, ActionOptions, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled };
3
+ export { Action, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, RequestRefused, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled };
4
4
  }
5
5
  declare const PageOpened_base: Schema.Class<PageOpened, Schema.TaggedStruct<"PageOpened", {
6
6
  readonly at: Schema.Finite;
@@ -112,43 +112,84 @@ declare const Box: Schema.Struct<{
112
112
  readonly height: Schema.Finite;
113
113
  }>;
114
114
  type Box = typeof Box.Type;
115
- /**
116
- * What else an action was asked, where it changes what the action does: a click's button, count
117
- * and hold, how `type` enters its text, how often and how long `press` holds its keys, how far
118
- * `scroll` moves, and the options `select` chose. Only a completed action records them.
119
- */
120
- declare const ActionOptions: Schema.Struct<{
121
- readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
122
- readonly clickCount: Schema.optional<Schema.Finite>;
123
- readonly holdMillis: Schema.optional<Schema.Finite>;
124
- readonly replace: Schema.optional<Schema.Boolean>;
125
- readonly submit: Schema.optional<Schema.Boolean>;
126
- readonly times: Schema.optional<Schema.Finite>;
127
- readonly dx: Schema.optional<Schema.Finite>;
128
- readonly dy: Schema.optional<Schema.Finite>;
129
- readonly values: Schema.optional<Schema.$Array<Schema.String>>;
130
- }>;
131
- type ActionOptions = typeof ActionOptions.Type;
132
115
  declare const Action_base: Schema.Class<Action, Schema.TaggedStruct<"Action", {
133
116
  readonly at: Schema.Finite;
134
117
  readonly startedAt: Schema.Finite;
135
118
  readonly page: Schema.String;
136
- readonly name: Schema.String;
119
+ readonly name: Schema.Literals<readonly ["click", "hover", "drag", "type", "press", "scroll", "select", "navigate", "back", "reload", "act"]>;
120
+ /** The decoded call, with secrets removed before publication. */
121
+ readonly value: Schema.TaggedUnion<{
122
+ readonly Act: Schema.TaggedStruct<"Act", {
123
+ readonly document: Schema.Int;
124
+ }>;
125
+ readonly Back: Schema.TaggedStruct<"Back", {}>;
126
+ readonly Click: Schema.TaggedStruct<"Click", {
127
+ readonly target: Schema.Union<readonly [Schema.String, Schema.Struct<{
128
+ readonly x: Schema.Finite;
129
+ readonly y: Schema.Finite;
130
+ }>]>;
131
+ readonly options: Schema.optional<Schema.Struct<{
132
+ readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
133
+ readonly clickCount: Schema.optional<Schema.Finite>;
134
+ readonly holdMillis: Schema.optional<Schema.Finite>;
135
+ }>>;
136
+ }>;
137
+ readonly Drag: Schema.TaggedStruct<"Drag", {
138
+ readonly from: Schema.Union<readonly [Schema.String, Schema.Struct<{
139
+ readonly x: Schema.Finite;
140
+ readonly y: Schema.Finite;
141
+ }>]>;
142
+ readonly to: Schema.Union<readonly [Schema.String, Schema.Struct<{
143
+ readonly x: Schema.Finite;
144
+ readonly y: Schema.Finite;
145
+ }>]>;
146
+ }>;
147
+ readonly Goto: Schema.TaggedStruct<"Goto", {
148
+ readonly url: Schema.String;
149
+ }>;
150
+ readonly Hover: Schema.TaggedStruct<"Hover", {
151
+ readonly target: Schema.Union<readonly [Schema.String, Schema.Struct<{
152
+ readonly x: Schema.Finite;
153
+ readonly y: Schema.Finite;
154
+ }>]>;
155
+ }>;
156
+ readonly Press: Schema.TaggedStruct<"Press", {
157
+ readonly keys: Schema.String;
158
+ readonly options: Schema.optional<Schema.Struct<{
159
+ readonly on: Schema.optional<Schema.String>;
160
+ readonly times: Schema.optional<Schema.Finite>;
161
+ readonly holdMillis: Schema.optional<Schema.Finite>;
162
+ }>>;
163
+ }>;
164
+ readonly Reload: Schema.TaggedStruct<"Reload", {}>;
165
+ readonly Scroll: Schema.TaggedStruct<"Scroll", {
166
+ readonly options: Schema.optional<Schema.Struct<{
167
+ readonly at: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
168
+ readonly x: Schema.Finite;
169
+ readonly y: Schema.Finite;
170
+ }>]>>;
171
+ readonly dx: Schema.optional<Schema.Finite>;
172
+ readonly dy: Schema.optional<Schema.Finite>;
173
+ }>>;
174
+ }>;
175
+ readonly Select: Schema.TaggedStruct<"Select", {
176
+ readonly ref: Schema.String;
177
+ readonly values: Schema.$Array<Schema.String>;
178
+ }>;
179
+ readonly Type: Schema.TaggedStruct<"Type", {
180
+ readonly text: Schema.String;
181
+ readonly options: Schema.optional<Schema.Struct<{
182
+ readonly into: Schema.optional<Schema.String>;
183
+ readonly replace: Schema.optional<Schema.Boolean>;
184
+ readonly submit: Schema.optional<Schema.Boolean>;
185
+ readonly secret: Schema.optional<Schema.Boolean>;
186
+ }>>;
187
+ }>;
188
+ }>;
137
189
  /** The address when the action ended; absent in events recorded by older releases. */
138
190
  readonly url: Schema.optional<Schema.String>;
139
191
  readonly correlation: Schema.optional<Schema.String>;
140
192
  readonly target: Schema.optional<Schema.String>;
141
- readonly options: Schema.optional<Schema.Struct<{
142
- readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
143
- readonly clickCount: Schema.optional<Schema.Finite>;
144
- readonly holdMillis: Schema.optional<Schema.Finite>;
145
- readonly replace: Schema.optional<Schema.Boolean>;
146
- readonly submit: Schema.optional<Schema.Boolean>;
147
- readonly times: Schema.optional<Schema.Finite>;
148
- readonly dx: Schema.optional<Schema.Finite>;
149
- readonly dy: Schema.optional<Schema.Finite>;
150
- readonly values: Schema.optional<Schema.$Array<Schema.String>>;
151
- }>>;
152
193
  readonly subject: Schema.optional<typeof Subject>;
153
194
  readonly to: Schema.optional<typeof Subject>;
154
195
  /** For an action at a point, the box of what it found there. */
@@ -167,7 +208,7 @@ declare const Action_base: Schema.Class<Action, Schema.TaggedStruct<"Action", {
167
208
  }>, {}>;
168
209
  /**
169
210
  * One page operation ended, including one its caller interrupted (`error: "interrupted"`).
170
- * `target` is what the caller asked for: a ref, a point, a URL or keys, and `options` the rest.
211
+ * `value` is the decoded call. `target` is its short rendering for observers.
171
212
  * `subject` is what an element or point action found there, and `to` where a drag ended; an
172
213
  * action that failed before finding its target has neither. Point actions carry the viewport
173
214
  * point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a
@@ -259,21 +300,36 @@ declare const DialogShown_base: Schema.Class<DialogShown, Schema.TaggedStruct<"D
259
300
  readonly page: Schema.String;
260
301
  readonly kind: Schema.String;
261
302
  readonly message: Schema.String;
262
- readonly answer: Schema.Literals<readonly ["accepted", "dismissed"]>;
303
+ readonly answer: Schema.Literals<readonly ["accepted", "dismissed", "failed"]>;
263
304
  }>, {}>;
264
305
  /**
265
- * A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a
306
+ * A JavaScript dialog appeared; its completed answer, or a failed response: an alert or a leave-page prompt accepted, a
266
307
  * confirm or a prompt dismissed, as if its Cancel were pressed.
267
308
  */
268
309
  declare class DialogShown extends DialogShown_base {}
269
- declare const BrowserEvent: Schema.Union<readonly [typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>;
310
+ declare const RequestRefused_base: Schema.Class<RequestRefused, Schema.TaggedStruct<"RequestRefused", {
311
+ readonly at: Schema.Finite;
312
+ readonly page: Schema.optional<Schema.String>;
313
+ readonly method: Schema.String;
314
+ readonly url: Schema.String;
315
+ readonly reason: Schema.String;
316
+ /** Safe structured diagnosis; arbitrary policy error details and causes stay private. */
317
+ readonly failure: Schema.optional<Schema.Struct<{
318
+ readonly reason: Schema.String;
319
+ readonly timeoutMillis: Schema.optional<Schema.Finite>;
320
+ }>>;
321
+ }>, {}>;
322
+ /** A context policy refused traffic; page is present only when its containing page was established.
323
+ * Worker and out-of-process iframe requests may omit it while retaining proven context ownership. */
324
+ declare class RequestRefused extends RequestRefused_base {}
325
+ declare const BrowserEvent: Schema.Union<readonly [typeof RequestRefused, typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>;
270
326
  type BrowserEvent = typeof BrowserEvent.Type;
271
327
  declare const RecordedEvent_base: Schema.Class<RecordedEvent, Schema.Struct<{
272
328
  readonly sequence: Schema.Int;
273
- readonly event: Schema.Union<readonly [typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>;
329
+ readonly event: Schema.Union<readonly [typeof RequestRefused, typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>;
274
330
  }>, {}>;
275
331
  /** A position in the browser's one replayable event history. Sequences begin at one. */
276
332
  declare class RecordedEvent extends RecordedEvent_base {}
277
333
  //#endregion
278
- export { TrackEvent as C, WheelScrolled as E, TextInserted as S, TrackPlanned as T, PointerReleased as _, BrowserEvent_d_exports as a, Subject as b, DisconnectCause as c, Navigated as d, PageClosed as f, PointerPressed as g, PageUntracked as h, BrowserEvent as i, Disconnected as l, PageOpened as m, ActionOptions as n, CursorChanged as o, PageLoaded as p, Box as r, DialogShown as s, Action as t, KeyChanged as u, RecordedEvent as v, TrackPerformed as w, SubjectContext as x, SessionEnding as y };
279
- //# sourceMappingURL=BrowserEvent-dq6FRT8w.d.mts.map
334
+ export { TrackEvent as C, WheelScrolled as E, TextInserted as S, TrackPlanned as T, RecordedEvent as _, CursorChanged as a, Subject as b, Disconnected as c, PageClosed as d, PageLoaded as f, PointerReleased as g, PointerPressed as h, BrowserEvent_d_exports as i, KeyChanged as l, PageUntracked as m, Box as n, DialogShown as o, PageOpened as p, BrowserEvent as r, DisconnectCause as s, Action as t, Navigated as u, RequestRefused as v, TrackPerformed as w, SubjectContext as x, SessionEnding as y };
335
+ //# sourceMappingURL=BrowserEvent-lLqJ3GJS.d.mts.map
@@ -1,2 +1,2 @@
1
- import { C as TrackEvent, E as WheelScrolled, S as TextInserted, T as TrackPlanned, _ as PointerReleased, b as Subject, c as DisconnectCause, d as Navigated, f as PageClosed, g as PointerPressed, h as PageUntracked, i as BrowserEvent, l as Disconnected, m as PageOpened, n as ActionOptions, o as CursorChanged, p as PageLoaded, r as Box, s as DialogShown, t as Action, u as KeyChanged, v as RecordedEvent, w as TrackPerformed, x as SubjectContext, y as SessionEnding } from "./BrowserEvent-dq6FRT8w.mjs";
2
- export { Action, ActionOptions, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled };
1
+ import { C as TrackEvent, E as WheelScrolled, S as TextInserted, T as TrackPlanned, _ as RecordedEvent, a as CursorChanged, b as Subject, c as Disconnected, d as PageClosed, f as PageLoaded, g as PointerReleased, h as PointerPressed, l as KeyChanged, m as PageUntracked, n as Box, o as DialogShown, p as PageOpened, r as BrowserEvent, s as DisconnectCause, t as Action, u as Navigated, v as RequestRefused, w as TrackPerformed, x as SubjectContext, y as SessionEnding } from "./BrowserEvent-lLqJ3GJS.mjs";
2
+ export { Action, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, RequestRefused, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled };
@@ -1,5 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { Plan, Point } from "./Motion.mjs";
2
+ import { Plan, Point } from "./Geometry.mjs";
3
+ import { Action as Action$1, Name } from "./Action.mjs";
3
4
  import { Schema } from "effect";
4
5
  //#region src/BrowserEvent.ts
5
6
  /**
@@ -16,7 +17,6 @@ import { Schema } from "effect";
16
17
  */
17
18
  var BrowserEvent_exports = /* @__PURE__ */ __exportAll({
18
19
  Action: () => Action,
19
- ActionOptions: () => ActionOptions,
20
20
  Box: () => Box,
21
21
  BrowserEvent: () => BrowserEvent,
22
22
  CursorChanged: () => CursorChanged,
@@ -32,6 +32,7 @@ var BrowserEvent_exports = /* @__PURE__ */ __exportAll({
32
32
  PointerPressed: () => PointerPressed,
33
33
  PointerReleased: () => PointerReleased,
34
34
  RecordedEvent: () => RecordedEvent,
35
+ RequestRefused: () => RequestRefused,
35
36
  SessionEnding: () => SessionEnding,
36
37
  Subject: () => Subject,
37
38
  SubjectContext: () => SubjectContext,
@@ -144,24 +145,8 @@ const Box = Schema.Struct({
144
145
  height: Schema.Finite
145
146
  });
146
147
  /**
147
- * What else an action was asked, where it changes what the action does: a click's button, count
148
- * and hold, how `type` enters its text, how often and how long `press` holds its keys, how far
149
- * `scroll` moves, and the options `select` chose. Only a completed action records them.
150
- */
151
- const ActionOptions = Schema.Struct({
152
- button: Schema.optional(Button),
153
- clickCount: Schema.optional(Schema.Finite),
154
- holdMillis: Schema.optional(Schema.Finite),
155
- replace: Schema.optional(Schema.Boolean),
156
- submit: Schema.optional(Schema.Boolean),
157
- times: Schema.optional(Schema.Finite),
158
- dx: Schema.optional(Schema.Finite),
159
- dy: Schema.optional(Schema.Finite),
160
- values: Schema.optional(Schema.Array(Schema.String))
161
- });
162
- /**
163
148
  * One page operation ended, including one its caller interrupted (`error: "interrupted"`).
164
- * `target` is what the caller asked for: a ref, a point, a URL or keys, and `options` the rest.
149
+ * `value` is the decoded call. `target` is its short rendering for observers.
165
150
  * `subject` is what an element or point action found there, and `to` where a drag ended; an
166
151
  * action that failed before finding its target has neither. Point actions carry the viewport
167
152
  * point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a
@@ -171,12 +156,13 @@ var Action = class extends Schema.TaggedClass()("Action", {
171
156
  at: Schema.Finite,
172
157
  startedAt: Schema.Finite,
173
158
  page: Schema.String,
174
- name: Schema.String,
159
+ name: Name,
160
+ /** The decoded call, with secrets removed before publication. */
161
+ value: Action$1,
175
162
  /** The address when the action ended; absent in events recorded by older releases. */
176
163
  url: Schema.optional(Schema.String),
177
164
  correlation: Schema.optional(Schema.String),
178
165
  target: Schema.optional(Schema.String),
179
- options: Schema.optional(ActionOptions),
180
166
  subject: Schema.optional(Subject),
181
167
  to: Schema.optional(Subject),
182
168
  /** For an action at a point, the box of what it found there. */
@@ -259,7 +245,7 @@ const TrackEvent = Schema.Union([
259
245
  CursorChanged
260
246
  ]);
261
247
  /**
262
- * A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a
248
+ * A JavaScript dialog appeared; its completed answer, or a failed response: an alert or a leave-page prompt accepted, a
263
249
  * confirm or a prompt dismissed, as if its Cancel were pressed.
264
250
  */
265
251
  var DialogShown = class extends Schema.TaggedClass()("DialogShown", {
@@ -267,9 +253,28 @@ var DialogShown = class extends Schema.TaggedClass()("DialogShown", {
267
253
  page: Schema.String,
268
254
  kind: Schema.String,
269
255
  message: Schema.String,
270
- answer: Schema.Literals(["accepted", "dismissed"])
256
+ answer: Schema.Literals([
257
+ "accepted",
258
+ "dismissed",
259
+ "failed"
260
+ ])
261
+ }) {};
262
+ /** A context policy refused traffic; page is present only when its containing page was established.
263
+ * Worker and out-of-process iframe requests may omit it while retaining proven context ownership. */
264
+ var RequestRefused = class extends Schema.TaggedClass()("RequestRefused", {
265
+ at: Schema.Finite,
266
+ page: Schema.optional(Schema.String),
267
+ method: Schema.String,
268
+ url: Schema.String,
269
+ reason: Schema.String,
270
+ /** Safe structured diagnosis; arbitrary policy error details and causes stay private. */
271
+ failure: Schema.optional(Schema.Struct({
272
+ reason: Schema.String,
273
+ timeoutMillis: Schema.optional(Schema.Finite)
274
+ }))
271
275
  }) {};
272
276
  const BrowserEvent = Schema.Union([
277
+ RequestRefused,
273
278
  PageOpened,
274
279
  PageClosed,
275
280
  PageUntracked,
@@ -287,6 +292,6 @@ var RecordedEvent = class extends Schema.Class("effect-browser/RecordedEvent")({
287
292
  event: BrowserEvent
288
293
  }) {};
289
294
  //#endregion
290
- export { Action, ActionOptions, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled, BrowserEvent_exports as t };
295
+ export { Action, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, RequestRefused, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled, BrowserEvent_exports as t };
291
296
 
292
297
  //# sourceMappingURL=BrowserEvent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserEvent.mjs","names":["Motion.Point","Motion.Plan"],"sources":["../src/BrowserEvent.ts"],"sourcesContent":["/**\n * What happened in a browser, in order: pages and their documents, actions, pointer motion, and\n * the browser's own end.\n *\n * Every event carries `at`, host monotonic milliseconds from the owning browser’s Effect `Clock`.\n * This clock also stamps screencast frames’ `receivedAt` and moments, so wall-clock corrections\n * cannot disturb their order. Compare stamps only within the same browser clock, not across hosts.\n * A page is named by its CDP target id, which stays the same across reconnects, and every URL is\n * reported without its userinfo or known secret parameters.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\nimport * as Motion from \"./Motion.ts\";\n\n/** A page opened, and the page that opened it, as a link or `window.open` does, if one did. */\nexport class PageOpened extends Schema.TaggedClass<PageOpened>()(\"PageOpened\", {\n at: Schema.Finite,\n page: Schema.String,\n url: Schema.String,\n opener: Schema.optional(Schema.String),\n}) {}\n\n/**\n * The page closed (`page`), or crashed and was closed (`crashed`). A page lost with its browser\n * has no event of its own: `Disconnected` stands for all of them.\n */\nexport class PageClosed extends Schema.TaggedClass<PageClosed>()(\"PageClosed\", {\n at: Schema.Finite,\n page: Schema.String,\n cause: Schema.Literals([\"page\", \"crashed\"]),\n}) {}\n\n/**\n * A tab the site opened that the library could not track, as its registration failed with\n * `detail`. A tab that closed as it opened has no event.\n */\nexport class PageUntracked extends Schema.TaggedClass<PageUntracked>()(\"PageUntracked\", {\n at: Schema.Finite,\n url: Schema.String,\n detail: Schema.String,\n}) {}\n\n/**\n * The page's main frame moved to `url`: into a new document, or within the current one\n * (`sameDocument`), as `pushState` and fragment links do. Frames carry the document they followed.\n */\nexport class Navigated extends Schema.TaggedClass<Navigated>()(\"Navigated\", {\n at: Schema.Finite,\n page: Schema.String,\n url: Schema.String,\n /**\n * The page's documents counted from 0, the one it had when this browser began tracking it, one\n * more for each new document. The count belongs to the page within one `Browser` and starts at\n * 0 again on a new connection, so compare it only with the same page's in the same browser.\n */\n document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n sameDocument: Schema.Boolean,\n}) {}\n\n/** The page's document finished parsing (`domcontentloaded`) or loading (`load`). */\nexport class PageLoaded extends Schema.TaggedClass<PageLoaded>()(\"PageLoaded\", {\n at: Schema.Finite,\n page: Schema.String,\n state: Schema.Literals([\"domcontentloaded\", \"load\"]),\n}) {}\n\n/**\n * Why a browser was lost to its owner: its connection dropped (`connection`), its provider ended\n * its session, at or after the session's `expiresAt` (`session`), or its owner released it.\n */\nexport const DisconnectCause = Schema.Literals([\"connection\", \"session\", \"released\"]);\n\nexport type DisconnectCause = typeof DisconnectCause.Type;\n\n/** The browser was lost to its owner, with every page in it. It happens once. */\nexport class Disconnected extends Schema.TaggedClass<Disconnected>()(\"Disconnected\", {\n at: Schema.Finite,\n cause: DisconnectCause,\n}) {}\n\n/** The provider ends this browser's session at `expiresAt`, a wall-clock instant. */\nexport class SessionEnding extends Schema.TaggedClass<SessionEnding>()(\"SessionEnding\", {\n at: Schema.Finite,\n expiresAt: Schema.DateTimeUtc,\n}) {}\n\n/**\n * The words around a subject that say which one it is, each bound to it in the page rather than\n * read off nearby text later. In a table, `row` is the row's header or first cell with text and\n * `column` the header over it; elsewhere, `label` is the words just before it in its row, item,\n * group or block, at most 40 characters. `heading` is the nearest heading above it, left out for\n * what is pinned to the viewport. Row, column and heading are at most 60 characters.\n */\nexport const SubjectContext = Schema.Struct({\n row: Schema.optional(Schema.String),\n column: Schema.optional(Schema.String),\n label: Schema.optional(Schema.String),\n heading: Schema.optional(Schema.String),\n});\n\nexport type SubjectContext = typeof SubjectContext.Type;\n\n/**\n * What an input acted on, or what `Page.find` found, as the page named it then: its role (null\n * when it has none), its accessible name (empty when it has none), its lowercase tag and its\n * context. For a point, it is the control under the point, or else the element painted there.\n * Unlike a ref, it keeps its meaning after the page changes.\n */\nexport class Subject extends Schema.Class<Subject>(\"effect-browser/Subject\")({\n role: Schema.NullOr(Schema.String),\n name: Schema.String,\n tag: Schema.String,\n context: SubjectContext,\n}) {}\n\nconst Button = Schema.Literals([\"left\", \"right\", \"middle\"]);\n\n/** An element's box in viewport CSS pixels; it may lie partly or wholly outside the viewport. */\nexport const Box = Schema.Struct({\n ...Motion.Point.fields,\n width: Schema.Finite,\n height: Schema.Finite,\n});\n\nexport type Box = typeof Box.Type;\n\n/**\n * What else an action was asked, where it changes what the action does: a click's button, count\n * and hold, how `type` enters its text, how often and how long `press` holds its keys, how far\n * `scroll` moves, and the options `select` chose. Only a completed action records them.\n */\nexport const ActionOptions = Schema.Struct({\n button: Schema.optional(Button),\n clickCount: Schema.optional(Schema.Finite),\n holdMillis: Schema.optional(Schema.Finite),\n replace: Schema.optional(Schema.Boolean),\n submit: Schema.optional(Schema.Boolean),\n times: Schema.optional(Schema.Finite),\n dx: Schema.optional(Schema.Finite),\n dy: Schema.optional(Schema.Finite),\n values: Schema.optional(Schema.Array(Schema.String)),\n});\n\nexport type ActionOptions = typeof ActionOptions.Type;\n\n/**\n * One page operation ended, including one its caller interrupted (`error: \"interrupted\"`).\n * `target` is what the caller asked for: a ref, a point, a URL or keys, and `options` the rest.\n * `subject` is what an element or point action found there, and `to` where a drag ended; an\n * action that failed before finding its target has neither. Point actions carry the viewport\n * point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a\n * model's tool call id.\n */\nexport class Action extends Schema.TaggedClass<Action>()(\"Action\", {\n at: Schema.Finite,\n startedAt: Schema.Finite,\n page: Schema.String,\n name: Schema.String,\n /** The address when the action ended; absent in events recorded by older releases. */\n url: Schema.optional(Schema.String),\n correlation: Schema.optional(Schema.String),\n target: Schema.optional(Schema.String),\n options: Schema.optional(ActionOptions),\n subject: Schema.optional(Subject),\n to: Schema.optional(Subject),\n /** For an action at a point, the box of what it found there. */\n box: Schema.optional(Box),\n text: Schema.optional(Schema.String),\n x: Schema.optional(Motion.Point.fields.x),\n y: Schema.optional(Motion.Point.fields.y),\n ok: Schema.Boolean,\n dispatched: Schema.Boolean,\n error: Schema.optional(Schema.String),\n}) {}\n\nconst Sequence = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** One whole glide, published before its first input. Offsets use the host monotonic clock. */\nexport class TrackPlanned extends Schema.TaggedClass<TrackPlanned>()(\"TrackPlanned\", {\n at: Schema.Finite,\n page: Schema.String,\n from: Motion.Point,\n samples: Motion.Plan,\n}) {}\n\n/**\n * The submitted prefix of a glide. `plan` is its TrackPlanned envelope sequence; `dispatched`\n * counts samples. `complete` means every sample was submitted, not acknowledged by the browser.\n * The terminal point clips a canceled plan so a compositor never draws its unrealized future.\n */\nexport class TrackPerformed extends Schema.TaggedClass<TrackPerformed>()(\"TrackPerformed\", {\n at: Schema.Finite,\n page: Schema.String,\n plan: Sequence,\n dispatched: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n ...Motion.Point.fields,\n complete: Schema.Boolean,\n}) {}\n\nexport class PointerPressed extends Schema.TaggedClass<PointerPressed>()(\"PointerPressed\", {\n at: Schema.Finite,\n page: Schema.String,\n ...Motion.Point.fields,\n button: Button,\n clickCount: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class PointerReleased extends Schema.TaggedClass<PointerReleased>()(\"PointerReleased\", {\n at: Schema.Finite,\n page: Schema.String,\n ...Motion.Point.fields,\n button: Button,\n clickCount: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class WheelScrolled extends Schema.TaggedClass<WheelScrolled>()(\"WheelScrolled\", {\n at: Schema.Finite,\n page: Schema.String,\n ...Motion.Point.fields,\n dx: Schema.Finite,\n dy: Schema.Finite,\n}) {}\n\nexport class KeyChanged extends Schema.TaggedClass<KeyChanged>()(\"KeyChanged\", {\n at: Schema.Finite,\n page: Schema.String,\n key: Schema.String,\n phase: Schema.Literals([\"down\", \"up\"]),\n}) {}\n\n/** Literal text insertion has no corresponding key events, including Unicode and newlines. */\nexport class TextInserted extends Schema.TaggedClass<TextInserted>()(\"TextInserted\", {\n at: Schema.Finite,\n page: Schema.String,\n text: Schema.String,\n}) {}\n\n/** The target's CSS cursor, obtained during target resolution without another browser call. */\nexport class CursorChanged extends Schema.TaggedClass<CursorChanged>()(\"CursorChanged\", {\n at: Schema.Finite,\n page: Schema.String,\n cursor: Schema.String,\n}) {}\n\nexport const TrackEvent = Schema.Union([\n TrackPlanned,\n TrackPerformed,\n PointerPressed,\n PointerReleased,\n WheelScrolled,\n KeyChanged,\n TextInserted,\n CursorChanged,\n]);\n\nexport type TrackEvent = typeof TrackEvent.Type;\n\n/**\n * A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a\n * confirm or a prompt dismissed, as if its Cancel were pressed.\n */\nexport class DialogShown extends Schema.TaggedClass<DialogShown>()(\"DialogShown\", {\n at: Schema.Finite,\n page: Schema.String,\n kind: Schema.String,\n message: Schema.String,\n answer: Schema.Literals([\"accepted\", \"dismissed\"]),\n}) {}\n\nexport const BrowserEvent = Schema.Union([\n PageOpened,\n PageClosed,\n PageUntracked,\n Navigated,\n PageLoaded,\n Action,\n ...TrackEvent.members,\n DialogShown,\n Disconnected,\n SessionEnding,\n]);\n\nexport type BrowserEvent = typeof BrowserEvent.Type;\n\n/** A position in the browser's one replayable event history. Sequences begin at one. */\nexport class RecordedEvent extends Schema.Class<RecordedEvent>(\"effect-browser/RecordedEvent\")({\n sequence: Sequence,\n event: BrowserEvent,\n}) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAa,aAAb,cAA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ACb,GAAA,MAAgB;CAChB,IAAI,OAAO;CACX,IAAI,OAAO;AACb,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,IAAI,OAAO;CACX,MAAM,OAAO;CACb,KAAK,OAAO;CACZ,OAAO,OAAO,SAAS,CAAC,QAAQ,IAAI,CAAC;AACvC,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,eAAb,cAAkC,OAAO,YAA0B,CAAC,CAAC,gBAAgB;CACnF,IAAI,OAAO;CACX,MAAM,OAAO;CACb,MAAM,OAAO;AACf,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,IAAI,OAAO;CACX,MAAM,OAAO;CACb,QAAQ,OAAO;AACjB,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAa,aAAa,OAAO,MAAM;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AAQD,IAAa,cAAb,cAAiC,OAAO,YAAyB,CAAC,CAAC,eAAe;CAChF,IAAI,OAAO;CACX,MAAM,OAAO;CACb,MAAM,OAAO;CACb,SAAS,OAAO;CAChB,QAAQ,OAAO,SAAS,CAAC,YAAY,WAAW,CAAC;AACnD,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAa,eAAe,OAAO,MAAM;CACvC;CACA;CACA;CACA;CACA;CACA;CACA,GAAG,WAAW;CACd;CACA;CACA;AACF,CAAC;;AAKD,IAAa,gBAAb,cAAmC,OAAO,MAAqB,8BAA8B,CAAC,CAAC;CAC7F,UAAU;CACV,OAAO;AACT,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"BrowserEvent.mjs","names":["ActionValue","Motion.Point","Motion.Plan"],"sources":["../src/BrowserEvent.ts"],"sourcesContent":["/**\n * What happened in a browser, in order: pages and their documents, actions, pointer motion, and\n * the browser's own end.\n *\n * Every event carries `at`, host monotonic milliseconds from the owning browser’s Effect `Clock`.\n * This clock also stamps screencast frames’ `receivedAt` and moments, so wall-clock corrections\n * cannot disturb their order. Compare stamps only within the same browser clock, not across hosts.\n * A page is named by its CDP target id, which stays the same across reconnects, and every URL is\n * reported without its userinfo or known secret parameters.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\nimport { Action as ActionValue, Name } from \"./Action.ts\";\nimport * as Motion from \"./Geometry.ts\";\n\n/** A page opened, and the page that opened it, as a link or `window.open` does, if one did. */\nexport class PageOpened extends Schema.TaggedClass<PageOpened>()(\"PageOpened\", {\n at: Schema.Finite,\n page: Schema.String,\n url: Schema.String,\n opener: Schema.optional(Schema.String),\n}) {}\n\n/**\n * The page closed (`page`), or crashed and was closed (`crashed`). A page lost with its browser\n * has no event of its own: `Disconnected` stands for all of them.\n */\nexport class PageClosed extends Schema.TaggedClass<PageClosed>()(\"PageClosed\", {\n at: Schema.Finite,\n page: Schema.String,\n cause: Schema.Literals([\"page\", \"crashed\"]),\n}) {}\n\n/**\n * A tab the site opened that the library could not track, as its registration failed with\n * `detail`. A tab that closed as it opened has no event.\n */\nexport class PageUntracked extends Schema.TaggedClass<PageUntracked>()(\"PageUntracked\", {\n at: Schema.Finite,\n url: Schema.String,\n detail: Schema.String,\n}) {}\n\n/**\n * The page's main frame moved to `url`: into a new document, or within the current one\n * (`sameDocument`), as `pushState` and fragment links do. Frames carry the document they followed.\n */\nexport class Navigated extends Schema.TaggedClass<Navigated>()(\"Navigated\", {\n at: Schema.Finite,\n page: Schema.String,\n url: Schema.String,\n /**\n * The page's documents counted from 0, the one it had when this browser began tracking it, one\n * more for each new document. The count belongs to the page within one `Browser` and starts at\n * 0 again on a new connection, so compare it only with the same page's in the same browser.\n */\n document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n sameDocument: Schema.Boolean,\n}) {}\n\n/** The page's document finished parsing (`domcontentloaded`) or loading (`load`). */\nexport class PageLoaded extends Schema.TaggedClass<PageLoaded>()(\"PageLoaded\", {\n at: Schema.Finite,\n page: Schema.String,\n state: Schema.Literals([\"domcontentloaded\", \"load\"]),\n}) {}\n\n/**\n * Why a browser was lost to its owner: its connection dropped (`connection`), its provider ended\n * its session, at or after the session's `expiresAt` (`session`), or its owner released it.\n */\nexport const DisconnectCause = Schema.Literals([\"connection\", \"session\", \"released\"]);\n\nexport type DisconnectCause = typeof DisconnectCause.Type;\n\n/** The browser was lost to its owner, with every page in it. It happens once. */\nexport class Disconnected extends Schema.TaggedClass<Disconnected>()(\"Disconnected\", {\n at: Schema.Finite,\n cause: DisconnectCause,\n}) {}\n\n/** The provider ends this browser's session at `expiresAt`, a wall-clock instant. */\nexport class SessionEnding extends Schema.TaggedClass<SessionEnding>()(\"SessionEnding\", {\n at: Schema.Finite,\n expiresAt: Schema.DateTimeUtc,\n}) {}\n\n/**\n * The words around a subject that say which one it is, each bound to it in the page rather than\n * read off nearby text later. In a table, `row` is the row's header or first cell with text and\n * `column` the header over it; elsewhere, `label` is the words just before it in its row, item,\n * group or block, at most 40 characters. `heading` is the nearest heading above it, left out for\n * what is pinned to the viewport. Row, column and heading are at most 60 characters.\n */\nexport const SubjectContext = Schema.Struct({\n row: Schema.optional(Schema.String),\n column: Schema.optional(Schema.String),\n label: Schema.optional(Schema.String),\n heading: Schema.optional(Schema.String),\n});\n\nexport type SubjectContext = typeof SubjectContext.Type;\n\n/**\n * What an input acted on, or what `Page.find` found, as the page named it then: its role (null\n * when it has none), its accessible name (empty when it has none), its lowercase tag and its\n * context. For a point, it is the control under the point, or else the element painted there.\n * Unlike a ref, it keeps its meaning after the page changes.\n */\nexport class Subject extends Schema.Class<Subject>(\"effect-browser/Subject\")({\n role: Schema.NullOr(Schema.String),\n name: Schema.String,\n tag: Schema.String,\n context: SubjectContext,\n}) {}\n\nconst Button = Schema.Literals([\"left\", \"right\", \"middle\"]);\n\n/** An element's box in viewport CSS pixels; it may lie partly or wholly outside the viewport. */\nexport const Box = Schema.Struct({\n ...Motion.Point.fields,\n width: Schema.Finite,\n height: Schema.Finite,\n});\n\nexport type Box = typeof Box.Type;\n\n/**\n * One page operation ended, including one its caller interrupted (`error: \"interrupted\"`).\n * `value` is the decoded call. `target` is its short rendering for observers.\n * `subject` is what an element or point action found there, and `to` where a drag ended; an\n * action that failed before finding its target has neither. Point actions carry the viewport\n * point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a\n * model's tool call id.\n */\nexport class Action extends Schema.TaggedClass<Action>()(\"Action\", {\n at: Schema.Finite,\n startedAt: Schema.Finite,\n page: Schema.String,\n name: Name,\n /** The decoded call, with secrets removed before publication. */\n value: ActionValue,\n /** The address when the action ended; absent in events recorded by older releases. */\n url: Schema.optional(Schema.String),\n correlation: Schema.optional(Schema.String),\n target: Schema.optional(Schema.String),\n subject: Schema.optional(Subject),\n to: Schema.optional(Subject),\n /** For an action at a point, the box of what it found there. */\n box: Schema.optional(Box),\n text: Schema.optional(Schema.String),\n x: Schema.optional(Motion.Point.fields.x),\n y: Schema.optional(Motion.Point.fields.y),\n ok: Schema.Boolean,\n dispatched: Schema.Boolean,\n error: Schema.optional(Schema.String),\n}) {}\n\nconst Sequence = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** One whole glide, published before its first input. Offsets use the host monotonic clock. */\nexport class TrackPlanned extends Schema.TaggedClass<TrackPlanned>()(\"TrackPlanned\", {\n at: Schema.Finite,\n page: Schema.String,\n from: Motion.Point,\n samples: Motion.Plan,\n}) {}\n\n/**\n * The submitted prefix of a glide. `plan` is its TrackPlanned envelope sequence; `dispatched`\n * counts samples. `complete` means every sample was submitted, not acknowledged by the browser.\n * The terminal point clips a canceled plan so a compositor never draws its unrealized future.\n */\nexport class TrackPerformed extends Schema.TaggedClass<TrackPerformed>()(\"TrackPerformed\", {\n at: Schema.Finite,\n page: Schema.String,\n plan: Sequence,\n dispatched: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n ...Motion.Point.fields,\n complete: Schema.Boolean,\n}) {}\n\nexport class PointerPressed extends Schema.TaggedClass<PointerPressed>()(\"PointerPressed\", {\n at: Schema.Finite,\n page: Schema.String,\n ...Motion.Point.fields,\n button: Button,\n clickCount: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class PointerReleased extends Schema.TaggedClass<PointerReleased>()(\"PointerReleased\", {\n at: Schema.Finite,\n page: Schema.String,\n ...Motion.Point.fields,\n button: Button,\n clickCount: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class WheelScrolled extends Schema.TaggedClass<WheelScrolled>()(\"WheelScrolled\", {\n at: Schema.Finite,\n page: Schema.String,\n ...Motion.Point.fields,\n dx: Schema.Finite,\n dy: Schema.Finite,\n}) {}\n\nexport class KeyChanged extends Schema.TaggedClass<KeyChanged>()(\"KeyChanged\", {\n at: Schema.Finite,\n page: Schema.String,\n key: Schema.String,\n phase: Schema.Literals([\"down\", \"up\"]),\n}) {}\n\n/** Literal text insertion has no corresponding key events, including Unicode and newlines. */\nexport class TextInserted extends Schema.TaggedClass<TextInserted>()(\"TextInserted\", {\n at: Schema.Finite,\n page: Schema.String,\n text: Schema.String,\n}) {}\n\n/** The target's CSS cursor, obtained during target resolution without another browser call. */\nexport class CursorChanged extends Schema.TaggedClass<CursorChanged>()(\"CursorChanged\", {\n at: Schema.Finite,\n page: Schema.String,\n cursor: Schema.String,\n}) {}\n\nexport const TrackEvent = Schema.Union([\n TrackPlanned,\n TrackPerformed,\n PointerPressed,\n PointerReleased,\n WheelScrolled,\n KeyChanged,\n TextInserted,\n CursorChanged,\n]);\n\nexport type TrackEvent = typeof TrackEvent.Type;\n\n/**\n * A JavaScript dialog appeared; its completed answer, or a failed response: an alert or a leave-page prompt accepted, a\n * confirm or a prompt dismissed, as if its Cancel were pressed.\n */\nexport class DialogShown extends Schema.TaggedClass<DialogShown>()(\"DialogShown\", {\n at: Schema.Finite,\n page: Schema.String,\n kind: Schema.String,\n message: Schema.String,\n answer: Schema.Literals([\"accepted\", \"dismissed\", \"failed\"]),\n}) {}\n\n/** A context policy refused traffic; page is present only when its containing page was established.\n * Worker and out-of-process iframe requests may omit it while retaining proven context ownership. */\nexport class RequestRefused extends Schema.TaggedClass<RequestRefused>()(\"RequestRefused\", {\n at: Schema.Finite,\n page: Schema.optional(Schema.String),\n method: Schema.String,\n url: Schema.String,\n reason: Schema.String,\n /** Safe structured diagnosis; arbitrary policy error details and causes stay private. */\n failure: Schema.optional(\n Schema.Struct({\n reason: Schema.String,\n timeoutMillis: Schema.optional(Schema.Finite),\n }),\n ),\n}) {}\n\nexport const BrowserEvent = Schema.Union([\n RequestRefused,\n PageOpened,\n PageClosed,\n PageUntracked,\n Navigated,\n PageLoaded,\n Action,\n ...TrackEvent.members,\n DialogShown,\n Disconnected,\n SessionEnding,\n]);\n\nexport type BrowserEvent = typeof BrowserEvent.Type;\n\n/** A position in the browser's one replayable event history. Sequences begin at one. */\nexport class RecordedEvent extends Schema.Class<RecordedEvent>(\"effect-browser/RecordedEvent\")({\n sequence: Sequence,\n event: BrowserEvent,\n}) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,IAAI,OAAO;CACX,MAAM,OAAO;CACb,KAAK,OAAO;CACZ,QAAQ,OAAO,SAAS,OAAO,MAAM;AACvC,CAAC,CAAC,CAAC,CAAC;;;;;AAMJ,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,IAAI,OAAO;CACX,MAAM,OAAO;CACb,OAAO,OAAO,SAAS,CAAC,QAAQ,SAAS,CAAC;AAC5C,CAAC,CAAC,CAAC,CAAC;;;;;AAMJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,IAAI,OAAO;CACX,KAAK,OAAO;CACZ,QAAQ,OAAO;AACjB,CAAC,CAAC,CAAC,CAAC;;;;;AAMJ,IAAa,YAAb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B;CACzF,IAAI,OAAO;CACX,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,QAAQ,OAAO;CACf,KAAK,OAAO;CACZ,QAAQ,OAAO;;CAEf,SAAS,OAAO,SACd,OAAO,OAAO;EACZ,QAAQ,OAAO;EACf,eAAe,OAAO,SAAS,OAAO,MAAM;CAC9C,CAAC,CACH;AACF,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAa,eAAe,OAAO,MAAM;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG,WAAW;CACd;CACA;CACA;AACF,CAAC;;AAKD,IAAa,gBAAb,cAAmC,OAAO,MAAqB,8BAA8B,CAAC,CAAC;CAC7F,UAAU;CACV,OAAO;AACT,CAAC,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
- import { b as Subject } from "./BrowserEvent-dq6FRT8w.mjs";
1
+ import { b as Subject } from "./BrowserEvent-lLqJ3GJS.mjs";
2
2
  import { Schema } from "effect";
3
3
  declare namespace Change_d_exports {
4
- export { Change, Changes, Kind, describe };
4
+ export { Change, Changes, Kind };
5
5
  }
6
6
  /**
7
7
  * `text` changed; `appeared` and `disappeared`, whether added or removed or shown or hidden;
@@ -64,8 +64,6 @@ declare const Changes_base: Schema.Class<Changes, Schema.Struct<{
64
64
  readonly changes: Schema.$Array<typeof Change>;
65
65
  }>, {}>;
66
66
  declare class Changes extends Changes_base {}
67
- /** A change in words for a model, such as `"$61,240" became "$62,010" (row "Bitcoin", column "Price")`. */
68
- declare const describe: (change: Change) => string;
69
67
  //#endregion
70
- export { describe as a, Kind as i, Change_d_exports as n, Changes as r, Change as t };
71
- //# sourceMappingURL=Change-DqING3tr.d.mts.map
68
+ export { Kind as i, Change_d_exports as n, Changes as r, Change as t };
69
+ //# sourceMappingURL=Change-Ba7INmay.d.mts.map
package/dist/Change.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as describe, i as Kind, r as Changes, t as Change } from "./Change-DqING3tr.mjs";
2
- export { Change, Changes, Kind, describe };
1
+ import { i as Kind, r as Changes, t as Change } from "./Change-Ba7INmay.mjs";
2
+ export { Change, Changes, Kind };
package/dist/Change.mjs CHANGED
@@ -1,2 +1,97 @@
1
- import { a as describe, i as Kind, r as Changes, t as Change } from "./Change-DNvztNLu.mjs";
2
- export { Change, Changes, Kind, describe };
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { Subject } from "./BrowserEvent.mjs";
3
+ import { Schema } from "effect";
4
+ //#region src/Change.ts
5
+ /**
6
+ * What visibly changed on a page over a window, element by element: text that changed, appeared,
7
+ * disappeared or came and went, a field's value, and the document's title. A change says what was
8
+ * shown at the window's start and at its end, how often it changed between, where it is on the
9
+ * page, and the input it followed, where it was that input's doing.
10
+ *
11
+ * `Page.changes` reads it. A page records once something reads its changes: from then, and from the
12
+ * start of each later document once it is parsed, until nobody has read it for two minutes. A page
13
+ * nobody reads records nothing. The record keeps 256 elements, each with its last 32 changes, for a
14
+ * minute; an element that keeps changing gives way before news, and what gives way is counted in
15
+ * `dropped`, with `from` moved past it. A change is told when it was in view as the page rendered
16
+ * it, its style showing it, so one scrolled away later is still told, and something removed or
17
+ * hidden only if it was in view before. What the record cannot see: pictures, a canvas, frames,
18
+ * shadow roots and SVG; a value a script sets; and a class that reveals an element the record has
19
+ * not seen before, such as a toast already on the page, though its later changes are seen.
20
+ *
21
+ * @since 0.3.0
22
+ */
23
+ var Change_exports = /* @__PURE__ */ __exportAll({
24
+ Change: () => Change,
25
+ Changes: () => Changes,
26
+ Kind: () => Kind
27
+ });
28
+ /**
29
+ * `text` changed; `appeared` and `disappeared`, whether added or removed or shown or hidden;
30
+ * `brief`, appeared and gone again by the window's end; `value`, a field's; `title`, the document's.
31
+ */
32
+ const Kind = Schema.Literals([
33
+ "text",
34
+ "appeared",
35
+ "disappeared",
36
+ "brief",
37
+ "value",
38
+ "title"
39
+ ]);
40
+ var Change = class extends Schema.Class("effect-browser/Change")({
41
+ kind: Kind,
42
+ /**
43
+ * What changed, as the page names it now, or where it was for what went. Its own words are what
44
+ * changed, so its name is empty unless something else names it, as a field's label does.
45
+ */
46
+ subject: Subject,
47
+ /** When it first changed in the window, in host monotonic milliseconds on the browser's clock. */
48
+ startedAt: Schema.Finite,
49
+ /** When it last changed in the window. */
50
+ at: Schema.Finite,
51
+ /**
52
+ * What it showed at the window's start; absent for what appeared and where the record let that go.
53
+ * What disappeared says what it showed as it went. A field's value reads `••••` unless unmasked.
54
+ */
55
+ before: Schema.optional(Schema.String),
56
+ /** What it showed at the window's end; absent for what disappeared. What came and went says what it showed. */
57
+ after: Schema.optional(Schema.String),
58
+ /** How many times what it showed changed in the window. */
59
+ count: Schema.Int.check(Schema.isGreaterThan(0)),
60
+ /** For a number that changed more than once, its lowest and highest, as shown. */
61
+ lowest: Schema.optional(Schema.String),
62
+ highest: Schema.optional(Schema.String),
63
+ /** When it last changed before the window, as far back as the record keeps: in flux, not news. */
64
+ earlier: Schema.optional(Schema.Finite),
65
+ /**
66
+ * When the trusted input it followed reached the page, where it was that input's doing. It was not
67
+ * in flux: in the 10 s before the input it had not changed, and nothing had come into or left what
68
+ * it sits in, so a ticker's tick or a feed's line is not. Then it changed within 3 s inside what
69
+ * the input acted on or its row, form, dialog or controlled element; or, elsewhere, within 500 ms
70
+ * of an input on a page where nothing had changed in the 2 s before, as a menu a portal puts at
71
+ * the end of the page does. What holds the input's target, as a menu holds its item, does not
72
+ * count against it. The page's `Action` that sent it holds that time.
73
+ */
74
+ cause: Schema.optional(Schema.Finite)
75
+ }) {};
76
+ var Changes = class extends Schema.Class("effect-browser/Changes")({
77
+ /** The page's document these changes belong to, as `Navigated` counts them. */
78
+ document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
79
+ /** Where the record is whole: before it, changes may be missing. */
80
+ from: Schema.Finite,
81
+ /** Where the window ends: its `until`, or when the page was read. */
82
+ until: Schema.Finite,
83
+ /**
84
+ * Where the window ends on the page's own clock. Give these changes as the next read's `since` and
85
+ * the two windows meet exactly, whatever the clock mapping does meanwhile.
86
+ */
87
+ cursor: Schema.Finite,
88
+ /** Changes in the window the record let go, at least; 0 when it kept them all. */
89
+ dropped: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
90
+ /** Oldest first, by when each began to change. */
91
+ changes: Schema.Array(Change)
92
+ }) {};
93
+ /** A change in words for a model, such as `"$61,240" became "$62,010" (row "Bitcoin", column "Price")`. */
94
+ //#endregion
95
+ export { Change, Changes, Kind, Change_exports as t };
96
+
97
+ //# sourceMappingURL=Change.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Change.mjs","names":[],"sources":["../src/Change.ts"],"sourcesContent":["/**\n * What visibly changed on a page over a window, element by element: text that changed, appeared,\n * disappeared or came and went, a field's value, and the document's title. A change says what was\n * shown at the window's start and at its end, how often it changed between, where it is on the\n * page, and the input it followed, where it was that input's doing.\n *\n * `Page.changes` reads it. A page records once something reads its changes: from then, and from the\n * start of each later document once it is parsed, until nobody has read it for two minutes. A page\n * nobody reads records nothing. The record keeps 256 elements, each with its last 32 changes, for a\n * minute; an element that keeps changing gives way before news, and what gives way is counted in\n * `dropped`, with `from` moved past it. A change is told when it was in view as the page rendered\n * it, its style showing it, so one scrolled away later is still told, and something removed or\n * hidden only if it was in view before. What the record cannot see: pictures, a canvas, frames,\n * shadow roots and SVG; a value a script sets; and a class that reveals an element the record has\n * not seen before, such as a toast already on the page, though its later changes are seen.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\nimport { Subject } from \"./BrowserEvent.ts\";\n\n/**\n * `text` changed; `appeared` and `disappeared`, whether added or removed or shown or hidden;\n * `brief`, appeared and gone again by the window's end; `value`, a field's; `title`, the document's.\n */\nexport const Kind = Schema.Literals([\"text\", \"appeared\", \"disappeared\", \"brief\", \"value\", \"title\"]);\n\nexport type Kind = typeof Kind.Type;\n\nexport class Change extends Schema.Class<Change>(\"effect-browser/Change\")({\n kind: Kind,\n /**\n * What changed, as the page names it now, or where it was for what went. Its own words are what\n * changed, so its name is empty unless something else names it, as a field's label does.\n */\n subject: Subject,\n /** When it first changed in the window, in host monotonic milliseconds on the browser's clock. */\n startedAt: Schema.Finite,\n /** When it last changed in the window. */\n at: Schema.Finite,\n /**\n * What it showed at the window's start; absent for what appeared and where the record let that go.\n * What disappeared says what it showed as it went. A field's value reads `••••` unless unmasked.\n */\n before: Schema.optional(Schema.String),\n /** What it showed at the window's end; absent for what disappeared. What came and went says what it showed. */\n after: Schema.optional(Schema.String),\n /** How many times what it showed changed in the window. */\n count: Schema.Int.check(Schema.isGreaterThan(0)),\n /** For a number that changed more than once, its lowest and highest, as shown. */\n lowest: Schema.optional(Schema.String),\n highest: Schema.optional(Schema.String),\n /** When it last changed before the window, as far back as the record keeps: in flux, not news. */\n earlier: Schema.optional(Schema.Finite),\n /**\n * When the trusted input it followed reached the page, where it was that input's doing. It was not\n * in flux: in the 10 s before the input it had not changed, and nothing had come into or left what\n * it sits in, so a ticker's tick or a feed's line is not. Then it changed within 3 s inside what\n * the input acted on or its row, form, dialog or controlled element; or, elsewhere, within 500 ms\n * of an input on a page where nothing had changed in the 2 s before, as a menu a portal puts at\n * the end of the page does. What holds the input's target, as a menu holds its item, does not\n * count against it. The page's `Action` that sent it holds that time.\n */\n cause: Schema.optional(Schema.Finite),\n}) {}\n\nexport class Changes extends Schema.Class<Changes>(\"effect-browser/Changes\")({\n /** The page's document these changes belong to, as `Navigated` counts them. */\n document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n /** Where the record is whole: before it, changes may be missing. */\n from: Schema.Finite,\n /** Where the window ends: its `until`, or when the page was read. */\n until: Schema.Finite,\n /**\n * Where the window ends on the page's own clock. Give these changes as the next read's `since` and\n * the two windows meet exactly, whatever the clock mapping does meanwhile.\n */\n cursor: Schema.Finite,\n /** Changes in the window the record let go, at least; 0 when it kept them all. */\n dropped: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n /** Oldest first, by when each began to change. */\n changes: Schema.Array(Change),\n}) {}\n\n/** A change in words for a model, such as `\"$61,240\" became \"$62,010\" (row \"Bitcoin\", column \"Price\")`. */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,OAAO,OAAO,SAAS;CAAC;CAAQ;CAAY;CAAe;CAAS;CAAS;AAAO,CAAC;AAIlG,IAAa,SAAb,cAA4B,OAAO,MAAc,uBAAuB,CAAC,CAAC;CACxE,MAAM;;;;;CAKN,SAAS;;CAET,WAAW,OAAO;;CAElB,IAAI,OAAO;;;;;CAKX,QAAQ,OAAO,SAAS,OAAO,MAAM;;CAErC,OAAO,OAAO,SAAS,OAAO,MAAM;;CAEpC,OAAO,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;CAE/C,QAAQ,OAAO,SAAS,OAAO,MAAM;CACrC,SAAS,OAAO,SAAS,OAAO,MAAM;;CAEtC,SAAS,OAAO,SAAS,OAAO,MAAM;;;;;;;;;;CAUtC,OAAO,OAAO,SAAS,OAAO,MAAM;AACtC,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,UAAb,cAA6B,OAAO,MAAe,wBAAwB,CAAC,CAAC;;CAE3E,UAAU,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;CAE3D,MAAM,OAAO;;CAEb,OAAO,OAAO;;;;;CAKd,QAAQ,OAAO;;CAEf,SAAS,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;CAE1D,SAAS,OAAO,MAAM,MAAM;AAC9B,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { Clock, Effect, Option } from "effect";
2
+ declare namespace Clock_d_exports {
3
+ export { Estimate, Mapping, Probe, estimate, mapping, monotonicMillis, supersedes, toBrowserSeconds, toHostTime, uncertaintyAt };
4
+ }
5
+ /** Read the captured owner's clock, including from native callbacks, without changing its origin. */
6
+ export declare const monotonicMillis: (clock: Clock.Clock) => number;
7
+ export interface Probe {
8
+ readonly hostStart: number;
9
+ readonly hostEnd: number;
10
+ readonly browserTime: number;
11
+ }
12
+ export interface Estimate {
13
+ /** Browser epoch milliseconds minus the owner's host monotonic milliseconds. */
14
+ readonly offsetMillis: number;
15
+ /** Either transport direction can own the entire round trip; symmetry is not assumed. */
16
+ readonly uncertaintyMillis: number;
17
+ readonly roundTripMillis: number;
18
+ readonly sampledAt: number;
19
+ }
20
+ /** The fastest complete probe limits uncertainty without mistaking transit delay for clock offset. */
21
+ export declare const estimate: (probes: ReadonlyArray<Probe>) => Option.Option<Estimate>;
22
+ /** An estimate's uncertainty at `hostTime`, wider the further that is from when it was sampled. */
23
+ export declare const uncertaintyAt: (estimate: Estimate, hostTime: number) => number;
24
+ /**
25
+ * The browser's one epoch mapping, shared by its pages, input runs and capture generations. It is
26
+ * measured on first need, by the first capture, never ahead of it.
27
+ */
28
+ export interface Mapping {
29
+ /** The latest estimate, without measuring: input uses it, and never waits for one. */
30
+ readonly latest: () => Estimate | undefined;
31
+ /** The latest estimate, measured through `measure` only while the browser has none. */
32
+ readonly current: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<Estimate, E>;
33
+ /**
34
+ * Measure again once ten seconds have passed since the latest measurement began. A failed
35
+ * measurement keeps the estimate, which keeps widening with its age.
36
+ */
37
+ readonly renew: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<void>;
38
+ }
39
+ /**
40
+ * Whether a new measurement should replace the current estimate. Each interval contains the true
41
+ * offset, so overlapping intervals agree and the narrower one is kept, the current one widened by
42
+ * its age: a probe delayed behind a busy page cannot widen every tab's stamps. A disjoint
43
+ * measurement means the clocks moved (a wall clock step, or drift between a remote browser and
44
+ * this host), so the newer evidence wins.
45
+ */
46
+ export declare const supersedes: (next: Estimate, current: Estimate) => boolean;
47
+ /**
48
+ * Every renderer of a browser reads the same host wall clock, so the offset belongs to the
49
+ * browser rather than a page. A busy page cannot fail work that an earlier estimate can serve.
50
+ */
51
+ export declare const mapping: (now: () => number) => Mapping;
52
+ export declare const toHostTime: (calibration: Estimate, browserEpochMillis: number) => number;
53
+ /** CDP input timestamps use seconds, unlike browser frame timestamps and the owner's clock. */
54
+ export declare const toBrowserSeconds: (calibration: Estimate, hostMillis: number) => number;
55
+ //#endregion
56
+ export { Clock_d_exports as t };
57
+ //# sourceMappingURL=Clock.d.mts.map