effect-browser 0.2.0-beta.9 → 0.3.0-beta.11

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 (205) hide show
  1. package/README.md +861 -1161
  2. package/dist/Browser-B4qncxe7.mjs +628 -0
  3. package/dist/Browser-B4qncxe7.mjs.map +1 -0
  4. package/dist/Browser.d.mts +129 -3
  5. package/dist/Browser.mjs +2 -22
  6. package/dist/BrowserError-Coy7EW1N.d.mts +140 -0
  7. package/dist/BrowserError.d.mts +2 -0
  8. package/dist/BrowserError.mjs +211 -0
  9. package/dist/BrowserError.mjs.map +1 -0
  10. package/dist/BrowserEvent-BRu2juEz.d.mts +279 -0
  11. package/dist/BrowserEvent.d.mts +2 -0
  12. package/dist/BrowserEvent.mjs +297 -0
  13. package/dist/BrowserEvent.mjs.map +1 -0
  14. package/dist/Cdp.d.mts +32 -0
  15. package/dist/Cdp.mjs +61 -0
  16. package/dist/Cdp.mjs.map +1 -0
  17. package/dist/Change-DNvztNLu.mjs +138 -0
  18. package/dist/Change-DNvztNLu.mjs.map +1 -0
  19. package/dist/Change-iMlcuzVD.d.mts +71 -0
  20. package/dist/Change.d.mts +2 -0
  21. package/dist/Change.mjs +2 -0
  22. package/dist/Chromium.d.mts +29 -81
  23. package/dist/Chromium.mjs +57 -392
  24. package/dist/Chromium.mjs.map +1 -1
  25. package/dist/Expect.d.mts +62 -0
  26. package/dist/Expect.mjs +114 -0
  27. package/dist/Expect.mjs.map +1 -0
  28. package/dist/Frame-Di2PxyF7.d.mts +119 -0
  29. package/dist/Frame.d.mts +2 -0
  30. package/dist/Frame.mjs +125 -0
  31. package/dist/Frame.mjs.map +1 -0
  32. package/dist/Moment.d.mts +2 -0
  33. package/dist/Moment.mjs +288 -0
  34. package/dist/Moment.mjs.map +1 -0
  35. package/dist/Motion.d.mts +40 -0
  36. package/dist/Motion.mjs +122 -0
  37. package/dist/Motion.mjs.map +1 -0
  38. package/dist/Page-B5cjaUp5.mjs +618 -0
  39. package/dist/Page-B5cjaUp5.mjs.map +1 -0
  40. package/dist/Page-B7X6DQUn.d.mts +595 -0
  41. package/dist/Page.d.mts +2 -0
  42. package/dist/Page.mjs +2 -0
  43. package/dist/Plan-Akcac63g.d.mts +209 -0
  44. package/dist/Plan-D1wrJVs8.mjs +508 -0
  45. package/dist/Plan-D1wrJVs8.mjs.map +1 -0
  46. package/dist/Plan.d.mts +2 -3
  47. package/dist/Plan.mjs +2 -2
  48. package/dist/Policy.d.mts +76 -0
  49. package/dist/Policy.mjs +237 -0
  50. package/dist/Policy.mjs.map +1 -0
  51. package/dist/Presentation.d.mts +48 -0
  52. package/dist/Presentation.mjs +117 -0
  53. package/dist/Presentation.mjs.map +1 -0
  54. package/dist/Snapshot-B34hZ4Jl.d.mts +68 -0
  55. package/dist/Snapshot.d.mts +2 -0
  56. package/dist/Snapshot.mjs +79 -0
  57. package/dist/Snapshot.mjs.map +1 -0
  58. package/dist/Stage.d.mts +64 -0
  59. package/dist/Stage.mjs +237 -0
  60. package/dist/Stage.mjs.map +1 -0
  61. package/dist/Supervisor-CYWFK3vM.d.mts +280 -0
  62. package/dist/Supervisor-TNKNOVzu.mjs +599 -0
  63. package/dist/Supervisor-TNKNOVzu.mjs.map +1 -0
  64. package/dist/Supervisor.d.mts +2 -0
  65. package/dist/Supervisor.mjs +2 -0
  66. package/dist/context-B6xr8nVi.mjs +261 -0
  67. package/dist/context-B6xr8nVi.mjs.map +1 -0
  68. package/dist/index.d.mts +17 -14
  69. package/dist/index.mjs +18 -13
  70. package/dist/match.inpage-xOe9LNO0.mjs +48 -0
  71. package/dist/match.inpage-xOe9LNO0.mjs.map +1 -0
  72. package/dist/page-BAf__WKX.mjs +5075 -0
  73. package/dist/page-BAf__WKX.mjs.map +1 -0
  74. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  75. package/dist/url-Cd04Okid.mjs +264 -0
  76. package/dist/url-Cd04Okid.mjs.map +1 -0
  77. package/package.json +96 -61
  78. package/src/Browser.ts +672 -0
  79. package/src/BrowserError.ts +234 -0
  80. package/src/BrowserEvent.ts +296 -0
  81. package/src/Cdp.ts +101 -0
  82. package/src/Change.ts +88 -0
  83. package/src/Chromium.ts +102 -0
  84. package/src/Expect.ts +180 -0
  85. package/src/Frame.ts +132 -0
  86. package/src/Moment.ts +479 -0
  87. package/src/Motion.ts +166 -0
  88. package/src/Page.ts +522 -0
  89. package/src/Plan.ts +663 -0
  90. package/src/Policy.ts +325 -0
  91. package/src/Presentation.ts +195 -0
  92. package/src/Snapshot.ts +89 -0
  93. package/src/Stage.ts +467 -0
  94. package/src/Supervisor.ts +599 -0
  95. package/src/index.ts +20 -0
  96. package/src/internal/input/actions.ts +610 -0
  97. package/src/internal/input/dispatch.ts +161 -0
  98. package/src/internal/input/edit.inpage.ts +162 -0
  99. package/src/internal/input/evidence.inpage.ts +164 -0
  100. package/src/internal/input/gate.ts +224 -0
  101. package/src/internal/input/guard.inpage.ts +605 -0
  102. package/src/internal/input/guard.ts +184 -0
  103. package/src/internal/input/keyboard.ts +112 -0
  104. package/src/internal/input/keys.ts +127 -0
  105. package/src/internal/input/perform.ts +376 -0
  106. package/src/internal/input/pointer.ts +153 -0
  107. package/src/internal/input/replies.ts +195 -0
  108. package/src/internal/input/settle.ts +50 -0
  109. package/src/internal/input/style.ts +186 -0
  110. package/src/internal/input/targets.inpage.ts +293 -0
  111. package/src/internal/input/targets.ts +148 -0
  112. package/src/internal/page/bridge.ts +391 -0
  113. package/src/internal/page/context.ts +314 -0
  114. package/src/internal/page/identity.ts +35 -0
  115. package/src/internal/page/lane.ts +311 -0
  116. package/src/internal/page/navigation.ts +183 -0
  117. package/src/internal/page/openings.ts +87 -0
  118. package/src/internal/page/page.ts +165 -0
  119. package/src/internal/page/url.ts +100 -0
  120. package/src/internal/page/viewport.ts +43 -0
  121. package/src/internal/pictures/capture.ts +776 -0
  122. package/src/internal/pictures/clock.ts +141 -0
  123. package/src/internal/pictures/counts.ts +92 -0
  124. package/src/internal/pictures/pictures.ts +521 -0
  125. package/src/internal/pictures/transport.ts +243 -0
  126. package/src/internal/reading/choose.ts +100 -0
  127. package/src/internal/reading/context.inpage.ts +201 -0
  128. package/src/internal/reading/controls.inpage.ts +158 -0
  129. package/src/internal/reading/expect.inpage.ts +70 -0
  130. package/src/internal/reading/match.inpage.ts +92 -0
  131. package/src/internal/reading/names.inpage.ts +306 -0
  132. package/src/internal/reading/outline.inpage.ts +260 -0
  133. package/src/internal/reading/reading.ts +223 -0
  134. package/src/internal/reading/ready.inpage.ts +164 -0
  135. package/src/internal/reading/ready.ts +111 -0
  136. package/src/internal/reading/subjects.inpage.ts +188 -0
  137. package/src/internal/reading/text.inpage.ts +135 -0
  138. package/src/internal/reading/walk.inpage.ts +220 -0
  139. package/src/internal/supervisor/lifecycle.ts +416 -0
  140. package/src/internal/timeline/changes.inpage.ts +216 -0
  141. package/src/internal/timeline/changes.ts +100 -0
  142. package/src/internal/timeline/events.ts +94 -0
  143. package/src/internal/timeline/fold.inpage.ts +123 -0
  144. package/src/internal/timeline/history.inpage.ts +229 -0
  145. package/src/internal/timeline/marks.inpage.ts +207 -0
  146. package/src/internal/timeline/record.inpage.ts +133 -0
  147. package/src/internal/timeline/sight.inpage.ts +122 -0
  148. package/src/internal/timeline/window.ts +96 -0
  149. package/src/internal/timeline/words.ts +65 -0
  150. package/dist/Bootstrap-B9UUXsvF.d.mts +0 -183
  151. package/dist/Bootstrap-CeQOWBy6.mjs +0 -189
  152. package/dist/Bootstrap-CeQOWBy6.mjs.map +0 -1
  153. package/dist/Bootstrap.d.mts +0 -3
  154. package/dist/Bootstrap.mjs +0 -2
  155. package/dist/Browser-BF9_sORP.d.mts +0 -388
  156. package/dist/Browser.mjs.map +0 -1
  157. package/dist/BrowserData-CPIIIHol.d.mts +0 -585
  158. package/dist/BrowserData.d.mts +0 -3
  159. package/dist/BrowserData.mjs +0 -695
  160. package/dist/BrowserData.mjs.map +0 -1
  161. package/dist/BrowserRuntime-B6nT1G4X.d.mts +0 -148
  162. package/dist/BrowserRuntime-C1r2aSRK.mjs +0 -6820
  163. package/dist/BrowserRuntime-C1r2aSRK.mjs.map +0 -1
  164. package/dist/BrowserRuntime.d.mts +0 -3
  165. package/dist/BrowserRuntime.mjs +0 -3
  166. package/dist/Capture.d.mts +0 -56
  167. package/dist/Capture.mjs +0 -678
  168. package/dist/Capture.mjs.map +0 -1
  169. package/dist/CaptureData-CYriZHX1.mjs +0 -201
  170. package/dist/CaptureData-CYriZHX1.mjs.map +0 -1
  171. package/dist/CaptureData.d.mts +0 -219
  172. package/dist/CaptureData.mjs +0 -2
  173. package/dist/Errors.d.mts +0 -158
  174. package/dist/Errors.mjs +0 -207
  175. package/dist/Errors.mjs.map +0 -1
  176. package/dist/Images-yCG9BmRU.mjs +0 -76
  177. package/dist/Images-yCG9BmRU.mjs.map +0 -1
  178. package/dist/OperationOptions-DAeRS6O9.mjs +0 -55
  179. package/dist/OperationOptions-DAeRS6O9.mjs.map +0 -1
  180. package/dist/PageControl.d.mts +0 -15
  181. package/dist/PageControl.mjs +0 -34
  182. package/dist/PageControl.mjs.map +0 -1
  183. package/dist/PageRegistry-B3q9DS3g.mjs +0 -164
  184. package/dist/PageRegistry-B3q9DS3g.mjs.map +0 -1
  185. package/dist/Plan-Dyxu2q8C.mjs +0 -543
  186. package/dist/Plan-Dyxu2q8C.mjs.map +0 -1
  187. package/dist/PlanData-B668RxbQ.d.mts +0 -4831
  188. package/dist/PlanData.d.mts +0 -3
  189. package/dist/PlanData.mjs +0 -268
  190. package/dist/PlanData.mjs.map +0 -1
  191. package/dist/PlanInput-BJcPPncs.mjs +0 -75
  192. package/dist/PlanInput-BJcPPncs.mjs.map +0 -1
  193. package/dist/PublicSession-DCSMMqOj.mjs +0 -5602
  194. package/dist/PublicSession-DCSMMqOj.mjs.map +0 -1
  195. package/dist/Testing.d.mts +0 -479
  196. package/dist/Testing.mjs +0 -2147
  197. package/dist/Testing.mjs.map +0 -1
  198. package/dist/Timeline-fV22Xk-S.d.mts +0 -29
  199. package/dist/Timeline.d.mts +0 -4
  200. package/dist/Timeline.mjs +0 -20
  201. package/dist/Timeline.mjs.map +0 -1
  202. package/dist/TimelineData-BsOn-YGZ.d.mts +0 -3818
  203. package/dist/TimelineData.d.mts +0 -3
  204. package/dist/TimelineData.mjs +0 -482
  205. package/dist/TimelineData.mjs.map +0 -1
