effect-browser 0.2.0-beta.0 → 0.2.0-beta.1

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 (40) hide show
  1. package/README.md +150 -10
  2. package/dist/{Association-zlgInoaj.mjs → Association-BsSfBYVx.mjs} +14 -10
  3. package/dist/Association-BsSfBYVx.mjs.map +1 -0
  4. package/dist/{Bootstrap-Be-2Ddmh.mjs → Bootstrap-CeQOWBy6.mjs} +6 -4
  5. package/dist/Bootstrap-CeQOWBy6.mjs.map +1 -0
  6. package/dist/Bootstrap.mjs +1 -1
  7. package/dist/Browser.d.mts +13 -1
  8. package/dist/Browser.mjs.map +1 -1
  9. package/dist/{BrowserData-DJAnUHoZ.d.mts → BrowserData-CRuxEZcn.d.mts} +90 -10
  10. package/dist/BrowserData.d.mts +2 -2
  11. package/dist/BrowserData.mjs +85 -7
  12. package/dist/BrowserData.mjs.map +1 -1
  13. package/dist/BrowserRuntime-Coz-5DYb.d.mts +143 -0
  14. package/dist/{BrowserRuntime-fZz1b0VI.mjs → BrowserRuntime-DViKNUdD.mjs} +2819 -2206
  15. package/dist/BrowserRuntime-DViKNUdD.mjs.map +1 -0
  16. package/dist/BrowserRuntime.d.mts +3 -139
  17. package/dist/BrowserRuntime.mjs +1 -1
  18. package/dist/Capture.d.mts +15 -1
  19. package/dist/Capture.mjs +58 -22
  20. package/dist/Capture.mjs.map +1 -1
  21. package/dist/{CaptureData-AmqVP_Ba.mjs → CaptureData-B5-mXlyq.mjs} +24 -6
  22. package/dist/CaptureData-B5-mXlyq.mjs.map +1 -0
  23. package/dist/CaptureData.d.mts +11 -2
  24. package/dist/CaptureData.mjs +1 -1
  25. package/dist/Chromium.d.mts +4 -3
  26. package/dist/Chromium.mjs +22 -16
  27. package/dist/Chromium.mjs.map +1 -1
  28. package/dist/Errors.d.mts +2 -2
  29. package/dist/Errors.mjs +1 -0
  30. package/dist/Errors.mjs.map +1 -1
  31. package/dist/PageControl.d.mts +1 -1
  32. package/dist/PageControl.mjs +1 -1
  33. package/dist/Testing.d.mts +437 -0
  34. package/dist/Testing.mjs +1561 -0
  35. package/dist/Testing.mjs.map +1 -0
  36. package/package.json +5 -1
  37. package/dist/Association-zlgInoaj.mjs.map +0 -1
  38. package/dist/Bootstrap-Be-2Ddmh.mjs.map +0 -1
  39. package/dist/BrowserRuntime-fZz1b0VI.mjs.map +0 -1
  40. package/dist/CaptureData-AmqVP_Ba.mjs.map +0 -1
@@ -1,3 +1,4 @@
1
+ import { BrowserError } from "./Errors.mjs";
1
2
  import { Schema } from "effect";
2
3
  //#region src/BrowserData.d.ts
3
4
  declare const Identifier: Schema.NonEmptyString;
@@ -81,8 +82,13 @@ declare const ViewportEvidence_base: Schema.Class<ViewportEvidence, Schema.Struc
81
82
  readonly height: Schema.Finite;
82
83
  /** Text that crossed a viewport edge; only its lines on screen were kept. */
83
84
  readonly clippedText: Schema.Natural;
84
- /** Left out: the browser found another element at the sampled point. */
85
+ /** Left out: another element is on top at the sampled point, or a box there paints over it. */
85
86
  readonly coveredText: Schema.Natural;
87
+ /**
88
+ * Left out: something that takes no pointer events lies over it and the browser's own hit test
89
+ * could not settle whether it paints there, for example beneath another such box, in a child
90
+ * frame, or after too many such points in one reading.
91
+ */
86
92
  readonly uncertainText: Schema.Natural;
87
93
  /** Controls that intersect the viewport but cannot be reached there. */
88
94
  readonly unreachableControls: Schema.Natural;
@@ -93,15 +99,24 @@ declare const ViewportEvidence_base: Schema.Class<ViewportEvidence, Schema.Struc
93
99
  * How a viewport reading was bounded and what it left out. These are counts, so they are safe
94
100
  * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is
95
101
  * kept when its line boxes intersect the viewport and the browser finds its own element at a
96
- * sampled point. `uncertainText` lay under something that takes no pointer events, which
97
- * hit-testing cannot see through, so it is left out rather than called visible.
102
+ * sampled point. Something that takes no pointer events is invisible to that test, so the
103
+ * browser is asked what is on top there with pointer events ignored: a box that paints at the
104
+ * point covers the text, and one that paints nothing there, such as an empty full-screen
105
+ * container, does not. Text that could not be settled that way is left out as uncertain.
98
106
  */
99
107
  declare class ViewportEvidence extends ViewportEvidence_base {}
