screw-bugs 0.0.0-stage → 0.1.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.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +906 -2
  3. package/bin/screw-bugs.js +29 -0
  4. package/dist/browser-playwright/annotate.d.ts +9 -0
  5. package/dist/browser-playwright/annotate.js +86 -0
  6. package/dist/browser-playwright/capture.d.ts +232 -0
  7. package/dist/browser-playwright/capture.js +1049 -0
  8. package/dist/browser-playwright/frames.d.ts +77 -0
  9. package/dist/browser-playwright/frames.js +191 -0
  10. package/dist/browser-playwright/index.d.ts +2 -0
  11. package/dist/browser-playwright/index.js +2 -0
  12. package/dist/browser-playwright/input.d.ts +44 -0
  13. package/dist/browser-playwright/input.js +116 -0
  14. package/dist/browser-playwright/launch.d.ts +21 -0
  15. package/dist/browser-playwright/launch.js +86 -0
  16. package/dist/browser-playwright/page.d.ts +387 -0
  17. package/dist/browser-playwright/page.js +1930 -0
  18. package/dist/build-info.json +5 -0
  19. package/dist/cli/app.d.ts +19 -0
  20. package/dist/cli/app.js +70 -0
  21. package/dist/cli/build-info.d.ts +52 -0
  22. package/dist/cli/build-info.js +82 -0
  23. package/dist/cli/commands.d.ts +14 -0
  24. package/dist/cli/commands.js +308 -0
  25. package/dist/cli/config.d.ts +16 -0
  26. package/dist/cli/config.js +71 -0
  27. package/dist/cli/doctor.d.ts +19 -0
  28. package/dist/cli/doctor.js +113 -0
  29. package/dist/cli/environment.d.ts +20 -0
  30. package/dist/cli/environment.js +34 -0
  31. package/dist/cli/exit-codes.d.ts +29 -0
  32. package/dist/cli/exit-codes.js +28 -0
  33. package/dist/cli/failure.d.ts +20 -0
  34. package/dist/cli/failure.js +15 -0
  35. package/dist/cli/index.d.ts +6 -0
  36. package/dist/cli/index.js +6 -0
  37. package/dist/cli/install-method.d.ts +96 -0
  38. package/dist/cli/install-method.js +148 -0
  39. package/dist/cli/main.d.ts +1 -0
  40. package/dist/cli/main.js +10 -0
  41. package/dist/cli/mcp.d.ts +30 -0
  42. package/dist/cli/mcp.js +309 -0
  43. package/dist/cli/node-version.d.ts +3 -0
  44. package/dist/cli/node-version.js +22 -0
  45. package/dist/cli/operations.d.ts +127 -0
  46. package/dist/cli/operations.js +337 -0
  47. package/dist/cli/package-info.d.ts +22 -0
  48. package/dist/cli/package-info.js +25 -0
  49. package/dist/cli/report-server.d.ts +170 -0
  50. package/dist/cli/report-server.js +387 -0
  51. package/dist/cli/signals.d.ts +37 -0
  52. package/dist/cli/signals.js +61 -0
  53. package/dist/cli/stamp-build.d.ts +1 -0
  54. package/dist/cli/stamp-build.js +9 -0
  55. package/dist/cli/update-check.d.ts +140 -0
  56. package/dist/cli/update-check.js +316 -0
  57. package/dist/cli/uploads.d.ts +16 -0
  58. package/dist/cli/uploads.js +80 -0
  59. package/dist/core/css.d.ts +95 -0
  60. package/dist/core/css.js +436 -0
  61. package/dist/core/engine.d.ts +65 -0
  62. package/dist/core/engine.js +436 -0
  63. package/dist/core/errors.d.ts +66 -0
  64. package/dist/core/errors.js +30 -0
  65. package/dist/core/evidence.d.ts +14 -0
  66. package/dist/core/evidence.js +127 -0
  67. package/dist/core/index.d.ts +12 -0
  68. package/dist/core/index.js +12 -0
  69. package/dist/core/labels.d.ts +47 -0
  70. package/dist/core/labels.js +199 -0
  71. package/dist/core/liveness.d.ts +45 -0
  72. package/dist/core/liveness.js +64 -0
  73. package/dist/core/marks.d.ts +63 -0
  74. package/dist/core/marks.js +410 -0
  75. package/dist/core/services.d.ts +444 -0
  76. package/dist/core/services.js +22 -0
  77. package/dist/core/steps.d.ts +96 -0
  78. package/dist/core/steps.js +656 -0
  79. package/dist/core/uploads.d.ts +49 -0
  80. package/dist/core/uploads.js +133 -0
  81. package/dist/core/video.d.ts +16 -0
  82. package/dist/core/video.js +101 -0
  83. package/dist/core/viewport.d.ts +28 -0
  84. package/dist/core/viewport.js +50 -0
  85. package/dist/report/html.d.ts +37 -0
  86. package/dist/report/html.js +762 -0
  87. package/dist/report/index.d.ts +5 -0
  88. package/dist/report/index.js +5 -0
  89. package/dist/report/markup.d.ts +27 -0
  90. package/dist/report/markup.js +75 -0
  91. package/dist/report/pr-summary.d.ts +11 -0
  92. package/dist/report/pr-summary.js +110 -0
  93. package/dist/report/sha256.d.ts +9 -0
  94. package/dist/report/sha256.js +97 -0
  95. package/dist/report/styles.d.ts +1 -0
  96. package/dist/report/styles.js +328 -0
  97. package/dist/report/view.d.ts +141 -0
  98. package/dist/report/view.js +368 -0
  99. package/dist/report/walkthrough.d.ts +75 -0
  100. package/dist/report/walkthrough.js +458 -0
  101. package/dist/schema/config.d.ts +7 -0
  102. package/dist/schema/config.js +6 -0
  103. package/dist/schema/doctor.d.ts +46 -0
  104. package/dist/schema/doctor.js +23 -0
  105. package/dist/schema/evidence.d.ts +994 -0
  106. package/dist/schema/evidence.js +521 -0
  107. package/dist/schema/findings.d.ts +159 -0
  108. package/dist/schema/findings.js +80 -0
  109. package/dist/schema/index.d.ts +7 -0
  110. package/dist/schema/index.js +7 -0
  111. package/dist/schema/job.d.ts +1724 -0
  112. package/dist/schema/job.js +505 -0
  113. package/dist/schema/ledger.d.ts +951 -0
  114. package/dist/schema/ledger.js +193 -0
  115. package/dist/schema/status.d.ts +7 -0
  116. package/dist/schema/status.js +11 -0
  117. package/dist/store-local/accounts.d.ts +7 -0
  118. package/dist/store-local/accounts.js +9 -0
  119. package/dist/store-local/index.d.ts +3 -0
  120. package/dist/store-local/index.js +3 -0
  121. package/dist/store-local/paths.d.ts +10 -0
  122. package/dist/store-local/paths.js +17 -0
  123. package/dist/store-local/storage.d.ts +20 -0
  124. package/dist/store-local/storage.js +170 -0
  125. package/package.json +73 -4
