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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +150 -10
  2. package/dist/{Association-zlgInoaj.mjs → Association-BsSfBYVx.mjs} +14 -10
  3. package/dist/Association-BsSfBYVx.mjs.map +1 -0
  4. package/dist/{Bootstrap-Be-2Ddmh.mjs → Bootstrap-CeQOWBy6.mjs} +6 -4
  5. package/dist/Bootstrap-CeQOWBy6.mjs.map +1 -0
  6. package/dist/Bootstrap.mjs +1 -1
  7. package/dist/Browser.d.mts +13 -1
  8. package/dist/Browser.mjs.map +1 -1
  9. package/dist/{BrowserData-DJAnUHoZ.d.mts → BrowserData-CRuxEZcn.d.mts} +90 -10
  10. package/dist/BrowserData.d.mts +2 -2
  11. package/dist/BrowserData.mjs +85 -7
  12. package/dist/BrowserData.mjs.map +1 -1
  13. package/dist/BrowserRuntime-Coz-5DYb.d.mts +143 -0
  14. package/dist/{BrowserRuntime-fZz1b0VI.mjs → BrowserRuntime-DViKNUdD.mjs} +2819 -2206
  15. package/dist/BrowserRuntime-DViKNUdD.mjs.map +1 -0
  16. package/dist/BrowserRuntime.d.mts +3 -139
  17. package/dist/BrowserRuntime.mjs +1 -1
  18. package/dist/Capture.d.mts +15 -1
  19. package/dist/Capture.mjs +58 -22
  20. package/dist/Capture.mjs.map +1 -1
  21. package/dist/{CaptureData-AmqVP_Ba.mjs → CaptureData-B5-mXlyq.mjs} +24 -6
  22. package/dist/CaptureData-B5-mXlyq.mjs.map +1 -0
  23. package/dist/CaptureData.d.mts +11 -2
  24. package/dist/CaptureData.mjs +1 -1
  25. package/dist/Chromium.d.mts +4 -3
  26. package/dist/Chromium.mjs +22 -16
  27. package/dist/Chromium.mjs.map +1 -1
  28. package/dist/Errors.d.mts +2 -2
  29. package/dist/Errors.mjs +1 -0
  30. package/dist/Errors.mjs.map +1 -1
  31. package/dist/PageControl.d.mts +1 -1
  32. package/dist/PageControl.mjs +1 -1
  33. package/dist/Testing.d.mts +437 -0
  34. package/dist/Testing.mjs +1561 -0
  35. package/dist/Testing.mjs.map +1 -0
  36. package/package.json +5 -1
  37. package/dist/Association-zlgInoaj.mjs.map +0 -1
  38. package/dist/Bootstrap-Be-2Ddmh.mjs.map +0 -1
  39. package/dist/BrowserRuntime-fZz1b0VI.mjs.map +0 -1
  40. package/dist/CaptureData-AmqVP_Ba.mjs.map +0 -1
