effect-browser 0.0.0-reserved.0 → 0.2.0-beta.0
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.
- package/LICENSE +21 -0
- package/README.md +664 -3
- package/dist/Association-zlgInoaj.mjs +134 -0
- package/dist/Association-zlgInoaj.mjs.map +1 -0
- package/dist/Bootstrap-B9UUXsvF.d.mts +183 -0
- package/dist/Bootstrap-Be-2Ddmh.mjs +187 -0
- package/dist/Bootstrap-Be-2Ddmh.mjs.map +1 -0
- package/dist/Bootstrap.d.mts +3 -0
- package/dist/Bootstrap.mjs +2 -0
- package/dist/Browser.d.mts +177 -0
- package/dist/Browser.mjs +14 -0
- package/dist/Browser.mjs.map +1 -0
- package/dist/BrowserData-DJAnUHoZ.d.mts +412 -0
- package/dist/BrowserData.d.mts +3 -0
- package/dist/BrowserData.mjs +494 -0
- package/dist/BrowserData.mjs.map +1 -0
- package/dist/BrowserRuntime-fZz1b0VI.mjs +5169 -0
- package/dist/BrowserRuntime-fZz1b0VI.mjs.map +1 -0
- package/dist/BrowserRuntime.d.mts +139 -0
- package/dist/BrowserRuntime.mjs +2 -0
- package/dist/Capture.d.mts +40 -0
- package/dist/Capture.mjs +476 -0
- package/dist/Capture.mjs.map +1 -0
- package/dist/CaptureData-AmqVP_Ba.mjs +162 -0
- package/dist/CaptureData-AmqVP_Ba.mjs.map +1 -0
- package/dist/CaptureData.d.mts +148 -0
- package/dist/CaptureData.mjs +2 -0
- package/dist/Chromium.d.mts +84 -0
- package/dist/Chromium.mjs +381 -0
- package/dist/Chromium.mjs.map +1 -0
- package/dist/Errors.d.mts +106 -0
- package/dist/Errors.mjs +155 -0
- package/dist/Errors.mjs.map +1 -0
- package/dist/PageControl.d.mts +15 -0
- package/dist/PageControl.mjs +28 -0
- package/dist/PageControl.mjs.map +1 -0
- package/dist/PageControlAssociation-DabEg5AR.mjs +10 -0
- package/dist/PageControlAssociation-DabEg5AR.mjs.map +1 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +9 -0
- package/package.json +67 -5
|
@@ -0,0 +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 };
|
|
3
|
+
export {};
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
//#region src/BrowserData.ts
|
|
3
|
+
const Identifier = Schema.NonEmptyString.check(Schema.isMaxLength(256), Schema.isPattern(/^[A-Za-z0-9_-]+$/));
|
|
4
|
+
const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));
|
|
5
|
+
/** Portable basename only; never a local or remote filesystem path. */
|
|
6
|
+
const SafeFilename = Schema.NonEmptyString.check(Schema.isMaxLength(240), Schema.makeFilter((value) => value !== "." && value !== ".." && !/[\x00-\x1f\x7f/\\:]/.test(value) && !/[. ]$/.test(value) && !/^\s/.test(value) && !/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(value), { title: "a portable, non-path download filename" }));
|
|
7
|
+
var Viewport = class extends Schema.Class("BrowserViewport")(Schema.Struct({
|
|
8
|
+
width: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),
|
|
9
|
+
height: PositiveInt.check(Schema.isLessThanOrEqualTo(4096))
|
|
10
|
+
}).check(Schema.makeFilter((v) => v.width * v.height <= 8388608, { title: "at most 8,388,608 viewport pixels" }))) {};
|
|
11
|
+
/** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */
|
|
12
|
+
var Target = class extends Schema.Class("BrowserTarget")({
|
|
13
|
+
generation: Schema.Natural,
|
|
14
|
+
pageId: Identifier,
|
|
15
|
+
frameId: Identifier
|
|
16
|
+
}) {};
|
|
17
|
+
var PageInfo = class extends Schema.Class("BrowserPageInfo")({
|
|
18
|
+
pageId: Identifier,
|
|
19
|
+
targetId: Identifier,
|
|
20
|
+
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
21
|
+
title: Schema.String.check(Schema.isMaxLength(512)),
|
|
22
|
+
selected: Schema.Boolean
|
|
23
|
+
}) {};
|
|
24
|
+
var FrameInfo = class extends Schema.Class("BrowserFrameInfo")({
|
|
25
|
+
frameId: Identifier,
|
|
26
|
+
parentFrameId: Schema.NullOr(Identifier),
|
|
27
|
+
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
28
|
+
name: Schema.String.check(Schema.isMaxLength(256))
|
|
29
|
+
}) {};
|
|
30
|
+
const SessionPhase = Schema.Literals([
|
|
31
|
+
"acquiring",
|
|
32
|
+
"open",
|
|
33
|
+
"paused",
|
|
34
|
+
"detached",
|
|
35
|
+
"faulted",
|
|
36
|
+
"uncertain",
|
|
37
|
+
"closing",
|
|
38
|
+
"closed"
|
|
39
|
+
]);
|
|
40
|
+
const SessionReason = Schema.Literals([
|
|
41
|
+
"expired",
|
|
42
|
+
"callback-failure",
|
|
43
|
+
"registration-failure",
|
|
44
|
+
"native-failure",
|
|
45
|
+
"disconnected",
|
|
46
|
+
"popup-policy",
|
|
47
|
+
"dialog-policy",
|
|
48
|
+
"popup-overflow",
|
|
49
|
+
"dialog-overflow",
|
|
50
|
+
"cleanup-capacity",
|
|
51
|
+
"handoff",
|
|
52
|
+
"detached",
|
|
53
|
+
"closed"
|
|
54
|
+
]);
|
|
55
|
+
const DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
56
|
+
/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */
|
|
57
|
+
var SessionStatus = class extends Schema.Class("BrowserSessionStatus")({
|
|
58
|
+
phase: SessionPhase,
|
|
59
|
+
reason: Schema.NullOr(SessionReason),
|
|
60
|
+
generation: DiagnosticCounter,
|
|
61
|
+
busy: Schema.Boolean,
|
|
62
|
+
unresolvedDispatch: Schema.Boolean
|
|
63
|
+
}) {};
|
|
64
|
+
/** Bounded host facts only: no target identity, page content, native exception or consumer cause. */
|
|
65
|
+
var BrowserDiagnostic = class extends Schema.Class("BrowserDiagnostic")({
|
|
66
|
+
reason: SessionReason,
|
|
67
|
+
disposition: Schema.Literals([
|
|
68
|
+
"pending",
|
|
69
|
+
"confirmed",
|
|
70
|
+
"not-dispatched",
|
|
71
|
+
"unknown"
|
|
72
|
+
]),
|
|
73
|
+
generation: DiagnosticCounter,
|
|
74
|
+
monotonicNanos: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n))
|
|
75
|
+
}) {};
|
|
76
|
+
var BrowserDiagnostics = class extends Schema.Class("BrowserDiagnostics")({
|
|
77
|
+
records: Schema.Array(BrowserDiagnostic).check(Schema.isMaxLength(32)),
|
|
78
|
+
total: DiagnosticCounter,
|
|
79
|
+
dropped: DiagnosticCounter,
|
|
80
|
+
truncated: Schema.Boolean
|
|
81
|
+
}) {};
|
|
82
|
+
var ObservedControl = class extends Schema.Class("BrowserObservedControl")({
|
|
83
|
+
elementId: Identifier,
|
|
84
|
+
kind: Schema.Literals([
|
|
85
|
+
"link",
|
|
86
|
+
"button",
|
|
87
|
+
"input",
|
|
88
|
+
"select",
|
|
89
|
+
"textarea",
|
|
90
|
+
"other"
|
|
91
|
+
]),
|
|
92
|
+
label: Schema.String.check(Schema.isMaxLength(256)),
|
|
93
|
+
disabled: Schema.Boolean,
|
|
94
|
+
checked: Schema.optionalKey(Schema.Boolean),
|
|
95
|
+
selected: Schema.optionalKey(Schema.Boolean),
|
|
96
|
+
inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),
|
|
97
|
+
required: Schema.optionalKey(Schema.Boolean),
|
|
98
|
+
/** Native select state. A select is never represented by one `selected` boolean. */
|
|
99
|
+
multiple: Schema.optionalKey(Schema.Boolean),
|
|
100
|
+
/** The issued select this native option belongs to, in the same observation. */
|
|
101
|
+
selectElementId: Schema.optionalKey(Identifier),
|
|
102
|
+
/** Some choices could not be issued within this reading's shared control/value bounds. */
|
|
103
|
+
optionsTruncated: Schema.optionalKey(Schema.Boolean)
|
|
104
|
+
}) {};
|
|
105
|
+
/**
|
|
106
|
+
* How a viewport reading was bounded and what it left out. These are counts, so they are safe
|
|
107
|
+
* to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is
|
|
108
|
+
* 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.
|
|
111
|
+
*/
|
|
112
|
+
var ViewportEvidence = class extends Schema.Class("BrowserViewportEvidence")({
|
|
113
|
+
width: Schema.Finite,
|
|
114
|
+
height: Schema.Finite,
|
|
115
|
+
/** Text that crossed a viewport edge; only its lines on screen were kept. */
|
|
116
|
+
clippedText: Schema.Natural,
|
|
117
|
+
/** Left out: the browser found another element at the sampled point. */
|
|
118
|
+
coveredText: Schema.Natural,
|
|
119
|
+
uncertainText: Schema.Natural,
|
|
120
|
+
/** Controls that intersect the viewport but cannot be reached there. */
|
|
121
|
+
unreachableControls: Schema.Natural,
|
|
122
|
+
/** The traversal budget ran out first, so this reading is known to be incomplete. */
|
|
123
|
+
exhausted: Schema.Boolean
|
|
124
|
+
}) {};
|
|
125
|
+
/**
|
|
126
|
+
* Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A
|
|
127
|
+
* `viewport` reading holds what is on screen and reachable, plus the bounded choices of its
|
|
128
|
+
* 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.
|
|
131
|
+
*/
|
|
132
|
+
var Observation = class extends Schema.Class("BrowserObservation")({
|
|
133
|
+
target: Target,
|
|
134
|
+
observationId: Identifier,
|
|
135
|
+
revision: Schema.Natural,
|
|
136
|
+
scope: Schema.Literals(["document", "viewport"]),
|
|
137
|
+
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
138
|
+
text: Schema.String.check(Schema.isMaxLength(131072)),
|
|
139
|
+
controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),
|
|
140
|
+
controlsTruncated: Schema.Boolean,
|
|
141
|
+
textTruncated: Schema.Boolean,
|
|
142
|
+
viewport: ViewportEvidence
|
|
143
|
+
}) {};
|
|
144
|
+
var ObservedElement = class extends Schema.Class("BrowserObservedElement")({
|
|
145
|
+
observationId: Identifier,
|
|
146
|
+
elementId: Identifier
|
|
147
|
+
}) {};
|
|
148
|
+
/** Observe a condition of this exact node. A replacement never satisfies the reference. */
|
|
149
|
+
var WaitForElementRequest = class extends Schema.Class("BrowserWaitForElementRequest")({
|
|
150
|
+
reference: ObservedElement,
|
|
151
|
+
state: Schema.Literals([
|
|
152
|
+
"visible",
|
|
153
|
+
"hidden",
|
|
154
|
+
"enabled",
|
|
155
|
+
"disabled"
|
|
156
|
+
]),
|
|
157
|
+
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
158
|
+
minimum: 1,
|
|
159
|
+
maximum: 6e4
|
|
160
|
+
})))
|
|
161
|
+
}) {};
|
|
162
|
+
/** Issued option element IDs from one observed native select; never values, labels or indices. */
|
|
163
|
+
const SelectOptions = Schema.Array(Identifier).check(Schema.isMinLength(1), Schema.isMaxLength(64), Schema.makeFilter((ids) => new Set(ids).size === ids.length));
|
|
164
|
+
/** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */
|
|
165
|
+
var PageSuspension = class extends Schema.Class("BrowserPageSuspension")({
|
|
166
|
+
pageId: Identifier,
|
|
167
|
+
targetId: Identifier,
|
|
168
|
+
suspensionId: Identifier
|
|
169
|
+
}) {};
|
|
170
|
+
var PageExecutionState = class extends Schema.Class("BrowserPageExecutionState")({
|
|
171
|
+
pageId: Identifier,
|
|
172
|
+
targetId: Identifier,
|
|
173
|
+
state: Schema.Literals([
|
|
174
|
+
"running",
|
|
175
|
+
"suspended",
|
|
176
|
+
"unknown"
|
|
177
|
+
]),
|
|
178
|
+
suspensionId: Schema.optionalKey(Identifier)
|
|
179
|
+
}) {};
|
|
180
|
+
/** Explicit opt-out: this integration does not claim whole-browser network containment. */
|
|
181
|
+
var BrowserPolicy = class BrowserPolicy extends Schema.Class("BrowserBrowserPolicy")({
|
|
182
|
+
network: Schema.Struct({ _tag: Schema.Literal("Unrestricted") }),
|
|
183
|
+
maxActions: PositiveInt.check(Schema.isLessThanOrEqualTo(1e3)),
|
|
184
|
+
maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(216e5)),
|
|
185
|
+
maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8388608))
|
|
186
|
+
}) {
|
|
187
|
+
/**
|
|
188
|
+
* Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.
|
|
189
|
+
* The network choice is spelled out in the name because this runtime cannot prove a
|
|
190
|
+
* narrower one; override any bound, never the network.
|
|
191
|
+
*/
|
|
192
|
+
static unrestricted(bounds = {}) {
|
|
193
|
+
return BrowserPolicy.make({
|
|
194
|
+
network: { _tag: "Unrestricted" },
|
|
195
|
+
maxActions: bounds.maxActions ?? 100,
|
|
196
|
+
maxElapsedMillis: bounds.maxElapsedMillis ?? 3e5,
|
|
197
|
+
maxReturnedBytes: bounds.maxReturnedBytes ?? 2097152
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const TargetUrl = Schema.NonEmptyString.check(Schema.isMaxLength(8192), Schema.makeFilter((value) => {
|
|
202
|
+
try {
|
|
203
|
+
const url = new URL(value);
|
|
204
|
+
return ["http:", "https:"].includes(url.protocol) && url.hostname !== "" && !url.username && !url.password;
|
|
205
|
+
} catch {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
}));
|
|
209
|
+
const Selector = Schema.NonEmptyString.check(Schema.isMaxLength(1024));
|
|
210
|
+
var NavigateRequest = class extends Schema.Class("BrowserNavigateRequest")({
|
|
211
|
+
url: TargetUrl,
|
|
212
|
+
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
213
|
+
minimum: 1,
|
|
214
|
+
maximum: 6e5
|
|
215
|
+
})))
|
|
216
|
+
}) {};
|
|
217
|
+
/**
|
|
218
|
+
* A navigation left in flight. `timeoutMillis` is how long the browser may take to reach
|
|
219
|
+
* DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.
|
|
220
|
+
*/
|
|
221
|
+
var StartNavigationRequest = class extends Schema.Class("BrowserStartNavigationRequest")({
|
|
222
|
+
url: TargetUrl,
|
|
223
|
+
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
224
|
+
minimum: 1,
|
|
225
|
+
maximum: 6e5
|
|
226
|
+
})))
|
|
227
|
+
}) {};
|
|
228
|
+
var ReadTextRequest = class extends Schema.Class("BrowserReadTextRequest")({ selector: Schema.optionalKey(Selector) }) {};
|
|
229
|
+
var ClickRequest = class extends Schema.Class("BrowserClickRequest")({ selector: Selector }) {};
|
|
230
|
+
var FillRequest = class extends Schema.Class("BrowserFillRequest")({
|
|
231
|
+
selector: Selector,
|
|
232
|
+
value: Schema.String.check(Schema.isMaxLength(65536))
|
|
233
|
+
}) {};
|
|
234
|
+
var ScrollRequest = class extends Schema.Class("BrowserScrollRequest")({
|
|
235
|
+
deltaX: Schema.Int.check(Schema.isBetween({
|
|
236
|
+
minimum: -1e5,
|
|
237
|
+
maximum: 1e5
|
|
238
|
+
})),
|
|
239
|
+
deltaY: Schema.Int.check(Schema.isBetween({
|
|
240
|
+
minimum: -1e5,
|
|
241
|
+
maximum: 1e5
|
|
242
|
+
}))
|
|
243
|
+
}) {};
|
|
244
|
+
/**
|
|
245
|
+
* CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It
|
|
246
|
+
* is not a document offset, a device pixel, or a coordinate inside a child frame.
|
|
247
|
+
*/
|
|
248
|
+
var ViewportPoint = class extends Schema.Class("BrowserViewportPoint")({
|
|
249
|
+
x: Schema.Finite.check(Schema.isBetween({
|
|
250
|
+
minimum: 0,
|
|
251
|
+
maximum: 16384
|
|
252
|
+
})),
|
|
253
|
+
y: Schema.Finite.check(Schema.isBetween({
|
|
254
|
+
minimum: 0,
|
|
255
|
+
maximum: 16384
|
|
256
|
+
}))
|
|
257
|
+
}) {};
|
|
258
|
+
/** A box in the viewport of the frame it was read from, in CSS pixels. */
|
|
259
|
+
var ViewportRect = class extends Schema.Class("BrowserViewportRect")({
|
|
260
|
+
x: Schema.Finite,
|
|
261
|
+
y: Schema.Finite,
|
|
262
|
+
width: Schema.Finite,
|
|
263
|
+
height: Schema.Finite
|
|
264
|
+
}) {};
|
|
265
|
+
/**
|
|
266
|
+
* What a host needs to decide whether a control may be acted on. Host-only: a destination can
|
|
267
|
+
* carry a token, so none of this is part of the model-facing `Observation`. It never includes a
|
|
268
|
+
* field's value or any markup.
|
|
269
|
+
*/
|
|
270
|
+
var ControlFacts = class extends Schema.Class("BrowserControlFacts")({
|
|
271
|
+
kind: ObservedControl.fields.kind,
|
|
272
|
+
label: ObservedControl.fields.label,
|
|
273
|
+
disabled: Schema.Boolean,
|
|
274
|
+
checked: Schema.optionalKey(Schema.Boolean),
|
|
275
|
+
selected: Schema.optionalKey(Schema.Boolean),
|
|
276
|
+
required: Schema.optionalKey(Schema.Boolean),
|
|
277
|
+
multiple: Schema.optionalKey(Schema.Boolean),
|
|
278
|
+
editable: Schema.Boolean,
|
|
279
|
+
inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),
|
|
280
|
+
autocomplete: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),
|
|
281
|
+
/** A resolved link target, or where this control submits its form. Absent when over-long. */
|
|
282
|
+
destination: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(2048))),
|
|
283
|
+
formMethod: Schema.optionalKey(Schema.Literals([
|
|
284
|
+
"get",
|
|
285
|
+
"post",
|
|
286
|
+
"dialog"
|
|
287
|
+
])),
|
|
288
|
+
box: ViewportRect,
|
|
289
|
+
placement: Schema.Literals([
|
|
290
|
+
"inside",
|
|
291
|
+
"partial",
|
|
292
|
+
"outside"
|
|
293
|
+
]),
|
|
294
|
+
/** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */
|
|
295
|
+
hitTest: Schema.Literals([
|
|
296
|
+
"self",
|
|
297
|
+
"covered",
|
|
298
|
+
"uncertain",
|
|
299
|
+
"unsampled"
|
|
300
|
+
]),
|
|
301
|
+
/** Only then is `box` in the main frame's viewport, the space pointer input uses. */
|
|
302
|
+
mainFrame: Schema.Boolean
|
|
303
|
+
}) {};
|
|
304
|
+
/**
|
|
305
|
+
* Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues
|
|
306
|
+
* no element references and never replaces the observation an agent's tools act on, so
|
|
307
|
+
* inspecting, checkpointing and then acting on the inspected node all compose.
|
|
308
|
+
*
|
|
309
|
+
* It is host-only, because it carries control facts. Text and picture are read one after the
|
|
310
|
+
* other, never atomically: the interval says when, and `documentChanged` says the document was
|
|
311
|
+
* replaced in between, so the two may describe different documents.
|
|
312
|
+
*/
|
|
313
|
+
var Checkpoint = class extends Schema.Class("BrowserCheckpoint")({
|
|
314
|
+
target: Target,
|
|
315
|
+
revision: Schema.Natural,
|
|
316
|
+
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
317
|
+
text: Schema.String.check(Schema.isMaxLength(131072)),
|
|
318
|
+
textTruncated: Schema.Boolean,
|
|
319
|
+
controls: Schema.Array(ControlFacts).check(Schema.isMaxLength(64)),
|
|
320
|
+
controlsTruncated: Schema.Boolean,
|
|
321
|
+
viewport: ViewportEvidence,
|
|
322
|
+
picture: Schema.optionalKey(Schema.Struct({
|
|
323
|
+
mediaType: Schema.Literal("image/png"),
|
|
324
|
+
bytes: Schema.Uint8Array
|
|
325
|
+
})),
|
|
326
|
+
documentChanged: Schema.Boolean,
|
|
327
|
+
startedMonotonicNanos: Schema.BigInt,
|
|
328
|
+
completedMonotonicNanos: Schema.BigInt
|
|
329
|
+
}) {};
|
|
330
|
+
const ReadingBounds = {
|
|
331
|
+
maxTextBytes: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
332
|
+
minimum: 1,
|
|
333
|
+
maximum: 131072
|
|
334
|
+
}))),
|
|
335
|
+
maxControls: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
336
|
+
minimum: 0,
|
|
337
|
+
maximum: 64
|
|
338
|
+
})))
|
|
339
|
+
};
|
|
340
|
+
/** Omitted bounds default at admission; `scope` defaults to the whole document. */
|
|
341
|
+
const ObservationOptions = Schema.Struct({
|
|
342
|
+
scope: Schema.optionalKey(Schema.Literals(["document", "viewport"])),
|
|
343
|
+
...ReadingBounds
|
|
344
|
+
});
|
|
345
|
+
/** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */
|
|
346
|
+
const CheckpointOptions = Schema.Struct({
|
|
347
|
+
...ReadingBounds,
|
|
348
|
+
picture: Schema.optionalKey(Schema.Boolean)
|
|
349
|
+
});
|
|
350
|
+
/** One native pointer move. Easing and pacing are the caller's: send the points you want. */
|
|
351
|
+
var PointerMoveRequest = class extends Schema.Class("BrowserPointerMoveRequest")({ to: ViewportPoint }) {};
|
|
352
|
+
/** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */
|
|
353
|
+
var HoverRequest = class extends Schema.Class("BrowserHoverRequest")({ selector: Selector }) {};
|
|
354
|
+
const WheelDelta = Schema.Finite.check(Schema.isBetween({
|
|
355
|
+
minimum: -1e5,
|
|
356
|
+
maximum: 1e5
|
|
357
|
+
}));
|
|
358
|
+
/**
|
|
359
|
+
* One native wheel event where the pointer is, or at `at` after moving there first. The browser
|
|
360
|
+
* chooses what scrolls, exactly as it would for a person, so a nested scroll container under
|
|
361
|
+
* the pointer scrolls instead of the page.
|
|
362
|
+
*/
|
|
363
|
+
var WheelRequest = class extends Schema.Class("BrowserWheelRequest")({
|
|
364
|
+
deltaX: WheelDelta,
|
|
365
|
+
deltaY: WheelDelta,
|
|
366
|
+
at: Schema.optionalKey(ViewportPoint)
|
|
367
|
+
}) {};
|
|
368
|
+
/**
|
|
369
|
+
* The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is
|
|
370
|
+
* closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.
|
|
371
|
+
*/
|
|
372
|
+
const NamedKey = Schema.Literals([
|
|
373
|
+
"Enter",
|
|
374
|
+
"Tab",
|
|
375
|
+
"Backspace",
|
|
376
|
+
"Delete",
|
|
377
|
+
"Escape",
|
|
378
|
+
"ArrowLeft",
|
|
379
|
+
"ArrowRight",
|
|
380
|
+
"ArrowUp",
|
|
381
|
+
"ArrowDown",
|
|
382
|
+
"Home",
|
|
383
|
+
"End",
|
|
384
|
+
"PageUp",
|
|
385
|
+
"PageDown"
|
|
386
|
+
]);
|
|
387
|
+
/** One printable ASCII character, space included: every one is a key on the US layout. */
|
|
388
|
+
const PrintableKey = Schema.String.check(Schema.isPattern(/^[\x20-\x7e]$/));
|
|
389
|
+
const KeyModifier = Schema.Literals([
|
|
390
|
+
"Shift",
|
|
391
|
+
"Control",
|
|
392
|
+
"Alt",
|
|
393
|
+
"Meta"
|
|
394
|
+
]);
|
|
395
|
+
/** One key, down then up, with any modifiers held around it. */
|
|
396
|
+
const KeyStroke = Schema.Struct({
|
|
397
|
+
key: Schema.Union([NamedKey, PrintableKey]),
|
|
398
|
+
modifiers: Schema.optionalKey(Schema.Array(KeyModifier).check(Schema.makeFilter((held) => new Set(held).size === held.length, { title: "each modifier at most once" })))
|
|
399
|
+
});
|
|
400
|
+
/**
|
|
401
|
+
* One real key stroke. It goes to whatever has focus in the page, exactly as it would for a
|
|
402
|
+
* person, unless `into` names the one element that must already have it. It never focuses that
|
|
403
|
+
* element, because that would hide a scripted focus inside a native-input operation: click it
|
|
404
|
+
* first.
|
|
405
|
+
*/
|
|
406
|
+
var PressRequest = class extends Schema.Class("BrowserPressRequest")({
|
|
407
|
+
...KeyStroke.fields,
|
|
408
|
+
into: Schema.optionalKey(Selector)
|
|
409
|
+
}) {};
|
|
410
|
+
/** Counted in characters, not UTF-16 units, because that is how many strokes it costs. */
|
|
411
|
+
const TypedText = Schema.NonEmptyString.check(Schema.makeFilter((text) => [...text].length <= 256, { title: "at most 256 characters" }), Schema.makeFilter((text) => [...text].every((character) => {
|
|
412
|
+
const point = character.codePointAt(0) ?? 0;
|
|
413
|
+
return point > 31 && point !== 127 && (point < 55296 || point > 57343);
|
|
414
|
+
}), { title: "no control characters or unpaired surrogates" }));
|
|
415
|
+
/**
|
|
416
|
+
* Text as the real key strokes that produce it, two native commands for each character, one
|
|
417
|
+
* after another under a single action timeout: send a long passage as several shorter runs.
|
|
418
|
+
* A character the US layout cannot produce is inserted as text, as an input method commits it,
|
|
419
|
+
* and raises no key events. Control characters are refused, so a line break can never press
|
|
420
|
+
* Enter from inside a run of text: a named key is always its own `press`. `into` works as it
|
|
421
|
+
* does for `PressRequest`: a guard on where the text lands, never a focus.
|
|
422
|
+
*/
|
|
423
|
+
var TypeRequest = class extends Schema.Class("BrowserTypeRequest")({
|
|
424
|
+
text: TypedText,
|
|
425
|
+
into: Schema.optionalKey(Selector)
|
|
426
|
+
}) {};
|
|
427
|
+
/**
|
|
428
|
+
* What native input was dispatched, where and when. `position` is the point this owner
|
|
429
|
+
* commanded, or null when it has not yet placed the pointer on this page. The interval is on
|
|
430
|
+
* the host monotonic clock that stamps `CapturedFrame.receivedMonotonicNanos`, so input and
|
|
431
|
+
* pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not
|
|
432
|
+
* claim the page finished scrolling, or that any frame shows it. A receipt never says which
|
|
433
|
+
* key was pressed or what was typed.
|
|
434
|
+
*/
|
|
435
|
+
var InputReceipt = class extends Schema.Class("BrowserInputReceipt")({
|
|
436
|
+
target: Target,
|
|
437
|
+
kind: Schema.Literals([
|
|
438
|
+
"pointer-move",
|
|
439
|
+
"hover",
|
|
440
|
+
"wheel",
|
|
441
|
+
"press",
|
|
442
|
+
"type"
|
|
443
|
+
]),
|
|
444
|
+
position: Schema.NullOr(ViewportPoint),
|
|
445
|
+
delta: Schema.optionalKey(Schema.Struct({
|
|
446
|
+
x: WheelDelta,
|
|
447
|
+
y: WheelDelta
|
|
448
|
+
})),
|
|
449
|
+
startedMonotonicNanos: Schema.BigInt,
|
|
450
|
+
completedMonotonicNanos: Schema.BigInt
|
|
451
|
+
}) {};
|
|
452
|
+
var ScreenshotRequest = class extends Schema.Class("BrowserScreenshotRequest")({ fullPage: Schema.Boolean }) {};
|
|
453
|
+
var NavigationResult = class extends Schema.Class("BrowserNavigationResult")({ url: TargetUrl }) {};
|
|
454
|
+
var ActionResult = class extends Schema.Class("BrowserActionResult")({ url: TargetUrl }) {};
|
|
455
|
+
var TextResult = class extends Schema.Class("BrowserTextResult")({ text: Schema.String.check(Schema.isMaxLength(8388608)) }) {};
|
|
456
|
+
var ScreenshotResult = class extends Schema.Class("BrowserScreenshotResult")({
|
|
457
|
+
mediaType: Schema.Literal("image/png"),
|
|
458
|
+
bytes: Schema.Uint8Array
|
|
459
|
+
}) {};
|
|
460
|
+
const FileMediaType = Schema.NonEmptyString.check(Schema.isMaxLength(128), Schema.isPattern(/^[a-z0-9][a-z0-9!#$&^_+.-]*\/[a-z0-9][a-z0-9!#$&^_+.-]*$/));
|
|
461
|
+
/** Small selection is in-memory by design: bytes the caller already holds, never a path. */
|
|
462
|
+
var InlineFile = class extends Schema.Class("BrowserInlineFile")({
|
|
463
|
+
name: SafeFilename,
|
|
464
|
+
mediaType: FileMediaType,
|
|
465
|
+
bytes: Schema.Uint8Array.check(Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1048576, { title: "between one byte and one mebibyte" }))
|
|
466
|
+
}) {};
|
|
467
|
+
const InlineFiles = Schema.Array(InlineFile).check(Schema.isMaxLength(8), Schema.makeFilter((files) => files.length > 0 && files.reduce((total, file) => total + file.bytes.byteLength, 0) <= 4194304, { title: "at most four mebibytes of in-memory selection" }));
|
|
468
|
+
const AutomationOptions = Schema.Struct({
|
|
469
|
+
actionTimeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
470
|
+
minimum: 1,
|
|
471
|
+
maximum: 6e4
|
|
472
|
+
}))),
|
|
473
|
+
/** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */
|
|
474
|
+
maxHostReads: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
475
|
+
minimum: 1,
|
|
476
|
+
maximum: 1e6
|
|
477
|
+
}))),
|
|
478
|
+
maxPages: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
479
|
+
minimum: 1,
|
|
480
|
+
maximum: 32
|
|
481
|
+
}))),
|
|
482
|
+
initialPage: Schema.optionalKey(Schema.Union([Schema.Struct({ targetId: Identifier }), Schema.Struct({ newPage: Schema.Literal(true) })])),
|
|
483
|
+
popupPolicy: Schema.optionalKey(Schema.Literals([
|
|
484
|
+
"retain",
|
|
485
|
+
"close",
|
|
486
|
+
"pause"
|
|
487
|
+
])),
|
|
488
|
+
dialogPolicy: Schema.optionalKey(Schema.Literals(["dismiss", "pause"])),
|
|
489
|
+
pageControl: Schema.optionalKey(Schema.Boolean)
|
|
490
|
+
});
|
|
491
|
+
//#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 };
|
|
493
|
+
|
|
494
|
+
//# sourceMappingURL=BrowserData.mjs.map
|
|
@@ -0,0 +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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