@@ -0,0 +1,211 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { DisconnectCause } from "./BrowserEvent.mjs";
3
+ import { Schema } from "effect";
4
+ //#region src/BrowserError.ts
5
+ /**
6
+ * The one error every browser operation fails with.
7
+ *
8
+ * `reason` says what went wrong and `dispatched` says whether the action's own input (a press,
9
+ * key, wheel, selection or hover, not the pointer travelling toward a press) or a navigation
10
+ * reached the browser first. `consequence` says what that leaves: what was lost, and whether the
11
+ * call can be repeated. `message` is a sentence for operators.
12
+ *
13
+ * @since 0.3.0
14
+ */
15
+ var BrowserError_exports = /* @__PURE__ */ __exportAll({
16
+ BrowserError: () => BrowserError,
17
+ Busy: () => Busy,
18
+ Closed: () => Closed,
19
+ EventHistoryExpired: () => EventHistoryExpired,
20
+ Failed: () => Failed,
21
+ InvalidRequest: () => InvalidRequest,
22
+ Limit: () => Limit,
23
+ NavigationFailed: () => NavigationFailed,
24
+ NotActionable: () => NotActionable,
25
+ NotFound: () => NotFound,
26
+ PolicyDenied: () => PolicyDenied,
27
+ PolicyTimeout: () => PolicyTimeout,
28
+ Reason: () => Reason,
29
+ StaleRef: () => StaleRef,
30
+ Suspended: () => Suspended,
31
+ Timeout: () => Timeout,
32
+ consequence: () => consequence
33
+ });
34
+ /** The operation did not finish in time. */
35
+ var Timeout = class extends Schema.TaggedError()("Timeout", { millis: Schema.Finite }) {
36
+ get message() {
37
+ return `timed out after ${this.millis} ms`;
38
+ }
39
+ };
40
+ /**
41
+ * The operation waited its turn behind others on its page and was not given one in time, or was
42
+ * asked to fail fast: the page may be well, only busy.
43
+ */
44
+ var Busy = class extends Schema.TaggedError()("Busy", {
45
+ waitedMillis: Schema.Finite,
46
+ /** The operations ahead of it: those holding the page and those asked before it. */
47
+ ahead: Schema.Int
48
+ }) {
49
+ get message() {
50
+ const others = this.ahead === 1 ? "operation" : "operations";
51
+ return `the page was busy: it waited ${this.waitedMillis} ms behind ${this.ahead} other ${others}`;
52
+ }
53
+ };
54
+ /** Input is withheld by a scoped suspension; nothing was dispatched. */
55
+ var Suspended = class extends Schema.TaggedError()("Suspended", {}) {
56
+ get message() {
57
+ return "browser input is suspended";
58
+ }
59
+ };
60
+ /** The browser has as many pages open as `maxPages` allows, and none closed in time. */
61
+ var Limit = class extends Schema.TaggedError()("Limit", { maxPages: Schema.Int }) {
62
+ get message() {
63
+ return `the browser already has ${this.maxPages} pages open, as many as it allows`;
64
+ }
65
+ };
66
+ /** A ref from an earlier snapshot no longer names an element on the page. */
67
+ var StaleRef = class extends Schema.TaggedError()("StaleRef", { ref: Schema.String }) {
68
+ get message() {
69
+ return `${this.ref} is not on the page any more`;
70
+ }
71
+ };
72
+ /** What the operation looked for is not on the page. */
73
+ var NotFound = class extends Schema.TaggedError()("NotFound", { target: Schema.String }) {
74
+ get message() {
75
+ return `${this.target} was not found`;
76
+ }
77
+ };
78
+ /** The element exists but cannot take this input: covered, disabled, hidden or the wrong kind. */
79
+ var NotActionable = class extends Schema.TaggedError()("NotActionable", { detail: Schema.String }) {
80
+ get message() {
81
+ return this.detail;
82
+ }
83
+ };
84
+ /** A navigation failed, for example on a DNS error or a refused connection. */
85
+ var NavigationFailed = class extends Schema.TaggedError()("NavigationFailed", {
86
+ url: Schema.String,
87
+ detail: Schema.String
88
+ }) {
89
+ get message() {
90
+ return `could not load ${this.url}: ${this.detail}`;
91
+ }
92
+ };
93
+ const closedBy = {
94
+ page: "the page was closed",
95
+ crashed: "the page crashed",
96
+ connection: "the connection to the browser was lost",
97
+ session: "the browser's session ended",
98
+ released: "the browser was released"
99
+ };
100
+ /**
101
+ * The page is gone: it was closed (`page`) or crashed, or its browser was lost for one of the
102
+ * browser's `DisconnectCause`s.
103
+ */
104
+ var Closed = class extends Schema.TaggedError()("Closed", { cause: Schema.Literals([
105
+ "page",
106
+ "crashed",
107
+ ...DisconnectCause.literals
108
+ ]) }) {
109
+ get message() {
110
+ return closedBy[this.cause];
111
+ }
112
+ };
113
+ /** The request itself is invalid, such as a ref that is not a ref or a point off the screen. */
114
+ var InvalidRequest = class extends Schema.TaggedError()("InvalidRequest", { detail: Schema.String }) {
115
+ get message() {
116
+ return this.detail;
117
+ }
118
+ };
119
+ /** The input policy refused the action before any input was sent. */
120
+ var PolicyDenied = class extends Schema.TaggedError()("PolicyDenied", {
121
+ detail: Schema.String,
122
+ /** What made the policy deny, such as the failure of the judge it asked. */
123
+ cause: Schema.optional(Schema.Defect())
124
+ }) {
125
+ get message() {
126
+ return `the input policy denied this action: ${this.detail}`;
127
+ }
128
+ };
129
+ /** The input policy did not release its hold within its own bound. */
130
+ var PolicyTimeout = class extends Schema.TaggedError()("PolicyTimeout", { millis: Schema.Finite }) {
131
+ get message() {
132
+ return `the input policy did not allow this action within ${this.millis} ms`;
133
+ }
134
+ };
135
+ /** The requested event cursor fell behind the browser's bounded replay history. */
136
+ var EventHistoryExpired = class extends Schema.TaggedError()("EventHistoryExpired", {
137
+ after: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
138
+ oldest: Schema.Int.check(Schema.isGreaterThan(0)),
139
+ latest: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
140
+ }) {
141
+ get message() {
142
+ return `event history after ${this.after} expired; retained sequences are ${this.oldest}–${this.latest}`;
143
+ }
144
+ };
145
+ /** The browser, the connection or the provider failed in a way the other reasons do not cover. */
146
+ var Failed = class extends Schema.TaggedError()("Failed", { detail: Schema.String }) {
147
+ get message() {
148
+ return this.detail;
149
+ }
150
+ };
151
+ const Reason = Schema.Union([
152
+ Timeout,
153
+ Busy,
154
+ Suspended,
155
+ Limit,
156
+ StaleRef,
157
+ NotFound,
158
+ NotActionable,
159
+ NavigationFailed,
160
+ Closed,
161
+ InvalidRequest,
162
+ PolicyDenied,
163
+ PolicyTimeout,
164
+ EventHistoryExpired,
165
+ Failed
166
+ ]);
167
+ var BrowserError = class extends Schema.TaggedError()("BrowserError", {
168
+ operation: Schema.String,
169
+ reason: Reason,
170
+ dispatched: Schema.Boolean
171
+ }) {
172
+ get message() {
173
+ return `${this.operation} failed${this.dispatched ? " after it was sent" : ""}: ${this.reason.message}`;
174
+ }
175
+ };
176
+ /** What `error` leaves, from its reason and whether it was dispatched alone. */
177
+ const consequence = ({ reason, dispatched }) => {
178
+ const repeat = dispatched ? "check" : "safe";
179
+ switch (reason._tag) {
180
+ case "Closed": return {
181
+ lost: reason.cause === "page" || reason.cause === "crashed" ? "page" : "session",
182
+ repeat
183
+ };
184
+ case "Busy":
185
+ case "Suspended":
186
+ case "Timeout":
187
+ case "Failed":
188
+ case "NavigationFailed": return {
189
+ lost: "nothing",
190
+ repeat
191
+ };
192
+ case "EventHistoryExpired": return {
193
+ lost: "nothing",
194
+ repeat: "resume"
195
+ };
196
+ case "StaleRef":
197
+ case "NotFound":
198
+ case "NotActionable":
199
+ case "InvalidRequest":
200
+ case "Limit":
201
+ case "PolicyDenied":
202
+ case "PolicyTimeout": return {
203
+ lost: "nothing",
204
+ repeat: "pointless"
205
+ };
206
+ }
207
+ };
208
+ //#endregion
209
+ export { BrowserError, Busy, Closed, EventHistoryExpired, Failed, InvalidRequest, Limit, NavigationFailed, NotActionable, NotFound, PolicyDenied, PolicyTimeout, Reason, StaleRef, Suspended, Timeout, consequence, BrowserError_exports as t };
210
+
211
+ //# sourceMappingURL=BrowserError.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserError.mjs","names":[],"sources":["../src/BrowserError.ts"],"sourcesContent":["/**\n * The one error every browser operation fails with.\n *\n * `reason` says what went wrong and `dispatched` says whether the action's own input (a press,\n * key, wheel, selection or hover, not the pointer travelling toward a press) or a navigation\n * reached the browser first. `consequence` says what that leaves: what was lost, and whether the\n * call can be repeated. `message` is a sentence for operators.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\nimport { DisconnectCause } from \"./BrowserEvent.ts\";\n\n/** The operation did not finish in time. */\nexport class Timeout extends Schema.TaggedError<Timeout>()(\"Timeout\", {\n millis: Schema.Finite,\n}) {\n override get message() {\n return `timed out after ${this.millis} ms`;\n }\n}\n\n/**\n * The operation waited its turn behind others on its page and was not given one in time, or was\n * asked to fail fast: the page may be well, only busy.\n */\nexport class Busy extends Schema.TaggedError<Busy>()(\"Busy\", {\n waitedMillis: Schema.Finite,\n /** The operations ahead of it: those holding the page and those asked before it. */\n ahead: Schema.Int,\n}) {\n override get message() {\n const others = this.ahead === 1 ? \"operation\" : \"operations\";\n\n return `the page was busy: it waited ${this.waitedMillis} ms behind ${this.ahead} other ${others}`;\n }\n}\n\n/** Input is withheld by a scoped suspension; nothing was dispatched. */\nexport class Suspended extends Schema.TaggedError<Suspended>()(\"Suspended\", {}) {\n override get message() {\n return \"browser input is suspended\";\n }\n}\n\n/** The browser has as many pages open as `maxPages` allows, and none closed in time. */\nexport class Limit extends Schema.TaggedError<Limit>()(\"Limit\", {\n maxPages: Schema.Int,\n}) {\n override get message() {\n return `the browser already has ${this.maxPages} pages open, as many as it allows`;\n }\n}\n\n/** A ref from an earlier snapshot no longer names an element on the page. */\nexport class StaleRef extends Schema.TaggedError<StaleRef>()(\"StaleRef\", {\n ref: Schema.String,\n}) {\n override get message() {\n return `${this.ref} is not on the page any more`;\n }\n}\n\n/** What the operation looked for is not on the page. */\nexport class NotFound extends Schema.TaggedError<NotFound>()(\"NotFound\", {\n target: Schema.String,\n}) {\n override get message() {\n return `${this.target} was not found`;\n }\n}\n\n/** The element exists but cannot take this input: covered, disabled, hidden or the wrong kind. */\nexport class NotActionable extends Schema.TaggedError<NotActionable>()(\"NotActionable\", {\n detail: Schema.String,\n}) {\n override get message() {\n return this.detail;\n }\n}\n\n/** A navigation failed, for example on a DNS error or a refused connection. */\nexport class NavigationFailed extends Schema.TaggedError<NavigationFailed>()(\"NavigationFailed\", {\n url: Schema.String,\n detail: Schema.String,\n}) {\n override get message() {\n return `could not load ${this.url}: ${this.detail}`;\n }\n}\n\nconst closedBy = {\n page: \"the page was closed\",\n crashed: \"the page crashed\",\n connection: \"the connection to the browser was lost\",\n session: \"the browser's session ended\",\n released: \"the browser was released\",\n};\n\n/**\n * The page is gone: it was closed (`page`) or crashed, or its browser was lost for one of the\n * browser's `DisconnectCause`s.\n */\nexport class Closed extends Schema.TaggedError<Closed>()(\"Closed\", {\n cause: Schema.Literals([\"page\", \"crashed\", ...DisconnectCause.literals]),\n}) {\n override get message() {\n return closedBy[this.cause];\n }\n}\n\n/** The request itself is invalid, such as a ref that is not a ref or a point off the screen. */\nexport class InvalidRequest extends Schema.TaggedError<InvalidRequest>()(\"InvalidRequest\", {\n detail: Schema.String,\n}) {\n override get message() {\n return this.detail;\n }\n}\n\n/** The input policy refused the action before any input was sent. */\nexport class PolicyDenied extends Schema.TaggedError<PolicyDenied>()(\"PolicyDenied\", {\n detail: Schema.String,\n /** What made the policy deny, such as the failure of the judge it asked. */\n cause: Schema.optional(Schema.Defect()),\n}) {\n override get message() {\n return `the input policy denied this action: ${this.detail}`;\n }\n}\n\n/** The input policy did not release its hold within its own bound. */\nexport class PolicyTimeout extends Schema.TaggedError<PolicyTimeout>()(\"PolicyTimeout\", {\n millis: Schema.Finite,\n}) {\n override get message() {\n return `the input policy did not allow this action within ${this.millis} ms`;\n }\n}\n\n/** The requested event cursor fell behind the browser's bounded replay history. */\nexport class EventHistoryExpired extends Schema.TaggedError<EventHistoryExpired>()(\n \"EventHistoryExpired\",\n {\n after: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n oldest: Schema.Int.check(Schema.isGreaterThan(0)),\n latest: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n },\n) {\n override get message() {\n return `event history after ${this.after} expired; retained sequences are ${this.oldest}–${this.latest}`;\n }\n}\n\n/** The browser, the connection or the provider failed in a way the other reasons do not cover. */\nexport class Failed extends Schema.TaggedError<Failed>()(\"Failed\", {\n detail: Schema.String,\n}) {\n override get message() {\n return this.detail;\n }\n}\n\nexport const Reason = Schema.Union([\n Timeout,\n Busy,\n Suspended,\n Limit,\n StaleRef,\n NotFound,\n NotActionable,\n NavigationFailed,\n Closed,\n InvalidRequest,\n PolicyDenied,\n PolicyTimeout,\n EventHistoryExpired,\n Failed,\n]);\n\nexport type Reason = typeof Reason.Type;\n\nexport class BrowserError extends Schema.TaggedError<BrowserError>()(\"BrowserError\", {\n operation: Schema.String,\n reason: Reason,\n dispatched: Schema.Boolean,\n}) {\n override get message() {\n return `${this.operation} failed${this.dispatched ? \" after it was sent\" : \"\"}: ${this.reason.message}`;\n }\n}\n\n/**\n * What a failure leaves. `lost` is `\"page\"` when the page is gone and its browser stands, and\n * `\"session\"` when the browser is gone with its pages. `repeat` says whether the call can be made\n * again, on what still stands: `\"safe\"`, as nothing reached the browser; `\"check\"`, as it may have\n * taken effect, so look first, as an `Expect` attempt does; `\"pointless\"`, as it fails again unless\n * something changes, such as\n * a new ref; or `\"resume\"`, reading events again from a newer cursor.\n */\nexport interface Consequence {\n readonly lost: \"nothing\" | \"page\" | \"session\";\n readonly repeat: \"safe\" | \"check\" | \"pointless\" | \"resume\";\n}\n\n/** What `error` leaves, from its reason and whether it was dispatched alone. */\nexport const consequence = ({ reason, dispatched }: BrowserError): Consequence => {\n const repeat = dispatched ? \"check\" : \"safe\";\n\n switch (reason._tag) {\n case \"Closed\":\n return {\n lost: reason.cause === \"page\" || reason.cause === \"crashed\" ? \"page\" : \"session\",\n repeat,\n };\n case \"Busy\":\n case \"Suspended\":\n case \"Timeout\":\n case \"Failed\":\n case \"NavigationFailed\":\n return { lost: \"nothing\", repeat };\n case \"EventHistoryExpired\":\n return { lost: \"nothing\", repeat: \"resume\" };\n case \"StaleRef\":\n case \"NotFound\":\n case \"NotActionable\":\n case \"InvalidRequest\":\n case \"Limit\":\n case \"PolicyDenied\":\n case \"PolicyTimeout\":\n return { lost: \"nothing\", repeat: \"pointless\" };\n }\n};\n"],"mappings":"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"}
@@ -0,0 +1,279 @@
1
+ import { Schema } from "effect";
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 };
4
+ }
5
+ declare const PageOpened_base: Schema.Class<PageOpened, Schema.TaggedStruct<"PageOpened", {
6
+ readonly at: Schema.Finite;
7
+ readonly page: Schema.String;
8
+ readonly url: Schema.String;
9
+ readonly opener: Schema.optional<Schema.String>;
10
+ }>, {}>;
11
+ /** A page opened, and the page that opened it, as a link or `window.open` does, if one did. */
12
+ declare class PageOpened extends PageOpened_base {}
13
+ declare const PageClosed_base: Schema.Class<PageClosed, Schema.TaggedStruct<"PageClosed", {
14
+ readonly at: Schema.Finite;
15
+ readonly page: Schema.String;
16
+ readonly cause: Schema.Literals<readonly ["page", "crashed"]>;
17
+ }>, {}>;
18
+ /**
19
+ * The page closed (`page`), or crashed and was closed (`crashed`). A page lost with its browser
20
+ * has no event of its own: `Disconnected` stands for all of them.
21
+ */
22
+ declare class PageClosed extends PageClosed_base {}
23
+ declare const PageUntracked_base: Schema.Class<PageUntracked, Schema.TaggedStruct<"PageUntracked", {
24
+ readonly at: Schema.Finite;
25
+ readonly url: Schema.String;
26
+ readonly detail: Schema.String;
27
+ }>, {}>;
28
+ /**
29
+ * A tab the site opened that the library could not track, as its registration failed with
30
+ * `detail`. A tab that closed as it opened has no event.
31
+ */
32
+ declare class PageUntracked extends PageUntracked_base {}
33
+ declare const Navigated_base: Schema.Class<Navigated, Schema.TaggedStruct<"Navigated", {
34
+ readonly at: Schema.Finite;
35
+ readonly page: Schema.String;
36
+ readonly url: Schema.String;
37
+ /**
38
+ * The page's documents counted from 0, the one it had when this browser began tracking it, one
39
+ * more for each new document. The count belongs to the page within one `Browser` and starts at
40
+ * 0 again on a new connection, so compare it only with the same page's in the same browser.
41
+ */
42
+ readonly document: Schema.Int;
43
+ readonly sameDocument: Schema.Boolean;
44
+ }>, {}>;
45
+ /**
46
+ * The page's main frame moved to `url`: into a new document, or within the current one
47
+ * (`sameDocument`), as `pushState` and fragment links do. Frames carry the document they followed.
48
+ */
49
+ declare class Navigated extends Navigated_base {}
50
+ declare const PageLoaded_base: Schema.Class<PageLoaded, Schema.TaggedStruct<"PageLoaded", {
51
+ readonly at: Schema.Finite;
52
+ readonly page: Schema.String;
53
+ readonly state: Schema.Literals<readonly ["domcontentloaded", "load"]>;
54
+ }>, {}>;
55
+ /** The page's document finished parsing (`domcontentloaded`) or loading (`load`). */
56
+ declare class PageLoaded extends PageLoaded_base {}
57
+ /**
58
+ * Why a browser was lost to its owner: its connection dropped (`connection`), its provider ended
59
+ * its session, at or after the session's `expiresAt` (`session`), or its owner released it.
60
+ */
61
+ declare const DisconnectCause: Schema.Literals<readonly ["connection", "session", "released"]>;
62
+ type DisconnectCause = typeof DisconnectCause.Type;
63
+ declare const Disconnected_base: Schema.Class<Disconnected, Schema.TaggedStruct<"Disconnected", {
64
+ readonly at: Schema.Finite;
65
+ readonly cause: Schema.Literals<readonly ["connection", "session", "released"]>;
66
+ }>, {}>;
67
+ /** The browser was lost to its owner, with every page in it. It happens once. */
68
+ declare class Disconnected extends Disconnected_base {}
69
+ declare const SessionEnding_base: Schema.Class<SessionEnding, Schema.TaggedStruct<"SessionEnding", {
70
+ readonly at: Schema.Finite;
71
+ readonly expiresAt: Schema.DateTimeUtc;
72
+ }>, {}>;
73
+ /** The provider ends this browser's session at `expiresAt`, a wall-clock instant. */
74
+ declare class SessionEnding extends SessionEnding_base {}
75
+ /**
76
+ * The words around a subject that say which one it is, each bound to it in the page rather than
77
+ * read off nearby text later. In a table, `row` is the row's header or first cell with text and
78
+ * `column` the header over it; elsewhere, `label` is the words just before it in its row, item,
79
+ * group or block, at most 40 characters. `heading` is the nearest heading above it, left out for
80
+ * what is pinned to the viewport. Row, column and heading are at most 60 characters.
81
+ */
82
+ declare const SubjectContext: Schema.Struct<{
83
+ readonly row: Schema.optional<Schema.String>;
84
+ readonly column: Schema.optional<Schema.String>;
85
+ readonly label: Schema.optional<Schema.String>;
86
+ readonly heading: Schema.optional<Schema.String>;
87
+ }>;
88
+ type SubjectContext = typeof SubjectContext.Type;
89
+ declare const Subject_base: Schema.Class<Subject, Schema.Struct<{
90
+ readonly role: Schema.NullOr<Schema.String>;
91
+ readonly name: Schema.String;
92
+ readonly tag: Schema.String;
93
+ readonly context: Schema.Struct<{
94
+ readonly row: Schema.optional<Schema.String>;
95
+ readonly column: Schema.optional<Schema.String>;
96
+ readonly label: Schema.optional<Schema.String>;
97
+ readonly heading: Schema.optional<Schema.String>;
98
+ }>;
99
+ }>, {}>;
100
+ /**
101
+ * What an input acted on, or what `Page.find` found, as the page named it then: its role (null
102
+ * when it has none), its accessible name (empty when it has none), its lowercase tag and its
103
+ * context. For a point, it is the control under the point, or else the element painted there.
104
+ * Unlike a ref, it keeps its meaning after the page changes.
105
+ */
106
+ declare class Subject extends Subject_base {}
107
+ /** An element's box in viewport CSS pixels; it may lie partly or wholly outside the viewport. */
108
+ declare const Box: Schema.Struct<{
109
+ readonly x: Schema.Finite;
110
+ readonly y: Schema.Finite;
111
+ readonly width: Schema.Finite;
112
+ readonly height: Schema.Finite;
113
+ }>;
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
+ declare const Action_base: Schema.Class<Action, Schema.TaggedStruct<"Action", {
133
+ readonly at: Schema.Finite;
134
+ readonly startedAt: Schema.Finite;
135
+ readonly page: Schema.String;
136
+ readonly name: Schema.String;
137
+ /** The address when the action ended; absent in events recorded by older releases. */
138
+ readonly url: Schema.optional<Schema.String>;
139
+ readonly correlation: Schema.optional<Schema.String>;
140
+ 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
+ readonly subject: Schema.optional<typeof Subject>;
153
+ readonly to: Schema.optional<typeof Subject>;
154
+ /** For an action at a point, the box of what it found there. */
155
+ readonly box: Schema.optional<Schema.Struct<{
156
+ readonly x: Schema.Finite;
157
+ readonly y: Schema.Finite;
158
+ readonly width: Schema.Finite;
159
+ readonly height: Schema.Finite;
160
+ }>>;
161
+ readonly text: Schema.optional<Schema.String>;
162
+ readonly x: Schema.optional<Schema.Finite>;
163
+ readonly y: Schema.optional<Schema.Finite>;
164
+ readonly ok: Schema.Boolean;
165
+ readonly dispatched: Schema.Boolean;
166
+ readonly error: Schema.optional<Schema.String>;
167
+ }>, {}>;
168
+ /**
169
+ * 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.
171
+ * `subject` is what an element or point action found there, and `to` where a drag ended; an
172
+ * action that failed before finding its target has neither. Point actions carry the viewport
173
+ * point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a
174
+ * model's tool call id.
175
+ */
176
+ declare class Action extends Action_base {}
177
+ declare const TrackPlanned_base: Schema.Class<TrackPlanned, Schema.TaggedStruct<"TrackPlanned", {
178
+ readonly at: Schema.Finite;
179
+ readonly page: Schema.String;
180
+ readonly from: Schema.Struct<{
181
+ readonly x: Schema.Finite;
182
+ readonly y: Schema.Finite;
183
+ }>;
184
+ readonly samples: Schema.$Array<Schema.Struct<{
185
+ readonly x: Schema.Finite;
186
+ readonly y: Schema.Finite;
187
+ readonly afterMillis: Schema.Finite;
188
+ }>>;
189
+ }>, {}>;
190
+ /** One whole glide, published before its first input. Offsets use the host monotonic clock. */
191
+ declare class TrackPlanned extends TrackPlanned_base {}
192
+ declare const TrackPerformed_base: Schema.Class<TrackPerformed, Schema.TaggedStruct<"TrackPerformed", {
193
+ readonly at: Schema.Finite;
194
+ readonly page: Schema.String;
195
+ readonly plan: Schema.Int;
196
+ readonly dispatched: Schema.Int;
197
+ readonly x: Schema.Finite;
198
+ readonly y: Schema.Finite;
199
+ readonly complete: Schema.Boolean;
200
+ }>, {}>;
201
+ /**
202
+ * The submitted prefix of a glide. `plan` is its TrackPlanned envelope sequence; `dispatched`
203
+ * counts samples. `complete` means every sample was submitted, not acknowledged by the browser.
204
+ * The terminal point clips a canceled plan so a compositor never draws its unrealized future.
205
+ */
206
+ declare class TrackPerformed extends TrackPerformed_base {}
207
+ declare const PointerPressed_base: Schema.Class<PointerPressed, Schema.TaggedStruct<"PointerPressed", {
208
+ readonly at: Schema.Finite;
209
+ readonly page: Schema.String;
210
+ readonly x: Schema.Finite;
211
+ readonly y: Schema.Finite;
212
+ readonly button: Schema.Literals<readonly ["left", "right", "middle"]>;
213
+ readonly clickCount: Schema.Int;
214
+ }>, {}>;
215
+ declare class PointerPressed extends PointerPressed_base {}
216
+ declare const PointerReleased_base: Schema.Class<PointerReleased, Schema.TaggedStruct<"PointerReleased", {
217
+ readonly at: Schema.Finite;
218
+ readonly page: Schema.String;
219
+ readonly x: Schema.Finite;
220
+ readonly y: Schema.Finite;
221
+ readonly button: Schema.Literals<readonly ["left", "right", "middle"]>;
222
+ readonly clickCount: Schema.Int;
223
+ }>, {}>;
224
+ declare class PointerReleased extends PointerReleased_base {}
225
+ declare const WheelScrolled_base: Schema.Class<WheelScrolled, Schema.TaggedStruct<"WheelScrolled", {
226
+ readonly at: Schema.Finite;
227
+ readonly page: Schema.String;
228
+ readonly x: Schema.Finite;
229
+ readonly y: Schema.Finite;
230
+ readonly dx: Schema.Finite;
231
+ readonly dy: Schema.Finite;
232
+ }>, {}>;
233
+ declare class WheelScrolled extends WheelScrolled_base {}
234
+ declare const KeyChanged_base: Schema.Class<KeyChanged, Schema.TaggedStruct<"KeyChanged", {
235
+ readonly at: Schema.Finite;
236
+ readonly page: Schema.String;
237
+ readonly key: Schema.String;
238
+ readonly phase: Schema.Literals<readonly ["down", "up"]>;
239
+ }>, {}>;
240
+ declare class KeyChanged extends KeyChanged_base {}
241
+ declare const TextInserted_base: Schema.Class<TextInserted, Schema.TaggedStruct<"TextInserted", {
242
+ readonly at: Schema.Finite;
243
+ readonly page: Schema.String;
244
+ readonly text: Schema.String;
245
+ }>, {}>;
246
+ /** Literal text insertion has no corresponding key events, including Unicode and newlines. */
247
+ declare class TextInserted extends TextInserted_base {}
248
+ declare const CursorChanged_base: Schema.Class<CursorChanged, Schema.TaggedStruct<"CursorChanged", {
249
+ readonly at: Schema.Finite;
250
+ readonly page: Schema.String;
251
+ readonly cursor: Schema.String;
252
+ }>, {}>;
253
+ /** The target's CSS cursor, obtained during target resolution without another browser call. */
254
+ declare class CursorChanged extends CursorChanged_base {}
255
+ declare const TrackEvent: Schema.Union<readonly [typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged]>;
256
+ type TrackEvent = typeof TrackEvent.Type;
257
+ declare const DialogShown_base: Schema.Class<DialogShown, Schema.TaggedStruct<"DialogShown", {
258
+ readonly at: Schema.Finite;
259
+ readonly page: Schema.String;
260
+ readonly kind: Schema.String;
261
+ readonly message: Schema.String;
262
+ readonly answer: Schema.Literals<readonly ["accepted", "dismissed"]>;
263
+ }>, {}>;
264
+ /**
265
+ * A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a
266
+ * confirm or a prompt dismissed, as if its Cancel were pressed.
267
+ */
268
+ 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]>;
270
+ type BrowserEvent = typeof BrowserEvent.Type;
271
+ declare const RecordedEvent_base: Schema.Class<RecordedEvent, Schema.Struct<{
272
+ 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]>;
274
+ }>, {}>;
275
+ /** A position in the browser's one replayable event history. Sequences begin at one. */
276
+ declare class RecordedEvent extends RecordedEvent_base {}
277
+ //#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-BRu2juEz.d.mts.map
@@ -0,0 +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-BRu2juEz.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 };