108
+ /**
109
+ * Case-insensitive text a reading keeps. It is applied inside the page before any limit, so
110
+ * matching controls are not crowded out by earlier ones. It filters what is read; it never
111
+ * searches for, re-finds or substitutes a node.
112
+ */
113
+ declare const ReadingMatch: Schema.String;
100
114
  declare const Observation_base: Schema.Class<Observation, Schema.Struct<{
101
115
  readonly target: typeof Target;
102
116
  readonly observationId: Schema.NonEmptyString;
103
117
  readonly revision: Schema.Natural;
104
118
  readonly scope: Schema.Literals<readonly ["document", "viewport"]>;
119
+ readonly match: Schema.optionalKey<Schema.String>;
105
120
  readonly url: Schema.String;
106
121
  readonly text: Schema.String;
107
122
  readonly controls: Schema.$Array<typeof ObservedControl>;
@@ -113,8 +128,9 @@ declare const Observation_base: Schema.Class<Observation, Schema.Struct<{
113
128
  * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A
114
129
  * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its
115
130
  * native selects. Those choices are not a claim that a closed dropdown's rows were visible.
116
- * A `document` reading is the whole body, wherever it is. Nothing here carries a destination,
117
- * a form or a field value.
131
+ * A `document` reading is the whole body, wherever it is. A reading with `match` keeps only
132
+ * matching text lines and controls, so what it leaves out is not evidence of absence. Nothing
133
+ * here carries a destination, a form or a field value.
118
134
  */
119
135
  declare class Observation extends Observation_base {}
120
136
  declare const ObservedElement_base: Schema.Class<ObservedElement, Schema.Struct<{
@@ -147,9 +163,7 @@ declare const PageExecutionState_base: Schema.Class<PageExecutionState, Schema.S
147
163
  }>, {}>;
148
164
  declare class PageExecutionState extends PageExecutionState_base {}
149
165
  declare const BrowserPolicy_base: Schema.Class<BrowserPolicy, Schema.Struct<{
150
- readonly network: Schema.Struct<{
151
- readonly _tag: Schema.Literal<"Unrestricted">;
152
- }>;
166
+ readonly network: Schema.TaggedStruct<"Unrestricted", {}>;
153
167
  readonly maxActions: Schema.Int;
154
168
  readonly maxElapsedMillis: Schema.Int;
155
169
  readonly maxReturnedBytes: Schema.Int;
@@ -192,6 +206,71 @@ declare const FillRequest_base: Schema.Class<FillRequest, Schema.Struct<{
192
206
  readonly value: Schema.String;
193
207
  }>, {}>;
194
208
  declare class FillRequest extends FillRequest_base {}
209
+ /**
210
+ * One observed control and the one state a form gives it: replacement text, the checked state a
211
+ * checkbox, radio or switch should end in (it is clicked only when it differs, and a native radio
212
+ * is never asked to clear itself), or issued option IDs of a native select from the same
213
+ * observation.
214
+ */
215
+ declare const FormField: Schema.Struct<{
216
+ readonly elementId: Schema.NonEmptyString;
217
+ readonly value: Schema.optionalKey<Schema.String>;
218
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
219
+ readonly options: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
220
+ }>;
221
+ type FormField = typeof FormField.Type;
222
+ declare const FillFormRequest_base: Schema.Class<FillFormRequest, Schema.Struct<{
223
+ readonly observationId: Schema.NonEmptyString;
224
+ readonly fields: Schema.$Array<Schema.Struct<{
225
+ readonly elementId: Schema.NonEmptyString;
226
+ readonly value: Schema.optionalKey<Schema.String>;
227
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
228
+ readonly options: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
229
+ }>>;
230
+ readonly submit: Schema.optionalKey<Schema.NonEmptyString>;
231
+ }>, {}>;
232
+ /** At most 32 distinct fields, and a submit control that is not one of them. */
233
+ declare class FillFormRequest extends FillFormRequest_base {}
234
+ /**
235
+ * Host choices about how a form proceeds. `verify` (default true) re-reads every field before
236
+ * submit and stops when one no longer holds what its own step left there. `settleMillis`
237
+ * (default 50, at most 5000; 0 skips it) is how long each dispatched step lets the page's own
238
+ * handlers run, after at least two rendered frames, before its result is read back.
239
+ */
240
+ declare const FillFormOptions: Schema.Struct<{
241
+ readonly verify: Schema.optionalKey<Schema.Boolean>;
242
+ readonly settleMillis: Schema.optionalKey<Schema.Int>;
243
+ }>;
244
+ type FillFormOptions = typeof FillFormOptions.Type;
245
+ declare const FormFieldResult_base: Schema.Class<FormFieldResult, Schema.Struct<{
246
+ readonly elementId: Schema.NonEmptyString;
247
+ readonly status: Schema.Literals<readonly ["set", "unchanged"]>;
248
+ }>, {}>;
249
+ /** `set` dispatched input; `unchanged` needed none, because a toggle already held its state. */
250
+ declare class FormFieldResult extends FormFieldResult_base {}
251
+ declare const FormStop_base: Schema.Class<FormStop, Schema.Struct<{
252
+ readonly stage: Schema.Literals<readonly ["field", "verify", "submit"]>;
253
+ readonly elementId: Schema.optionalKey<Schema.NonEmptyString>;
254
+ readonly error: typeof BrowserError;
255
+ }>, {}>;
256
+ /**
257
+ * Where a form stopped and why. `error.outcome` says whether this step itself was dispatched;
258
+ * nothing after it was. `elementId` names the control it stopped at, when there is one: a
259
+ * verification that could not read the form at all names none.
260
+ */
261
+ declare class FormStop extends FormStop_base {}
262
+ declare const FillFormResult_base: Schema.Class<FillFormResult, Schema.Struct<{
263
+ readonly fields: Schema.$Array<typeof FormFieldResult>;
264
+ readonly submitted: Schema.Boolean;
265
+ readonly url: Schema.NonEmptyString;
266
+ readonly stopped: Schema.optionalKey<typeof FormStop>;
267
+ }>, {}>;
268
+ /**
269
+ * What a form did, in order. `stopped` is present when it did not finish: the fields before it
270
+ * stay set, because a form is not a transaction. `submitted` is true only when the submit click
271
+ * completed; a stop at `submit` with an `unknown` outcome may have sent it.
272
+ */
273
+ declare class FillFormResult extends FillFormResult_base {}
195
274
  declare const ScrollRequest_base: Schema.Class<ScrollRequest, Schema.Struct<{
196
275
  readonly deltaX: Schema.Int;
197
276
  readonly deltaY: Schema.Int;
@@ -273,6 +352,7 @@ declare const ObservationOptions: Schema.Struct<{
273
352
  readonly maxTextBytes: Schema.optionalKey<Schema.Int>;
274
353
  readonly maxControls: Schema.optionalKey<Schema.Int>;
275
354
  readonly scope: Schema.optionalKey<Schema.Literals<readonly ["document", "viewport"]>>;
355
+ readonly match: Schema.optionalKey<Schema.String>;
276
356
  }>;
277
357
  type ObservationOptions = typeof ObservationOptions.Type;
278
358
  /** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */
@@ -407,6 +487,6 @@ declare const AutomationOptions: Schema.Struct<{
407
487
  }>;
408
488
  type AutomationOptions = typeof AutomationOptions.Type;
409
489
  //#endregion
410
- export { PositiveInt as A, SessionReason as B, ObservationOptions as C, PageInfo as D, PageExecutionState as E, ScreenshotResult as F, TextResult as G, StartNavigationRequest as H, ScrollRequest as I, ViewportEvidence as J, TypeRequest as K, SelectOptions as L, ReadTextRequest as M, SafeFilename as N, PageSuspension as O, ScreenshotRequest as P, WheelRequest as Q, Selector as R, Observation as S, ObservedElement as T, Target as U, SessionStatus as V, TargetUrl as W, ViewportRect as X, ViewportPoint as Y, WaitForElementRequest as Z, KeyModifier as _, BrowserPolicy as a, NavigateRequest as b, ClickRequest as c, FrameInfo as d, HoverRequest as f, InputReceipt as g, InlineFiles as h, BrowserDiagnostics as i, PressRequest as j, PointerMoveRequest as k, ControlFacts as l, InlineFile as m, AutomationOptions as n, Checkpoint as o, Identifier as p, Viewport as q, BrowserDiagnostic as r, CheckpointOptions as s, ActionResult as t, FillRequest as u, KeyStroke as v, ObservedControl as w, NavigationResult as x, NamedKey as y, SessionPhase as z };
490
+ export { TypeRequest as $, ObservedControl as A, SafeFilename as B, KeyModifier as C, NavigationResult as D, NavigateRequest as E, PointerMoveRequest as F, Selector as G, ScreenshotResult as H, PositiveInt as I, SessionStatus as J, SessionPhase as K, PressRequest as L, PageExecutionState as M, PageInfo as N, Observation as O, PageSuspension as P, TextResult as Q, ReadTextRequest as R, InputReceipt as S, NamedKey as T, ScrollRequest as U, ScreenshotRequest as V, SelectOptions as W, Target as X, StartNavigationRequest as Y, TargetUrl as Z, FrameInfo as _, BrowserPolicy as a, WheelRequest as at, InlineFile as b, ClickRequest as c, FillFormRequest as d, Viewport as et, FillFormResult as f, FormStop as g, FormFieldResult as h, BrowserDiagnostics as i, WaitForElementRequest as it, ObservedElement as j, ObservationOptions as k, ControlFacts as l, FormField as m, AutomationOptions as n, ViewportPoint as nt, Checkpoint as o, FillRequest as p, SessionReason as q, BrowserDiagnostic as r, ViewportRect as rt, CheckpointOptions as s, ActionResult as t, ViewportEvidence as tt, FillFormOptions as u, HoverRequest as v, KeyStroke as w, InlineFiles as x, Identifier as y, ReadingMatch as z };
411
491
  export {};
412
- //# sourceMappingURL=BrowserData-DJAnUHoZ.d.mts.map
492
+ //# sourceMappingURL=BrowserData-CRuxEZcn.d.mts.map
@@ -1,3 +1,3 @@
1
- import { A as PositiveInt, B as SessionReason, C as ObservationOptions, D as PageInfo, E as PageExecutionState, F as ScreenshotResult, G as TextResult, H as StartNavigationRequest, I as ScrollRequest, J as ViewportEvidence, K as TypeRequest, L as SelectOptions, M as ReadTextRequest, N as SafeFilename, O as PageSuspension, P as ScreenshotRequest, Q as WheelRequest, R as Selector, S as Observation, T as ObservedElement, U as Target, V as SessionStatus, W as TargetUrl, X as ViewportRect, Y as ViewportPoint, Z as WaitForElementRequest, _ as KeyModifier, a as BrowserPolicy, b as NavigateRequest, c as ClickRequest, d as FrameInfo, f as HoverRequest, g as InputReceipt, h as InlineFiles, i as BrowserDiagnostics, j as PressRequest, k as PointerMoveRequest, l as ControlFacts, m as InlineFile, n as AutomationOptions, o as Checkpoint, p as Identifier, q as Viewport, r as BrowserDiagnostic, s as CheckpointOptions, t as ActionResult, u as FillRequest, v as KeyStroke, w as ObservedControl, x as NavigationResult, y as NamedKey, z as SessionPhase } from "./BrowserData-DJAnUHoZ.mjs";
2
- export { ActionResult, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, FillRequest, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
1
+ import { $ as TypeRequest, A as ObservedControl, B as SafeFilename, C as KeyModifier, D as NavigationResult, E as NavigateRequest, F as PointerMoveRequest, G as Selector, H as ScreenshotResult, I as PositiveInt, J as SessionStatus, K as SessionPhase, L as PressRequest, M as PageExecutionState, N as PageInfo, O as Observation, P as PageSuspension, Q as TextResult, R as ReadTextRequest, S as InputReceipt, T as NamedKey, U as ScrollRequest, V as ScreenshotRequest, W as SelectOptions, X as Target, Y as StartNavigationRequest, Z as TargetUrl, _ as FrameInfo, a as BrowserPolicy, at as WheelRequest, b as InlineFile, c as ClickRequest, d as FillFormRequest, et as Viewport, f as FillFormResult, g as FormStop, h as FormFieldResult, i as BrowserDiagnostics, it as WaitForElementRequest, j as ObservedElement, k as ObservationOptions, l as ControlFacts, m as FormField, n as AutomationOptions, nt as ViewportPoint, o as Checkpoint, p as FillRequest, q as SessionReason, r as BrowserDiagnostic, rt as ViewportRect, s as CheckpointOptions, t as ActionResult, tt as ViewportEvidence, u as FillFormOptions, v as HoverRequest, w as KeyStroke, x as InlineFiles, y as Identifier, z as ReadingMatch } from "./BrowserData-CRuxEZcn.mjs";
2
+ export { ActionResult, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, FillFormOptions, FillFormRequest, FillFormResult, FillRequest, FormField, FormFieldResult, FormStop, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, ReadingMatch, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
3
3
  export {};
@@ -1,3 +1,4 @@
1
+ import { BrowserError } from "./Errors.mjs";
1
2
  import { Schema } from "effect";
2
3
  //#region src/BrowserData.ts
3
4
  const Identifier = Schema.NonEmptyString.check(Schema.isMaxLength(256), Schema.isPattern(/^[A-Za-z0-9_-]+$/));
@@ -106,16 +107,23 @@ var ObservedControl = class extends Schema.Class("BrowserObservedControl")({
106
107
  * How a viewport reading was bounded and what it left out. These are counts, so they are safe
107
108
  * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is
108
109
  * kept when its line boxes intersect the viewport and the browser finds its own element at a
109
- * sampled point. `uncertainText` lay under something that takes no pointer events, which
110
- * hit-testing cannot see through, so it is left out rather than called visible.
110
+ * sampled point. Something that takes no pointer events is invisible to that test, so the
111
+ * browser is asked what is on top there with pointer events ignored: a box that paints at the
112
+ * point covers the text, and one that paints nothing there, such as an empty full-screen
113
+ * container, does not. Text that could not be settled that way is left out as uncertain.
111
114
  */
112
115
  var ViewportEvidence = class extends Schema.Class("BrowserViewportEvidence")({
113
116
  width: Schema.Finite,
114
117
  height: Schema.Finite,
115
118
  /** Text that crossed a viewport edge; only its lines on screen were kept. */
116
119
  clippedText: Schema.Natural,
117
- /** Left out: the browser found another element at the sampled point. */
120
+ /** Left out: another element is on top at the sampled point, or a box there paints over it. */
118
121
  coveredText: Schema.Natural,
122
+ /**
123
+ * Left out: something that takes no pointer events lies over it and the browser's own hit test
124
+ * could not settle whether it paints there, for example beneath another such box, in a child
125
+ * frame, or after too many such points in one reading.
126
+ */
119
127
  uncertainText: Schema.Natural,
120
128
  /** Controls that intersect the viewport but cannot be reached there. */
121
129
  unreachableControls: Schema.Natural,
@@ -123,17 +131,25 @@ var ViewportEvidence = class extends Schema.Class("BrowserViewportEvidence")({
123
131
  exhausted: Schema.Boolean
124
132
  }) {};
125
133
  /**
134
+ * Case-insensitive text a reading keeps. It is applied inside the page before any limit, so
135
+ * matching controls are not crowded out by earlier ones. It filters what is read; it never
136
+ * searches for, re-finds or substitutes a node.
137
+ */
138
+ const ReadingMatch = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(256), Schema.makeFilter((value) => value.trim().length > 0, { title: "not only whitespace" }));
139
+ /**
126
140
  * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A
127
141
  * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its
128
142
  * native selects. Those choices are not a claim that a closed dropdown's rows were visible.
129
- * A `document` reading is the whole body, wherever it is. Nothing here carries a destination,
130
- * a form or a field value.
143
+ * A `document` reading is the whole body, wherever it is. A reading with `match` keeps only
144
+ * matching text lines and controls, so what it leaves out is not evidence of absence. Nothing
145
+ * here carries a destination, a form or a field value.
131
146
  */
132
147
  var Observation = class extends Schema.Class("BrowserObservation")({
133
148
  target: Target,
134
149
  observationId: Identifier,
135
150
  revision: Schema.Natural,
136
151
  scope: Schema.Literals(["document", "viewport"]),
152
+ match: Schema.optionalKey(ReadingMatch),
137
153
  url: Schema.String.check(Schema.isMaxLength(8192)),
138
154
  text: Schema.String.check(Schema.isMaxLength(131072)),
139
155
  controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),
@@ -179,7 +195,7 @@ var PageExecutionState = class extends Schema.Class("BrowserPageExecutionState")
179
195
  }) {};
180
196
  /** Explicit opt-out: this integration does not claim whole-browser network containment. */
181
197
  var BrowserPolicy = class BrowserPolicy extends Schema.Class("BrowserBrowserPolicy")({
182
- network: Schema.Struct({ _tag: Schema.Literal("Unrestricted") }),
198
+ network: Schema.TaggedStruct("Unrestricted", {}),
183
199
  maxActions: PositiveInt.check(Schema.isLessThanOrEqualTo(1e3)),
184
200
  maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(216e5)),
185
201
  maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8388608))
@@ -231,6 +247,67 @@ var FillRequest = class extends Schema.Class("BrowserFillRequest")({
231
247
  selector: Selector,
232
248
  value: Schema.String.check(Schema.isMaxLength(65536))
233
249
  }) {};
250
+ /**
251
+ * One observed control and the one state a form gives it: replacement text, the checked state a
252
+ * checkbox, radio or switch should end in (it is clicked only when it differs, and a native radio
253
+ * is never asked to clear itself), or issued option IDs of a native select from the same
254
+ * observation.
255
+ */
256
+ const FormField = Schema.Struct({
257
+ elementId: Identifier,
258
+ value: Schema.optionalKey(FillRequest.fields.value),
259
+ checked: Schema.optionalKey(Schema.Boolean),
260
+ options: Schema.optionalKey(SelectOptions)
261
+ }).check(Schema.makeFilter((field) => Number(field.value !== void 0) + Number(field.checked !== void 0) + Number(field.options !== void 0) === 1, { title: "exactly one of value, checked or options" }));
262
+ /** At most 32 distinct fields, and a submit control that is not one of them. */
263
+ var FillFormRequest = class extends Schema.Class("BrowserFillFormRequest")(Schema.Struct({
264
+ observationId: Identifier,
265
+ fields: Schema.Array(FormField).check(Schema.isMinLength(1), Schema.isMaxLength(32), Schema.makeFilter((fields) => new Set(fields.map((field) => field.elementId)).size === fields.length, { title: "each field at most once" })),
266
+ submit: Schema.optionalKey(Identifier)
267
+ }).check(Schema.makeFilter((request) => request.submit === void 0 || !request.fields.some((field) => field.elementId === request.submit), { title: "a submit control that is not also a field" }))) {};
268
+ /**
269
+ * Host choices about how a form proceeds. `verify` (default true) re-reads every field before
270
+ * submit and stops when one no longer holds what its own step left there. `settleMillis`
271
+ * (default 50, at most 5000; 0 skips it) is how long each dispatched step lets the page's own
272
+ * handlers run, after at least two rendered frames, before its result is read back.
273
+ */
274
+ const FillFormOptions = Schema.Struct({
275
+ verify: Schema.optionalKey(Schema.Boolean),
276
+ settleMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
277
+ minimum: 0,
278
+ maximum: 5e3
279
+ })))
280
+ });
281
+ /** `set` dispatched input; `unchanged` needed none, because a toggle already held its state. */
282
+ var FormFieldResult = class extends Schema.Class("BrowserFormFieldResult")({
283
+ elementId: Identifier,
284
+ status: Schema.Literals(["set", "unchanged"])
285
+ }) {};
286
+ /**
287
+ * Where a form stopped and why. `error.outcome` says whether this step itself was dispatched;
288
+ * nothing after it was. `elementId` names the control it stopped at, when there is one: a
289
+ * verification that could not read the form at all names none.
290
+ */
291
+ var FormStop = class extends Schema.Class("BrowserFormStop")({
292
+ stage: Schema.Literals([
293
+ "field",
294
+ "verify",
295
+ "submit"
296
+ ]),
297
+ elementId: Schema.optionalKey(Identifier),
298
+ error: BrowserError
299
+ }) {};
300
+ /**
301
+ * What a form did, in order. `stopped` is present when it did not finish: the fields before it
302
+ * stay set, because a form is not a transaction. `submitted` is true only when the submit click
303
+ * completed; a stop at `submit` with an `unknown` outcome may have sent it.
304
+ */
305
+ var FillFormResult = class extends Schema.Class("BrowserFillFormResult")({
306
+ fields: Schema.Array(FormFieldResult).check(Schema.isMaxLength(32)),
307
+ submitted: Schema.Boolean,
308
+ url: TargetUrl,
309
+ stopped: Schema.optionalKey(FormStop)
310
+ }) {};
234
311
  var ScrollRequest = class extends Schema.Class("BrowserScrollRequest")({
235
312
  deltaX: Schema.Int.check(Schema.isBetween({
236
313
  minimum: -1e5,
@@ -340,6 +417,7 @@ const ReadingBounds = {
340
417
  /** Omitted bounds default at admission; `scope` defaults to the whole document. */
341
418
  const ObservationOptions = Schema.Struct({
342
419
  scope: Schema.optionalKey(Schema.Literals(["document", "viewport"])),
420
+ match: Schema.optionalKey(ReadingMatch),
343
421
  ...ReadingBounds
344
422
  });
345
423
  /** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */
@@ -489,6 +567,6 @@ const AutomationOptions = Schema.Struct({
489
567
  pageControl: Schema.optionalKey(Schema.Boolean)
490
568
  });
491
569
  //#endregion
492
- export { ActionResult, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, FillRequest, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
570
+ export { ActionResult, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, FillFormOptions, FillFormRequest, FillFormResult, FillRequest, FormField, FormFieldResult, FormStop, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, ReadingMatch, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
493
571
 
494
572
  //# sourceMappingURL=BrowserData.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserData.mjs","names":[],"sources":["../src/BrowserData.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nexport const Identifier = Schema.NonEmptyString.check(\n Schema.isMaxLength(256),\n Schema.isPattern(/^[A-Za-z0-9_-]+$/),\n);\n\nexport const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** Portable basename only; never a local or remote filesystem path. */\nexport const SafeFilename = Schema.NonEmptyString.check(\n Schema.isMaxLength(240),\n Schema.makeFilter(\n (value) =>\n value !== \".\" &&\n value !== \"..\" &&\n !/[\\x00-\\x1f\\x7f/\\\\:]/.test(value) &&\n !/[. ]$/.test(value) &&\n !/^\\s/.test(value) &&\n !/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\.|$)/i.test(value),\n { title: \"a portable, non-path download filename\" },\n ),\n);\n\nexport class Viewport extends Schema.Class<Viewport>(\"BrowserViewport\")(\n Schema.Struct({\n width: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n height: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n }).check(\n Schema.makeFilter((v) => v.width * v.height <= 8_388_608, {\n title: \"at most 8,388,608 viewport pixels\",\n }),\n ),\n) {}\n\n/** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */\n\nexport class Target extends Schema.Class<Target>(\"BrowserTarget\")({\n generation: Schema.Natural,\n pageId: Identifier,\n frameId: Identifier,\n}) {}\n\nexport class PageInfo extends Schema.Class<PageInfo>(\"BrowserPageInfo\")({\n pageId: Identifier,\n targetId: Identifier,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n title: Schema.String.check(Schema.isMaxLength(512)),\n selected: Schema.Boolean,\n}) {}\n\nexport class FrameInfo extends Schema.Class<FrameInfo>(\"BrowserFrameInfo\")({\n frameId: Identifier,\n parentFrameId: Schema.NullOr(Identifier),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n name: Schema.String.check(Schema.isMaxLength(256)),\n}) {}\n\nexport const SessionPhase = Schema.Literals([\n \"acquiring\",\n \"open\",\n \"paused\",\n \"detached\",\n \"faulted\",\n \"uncertain\",\n \"closing\",\n \"closed\",\n]);\n\nexport type SessionPhase = typeof SessionPhase.Type;\n\nexport const SessionReason = Schema.Literals([\n \"expired\",\n \"callback-failure\",\n \"registration-failure\",\n \"native-failure\",\n \"disconnected\",\n \"popup-policy\",\n \"dialog-policy\",\n \"popup-overflow\",\n \"dialog-overflow\",\n \"cleanup-capacity\",\n \"handoff\",\n \"detached\",\n \"closed\",\n]);\n\nexport type SessionReason = typeof SessionReason.Type;\n\nconst DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));\n\n/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */\nexport class SessionStatus extends Schema.Class<SessionStatus>(\"BrowserSessionStatus\")({\n phase: SessionPhase,\n reason: Schema.NullOr(SessionReason),\n generation: DiagnosticCounter,\n busy: Schema.Boolean,\n unresolvedDispatch: Schema.Boolean,\n}) {}\n\n/** Bounded host facts only: no target identity, page content, native exception or consumer cause. */\nexport class BrowserDiagnostic extends Schema.Class<BrowserDiagnostic>(\"BrowserDiagnostic\")({\n reason: SessionReason,\n disposition: Schema.Literals([\"pending\", \"confirmed\", \"not-dispatched\", \"unknown\"]),\n generation: DiagnosticCounter,\n monotonicNanos: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n)),\n}) {}\n\nexport class BrowserDiagnostics extends Schema.Class<BrowserDiagnostics>(\"BrowserDiagnostics\")({\n records: Schema.Array(BrowserDiagnostic).check(Schema.isMaxLength(32)),\n total: DiagnosticCounter,\n dropped: DiagnosticCounter,\n truncated: Schema.Boolean,\n}) {}\n\nexport class ObservedControl extends Schema.Class<ObservedControl>(\"BrowserObservedControl\")({\n elementId: Identifier,\n kind: Schema.Literals([\"link\", \"button\", \"input\", \"select\", \"textarea\", \"other\"]),\n label: Schema.String.check(Schema.isMaxLength(256)),\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n required: Schema.optionalKey(Schema.Boolean),\n /** Native select state. A select is never represented by one `selected` boolean. */\n multiple: Schema.optionalKey(Schema.Boolean),\n /** The issued select this native option belongs to, in the same observation. */\n selectElementId: Schema.optionalKey(Identifier),\n /** Some choices could not be issued within this reading's shared control/value bounds. */\n optionsTruncated: Schema.optionalKey(Schema.Boolean),\n}) {}\n\n/**\n * How a viewport reading was bounded and what it left out. These are counts, so they are safe\n * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is\n * kept when its line boxes intersect the viewport and the browser finds its own element at a\n * sampled point. `uncertainText` lay under something that takes no pointer events, which\n * hit-testing cannot see through, so it is left out rather than called visible.\n */\nexport class ViewportEvidence extends Schema.Class<ViewportEvidence>(\"BrowserViewportEvidence\")({\n width: Schema.Finite,\n height: Schema.Finite,\n /** Text that crossed a viewport edge; only its lines on screen were kept. */\n clippedText: Schema.Natural,\n /** Left out: the browser found another element at the sampled point. */\n coveredText: Schema.Natural,\n uncertainText: Schema.Natural,\n /** Controls that intersect the viewport but cannot be reached there. */\n unreachableControls: Schema.Natural,\n /** The traversal budget ran out first, so this reading is known to be incomplete. */\n exhausted: Schema.Boolean,\n}) {}\n\n/**\n * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A\n * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its\n * native selects. Those choices are not a claim that a closed dropdown's rows were visible.\n * A `document` reading is the whole body, wherever it is. Nothing here carries a destination,\n * a form or a field value.\n */\nexport class Observation extends Schema.Class<Observation>(\"BrowserObservation\")({\n target: Target,\n observationId: Identifier,\n revision: Schema.Natural,\n scope: Schema.Literals([\"document\", \"viewport\"]),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n textTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n}) {}\n\nexport class ObservedElement extends Schema.Class<ObservedElement>(\"BrowserObservedElement\")({\n observationId: Identifier,\n elementId: Identifier,\n}) {}\n\n/** Observe a condition of this exact node. A replacement never satisfies the reference. */\nexport class WaitForElementRequest extends Schema.Class<WaitForElementRequest>(\n \"BrowserWaitForElementRequest\",\n)({\n reference: ObservedElement,\n state: Schema.Literals([\"visible\", \"hidden\", \"enabled\", \"disabled\"]),\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n}) {}\n\n/** Issued option element IDs from one observed native select; never values, labels or indices. */\nexport const SelectOptions = Schema.Array(Identifier).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(64),\n Schema.makeFilter((ids) => new Set(ids).size === ids.length),\n);\n\nexport type SelectOptions = typeof SelectOptions.Type;\n\n/** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */\nexport class PageSuspension extends Schema.Class<PageSuspension>(\"BrowserPageSuspension\")({\n pageId: Identifier,\n targetId: Identifier,\n suspensionId: Identifier,\n}) {}\n\nexport class PageExecutionState extends Schema.Class<PageExecutionState>(\n \"BrowserPageExecutionState\",\n)({\n pageId: Identifier,\n targetId: Identifier,\n state: Schema.Literals([\"running\", \"suspended\", \"unknown\"]),\n suspensionId: Schema.optionalKey(Identifier),\n}) {}\n\n/** Explicit opt-out: this integration does not claim whole-browser network containment. */\nexport class BrowserPolicy extends Schema.Class<BrowserPolicy>(\"BrowserBrowserPolicy\")({\n network: Schema.Struct({ _tag: Schema.Literal(\"Unrestricted\") }),\n maxActions: PositiveInt.check(Schema.isLessThanOrEqualTo(1000)),\n maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(21_600_000)),\n maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8 * 1024 * 1024)),\n}) {\n /**\n * Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.\n * The network choice is spelled out in the name because this runtime cannot prove a\n * narrower one; override any bound, never the network.\n */\n static unrestricted(\n bounds: Partial<\n Pick<BrowserPolicy, \"maxActions\" | \"maxElapsedMillis\" | \"maxReturnedBytes\">\n > = {},\n ): BrowserPolicy {\n return BrowserPolicy.make({\n network: { _tag: \"Unrestricted\" },\n maxActions: bounds.maxActions ?? 100,\n maxElapsedMillis: bounds.maxElapsedMillis ?? 5 * 60_000,\n maxReturnedBytes: bounds.maxReturnedBytes ?? 2 * 1024 * 1024,\n });\n }\n}\n\nexport const TargetUrl = Schema.NonEmptyString.check(\n Schema.isMaxLength(8192),\n Schema.makeFilter((value) => {\n try {\n const url = new URL(value);\n\n return (\n [\"http:\", \"https:\"].includes(url.protocol) &&\n url.hostname !== \"\" &&\n !url.username &&\n !url.password\n );\n } catch {\n return false;\n }\n }),\n);\n\nexport const Selector = Schema.NonEmptyString.check(Schema.isMaxLength(1024));\n\nexport class NavigateRequest extends Schema.Class<NavigateRequest>(\"BrowserNavigateRequest\")({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\n/**\n * A navigation left in flight. `timeoutMillis` is how long the browser may take to reach\n * DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.\n */\nexport class StartNavigationRequest extends Schema.Class<StartNavigationRequest>(\n \"BrowserStartNavigationRequest\",\n)({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\nexport class ReadTextRequest extends Schema.Class<ReadTextRequest>(\"BrowserReadTextRequest\")({\n selector: Schema.optionalKey(Selector),\n}) {}\n\nexport class ClickRequest extends Schema.Class<ClickRequest>(\"BrowserClickRequest\")({\n selector: Selector,\n}) {}\n\nexport class FillRequest extends Schema.Class<FillRequest>(\"BrowserFillRequest\")({\n selector: Selector,\n value: Schema.String.check(Schema.isMaxLength(65536)),\n}) {}\n\nexport class ScrollRequest extends Schema.Class<ScrollRequest>(\"BrowserScrollRequest\")({\n deltaX: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n deltaY: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n}) {}\n\n/**\n * CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It\n * is not a document offset, a device pixel, or a coordinate inside a child frame.\n */\nexport class ViewportPoint extends Schema.Class<ViewportPoint>(\"BrowserViewportPoint\")({\n x: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n y: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n}) {}\n\n/** A box in the viewport of the frame it was read from, in CSS pixels. */\nexport class ViewportRect extends Schema.Class<ViewportRect>(\"BrowserViewportRect\")({\n x: Schema.Finite,\n y: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n}) {}\n\n/**\n * What a host needs to decide whether a control may be acted on. Host-only: a destination can\n * carry a token, so none of this is part of the model-facing `Observation`. It never includes a\n * field's value or any markup.\n */\nexport class ControlFacts extends Schema.Class<ControlFacts>(\"BrowserControlFacts\")({\n kind: ObservedControl.fields.kind,\n label: ObservedControl.fields.label,\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n required: Schema.optionalKey(Schema.Boolean),\n multiple: Schema.optionalKey(Schema.Boolean),\n editable: Schema.Boolean,\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n autocomplete: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n /** A resolved link target, or where this control submits its form. Absent when over-long. */\n destination: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(2048))),\n formMethod: Schema.optionalKey(Schema.Literals([\"get\", \"post\", \"dialog\"])),\n box: ViewportRect,\n placement: Schema.Literals([\"inside\", \"partial\", \"outside\"]),\n /** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */\n hitTest: Schema.Literals([\"self\", \"covered\", \"uncertain\", \"unsampled\"]),\n /** Only then is `box` in the main frame's viewport, the space pointer input uses. */\n mainFrame: Schema.Boolean,\n}) {}\n\n/**\n * Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues\n * no element references and never replaces the observation an agent's tools act on, so\n * inspecting, checkpointing and then acting on the inspected node all compose.\n *\n * It is host-only, because it carries control facts. Text and picture are read one after the\n * other, never atomically: the interval says when, and `documentChanged` says the document was\n * replaced in between, so the two may describe different documents.\n */\nexport class Checkpoint extends Schema.Class<Checkpoint>(\"BrowserCheckpoint\")({\n target: Target,\n revision: Schema.Natural,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n textTruncated: Schema.Boolean,\n controls: Schema.Array(ControlFacts).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n picture: Schema.optionalKey(\n Schema.Struct({ mediaType: Schema.Literal(\"image/png\"), bytes: Schema.Uint8Array }),\n ),\n documentChanged: Schema.Boolean,\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\nconst ReadingBounds = {\n maxTextBytes: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 131072 })),\n ),\n maxControls: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 64 }))),\n};\n\n/** Omitted bounds default at admission; `scope` defaults to the whole document. */\nexport const ObservationOptions = Schema.Struct({\n scope: Schema.optionalKey(Schema.Literals([\"document\", \"viewport\"])),\n ...ReadingBounds,\n});\n\nexport type ObservationOptions = typeof ObservationOptions.Type;\n\n/** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */\nexport const CheckpointOptions = Schema.Struct({\n ...ReadingBounds,\n picture: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type CheckpointOptions = typeof CheckpointOptions.Type;\n\n/** One native pointer move. Easing and pacing are the caller's: send the points you want. */\nexport class PointerMoveRequest extends Schema.Class<PointerMoveRequest>(\n \"BrowserPointerMoveRequest\",\n)({ to: ViewportPoint }) {}\n\n/** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */\nexport class HoverRequest extends Schema.Class<HoverRequest>(\"BrowserHoverRequest\")({\n selector: Selector,\n}) {}\n\nconst WheelDelta = Schema.Finite.check(Schema.isBetween({ minimum: -100000, maximum: 100000 }));\n\n/**\n * One native wheel event where the pointer is, or at `at` after moving there first. The browser\n * chooses what scrolls, exactly as it would for a person, so a nested scroll container under\n * the pointer scrolls instead of the page.\n */\nexport class WheelRequest extends Schema.Class<WheelRequest>(\"BrowserWheelRequest\")({\n deltaX: WheelDelta,\n deltaY: WheelDelta,\n at: Schema.optionalKey(ViewportPoint),\n}) {}\n\n/**\n * The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is\n * closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.\n */\nexport const NamedKey = Schema.Literals([\n \"Enter\",\n \"Tab\",\n \"Backspace\",\n \"Delete\",\n \"Escape\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"PageUp\",\n \"PageDown\",\n]);\n\nexport type NamedKey = typeof NamedKey.Type;\n\n/** One printable ASCII character, space included: every one is a key on the US layout. */\nconst PrintableKey = Schema.String.check(Schema.isPattern(/^[\\x20-\\x7e]$/));\n\nexport const KeyModifier = Schema.Literals([\"Shift\", \"Control\", \"Alt\", \"Meta\"]);\n\nexport type KeyModifier = typeof KeyModifier.Type;\n\n/** One key, down then up, with any modifiers held around it. */\nexport const KeyStroke = Schema.Struct({\n key: Schema.Union([NamedKey, PrintableKey]),\n modifiers: Schema.optionalKey(\n Schema.Array(KeyModifier).check(\n Schema.makeFilter((held) => new Set(held).size === held.length, {\n title: \"each modifier at most once\",\n }),\n ),\n ),\n});\n\nexport type KeyStroke = typeof KeyStroke.Type;\n\n/**\n * One real key stroke. It goes to whatever has focus in the page, exactly as it would for a\n * person, unless `into` names the one element that must already have it. It never focuses that\n * element, because that would hide a scripted focus inside a native-input operation: click it\n * first.\n */\nexport class PressRequest extends Schema.Class<PressRequest>(\"BrowserPressRequest\")({\n ...KeyStroke.fields,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/** Counted in characters, not UTF-16 units, because that is how many strokes it costs. */\nconst TypedText = Schema.NonEmptyString.check(\n Schema.makeFilter((text) => [...text].length <= 256, { title: \"at most 256 characters\" }),\n Schema.makeFilter(\n (text) =>\n [...text].every((character) => {\n const point = character.codePointAt(0) ?? 0;\n\n // An unpaired surrogate is not a character, and would not survive the wire as one.\n return point > 0x1f && point !== 0x7f && (point < 0xd800 || point > 0xdfff);\n }),\n { title: \"no control characters or unpaired surrogates\" },\n ),\n);\n\n/**\n * Text as the real key strokes that produce it, two native commands for each character, one\n * after another under a single action timeout: send a long passage as several shorter runs.\n * A character the US layout cannot produce is inserted as text, as an input method commits it,\n * and raises no key events. Control characters are refused, so a line break can never press\n * Enter from inside a run of text: a named key is always its own `press`. `into` works as it\n * does for `PressRequest`: a guard on where the text lands, never a focus.\n */\nexport class TypeRequest extends Schema.Class<TypeRequest>(\"BrowserTypeRequest\")({\n text: TypedText,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/**\n * What native input was dispatched, where and when. `position` is the point this owner\n * commanded, or null when it has not yet placed the pointer on this page. The interval is on\n * the host monotonic clock that stamps `CapturedFrame.receivedMonotonicNanos`, so input and\n * pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not\n * claim the page finished scrolling, or that any frame shows it. A receipt never says which\n * key was pressed or what was typed.\n */\nexport class InputReceipt extends Schema.Class<InputReceipt>(\"BrowserInputReceipt\")({\n target: Target,\n kind: Schema.Literals([\"pointer-move\", \"hover\", \"wheel\", \"press\", \"type\"]),\n position: Schema.NullOr(ViewportPoint),\n delta: Schema.optionalKey(Schema.Struct({ x: WheelDelta, y: WheelDelta })),\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\nexport class ScreenshotRequest extends Schema.Class<ScreenshotRequest>(\"BrowserScreenshotRequest\")({\n fullPage: Schema.Boolean,\n}) {}\n\nexport class NavigationResult extends Schema.Class<NavigationResult>(\"BrowserNavigationResult\")({\n url: TargetUrl,\n}) {}\n\nexport class ActionResult extends Schema.Class<ActionResult>(\"BrowserActionResult\")({\n url: TargetUrl,\n}) {}\n\nexport class TextResult extends Schema.Class<TextResult>(\"BrowserTextResult\")({\n text: Schema.String.check(Schema.isMaxLength(8 * 1024 * 1024)),\n}) {}\n\nexport class ScreenshotResult extends Schema.Class<ScreenshotResult>(\"BrowserScreenshotResult\")({\n mediaType: Schema.Literal(\"image/png\"),\n bytes: Schema.Uint8Array,\n}) {}\n\nconst FileMediaType = Schema.NonEmptyString.check(\n Schema.isMaxLength(128),\n Schema.isPattern(/^[a-z0-9][a-z0-9!#$&^_+.-]*\\/[a-z0-9][a-z0-9!#$&^_+.-]*$/),\n);\n\n/** Small selection is in-memory by design: bytes the caller already holds, never a path. */\nexport class InlineFile extends Schema.Class<InlineFile>(\"BrowserInlineFile\")({\n name: SafeFilename,\n mediaType: FileMediaType,\n bytes: Schema.Uint8Array.check(\n Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1024 * 1024, {\n title: \"between one byte and one mebibyte\",\n }),\n ),\n}) {}\n\nexport const InlineFiles = Schema.Array(InlineFile).check(\n Schema.isMaxLength(8),\n Schema.makeFilter(\n (files) =>\n files.length > 0 &&\n files.reduce((total, file) => total + file.bytes.byteLength, 0) <= 4 * 1024 * 1024,\n { title: \"at most four mebibytes of in-memory selection\" },\n ),\n);\n\nexport const AutomationOptions = Schema.Struct({\n actionTimeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n /** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */\n maxHostReads: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1_000_000 })),\n ),\n maxPages: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 32 }))),\n initialPage: Schema.optionalKey(\n Schema.Union([\n Schema.Struct({ targetId: Identifier }),\n Schema.Struct({ newPage: Schema.Literal(true) }),\n ]),\n ),\n popupPolicy: Schema.optionalKey(Schema.Literals([\"retain\", \"close\", \"pause\"])),\n dialogPolicy: Schema.optionalKey(Schema.Literals([\"dismiss\", \"pause\"])),\n pageControl: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type AutomationOptions = typeof AutomationOptions.Type;\n"],"mappings":";;AAEA,MAAa,aAAa,OAAO,eAAe,MAC9C,OAAO,YAAY,GAAG,GACtB,OAAO,UAAU,kBAAkB,CACrC;AAEA,MAAa,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;AAGnE,MAAa,eAAe,OAAO,eAAe,MAChD,OAAO,YAAY,GAAG,GACtB,OAAO,YACJ,UACC,UAAU,OACV,UAAU,QACV,CAAC,sBAAsB,KAAK,KAAK,KACjC,CAAC,QAAQ,KAAK,KAAK,KACnB,CAAC,MAAM,KAAK,KAAK,KACjB,CAAC,gDAAgD,KAAK,KAAK,GAC7D,EAAE,OAAO,yCAAyC,CACpD,CACF;AAEA,IAAa,WAAb,cAA8B,OAAO,MAAgB,iBAAiB,CAAC,CACrE,OAAO,OAAO;CACZ,OAAO,YAAY,MAAM,OAAO,oBAAoB,IAAI,CAAC;CACzD,QAAQ,YAAY,MAAM,OAAO,oBAAoB,IAAI,CAAC;AAC5D,CAAC,CAAC,CAAC,MACD,OAAO,YAAY,MAAM,EAAE,QAAQ,EAAE,UAAU,SAAW,EACxD,OAAO,oCACT,CAAC,CACH,CACF,CAAC,CAAC,CAAC;;AAIH,IAAa,SAAb,cAA4B,OAAO,MAAc,eAAe,CAAC,CAAC;CAChE,YAAY,OAAO;CACnB,QAAQ;CACR,SAAS;AACX,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,WAAb,cAA8B,OAAO,MAAgB,iBAAiB,CAAC,CAAC;CACtE,QAAQ;CACR,UAAU;CACV,KAAK,OAAO,OAAO,MAAM,OAAO,YAAY,IAAI,CAAC;CACjD,OAAO,OAAO,OAAO,MAAM,OAAO,YAAY,GAAG,CAAC;CAClD,UAAU,OAAO;AACnB,CAAC,CAAC,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":[],"sources":["../src/BrowserData.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { BrowserError } from \"./Errors.ts\";\n\nexport const Identifier = Schema.NonEmptyString.check(\n Schema.isMaxLength(256),\n Schema.isPattern(/^[A-Za-z0-9_-]+$/),\n);\n\nexport const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** Portable basename only; never a local or remote filesystem path. */\nexport const SafeFilename = Schema.NonEmptyString.check(\n Schema.isMaxLength(240),\n Schema.makeFilter(\n (value) =>\n value !== \".\" &&\n value !== \"..\" &&\n // oxlint-disable-next-line eslint/no-control-regex -- control characters are what it rejects\n !/[\\x00-\\x1f\\x7f/\\\\:]/.test(value) &&\n !/[. ]$/.test(value) &&\n !/^\\s/.test(value) &&\n !/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\.|$)/i.test(value),\n { title: \"a portable, non-path download filename\" },\n ),\n);\n\nexport class Viewport extends Schema.Class<Viewport>(\"BrowserViewport\")(\n Schema.Struct({\n width: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n height: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n }).check(\n Schema.makeFilter((v) => v.width * v.height <= 8_388_608, {\n title: \"at most 8,388,608 viewport pixels\",\n }),\n ),\n) {}\n\n/** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */\n\nexport class Target extends Schema.Class<Target>(\"BrowserTarget\")({\n generation: Schema.Natural,\n pageId: Identifier,\n frameId: Identifier,\n}) {}\n\nexport class PageInfo extends Schema.Class<PageInfo>(\"BrowserPageInfo\")({\n pageId: Identifier,\n targetId: Identifier,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n title: Schema.String.check(Schema.isMaxLength(512)),\n selected: Schema.Boolean,\n}) {}\n\nexport class FrameInfo extends Schema.Class<FrameInfo>(\"BrowserFrameInfo\")({\n frameId: Identifier,\n parentFrameId: Schema.NullOr(Identifier),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n name: Schema.String.check(Schema.isMaxLength(256)),\n}) {}\n\nexport const SessionPhase = Schema.Literals([\n \"acquiring\",\n \"open\",\n \"paused\",\n \"detached\",\n \"faulted\",\n \"uncertain\",\n \"closing\",\n \"closed\",\n]);\n\nexport type SessionPhase = typeof SessionPhase.Type;\n\nexport const SessionReason = Schema.Literals([\n \"expired\",\n \"callback-failure\",\n \"registration-failure\",\n \"native-failure\",\n \"disconnected\",\n \"popup-policy\",\n \"dialog-policy\",\n \"popup-overflow\",\n \"dialog-overflow\",\n \"cleanup-capacity\",\n \"handoff\",\n \"detached\",\n \"closed\",\n]);\n\nexport type SessionReason = typeof SessionReason.Type;\n\nconst DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));\n\n/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */\nexport class SessionStatus extends Schema.Class<SessionStatus>(\"BrowserSessionStatus\")({\n phase: SessionPhase,\n reason: Schema.NullOr(SessionReason),\n generation: DiagnosticCounter,\n busy: Schema.Boolean,\n unresolvedDispatch: Schema.Boolean,\n}) {}\n\n/** Bounded host facts only: no target identity, page content, native exception or consumer cause. */\nexport class BrowserDiagnostic extends Schema.Class<BrowserDiagnostic>(\"BrowserDiagnostic\")({\n reason: SessionReason,\n disposition: Schema.Literals([\"pending\", \"confirmed\", \"not-dispatched\", \"unknown\"]),\n generation: DiagnosticCounter,\n monotonicNanos: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n)),\n}) {}\n\nexport class BrowserDiagnostics extends Schema.Class<BrowserDiagnostics>(\"BrowserDiagnostics\")({\n records: Schema.Array(BrowserDiagnostic).check(Schema.isMaxLength(32)),\n total: DiagnosticCounter,\n dropped: DiagnosticCounter,\n truncated: Schema.Boolean,\n}) {}\n\nexport class ObservedControl extends Schema.Class<ObservedControl>(\"BrowserObservedControl\")({\n elementId: Identifier,\n kind: Schema.Literals([\"link\", \"button\", \"input\", \"select\", \"textarea\", \"other\"]),\n label: Schema.String.check(Schema.isMaxLength(256)),\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n required: Schema.optionalKey(Schema.Boolean),\n /** Native select state. A select is never represented by one `selected` boolean. */\n multiple: Schema.optionalKey(Schema.Boolean),\n /** The issued select this native option belongs to, in the same observation. */\n selectElementId: Schema.optionalKey(Identifier),\n /** Some choices could not be issued within this reading's shared control/value bounds. */\n optionsTruncated: Schema.optionalKey(Schema.Boolean),\n}) {}\n\n/**\n * How a viewport reading was bounded and what it left out. These are counts, so they are safe\n * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is\n * kept when its line boxes intersect the viewport and the browser finds its own element at a\n * sampled point. Something that takes no pointer events is invisible to that test, so the\n * browser is asked what is on top there with pointer events ignored: a box that paints at the\n * point covers the text, and one that paints nothing there, such as an empty full-screen\n * container, does not. Text that could not be settled that way is left out as uncertain.\n */\nexport class ViewportEvidence extends Schema.Class<ViewportEvidence>(\"BrowserViewportEvidence\")({\n width: Schema.Finite,\n height: Schema.Finite,\n /** Text that crossed a viewport edge; only its lines on screen were kept. */\n clippedText: Schema.Natural,\n /** Left out: another element is on top at the sampled point, or a box there paints over it. */\n coveredText: Schema.Natural,\n /**\n * Left out: something that takes no pointer events lies over it and the browser's own hit test\n * could not settle whether it paints there, for example beneath another such box, in a child\n * frame, or after too many such points in one reading.\n */\n uncertainText: Schema.Natural,\n /** Controls that intersect the viewport but cannot be reached there. */\n unreachableControls: Schema.Natural,\n /** The traversal budget ran out first, so this reading is known to be incomplete. */\n exhausted: Schema.Boolean,\n}) {}\n\n/**\n * Case-insensitive text a reading keeps. It is applied inside the page before any limit, so\n * matching controls are not crowded out by earlier ones. It filters what is read; it never\n * searches for, re-finds or substitutes a node.\n */\nexport const ReadingMatch = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(256),\n Schema.makeFilter((value) => value.trim().length > 0, { title: \"not only whitespace\" }),\n);\n\n/**\n * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A\n * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its\n * native selects. Those choices are not a claim that a closed dropdown's rows were visible.\n * A `document` reading is the whole body, wherever it is. A reading with `match` keeps only\n * matching text lines and controls, so what it leaves out is not evidence of absence. Nothing\n * here carries a destination, a form or a field value.\n */\nexport class Observation extends Schema.Class<Observation>(\"BrowserObservation\")({\n target: Target,\n observationId: Identifier,\n revision: Schema.Natural,\n scope: Schema.Literals([\"document\", \"viewport\"]),\n match: Schema.optionalKey(ReadingMatch),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n textTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n}) {}\n\nexport class ObservedElement extends Schema.Class<ObservedElement>(\"BrowserObservedElement\")({\n observationId: Identifier,\n elementId: Identifier,\n}) {}\n\n/** Observe a condition of this exact node. A replacement never satisfies the reference. */\nexport class WaitForElementRequest extends Schema.Class<WaitForElementRequest>(\n \"BrowserWaitForElementRequest\",\n)({\n reference: ObservedElement,\n state: Schema.Literals([\"visible\", \"hidden\", \"enabled\", \"disabled\"]),\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n}) {}\n\n/** Issued option element IDs from one observed native select; never values, labels or indices. */\nexport const SelectOptions = Schema.Array(Identifier).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(64),\n Schema.makeFilter((ids) => new Set(ids).size === ids.length),\n);\n\nexport type SelectOptions = typeof SelectOptions.Type;\n\n/** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */\nexport class PageSuspension extends Schema.Class<PageSuspension>(\"BrowserPageSuspension\")({\n pageId: Identifier,\n targetId: Identifier,\n suspensionId: Identifier,\n}) {}\n\nexport class PageExecutionState extends Schema.Class<PageExecutionState>(\n \"BrowserPageExecutionState\",\n)({\n pageId: Identifier,\n targetId: Identifier,\n state: Schema.Literals([\"running\", \"suspended\", \"unknown\"]),\n suspensionId: Schema.optionalKey(Identifier),\n}) {}\n\n/** Explicit opt-out: this integration does not claim whole-browser network containment. */\nexport class BrowserPolicy extends Schema.Class<BrowserPolicy>(\"BrowserBrowserPolicy\")({\n network: Schema.TaggedStruct(\"Unrestricted\", {}),\n maxActions: PositiveInt.check(Schema.isLessThanOrEqualTo(1000)),\n maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(21_600_000)),\n maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8 * 1024 * 1024)),\n}) {\n /**\n * Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.\n * The network choice is spelled out in the name because this runtime cannot prove a\n * narrower one; override any bound, never the network.\n */\n static unrestricted(\n bounds: Partial<\n Pick<BrowserPolicy, \"maxActions\" | \"maxElapsedMillis\" | \"maxReturnedBytes\">\n > = {},\n ): BrowserPolicy {\n return BrowserPolicy.make({\n network: { _tag: \"Unrestricted\" },\n maxActions: bounds.maxActions ?? 100,\n maxElapsedMillis: bounds.maxElapsedMillis ?? 5 * 60_000,\n maxReturnedBytes: bounds.maxReturnedBytes ?? 2 * 1024 * 1024,\n });\n }\n}\n\nexport const TargetUrl = Schema.NonEmptyString.check(\n Schema.isMaxLength(8192),\n Schema.makeFilter((value) => {\n try {\n const url = new URL(value);\n\n return (\n [\"http:\", \"https:\"].includes(url.protocol) &&\n url.hostname !== \"\" &&\n !url.username &&\n !url.password\n );\n } catch {\n return false;\n }\n }),\n);\n\nexport const Selector = Schema.NonEmptyString.check(Schema.isMaxLength(1024));\n\nexport class NavigateRequest extends Schema.Class<NavigateRequest>(\"BrowserNavigateRequest\")({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\n/**\n * A navigation left in flight. `timeoutMillis` is how long the browser may take to reach\n * DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.\n */\nexport class StartNavigationRequest extends Schema.Class<StartNavigationRequest>(\n \"BrowserStartNavigationRequest\",\n)({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\nexport class ReadTextRequest extends Schema.Class<ReadTextRequest>(\"BrowserReadTextRequest\")({\n selector: Schema.optionalKey(Selector),\n}) {}\n\nexport class ClickRequest extends Schema.Class<ClickRequest>(\"BrowserClickRequest\")({\n selector: Selector,\n}) {}\n\nexport class FillRequest extends Schema.Class<FillRequest>(\"BrowserFillRequest\")({\n selector: Selector,\n value: Schema.String.check(Schema.isMaxLength(65536)),\n}) {}\n\n/**\n * One observed control and the one state a form gives it: replacement text, the checked state a\n * checkbox, radio or switch should end in (it is clicked only when it differs, and a native radio\n * is never asked to clear itself), or issued option IDs of a native select from the same\n * observation.\n */\nexport const FormField = Schema.Struct({\n elementId: Identifier,\n value: Schema.optionalKey(FillRequest.fields.value),\n checked: Schema.optionalKey(Schema.Boolean),\n options: Schema.optionalKey(SelectOptions),\n}).check(\n Schema.makeFilter(\n (field) =>\n Number(field.value !== undefined) +\n Number(field.checked !== undefined) +\n Number(field.options !== undefined) ===\n 1,\n { title: \"exactly one of value, checked or options\" },\n ),\n);\n\nexport type FormField = typeof FormField.Type;\n\n/** At most 32 distinct fields, and a submit control that is not one of them. */\nexport class FillFormRequest extends Schema.Class<FillFormRequest>(\"BrowserFillFormRequest\")(\n Schema.Struct({\n observationId: Identifier,\n fields: Schema.Array(FormField).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(32),\n Schema.makeFilter(\n (fields) => new Set(fields.map((field) => field.elementId)).size === fields.length,\n { title: \"each field at most once\" },\n ),\n ),\n submit: Schema.optionalKey(Identifier),\n }).check(\n Schema.makeFilter(\n (request) =>\n request.submit === undefined ||\n !request.fields.some((field) => field.elementId === request.submit),\n { title: \"a submit control that is not also a field\" },\n ),\n ),\n) {}\n\n/**\n * Host choices about how a form proceeds. `verify` (default true) re-reads every field before\n * submit and stops when one no longer holds what its own step left there. `settleMillis`\n * (default 50, at most 5000; 0 skips it) is how long each dispatched step lets the page's own\n * handlers run, after at least two rendered frames, before its result is read back.\n */\nexport const FillFormOptions = Schema.Struct({\n verify: Schema.optionalKey(Schema.Boolean),\n settleMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 5000 })),\n ),\n});\n\nexport type FillFormOptions = typeof FillFormOptions.Type;\n\n/** `set` dispatched input; `unchanged` needed none, because a toggle already held its state. */\nexport class FormFieldResult extends Schema.Class<FormFieldResult>(\"BrowserFormFieldResult\")({\n elementId: Identifier,\n status: Schema.Literals([\"set\", \"unchanged\"]),\n}) {}\n\n/**\n * Where a form stopped and why. `error.outcome` says whether this step itself was dispatched;\n * nothing after it was. `elementId` names the control it stopped at, when there is one: a\n * verification that could not read the form at all names none.\n */\nexport class FormStop extends Schema.Class<FormStop>(\"BrowserFormStop\")({\n stage: Schema.Literals([\"field\", \"verify\", \"submit\"]),\n elementId: Schema.optionalKey(Identifier),\n error: BrowserError,\n}) {}\n\n/**\n * What a form did, in order. `stopped` is present when it did not finish: the fields before it\n * stay set, because a form is not a transaction. `submitted` is true only when the submit click\n * completed; a stop at `submit` with an `unknown` outcome may have sent it.\n */\nexport class FillFormResult extends Schema.Class<FillFormResult>(\"BrowserFillFormResult\")({\n fields: Schema.Array(FormFieldResult).check(Schema.isMaxLength(32)),\n submitted: Schema.Boolean,\n url: TargetUrl,\n stopped: Schema.optionalKey(FormStop),\n}) {}\n\nexport class ScrollRequest extends Schema.Class<ScrollRequest>(\"BrowserScrollRequest\")({\n deltaX: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n deltaY: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n}) {}\n\n/**\n * CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It\n * is not a document offset, a device pixel, or a coordinate inside a child frame.\n */\nexport class ViewportPoint extends Schema.Class<ViewportPoint>(\"BrowserViewportPoint\")({\n x: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n y: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n}) {}\n\n/** A box in the viewport of the frame it was read from, in CSS pixels. */\nexport class ViewportRect extends Schema.Class<ViewportRect>(\"BrowserViewportRect\")({\n x: Schema.Finite,\n y: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n}) {}\n\n/**\n * What a host needs to decide whether a control may be acted on. Host-only: a destination can\n * carry a token, so none of this is part of the model-facing `Observation`. It never includes a\n * field's value or any markup.\n */\nexport class ControlFacts extends Schema.Class<ControlFacts>(\"BrowserControlFacts\")({\n kind: ObservedControl.fields.kind,\n label: ObservedControl.fields.label,\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n required: Schema.optionalKey(Schema.Boolean),\n multiple: Schema.optionalKey(Schema.Boolean),\n editable: Schema.Boolean,\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n autocomplete: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n /** A resolved link target, or where this control submits its form. Absent when over-long. */\n destination: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(2048))),\n formMethod: Schema.optionalKey(Schema.Literals([\"get\", \"post\", \"dialog\"])),\n box: ViewportRect,\n placement: Schema.Literals([\"inside\", \"partial\", \"outside\"]),\n /** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */\n hitTest: Schema.Literals([\"self\", \"covered\", \"uncertain\", \"unsampled\"]),\n /** Only then is `box` in the main frame's viewport, the space pointer input uses. */\n mainFrame: Schema.Boolean,\n}) {}\n\n/**\n * Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues\n * no element references and never replaces the observation an agent's tools act on, so\n * inspecting, checkpointing and then acting on the inspected node all compose.\n *\n * It is host-only, because it carries control facts. Text and picture are read one after the\n * other, never atomically: the interval says when, and `documentChanged` says the document was\n * replaced in between, so the two may describe different documents.\n */\nexport class Checkpoint extends Schema.Class<Checkpoint>(\"BrowserCheckpoint\")({\n target: Target,\n revision: Schema.Natural,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n textTruncated: Schema.Boolean,\n controls: Schema.Array(ControlFacts).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n picture: Schema.optionalKey(\n Schema.Struct({ mediaType: Schema.Literal(\"image/png\"), bytes: Schema.Uint8Array }),\n ),\n documentChanged: Schema.Boolean,\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\nconst ReadingBounds = {\n maxTextBytes: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 131072 })),\n ),\n maxControls: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 64 }))),\n};\n\n/** Omitted bounds default at admission; `scope` defaults to the whole document. */\nexport const ObservationOptions = Schema.Struct({\n scope: Schema.optionalKey(Schema.Literals([\"document\", \"viewport\"])),\n match: Schema.optionalKey(ReadingMatch),\n ...ReadingBounds,\n});\n\nexport type ObservationOptions = typeof ObservationOptions.Type;\n\n/** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */\nexport const CheckpointOptions = Schema.Struct({\n ...ReadingBounds,\n picture: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type CheckpointOptions = typeof CheckpointOptions.Type;\n\n/** One native pointer move. Easing and pacing are the caller's: send the points you want. */\nexport class PointerMoveRequest extends Schema.Class<PointerMoveRequest>(\n \"BrowserPointerMoveRequest\",\n)({ to: ViewportPoint }) {}\n\n/** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */\nexport class HoverRequest extends Schema.Class<HoverRequest>(\"BrowserHoverRequest\")({\n selector: Selector,\n}) {}\n\nconst WheelDelta = Schema.Finite.check(Schema.isBetween({ minimum: -100000, maximum: 100000 }));\n\n/**\n * One native wheel event where the pointer is, or at `at` after moving there first. The browser\n * chooses what scrolls, exactly as it would for a person, so a nested scroll container under\n * the pointer scrolls instead of the page.\n */\nexport class WheelRequest extends Schema.Class<WheelRequest>(\"BrowserWheelRequest\")({\n deltaX: WheelDelta,\n deltaY: WheelDelta,\n at: Schema.optionalKey(ViewportPoint),\n}) {}\n\n/**\n * The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is\n * closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.\n */\nexport const NamedKey = Schema.Literals([\n \"Enter\",\n \"Tab\",\n \"Backspace\",\n \"Delete\",\n \"Escape\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"PageUp\",\n \"PageDown\",\n]);\n\nexport type NamedKey = typeof NamedKey.Type;\n\n/** One printable ASCII character, space included: every one is a key on the US layout. */\nconst PrintableKey = Schema.String.check(Schema.isPattern(/^[\\x20-\\x7e]$/));\n\nexport const KeyModifier = Schema.Literals([\"Shift\", \"Control\", \"Alt\", \"Meta\"]);\n\nexport type KeyModifier = typeof KeyModifier.Type;\n\n/** One key, down then up, with any modifiers held around it. */\nexport const KeyStroke = Schema.Struct({\n key: Schema.Union([NamedKey, PrintableKey]),\n modifiers: Schema.optionalKey(\n Schema.Array(KeyModifier).check(\n Schema.makeFilter((held) => new Set(held).size === held.length, {\n title: \"each modifier at most once\",\n }),\n ),\n ),\n});\n\nexport type KeyStroke = typeof KeyStroke.Type;\n\n/**\n * One real key stroke. It goes to whatever has focus in the page, exactly as it would for a\n * person, unless `into` names the one element that must already have it. It never focuses that\n * element, because that would hide a scripted focus inside a native-input operation: click it\n * first.\n */\nexport class PressRequest extends Schema.Class<PressRequest>(\"BrowserPressRequest\")({\n ...KeyStroke.fields,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/** Counted in characters, not UTF-16 units, because that is how many strokes it costs. */\nconst TypedText = Schema.NonEmptyString.check(\n Schema.makeFilter((text) => [...text].length <= 256, { title: \"at most 256 characters\" }),\n Schema.makeFilter(\n (text) =>\n [...text].every((character) => {\n const point = character.codePointAt(0) ?? 0;\n\n // An unpaired surrogate is not a character, and would not survive the wire as one.\n return point > 0x1f && point !== 0x7f && (point < 0xd800 || point > 0xdfff);\n }),\n { title: \"no control characters or unpaired surrogates\" },\n ),\n);\n\n/**\n * Text as the real key strokes that produce it, two native commands for each character, one\n * after another under a single action timeout: send a long passage as several shorter runs.\n * A character the US layout cannot produce is inserted as text, as an input method commits it,\n * and raises no key events. Control characters are refused, so a line break can never press\n * Enter from inside a run of text: a named key is always its own `press`. `into` works as it\n * does for `PressRequest`: a guard on where the text lands, never a focus.\n */\nexport class TypeRequest extends Schema.Class<TypeRequest>(\"BrowserTypeRequest\")({\n text: TypedText,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/**\n * What native input was dispatched, where and when. `position` is the point this owner\n * commanded, or null when it has not yet placed the pointer on this page. The interval is on\n * the host monotonic clock that stamps `CapturedFrame.receivedMonotonicNanos`, so input and\n * pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not\n * claim the page finished scrolling, or that any frame shows it. A receipt never says which\n * key was pressed or what was typed.\n */\nexport class InputReceipt extends Schema.Class<InputReceipt>(\"BrowserInputReceipt\")({\n target: Target,\n kind: Schema.Literals([\"pointer-move\", \"hover\", \"wheel\", \"press\", \"type\"]),\n position: Schema.NullOr(ViewportPoint),\n delta: Schema.optionalKey(Schema.Struct({ x: WheelDelta, y: WheelDelta })),\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\nexport class ScreenshotRequest extends Schema.Class<ScreenshotRequest>(\"BrowserScreenshotRequest\")({\n fullPage: Schema.Boolean,\n}) {}\n\nexport class NavigationResult extends Schema.Class<NavigationResult>(\"BrowserNavigationResult\")({\n url: TargetUrl,\n}) {}\n\nexport class ActionResult extends Schema.Class<ActionResult>(\"BrowserActionResult\")({\n url: TargetUrl,\n}) {}\n\nexport class TextResult extends Schema.Class<TextResult>(\"BrowserTextResult\")({\n text: Schema.String.check(Schema.isMaxLength(8 * 1024 * 1024)),\n}) {}\n\nexport class ScreenshotResult extends Schema.Class<ScreenshotResult>(\"BrowserScreenshotResult\")({\n mediaType: Schema.Literal(\"image/png\"),\n bytes: Schema.Uint8Array,\n}) {}\n\nconst FileMediaType = Schema.NonEmptyString.check(\n Schema.isMaxLength(128),\n Schema.isPattern(/^[a-z0-9][a-z0-9!#$&^_+.-]*\\/[a-z0-9][a-z0-9!#$&^_+.-]*$/),\n);\n\n/** Small selection is in-memory by design: bytes the caller already holds, never a path. */\nexport class InlineFile extends Schema.Class<InlineFile>(\"BrowserInlineFile\")({\n name: SafeFilename,\n mediaType: FileMediaType,\n bytes: Schema.Uint8Array.check(\n Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1024 * 1024, {\n title: \"between one byte and one mebibyte\",\n }),\n ),\n}) {}\n\nexport const InlineFiles = Schema.Array(InlineFile).check(\n Schema.isMaxLength(8),\n Schema.makeFilter(\n (files) =>\n files.length > 0 &&\n files.reduce((total, file) => total + file.bytes.byteLength, 0) <= 4 * 1024 * 1024,\n { title: \"at most four mebibytes of in-memory selection\" },\n ),\n);\n\nexport const AutomationOptions = Schema.Struct({\n actionTimeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n /** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */\n maxHostReads: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1_000_000 })),\n ),\n maxPages: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 32 }))),\n initialPage: Schema.optionalKey(\n Schema.Union([\n Schema.Struct({ targetId: Identifier }),\n Schema.Struct({ newPage: Schema.Literal(true) }),\n ]),\n ),\n popupPolicy: Schema.optionalKey(Schema.Literals([\"retain\", \"close\", \"pause\"])),\n dialogPolicy: Schema.optionalKey(Schema.Literals([\"dismiss\", \"pause\"])),\n pageControl: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type AutomationOptions = typeof AutomationOptions.Type;\n"],"mappings":";;;AAIA,MAAa,aAAa,OAAO,eAAe,MAC9C,OAAO,YAAY,GAAG,GACtB,OAAO,UAAU,kBAAkB,CACrC;AAEA,MAAa,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;AAGnE,MAAa,eAAe,OAAO,eAAe,MAChD,OAAO,YAAY,GAAG,GACtB,OAAO,YACJ,UACC,UAAU,OACV,UAAU,QAEV,CAAC,sBAAsB,KAAK,KAAK,KACjC,CAAC,QAAQ,KAAK,KAAK,KACnB,CAAC,MAAM,KAAK,KAAK,KACjB,CAAC,gDAAgD,KAAK,KAAK,GAC7D,EAAE,OAAO,yCAAyC,CACpD,CACF;AAEA,IAAa,WAAb,cAA8B,OAAO,MAAgB,iBAAiB,CAAC,CACrE,OAAO,OAAO;CACZ,OAAO,YAAY,MAAM,OAAO,oBAAoB,IAAI,CAAC;CACzD,QAAQ,YAAY,MAAM,OAAO,oBAAoB,IAAI,CAAC;AAC5D,CAAC,CAAC,CAAC,MACD,OAAO,YAAY,MAAM,EAAE,QAAQ,EAAE,UAAU,SAAW,EACxD,OAAO,oCACT,CAAC,CACH,CACF,CAAC,CAAC,CAAC;;AAIH,IAAa,SAAb,cAA4B,OAAO,MAAc,eAAe,CAAC,CAAC;CAChE,YAAY,OAAO;CACnB,QAAQ;CACR,SAAS;AACX,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,WAAb,cAA8B,OAAO,MAAgB,iBAAiB,CAAC,CAAC;CACtE,QAAQ;CACR,UAAU;CACV,KAAK,OAAO,OAAO,MAAM,OAAO,YAAY,IAAI,CAAC;CACjD,OA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