effect-browser 0.2.0-beta.9 → 0.3.0-beta.10
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/README.md +849 -1161
- package/dist/Browser-S4kvpmqa.mjs +605 -0
- package/dist/Browser-S4kvpmqa.mjs.map +1 -0
- package/dist/Browser.d.mts +127 -3
- package/dist/Browser.mjs +2 -22
- package/dist/BrowserError-Coy7EW1N.d.mts +140 -0
- package/dist/BrowserError.d.mts +2 -0
- package/dist/BrowserError.mjs +211 -0
- package/dist/BrowserError.mjs.map +1 -0
- package/dist/BrowserEvent-BRu2juEz.d.mts +279 -0
- package/dist/BrowserEvent.d.mts +2 -0
- package/dist/BrowserEvent.mjs +297 -0
- package/dist/BrowserEvent.mjs.map +1 -0
- package/dist/Cdp.d.mts +32 -0
- package/dist/Cdp.mjs +61 -0
- package/dist/Cdp.mjs.map +1 -0
- package/dist/Change-DNvztNLu.mjs +138 -0
- package/dist/Change-DNvztNLu.mjs.map +1 -0
- package/dist/Change-iMlcuzVD.d.mts +71 -0
- package/dist/Change.d.mts +2 -0
- package/dist/Change.mjs +2 -0
- package/dist/Chromium.d.mts +29 -81
- package/dist/Chromium.mjs +57 -392
- package/dist/Chromium.mjs.map +1 -1
- package/dist/Expect.d.mts +62 -0
- package/dist/Expect.mjs +114 -0
- package/dist/Expect.mjs.map +1 -0
- package/dist/Frame-BERmf_gM.d.mts +117 -0
- package/dist/Frame.d.mts +2 -0
- package/dist/Frame.mjs +123 -0
- package/dist/Frame.mjs.map +1 -0
- package/dist/Moment.d.mts +2 -0
- package/dist/Moment.mjs +288 -0
- package/dist/Moment.mjs.map +1 -0
- package/dist/Motion.d.mts +40 -0
- package/dist/Motion.mjs +122 -0
- package/dist/Motion.mjs.map +1 -0
- package/dist/Page-B5cjaUp5.mjs +618 -0
- package/dist/Page-B5cjaUp5.mjs.map +1 -0
- package/dist/Page-BlPjfibv.d.mts +595 -0
- package/dist/Page.d.mts +2 -0
- package/dist/Page.mjs +2 -0
- package/dist/Plan-BI8XGvDu.d.mts +209 -0
- package/dist/Plan-D1wrJVs8.mjs +508 -0
- package/dist/Plan-D1wrJVs8.mjs.map +1 -0
- package/dist/Plan.d.mts +2 -3
- package/dist/Plan.mjs +2 -2
- package/dist/Policy.d.mts +76 -0
- package/dist/Policy.mjs +237 -0
- package/dist/Policy.mjs.map +1 -0
- package/dist/Presentation.d.mts +48 -0
- package/dist/Presentation.mjs +117 -0
- package/dist/Presentation.mjs.map +1 -0
- package/dist/Snapshot-B34hZ4Jl.d.mts +68 -0
- package/dist/Snapshot.d.mts +2 -0
- package/dist/Snapshot.mjs +79 -0
- package/dist/Snapshot.mjs.map +1 -0
- package/dist/Stage.d.mts +64 -0
- package/dist/Stage.mjs +237 -0
- package/dist/Stage.mjs.map +1 -0
- package/dist/Supervisor-CYWFK3vM.d.mts +280 -0
- package/dist/Supervisor-TNKNOVzu.mjs +599 -0
- package/dist/Supervisor-TNKNOVzu.mjs.map +1 -0
- package/dist/Supervisor.d.mts +2 -0
- package/dist/Supervisor.mjs +2 -0
- package/dist/context-B6xr8nVi.mjs +261 -0
- package/dist/context-B6xr8nVi.mjs.map +1 -0
- package/dist/index.d.mts +17 -14
- package/dist/index.mjs +18 -13
- package/dist/match.inpage-xOe9LNO0.mjs +48 -0
- package/dist/match.inpage-xOe9LNO0.mjs.map +1 -0
- package/dist/page-B8tUQELg.mjs +5073 -0
- package/dist/page-B8tUQELg.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/url-Cd04Okid.mjs +264 -0
- package/dist/url-Cd04Okid.mjs.map +1 -0
- package/package.json +96 -61
- package/src/Browser.ts +666 -0
- package/src/BrowserError.ts +234 -0
- package/src/BrowserEvent.ts +296 -0
- package/src/Cdp.ts +101 -0
- package/src/Change.ts +88 -0
- package/src/Chromium.ts +102 -0
- package/src/Expect.ts +180 -0
- package/src/Frame.ts +130 -0
- package/src/Moment.ts +479 -0
- package/src/Motion.ts +166 -0
- package/src/Page.ts +522 -0
- package/src/Plan.ts +663 -0
- package/src/Policy.ts +325 -0
- package/src/Presentation.ts +195 -0
- package/src/Snapshot.ts +89 -0
- package/src/Stage.ts +467 -0
- package/src/Supervisor.ts +599 -0
- package/src/index.ts +20 -0
- package/src/internal/input/actions.ts +610 -0
- package/src/internal/input/dispatch.ts +161 -0
- package/src/internal/input/edit.inpage.ts +162 -0
- package/src/internal/input/evidence.inpage.ts +164 -0
- package/src/internal/input/gate.ts +224 -0
- package/src/internal/input/guard.inpage.ts +605 -0
- package/src/internal/input/guard.ts +184 -0
- package/src/internal/input/keyboard.ts +112 -0
- package/src/internal/input/keys.ts +127 -0
- package/src/internal/input/perform.ts +376 -0
- package/src/internal/input/pointer.ts +153 -0
- package/src/internal/input/replies.ts +195 -0
- package/src/internal/input/settle.ts +50 -0
- package/src/internal/input/style.ts +186 -0
- package/src/internal/input/targets.inpage.ts +293 -0
- package/src/internal/input/targets.ts +148 -0
- package/src/internal/page/bridge.ts +386 -0
- package/src/internal/page/context.ts +312 -0
- package/src/internal/page/lane.ts +311 -0
- package/src/internal/page/navigation.ts +183 -0
- package/src/internal/page/openings.ts +87 -0
- package/src/internal/page/page.ts +165 -0
- package/src/internal/page/url.ts +100 -0
- package/src/internal/page/viewport.ts +43 -0
- package/src/internal/pictures/capture.ts +776 -0
- package/src/internal/pictures/clock.ts +141 -0
- package/src/internal/pictures/counts.ts +92 -0
- package/src/internal/pictures/pictures.ts +520 -0
- package/src/internal/pictures/transport.ts +242 -0
- package/src/internal/reading/choose.ts +100 -0
- package/src/internal/reading/context.inpage.ts +201 -0
- package/src/internal/reading/controls.inpage.ts +158 -0
- package/src/internal/reading/expect.inpage.ts +70 -0
- package/src/internal/reading/match.inpage.ts +92 -0
- package/src/internal/reading/names.inpage.ts +306 -0
- package/src/internal/reading/outline.inpage.ts +260 -0
- package/src/internal/reading/reading.ts +223 -0
- package/src/internal/reading/ready.inpage.ts +164 -0
- package/src/internal/reading/ready.ts +111 -0
- package/src/internal/reading/subjects.inpage.ts +188 -0
- package/src/internal/reading/text.inpage.ts +135 -0
- package/src/internal/reading/walk.inpage.ts +220 -0
- package/src/internal/supervisor/lifecycle.ts +416 -0
- package/src/internal/timeline/changes.inpage.ts +216 -0
- package/src/internal/timeline/changes.ts +100 -0
- package/src/internal/timeline/events.ts +94 -0
- package/src/internal/timeline/fold.inpage.ts +123 -0
- package/src/internal/timeline/history.inpage.ts +229 -0
- package/src/internal/timeline/marks.inpage.ts +207 -0
- package/src/internal/timeline/record.inpage.ts +133 -0
- package/src/internal/timeline/sight.inpage.ts +122 -0
- package/src/internal/timeline/window.ts +96 -0
- package/src/internal/timeline/words.ts +65 -0
- package/dist/Bootstrap-B9UUXsvF.d.mts +0 -183
- package/dist/Bootstrap-CeQOWBy6.mjs +0 -189
- package/dist/Bootstrap-CeQOWBy6.mjs.map +0 -1
- package/dist/Bootstrap.d.mts +0 -3
- package/dist/Bootstrap.mjs +0 -2
- package/dist/Browser-BF9_sORP.d.mts +0 -388
- package/dist/Browser.mjs.map +0 -1
- package/dist/BrowserData-CPIIIHol.d.mts +0 -585
- package/dist/BrowserData.d.mts +0 -3
- package/dist/BrowserData.mjs +0 -695
- package/dist/BrowserData.mjs.map +0 -1
- package/dist/BrowserRuntime-B6nT1G4X.d.mts +0 -148
- package/dist/BrowserRuntime-C1r2aSRK.mjs +0 -6820
- package/dist/BrowserRuntime-C1r2aSRK.mjs.map +0 -1
- package/dist/BrowserRuntime.d.mts +0 -3
- package/dist/BrowserRuntime.mjs +0 -3
- package/dist/Capture.d.mts +0 -56
- package/dist/Capture.mjs +0 -678
- package/dist/Capture.mjs.map +0 -1
- package/dist/CaptureData-CYriZHX1.mjs +0 -201
- package/dist/CaptureData-CYriZHX1.mjs.map +0 -1
- package/dist/CaptureData.d.mts +0 -219
- package/dist/CaptureData.mjs +0 -2
- package/dist/Errors.d.mts +0 -158
- package/dist/Errors.mjs +0 -207
- package/dist/Errors.mjs.map +0 -1
- package/dist/Images-yCG9BmRU.mjs +0 -76
- package/dist/Images-yCG9BmRU.mjs.map +0 -1
- package/dist/OperationOptions-DAeRS6O9.mjs +0 -55
- package/dist/OperationOptions-DAeRS6O9.mjs.map +0 -1
- package/dist/PageControl.d.mts +0 -15
- package/dist/PageControl.mjs +0 -34
- package/dist/PageControl.mjs.map +0 -1
- package/dist/PageRegistry-B3q9DS3g.mjs +0 -164
- package/dist/PageRegistry-B3q9DS3g.mjs.map +0 -1
- package/dist/Plan-Dyxu2q8C.mjs +0 -543
- package/dist/Plan-Dyxu2q8C.mjs.map +0 -1
- package/dist/PlanData-B668RxbQ.d.mts +0 -4831
- package/dist/PlanData.d.mts +0 -3
- package/dist/PlanData.mjs +0 -268
- package/dist/PlanData.mjs.map +0 -1
- package/dist/PlanInput-BJcPPncs.mjs +0 -75
- package/dist/PlanInput-BJcPPncs.mjs.map +0 -1
- package/dist/PublicSession-DCSMMqOj.mjs +0 -5602
- package/dist/PublicSession-DCSMMqOj.mjs.map +0 -1
- package/dist/Testing.d.mts +0 -479
- package/dist/Testing.mjs +0 -2147
- package/dist/Testing.mjs.map +0 -1
- package/dist/Timeline-fV22Xk-S.d.mts +0 -29
- package/dist/Timeline.d.mts +0 -4
- package/dist/Timeline.mjs +0 -20
- package/dist/Timeline.mjs.map +0 -1
- package/dist/TimelineData-BsOn-YGZ.d.mts +0 -3818
- package/dist/TimelineData.d.mts +0 -3
- package/dist/TimelineData.mjs +0 -482
- package/dist/TimelineData.mjs.map +0 -1
package/dist/BrowserData.mjs
DELETED
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
import { BrowserError } from "./Errors.mjs";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
//#region src/BrowserData.ts
|
|
4
|
-
const Identifier = Schema.NonEmptyString.check(Schema.isMaxLength(256), Schema.isPattern(/^[A-Za-z0-9_-]+$/));
|
|
5
|
-
const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));
|
|
6
|
-
/** Portable basename only; never a local or remote filesystem path. */
|
|
7
|
-
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" }));
|
|
8
|
-
var Viewport = class extends Schema.Class("BrowserViewport")(Schema.Struct({
|
|
9
|
-
width: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),
|
|
10
|
-
height: PositiveInt.check(Schema.isLessThanOrEqualTo(4096))
|
|
11
|
-
}).check(Schema.makeFilter((v) => v.width * v.height <= 8388608, { title: "at most 8,388,608 viewport pixels" }))) {};
|
|
12
|
-
/** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */
|
|
13
|
-
var Target = class extends Schema.Class("BrowserTarget")({
|
|
14
|
-
generation: Schema.Natural,
|
|
15
|
-
pageId: Identifier,
|
|
16
|
-
frameId: Identifier
|
|
17
|
-
}) {};
|
|
18
|
-
var PageInfo = class extends Schema.Class("BrowserPageInfo")({
|
|
19
|
-
pageId: Identifier,
|
|
20
|
-
targetId: Identifier,
|
|
21
|
-
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
22
|
-
title: Schema.String.check(Schema.isMaxLength(512)),
|
|
23
|
-
selected: Schema.Boolean
|
|
24
|
-
}) {};
|
|
25
|
-
var FrameInfo = class extends Schema.Class("BrowserFrameInfo")({
|
|
26
|
-
frameId: Identifier,
|
|
27
|
-
parentFrameId: Schema.NullOr(Identifier),
|
|
28
|
-
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
29
|
-
name: Schema.String.check(Schema.isMaxLength(256))
|
|
30
|
-
}) {};
|
|
31
|
-
const SessionPhase = Schema.Literals([
|
|
32
|
-
"acquiring",
|
|
33
|
-
"open",
|
|
34
|
-
"paused",
|
|
35
|
-
"detached",
|
|
36
|
-
"faulted",
|
|
37
|
-
"uncertain",
|
|
38
|
-
"closing",
|
|
39
|
-
"closed"
|
|
40
|
-
]);
|
|
41
|
-
const SessionReason = Schema.Literals([
|
|
42
|
-
"expired",
|
|
43
|
-
"callback-failure",
|
|
44
|
-
"registration-failure",
|
|
45
|
-
"native-failure",
|
|
46
|
-
"disconnected",
|
|
47
|
-
"popup-policy",
|
|
48
|
-
"dialog-policy",
|
|
49
|
-
"popup-overflow",
|
|
50
|
-
"dialog-overflow",
|
|
51
|
-
"cleanup-capacity",
|
|
52
|
-
"handoff",
|
|
53
|
-
"detached",
|
|
54
|
-
"closed",
|
|
55
|
-
"page-contained"
|
|
56
|
-
]);
|
|
57
|
-
const DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
58
|
-
/**
|
|
59
|
-
* Bounded fresh metadata from one owner generation. Native URL/title reads are non-atomic.
|
|
60
|
-
* PageInfo is data; callers must acquire an issued Page and observe it explicitly before input.
|
|
61
|
-
* The separate pages lifecycle stream attaches its cached registry snapshot and cursor atomically.
|
|
62
|
-
*/
|
|
63
|
-
var Inventory = class extends Schema.Class("BrowserInventory")({
|
|
64
|
-
generation: DiagnosticCounter,
|
|
65
|
-
pages: Schema.Array(PageInfo).check(Schema.isMaxLength(32))
|
|
66
|
-
}) {};
|
|
67
|
-
/** The bound on one session's model-reachable actions, like the host-read allowance's. */
|
|
68
|
-
const ActionAllowance = PositiveInt.check(Schema.isLessThanOrEqualTo(1e6));
|
|
69
|
-
/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */
|
|
70
|
-
var SessionStatus = class extends Schema.Class("BrowserSessionStatus")({
|
|
71
|
-
phase: SessionPhase,
|
|
72
|
-
reason: Schema.NullOr(SessionReason),
|
|
73
|
-
generation: DiagnosticCounter,
|
|
74
|
-
busy: Schema.Boolean,
|
|
75
|
-
unresolvedDispatch: Schema.Boolean,
|
|
76
|
-
/**
|
|
77
|
-
* Actions admitted against the policy's `maxActions`, as the owner counted them. Host reads
|
|
78
|
-
* (`checkpoint`, `controlFacts`) and uncharged reads such as a form's verification are not
|
|
79
|
-
* actions. `used` equals `maximum` once the allowance is spent; the owner stays open.
|
|
80
|
-
*/
|
|
81
|
-
actions: Schema.Struct({
|
|
82
|
-
used: Schema.Natural.check(Schema.isLessThanOrEqualTo(1e6)),
|
|
83
|
-
maximum: ActionAllowance
|
|
84
|
-
}).check(Schema.makeFilter((actions) => actions.used <= actions.maximum, { title: "no more actions used than allowed" }))
|
|
85
|
-
}) {};
|
|
86
|
-
/** Bounded host facts only: no target identity, page content, native exception or consumer cause. */
|
|
87
|
-
var BrowserDiagnostic = class extends Schema.Class("BrowserDiagnostic")({
|
|
88
|
-
reason: SessionReason,
|
|
89
|
-
disposition: Schema.Literals([
|
|
90
|
-
"pending",
|
|
91
|
-
"confirmed",
|
|
92
|
-
"not-dispatched",
|
|
93
|
-
"unknown"
|
|
94
|
-
]),
|
|
95
|
-
generation: DiagnosticCounter,
|
|
96
|
-
monotonicNanos: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n))
|
|
97
|
-
}) {};
|
|
98
|
-
var BrowserDiagnostics = class extends Schema.Class("BrowserDiagnostics")({
|
|
99
|
-
records: Schema.Array(BrowserDiagnostic).check(Schema.isMaxLength(32)),
|
|
100
|
-
total: DiagnosticCounter,
|
|
101
|
-
dropped: DiagnosticCounter,
|
|
102
|
-
truncated: Schema.Boolean
|
|
103
|
-
}) {};
|
|
104
|
-
var ObservedControl = class extends Schema.Class("BrowserObservedControl")({
|
|
105
|
-
elementId: Identifier,
|
|
106
|
-
kind: Schema.Literals([
|
|
107
|
-
"link",
|
|
108
|
-
"button",
|
|
109
|
-
"input",
|
|
110
|
-
"select",
|
|
111
|
-
"textarea",
|
|
112
|
-
"other"
|
|
113
|
-
]),
|
|
114
|
-
label: Schema.String.check(Schema.isMaxLength(256)),
|
|
115
|
-
disabled: Schema.Boolean,
|
|
116
|
-
checked: Schema.optionalKey(Schema.Boolean),
|
|
117
|
-
selected: Schema.optionalKey(Schema.Boolean),
|
|
118
|
-
inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),
|
|
119
|
-
required: Schema.optionalKey(Schema.Boolean),
|
|
120
|
-
/** Native select state. A select is never represented by one `selected` boolean. */
|
|
121
|
-
multiple: Schema.optionalKey(Schema.Boolean),
|
|
122
|
-
/** The issued select this native option belongs to, in the same observation. */
|
|
123
|
-
selectElementId: Schema.optionalKey(Identifier),
|
|
124
|
-
/** Some choices could not be issued within this reading's shared control/value bounds. */
|
|
125
|
-
optionsTruncated: Schema.optionalKey(Schema.Boolean)
|
|
126
|
-
}) {};
|
|
127
|
-
const ScrollOffset = Schema.Finite.check(Schema.isBetween({
|
|
128
|
-
minimum: -Number.MAX_SAFE_INTEGER,
|
|
129
|
-
maximum: Number.MAX_SAFE_INTEGER
|
|
130
|
-
}));
|
|
131
|
-
const ScrollExtent = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
132
|
-
/**
|
|
133
|
-
* The read frame's root document scroll geometry, sampled in CSS pixels with the reading.
|
|
134
|
-
* Offsets can be negative (for example RTL); dimensions are the scrolling element's measured
|
|
135
|
-
* scrollWidth/Height and clientWidth/Height. They do not describe a nested scrolling container
|
|
136
|
-
* or expose unseen text, and do not establish a scroll direction or an end-of-document condition.
|
|
137
|
-
*/
|
|
138
|
-
const DocumentScroll = Schema.Struct({
|
|
139
|
-
x: ScrollOffset,
|
|
140
|
-
y: ScrollOffset,
|
|
141
|
-
scrollWidth: ScrollExtent,
|
|
142
|
-
scrollHeight: ScrollExtent,
|
|
143
|
-
clientWidth: ScrollExtent,
|
|
144
|
-
clientHeight: ScrollExtent
|
|
145
|
-
});
|
|
146
|
-
/**
|
|
147
|
-
* How a viewport reading was bounded, what it left out, and its document scroll geometry. These
|
|
148
|
-
* counts and measured layout facts can be shown to a model. Visibility is geometry and
|
|
149
|
-
* hit-testing, never a pixel comparison: text is
|
|
150
|
-
* kept when its line boxes intersect the viewport and the browser finds its own element at a
|
|
151
|
-
* sampled point. Something that takes no pointer events is invisible to that test, so the
|
|
152
|
-
* browser is asked what is on top there with pointer events ignored: a box that paints at the
|
|
153
|
-
* point covers the text, and one that paints nothing there, such as an empty full-screen
|
|
154
|
-
* container, does not. Text that could not be settled that way is left out as uncertain.
|
|
155
|
-
*/
|
|
156
|
-
var ViewportEvidence = class extends Schema.Class("BrowserViewportEvidence")({
|
|
157
|
-
width: Schema.Finite,
|
|
158
|
-
height: Schema.Finite,
|
|
159
|
-
/** Absent when the document has no scrolling element, or in older/scripted readings. */
|
|
160
|
-
documentScroll: Schema.optionalKey(DocumentScroll),
|
|
161
|
-
/** Text that crossed a viewport edge; only its lines on screen were kept. */
|
|
162
|
-
clippedText: Schema.Natural,
|
|
163
|
-
/** Left out: another element is on top at the sampled point, or a box there paints over it. */
|
|
164
|
-
coveredText: Schema.Natural,
|
|
165
|
-
/**
|
|
166
|
-
* Left out: something that takes no pointer events lies over it and the browser's own hit test
|
|
167
|
-
* could not settle whether it paints there, for example beneath another such box, in a child
|
|
168
|
-
* frame, or after too many such points in one reading.
|
|
169
|
-
*/
|
|
170
|
-
uncertainText: Schema.Natural,
|
|
171
|
-
/** Controls that intersect the viewport but cannot be reached there. */
|
|
172
|
-
unreachableControls: Schema.Natural,
|
|
173
|
-
/** The traversal budget ran out first, so this reading is known to be incomplete. */
|
|
174
|
-
exhausted: Schema.Boolean
|
|
175
|
-
}) {};
|
|
176
|
-
/**
|
|
177
|
-
* Case-insensitive text a reading keeps. It is applied inside the page before any limit, so
|
|
178
|
-
* matching controls are not crowded out by earlier ones. It filters what is read; it never
|
|
179
|
-
* searches for, re-finds or substitutes a node.
|
|
180
|
-
*/
|
|
181
|
-
const ReadingMatch = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(256), Schema.makeFilter((value) => value.trim().length > 0, { title: "not only whitespace" }));
|
|
182
|
-
/**
|
|
183
|
-
* Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A
|
|
184
|
-
* `viewport` reading holds what is on screen and reachable, plus the bounded choices of its
|
|
185
|
-
* native selects. Those choices are not a claim that a closed dropdown's rows were visible.
|
|
186
|
-
* A `document` reading is the whole body, wherever it is. A reading with `match` keeps only
|
|
187
|
-
* matching text lines and controls, so what it leaves out is not evidence of absence. Nothing
|
|
188
|
-
* here carries a destination, a form or a field value.
|
|
189
|
-
*/
|
|
190
|
-
var Observation = class extends Schema.Class("BrowserObservation")({
|
|
191
|
-
target: Target,
|
|
192
|
-
observationId: Identifier,
|
|
193
|
-
revision: Schema.Natural,
|
|
194
|
-
scope: Schema.Literals(["document", "viewport"]),
|
|
195
|
-
match: Schema.optionalKey(ReadingMatch),
|
|
196
|
-
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
197
|
-
text: Schema.String.check(Schema.isMaxLength(131072)),
|
|
198
|
-
controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),
|
|
199
|
-
controlsTruncated: Schema.Boolean,
|
|
200
|
-
textTruncated: Schema.Boolean,
|
|
201
|
-
viewport: ViewportEvidence
|
|
202
|
-
}) {};
|
|
203
|
-
var ObservedElement = class extends Schema.Class("BrowserObservedElement")({
|
|
204
|
-
observationId: Identifier,
|
|
205
|
-
elementId: Identifier
|
|
206
|
-
}) {};
|
|
207
|
-
/** Observe a condition of this exact node. A replacement never satisfies the reference. */
|
|
208
|
-
var WaitForElementRequest = class extends Schema.Class("BrowserWaitForElementRequest")({
|
|
209
|
-
reference: ObservedElement,
|
|
210
|
-
state: Schema.Literals([
|
|
211
|
-
"visible",
|
|
212
|
-
"hidden",
|
|
213
|
-
"enabled",
|
|
214
|
-
"disabled"
|
|
215
|
-
]),
|
|
216
|
-
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
217
|
-
minimum: 1,
|
|
218
|
-
maximum: 6e4
|
|
219
|
-
})))
|
|
220
|
-
}) {};
|
|
221
|
-
/** Issued option element IDs from one observed native select; never values, labels or indices. */
|
|
222
|
-
const SelectOptions = Schema.Array(Identifier).check(Schema.isMinLength(1), Schema.isMaxLength(64), Schema.makeFilter((ids) => new Set(ids).size === ids.length));
|
|
223
|
-
/** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */
|
|
224
|
-
var PageSuspension = class extends Schema.Class("BrowserPageSuspension")({
|
|
225
|
-
pageId: Identifier,
|
|
226
|
-
targetId: Identifier,
|
|
227
|
-
suspensionId: Identifier
|
|
228
|
-
}) {};
|
|
229
|
-
var PageExecutionState = class extends Schema.Class("BrowserPageExecutionState")({
|
|
230
|
-
pageId: Identifier,
|
|
231
|
-
targetId: Identifier,
|
|
232
|
-
state: Schema.Literals([
|
|
233
|
-
"running",
|
|
234
|
-
"suspended",
|
|
235
|
-
"unknown"
|
|
236
|
-
]),
|
|
237
|
-
suspensionId: Schema.optionalKey(Identifier)
|
|
238
|
-
}) {};
|
|
239
|
-
/** Explicit opt-out: this integration does not claim whole-browser network containment. */
|
|
240
|
-
var BrowserPolicy = class BrowserPolicy extends Schema.Class("BrowserBrowserPolicy")({
|
|
241
|
-
network: Schema.TaggedStruct("Unrestricted", {}),
|
|
242
|
-
/** Model-reachable actions for the session's lifetime, 1–1,000,000. `status.actions` reads use. */
|
|
243
|
-
maxActions: ActionAllowance,
|
|
244
|
-
maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(216e5)),
|
|
245
|
-
maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8388608))
|
|
246
|
-
}) {
|
|
247
|
-
/**
|
|
248
|
-
* Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.
|
|
249
|
-
* The network choice is spelled out in the name because this runtime cannot prove a
|
|
250
|
-
* narrower one; override any bound, never the network. A long session raises `maxActions`
|
|
251
|
-
* (up to 1,000,000) and `maxElapsedMillis` (up to six hours) together.
|
|
252
|
-
*/
|
|
253
|
-
static unrestricted(bounds = {}) {
|
|
254
|
-
return BrowserPolicy.make({
|
|
255
|
-
network: { _tag: "Unrestricted" },
|
|
256
|
-
maxActions: bounds.maxActions ?? 100,
|
|
257
|
-
maxElapsedMillis: bounds.maxElapsedMillis ?? 3e5,
|
|
258
|
-
maxReturnedBytes: bounds.maxReturnedBytes ?? 2097152
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
const TargetUrl = Schema.NonEmptyString.check(Schema.isMaxLength(8192), Schema.makeFilter((value) => {
|
|
263
|
-
try {
|
|
264
|
-
const url = new URL(value);
|
|
265
|
-
return ["http:", "https:"].includes(url.protocol) && url.hostname !== "" && !url.username && !url.password;
|
|
266
|
-
} catch {
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
}));
|
|
270
|
-
const Selector = Schema.NonEmptyString.check(Schema.isMaxLength(1024));
|
|
271
|
-
var NavigateRequest = class extends Schema.Class("BrowserNavigateRequest")({
|
|
272
|
-
url: TargetUrl,
|
|
273
|
-
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
274
|
-
minimum: 1,
|
|
275
|
-
maximum: 6e5
|
|
276
|
-
})))
|
|
277
|
-
}) {};
|
|
278
|
-
/**
|
|
279
|
-
* A navigation left in flight. `timeoutMillis` is how long the browser may take to reach
|
|
280
|
-
* DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.
|
|
281
|
-
*/
|
|
282
|
-
var StartNavigationRequest = class extends Schema.Class("BrowserStartNavigationRequest")({
|
|
283
|
-
url: TargetUrl,
|
|
284
|
-
timeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
285
|
-
minimum: 1,
|
|
286
|
-
maximum: 6e5
|
|
287
|
-
})))
|
|
288
|
-
}) {};
|
|
289
|
-
var ReadTextRequest = class extends Schema.Class("BrowserReadTextRequest")({ selector: Schema.optionalKey(Selector) }) {};
|
|
290
|
-
var ClickRequest = class extends Schema.Class("BrowserClickRequest")({ selector: Selector }) {};
|
|
291
|
-
var FillRequest = class extends Schema.Class("BrowserFillRequest")({
|
|
292
|
-
selector: Selector,
|
|
293
|
-
value: Schema.String.check(Schema.isMaxLength(65536))
|
|
294
|
-
}) {};
|
|
295
|
-
/**
|
|
296
|
-
* One observed control and the one state a form gives it: replacement text, the checked state a
|
|
297
|
-
* checkbox, radio or switch should end in (it is clicked only when it differs, and a native radio
|
|
298
|
-
* is never asked to clear itself), or issued option IDs of a native select from the same
|
|
299
|
-
* observation.
|
|
300
|
-
*/
|
|
301
|
-
const FormField = Schema.Struct({
|
|
302
|
-
elementId: Identifier,
|
|
303
|
-
value: Schema.optionalKey(FillRequest.fields.value),
|
|
304
|
-
checked: Schema.optionalKey(Schema.Boolean),
|
|
305
|
-
options: Schema.optionalKey(SelectOptions)
|
|
306
|
-
}).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" }));
|
|
307
|
-
/** At most 32 distinct fields, and a submit control that is not one of them. */
|
|
308
|
-
var FillFormRequest = class extends Schema.Class("BrowserFillFormRequest")(Schema.Struct({
|
|
309
|
-
observationId: Identifier,
|
|
310
|
-
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" })),
|
|
311
|
-
submit: Schema.optionalKey(Identifier)
|
|
312
|
-
}).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" }))) {};
|
|
313
|
-
/**
|
|
314
|
-
* Host choices about how a form proceeds. `verify` (default true) re-reads every field before
|
|
315
|
-
* submit and stops when one no longer holds what its own step left there. `settleMillis`
|
|
316
|
-
* (default 50, at most 5000; 0 skips it) is how long each dispatched step lets the page's own
|
|
317
|
-
* handlers run, after at least two rendered frames, before its result is read back.
|
|
318
|
-
*/
|
|
319
|
-
const FillFormOptions = Schema.Struct({
|
|
320
|
-
verify: Schema.optionalKey(Schema.Boolean),
|
|
321
|
-
settleMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
322
|
-
minimum: 0,
|
|
323
|
-
maximum: 5e3
|
|
324
|
-
})))
|
|
325
|
-
});
|
|
326
|
-
/**
|
|
327
|
-
* Where a form stopped and why. `error.outcome` says whether this step itself was dispatched;
|
|
328
|
-
* nothing after it was. `elementId` names the control it stopped at, when there is one: a
|
|
329
|
-
* verification that could not read the form at all names none.
|
|
330
|
-
*/
|
|
331
|
-
var FormStop = class extends Schema.Class("BrowserFormStop")({
|
|
332
|
-
stage: Schema.Literals([
|
|
333
|
-
"field",
|
|
334
|
-
"verify",
|
|
335
|
-
"submit"
|
|
336
|
-
]),
|
|
337
|
-
elementId: Schema.optionalKey(Identifier),
|
|
338
|
-
error: BrowserError
|
|
339
|
-
}) {};
|
|
340
|
-
/**
|
|
341
|
-
* What a form did, in order. `stopped` is present when it did not finish: the fields before it
|
|
342
|
-
* stay set, because a form is not a transaction. `submitted` is true only when the submit click
|
|
343
|
-
* completed; a stop at `submit` with an `unknown` outcome may have sent it.
|
|
344
|
-
*/
|
|
345
|
-
var ScrollRequest = class extends Schema.Class("BrowserScrollRequest")({
|
|
346
|
-
deltaX: Schema.Int.check(Schema.isBetween({
|
|
347
|
-
minimum: -1e5,
|
|
348
|
-
maximum: 1e5
|
|
349
|
-
})),
|
|
350
|
-
deltaY: Schema.Int.check(Schema.isBetween({
|
|
351
|
-
minimum: -1e5,
|
|
352
|
-
maximum: 1e5
|
|
353
|
-
}))
|
|
354
|
-
}) {};
|
|
355
|
-
/**
|
|
356
|
-
* CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It
|
|
357
|
-
* is not a document offset, a device pixel, or a coordinate inside a child frame.
|
|
358
|
-
*/
|
|
359
|
-
var ViewportPoint = class extends Schema.Class("BrowserViewportPoint")({
|
|
360
|
-
x: Schema.Finite.check(Schema.isBetween({
|
|
361
|
-
minimum: 0,
|
|
362
|
-
maximum: 16384
|
|
363
|
-
})),
|
|
364
|
-
y: Schema.Finite.check(Schema.isBetween({
|
|
365
|
-
minimum: 0,
|
|
366
|
-
maximum: 16384
|
|
367
|
-
}))
|
|
368
|
-
}) {};
|
|
369
|
-
/** A box in the viewport of the frame it was read from, in CSS pixels. */
|
|
370
|
-
var ViewportRect = class extends Schema.Class("BrowserViewportRect")({
|
|
371
|
-
x: Schema.Finite,
|
|
372
|
-
y: Schema.Finite,
|
|
373
|
-
width: Schema.Finite,
|
|
374
|
-
height: Schema.Finite
|
|
375
|
-
}) {};
|
|
376
|
-
/**
|
|
377
|
-
* What a host needs to decide whether a control may be acted on. Host-only: a destination can
|
|
378
|
-
* carry a token, so none of this is part of the model-facing `Observation`. It never includes a
|
|
379
|
-
* field's value or any markup.
|
|
380
|
-
*/
|
|
381
|
-
var ControlFacts = class extends Schema.Class("BrowserControlFacts")({
|
|
382
|
-
kind: ObservedControl.fields.kind,
|
|
383
|
-
label: ObservedControl.fields.label,
|
|
384
|
-
disabled: Schema.Boolean,
|
|
385
|
-
checked: Schema.optionalKey(Schema.Boolean),
|
|
386
|
-
selected: Schema.optionalKey(Schema.Boolean),
|
|
387
|
-
required: Schema.optionalKey(Schema.Boolean),
|
|
388
|
-
multiple: Schema.optionalKey(Schema.Boolean),
|
|
389
|
-
editable: Schema.Boolean,
|
|
390
|
-
inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),
|
|
391
|
-
autocomplete: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),
|
|
392
|
-
/** A resolved link target, or where this control submits its form. Absent when over-long. */
|
|
393
|
-
destination: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(2048))),
|
|
394
|
-
formMethod: Schema.optionalKey(Schema.Literals([
|
|
395
|
-
"get",
|
|
396
|
-
"post",
|
|
397
|
-
"dialog"
|
|
398
|
-
])),
|
|
399
|
-
box: ViewportRect,
|
|
400
|
-
placement: Schema.Literals([
|
|
401
|
-
"inside",
|
|
402
|
-
"partial",
|
|
403
|
-
"outside"
|
|
404
|
-
]),
|
|
405
|
-
/** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */
|
|
406
|
-
hitTest: Schema.Literals([
|
|
407
|
-
"self",
|
|
408
|
-
"covered",
|
|
409
|
-
"uncertain",
|
|
410
|
-
"unsampled"
|
|
411
|
-
]),
|
|
412
|
-
/** Only then is `box` in the main frame's viewport, the space pointer input uses. */
|
|
413
|
-
mainFrame: Schema.Boolean
|
|
414
|
-
}) {};
|
|
415
|
-
/**
|
|
416
|
-
* Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues
|
|
417
|
-
* no element references and never replaces the observation an agent's tools act on, so
|
|
418
|
-
* inspecting, checkpointing and then acting on the inspected node all compose.
|
|
419
|
-
*
|
|
420
|
-
* It is host-only, because it carries control facts. Text and picture are read one after the
|
|
421
|
-
* other, never atomically: the interval says when, and `documentChanged` says the document was
|
|
422
|
-
* replaced in between, so the two may describe different documents.
|
|
423
|
-
*/
|
|
424
|
-
var Checkpoint = class extends Schema.Class("BrowserCheckpoint")({
|
|
425
|
-
target: Target,
|
|
426
|
-
revision: Schema.Natural,
|
|
427
|
-
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
428
|
-
text: Schema.String.check(Schema.isMaxLength(131072)),
|
|
429
|
-
textTruncated: Schema.Boolean,
|
|
430
|
-
controls: Schema.Array(ControlFacts).check(Schema.isMaxLength(64)),
|
|
431
|
-
controlsTruncated: Schema.Boolean,
|
|
432
|
-
viewport: ViewportEvidence,
|
|
433
|
-
picture: Schema.optionalKey(Schema.Struct({
|
|
434
|
-
mediaType: Schema.Literal("image/png"),
|
|
435
|
-
bytes: Schema.Uint8Array
|
|
436
|
-
})),
|
|
437
|
-
documentChanged: Schema.Boolean,
|
|
438
|
-
startedMonotonicNanos: Schema.BigInt,
|
|
439
|
-
completedMonotonicNanos: Schema.BigInt
|
|
440
|
-
}) {};
|
|
441
|
-
const ReadingBounds = {
|
|
442
|
-
maxTextBytes: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
443
|
-
minimum: 1,
|
|
444
|
-
maximum: 131072
|
|
445
|
-
}))),
|
|
446
|
-
maxControls: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
447
|
-
minimum: 0,
|
|
448
|
-
maximum: 64
|
|
449
|
-
})))
|
|
450
|
-
};
|
|
451
|
-
/** Omitted bounds default at admission; `scope` defaults to the whole document. */
|
|
452
|
-
const ObservationOptions = Schema.Struct({
|
|
453
|
-
scope: Schema.optionalKey(Schema.Literals(["document", "viewport"])),
|
|
454
|
-
match: Schema.optionalKey(ReadingMatch),
|
|
455
|
-
...ReadingBounds
|
|
456
|
-
});
|
|
457
|
-
/** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */
|
|
458
|
-
const CheckpointOptions = Schema.Struct({
|
|
459
|
-
...ReadingBounds,
|
|
460
|
-
picture: Schema.optionalKey(Schema.Boolean)
|
|
461
|
-
});
|
|
462
|
-
/** One native pointer move. Easing and pacing are the caller's: send the points you want. */
|
|
463
|
-
var PointerMoveRequest = class extends Schema.Class("BrowserPointerMoveRequest")({ to: ViewportPoint }) {};
|
|
464
|
-
/** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */
|
|
465
|
-
var HoverRequest = class extends Schema.Class("BrowserHoverRequest")({ selector: Selector }) {};
|
|
466
|
-
const WheelDelta = Schema.Finite.check(Schema.isBetween({
|
|
467
|
-
minimum: -1e5,
|
|
468
|
-
maximum: 1e5
|
|
469
|
-
}));
|
|
470
|
-
/**
|
|
471
|
-
* One native wheel event where the pointer is, or at `at` after moving there first. The browser
|
|
472
|
-
* chooses what scrolls, exactly as it would for a person, so a nested scroll container under
|
|
473
|
-
* the pointer scrolls instead of the page.
|
|
474
|
-
*/
|
|
475
|
-
var WheelRequest = class extends Schema.Class("BrowserWheelRequest")({
|
|
476
|
-
deltaX: WheelDelta,
|
|
477
|
-
deltaY: WheelDelta,
|
|
478
|
-
at: Schema.optionalKey(ViewportPoint)
|
|
479
|
-
}) {};
|
|
480
|
-
/**
|
|
481
|
-
* The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is
|
|
482
|
-
* closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.
|
|
483
|
-
*/
|
|
484
|
-
const NamedKey = Schema.Literals([
|
|
485
|
-
"Enter",
|
|
486
|
-
"Tab",
|
|
487
|
-
"Backspace",
|
|
488
|
-
"Delete",
|
|
489
|
-
"Escape",
|
|
490
|
-
"ArrowLeft",
|
|
491
|
-
"ArrowRight",
|
|
492
|
-
"ArrowUp",
|
|
493
|
-
"ArrowDown",
|
|
494
|
-
"Home",
|
|
495
|
-
"End",
|
|
496
|
-
"PageUp",
|
|
497
|
-
"PageDown"
|
|
498
|
-
]);
|
|
499
|
-
/** One printable ASCII character, space included: every one is a key on the US layout. */
|
|
500
|
-
const PrintableKey = Schema.String.check(Schema.isPattern(/^[\x20-\x7e]$/));
|
|
501
|
-
const KeyModifier = Schema.Literals([
|
|
502
|
-
"Shift",
|
|
503
|
-
"Control",
|
|
504
|
-
"Alt",
|
|
505
|
-
"Meta"
|
|
506
|
-
]);
|
|
507
|
-
/** One key, down then up, with any modifiers held around it. */
|
|
508
|
-
const KeyStroke = Schema.Struct({
|
|
509
|
-
key: Schema.Union([NamedKey, PrintableKey]),
|
|
510
|
-
modifiers: Schema.optionalKey(Schema.Array(KeyModifier).check(Schema.makeFilter((held) => new Set(held).size === held.length, { title: "each modifier at most once" })))
|
|
511
|
-
});
|
|
512
|
-
/**
|
|
513
|
-
* One real key stroke. It goes to whatever has focus in the page, exactly as it would for a
|
|
514
|
-
* person, unless `into` names the one element that must already have it. It never focuses that
|
|
515
|
-
* element, because that would hide a scripted focus inside a native-input operation: click it
|
|
516
|
-
* first.
|
|
517
|
-
*/
|
|
518
|
-
var PressRequest = class extends Schema.Class("BrowserPressRequest")({
|
|
519
|
-
...KeyStroke.fields,
|
|
520
|
-
into: Schema.optionalKey(Selector)
|
|
521
|
-
}) {};
|
|
522
|
-
/** Counted in characters, not UTF-16 units, because that is how many strokes it costs. */
|
|
523
|
-
const TypedText = Schema.NonEmptyString.check(Schema.makeFilter((text) => [...text].length <= 256, { title: "at most 256 characters" }), Schema.makeFilter((text) => [...text].every((character) => {
|
|
524
|
-
const point = character.codePointAt(0) ?? 0;
|
|
525
|
-
return point > 31 && point !== 127 && (point < 55296 || point > 57343);
|
|
526
|
-
}), { title: "no control characters or unpaired surrogates" }));
|
|
527
|
-
/**
|
|
528
|
-
* Text as the real key strokes that produce it, with ordered native commands submitted in
|
|
529
|
-
* bounded windows under a single action timeout. An interrupted run is never replayed.
|
|
530
|
-
* A character the US layout cannot produce is inserted as text, as an input method commits it,
|
|
531
|
-
* and raises no key events. Control characters are refused, so a line break can never press
|
|
532
|
-
* Enter from inside a run of text: a named key is always its own `press`. `into` works as it
|
|
533
|
-
* does for `PressRequest`: a guard on where the text lands, never a focus. The exact node is
|
|
534
|
-
* checked before subsequent windows; already submitted input cannot be recalled on focus loss.
|
|
535
|
-
*/
|
|
536
|
-
var TypeRequest = class extends Schema.Class("BrowserTypeRequest")({
|
|
537
|
-
text: TypedText,
|
|
538
|
-
into: Schema.optionalKey(Selector)
|
|
539
|
-
}) {};
|
|
540
|
-
/**
|
|
541
|
-
* What native input was dispatched, where and when. `position` is the point this owner
|
|
542
|
-
* commanded, null before it has placed the pointer, or unknown when Playwright chose the click
|
|
543
|
-
* point internally. For clicks, the interval brackets Playwright's supported click call, which
|
|
544
|
-
* can include its actionability and navigation waits; the browser's exact dispatch instant is
|
|
545
|
-
* unavailable. The interval is on the host monotonic clock that stamps
|
|
546
|
-
* `CapturedFrame.receivedMonotonicNanos`, so input and
|
|
547
|
-
* pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not
|
|
548
|
-
* claim the page finished scrolling, or that any frame shows it. A receipt never says which
|
|
549
|
-
* key was pressed or what was typed.
|
|
550
|
-
*/
|
|
551
|
-
var InputReceipt = class extends Schema.Class("BrowserInputReceipt")({
|
|
552
|
-
target: Target,
|
|
553
|
-
kind: Schema.Literals([
|
|
554
|
-
"pointer-move",
|
|
555
|
-
"hover",
|
|
556
|
-
"wheel",
|
|
557
|
-
"click",
|
|
558
|
-
"press",
|
|
559
|
-
"type"
|
|
560
|
-
]),
|
|
561
|
-
position: Schema.NullOr(ViewportPoint),
|
|
562
|
-
intended: Schema.optionalKey(Schema.Struct({
|
|
563
|
-
position: ViewportPoint,
|
|
564
|
-
relativePosition: ViewportPoint,
|
|
565
|
-
qualification: Schema.Literal("checked-exact-node-sample")
|
|
566
|
-
})),
|
|
567
|
-
delta: Schema.optionalKey(Schema.Struct({
|
|
568
|
-
x: WheelDelta,
|
|
569
|
-
y: WheelDelta
|
|
570
|
-
})),
|
|
571
|
-
startedMonotonicNanos: Schema.BigInt,
|
|
572
|
-
completedMonotonicNanos: Schema.BigInt
|
|
573
|
-
}) {};
|
|
574
|
-
/** `set` dispatched input; `unchanged` needed none, because a toggle already held its state. */
|
|
575
|
-
var FormFieldResult = class extends Schema.Class("BrowserFormFieldResult")({
|
|
576
|
-
elementId: Identifier,
|
|
577
|
-
status: Schema.Literals(["set", "unchanged"]),
|
|
578
|
-
input: Schema.optionalKey(InputReceipt)
|
|
579
|
-
}) {};
|
|
580
|
-
/** The bounded receipts for any toggle clicks and the one optional submit click. */
|
|
581
|
-
var FillFormResult = class extends Schema.Class("BrowserFillFormResult")({
|
|
582
|
-
fields: Schema.Array(FormFieldResult).check(Schema.isMaxLength(32)),
|
|
583
|
-
submitted: Schema.Boolean,
|
|
584
|
-
url: TargetUrl,
|
|
585
|
-
submitInput: Schema.optionalKey(InputReceipt),
|
|
586
|
-
stopped: Schema.optionalKey(FormStop)
|
|
587
|
-
}) {};
|
|
588
|
-
var ScreenshotRequest = class extends Schema.Class("BrowserScreenshotRequest")({ fullPage: Schema.Boolean }) {};
|
|
589
|
-
var NavigationResult = class extends Schema.Class("BrowserNavigationResult")({ url: TargetUrl }) {};
|
|
590
|
-
var ActionResult = class extends Schema.Class("BrowserActionResult")({
|
|
591
|
-
url: TargetUrl,
|
|
592
|
-
/** Present for clicks; fill and scripted scroll results have no native input receipt. */
|
|
593
|
-
input: Schema.optionalKey(InputReceipt)
|
|
594
|
-
}) {};
|
|
595
|
-
var TextResult = class extends Schema.Class("BrowserTextResult")({ text: Schema.String.check(Schema.isMaxLength(8388608)) }) {};
|
|
596
|
-
var ScreenshotResult = class extends Schema.Class("BrowserScreenshotResult")({
|
|
597
|
-
mediaType: Schema.Literal("image/png"),
|
|
598
|
-
bytes: Schema.Uint8Array
|
|
599
|
-
}) {};
|
|
600
|
-
const FileMediaType = Schema.NonEmptyString.check(Schema.isMaxLength(128), Schema.isPattern(/^[a-z0-9][a-z0-9!#$&^_+.-]*\/[a-z0-9][a-z0-9!#$&^_+.-]*$/));
|
|
601
|
-
/** Small selection is in-memory by design: bytes the caller already holds, never a path. */
|
|
602
|
-
var InlineFile = class extends Schema.Class("BrowserInlineFile")({
|
|
603
|
-
name: SafeFilename,
|
|
604
|
-
mediaType: FileMediaType,
|
|
605
|
-
bytes: Schema.Uint8Array.check(Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1048576, { title: "between one byte and one mebibyte" }))
|
|
606
|
-
}) {};
|
|
607
|
-
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" }));
|
|
608
|
-
const AdmissionLimits = Schema.Struct({
|
|
609
|
-
pendingPerPage: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
610
|
-
minimum: 1,
|
|
611
|
-
maximum: 1024
|
|
612
|
-
}))),
|
|
613
|
-
pendingPerSession: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
614
|
-
minimum: 1,
|
|
615
|
-
maximum: 1024
|
|
616
|
-
})))
|
|
617
|
-
});
|
|
618
|
-
/** Finite metadata retention and subscriber resources; native capture bytes have separate limits. */
|
|
619
|
-
const TimelineLimits = Schema.Struct({
|
|
620
|
-
maxDurationMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
621
|
-
minimum: 1,
|
|
622
|
-
maximum: 216e5
|
|
623
|
-
}))),
|
|
624
|
-
maxEvents: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
625
|
-
minimum: 1,
|
|
626
|
-
maximum: 65536
|
|
627
|
-
}))),
|
|
628
|
-
maxBytes: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
629
|
-
minimum: 2048,
|
|
630
|
-
maximum: 67108864
|
|
631
|
-
}))),
|
|
632
|
-
maxSubscribers: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
633
|
-
minimum: 1,
|
|
634
|
-
maximum: 256
|
|
635
|
-
}))),
|
|
636
|
-
maxEventBytes: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
637
|
-
minimum: 2048,
|
|
638
|
-
maximum: 1048576
|
|
639
|
-
})))
|
|
640
|
-
}).check(Schema.makeFilter((limits) => limits.maxEventBytes === void 0 || limits.maxBytes === void 0 || limits.maxEventBytes <= limits.maxBytes, { title: "event metadata fits the retained metadata budget" }));
|
|
641
|
-
const AutomationOptions = Schema.Struct({
|
|
642
|
-
timelineLimits: Schema.optionalKey(TimelineLimits),
|
|
643
|
-
admissionLimits: Schema.optionalKey(AdmissionLimits),
|
|
644
|
-
observationLimits: Schema.optionalKey(Schema.Struct({
|
|
645
|
-
maxSnapshotsPerPage: Schema.Int.check(Schema.isBetween({
|
|
646
|
-
minimum: 1,
|
|
647
|
-
maximum: 128
|
|
648
|
-
})),
|
|
649
|
-
maxSnapshotsPerSession: Schema.Int.check(Schema.isBetween({
|
|
650
|
-
minimum: 1,
|
|
651
|
-
maximum: 4096
|
|
652
|
-
})),
|
|
653
|
-
maxHandlesPerPage: Schema.Int.check(Schema.isBetween({
|
|
654
|
-
minimum: 1,
|
|
655
|
-
maximum: 65536
|
|
656
|
-
})),
|
|
657
|
-
maxHandlesPerSession: Schema.Int.check(Schema.isBetween({
|
|
658
|
-
minimum: 1,
|
|
659
|
-
maximum: 2097152
|
|
660
|
-
})),
|
|
661
|
-
maxBytesPerPage: Schema.Int.check(Schema.isBetween({
|
|
662
|
-
minimum: 1,
|
|
663
|
-
maximum: 268435456
|
|
664
|
-
})),
|
|
665
|
-
maxBytesPerSession: Schema.Int.check(Schema.isBetween({
|
|
666
|
-
minimum: 1,
|
|
667
|
-
maximum: 1073741824
|
|
668
|
-
}))
|
|
669
|
-
})),
|
|
670
|
-
actionTimeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
671
|
-
minimum: 1,
|
|
672
|
-
maximum: 6e4
|
|
673
|
-
}))),
|
|
674
|
-
/** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */
|
|
675
|
-
maxHostReads: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
676
|
-
minimum: 1,
|
|
677
|
-
maximum: 1e6
|
|
678
|
-
}))),
|
|
679
|
-
maxPages: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
|
|
680
|
-
minimum: 1,
|
|
681
|
-
maximum: 32
|
|
682
|
-
}))),
|
|
683
|
-
initialPage: Schema.optionalKey(Schema.Union([Schema.Struct({ targetId: Identifier }), Schema.Struct({ newPage: Schema.Literal(true) })])),
|
|
684
|
-
popupPolicy: Schema.optionalKey(Schema.Literals([
|
|
685
|
-
"retain",
|
|
686
|
-
"close",
|
|
687
|
-
"pause"
|
|
688
|
-
])),
|
|
689
|
-
dialogPolicy: Schema.optionalKey(Schema.Literals(["dismiss", "pause"])),
|
|
690
|
-
pageControl: Schema.optionalKey(Schema.Boolean)
|
|
691
|
-
});
|
|
692
|
-
//#endregion
|
|
693
|
-
export { ActionResult, AdmissionLimits, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, DocumentScroll, FillFormOptions, FillFormRequest, FillFormResult, FillRequest, FormField, FormFieldResult, FormStop, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, Inventory, 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, TimelineLimits, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
|
|
694
|
-
|
|
695
|
-
//# sourceMappingURL=BrowserData.mjs.map
|