@@ -0,0 +1,437 @@
1
+ import { BrowserError, BrowserOperation, BrowserOutcome, BrowserReason, InitializationError } from "./Errors.mjs";
2
+ import { a as BrowserPolicy, et as Viewport, n as AutomationOptions, nt as ViewportPoint } from "./BrowserData-CRuxEZcn.mjs";
3
+ import { BrowserSession, OpenOptions } from "./Browser.mjs";
4
+ import { r as BrowserBinding } from "./BrowserRuntime-Coz-5DYb.mjs";
5
+ import { Crypto, Effect, Layer, Option, Schema, Scope } from "effect";
6
+ //#region src/internal/testing/Frame.d.ts
7
+ /** A valid 64×48 baseline JPEG, the bytes a scripted capture frame carries by default. */
8
+ declare const jpegFrame: () => Uint8Array;
9
+ //#endregion
10
+ //#region src/internal/testing/Script.d.ts
11
+ /** Host-only facts a scripted control reports beyond what its observed fields imply. */
12
+ export declare const ControlFactsScript: Schema.Struct<{
13
+ readonly editable: Schema.optionalKey<Schema.Boolean>;
14
+ readonly formMethod: Schema.optionalKey<Schema.Literals<readonly ["get", "post", "dialog"]>>;
15
+ readonly hitTest: Schema.optionalKey<Schema.Literals<readonly ["self", "covered", "uncertain", "unsampled"]>>;
16
+ readonly placement: Schema.optionalKey<Schema.Literals<readonly ["inside", "partial", "outside"]>>;
17
+ readonly autocomplete: Schema.optionalKey<Schema.String>;
18
+ readonly box: Schema.optionalKey<Schema.Struct<{
19
+ readonly x: Schema.Finite;
20
+ readonly y: Schema.Finite;
21
+ readonly width: Schema.Finite;
22
+ readonly height: Schema.Finite;
23
+ }>>;
24
+ }>;
25
+ /**
26
+ * One control a scripted document offers. `id` becomes the issued `elementId`, so a scripted
27
+ * model turn can name it statically. Nothing here is a live capability.
28
+ */
29
+ export declare const ControlScript: Schema.Struct<{
30
+ readonly id: Schema.NonEmptyString;
31
+ readonly kind: Schema.Literals<readonly ["link", "button", "input", "select", "textarea", "other"]>;
32
+ readonly label: Schema.String;
33
+ readonly disabled: Schema.optionalKey<Schema.Boolean>;
34
+ /** A checkbox or radio `input` without it starts unchecked, as a real one does. */
35
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
36
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
37
+ readonly inputType: Schema.optionalKey<Schema.String>;
38
+ readonly required: Schema.optionalKey<Schema.Boolean>;
39
+ readonly multiple: Schema.optionalKey<Schema.Boolean>;
40
+ /** The scripted select this option belongs to; it must be in the same document. */
41
+ readonly selectElementId: Schema.optionalKey<Schema.NonEmptyString>;
42
+ /**
43
+ * The link target, or the form action a submit control sends to: reported as the control's
44
+ * destination fact, and where activating it leads. Only a `link`, or a `button`/`input` whose
45
+ * `inputType` is `submit` or `image`, has one, because that is all a real document reports.
46
+ */
47
+ readonly destination: Schema.optionalKey<Schema.NonEmptyString>;
48
+ /** Where activation leads with no destination fact: what an `onclick` handler does. */
49
+ readonly activates: Schema.optionalKey<Schema.NonEmptyString>;
50
+ /** Outside the viewport: absent from viewport readings and refused by hover. */
51
+ readonly offscreen: Schema.optionalKey<Schema.Boolean>;
52
+ /** What `readText({ selector: "#id" })` returns; defaults to the label. */
53
+ readonly text: Schema.optionalKey<Schema.String>;
54
+ /** Clicking for a download completes one with this name. */
55
+ readonly download: Schema.optionalKey<Schema.NonEmptyString>;
56
+ readonly facts: Schema.optionalKey<Schema.Struct<{
57
+ readonly editable: Schema.optionalKey<Schema.Boolean>;
58
+ readonly formMethod: Schema.optionalKey<Schema.Literals<readonly ["get", "post", "dialog"]>>;
59
+ readonly hitTest: Schema.optionalKey<Schema.Literals<readonly ["self", "covered", "uncertain", "unsampled"]>>;
60
+ readonly placement: Schema.optionalKey<Schema.Literals<readonly ["inside", "partial", "outside"]>>;
61
+ readonly autocomplete: Schema.optionalKey<Schema.String>;
62
+ readonly box: Schema.optionalKey<Schema.Struct<{
63
+ readonly x: Schema.Finite;
64
+ readonly y: Schema.Finite;
65
+ readonly width: Schema.Finite;
66
+ readonly height: Schema.Finite;
67
+ }>>;
68
+ }>>;
69
+ }>;
70
+ export type ControlScript = typeof ControlScript.Type;
71
+ export declare const DocumentScript: Schema.Struct<{
72
+ readonly url: Schema.NonEmptyString;
73
+ readonly title: Schema.optionalKey<Schema.String>;
74
+ readonly text: Schema.String;
75
+ readonly controls: Schema.optionalKey<Schema.$Array<Schema.Struct<{
76
+ readonly id: Schema.NonEmptyString;
77
+ readonly kind: Schema.Literals<readonly ["link", "button", "input", "select", "textarea", "other"]>;
78
+ readonly label: Schema.String;
79
+ readonly disabled: Schema.optionalKey<Schema.Boolean>;
80
+ /** A checkbox or radio `input` without it starts unchecked, as a real one does. */
81
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
82
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
83
+ readonly inputType: Schema.optionalKey<Schema.String>;
84
+ readonly required: Schema.optionalKey<Schema.Boolean>;
85
+ readonly multiple: Schema.optionalKey<Schema.Boolean>;
86
+ /** The scripted select this option belongs to; it must be in the same document. */
87
+ readonly selectElementId: Schema.optionalKey<Schema.NonEmptyString>;
88
+ /**
89
+ * The link target, or the form action a submit control sends to: reported as the control's
90
+ * destination fact, and where activating it leads. Only a `link`, or a `button`/`input` whose
91
+ * `inputType` is `submit` or `image`, has one, because that is all a real document reports.
92
+ */
93
+ readonly destination: Schema.optionalKey<Schema.NonEmptyString>;
94
+ /** Where activation leads with no destination fact: what an `onclick` handler does. */
95
+ readonly activates: Schema.optionalKey<Schema.NonEmptyString>;
96
+ /** Outside the viewport: absent from viewport readings and refused by hover. */
97
+ readonly offscreen: Schema.optionalKey<Schema.Boolean>;
98
+ /** What `readText({ selector: "#id" })` returns; defaults to the label. */
99
+ readonly text: Schema.optionalKey<Schema.String>;
100
+ /** Clicking for a download completes one with this name. */
101
+ readonly download: Schema.optionalKey<Schema.NonEmptyString>;
102
+ readonly facts: Schema.optionalKey<Schema.Struct<{
103
+ readonly editable: Schema.optionalKey<Schema.Boolean>;
104
+ readonly formMethod: Schema.optionalKey<Schema.Literals<readonly ["get", "post", "dialog"]>>;
105
+ readonly hitTest: Schema.optionalKey<Schema.Literals<readonly ["self", "covered", "uncertain", "unsampled"]>>;
106
+ readonly placement: Schema.optionalKey<Schema.Literals<readonly ["inside", "partial", "outside"]>>;
107
+ readonly autocomplete: Schema.optionalKey<Schema.String>;
108
+ readonly box: Schema.optionalKey<Schema.Struct<{
109
+ readonly x: Schema.Finite;
110
+ readonly y: Schema.Finite;
111
+ readonly width: Schema.Finite;
112
+ readonly height: Schema.Finite;
113
+ }>>;
114
+ }>>;
115
+ }>>>;
116
+ }>;
117
+ export type DocumentScript = typeof DocumentScript.Type;
118
+ /**
119
+ * The documents a scripted browser can show. A navigation to a listed address reaches that
120
+ * document; an unlisted address reaches an empty document with that address.
121
+ */
122
+ export declare const Script: Schema.Struct<{
123
+ readonly documents: Schema.$Array<Schema.Struct<{
124
+ readonly url: Schema.NonEmptyString;
125
+ readonly title: Schema.optionalKey<Schema.String>;
126
+ readonly text: Schema.String;
127
+ readonly controls: Schema.optionalKey<Schema.$Array<Schema.Struct<{
128
+ readonly id: Schema.NonEmptyString;
129
+ readonly kind: Schema.Literals<readonly ["link", "button", "input", "select", "textarea", "other"]>;
130
+ readonly label: Schema.String;
131
+ readonly disabled: Schema.optionalKey<Schema.Boolean>;
132
+ /** A checkbox or radio `input` without it starts unchecked, as a real one does. */
133
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
134
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
135
+ readonly inputType: Schema.optionalKey<Schema.String>;
136
+ readonly required: Schema.optionalKey<Schema.Boolean>;
137
+ readonly multiple: Schema.optionalKey<Schema.Boolean>;
138
+ /** The scripted select this option belongs to; it must be in the same document. */
139
+ readonly selectElementId: Schema.optionalKey<Schema.NonEmptyString>;
140
+ /**
141
+ * The link target, or the form action a submit control sends to: reported as the control's
142
+ * destination fact, and where activating it leads. Only a `link`, or a `button`/`input` whose
143
+ * `inputType` is `submit` or `image`, has one, because that is all a real document reports.
144
+ */
145
+ readonly destination: Schema.optionalKey<Schema.NonEmptyString>;
146
+ /** Where activation leads with no destination fact: what an `onclick` handler does. */
147
+ readonly activates: Schema.optionalKey<Schema.NonEmptyString>;
148
+ /** Outside the viewport: absent from viewport readings and refused by hover. */
149
+ readonly offscreen: Schema.optionalKey<Schema.Boolean>;
150
+ /** What `readText({ selector: "#id" })` returns; defaults to the label. */
151
+ readonly text: Schema.optionalKey<Schema.String>;
152
+ /** Clicking for a download completes one with this name. */
153
+ readonly download: Schema.optionalKey<Schema.NonEmptyString>;
154
+ readonly facts: Schema.optionalKey<Schema.Struct<{
155
+ readonly editable: Schema.optionalKey<Schema.Boolean>;
156
+ readonly formMethod: Schema.optionalKey<Schema.Literals<readonly ["get", "post", "dialog"]>>;
157
+ readonly hitTest: Schema.optionalKey<Schema.Literals<readonly ["self", "covered", "uncertain", "unsampled"]>>;
158
+ readonly placement: Schema.optionalKey<Schema.Literals<readonly ["inside", "partial", "outside"]>>;
159
+ readonly autocomplete: Schema.optionalKey<Schema.String>;
160
+ readonly box: Schema.optionalKey<Schema.Struct<{
161
+ readonly x: Schema.Finite;
162
+ readonly y: Schema.Finite;
163
+ readonly width: Schema.Finite;
164
+ readonly height: Schema.Finite;
165
+ }>>;
166
+ }>>;
167
+ }>>>;
168
+ }>>;
169
+ /** The first page's document at connect; defaults to the first listed document. */
170
+ readonly start: Schema.optionalKey<Schema.NonEmptyString>;
171
+ /**
172
+ * What successive connection attempts to one browser do: `refuse` fails the attempt as an
173
+ * unreachable endpoint would, and `accept` connects. Attempts past the list connect.
174
+ */
175
+ readonly connections: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["accept", "refuse"]>>>;
176
+ }>;
177
+ export type Script = typeof Script.Type;
178
+ declare const ScriptedReference_base: Schema.Class<ScriptedReference, Schema.Struct<{
179
+ readonly provider: Schema.Literal<"scripted">;
180
+ readonly id: Schema.NonEmptyString;
181
+ }>, {}>;
182
+ export declare class ScriptedReference extends ScriptedReference_base {}
183
+ declare const ScriptedCleanupIssue_base: Schema.Class<ScriptedCleanupIssue, Schema.Struct<{
184
+ readonly step: Schema.Literals<readonly ["fence", "capture", "initialization", "disconnect"]>;
185
+ readonly reason: Schema.Literals<readonly ["timeout", "failed", "interrupted"]>;
186
+ }>, {}>;
187
+ export declare class ScriptedCleanupIssue extends ScriptedCleanupIssue_base {}
188
+ declare const ScriptedCleanupResult_base: Schema.Class<ScriptedCleanupResult, Schema.Struct<{
189
+ readonly reference: typeof ScriptedReference;
190
+ readonly connection: Schema.Literals<readonly ["closed", "failed", "not-connected", "pending"]>;
191
+ readonly issues: Schema.$Array<typeof ScriptedCleanupIssue>;
192
+ }>, {}>;
193
+ /** Connection teardown facts for a scripted browser; there is no process or provider status. */
194
+ export declare class ScriptedCleanupResult extends ScriptedCleanupResult_base {}
195
+ /**
196
+ * The operations whose next call a test may script. `disconnect` is the owner's native teardown
197
+ * of a connection: a `Fail` makes it fail and a `Hold` parks it, however long cleanup waits.
198
+ */
199
+ export declare const ScriptableOperation: Schema.Literals<("capture-stop" | "checkpoint" | "click" | "click-and-wait" | "close-page" | "control-facts" | "disconnect" | "download-action" | "file-chooser" | "fill" | "fill-form" | "hover" | "list-frames" | "list-pages" | "navigate" | "navigate-stop" | "new-page" | "observe" | "page-resume" | "page-suspend" | "pointer-move" | "press" | "read-text" | "resize" | "revalidate" | "screenshot" | "scroll" | "select-files" | "select-frame" | "select-option" | "select-page" | "type" | "wait" | "wheel")[]>;
200
+ export type ScriptableOperation = typeof ScriptableOperation.Type;
201
+ /** A held native call: the test learns that it arrived, then decides when it may finish. */
202
+ interface Gate {
203
+ /** Resolves once the held call has reached the engine. */
204
+ readonly reached: Effect.Effect<void>;
205
+ /** Lets the held call finish normally. */
206
+ readonly open: Effect.Effect<void>;
207
+ }
208
+ /**
209
+ * What the next admitted call of one operation does instead of following the document model.
210
+ * `Fail` with `outcome: "unknown"` dispatches first and then fails, so the owner fences the
211
+ * session; the other outcomes never dispatch. `Hold` parks the call until its gate opens, before
212
+ * or after native dispatch. `Disconnect` drops the connection inside the call.
213
+ */
214
+ type ScriptedOutcome = {
215
+ readonly _tag: "Fail";
216
+ readonly reason: BrowserReason;
217
+ readonly outcome: BrowserOutcome;
218
+ } | {
219
+ readonly _tag: "Hold";
220
+ readonly gate: Gate;
221
+ readonly dispatched: boolean;
222
+ } | {
223
+ readonly _tag: "Disconnect";
224
+ readonly dispatched?: boolean;
225
+ };
226
+ /** Evidence of one admitted call. It never carries filled values, typed text or addresses. */
227
+ interface RecordedCall {
228
+ readonly sequence: number;
229
+ readonly operation: BrowserOperation;
230
+ readonly pageId: string;
231
+ readonly elementId?: string;
232
+ readonly selector?: string;
233
+ /** The engine was asked to act: the moment after which an outcome can be unknown. */
234
+ readonly dispatched: boolean;
235
+ readonly settled: "completed" | "failed" | "pending";
236
+ }
237
+ /** One frame a test hands to a running capture interval; omitted fields take defaults. */
238
+ interface ScriptedFrame {
239
+ readonly bytes?: Uint8Array;
240
+ /** Presentation time in Unix milliseconds; defaults to forty milliseconds after the last frame. */
241
+ readonly timestamp?: number;
242
+ readonly viewportWidth?: number;
243
+ readonly viewportHeight?: number;
244
+ }
245
+ /**
246
+ * How one connection to a scripted browser went: refused by the script, still open, closed by
247
+ * its owner, dropped (as `disconnect` or an armed `Disconnect` drops it), or failed to close.
248
+ */
249
+ type ScriptedConnection = "refused" | "open" | "closed" | "dropped" | "close-failed";
250
+ /** What a page would see when it calls a registered binding: a reply, or a bare rejection. */
251
+ type BindingReply = {
252
+ readonly ok: true;
253
+ readonly output: unknown;
254
+ } | {
255
+ readonly ok: false;
256
+ };
257
+ /**
258
+ * The test's side of one scripted browser. The browser outlives any one connection, as a
259
+ * keep-alive browser does: a reconnection finds the same pages, and this handle keeps working
260
+ * while no connection is open.
261
+ */
262
+ interface ScriptedControl {
263
+ readonly calls: Effect.Effect<ReadonlyArray<RecordedCall>>;
264
+ /** Arm the next admitted call of one operation. Arms are consumed one-shot in arming order. */
265
+ readonly next: (operation: ScriptableOperation, outcome: ScriptedOutcome) => Effect.Effect<void>;
266
+ readonly gate: Effect.Effect<Gate>;
267
+ readonly document: {
268
+ /**
269
+ * The document of the page selected last, whether or not a connection is open; `Closed`
270
+ * once that page is closed.
271
+ */
272
+ readonly current: Effect.Effect<DocumentScript, BrowserError>;
273
+ /**
274
+ * The document is replaced, as a navigation replaces it: every retained node and every
275
+ * pending wait on that page becomes stale, and a capture learns of a new document.
276
+ */
277
+ readonly replace: (next: DocumentScript) => Effect.Effect<void, BrowserError>;
278
+ /**
279
+ * The same document changes, as its own script would change it: controls that keep their
280
+ * id keep their identity, removed ones detach, waits re-evaluate, nothing goes stale.
281
+ */
282
+ readonly update: (next: DocumentScript) => Effect.Effect<void, BrowserError>;
283
+ /** What `fill` and `type` put into which control id. Never part of `calls`. */
284
+ readonly values: Effect.Effect<ReadonlyMap<string, string>>;
285
+ /** File names attached to which control id by file selection. */
286
+ readonly files: Effect.Effect<ReadonlyMap<string, ReadonlyArray<string>>>;
287
+ };
288
+ /**
289
+ * The last point a pointer command placed on any page, or null when none was placed yet. An
290
+ * input receipt reports the point placed on its own page, as Chromium's per-page pointer does.
291
+ */
292
+ readonly pointer: Effect.Effect<ViewportPoint | null>;
293
+ readonly capture: {
294
+ /** Deliver one frame to the interval capturing the selected page. */
295
+ readonly emit: (frame?: ScriptedFrame) => Effect.Effect<void, BrowserError>;
296
+ };
297
+ /** A page-side call of a registered `Bootstrap.binding`, through the real admission path. */
298
+ readonly invoke: (name: string, input: unknown, options?: {
299
+ readonly origin?: string;
300
+ }) => Effect.Effect<BindingReply>;
301
+ /** Every open connection drops; each owner reports its session as disconnected. */
302
+ readonly disconnect: Effect.Effect<void>;
303
+ /** Every connection made to this browser, in order, and how each has ended so far. */
304
+ readonly connections: Effect.Effect<ReadonlyArray<ScriptedConnection>>;
305
+ }
306
+ /** The real public session over the scripted engine, decorated the way owned sessions are. */
307
+ interface ScriptedSession<E = never> extends BrowserSession<E> {
308
+ readonly reference: ScriptedReference;
309
+ readonly control: ScriptedControl;
310
+ readonly closeChecked: Effect.Effect<ScriptedCleanupResult, BrowserError>;
311
+ readonly close: Effect.Effect<ScriptedCleanupResult>;
312
+ readonly cleanupResult: Effect.Effect<Option.Option<ScriptedCleanupResult>>;
313
+ }
314
+ //#endregion
315
+ //#region src/Testing.d.ts
316
+ /**
317
+ * How a scripted browser is opened. The defaults are the ones a Chromium launch would use: an
318
+ * unrestricted policy of 100 actions, five minutes and 2 MiB, a 1280×720 viewport and a
319
+ * ten-second action timeout.
320
+ */
321
+ export interface ScriptedOptions<E = never, R = never> extends OpenOptions<E, R> {
322
+ readonly policy?: BrowserPolicy;
323
+ readonly automation?: AutomationOptions;
324
+ readonly viewport?: Viewport;
325
+ readonly onCleanup?: (result: ScriptedCleanupResult) => Effect.Effect<void>;
326
+ }
327
+ /**
328
+ * The scripted engine as an opaque binding. Connections to one address reach one browser, so a
329
+ * reconnection finds the pages it left; each browser has one control handle.
330
+ */
331
+ export interface ScriptedBinding {
332
+ readonly binding: BrowserBinding;
333
+ /** One control for each browser connected to so far, in first-connection order. */
334
+ readonly browsers: Effect.Effect<ReadonlyArray<ScriptedControl>>;
335
+ }
336
+ /**
337
+ * Open one scripted browser in the caller's Scope. The session is the real owner over a
338
+ * scripted native engine: admission, budgets, staleness, dispatch evidence, capture, page holds
339
+ * and typed callbacks are the production code paths. Only the page and its outcomes are scripted,
340
+ * and the owner's ids and handoff tokens come from `sequentialCrypto`.
341
+ */
342
+ export declare const open: <E = never, R = never>(script: {
343
+ readonly documents: readonly {
344
+ readonly url: string;
345
+ readonly title?: string | undefined;
346
+ readonly text: string;
347
+ readonly controls?: readonly {
348
+ readonly id: string;
349
+ readonly kind: "button" | "input" | "link" | "other" | "select" | "textarea";
350
+ readonly label: string;
351
+ readonly disabled?: boolean | undefined;
352
+ readonly checked?: boolean | undefined;
353
+ readonly selected?: boolean | undefined;
354
+ readonly inputType?: string | undefined;
355
+ readonly required?: boolean | undefined;
356
+ readonly multiple?: boolean | undefined;
357
+ readonly selectElementId?: string | undefined;
358
+ readonly destination?: string | undefined;
359
+ readonly activates?: string | undefined;
360
+ readonly offscreen?: boolean | undefined;
361
+ readonly text?: string | undefined;
362
+ readonly download?: string | undefined;
363
+ readonly facts?: {
364
+ readonly editable?: boolean | undefined;
365
+ readonly formMethod?: "dialog" | "get" | "post" | undefined;
366
+ readonly hitTest?: "covered" | "self" | "uncertain" | "unsampled" | undefined;
367
+ readonly placement?: "inside" | "outside" | "partial" | undefined;
368
+ readonly autocomplete?: string | undefined;
369
+ readonly box?: {
370
+ readonly x: number;
371
+ readonly y: number;
372
+ readonly width: number;
373
+ readonly height: number;
374
+ } | undefined;
375
+ } | undefined;
376
+ }[] | undefined;
377
+ }[];
378
+ readonly start?: string | undefined;
379
+ readonly connections?: readonly ("accept" | "refuse")[] | undefined;
380
+ }, options?: ScriptedOptions<E, R> | undefined) => Effect.Effect<ScriptedSession<E>, E | BrowserError | InitializationError, Scope.Scope | Exclude<R, Scope.Scope>>;
381
+ /**
382
+ * The `Crypto` scripted browsers draw their ids and handoff tokens from. Its bytes count up from
383
+ * one on each build, so every value is predictable; it is not random and computes no digest.
384
+ * `open` uses it already. A provider Layer built over `binding` still requires a `Crypto`, and
385
+ * this one keeps such a test free of a platform package.
386
+ */
387
+ export declare const sequentialCrypto: Layer.Layer<Crypto.Crypto>;
388
+ /**
389
+ * The same engine for a provider Layer built on `browser-runtime`, such as
390
+ * `BrowserbaseBrowser.layer` with `BrowserBinding.layer(binding)`. Each address the Layer
391
+ * connects to is one browser with one control handle; reconnecting to it finds its pages.
392
+ */
393
+ export declare const binding: (script: {
394
+ readonly documents: readonly {
395
+ readonly url: string;
396
+ readonly title?: string | undefined;
397
+ readonly text: string;
398
+ readonly controls?: readonly {
399
+ readonly id: string;
400
+ readonly kind: "button" | "input" | "link" | "other" | "select" | "textarea";
401
+ readonly label: string;
402
+ readonly disabled?: boolean | undefined;
403
+ readonly checked?: boolean | undefined;
404
+ readonly selected?: boolean | undefined;
405
+ readonly inputType?: string | undefined;
406
+ readonly required?: boolean | undefined;
407
+ readonly multiple?: boolean | undefined;
408
+ readonly selectElementId?: string | undefined;
409
+ readonly destination?: string | undefined;
410
+ readonly activates?: string | undefined;
411
+ readonly offscreen?: boolean | undefined;
412
+ readonly text?: string | undefined;
413
+ readonly download?: string | undefined;
414
+ readonly facts?: {
415
+ readonly editable?: boolean | undefined;
416
+ readonly formMethod?: "dialog" | "get" | "post" | undefined;
417
+ readonly hitTest?: "covered" | "self" | "uncertain" | "unsampled" | undefined;
418
+ readonly placement?: "inside" | "outside" | "partial" | undefined;
419
+ readonly autocomplete?: string | undefined;
420
+ readonly box?: {
421
+ readonly x: number;
422
+ readonly y: number;
423
+ readonly width: number;
424
+ readonly height: number;
425
+ } | undefined;
426
+ } | undefined;
427
+ }[] | undefined;
428
+ }[];
429
+ readonly start?: string | undefined;
430
+ readonly connections?: readonly ("accept" | "refuse")[] | undefined;
431
+ }) => Effect.Effect<ScriptedBinding, BrowserError, never>;
432
+ /** A valid 64×48 JPEG: the default bytes of a scripted capture frame, for a caller's own frames. */
433
+ export declare const jpeg: typeof jpegFrame;
434
+ //#endregion
435
+ export type { BindingReply, Gate, RecordedCall, ScriptedConnection, ScriptedControl, ScriptedFrame, ScriptedOutcome, ScriptedSession };
436
+ export {};
437
+ //# sourceMappingURL=Testing.d.mts.map