@@ -0,0 +1,387 @@
1
+ import { Effect, Schema, type Scope } from 'effect';
2
+ import { type Frame, type FrameLocator, type Browser as PlaywrightBrowser, type Page } from 'playwright-core';
3
+ import { type BrowserPage, PageActionFailed } from '../core/index.js';
4
+ import { type Device, type Point, type VisualViewport } from '../schema/index.js';
5
+ /** Waiting for an element to appear before acting on it, unless the step gives `timeoutMs`. */
6
+ export declare const ACTION_TIMEOUT_MS = 5000;
7
+ /**
8
+ * Loading a page: goto and reload wait up to its `load` event; any other page load gets this long
9
+ * from its start to its response. A step's `timeoutMs` changes it (see `loadTimeoutOf`).
10
+ */
11
+ export declare const NAVIGATION_TIMEOUT_MS = 15000;
12
+ /** How long expectText and expectUrl wait for the page to get there, unless given `timeoutMs`. */
13
+ export declare const EXPECT_TIMEOUT_MS = 5000;
14
+ export declare const SCREENSHOT_TIMEOUT_MS = 10000;
15
+ /**
16
+ * How long a click or key press waits after it is dispatched, so that a navigation it causes
17
+ * starts while it is still the current step, such as a form that the Enter key submits.
18
+ */
19
+ export declare const NAVIGATION_START_MS = 250;
20
+ /**
21
+ * The Playwright device profile behind `device: mobile`: an iPhone's viewport, user agent, pixel
22
+ * ratio and touch. We only launch Chromium-based browsers (never WebKit), so the page is still
23
+ * rendered by Chromium; this catches layout and touch problems, not Safari engine quirks.
24
+ */
25
+ export declare const MOBILE_DEVICE = "iPhone 17";
26
+ /** The device as reports show it; the engine is named because mobile is not real Safari. */
27
+ export declare const deviceLabel: (device: Device) => string;
28
+ /** Session videos fit in this box, keeping the viewport's shape, so files stay small. */
29
+ export declare const VIDEO_MAX: {
30
+ readonly width: 1280;
31
+ readonly height: 720;
32
+ };
33
+ /** The size of a session's video for a viewport: the viewport, scaled down into `VIDEO_MAX`. */
34
+ export declare const videoSize: (viewport: {
35
+ readonly width: number;
36
+ readonly height: number;
37
+ }) => {
38
+ width: number;
39
+ height: number;
40
+ };
41
+ /** How long closing a session (and saving its video) may take. */
42
+ export declare const CLOSE_TIMEOUT_MS = 30000;
43
+ /** How long measuring an element for a screenshot or reading page facts may take. */
44
+ export declare const MEASURE_TIMEOUT_MS = 1000;
45
+ /** How long setting up the input observer (`watchInput`) or taking it down may take. */
46
+ export declare const INPUT_SETUP_TIMEOUT_MS = 2000;
47
+ /** How long saving what a screenshot needs besides the image may take. */
48
+ export declare const CAPTURE_TIMEOUT_MS = 3000;
49
+ /**
50
+ * Scrolling through a page before a full-page screenshot (see `revealPage`): at most this many
51
+ * viewports, this far apart, and this long in all, the last part of it for what the scrolling
52
+ * revealed to settle once the page is back where it was.
53
+ */
54
+ export declare const REVEAL: {
55
+ readonly steps: 20;
56
+ readonly stepMs: 120;
57
+ readonly settleMs: 400;
58
+ readonly budgetMs: 3000;
59
+ };
60
+ /** The page, or the document of a frame in it. */
61
+ type Scope = Page | Frame | FrameLocator;
62
+ /** Width and height of a PNG, from its header. */
63
+ export declare const pngSize: (bytes: Uint8Array) => {
64
+ width: number;
65
+ height: number;
66
+ };
67
+ /** How long reading the frames of a screenshot may take, all together. */
68
+ export declare const FRAMES_TIMEOUT_MS = 4000;
69
+ /** A box a page function gives, in CSS pixels: the stored `Box`, held to finite numbers. */
70
+ export declare const PageBox: Schema.Struct<{
71
+ readonly x: Schema.Finite;
72
+ readonly y: Schema.Finite;
73
+ readonly width: Schema.Finite;
74
+ readonly height: Schema.Finite;
75
+ }>;
76
+ /** A trusted input event the main frame's page got, as `observeInput` reports it. */
77
+ export declare const Dispatched: Schema.Struct<{
78
+ readonly type: Schema.Literals<readonly ["pointerdown", "mousedown", "keydown"]>;
79
+ /** When the browser dispatched it to the page, in ms since the epoch. */
80
+ readonly at: Schema.Finite;
81
+ /** A mouse press's `screenX` and `screenY`: where it pressed on the screen (see `framePoint`). */
82
+ readonly x: Schema.optionalKey<Schema.Finite>;
83
+ readonly y: Schema.optionalKey<Schema.Finite>;
84
+ /** Its `clientX` and `clientY`: the same point in the page's layout viewport. */
85
+ readonly clientX: Schema.optionalKey<Schema.Finite>;
86
+ readonly clientY: Schema.optionalKey<Schema.Finite>;
87
+ /** The visual viewport's `scale` then: screen pixels per layout pixel. */
88
+ readonly scale: Schema.optionalKey<Schema.Finite>;
89
+ /** The window's `screenX` and `screenY` then: where the widget is on the screen. */
90
+ readonly windowX: Schema.optionalKey<Schema.Finite>;
91
+ readonly windowY: Schema.optionalKey<Schema.Finite>;
92
+ }>;
93
+ export type Dispatched = typeof Dispatched.Type;
94
+ /** How the page under test is drawn, for placing a press in the video (see `framePoint`). */
95
+ export interface Drawn {
96
+ /** Whether the session emulates a phone, whose visual viewport can be scaled and moved. */
97
+ readonly mobile: boolean;
98
+ /**
99
+ * Whether the browser draws the page on a widget at the screen's origin with nothing above it:
100
+ * Chromium's headless shell, which has no windows (see `widgetAtOrigin`).
101
+ */
102
+ readonly atOrigin: boolean;
103
+ }
104
+ /**
105
+ * Where a mouse press shows in the video, in CSS pixels of `viewport` (the size Playwright set,
106
+ * which the video shows whole); undefined unless that is certain.
107
+ *
108
+ * On a desktop, where nothing but pinch zoom scales the page, the visual viewport is the layout
109
+ * one whenever its `scale` is 1: they are the same size, so it cannot be moved inside it. Then
110
+ * the press is at its `clientX` and `clientY`, the point in the layout viewport, when that is
111
+ * inside the frame. Zoomed (by CDP's `Emulation.setPageScaleFactor`, say), it is not certain.
112
+ *
113
+ * On a phone, not `clientX` and `clientY`: those are in the page's layout viewport, while the
114
+ * video shows the visual viewport, scaled to fill the frame and moved by pinch zoom. A page
115
+ * without a viewport meta tag is laid out 980 wide and shown at 0.41, so a press at `clientX` 250
116
+ * is 25% across the video, not 62%. Measuring the visual viewport (`visualViewport.offsetLeft`,
117
+ * CDP's `Page.getLayoutMetrics`) brings the page's style and layout up to date, which a page can
118
+ * notice (see `observeInput`), so it is not measured. The event's `screenX` and `screenY` are the
119
+ * point on the screen, in CSS pixels: the browser fixed them when it made the event from
120
+ * Playwright's input. They are the point on the frame when the browser draws the page on a widget
121
+ * at the screen's origin with nothing above it (`atOrigin`; the window's own `screenX` and
122
+ * `screenY` are 0 then), and the press is inside the frame.
123
+ *
124
+ * Checked against the layout point: the visual viewport is never left of or above the layout one,
125
+ * so `clientX - x / scale`, its offset, is at least 0, and so is `clientY - y / scale`. A screen
126
+ * point that is not on the widget (a window with the browser's toolbar above the page) fails that
127
+ * when the page is not moved. Device pixels play no part: `screenX` is in CSS pixels at any device
128
+ * scale.
129
+ *
130
+ * Never on a phone in a browser with windows of its own: headed, or Chrome's and Edge's headless
131
+ * mode, which lays its windows out as headed. A window has the browser's toolbars above the page,
132
+ * so `screenY` is that much below the frame's point, and a page whose visual viewport is moved
133
+ * down passes the check all the same (tested: zoomed in twice and moved to 30,100, a press shows
134
+ * 87 px above where `screenY` has it). In Chrome's headless mode the window is also moved (tested
135
+ * on Linux: to 10,10), while a phone's emulation still says 0,0. Nothing on the event tells these apart, so a phone in
136
+ * such a browser records no point.
137
+ */
138
+ export declare const framePoint: (dispatched: Dispatched, viewport: {
139
+ readonly width: number;
140
+ readonly height: number;
141
+ }, drawn: Drawn) => Point | undefined;
142
+ /**
143
+ * Whether `browser` draws its pages on a widget at the screen's origin with nothing above it:
144
+ * Chromium's headless shell, which Playwright runs headless when no channel is given, and which
145
+ * names itself `HeadlessChrome` in CDP's `Browser.getVersion`. Any other browser has windows:
146
+ * Chrome and Chromium, headed or in their headless mode, name themselves `Chrome`. False when it
147
+ * cannot be told.
148
+ */
149
+ export declare const widgetAtOrigin: (browser: PlaywrightBrowser) => Effect.Effect<boolean>;
150
+ /**
151
+ * The visual viewport a screenshot's boxes can be placed with (see `VisualViewport`): the one
152
+ * `captureState` measured with the page's own boxes (`seen`), when the page still showed at its
153
+ * scale once every box was measured (`scaleNow`), so the page was not zoomed meanwhile. A
154
+ * full-page screenshot shows the layout itself, where boxes measured from the visual viewport's
155
+ * top left (`boundingBox`'s) are where they are only when it is at the layout's: so only when it
156
+ * shows all of the layout's width and height at once, at a scale of at most 1. Else undefined:
157
+ * where the boxes show cannot be told for sure.
158
+ */
159
+ export declare const visualOf: (seen: VisualViewport | undefined, scaleNow: number | undefined, fullPage: boolean) => VisualViewport | undefined;
160
+ /** The trusted input the page under test got, while an action ran (see `watchInput`). */
161
+ export interface InputWatch {
162
+ /**
163
+ * Runs `act` untouched, and gives with its result `dispatched`: what reads the first event of
164
+ * `types` that reached the page while it ran (dispatched no earlier than when it began and no
165
+ * later than when it returned); undefined when none was heard. Read it as late as the step
166
+ * allows, after its pause: the browser reports an event on another channel than the one `act`
167
+ * returns on, so it may come in only after `act` has returned.
168
+ */
169
+ readonly during: <A, E>(types: ReadonlySet<Dispatched['type']>, act: Effect.Effect<A, E>) => Effect.Effect<{
170
+ readonly value: A;
171
+ readonly dispatched: Effect.Effect<Dispatched | undefined>;
172
+ }, E>;
173
+ }
174
+ /** What `frameElementInfo` gives, decoded as it comes back from the page (see `FrameElementInfo`). */
175
+ export declare const FrameInfo: Schema.Struct<{
176
+ readonly tag: Schema.String;
177
+ readonly id: Schema.optionalKey<Schema.String>;
178
+ readonly classes: Schema.optionalKey<Schema.$Array<Schema.String>>;
179
+ readonly testId: Schema.optionalKey<Schema.String>;
180
+ readonly attrs: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
181
+ readonly cutAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
182
+ readonly omittedAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
183
+ readonly moreAttrs: Schema.optionalKey<Schema.Boolean>;
184
+ readonly moreClasses: Schema.optionalKey<Schema.Boolean>;
185
+ readonly foreign: Schema.optionalKey<Schema.Boolean>;
186
+ readonly role: Schema.optionalKey<Schema.String>;
187
+ readonly name: Schema.optionalKey<Schema.String>;
188
+ readonly ancestors: Schema.$Array<Schema.Struct<{
189
+ tag: Schema.String;
190
+ id: Schema.optionalKey<Schema.String>;
191
+ classes: Schema.optionalKey<Schema.$Array<Schema.String>>;
192
+ testId: Schema.optionalKey<Schema.String>;
193
+ attrs: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
194
+ cutAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
195
+ omittedAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
196
+ moreAttrs: Schema.optionalKey<Schema.Boolean>;
197
+ moreClasses: Schema.optionalKey<Schema.Boolean>;
198
+ foreign: Schema.optionalKey<Schema.Boolean>;
199
+ }>>;
200
+ readonly moreAncestors: Schema.optionalKey<Schema.Boolean>;
201
+ readonly visible: Schema.Boolean;
202
+ readonly opacity: Schema.Finite;
203
+ readonly clip: Schema.optionalKey<Schema.Struct<{
204
+ readonly x: Schema.Finite;
205
+ readonly y: Schema.Finite;
206
+ readonly width: Schema.Finite;
207
+ readonly height: Schema.Finite;
208
+ }>>;
209
+ readonly left: Schema.Finite;
210
+ readonly top: Schema.Finite;
211
+ readonly width: Schema.Finite;
212
+ readonly height: Schema.Finite;
213
+ readonly offsetWidth: Schema.Finite;
214
+ readonly offsetHeight: Schema.Finite;
215
+ }>;
216
+ /** How often `watchText` looks again, while it waits and while it watches. */
217
+ export declare const WATCH_POLL_MS = 200;
218
+ /**
219
+ * The most frames `watchText` reads where it looks; where more show, it cannot be told free of a
220
+ * text. It lists at most `FRAMES_LISTED_MAX` frames of the page to tell which those are.
221
+ */
222
+ export declare const ABSENCE_FRAMES_MAX = 20;
223
+ export declare const FRAMES_LISTED_MAX = 200;
224
+ /**
225
+ * A frame that shows less than this many CSS pixels both across and down, where it shows (a 1×1
226
+ * tracking pixel), is read like any other, but when it cannot be read or stays empty, that
227
+ * blocks nothing: it cannot show text a person can read.
228
+ */
229
+ export declare const READABLE_FRAME_PX = 16;
230
+ /** How long reading the closed shadow roots of one look may take, all together. */
231
+ export declare const CLOSED_ROOTS_TIMEOUT_MS = 3000;
232
+ /**
233
+ * The longest one look's read of closed shadow roots may take once `watchText` reads them on every
234
+ * look: past it, they cannot be watched as closely as the rest, so the check is blocked.
235
+ */
236
+ export declare const CLOSED_POLL_BUDGET_MS = 1000;
237
+ /** How long `watchText` remembers whether an empty document's closed shadow roots show anything. */
238
+ export declare const CLOSED_SHOWS_MS = 1000;
239
+ /** A node as CDP's `DOM.getDocument` gives it, as far as finding shadow roots needs. */
240
+ interface CdpNode {
241
+ readonly backendNodeId: number;
242
+ readonly shadowRootType?: string;
243
+ readonly children?: ReadonlyArray<CdpNode>;
244
+ readonly shadowRoots?: ReadonlyArray<CdpNode>;
245
+ readonly contentDocument?: CdpNode;
246
+ }
247
+ declare const CdpNode: Schema.Codec<CdpNode>;
248
+ /** CDP's answers, decoded: they are outside input like any other. */
249
+ export declare const CdpDocument: Schema.Struct<{
250
+ readonly root: Schema.Codec<CdpNode, CdpNode, never, never>;
251
+ }>;
252
+ export declare const CdpCalled: Schema.Struct<{
253
+ readonly result: Schema.Struct<{
254
+ readonly value: Schema.Union<readonly [Schema.Struct<{
255
+ readonly _tag: Schema.Literal<"outside">;
256
+ }>, Schema.Struct<{
257
+ readonly _tag: Schema.Literal<"content">;
258
+ readonly shows: Schema.Boolean;
259
+ }>, Schema.Struct<{
260
+ readonly as: Schema.Literals<readonly ["text", "alt", "label"]>;
261
+ readonly value: Schema.String;
262
+ readonly near: Schema.optionalKey<Schema.String>;
263
+ readonly _tag: Schema.Literal<"found">;
264
+ readonly index: Schema.Int;
265
+ }>, Schema.Struct<{
266
+ readonly _tag: Schema.Literal<"absent">;
267
+ readonly index: Schema.Int;
268
+ }>, Schema.Struct<{
269
+ readonly _tag: Schema.Literal<"incomplete">;
270
+ readonly reason: Schema.String;
271
+ readonly index: Schema.Int;
272
+ }>]>;
273
+ }>;
274
+ readonly exceptionDetails: Schema.optionalKey<Schema.Unknown>;
275
+ }>;
276
+ /**
277
+ * What `captureState` gives, decoded as it comes back from the page: its candidates and nodes are
278
+ * those of a screenshot's page state, in CSS pixels and without a frame.
279
+ */
280
+ export declare const CapturedState: Schema.Struct<{
281
+ readonly scale: Schema.Finite;
282
+ readonly scrollX: Schema.Finite;
283
+ readonly scrollY: Schema.Finite;
284
+ readonly candidates: Schema.$Array<Schema.Struct<{
285
+ readonly tag: Schema.String;
286
+ readonly role: Schema.optionalKey<Schema.String>;
287
+ readonly name: Schema.optionalKey<Schema.String>;
288
+ readonly text: Schema.optionalKey<Schema.String>;
289
+ readonly label: Schema.optionalKey<Schema.String>;
290
+ readonly alt: Schema.optionalKey<Schema.String>;
291
+ readonly src: Schema.optionalKey<Schema.String>;
292
+ readonly href: Schema.optionalKey<Schema.String>;
293
+ readonly id: Schema.optionalKey<Schema.String>;
294
+ readonly classes: Schema.optionalKey<Schema.$Array<Schema.String>>;
295
+ readonly testId: Schema.optionalKey<Schema.String>;
296
+ readonly attrs: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
297
+ readonly cutAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
298
+ readonly omittedAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
299
+ readonly moreAttrs: Schema.optionalKey<Schema.Boolean>;
300
+ readonly moreClasses: Schema.optionalKey<Schema.Boolean>;
301
+ readonly foreign: Schema.optionalKey<Schema.Boolean>;
302
+ readonly up: Schema.optionalKey<Schema.Int>;
303
+ readonly upCut: Schema.optionalKey<Schema.Boolean>;
304
+ readonly parent: Schema.optionalKey<Schema.Int>;
305
+ readonly visible: Schema.optionalKey<Schema.Boolean>;
306
+ readonly frame: Schema.optionalKey<Schema.Int>;
307
+ readonly box: Schema.Struct<{
308
+ readonly x: Schema.Finite;
309
+ readonly y: Schema.Finite;
310
+ readonly width: Schema.Finite;
311
+ readonly height: Schema.Finite;
312
+ }>;
313
+ readonly content: Schema.optionalKey<Schema.Struct<{
314
+ readonly x: Schema.Finite;
315
+ readonly y: Schema.Finite;
316
+ readonly width: Schema.Finite;
317
+ readonly height: Schema.Finite;
318
+ }>>;
319
+ }>>;
320
+ readonly nodes: Schema.$Array<Schema.Struct<{
321
+ readonly tag: Schema.String;
322
+ readonly id: Schema.optionalKey<Schema.String>;
323
+ readonly classes: Schema.optionalKey<Schema.$Array<Schema.String>>;
324
+ readonly testId: Schema.optionalKey<Schema.String>;
325
+ readonly attrs: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
326
+ readonly cutAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
327
+ readonly omittedAttrs: Schema.optionalKey<Schema.$Array<Schema.String>>;
328
+ readonly moreAttrs: Schema.optionalKey<Schema.Boolean>;
329
+ readonly moreClasses: Schema.optionalKey<Schema.Boolean>;
330
+ readonly foreign: Schema.optionalKey<Schema.Boolean>;
331
+ readonly parent: Schema.optionalKey<Schema.Int>;
332
+ }>>;
333
+ readonly truncated: Schema.optionalKey<Schema.Struct<{
334
+ readonly found: Schema.Int;
335
+ readonly complete: Schema.Boolean;
336
+ readonly unsaved: Schema.$Record<Schema.String, Schema.Int>;
337
+ readonly nested: Schema.$Array<Schema.Int>;
338
+ }>>;
339
+ /** Decoded on its own (`seenOf`): one that does not fit leaves the rest as it is. */
340
+ readonly visual: Schema.optionalKey<Schema.Unknown>;
341
+ }>;
342
+ /** What `contentOf` gives. */
343
+ export declare const ContentBox: Schema.UndefinedOr<Schema.Struct<{
344
+ readonly x: Schema.Finite;
345
+ readonly y: Schema.Finite;
346
+ readonly width: Schema.Finite;
347
+ readonly height: Schema.Finite;
348
+ }>>;
349
+ /** What `nearText` gives. */
350
+ export declare const NearText: Schema.UndefinedOr<Schema.String>;
351
+ /** How much of one document `findText` reads before it says it could not read it whole. */
352
+ export declare const ABSENCE_BUDGET: {
353
+ readonly nodesMax: 200000;
354
+ readonly labelsMax: 20000;
355
+ };
356
+ /**
357
+ * How long looking for what a step did not find elsewhere may take, all together (see
358
+ * `findElsewhere`), and how long finding the frame the step named may take within it.
359
+ */
360
+ export declare const ELSEWHERE_TIMEOUT_MS = 1000;
361
+ /**
362
+ * One session: a fresh context (no cookies or storage from other runs) with one tab that every
363
+ * case of the session runs in, recorded as one continuous video. Tabs and windows a case opens
364
+ * are in the same context and are closed before the next case. Closed with its scope; the video
365
+ * is saved then too, so a run that is stopped keeps it.
366
+ *
367
+ * Playwright records each tab's video separately, so only the session's own tab is kept: the
368
+ * videos of tabs the cases opened are deleted. Recording needs Playwright's ffmpeg; without it,
369
+ * the session runs without a video and says why.
370
+ */
371
+ export declare const newSession: (browser: PlaywrightBrowser, device: Device, video: {
372
+ readonly dir: string;
373
+ readonly path: string;
374
+ } | undefined,
375
+ /** Whether to watch the input the page gets, for recording actions; for tests to compare. */
376
+ observed?: boolean) => Effect.Effect<{
377
+ page: BrowserPage;
378
+ beginCase: (options: {
379
+ readonly continues?: boolean;
380
+ } | undefined) => Effect.Effect<void, never, never>;
381
+ crashed: Effect.Effect<string | undefined, never, never>;
382
+ videoStartedAt: number;
383
+ close: Effect.Effect<{
384
+ videoProblem: string | undefined;
385
+ }, never, never>;
386
+ }, PageActionFailed, Scope.Scope>;
387
+ export {};