effect-browser 0.2.0-beta.6 → 0.2.0-beta.7
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 +48 -5
- package/dist/{Association-BsSfBYVx.mjs → Association-CH3kPHXE.mjs} +34 -5
- package/dist/Association-CH3kPHXE.mjs.map +1 -0
- package/dist/Browser.d.mts +13 -2
- package/dist/Browser.mjs.map +1 -1
- package/dist/{BrowserData-DPh3Oaof.d.mts → BrowserData-KHk4o__c.d.mts} +4 -4
- package/dist/BrowserData.d.mts +1 -1
- package/dist/BrowserData.mjs +2 -1
- package/dist/BrowserData.mjs.map +1 -1
- package/dist/{BrowserRuntime-DImn_Oe_.mjs → BrowserRuntime-Cr76CN4I.mjs} +195 -33
- package/dist/BrowserRuntime-Cr76CN4I.mjs.map +1 -0
- package/dist/{BrowserRuntime-BBAjpVFa.d.mts → BrowserRuntime-hxkTNlRa.d.mts} +2 -2
- package/dist/BrowserRuntime.d.mts +1 -1
- package/dist/BrowserRuntime.mjs +1 -1
- package/dist/Capture.mjs +1 -1
- package/dist/CaptureData.d.mts +1 -1
- package/dist/Chromium.d.mts +1 -1
- package/dist/Chromium.mjs +1 -1
- package/dist/Errors.d.mts +5 -2
- package/dist/Errors.mjs +10 -1
- package/dist/Errors.mjs.map +1 -1
- package/dist/PageControl.d.mts +1 -1
- package/dist/Testing.d.mts +3 -3
- package/dist/Testing.mjs +28 -14
- package/dist/Testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/Association-BsSfBYVx.mjs.map +0 -1
- package/dist/BrowserRuntime-DImn_Oe_.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ A `BrowserSession<E>` is the live, host-only capability returned by the supplyin
|
|
|
10
10
|
|
|
11
11
|
All callers use this exact session. `Capture.start`, `Capture.stream` and `PageControl` authenticate its identity privately; spreading or decoding an object cannot copy authority. A session or binding absent from the receiving runtime's private registry fails with reason `UnregisteredSession` and outcome `undispatched`. A copy, fabricated value or separately loaded runtime can cause that refusal; it does not establish which occurred. A registered session with page control disabled still fails `Unsupported`. `Tools.run` from `effect-agent-browser/tools` uses the original session directly; `yield* Adapter.fromSession(session, { selection: "current" | "retained" })` adapts it to the framework's handle with an explicit target policy. Neither opens another browser.
|
|
12
12
|
|
|
13
|
-
Mutations are serialized. An observed node remains usable only until an invalidating event; a replaced node is never searched for again. A timed-out or interrupted mutation after dispatch has an unknown outcome and is never automatically replayed. Unresolved control fences the owner; a main-frame loading timeout can instead retire control through one acknowledged stop, as described below. `undispatched`, `rejected` and `unknown` remain distinct expected outcomes.
|
|
13
|
+
Mutations are serialized. An observed node remains usable only until an invalidating event; a replaced node is never searched for again. A timed-out or interrupted mutation after dispatch has an unknown outcome and is never automatically replayed. Unresolved control fences the owner; a main-frame loading timeout can instead retire control through one acknowledged stop, and an unknown outcome on a pinned page that is not the selected one can instead close that page, as described below. `undispatched`, `rejected` and `unknown` remain distinct expected outcomes.
|
|
14
14
|
|
|
15
15
|
## Self-managed Chromium
|
|
16
16
|
|
|
@@ -226,6 +226,22 @@ owner admission. Page/frame selection returns `void`; request `retain` separatel
|
|
|
226
226
|
sequence is intended. Failed metadata acquisition after creation keeps the creation's dispatch
|
|
227
227
|
evidence and never creates a second page.
|
|
228
228
|
|
|
229
|
+
Each page `createPage` opens is a window of its own, not a tab. Chromium paints only the front
|
|
230
|
+
tab of a window, so a screenshot of a tab behind another waits seconds for a compositor frame, or
|
|
231
|
+
never gets one, and the page that was in front goes behind each new tab. A window of its own is
|
|
232
|
+
painted whether or not another page is in front, so any page can be pictured and read at speed
|
|
233
|
+
and the selected page keeps its capture. With a fixed viewport, each new window's contents are
|
|
234
|
+
set to it, as the first page's are; a provider-managed or preserved viewport is left to the
|
|
235
|
+
browser, which sizes a new window like the last one it showed. A browser that answers the
|
|
236
|
+
request for a window with a protocol error, which means it created nothing, gets tabs from then
|
|
237
|
+
on. `createPage` has no page to conflict with, so it waits its turn behind another operation,
|
|
238
|
+
within its action timeout, rather than failing `busy`; a turn that never comes fails `timeout`
|
|
239
|
+
and `undispatched`, and opens nothing.
|
|
240
|
+
|
|
241
|
+
`describePage(pageInfo)` reads one exact page's current address and title, and whether it is
|
|
242
|
+
selected, without reading every other page. `pages` reads every page's title at once rather than
|
|
243
|
+
one after another, but each title is still a round trip to the browser.
|
|
244
|
+
|
|
229
245
|
For work that must stay on a page while selection moves elsewhere, pin it explicitly:
|
|
230
246
|
|
|
231
247
|
```ts
|
|
@@ -272,6 +288,28 @@ even while another page is selected. IDs are opaque and connection-specific; con
|
|
|
272
288
|
inspection result rather than predicting serials. Attachment, identity and fresh-state checks at
|
|
273
289
|
dispatch remain necessary even when the last input targeted a different page.
|
|
274
290
|
|
|
291
|
+
### An unknown outcome on a page that is not selected
|
|
292
|
+
|
|
293
|
+
A mutation whose outcome becomes unknown after dispatch, because it timed out, failed or was
|
|
294
|
+
interrupted, normally fences the whole session: nothing knows what it did or whether more of it
|
|
295
|
+
will still land. When it was sent through a pinned handle to a page that is not the selected
|
|
296
|
+
one, the owner instead keeps its permit and asks the browser to close that page, within two
|
|
297
|
+
seconds. Once the browser confirms the page closed, nothing still bound for it can land, and the
|
|
298
|
+
session stays open: the selected page, every other page, their observations and captures carry
|
|
299
|
+
on. The operation still fails with its own reason and `unknown` outcome, and it is never re-sent.
|
|
300
|
+
Its page is gone, so its `PageInfo` and pinned handles fail `undispatched` from then on, and
|
|
301
|
+
`session.diagnostics` records `page-contained`. A host that gets `unknown` from a pinned page and
|
|
302
|
+
then finds `status.phase` still `open` knows the page was closed.
|
|
303
|
+
|
|
304
|
+
Closing the page does not undo what the operation already did. A request it made, a cookie or
|
|
305
|
+
storage it changed, a download or a popup it started can all outlast the page, exactly as they
|
|
306
|
+
can after a known outcome. The owner fences as before when the page does not close in time, when
|
|
307
|
+
the unknown outcome is on the selected page (direct operations follow it, and nothing could be
|
|
308
|
+
selected in its place), when the owner cannot read its selection, when the session is paused, and
|
|
309
|
+
for every operation that is not a pinned page's own: downloads, file choosers, forms, waits, page
|
|
310
|
+
holds, page creation and closure, and a navigation after its dispatch returned, which settles
|
|
311
|
+
through its own stop.
|
|
312
|
+
|
|
275
313
|
The complete [multi-page example](examples/multi-page.ts) keeps a presentation page pinned while
|
|
276
314
|
the selected scout supplies observations. It reads and captures the presentation page without
|
|
277
315
|
switching selection and returns only data after the shared browser scope closes.
|
|
@@ -291,7 +329,12 @@ const read = session
|
|
|
291
329
|
allowance exhausted at two reports `maximum: 2, observed: 2`; it does not count a third call that
|
|
292
330
|
was never admitted. `Configuration` and `Malformed` may name a declared schema-field prefix,
|
|
293
331
|
never a supplied value or unknown property name. `Provider`/`Transport` may carry `status` and
|
|
294
|
-
`RateLimited` may carry `retryAfterMillis`; those fields no longer sit on the outer error.
|
|
332
|
+
`RateLimited` may carry `retryAfterMillis`; those fields no longer sit on the outer error. A
|
|
333
|
+
`Provider` failure the native engine raised carries `detail`: the first line of what the engine
|
|
334
|
+
said, such as `elementHandle.click: Target page, context or browser has been closed`, without
|
|
335
|
+
terminal escape codes and at most 512 characters, with every address cut to its origin
|
|
336
|
+
(`https://shop.test/…`) and Playwright's call log dropped, since a path, query or DevTools endpoint
|
|
337
|
+
can carry a credential. It is a host diagnostic, and the agent tools never project it.
|
|
295
338
|
`InitializationError` and the provider's separate resource-error families retain their own
|
|
296
339
|
contracts. The Agent tools project host errors to their compact eleven-reason vocabulary and
|
|
297
340
|
retain the originals in the bounded, host-only `ToolHost.toolFailures` snapshot.
|
|
@@ -538,7 +581,7 @@ Keys go to whatever has focus in the selected page, in whichever frame that is,
|
|
|
538
581
|
|
|
539
582
|
A key is spelled as the `KeyboardEvent.key` the page will see, and the vocabulary is closed: `Enter`, `Tab`, `Backspace`, `Delete`, `Escape`, the four arrows, `Home`, `End`, `PageUp`, `PageDown`, or one printable ASCII character (a space is `" "`), with `Shift`, `Control`, `Alt` and `Meta` as modifiers. The native engine parses a key string, chords included, and begins holding the modifiers before it has validated the key, so nothing reaches it that was not reviewed here. A modifier other than Shift makes a chord rather than a character, and nothing is typed.
|
|
540
583
|
|
|
541
|
-
`type` sends up to 256 characters as one charged action, two native commands for each, one after another under a single action timeout. On a slow link a long passage can outlast that timeout, which leaves an unknown outcome and fences the session like any interrupted mutation, so send it as several shorter runs. The owner is checked between characters, which means a fence stops the rest instead of typing into a session that is closing. Two limits come from the pinned engine. A character the US layout cannot produce is committed as text, the way an input method commits it: the field changes and no key event says so. And a shifted character arrives as its own key with `shiftKey` false. When a page reads the modifier, send that stroke through `press` with `Shift` held, spelling the key as the page will see it: `{ key: "A", modifiers: ["Shift"] }`. Spelled `"a"`, the engine sends `a` with Shift down, which is what Shift produces with Caps Lock on. Control characters are refused in text because the engine presses Enter for a line break; a named key is always its own `press`. Pacing is yours, as easing is for the pointer: for a typist's cadence, send one character per call and sleep between them, at one action each.
|
|
584
|
+
`type` sends up to 256 characters as one charged action, two native commands for each, one after another under a single action timeout. On a slow link a long passage can outlast that timeout, which leaves an unknown outcome and fences the session like any interrupted mutation (or, on a pinned page that is not selected, closes that page), so send it as several shorter runs. The owner is checked between characters, which means a fence stops the rest instead of typing into a session that is closing. Two limits come from the pinned engine. A character the US layout cannot produce is committed as text, the way an input method commits it: the field changes and no key event says so. And a shifted character arrives as its own key with `shiftKey` false. When a page reads the modifier, send that stroke through `press` with `Shift` held, spelling the key as the page will see it: `{ key: "A", modifiers: ["Shift"] }`. Spelled `"a"`, the engine sends `a` with Shift down, which is what Shift produces with Caps Lock on. Control characters are refused in text because the engine presses Enter for a line break; a named key is always its own `press`. Pacing is yours, as easing is for the pointer: for a typist's cadence, send one character per call and sleep between them, at one action each.
|
|
542
585
|
|
|
543
586
|
A press is dispatched, not awaited. If Enter submits a form, wait for what the next document shows with `waitFor`. A receipt carries the same target, pointer position and interval as any other input, and never says which key was pressed or what was typed. Typing a secret is still more observable than one `fill`, because the page sees every stroke; prefer `fill` for one unless the page requires keys. Neither operation is part of the model-facing toolkit in `effect-agent-browser`.
|
|
544
587
|
|
|
@@ -711,7 +754,7 @@ Footage from `capture` is the page surface. It has no pointer, no tab strip and
|
|
|
711
754
|
- an `InputReceipt` for each exposed native pointer, click and key operation, with a known position when the owner has one and an interval on that same clock. Internal download and file-chooser clicks clear the remembered pointer position but do not expose a receipt;
|
|
712
755
|
- an address for every document a frame can name: `initialUrl` for document 0, read in the same turn the watch is installed, and a `url` on each cross-document boundary, read inside the navigation event that committed it. Page-lifetime captures separately mark same-document URL changes without advancing the document number. An application that samples `observe()` between actions can learn an address, but never when it became the address. One longer than 8192 characters is `null`, never cut into an address the page did not show.
|
|
713
756
|
|
|
714
|
-
A cross-document boundary is the commit, and it is the only moment of a navigation an application cannot see for itself. A same-document boundary records a URL change without claiming that a new document committed. When a cross-document navigation started and when its document finished loading are yours to stamp around the operation that caused it, because you made the call: `startNavigation` returns at dispatch and its `completed` resolves at DOMContentLoaded. The clock is Effect's `Clock`, read where the session was opened and the capture was started, so `Clock.clockWith((clock) => clock.monotonicTimeNanos)` in the same runtime is on the same timeline as every frame and receipt. A title is page state that changes whenever the page likes, not part of a transition: read it with `session.
|
|
757
|
+
A cross-document boundary is the commit, and it is the only moment of a navigation an application cannot see for itself. A same-document boundary records a URL change without claiming that a new document committed. When a cross-document navigation started and when its document finished loading are yours to stamp around the operation that caused it, because you made the call: `startNavigation` returns at dispatch and its `completed` resolves at DOMContentLoaded. The clock is Effect's `Clock`, read where the session was opened and the capture was started, so `Clock.clockWith((clock) => clock.monotonicTimeNanos)` in the same runtime is on the same timeline as every frame and receipt. A title is page state that changes whenever the page likes, not part of a transition: read it with `session.describePage(page)` when you need one, and stamp that read yourself.
|
|
715
758
|
|
|
716
759
|
The two clocks are never related for you. `sourceTimeMillis` is the browser's wall clock; everything above is the host's monotonic clock; on a hosted session they differ by an offset this package cannot observe. Every frame it receives is already late by the very capture latency it would be trying to measure, and nothing else it is handed carries the browser's time. Relating them takes a round trip into the page, which costs either a charged action or a registered binding, on a schedule only the application can choose, and it fails on a held page. So place input on frames by receipt time, which is always available and late by the capture latency, or measure the offset yourself with a four-timestamp exchange over a typed binding, as NTP does: the page stamps when it called and when the reply arrived, the host stamps when it received and when it replied, and half the best round trip is the error bound to report beside the offset.
|
|
717
760
|
|
|
@@ -789,7 +832,7 @@ it.effect("an unknown click is never replayed", () =>
|
|
|
789
832
|
);
|
|
790
833
|
```
|
|
791
834
|
|
|
792
|
-
`browser.control` is the test's side of the scripted browser. The browser outlives any one connection, as a keep-alive browser does: a reconnection to the same address finds the pages it left, and the control keeps working while no connection is open, so a test can change a page while its owner is detached. `connections` lists every connection made to that browser and how each ended so far (`open`, `closed`, `dropped`, `close-failed`, or `refused` by the script's `connections: ["refuse", …]`), which makes a connection an owner left open visible. `next("disconnect", …)` scripts the owner's native teardown: `Fail` makes it fail, so the receipt reports `connection: "failed"` with a `disconnect` issue, and `Hold` parks it at a gate however long cleanup waits. A navigation stop is recorded in `calls` as `navigate-stop`, and its arms apply before or after it is sent. The rest of `browser.control`: `next(operation, outcome)` arms what the next admitted call of one operation does. `Fail` with `outcome: "unknown"` dispatches and then fails, so the owner fences the session and refuses every later mutation `Closed` and `undispatched`; `Fail` with `undispatched` or `rejected` never dispatches. `Hold` parks the call at a `Gate` before or after dispatch, so a test can interrupt or time out a call at a known point and then check what the owner made of it. `Disconnect` drops the connection inside the call. `calls` is the recorder: every admitted call with its operation, page, node, `dispatched` and `settled`, and never a filled value, typed text or address; `document.values` and `document.files` hold those separately. `document.replace` swaps the page's document as a navigation would, so retained nodes and pending waits go stale and a capture learns of a new document; `document.update` changes the same document in place, so controls that keep their `id` keep their identity and waits re-evaluate. `capture.emit` hands a frame to a running interval, `invoke` calls a registered binding as a page would, and `disconnect` drops every open connection outside any call. `closeChecked` returns a `ScriptedCleanupResult`, and `onCleanup` receives it, as the concrete owners do.
|
|
835
|
+
`browser.control` is the test's side of the scripted browser. The browser outlives any one connection, as a keep-alive browser does: a reconnection to the same address finds the pages it left, and the control keeps working while no connection is open, so a test can change a page while its owner is detached. `connections` lists every connection made to that browser and how each ended so far (`open`, `closed`, `dropped`, `close-failed`, or `refused` by the script's `connections: ["refuse", …]`), which makes a connection an owner left open visible. `next("disconnect", …)` scripts the owner's native teardown: `Fail` makes it fail, so the receipt reports `connection: "failed"` with a `disconnect` issue, and `Hold` parks it at a gate however long cleanup waits. A navigation stop is recorded in `calls` as `navigate-stop`, and its arms apply before or after it is sent. Closing a page that is not selected after an unknown outcome on it is recorded as `close-page`; arming `close-page` with `Fail` makes that close fail, so the owner fences. The rest of `browser.control`: `next(operation, outcome)` arms what the next admitted call of one operation does. `Fail` with `outcome: "unknown"` dispatches and then fails, so the owner fences the session and refuses every later mutation `Closed` and `undispatched`; `Fail` with `undispatched` or `rejected` never dispatches. `Hold` parks the call at a `Gate` before or after dispatch, so a test can interrupt or time out a call at a known point and then check what the owner made of it. `Disconnect` drops the connection inside the call. `calls` is the recorder: every admitted call with its operation, page, node, `dispatched` and `settled`, and never a filled value, typed text or address; `document.values` and `document.files` hold those separately. `document.replace` swaps the page's document as a navigation would, so retained nodes and pending waits go stale and a capture learns of a new document; `document.update` changes the same document in place, so controls that keep their `id` keep their identity and waits re-evaluate. `capture.emit` hands a frame to a running interval, `invoke` calls a registered binding as a page would, and `disconnect` drops every open connection outside any call. `closeChecked` returns a `ScriptedCleanupResult`, and `onCleanup` receives it, as the concrete owners do.
|
|
793
836
|
|
|
794
837
|
Time is the caller's clock. In-flight navigations, waits, holds and callback deadlines run under the context the session was opened in, so under `it.effect` from `@effect/vitest` a `TestClock.adjust` advances them and nothing real elapses, while `it.live` runs them in real time. `Testing.binding(script)` is the same engine as an opaque `BrowserBinding` for code that constructs a runtime itself; its `browsers` has one control handle for each address connected to, in first-connection order; `Testing.jpeg()` is a small valid JPEG for frames.
|
|
795
838
|
|
|
@@ -33,12 +33,41 @@ const safeDecode = (codec, raw) => {
|
|
|
33
33
|
if (Exit.isFailure(decoded)) throw failure(Reasons.Malformed.make({}));
|
|
34
34
|
return decoded.value;
|
|
35
35
|
};
|
|
36
|
+
const escapes = /\u001b\[[0-9;]*m/g;
|
|
37
|
+
const addresses = /\b[a-z][a-z0-9+.-]*:\/\/[^\s"'<>]*/gi;
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
+
* An address keeps only its origin: a path, query or user name can carry a credential, such as
|
|
40
|
+
* a DevTools endpoint's browser id or a provider's signed connection URL.
|
|
41
|
+
*/
|
|
42
|
+
const originOf = (address) => {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = new URL(address);
|
|
45
|
+
return parsed.host === "" ? `${parsed.protocol}…` : `${parsed.protocol}//${parsed.host}/…`;
|
|
46
|
+
} catch {
|
|
47
|
+
return "…";
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* The first line of what the engine said, which names the call and its reason. Playwright's
|
|
52
|
+
* call log below it repeats addresses, selectors and endpoints, so it never leaves.
|
|
53
|
+
*/
|
|
54
|
+
const nativeDetail = (error) => {
|
|
55
|
+
const line = (error instanceof Error ? error.message : typeof error === "string" ? error : void 0)?.replace(escapes, "").split("\n", 1)[0]?.trim();
|
|
56
|
+
if (line === void 0 || line === "") return void 0;
|
|
57
|
+
return line.replace(addresses, originOf).slice(0, 512);
|
|
58
|
+
};
|
|
59
|
+
/** A raw failure the engine raised, with what it said about it. */
|
|
60
|
+
const providerReason = (error) => {
|
|
61
|
+
const detail = nativeDetail(error);
|
|
62
|
+
return Reasons.Provider.make(detail === void 0 ? {} : { detail });
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* No raw exception from Playwright crosses this private boundary: only its sanitized first line
|
|
66
|
+
* does, as the provider reason's detail. A ticket's own fence is already a public error and
|
|
67
|
+
* passes through with the operation the owner gave it.
|
|
39
68
|
*/
|
|
40
69
|
const sanitize = (action) => Promise.resolve().then(action).catch((error) => {
|
|
41
|
-
throw Schema.is(BrowserError)(error) || Schema.is(NativeFailure)(error) ? error : failure(
|
|
70
|
+
throw Schema.is(BrowserError)(error) || Schema.is(NativeFailure)(error) ? error : failure(providerReason(error));
|
|
42
71
|
});
|
|
43
72
|
const closeWithin = async (action, milliseconds = 2e3) => {
|
|
44
73
|
let timer;
|
|
@@ -133,6 +162,6 @@ const associate = (session, parent) => {
|
|
|
133
162
|
};
|
|
134
163
|
const captureParent = (session) => parents.get(session);
|
|
135
164
|
//#endregion
|
|
136
|
-
export { NativeFailure as a,
|
|
165
|
+
export { NativeFailure as a, providerReason as c, sanitize as d, timeout as f, pngGeometry as i, publicError as l, captureParent as n, closeWithin as o, jpegGeometry as r, failure as s, associate as t, safeDecode as u };
|
|
137
166
|
|
|
138
|
-
//# sourceMappingURL=Association-
|
|
167
|
+
//# sourceMappingURL=Association-CH3kPHXE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Association-CH3kPHXE.mjs","names":[],"sources":["../src/internal/browser/NativeCalls.ts","../src/internal/browser/Images.ts","../src/internal/browser/Association.ts"],"sourcesContent":["import { Exit, Schema } from \"effect\";\n\nimport {\n BrowserError,\n BrowserOutcome,\n Reasons,\n type BrowserOperation,\n type BrowserReason,\n} from \"../../Errors.ts\";\nimport type { ReadTicket } from \"./Owner.ts\";\n\n/**\n * A native step failed. It names no operation: the owner stamps the one the caller asked for\n * when it admits the work, so a step's own vocabulary can never become public API.\n */\nexport class NativeFailure extends Schema.TaggedError<NativeFailure>()(\"NativeFailure\", {\n reason: BrowserError.fields.reason,\n // Some native helpers run both before and after dispatch. Only their owner has that evidence.\n outcome: Schema.optionalKey(BrowserOutcome),\n}) {}\n\n/**\n * The only way a native failure becomes public. A fenced ticket already speaks publicly and\n * passes through with the operation the owner gave it; a native failure keeps its reason and\n * takes the caller's operation; anything else is the caller's fallback.\n */\nexport const publicError = (\n error: unknown,\n operation: BrowserOperation,\n fallback: Pick<BrowserError, \"reason\" | \"outcome\">,\n): BrowserError => {\n if (Schema.is(BrowserError)(error)) return error;\n const known = Schema.is(NativeFailure)(error) ? error : fallback;\n\n return BrowserError.make({\n operation,\n reason: known.reason,\n outcome: known.outcome ?? fallback.outcome,\n });\n};\n\n/** Shared by the Playwright driver's seams, so every native call fails in the same vocabulary. */\nexport const failure = (reason: BrowserReason, outcome?: BrowserOutcome) =>\n NativeFailure.make({ reason, ...(outcome === undefined ? {} : { outcome }) });\n\nexport const safeDecode = <A>(codec: Schema.Codec<A, unknown, never, never>, raw: unknown): A => {\n const decoded = Schema.decodeUnknownExit(codec)(raw);\n\n // A schema issue and a throw while reading the reply are both a malformed reply.\n if (Exit.isFailure(decoded)) throw failure(Reasons.Malformed.make({}));\n\n return decoded.value;\n};\n\n// oxlint-disable-next-line no-control-regex -- matches the terminal escape codes Playwright colours its call log with\nconst escapes = /\\u001b\\[[0-9;]*m/g;\n\nconst addresses = /\\b[a-z][a-z0-9+.-]*:\\/\\/[^\\s\"'<>]*/gi;\n\n/**\n * An address keeps only its origin: a path, query or user name can carry a credential, such as\n * a DevTools endpoint's browser id or a provider's signed connection URL.\n */\nconst originOf = (address: string): string => {\n try {\n const parsed = new URL(address);\n\n return parsed.host === \"\" ? `${parsed.protocol}…` : `${parsed.protocol}//${parsed.host}/…`;\n } catch {\n return \"…\";\n }\n};\n\n/**\n * The first line of what the engine said, which names the call and its reason. Playwright's\n * call log below it repeats addresses, selectors and endpoints, so it never leaves.\n */\nexport const nativeDetail = (error: unknown): string | undefined => {\n const message =\n error instanceof Error ? error.message : typeof error === \"string\" ? error : undefined;\n\n const line = message?.replace(escapes, \"\").split(\"\\n\", 1)[0]?.trim();\n\n if (line === undefined || line === \"\") return undefined;\n\n return line.replace(addresses, originOf).slice(0, 512);\n};\n\n/** A raw failure the engine raised, with what it said about it. */\nexport const providerReason = (error: unknown) => {\n const detail = nativeDetail(error);\n\n return Reasons.Provider.make(detail === undefined ? {} : { detail });\n};\n\n/**\n * No raw exception from Playwright crosses this private boundary: only its sanitized first line\n * does, as the provider reason's detail. A ticket's own fence is already a public error and\n * passes through with the operation the owner gave it.\n */\nexport const sanitize = <A>(action: () => Promise<A>): Promise<A> =>\n Promise.resolve()\n .then(action)\n .catch((error: unknown) => {\n throw Schema.is(BrowserError)(error) || Schema.is(NativeFailure)(error)\n ? error\n : failure(providerReason(error));\n });\n\nexport const closeWithin = async (\n action: () => Promise<unknown>,\n milliseconds = 2000,\n): Promise<void> => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n try {\n await Promise.race([\n Promise.resolve().then(action),\n new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(failure(Reasons.Timeout.make({}))), milliseconds);\n }),\n ]);\n } finally {\n clearTimeout(timer);\n }\n};\n\n// The native timeout is finite as well as Effect's authoritative deadline. It cannot undo dispatch.\nexport const timeout = (ticket: ReadTicket) => {\n ticket.check();\n\n return ticket.remainingMillis();\n};\n","import { Reasons } from \"../../Errors.ts\";\nimport { failure } from \"./NativeCalls.ts\";\n\nconst malformed = () => failure(Reasons.Malformed.make({}));\n\n/** A checked read: a truncated segment is malformed framing, never `undefined` arithmetic. */\nconst byteAt = (bytes: Uint8Array, index: number): number => {\n const byte = bytes[index];\n\n if (byte === undefined) throw malformed();\n\n return byte;\n};\n\n/** Parse framing only; a caller decoding media must still validate its complete bitstream. */\nexport const pngGeometry = (bytes: Uint8Array): { width: number; height: number } => {\n const signature = [137, 80, 78, 71, 13, 10, 26, 10];\n\n if (\n bytes.length < 33 ||\n signature.some((b, i) => bytes[i] !== b) ||\n bytes[12] !== 73 ||\n bytes[13] !== 72 ||\n bytes[14] !== 68 ||\n bytes[15] !== 82\n )\n throw malformed();\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n\n if (view.getUint32(8) !== 13) throw malformed();\n\n const width = view.getUint32(16),\n height = view.getUint32(20);\n\n if (width === 0 || height === 0) throw malformed();\n\n return { width, height };\n};\n\n/** JPEG SOF dimensions avoid trusting the requested size or CSS viewport dimensions. */\nexport const jpegGeometry = (bytes: Uint8Array): { width: number; height: number } => {\n if (bytes.length < 4 || bytes[0] !== 255 || bytes[1] !== 216) throw malformed();\n let offset = 2;\n\n while (offset + 3 < bytes.length) {\n if (bytes[offset++] !== 255) throw malformed();\n while (bytes[offset] === 255) offset++;\n const marker = bytes[offset++];\n\n if (marker === undefined || marker === 217 || marker === 218) break;\n if (marker === 1 || (marker >= 208 && marker <= 215)) continue;\n if (offset + 1 >= bytes.length) throw malformed();\n const size = byteAt(bytes, offset) * 256 + byteAt(bytes, offset + 1);\n\n if (size < 2 || offset + size > bytes.length) throw malformed();\n if ([192, 193, 194, 195, 197, 198, 199, 201, 202, 203, 205, 206, 207].includes(marker)) {\n if (size < 8) throw malformed();\n const height = byteAt(bytes, offset + 3) * 256 + byteAt(bytes, offset + 4);\n const width = byteAt(bytes, offset + 5) * 256 + byteAt(bytes, offset + 6);\n\n if (width === 0 || height === 0) throw malformed();\n\n return { width, height };\n }\n offset += size;\n }\n throw malformed();\n};\n","import type { Effect } from \"effect\";\n\nimport type { PageInfo, Target } from \"../../BrowserData.ts\";\nimport type { BrowserError } from \"../../Errors.ts\";\nimport type { CaptureSource } from \"./Driver.ts\";\nimport type { Owner, Ticket } from \"./Owner.ts\";\n\nexport interface CaptureLease {\n readonly stop: Effect.Effect<void>;\n readonly invalidate: (reason: string) => void;\n readonly reservedBytes: number;\n}\n\nexport interface CaptureResolution {\n /** Stable native page identity used to quarantine an unconfirmed screencast across reconnects. */\n readonly key: string;\n readonly target: Target;\n readonly source: CaptureSource;\n}\n\nexport interface CaptureParent {\n readonly owner: Owner;\n readonly resolve: (\n ticket: Ticket,\n target?: PageInfo,\n ) => Effect.Effect<CaptureResolution, BrowserError>;\n readonly target: () => Target;\n readonly captureLeases: Map<string, CaptureLease>;\n captureReservedBytes: number;\n}\n\n// This is a private capability registry, not stored domain data. Exact live session identity is\n// required: spreading/cloning a session must not copy authority to mutate its capture owner,\n// leases or reservations. A public/enumerable parent field would weaken that boundary.\n// Keep this access centralized here; schemas describe data, never this mutable ownership state.\nconst parents = new WeakMap<object, CaptureParent>();\n\nexport const associate = (session: object, parent: CaptureParent): void => {\n parents.set(session, parent);\n};\n\nexport const captureParent = (session: object): CaptureParent | undefined => parents.get(session);\n"],"mappings":";;;;;;;AAeA,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,QAAQ,aAAa,OAAO;CAE5B,SAAS,OAAO,YAAY,cAAc;AAC5C,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,MAAa,eACX,OACA,WACA,aACiB;CACjB,IAAI,OAAO,GAAG,YAAY,CAAC,CAAC,KAAK,GAAG,OAAO;CAC3C,MAAM,QAAQ,OAAO,GAAG,aAAa,CAAC,CAAC,KAAK,IAAI,QAAQ;CAExD,OAAO,aAAa,KAAK;EACvB;EACA,QAAQ,MAAM;EACd,SAAS,MAAM,WAAW,SAAS;CACrC,CAAC;AACH;;AAGA,MAAa,WAAW,QAAuB,YAC7C,cAAc,KAAK;CAAE;CAAQ,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;AAAG,CAAC;AAE9E,MAAa,cAAiB,OAA+C,QAAoB;CAC/F,MAAM,UAAU,OAAO,kBAAkB,KAAK,CAAC,CAAC,GAAG;CAGnD,IAAI,KAAK,UAAU,OAAO,GAAG,MAAM,QAAQ,QAAQ,UAAU,KAAK,CAAC,CAAC,CAAC;CAErE,OAAO,QAAQ;AACjB;AAGA,MAAM,UAAU;AAEhB,MAAM,YAAY;;;;;AAMlB,MAAM,YAAY,YAA4B;CAC5C,IAAI;EACF,MAAM,SAAS,IAAI,IAAI,OAAO;EAE9B,OAAO,OAAO,SAAS,KAAK,GAAG,OAAO,SAAS,KAAK,GAAG,OAAO,SAAS,IAAI,OAAO,KAAK;CACzF,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,MAAa,gBAAgB,UAAuC;CAIlE,MAAM,QAFJ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,UAAU,WAAW,QAAQ,KAAA,EAAA,EAEzD,QAAQ,SAAS,EAAE,CAAC,CAAC,MA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zE,MAAM,QAAQ,OAAO,OAAO,SAAS,CAAC,IAAI,MAAM,OAAO,OAAO,SAAS,CAAC;GAExE,IAAI,UAAU,KAAK,WAAW,GAAG,MAAM,UAAU;GAEjD,OAAO;IAAE;IAAO;GAAO;EACzB;EACA,UAAU;CACZ;CACA,MAAM,UAAU;AAClB;;;AChCA,MAAM,0BAAU,IAAI,QAA+B;AAEnD,MAAa,aAAa,SAAiB,WAAgC;CACzE,QAAQ,IAAI,SAAS,MAAM;AAC7B;AAEA,MAAa,iBAAiB,YAA+C,QAAQ,IAAI,OAAO"}
|
package/dist/Browser.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as Plan, g as ReadinessOutcome, s as Bootstrap_d_exports, t as BindingDiagnostics } from "./Bootstrap-B9UUXsvF.mjs";
|
|
2
2
|
import { BrowserError, InitializationError } from "./Errors.mjs";
|
|
3
|
-
import { $ as TypeRequest, D as NavigationResult, E as NavigateRequest, F as PointerMoveRequest, H as ScreenshotResult, J as SessionStatus, L as PressRequest, N as PageInfo, O as Observation, Q as TextResult, R as ReadTextRequest, S as InputReceipt, U as ScrollRequest, V as ScreenshotRequest, W as SelectOptions, X as Target, Y as StartNavigationRequest, _ as FrameInfo, at as WheelRequest, c as ClickRequest, d as FillFormRequest, et as Viewport, f as FillFormResult, i as BrowserDiagnostics, it as WaitForElementRequest, j as ObservedElement, k as ObservationOptions, l as ControlFacts, o as Checkpoint, p as FillRequest, s as CheckpointOptions, t as ActionResult, u as FillFormOptions, v as HoverRequest, w as KeyStroke } from "./BrowserData-
|
|
3
|
+
import { $ as TypeRequest, D as NavigationResult, E as NavigateRequest, F as PointerMoveRequest, H as ScreenshotResult, J as SessionStatus, L as PressRequest, N as PageInfo, O as Observation, Q as TextResult, R as ReadTextRequest, S as InputReceipt, U as ScrollRequest, V as ScreenshotRequest, W as SelectOptions, X as Target, Y as StartNavigationRequest, _ as FrameInfo, at as WheelRequest, c as ClickRequest, d as FillFormRequest, et as Viewport, f as FillFormResult, i as BrowserDiagnostics, it as WaitForElementRequest, j as ObservedElement, k as ObservationOptions, l as ControlFacts, o as Checkpoint, p as FillRequest, s as CheckpointOptions, t as ActionResult, u as FillFormOptions, v as HoverRequest, w as KeyStroke } from "./BrowserData-KHk4o__c.mjs";
|
|
4
4
|
import { Effect, Scope } from "effect";
|
|
5
5
|
//#region src/Browser.d.ts
|
|
6
6
|
/**
|
|
@@ -137,6 +137,12 @@ export interface BrowserSession<E = never> extends TargetOperations {
|
|
|
137
137
|
*/
|
|
138
138
|
readonly fillForm: (request: FillFormRequest, admission?: ElementAdmission, options?: FillFormOptions) => Effect.Effect<FillFormResult, BrowserError>;
|
|
139
139
|
readonly pages: Effect.Effect<ReadonlyArray<PageInfo>, BrowserError>;
|
|
140
|
+
/**
|
|
141
|
+
* One exact page's address and title as they are now, and whether it is selected, without
|
|
142
|
+
* reading every other page as `pages` does. An identity that no longer names an open page
|
|
143
|
+
* fails undispatched.
|
|
144
|
+
*/
|
|
145
|
+
readonly describePage: (page: PageInfo) => Effect.Effect<PageInfo, BrowserError>;
|
|
140
146
|
readonly frames: Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;
|
|
141
147
|
/** List frames on one exact page without selecting it. */
|
|
142
148
|
readonly framesOf: (page: PageInfo) => Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;
|
|
@@ -146,7 +152,12 @@ export interface BrowserSession<E = never> extends TargetOperations {
|
|
|
146
152
|
readonly pinFrame: (page: PageInfo, frame: FrameInfo) => Effect.Effect<PinnedTarget, BrowserError>;
|
|
147
153
|
readonly selectPage: (page: PageInfo) => Effect.Effect<void, BrowserError>;
|
|
148
154
|
readonly selectFrame: (frameId: string) => Effect.Effect<void, BrowserError>;
|
|
149
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Open a page in its own window, sized like the others, without selecting it, and return that
|
|
157
|
+
* exact page's checked identity. Chromium paints every window, so any page can be pictured
|
|
158
|
+
* and read at speed, not only the one in front. It waits its turn behind other operations,
|
|
159
|
+
* within its action timeout, rather than failing `busy`.
|
|
160
|
+
*/
|
|
150
161
|
readonly createPage: Effect.Effect<PageInfo, BrowserError>;
|
|
151
162
|
readonly closePage: (page: PageInfo) => Effect.Effect<void, BrowserError>;
|
|
152
163
|
readonly resizeViewport: (viewport: Viewport) => Effect.Effect<void, BrowserError>;
|
package/dist/Browser.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.mjs","names":[],"sources":["../src/Browser.ts"],"sourcesContent":["import { Effect, type Scope } from \"effect\";\nimport { dual } from \"effect/Function\";\n\nimport type * as Bootstrap from \"./Bootstrap.ts\";\nimport type {\n BrowserDiagnostics,\n Checkpoint,\n CheckpointOptions,\n FillFormOptions,\n FillFormRequest,\n FillFormResult,\n FillRequest,\n HoverRequest,\n InputReceipt,\n KeyStroke,\n NavigateRequest,\n NavigationResult,\n ObservationOptions,\n ObservedElement,\n PointerMoveRequest,\n PressRequest,\n ReadTextRequest,\n ScreenshotRequest,\n ScreenshotResult,\n ScrollRequest,\n SelectOptions,\n SessionStatus,\n StartNavigationRequest,\n TextResult,\n TypeRequest,\n WaitForElementRequest,\n WheelRequest,\n ControlFacts,\n ActionResult,\n ClickRequest,\n FrameInfo,\n Observation,\n PageInfo,\n Target,\n Viewport,\n} from \"./BrowserData.ts\";\nimport type { BrowserError, InitializationError } from \"./Errors.ts\";\n\n/**\n * A host's decision about one control, made on facts read from the exact node immediately\n * before input. Returning anything but `true`, or throwing, sends nothing and fails `denied`.\n * It is a plain synchronous function on purpose: it runs while the owner's permit is held, where\n * waiting on a model or a network call would stall every other operation. It is not an atomic\n * check-and-input transaction, because page script can still run before the native input lands.\n */\nexport interface ElementAdmission {\n readonly admit: (facts: ControlFacts) => boolean;\n}\n\n/**\n * A navigation the browser is still performing. The owner's permit was released when it was\n * dispatched, so while it loads a host may read, `checkpoint`, hold and resume this page, and\n * use any other page. Anything that would change this page fails `busy` until it settles.\n *\n * Leaving its scope unsettled fences the session, exactly as an interrupted mutation does,\n * because nothing then knows what the browser did. It is never replayed.\n */\nexport interface NavigationOperation {\n /** What was navigated, read before dispatch. */\n readonly target: Target;\n /**\n * The document reached DOMContentLoaded. It belongs to this one navigation: a successor that\n * reaches the same URL fails it instead. Interrupting a waiter stops nothing in the browser.\n */\n readonly completed: Effect.Effect<NavigationResult, BrowserError>;\n /**\n * Asks the browser to stop loading and waits for this navigation to settle, after which\n * `completed` fails `interrupted`. Success is a known outcome and the session stays usable:\n * the page holds whatever had loaded. It does not undo anything the page already did.\n * An already-completed navigation cannot stop a successor. Concurrent callers share their\n * active attempt. Before dispatch, cancellation or a busy refusal permits a later request\n * once native setup has retired. A dispatched attempt's outcome, including failure or\n * interruption, is retained permanently; an uncertain stop is never replayed.\n */\n readonly stop: Effect.Effect<void, BrowserError>;\n}\n\n/** Common operations. Direct, retained and pinned views choose their target at different times. */\nexport interface TargetOperations {\n readonly navigate: (request: NavigateRequest) => Effect.Effect<NavigationResult, BrowserError>;\n /** `navigate`, left in flight: the same single dispatch, completed by the caller. */\n readonly startNavigation: (\n request: StartNavigationRequest,\n ) => Effect.Effect<NavigationOperation, BrowserError, Scope.Scope>;\n readonly readText: (request: ReadTextRequest) => Effect.Effect<TextResult, BrowserError>;\n readonly click: (request: ClickRequest) => Effect.Effect<ActionResult, BrowserError>;\n readonly fill: (request: FillRequest) => Effect.Effect<ActionResult, BrowserError>;\n /** Script in the page: instantaneous, and it raises no wheel event. */\n readonly scroll: (request: ScrollRequest) => Effect.Effect<ActionResult, BrowserError>;\n /** One real pointer move, in main-frame viewport pixels. */\n readonly pointerMove: (request: PointerMoveRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** Places the pointer on one exact element where it is, or fails `not-visible` unsent. */\n readonly hover: (request: HoverRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** One real wheel event; the browser decides what under the pointer scrolls. */\n readonly wheel: (request: WheelRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** One real key stroke to whatever has focus, or fails `not-focused` unsent if `into` lacks it. */\n readonly press: (request: PressRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** Text as the real key strokes that produce it, under the same focus rule as `press`. */\n readonly type: (request: TypeRequest) => Effect.Effect<InputReceipt, BrowserError>;\n readonly screenshot: (\n request: ScreenshotRequest,\n ) => Effect.Effect<ScreenshotResult, BrowserError>;\n}\n\n/**\n * One explicit page/frame target. Selection may move independently; each operation re-resolves\n * this identity inside the same owner and connection. Closing/detaching it or reconnecting makes\n * the handle stale before dispatch.\n */\nexport interface PinnedTarget extends TargetOperations {\n readonly target: Target;\n}\n\n/** A checked selection retained at acquisition; moving selection away and back makes it stale. */\nexport interface RetainedTarget extends TargetOperations {}\n\n/**\n * Host control over one owned browser. This is not a serializable model value: copying a\n * session object cannot copy its capture, page-control or connection authority.\n *\n * The inherited target operations resolve the selected page/frame when their Effect executes.\n * Use `retain` to retain the current selection with stale-on-selection-change semantics, or\n * `pinPage` / `pinFrame` when work must stay on an explicit target while selection moves.\n */\nexport interface BrowserSession<E = never> extends TargetOperations {\n /** The implementation which owns this live connection. */\n readonly implementation: string;\n /** Copied host-only state, readable without admission in every lifecycle phase. */\n readonly status: Effect.Effect<SessionStatus>;\n /** Bounded native/policy diagnostics. Typed callback causes remain in bindingDiagnostics. */\n readonly diagnostics: Effect.Effect<BrowserDiagnostics>;\n /** Close this scope and require its own ownership-specific cleanup evidence. */\n readonly closeChecked: Effect.Effect<void, BrowserError>;\n /** First fail-session callback cause, preserving the consumer's error type on the host. */\n readonly failure: Effect.Effect<never, E | InitializationError>;\n /** Bounded host-only evidence; consumer causes are never projected into a page reply. */\n readonly bindingDiagnostics: Effect.Effect<Bootstrap.BindingDiagnostics<E>>;\n /** Resolve, validate and retain the selection under owner admission. */\n readonly retain: Effect.Effect<RetainedTarget, BrowserError>;\n readonly target: Effect.Effect<Target, BrowserError>;\n /**\n * The one observation whose nodes later actions may name. `scope: \"viewport\"` keeps only text\n * and controls that are on screen and reachable, plus bounded choices of visible native\n * selects; the default reads the whole document. It carries no destination, form or field value.\n */\n readonly observe: (options?: ObservationOptions) => Effect.Effect<Observation, BrowserError>;\n /**\n * Passive evidence for a recorder, with a picture when asked. It issues no references and\n * leaves the observation above exactly as it was. Host-only: it carries control facts.\n */\n readonly checkpoint: (options?: CheckpointOptions) => Effect.Effect<Checkpoint, BrowserError>;\n /** Host-only facts about one observed control, read from that exact node just now. */\n readonly controlFacts: (reference: ObservedElement) => Effect.Effect<ControlFacts, BrowserError>;\n /**\n * After a page hold, nothing observed on that page may be acted on unchecked. This checks one\n * reference: still attached, and still the control that was inspected. It never searches by\n * selector or label for a substitute, and it sends nothing.\n */\n readonly revalidateElement: (\n reference: ObservedElement,\n ) => Effect.Effect<ObservedElement, BrowserError>;\n readonly clickElement: (\n reference: ObservedElement,\n admission?: ElementAdmission,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly fillElement: (\n reference: ObservedElement,\n value: string,\n admission?: ElementAdmission,\n ) => Effect.Effect<ActionResult, BrowserError>;\n /** One selection using this exact select and its issued option element IDs, with fresh checks. */\n readonly selectOption: (\n reference: ObservedElement,\n options: SelectOptions,\n admission?: ElementAdmission,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly hoverElement: (\n reference: ObservedElement,\n admission?: ElementAdmission,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** A key stroke sent only if the exact node an observation named already has focus. */\n readonly pressElement: (\n reference: ObservedElement,\n stroke: KeyStroke,\n admission?: ElementAdmission,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** Real typing with `fillElement`'s exactness: that node must already have focus. */\n readonly typeElement: (\n reference: ObservedElement,\n text: string,\n admission?: ElementAdmission,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /**\n * Set several controls of one observation in order, then optionally click one submit control.\n * Every step acts on the exact observed node after the same fresh checks as `fillElement`,\n * except that a control may have become enabled since it was observed, and each is admitted\n * and charged as its own action. The observation stays usable for this form's own steps only;\n * anything else that changes the page still retires it, and the form retires it when it ends.\n * The first refused or uncertain step ends the form. Submit is sent only after every field\n * succeeded and, unless `verify` is false, still holds what its step left there. Fields set\n * before a stop stay set. It fails only when its first step does; otherwise `stopped` says\n * where it ended and why.\n */\n readonly fillForm: (\n request: FillFormRequest,\n admission?: ElementAdmission,\n options?: FillFormOptions,\n ) => Effect.Effect<FillFormResult, BrowserError>;\n readonly pages: Effect.Effect<ReadonlyArray<PageInfo>, BrowserError>;\n readonly frames: Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;\n /** List frames on one exact page without selecting it. */\n readonly framesOf: (page: PageInfo) => Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;\n /** Pin the page's main frame without changing the session selection. */\n readonly pinPage: (page: PageInfo) => Effect.Effect<PinnedTarget, BrowserError>;\n /** Pin one frame that currently belongs to the exact page, without changing selection. */\n readonly pinFrame: (\n page: PageInfo,\n frame: FrameInfo,\n ) => Effect.Effect<PinnedTarget, BrowserError>;\n readonly selectPage: (page: PageInfo) => Effect.Effect<void, BrowserError>;\n readonly selectFrame: (frameId: string) => Effect.Effect<void, BrowserError>;\n /** Create a tab without selecting it and return that exact tab's checked identity. */\n readonly createPage: Effect.Effect<PageInfo, BrowserError>;\n readonly closePage: (page: PageInfo) => Effect.Effect<void, BrowserError>;\n readonly resizeViewport: (viewport: Viewport) => Effect.Effect<void, BrowserError>;\n /**\n * Wait on the original observed node within the host deadline. Hidden includes its detachment;\n * document replacement is stale. Success observes a condition, without authorizing later input.\n */\n readonly waitForElement: (request: WaitForElementRequest) => Effect.Effect<void, BrowserError>;\n readonly waitFor: (request: {\n readonly selector: string;\n readonly state: \"visible\" | \"hidden\" | \"attached\" | \"detached\";\n }) => Effect.Effect<void, BrowserError>;\n /** Navigation observation is registered before the single click dispatch. */\n readonly clickAndWait: (request: ClickRequest) => Effect.Effect<ActionResult, BrowserError>;\n /**\n * Readiness of the current document only. Dependent operations wait for it themselves;\n * this reports it without charging an action, so a caller can decide what to do about a\n * document that predates the registrations.\n */\n readonly ready: Effect.Effect<Bootstrap.ReadinessOutcome, InitializationError>;\n}\n\n/** Helpers that do not supervise callback failures accept any live browser session. */\nexport type AnySession = BrowserSession<unknown>;\n\n/** Dependencies are captured at acquisition, not erased into an environment-free service Layer. */\nexport interface OpenOptions<E = never, R = never> {\n readonly bootstrap?: Bootstrap.Plan<E, R>;\n}\n\n/**\n * Acquire, supervise and close one browser in a fresh scope. The callback keeps the concrete\n * Chromium or provider session type. Its scoped work is joined before checked browser cleanup,\n * and cleanup failures remain typed even when the callback has already failed or was cancelled.\n * Acquisition is evaluated once; an uncertain result is never retried.\n */\nexport const scoped: {\n <S extends BrowserSession<unknown>, A, E2, R2>(\n f: (session: S) => Effect.Effect<A, E2, R2>,\n ): <E, AE, AR>(\n open: Effect.Effect<S & BrowserSession<E>, AE, AR>,\n ) => Effect.Effect<\n A,\n AE | E | E2 | InitializationError | BrowserError,\n Exclude<AR | R2, Scope.Scope>\n >;\n <S, E, AE, AR, A, E2, R2>(\n open: Effect.Effect<S & BrowserSession<E>, AE, AR>,\n f: (session: S & BrowserSession<E>) => Effect.Effect<A, E2, R2>,\n ): Effect.Effect<\n A,\n AE | E | E2 | InitializationError | BrowserError,\n Exclude<AR | R2, Scope.Scope>\n >;\n} = dual(\n 2,\n <S, E, AE, AR, A, E2, R2>(\n open: Effect.Effect<S & BrowserSession<E>, AE, AR>,\n f: (session: S & BrowserSession<E>) => Effect.Effect<A, E2, R2>,\n ) =>\n Effect.scoped(\n Effect.flatMap(open, (session) =>\n Effect.scoped(\n Effect.raceFirst(\n session.failure,\n Effect.suspend(() => f(session)),\n ),\n ).pipe(Effect.onExit(() => session.closeChecked)),\n ),\n ),\n);\n"],"mappings":";;;;;;;;;AAuQA,MAAa,SAkBT,KACF,IAEE,MACA,MAEA,OAAO,OACL,OAAO,QAAQ,OAAO,YACpB,OAAO,OACL,OAAO,UACL,QAAQ,SACR,OAAO,cAAc,EAAE,OAAO,CAAC,CACjC,CACF,CAAC,CAAC,KAAK,OAAO,aAAa,QAAQ,YAAY,CAAC,CAClD,CACF,CACJ"}
|
|
1
|
+
{"version":3,"file":"Browser.mjs","names":[],"sources":["../src/Browser.ts"],"sourcesContent":["import { Effect, type Scope } from \"effect\";\nimport { dual } from \"effect/Function\";\n\nimport type * as Bootstrap from \"./Bootstrap.ts\";\nimport type {\n BrowserDiagnostics,\n Checkpoint,\n CheckpointOptions,\n FillFormOptions,\n FillFormRequest,\n FillFormResult,\n FillRequest,\n HoverRequest,\n InputReceipt,\n KeyStroke,\n NavigateRequest,\n NavigationResult,\n ObservationOptions,\n ObservedElement,\n PointerMoveRequest,\n PressRequest,\n ReadTextRequest,\n ScreenshotRequest,\n ScreenshotResult,\n ScrollRequest,\n SelectOptions,\n SessionStatus,\n StartNavigationRequest,\n TextResult,\n TypeRequest,\n WaitForElementRequest,\n WheelRequest,\n ControlFacts,\n ActionResult,\n ClickRequest,\n FrameInfo,\n Observation,\n PageInfo,\n Target,\n Viewport,\n} from \"./BrowserData.ts\";\nimport type { BrowserError, InitializationError } from \"./Errors.ts\";\n\n/**\n * A host's decision about one control, made on facts read from the exact node immediately\n * before input. Returning anything but `true`, or throwing, sends nothing and fails `denied`.\n * It is a plain synchronous function on purpose: it runs while the owner's permit is held, where\n * waiting on a model or a network call would stall every other operation. It is not an atomic\n * check-and-input transaction, because page script can still run before the native input lands.\n */\nexport interface ElementAdmission {\n readonly admit: (facts: ControlFacts) => boolean;\n}\n\n/**\n * A navigation the browser is still performing. The owner's permit was released when it was\n * dispatched, so while it loads a host may read, `checkpoint`, hold and resume this page, and\n * use any other page. Anything that would change this page fails `busy` until it settles.\n *\n * Leaving its scope unsettled fences the session, exactly as an interrupted mutation does,\n * because nothing then knows what the browser did. It is never replayed.\n */\nexport interface NavigationOperation {\n /** What was navigated, read before dispatch. */\n readonly target: Target;\n /**\n * The document reached DOMContentLoaded. It belongs to this one navigation: a successor that\n * reaches the same URL fails it instead. Interrupting a waiter stops nothing in the browser.\n */\n readonly completed: Effect.Effect<NavigationResult, BrowserError>;\n /**\n * Asks the browser to stop loading and waits for this navigation to settle, after which\n * `completed` fails `interrupted`. Success is a known outcome and the session stays usable:\n * the page holds whatever had loaded. It does not undo anything the page already did.\n * An already-completed navigation cannot stop a successor. Concurrent callers share their\n * active attempt. Before dispatch, cancellation or a busy refusal permits a later request\n * once native setup has retired. A dispatched attempt's outcome, including failure or\n * interruption, is retained permanently; an uncertain stop is never replayed.\n */\n readonly stop: Effect.Effect<void, BrowserError>;\n}\n\n/** Common operations. Direct, retained and pinned views choose their target at different times. */\nexport interface TargetOperations {\n readonly navigate: (request: NavigateRequest) => Effect.Effect<NavigationResult, BrowserError>;\n /** `navigate`, left in flight: the same single dispatch, completed by the caller. */\n readonly startNavigation: (\n request: StartNavigationRequest,\n ) => Effect.Effect<NavigationOperation, BrowserError, Scope.Scope>;\n readonly readText: (request: ReadTextRequest) => Effect.Effect<TextResult, BrowserError>;\n readonly click: (request: ClickRequest) => Effect.Effect<ActionResult, BrowserError>;\n readonly fill: (request: FillRequest) => Effect.Effect<ActionResult, BrowserError>;\n /** Script in the page: instantaneous, and it raises no wheel event. */\n readonly scroll: (request: ScrollRequest) => Effect.Effect<ActionResult, BrowserError>;\n /** One real pointer move, in main-frame viewport pixels. */\n readonly pointerMove: (request: PointerMoveRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** Places the pointer on one exact element where it is, or fails `not-visible` unsent. */\n readonly hover: (request: HoverRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** One real wheel event; the browser decides what under the pointer scrolls. */\n readonly wheel: (request: WheelRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** One real key stroke to whatever has focus, or fails `not-focused` unsent if `into` lacks it. */\n readonly press: (request: PressRequest) => Effect.Effect<InputReceipt, BrowserError>;\n /** Text as the real key strokes that produce it, under the same focus rule as `press`. */\n readonly type: (request: TypeRequest) => Effect.Effect<InputReceipt, BrowserError>;\n readonly screenshot: (\n request: ScreenshotRequest,\n ) => Effect.Effect<ScreenshotResult, BrowserError>;\n}\n\n/**\n * One explicit page/frame target. Selection may move independently; each operation re-resolves\n * this identity inside the same owner and connection. Closing/detaching it or reconnecting makes\n * the handle stale before dispatch.\n */\nexport interface PinnedTarget extends TargetOperations {\n readonly target: Target;\n}\n\n/** A checked selection retained at acquisition; moving selection away and back makes it stale. */\nexport interface RetainedTarget extends TargetOperations {}\n\n/**\n * Host control over one owned browser. This is not a serializable model value: copying a\n * session object cannot copy its capture, page-control or connection authority.\n *\n * The inherited target operations resolve the selected page/frame when their Effect executes.\n * Use `retain` to retain the current selection with stale-on-selection-change semantics, or\n * `pinPage` / `pinFrame` when work must stay on an explicit target while selection moves.\n */\nexport interface BrowserSession<E = never> extends TargetOperations {\n /** The implementation which owns this live connection. */\n readonly implementation: string;\n /** Copied host-only state, readable without admission in every lifecycle phase. */\n readonly status: Effect.Effect<SessionStatus>;\n /** Bounded native/policy diagnostics. Typed callback causes remain in bindingDiagnostics. */\n readonly diagnostics: Effect.Effect<BrowserDiagnostics>;\n /** Close this scope and require its own ownership-specific cleanup evidence. */\n readonly closeChecked: Effect.Effect<void, BrowserError>;\n /** First fail-session callback cause, preserving the consumer's error type on the host. */\n readonly failure: Effect.Effect<never, E | InitializationError>;\n /** Bounded host-only evidence; consumer causes are never projected into a page reply. */\n readonly bindingDiagnostics: Effect.Effect<Bootstrap.BindingDiagnostics<E>>;\n /** Resolve, validate and retain the selection under owner admission. */\n readonly retain: Effect.Effect<RetainedTarget, BrowserError>;\n readonly target: Effect.Effect<Target, BrowserError>;\n /**\n * The one observation whose nodes later actions may name. `scope: \"viewport\"` keeps only text\n * and controls that are on screen and reachable, plus bounded choices of visible native\n * selects; the default reads the whole document. It carries no destination, form or field value.\n */\n readonly observe: (options?: ObservationOptions) => Effect.Effect<Observation, BrowserError>;\n /**\n * Passive evidence for a recorder, with a picture when asked. It issues no references and\n * leaves the observation above exactly as it was. Host-only: it carries control facts.\n */\n readonly checkpoint: (options?: CheckpointOptions) => Effect.Effect<Checkpoint, BrowserError>;\n /** Host-only facts about one observed control, read from that exact node just now. */\n readonly controlFacts: (reference: ObservedElement) => Effect.Effect<ControlFacts, BrowserError>;\n /**\n * After a page hold, nothing observed on that page may be acted on unchecked. This checks one\n * reference: still attached, and still the control that was inspected. It never searches by\n * selector or label for a substitute, and it sends nothing.\n */\n readonly revalidateElement: (\n reference: ObservedElement,\n ) => Effect.Effect<ObservedElement, BrowserError>;\n readonly clickElement: (\n reference: ObservedElement,\n admission?: ElementAdmission,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly fillElement: (\n reference: ObservedElement,\n value: string,\n admission?: ElementAdmission,\n ) => Effect.Effect<ActionResult, BrowserError>;\n /** One selection using this exact select and its issued option element IDs, with fresh checks. */\n readonly selectOption: (\n reference: ObservedElement,\n options: SelectOptions,\n admission?: ElementAdmission,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly hoverElement: (\n reference: ObservedElement,\n admission?: ElementAdmission,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** A key stroke sent only if the exact node an observation named already has focus. */\n readonly pressElement: (\n reference: ObservedElement,\n stroke: KeyStroke,\n admission?: ElementAdmission,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** Real typing with `fillElement`'s exactness: that node must already have focus. */\n readonly typeElement: (\n reference: ObservedElement,\n text: string,\n admission?: ElementAdmission,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /**\n * Set several controls of one observation in order, then optionally click one submit control.\n * Every step acts on the exact observed node after the same fresh checks as `fillElement`,\n * except that a control may have become enabled since it was observed, and each is admitted\n * and charged as its own action. The observation stays usable for this form's own steps only;\n * anything else that changes the page still retires it, and the form retires it when it ends.\n * The first refused or uncertain step ends the form. Submit is sent only after every field\n * succeeded and, unless `verify` is false, still holds what its step left there. Fields set\n * before a stop stay set. It fails only when its first step does; otherwise `stopped` says\n * where it ended and why.\n */\n readonly fillForm: (\n request: FillFormRequest,\n admission?: ElementAdmission,\n options?: FillFormOptions,\n ) => Effect.Effect<FillFormResult, BrowserError>;\n readonly pages: Effect.Effect<ReadonlyArray<PageInfo>, BrowserError>;\n /**\n * One exact page's address and title as they are now, and whether it is selected, without\n * reading every other page as `pages` does. An identity that no longer names an open page\n * fails undispatched.\n */\n readonly describePage: (page: PageInfo) => Effect.Effect<PageInfo, BrowserError>;\n readonly frames: Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;\n /** List frames on one exact page without selecting it. */\n readonly framesOf: (page: PageInfo) => Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;\n /** Pin the page's main frame without changing the session selection. */\n readonly pinPage: (page: PageInfo) => Effect.Effect<PinnedTarget, BrowserError>;\n /** Pin one frame that currently belongs to the exact page, without changing selection. */\n readonly pinFrame: (\n page: PageInfo,\n frame: FrameInfo,\n ) => Effect.Effect<PinnedTarget, BrowserError>;\n readonly selectPage: (page: PageInfo) => Effect.Effect<void, BrowserError>;\n readonly selectFrame: (frameId: string) => Effect.Effect<void, BrowserError>;\n /**\n * Open a page in its own window, sized like the others, without selecting it, and return that\n * exact page's checked identity. Chromium paints every window, so any page can be pictured\n * and read at speed, not only the one in front. It waits its turn behind other operations,\n * within its action timeout, rather than failing `busy`.\n */\n readonly createPage: Effect.Effect<PageInfo, BrowserError>;\n readonly closePage: (page: PageInfo) => Effect.Effect<void, BrowserError>;\n readonly resizeViewport: (viewport: Viewport) => Effect.Effect<void, BrowserError>;\n /**\n * Wait on the original observed node within the host deadline. Hidden includes its detachment;\n * document replacement is stale. Success observes a condition, without authorizing later input.\n */\n readonly waitForElement: (request: WaitForElementRequest) => Effect.Effect<void, BrowserError>;\n readonly waitFor: (request: {\n readonly selector: string;\n readonly state: \"visible\" | \"hidden\" | \"attached\" | \"detached\";\n }) => Effect.Effect<void, BrowserError>;\n /** Navigation observation is registered before the single click dispatch. */\n readonly clickAndWait: (request: ClickRequest) => Effect.Effect<ActionResult, BrowserError>;\n /**\n * Readiness of the current document only. Dependent operations wait for it themselves;\n * this reports it without charging an action, so a caller can decide what to do about a\n * document that predates the registrations.\n */\n readonly ready: Effect.Effect<Bootstrap.ReadinessOutcome, InitializationError>;\n}\n\n/** Helpers that do not supervise callback failures accept any live browser session. */\nexport type AnySession = BrowserSession<unknown>;\n\n/** Dependencies are captured at acquisition, not erased into an environment-free service Layer. */\nexport interface OpenOptions<E = never, R = never> {\n readonly bootstrap?: Bootstrap.Plan<E, R>;\n}\n\n/**\n * Acquire, supervise and close one browser in a fresh scope. The callback keeps the concrete\n * Chromium or provider session type. Its scoped work is joined before checked browser cleanup,\n * and cleanup failures remain typed even when the callback has already failed or was cancelled.\n * Acquisition is evaluated once; an uncertain result is never retried.\n */\nexport const scoped: {\n <S extends BrowserSession<unknown>, A, E2, R2>(\n f: (session: S) => Effect.Effect<A, E2, R2>,\n ): <E, AE, AR>(\n open: Effect.Effect<S & BrowserSession<E>, AE, AR>,\n ) => Effect.Effect<\n A,\n AE | E | E2 | InitializationError | BrowserError,\n Exclude<AR | R2, Scope.Scope>\n >;\n <S, E, AE, AR, A, E2, R2>(\n open: Effect.Effect<S & BrowserSession<E>, AE, AR>,\n f: (session: S & BrowserSession<E>) => Effect.Effect<A, E2, R2>,\n ): Effect.Effect<\n A,\n AE | E | E2 | InitializationError | BrowserError,\n Exclude<AR | R2, Scope.Scope>\n >;\n} = dual(\n 2,\n <S, E, AE, AR, A, E2, R2>(\n open: Effect.Effect<S & BrowserSession<E>, AE, AR>,\n f: (session: S & BrowserSession<E>) => Effect.Effect<A, E2, R2>,\n ) =>\n Effect.scoped(\n Effect.flatMap(open, (session) =>\n Effect.scoped(\n Effect.raceFirst(\n session.failure,\n Effect.suspend(() => f(session)),\n ),\n ).pipe(Effect.onExit(() => session.closeChecked)),\n ),\n ),\n);\n"],"mappings":";;;;;;;;;AAkRA,MAAa,SAkBT,KACF,IAEE,MACA,MAEA,OAAO,OACL,OAAO,QAAQ,OAAO,YACpB,OAAO,OACL,OAAO,UACL,QAAQ,SACR,OAAO,cAAc,EAAE,OAAO,CAAC,CACjC,CACF,CAAC,CAAC,KAAK,OAAO,aAAa,QAAQ,YAAY,CAAC,CAClD,CACF,CACJ"}
|
|
@@ -34,11 +34,11 @@ declare const FrameInfo_base: Schema.Class<FrameInfo, Schema.Struct<{
|
|
|
34
34
|
declare class FrameInfo extends FrameInfo_base {}
|
|
35
35
|
declare const SessionPhase: Schema.Literals<readonly ["acquiring", "open", "paused", "detached", "faulted", "uncertain", "closing", "closed"]>;
|
|
36
36
|
type SessionPhase = typeof SessionPhase.Type;
|
|
37
|
-
declare const SessionReason: Schema.Literals<readonly ["expired", "callback-failure", "registration-failure", "native-failure", "disconnected", "popup-policy", "dialog-policy", "popup-overflow", "dialog-overflow", "cleanup-capacity", "handoff", "detached", "closed"]>;
|
|
37
|
+
declare const SessionReason: Schema.Literals<readonly ["expired", "callback-failure", "registration-failure", "native-failure", "disconnected", "popup-policy", "dialog-policy", "popup-overflow", "dialog-overflow", "cleanup-capacity", "handoff", "detached", "closed", "page-contained"]>;
|
|
38
38
|
type SessionReason = typeof SessionReason.Type;
|
|
39
39
|
declare const SessionStatus_base: Schema.Class<SessionStatus, Schema.Struct<{
|
|
40
40
|
readonly phase: Schema.Literals<readonly ["acquiring", "open", "paused", "detached", "faulted", "uncertain", "closing", "closed"]>;
|
|
41
|
-
readonly reason: Schema.NullOr<Schema.Literals<readonly ["expired", "callback-failure", "registration-failure", "native-failure", "disconnected", "popup-policy", "dialog-policy", "popup-overflow", "dialog-overflow", "cleanup-capacity", "handoff", "detached", "closed"]>>;
|
|
41
|
+
readonly reason: Schema.NullOr<Schema.Literals<readonly ["expired", "callback-failure", "registration-failure", "native-failure", "disconnected", "popup-policy", "dialog-policy", "popup-overflow", "dialog-overflow", "cleanup-capacity", "handoff", "detached", "closed", "page-contained"]>>;
|
|
42
42
|
readonly generation: Schema.Natural;
|
|
43
43
|
readonly busy: Schema.Boolean;
|
|
44
44
|
readonly unresolvedDispatch: Schema.Boolean;
|
|
@@ -55,7 +55,7 @@ declare const SessionStatus_base: Schema.Class<SessionStatus, Schema.Struct<{
|
|
|
55
55
|
/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */
|
|
56
56
|
declare class SessionStatus extends SessionStatus_base {}
|
|
57
57
|
declare const BrowserDiagnostic_base: Schema.Class<BrowserDiagnostic, Schema.Struct<{
|
|
58
|
-
readonly reason: Schema.Literals<readonly ["expired", "callback-failure", "registration-failure", "native-failure", "disconnected", "popup-policy", "dialog-policy", "popup-overflow", "dialog-overflow", "cleanup-capacity", "handoff", "detached", "closed"]>;
|
|
58
|
+
readonly reason: Schema.Literals<readonly ["expired", "callback-failure", "registration-failure", "native-failure", "disconnected", "popup-policy", "dialog-policy", "popup-overflow", "dialog-overflow", "cleanup-capacity", "handoff", "detached", "closed", "page-contained"]>;
|
|
59
59
|
readonly disposition: Schema.Literals<readonly ["pending", "confirmed", "not-dispatched", "unknown"]>;
|
|
60
60
|
readonly generation: Schema.Natural;
|
|
61
61
|
readonly monotonicNanos: Schema.BigInt;
|
|
@@ -508,4 +508,4 @@ type AutomationOptions = typeof AutomationOptions.Type;
|
|
|
508
508
|
//#endregion
|
|
509
509
|
export { TypeRequest as $, ObservedControl as A, SafeFilename as B, KeyModifier as C, NavigationResult as D, NavigateRequest as E, PointerMoveRequest as F, Selector as G, ScreenshotResult as H, PositiveInt as I, SessionStatus as J, SessionPhase as K, PressRequest as L, PageExecutionState as M, PageInfo as N, Observation as O, PageSuspension as P, TextResult as Q, ReadTextRequest as R, InputReceipt as S, NamedKey as T, ScrollRequest as U, ScreenshotRequest as V, SelectOptions as W, Target as X, StartNavigationRequest as Y, TargetUrl as Z, FrameInfo as _, BrowserPolicy as a, WheelRequest as at, InlineFile as b, ClickRequest as c, FillFormRequest as d, Viewport as et, FillFormResult as f, FormStop as g, FormFieldResult as h, BrowserDiagnostics as i, WaitForElementRequest as it, ObservedElement as j, ObservationOptions as k, ControlFacts as l, FormField as m, AutomationOptions as n, ViewportPoint as nt, Checkpoint as o, FillRequest as p, SessionReason as q, BrowserDiagnostic as r, ViewportRect as rt, CheckpointOptions as s, ActionResult as t, ViewportEvidence as tt, FillFormOptions as u, HoverRequest as v, KeyStroke as w, InlineFiles as x, Identifier as y, ReadingMatch as z };
|
|
510
510
|
export {};
|
|
511
|
-
//# sourceMappingURL=BrowserData-
|
|
511
|
+
//# sourceMappingURL=BrowserData-KHk4o__c.d.mts.map
|
package/dist/BrowserData.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as TypeRequest, A as ObservedControl, B as SafeFilename, C as KeyModifier, D as NavigationResult, E as NavigateRequest, F as PointerMoveRequest, G as Selector, H as ScreenshotResult, I as PositiveInt, J as SessionStatus, K as SessionPhase, L as PressRequest, M as PageExecutionState, N as PageInfo, O as Observation, P as PageSuspension, Q as TextResult, R as ReadTextRequest, S as InputReceipt, T as NamedKey, U as ScrollRequest, V as ScreenshotRequest, W as SelectOptions, X as Target, Y as StartNavigationRequest, Z as TargetUrl, _ as FrameInfo, a as BrowserPolicy, at as WheelRequest, b as InlineFile, c as ClickRequest, d as FillFormRequest, et as Viewport, f as FillFormResult, g as FormStop, h as FormFieldResult, i as BrowserDiagnostics, it as WaitForElementRequest, j as ObservedElement, k as ObservationOptions, l as ControlFacts, m as FormField, n as AutomationOptions, nt as ViewportPoint, o as Checkpoint, p as FillRequest, q as SessionReason, r as BrowserDiagnostic, rt as ViewportRect, s as CheckpointOptions, t as ActionResult, tt as ViewportEvidence, u as FillFormOptions, v as HoverRequest, w as KeyStroke, x as InlineFiles, y as Identifier, z as ReadingMatch } from "./BrowserData-
|
|
1
|
+
import { $ as TypeRequest, A as ObservedControl, B as SafeFilename, C as KeyModifier, D as NavigationResult, E as NavigateRequest, F as PointerMoveRequest, G as Selector, H as ScreenshotResult, I as PositiveInt, J as SessionStatus, K as SessionPhase, L as PressRequest, M as PageExecutionState, N as PageInfo, O as Observation, P as PageSuspension, Q as TextResult, R as ReadTextRequest, S as InputReceipt, T as NamedKey, U as ScrollRequest, V as ScreenshotRequest, W as SelectOptions, X as Target, Y as StartNavigationRequest, Z as TargetUrl, _ as FrameInfo, a as BrowserPolicy, at as WheelRequest, b as InlineFile, c as ClickRequest, d as FillFormRequest, et as Viewport, f as FillFormResult, g as FormStop, h as FormFieldResult, i as BrowserDiagnostics, it as WaitForElementRequest, j as ObservedElement, k as ObservationOptions, l as ControlFacts, m as FormField, n as AutomationOptions, nt as ViewportPoint, o as Checkpoint, p as FillRequest, q as SessionReason, r as BrowserDiagnostic, rt as ViewportRect, s as CheckpointOptions, t as ActionResult, tt as ViewportEvidence, u as FillFormOptions, v as HoverRequest, w as KeyStroke, x as InlineFiles, y as Identifier, z as ReadingMatch } from "./BrowserData-KHk4o__c.mjs";
|
|
2
2
|
export { ActionResult, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, FillFormOptions, FillFormRequest, FillFormResult, FillRequest, FormField, FormFieldResult, FormStop, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, ReadingMatch, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
|
|
3
3
|
export {};
|
package/dist/BrowserData.mjs
CHANGED
|
@@ -51,7 +51,8 @@ const SessionReason = Schema.Literals([
|
|
|
51
51
|
"cleanup-capacity",
|
|
52
52
|
"handoff",
|
|
53
53
|
"detached",
|
|
54
|
-
"closed"
|
|
54
|
+
"closed",
|
|
55
|
+
"page-contained"
|
|
55
56
|
]);
|
|
56
57
|
const DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
57
58
|
/** The bound on one session's model-reachable actions, like the host-read allowance's. */
|
package/dist/BrowserData.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserData.mjs","names":[],"sources":["../src/BrowserData.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { BrowserError } from \"./Errors.ts\";\n\nexport const Identifier = Schema.NonEmptyString.check(\n Schema.isMaxLength(256),\n Schema.isPattern(/^[A-Za-z0-9_-]+$/),\n);\n\nexport const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** Portable basename only; never a local or remote filesystem path. */\nexport const SafeFilename = Schema.NonEmptyString.check(\n Schema.isMaxLength(240),\n Schema.makeFilter(\n (value) =>\n value !== \".\" &&\n value !== \"..\" &&\n // oxlint-disable-next-line eslint/no-control-regex -- control characters are what it rejects\n !/[\\x00-\\x1f\\x7f/\\\\:]/.test(value) &&\n !/[. ]$/.test(value) &&\n !/^\\s/.test(value) &&\n !/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\.|$)/i.test(value),\n { title: \"a portable, non-path download filename\" },\n ),\n);\n\nexport class Viewport extends Schema.Class<Viewport>(\"BrowserViewport\")(\n Schema.Struct({\n width: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n height: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n }).check(\n Schema.makeFilter((v) => v.width * v.height <= 8_388_608, {\n title: \"at most 8,388,608 viewport pixels\",\n }),\n ),\n) {}\n\n/** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */\n\nexport class Target extends Schema.Class<Target>(\"BrowserTarget\")({\n generation: Schema.Natural,\n pageId: Identifier,\n frameId: Identifier,\n}) {}\n\nexport class PageInfo extends Schema.Class<PageInfo>(\"BrowserPageInfo\")({\n pageId: Identifier,\n targetId: Identifier,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n title: Schema.String.check(Schema.isMaxLength(512)),\n selected: Schema.Boolean,\n}) {}\n\nexport class FrameInfo extends Schema.Class<FrameInfo>(\"BrowserFrameInfo\")({\n frameId: Identifier,\n parentFrameId: Schema.NullOr(Identifier),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n name: Schema.String.check(Schema.isMaxLength(256)),\n}) {}\n\nexport const SessionPhase = Schema.Literals([\n \"acquiring\",\n \"open\",\n \"paused\",\n \"detached\",\n \"faulted\",\n \"uncertain\",\n \"closing\",\n \"closed\",\n]);\n\nexport type SessionPhase = typeof SessionPhase.Type;\n\nexport const SessionReason = Schema.Literals([\n \"expired\",\n \"callback-failure\",\n \"registration-failure\",\n \"native-failure\",\n \"disconnected\",\n \"popup-policy\",\n \"dialog-policy\",\n \"popup-overflow\",\n \"dialog-overflow\",\n \"cleanup-capacity\",\n \"handoff\",\n \"detached\",\n \"closed\",\n]);\n\nexport type SessionReason = typeof SessionReason.Type;\n\nconst DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));\n\n/** The bound on one session's model-reachable actions, like the host-read allowance's. */\nconst ActionAllowance = PositiveInt.check(Schema.isLessThanOrEqualTo(1_000_000));\n\n/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */\nexport class SessionStatus extends Schema.Class<SessionStatus>(\"BrowserSessionStatus\")({\n phase: SessionPhase,\n reason: Schema.NullOr(SessionReason),\n generation: DiagnosticCounter,\n busy: Schema.Boolean,\n unresolvedDispatch: Schema.Boolean,\n /**\n * Actions admitted against the policy's `maxActions`, as the owner counted them. Host reads\n * (`checkpoint`, `controlFacts`) and uncharged reads such as a form's verification are not\n * actions. `used` equals `maximum` once the allowance is spent; the owner stays open.\n */\n actions: Schema.Struct({\n used: Schema.Natural.check(Schema.isLessThanOrEqualTo(1_000_000)),\n maximum: ActionAllowance,\n }).check(\n Schema.makeFilter((actions) => actions.used <= actions.maximum, {\n title: \"no more actions used than allowed\",\n }),\n ),\n}) {}\n\n/** Bounded host facts only: no target identity, page content, native exception or consumer cause. */\nexport class BrowserDiagnostic extends Schema.Class<BrowserDiagnostic>(\"BrowserDiagnostic\")({\n reason: SessionReason,\n disposition: Schema.Literals([\"pending\", \"confirmed\", \"not-dispatched\", \"unknown\"]),\n generation: DiagnosticCounter,\n monotonicNanos: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n)),\n}) {}\n\nexport class BrowserDiagnostics extends Schema.Class<BrowserDiagnostics>(\"BrowserDiagnostics\")({\n records: Schema.Array(BrowserDiagnostic).check(Schema.isMaxLength(32)),\n total: DiagnosticCounter,\n dropped: DiagnosticCounter,\n truncated: Schema.Boolean,\n}) {}\n\nexport class ObservedControl extends Schema.Class<ObservedControl>(\"BrowserObservedControl\")({\n elementId: Identifier,\n kind: Schema.Literals([\"link\", \"button\", \"input\", \"select\", \"textarea\", \"other\"]),\n label: Schema.String.check(Schema.isMaxLength(256)),\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n required: Schema.optionalKey(Schema.Boolean),\n /** Native select state. A select is never represented by one `selected` boolean. */\n multiple: Schema.optionalKey(Schema.Boolean),\n /** The issued select this native option belongs to, in the same observation. */\n selectElementId: Schema.optionalKey(Identifier),\n /** Some choices could not be issued within this reading's shared control/value bounds. */\n optionsTruncated: Schema.optionalKey(Schema.Boolean),\n}) {}\n\n/**\n * How a viewport reading was bounded and what it left out. These are counts, so they are safe\n * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is\n * kept when its line boxes intersect the viewport and the browser finds its own element at a\n * sampled point. Something that takes no pointer events is invisible to that test, so the\n * browser is asked what is on top there with pointer events ignored: a box that paints at the\n * point covers the text, and one that paints nothing there, such as an empty full-screen\n * container, does not. Text that could not be settled that way is left out as uncertain.\n */\nexport class ViewportEvidence extends Schema.Class<ViewportEvidence>(\"BrowserViewportEvidence\")({\n width: Schema.Finite,\n height: Schema.Finite,\n /** Text that crossed a viewport edge; only its lines on screen were kept. */\n clippedText: Schema.Natural,\n /** Left out: another element is on top at the sampled point, or a box there paints over it. */\n coveredText: Schema.Natural,\n /**\n * Left out: something that takes no pointer events lies over it and the browser's own hit test\n * could not settle whether it paints there, for example beneath another such box, in a child\n * frame, or after too many such points in one reading.\n */\n uncertainText: Schema.Natural,\n /** Controls that intersect the viewport but cannot be reached there. */\n unreachableControls: Schema.Natural,\n /** The traversal budget ran out first, so this reading is known to be incomplete. */\n exhausted: Schema.Boolean,\n}) {}\n\n/**\n * Case-insensitive text a reading keeps. It is applied inside the page before any limit, so\n * matching controls are not crowded out by earlier ones. It filters what is read; it never\n * searches for, re-finds or substitutes a node.\n */\nexport const ReadingMatch = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(256),\n Schema.makeFilter((value) => value.trim().length > 0, { title: \"not only whitespace\" }),\n);\n\n/**\n * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A\n * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its\n * native selects. Those choices are not a claim that a closed dropdown's rows were visible.\n * A `document` reading is the whole body, wherever it is. A reading with `match` keeps only\n * matching text lines and controls, so what it leaves out is not evidence of absence. Nothing\n * here carries a destination, a form or a field value.\n */\nexport class Observation extends Schema.Class<Observation>(\"BrowserObservation\")({\n target: Target,\n observationId: Identifier,\n revision: Schema.Natural,\n scope: Schema.Literals([\"document\", \"viewport\"]),\n match: Schema.optionalKey(ReadingMatch),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n textTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n}) {}\n\nexport class ObservedElement extends Schema.Class<ObservedElement>(\"BrowserObservedElement\")({\n observationId: Identifier,\n elementId: Identifier,\n}) {}\n\n/** Observe a condition of this exact node. A replacement never satisfies the reference. */\nexport class WaitForElementRequest extends Schema.Class<WaitForElementRequest>(\n \"BrowserWaitForElementRequest\",\n)({\n reference: ObservedElement,\n state: Schema.Literals([\"visible\", \"hidden\", \"enabled\", \"disabled\"]),\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n}) {}\n\n/** Issued option element IDs from one observed native select; never values, labels or indices. */\nexport const SelectOptions = Schema.Array(Identifier).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(64),\n Schema.makeFilter((ids) => new Set(ids).size === ids.length),\n);\n\nexport type SelectOptions = typeof SelectOptions.Type;\n\n/** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */\nexport class PageSuspension extends Schema.Class<PageSuspension>(\"BrowserPageSuspension\")({\n pageId: Identifier,\n targetId: Identifier,\n suspensionId: Identifier,\n}) {}\n\nexport class PageExecutionState extends Schema.Class<PageExecutionState>(\n \"BrowserPageExecutionState\",\n)({\n pageId: Identifier,\n targetId: Identifier,\n state: Schema.Literals([\"running\", \"suspended\", \"unknown\"]),\n suspensionId: Schema.optionalKey(Identifier),\n}) {}\n\n/** Explicit opt-out: this integration does not claim whole-browser network containment. */\nexport class BrowserPolicy extends Schema.Class<BrowserPolicy>(\"BrowserBrowserPolicy\")({\n network: Schema.TaggedStruct(\"Unrestricted\", {}),\n /** Model-reachable actions for the session's lifetime, 1–1,000,000. `status.actions` reads use. */\n maxActions: ActionAllowance,\n maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(21_600_000)),\n maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8 * 1024 * 1024)),\n}) {\n /**\n * Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.\n * The network choice is spelled out in the name because this runtime cannot prove a\n * narrower one; override any bound, never the network. A long session raises `maxActions`\n * (up to 1,000,000) and `maxElapsedMillis` (up to six hours) together.\n */\n static unrestricted(\n bounds: Partial<\n Pick<BrowserPolicy, \"maxActions\" | \"maxElapsedMillis\" | \"maxReturnedBytes\">\n > = {},\n ): BrowserPolicy {\n return BrowserPolicy.make({\n network: { _tag: \"Unrestricted\" },\n maxActions: bounds.maxActions ?? 100,\n maxElapsedMillis: bounds.maxElapsedMillis ?? 5 * 60_000,\n maxReturnedBytes: bounds.maxReturnedBytes ?? 2 * 1024 * 1024,\n });\n }\n}\n\nexport const TargetUrl = Schema.NonEmptyString.check(\n Schema.isMaxLength(8192),\n Schema.makeFilter((value) => {\n try {\n const url = new URL(value);\n\n return (\n [\"http:\", \"https:\"].includes(url.protocol) &&\n url.hostname !== \"\" &&\n !url.username &&\n !url.password\n );\n } catch {\n return false;\n }\n }),\n);\n\nexport const Selector = Schema.NonEmptyString.check(Schema.isMaxLength(1024));\n\nexport class NavigateRequest extends Schema.Class<NavigateRequest>(\"BrowserNavigateRequest\")({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\n/**\n * A navigation left in flight. `timeoutMillis` is how long the browser may take to reach\n * DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.\n */\nexport class StartNavigationRequest extends Schema.Class<StartNavigationRequest>(\n \"BrowserStartNavigationRequest\",\n)({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\nexport class ReadTextRequest extends Schema.Class<ReadTextRequest>(\"BrowserReadTextRequest\")({\n selector: Schema.optionalKey(Selector),\n}) {}\n\nexport class ClickRequest extends Schema.Class<ClickRequest>(\"BrowserClickRequest\")({\n selector: Selector,\n}) {}\n\nexport class FillRequest extends Schema.Class<FillRequest>(\"BrowserFillRequest\")({\n selector: Selector,\n value: Schema.String.check(Schema.isMaxLength(65536)),\n}) {}\n\n/**\n * One observed control and the one state a form gives it: replacement text, the checked state a\n * checkbox, radio or switch should end in (it is clicked only when it differs, and a native radio\n * is never asked to clear itself), or issued option IDs of a native select from the same\n * observation.\n */\nexport const FormField = Schema.Struct({\n elementId: Identifier,\n value: Schema.optionalKey(FillRequest.fields.value),\n checked: Schema.optionalKey(Schema.Boolean),\n options: Schema.optionalKey(SelectOptions),\n}).check(\n Schema.makeFilter(\n (field) =>\n Number(field.value !== undefined) +\n Number(field.checked !== undefined) +\n Number(field.options !== undefined) ===\n 1,\n { title: \"exactly one of value, checked or options\" },\n ),\n);\n\nexport type FormField = typeof FormField.Type;\n\n/** At most 32 distinct fields, and a submit control that is not one of them. */\nexport class FillFormRequest extends Schema.Class<FillFormRequest>(\"BrowserFillFormRequest\")(\n Schema.Struct({\n observationId: Identifier,\n fields: Schema.Array(FormField).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(32),\n Schema.makeFilter(\n (fields) => new Set(fields.map((field) => field.elementId)).size === fields.length,\n { title: \"each field at most once\" },\n ),\n ),\n submit: Schema.optionalKey(Identifier),\n }).check(\n Schema.makeFilter(\n (request) =>\n request.submit === undefined ||\n !request.fields.some((field) => field.elementId === request.submit),\n { title: \"a submit control that is not also a field\" },\n ),\n ),\n) {}\n\n/**\n * Host choices about how a form proceeds. `verify` (default true) re-reads every field before\n * submit and stops when one no longer holds what its own step left there. `settleMillis`\n * (default 50, at most 5000; 0 skips it) is how long each dispatched step lets the page's own\n * handlers run, after at least two rendered frames, before its result is read back.\n */\nexport const FillFormOptions = Schema.Struct({\n verify: Schema.optionalKey(Schema.Boolean),\n settleMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 5000 })),\n ),\n});\n\nexport type FillFormOptions = typeof FillFormOptions.Type;\n\n/**\n * Where a form stopped and why. `error.outcome` says whether this step itself was dispatched;\n * nothing after it was. `elementId` names the control it stopped at, when there is one: a\n * verification that could not read the form at all names none.\n */\nexport class FormStop extends Schema.Class<FormStop>(\"BrowserFormStop\")({\n stage: Schema.Literals([\"field\", \"verify\", \"submit\"]),\n elementId: Schema.optionalKey(Identifier),\n error: BrowserError,\n}) {}\n\n/**\n * What a form did, in order. `stopped` is present when it did not finish: the fields before it\n * stay set, because a form is not a transaction. `submitted` is true only when the submit click\n * completed; a stop at `submit` with an `unknown` outcome may have sent it.\n */\nexport class ScrollRequest extends Schema.Class<ScrollRequest>(\"BrowserScrollRequest\")({\n deltaX: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n deltaY: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n}) {}\n\n/**\n * CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It\n * is not a document offset, a device pixel, or a coordinate inside a child frame.\n */\nexport class ViewportPoint extends Schema.Class<ViewportPoint>(\"BrowserViewportPoint\")({\n x: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n y: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n}) {}\n\n/** A box in the viewport of the frame it was read from, in CSS pixels. */\nexport class ViewportRect extends Schema.Class<ViewportRect>(\"BrowserViewportRect\")({\n x: Schema.Finite,\n y: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n}) {}\n\n/**\n * What a host needs to decide whether a control may be acted on. Host-only: a destination can\n * carry a token, so none of this is part of the model-facing `Observation`. It never includes a\n * field's value or any markup.\n */\nexport class ControlFacts extends Schema.Class<ControlFacts>(\"BrowserControlFacts\")({\n kind: ObservedControl.fields.kind,\n label: ObservedControl.fields.label,\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n required: Schema.optionalKey(Schema.Boolean),\n multiple: Schema.optionalKey(Schema.Boolean),\n editable: Schema.Boolean,\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n autocomplete: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n /** A resolved link target, or where this control submits its form. Absent when over-long. */\n destination: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(2048))),\n formMethod: Schema.optionalKey(Schema.Literals([\"get\", \"post\", \"dialog\"])),\n box: ViewportRect,\n placement: Schema.Literals([\"inside\", \"partial\", \"outside\"]),\n /** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */\n hitTest: Schema.Literals([\"self\", \"covered\", \"uncertain\", \"unsampled\"]),\n /** Only then is `box` in the main frame's viewport, the space pointer input uses. */\n mainFrame: Schema.Boolean,\n}) {}\n\n/**\n * Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues\n * no element references and never replaces the observation an agent's tools act on, so\n * inspecting, checkpointing and then acting on the inspected node all compose.\n *\n * It is host-only, because it carries control facts. Text and picture are read one after the\n * other, never atomically: the interval says when, and `documentChanged` says the document was\n * replaced in between, so the two may describe different documents.\n */\nexport class Checkpoint extends Schema.Class<Checkpoint>(\"BrowserCheckpoint\")({\n target: Target,\n revision: Schema.Natural,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n textTruncated: Schema.Boolean,\n controls: Schema.Array(ControlFacts).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n picture: Schema.optionalKey(\n Schema.Struct({ mediaType: Schema.Literal(\"image/png\"), bytes: Schema.Uint8Array }),\n ),\n documentChanged: Schema.Boolean,\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\nconst ReadingBounds = {\n maxTextBytes: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 131072 })),\n ),\n maxControls: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 64 }))),\n};\n\n/** Omitted bounds default at admission; `scope` defaults to the whole document. */\nexport const ObservationOptions = Schema.Struct({\n scope: Schema.optionalKey(Schema.Literals([\"document\", \"viewport\"])),\n match: Schema.optionalKey(ReadingMatch),\n ...ReadingBounds,\n});\n\nexport type ObservationOptions = typeof ObservationOptions.Type;\n\n/** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */\nexport const CheckpointOptions = Schema.Struct({\n ...ReadingBounds,\n picture: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type CheckpointOptions = typeof CheckpointOptions.Type;\n\n/** One native pointer move. Easing and pacing are the caller's: send the points you want. */\nexport class PointerMoveRequest extends Schema.Class<PointerMoveRequest>(\n \"BrowserPointerMoveRequest\",\n)({ to: ViewportPoint }) {}\n\n/** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */\nexport class HoverRequest extends Schema.Class<HoverRequest>(\"BrowserHoverRequest\")({\n selector: Selector,\n}) {}\n\nconst WheelDelta = Schema.Finite.check(Schema.isBetween({ minimum: -100000, maximum: 100000 }));\n\n/**\n * One native wheel event where the pointer is, or at `at` after moving there first. The browser\n * chooses what scrolls, exactly as it would for a person, so a nested scroll container under\n * the pointer scrolls instead of the page.\n */\nexport class WheelRequest extends Schema.Class<WheelRequest>(\"BrowserWheelRequest\")({\n deltaX: WheelDelta,\n deltaY: WheelDelta,\n at: Schema.optionalKey(ViewportPoint),\n}) {}\n\n/**\n * The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is\n * closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.\n */\nexport const NamedKey = Schema.Literals([\n \"Enter\",\n \"Tab\",\n \"Backspace\",\n \"Delete\",\n \"Escape\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"PageUp\",\n \"PageDown\",\n]);\n\nexport type NamedKey = typeof NamedKey.Type;\n\n/** One printable ASCII character, space included: every one is a key on the US layout. */\nconst PrintableKey = Schema.String.check(Schema.isPattern(/^[\\x20-\\x7e]$/));\n\nexport const KeyModifier = Schema.Literals([\"Shift\", \"Control\", \"Alt\", \"Meta\"]);\n\nexport type KeyModifier = typeof KeyModifier.Type;\n\n/** One key, down then up, with any modifiers held around it. */\nexport const KeyStroke = Schema.Struct({\n key: Schema.Union([NamedKey, PrintableKey]),\n modifiers: Schema.optionalKey(\n Schema.Array(KeyModifier).check(\n Schema.makeFilter((held) => new Set(held).size === held.length, {\n title: \"each modifier at most once\",\n }),\n ),\n ),\n});\n\nexport type KeyStroke = typeof KeyStroke.Type;\n\n/**\n * One real key stroke. It goes to whatever has focus in the page, exactly as it would for a\n * person, unless `into` names the one element that must already have it. It never focuses that\n * element, because that would hide a scripted focus inside a native-input operation: click it\n * first.\n */\nexport class PressRequest extends Schema.Class<PressRequest>(\"BrowserPressRequest\")({\n ...KeyStroke.fields,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/** Counted in characters, not UTF-16 units, because that is how many strokes it costs. */\nconst TypedText = Schema.NonEmptyString.check(\n Schema.makeFilter((text) => [...text].length <= 256, { title: \"at most 256 characters\" }),\n Schema.makeFilter(\n (text) =>\n [...text].every((character) => {\n const point = character.codePointAt(0) ?? 0;\n\n // An unpaired surrogate is not a character, and would not survive the wire as one.\n return point > 0x1f && point !== 0x7f && (point < 0xd800 || point > 0xdfff);\n }),\n { title: \"no control characters or unpaired surrogates\" },\n ),\n);\n\n/**\n * Text as the real key strokes that produce it, two native commands for each character, one\n * after another under a single action timeout: send a long passage as several shorter runs.\n * A character the US layout cannot produce is inserted as text, as an input method commits it,\n * and raises no key events. Control characters are refused, so a line break can never press\n * Enter from inside a run of text: a named key is always its own `press`. `into` works as it\n * does for `PressRequest`: a guard on where the text lands, never a focus.\n */\nexport class TypeRequest extends Schema.Class<TypeRequest>(\"BrowserTypeRequest\")({\n text: TypedText,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/**\n * What native input was dispatched, where and when. `position` is the point this owner\n * commanded, null before it has placed the pointer, or unknown when Playwright chose the click\n * point internally. For clicks, the interval brackets Playwright's supported click call, which\n * can include its actionability and navigation waits; the browser's exact dispatch instant is\n * unavailable. The interval is on the host monotonic clock that stamps\n * `CapturedFrame.receivedMonotonicNanos`, so input and\n * pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not\n * claim the page finished scrolling, or that any frame shows it. A receipt never says which\n * key was pressed or what was typed.\n */\nexport class InputReceipt extends Schema.Class<InputReceipt>(\"BrowserInputReceipt\")({\n target: Target,\n kind: Schema.Literals([\"pointer-move\", \"hover\", \"wheel\", \"click\", \"press\", \"type\"]),\n position: Schema.NullOr(ViewportPoint),\n delta: Schema.optionalKey(Schema.Struct({ x: WheelDelta, y: WheelDelta })),\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\n/** `set` dispatched input; `unchanged` needed none, because a toggle already held its state. */\nexport class FormFieldResult extends Schema.Class<FormFieldResult>(\"BrowserFormFieldResult\")({\n elementId: Identifier,\n status: Schema.Literals([\"set\", \"unchanged\"]),\n input: Schema.optionalKey(InputReceipt),\n}) {}\n\n/** The bounded receipts for any toggle clicks and the one optional submit click. */\nexport class FillFormResult extends Schema.Class<FillFormResult>(\"BrowserFillFormResult\")({\n fields: Schema.Array(FormFieldResult).check(Schema.isMaxLength(32)),\n submitted: Schema.Boolean,\n url: TargetUrl,\n submitInput: Schema.optionalKey(InputReceipt),\n stopped: Schema.optionalKey(FormStop),\n}) {}\n\nexport class ScreenshotRequest extends Schema.Class<ScreenshotRequest>(\"BrowserScreenshotRequest\")({\n fullPage: Schema.Boolean,\n}) {}\n\nexport class NavigationResult extends Schema.Class<NavigationResult>(\"BrowserNavigationResult\")({\n url: TargetUrl,\n}) {}\n\nexport class ActionResult extends Schema.Class<ActionResult>(\"BrowserActionResult\")({\n url: TargetUrl,\n /** Present for clicks; fill and scripted scroll results have no native input receipt. */\n input: Schema.optionalKey(InputReceipt),\n}) {}\n\nexport class TextResult extends Schema.Class<TextResult>(\"BrowserTextResult\")({\n text: Schema.String.check(Schema.isMaxLength(8 * 1024 * 1024)),\n}) {}\n\nexport class ScreenshotResult extends Schema.Class<ScreenshotResult>(\"BrowserScreenshotResult\")({\n mediaType: Schema.Literal(\"image/png\"),\n bytes: Schema.Uint8Array,\n}) {}\n\nconst FileMediaType = Schema.NonEmptyString.check(\n Schema.isMaxLength(128),\n Schema.isPattern(/^[a-z0-9][a-z0-9!#$&^_+.-]*\\/[a-z0-9][a-z0-9!#$&^_+.-]*$/),\n);\n\n/** Small selection is in-memory by design: bytes the caller already holds, never a path. */\nexport class InlineFile extends Schema.Class<InlineFile>(\"BrowserInlineFile\")({\n name: SafeFilename,\n mediaType: FileMediaType,\n bytes: Schema.Uint8Array.check(\n Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1024 * 1024, {\n title: \"between one byte and one mebibyte\",\n }),\n ),\n}) {}\n\nexport const InlineFiles = Schema.Array(InlineFile).check(\n Schema.isMaxLength(8),\n Schema.makeFilter(\n (files) =>\n files.length > 0 &&\n files.reduce((total, file) => total + file.bytes.byteLength, 0) <= 4 * 1024 * 1024,\n { title: \"at most four mebibytes of in-memory selection\" },\n ),\n);\n\nexport const AutomationOptions = Schema.Struct({\n actionTimeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n /** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */\n maxHostReads: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1_000_000 })),\n ),\n maxPages: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 32 }))),\n initialPage: Schema.optionalKey(\n Schema.Union([\n Schema.Struct({ targetId: Identifier }),\n Schema.Struct({ newPage: Schema.Literal(true) }),\n ]),\n ),\n popupPolicy: Schema.optionalKey(Schema.Literals([\"retain\", \"close\", \"pause\"])),\n dialogPolicy: Schema.optionalKey(Schema.Literals([\"dismiss\", \"pause\"])),\n pageControl: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type AutomationOptions = typeof AutomationOptions.Type;\n"],"mappings":";;;AAIA,MAAa,aAAa,OAAO,eAAe,MAC9C,OAAO,YAAY,GAAG,GACtB,OAAO,UAAU,kBAAkB,CACrC;AA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F;AAEA,MAAa,oBAAoB,OAAO,OAAO;CAC7C,qBAAqB,OAAO,YAC1B,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAM,CAAC,CAAC,CACnE;;CAEA,cAAc,OAAO,YACnB,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAU,CAAC,CAAC,CACvE;CACA,UAAU,OAAO,YAAY,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;CAC5F,aAAa,OAAO,YAClB,OAAO,MAAM,CACX,OAAO,OAAO,EAAE,UAAU,WAAW,CAAC,GACtC,OAAO,OAAO,EAAE,SAAS,OAAO,QAAQ,IAAI,EAAE,CAAC,CACjD,CAAC,CACH;CACA,aAAa,OAAO,YAAY,OAAO,SAAS;EAAC;EAAU;EAAS;CAAO,CAAC,CAAC;CAC7E,cAAc,OAAO,YAAY,OAAO,SAAS,CAAC,WAAW,OAAO,CAAC,CAAC;CACtE,aAAa,OAAO,YAAY,OAAO,OAAO;AAChD,CAAC"}
|
|
1
|
+
{"version":3,"file":"BrowserData.mjs","names":[],"sources":["../src/BrowserData.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { BrowserError } from \"./Errors.ts\";\n\nexport const Identifier = Schema.NonEmptyString.check(\n Schema.isMaxLength(256),\n Schema.isPattern(/^[A-Za-z0-9_-]+$/),\n);\n\nexport const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** Portable basename only; never a local or remote filesystem path. */\nexport const SafeFilename = Schema.NonEmptyString.check(\n Schema.isMaxLength(240),\n Schema.makeFilter(\n (value) =>\n value !== \".\" &&\n value !== \"..\" &&\n // oxlint-disable-next-line eslint/no-control-regex -- control characters are what it rejects\n !/[\\x00-\\x1f\\x7f/\\\\:]/.test(value) &&\n !/[. ]$/.test(value) &&\n !/^\\s/.test(value) &&\n !/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\.|$)/i.test(value),\n { title: \"a portable, non-path download filename\" },\n ),\n);\n\nexport class Viewport extends Schema.Class<Viewport>(\"BrowserViewport\")(\n Schema.Struct({\n width: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n height: PositiveInt.check(Schema.isLessThanOrEqualTo(4096)),\n }).check(\n Schema.makeFilter((v) => v.width * v.height <= 8_388_608, {\n title: \"at most 8,388,608 viewport pixels\",\n }),\n ),\n) {}\n\n/** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */\n\nexport class Target extends Schema.Class<Target>(\"BrowserTarget\")({\n generation: Schema.Natural,\n pageId: Identifier,\n frameId: Identifier,\n}) {}\n\nexport class PageInfo extends Schema.Class<PageInfo>(\"BrowserPageInfo\")({\n pageId: Identifier,\n targetId: Identifier,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n title: Schema.String.check(Schema.isMaxLength(512)),\n selected: Schema.Boolean,\n}) {}\n\nexport class FrameInfo extends Schema.Class<FrameInfo>(\"BrowserFrameInfo\")({\n frameId: Identifier,\n parentFrameId: Schema.NullOr(Identifier),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n name: Schema.String.check(Schema.isMaxLength(256)),\n}) {}\n\nexport const SessionPhase = Schema.Literals([\n \"acquiring\",\n \"open\",\n \"paused\",\n \"detached\",\n \"faulted\",\n \"uncertain\",\n \"closing\",\n \"closed\",\n]);\n\nexport type SessionPhase = typeof SessionPhase.Type;\n\nexport const SessionReason = Schema.Literals([\n \"expired\",\n \"callback-failure\",\n \"registration-failure\",\n \"native-failure\",\n \"disconnected\",\n \"popup-policy\",\n \"dialog-policy\",\n \"popup-overflow\",\n \"dialog-overflow\",\n \"cleanup-capacity\",\n \"handoff\",\n \"detached\",\n \"closed\",\n \"page-contained\",\n]);\n\nexport type SessionReason = typeof SessionReason.Type;\n\nconst DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));\n\n/** The bound on one session's model-reachable actions, like the host-read allowance's. */\nconst ActionAllowance = PositiveInt.check(Schema.isLessThanOrEqualTo(1_000_000));\n\n/** Host-only admission evidence. Neither an admission token nor proof of remote termination. */\nexport class SessionStatus extends Schema.Class<SessionStatus>(\"BrowserSessionStatus\")({\n phase: SessionPhase,\n reason: Schema.NullOr(SessionReason),\n generation: DiagnosticCounter,\n busy: Schema.Boolean,\n unresolvedDispatch: Schema.Boolean,\n /**\n * Actions admitted against the policy's `maxActions`, as the owner counted them. Host reads\n * (`checkpoint`, `controlFacts`) and uncharged reads such as a form's verification are not\n * actions. `used` equals `maximum` once the allowance is spent; the owner stays open.\n */\n actions: Schema.Struct({\n used: Schema.Natural.check(Schema.isLessThanOrEqualTo(1_000_000)),\n maximum: ActionAllowance,\n }).check(\n Schema.makeFilter((actions) => actions.used <= actions.maximum, {\n title: \"no more actions used than allowed\",\n }),\n ),\n}) {}\n\n/** Bounded host facts only: no target identity, page content, native exception or consumer cause. */\nexport class BrowserDiagnostic extends Schema.Class<BrowserDiagnostic>(\"BrowserDiagnostic\")({\n reason: SessionReason,\n disposition: Schema.Literals([\"pending\", \"confirmed\", \"not-dispatched\", \"unknown\"]),\n generation: DiagnosticCounter,\n monotonicNanos: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n)),\n}) {}\n\nexport class BrowserDiagnostics extends Schema.Class<BrowserDiagnostics>(\"BrowserDiagnostics\")({\n records: Schema.Array(BrowserDiagnostic).check(Schema.isMaxLength(32)),\n total: DiagnosticCounter,\n dropped: DiagnosticCounter,\n truncated: Schema.Boolean,\n}) {}\n\nexport class ObservedControl extends Schema.Class<ObservedControl>(\"BrowserObservedControl\")({\n elementId: Identifier,\n kind: Schema.Literals([\"link\", \"button\", \"input\", \"select\", \"textarea\", \"other\"]),\n label: Schema.String.check(Schema.isMaxLength(256)),\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n required: Schema.optionalKey(Schema.Boolean),\n /** Native select state. A select is never represented by one `selected` boolean. */\n multiple: Schema.optionalKey(Schema.Boolean),\n /** The issued select this native option belongs to, in the same observation. */\n selectElementId: Schema.optionalKey(Identifier),\n /** Some choices could not be issued within this reading's shared control/value bounds. */\n optionsTruncated: Schema.optionalKey(Schema.Boolean),\n}) {}\n\n/**\n * How a viewport reading was bounded and what it left out. These are counts, so they are safe\n * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is\n * kept when its line boxes intersect the viewport and the browser finds its own element at a\n * sampled point. Something that takes no pointer events is invisible to that test, so the\n * browser is asked what is on top there with pointer events ignored: a box that paints at the\n * point covers the text, and one that paints nothing there, such as an empty full-screen\n * container, does not. Text that could not be settled that way is left out as uncertain.\n */\nexport class ViewportEvidence extends Schema.Class<ViewportEvidence>(\"BrowserViewportEvidence\")({\n width: Schema.Finite,\n height: Schema.Finite,\n /** Text that crossed a viewport edge; only its lines on screen were kept. */\n clippedText: Schema.Natural,\n /** Left out: another element is on top at the sampled point, or a box there paints over it. */\n coveredText: Schema.Natural,\n /**\n * Left out: something that takes no pointer events lies over it and the browser's own hit test\n * could not settle whether it paints there, for example beneath another such box, in a child\n * frame, or after too many such points in one reading.\n */\n uncertainText: Schema.Natural,\n /** Controls that intersect the viewport but cannot be reached there. */\n unreachableControls: Schema.Natural,\n /** The traversal budget ran out first, so this reading is known to be incomplete. */\n exhausted: Schema.Boolean,\n}) {}\n\n/**\n * Case-insensitive text a reading keeps. It is applied inside the page before any limit, so\n * matching controls are not crowded out by earlier ones. It filters what is read; it never\n * searches for, re-finds or substitutes a node.\n */\nexport const ReadingMatch = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(256),\n Schema.makeFilter((value) => value.trim().length > 0, { title: \"not only whitespace\" }),\n);\n\n/**\n * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A\n * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its\n * native selects. Those choices are not a claim that a closed dropdown's rows were visible.\n * A `document` reading is the whole body, wherever it is. A reading with `match` keeps only\n * matching text lines and controls, so what it leaves out is not evidence of absence. Nothing\n * here carries a destination, a form or a field value.\n */\nexport class Observation extends Schema.Class<Observation>(\"BrowserObservation\")({\n target: Target,\n observationId: Identifier,\n revision: Schema.Natural,\n scope: Schema.Literals([\"document\", \"viewport\"]),\n match: Schema.optionalKey(ReadingMatch),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n controls: Schema.Array(ObservedControl).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n textTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n}) {}\n\nexport class ObservedElement extends Schema.Class<ObservedElement>(\"BrowserObservedElement\")({\n observationId: Identifier,\n elementId: Identifier,\n}) {}\n\n/** Observe a condition of this exact node. A replacement never satisfies the reference. */\nexport class WaitForElementRequest extends Schema.Class<WaitForElementRequest>(\n \"BrowserWaitForElementRequest\",\n)({\n reference: ObservedElement,\n state: Schema.Literals([\"visible\", \"hidden\", \"enabled\", \"disabled\"]),\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n}) {}\n\n/** Issued option element IDs from one observed native select; never values, labels or indices. */\nexport const SelectOptions = Schema.Array(Identifier).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(64),\n Schema.makeFilter((ids) => new Set(ids).size === ids.length),\n);\n\nexport type SelectOptions = typeof SelectOptions.Type;\n\n/** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */\nexport class PageSuspension extends Schema.Class<PageSuspension>(\"BrowserPageSuspension\")({\n pageId: Identifier,\n targetId: Identifier,\n suspensionId: Identifier,\n}) {}\n\nexport class PageExecutionState extends Schema.Class<PageExecutionState>(\n \"BrowserPageExecutionState\",\n)({\n pageId: Identifier,\n targetId: Identifier,\n state: Schema.Literals([\"running\", \"suspended\", \"unknown\"]),\n suspensionId: Schema.optionalKey(Identifier),\n}) {}\n\n/** Explicit opt-out: this integration does not claim whole-browser network containment. */\nexport class BrowserPolicy extends Schema.Class<BrowserPolicy>(\"BrowserBrowserPolicy\")({\n network: Schema.TaggedStruct(\"Unrestricted\", {}),\n /** Model-reachable actions for the session's lifetime, 1–1,000,000. `status.actions` reads use. */\n maxActions: ActionAllowance,\n maxElapsedMillis: PositiveInt.check(Schema.isLessThanOrEqualTo(21_600_000)),\n maxReturnedBytes: PositiveInt.check(Schema.isLessThanOrEqualTo(8 * 1024 * 1024)),\n}) {\n /**\n * Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.\n * The network choice is spelled out in the name because this runtime cannot prove a\n * narrower one; override any bound, never the network. A long session raises `maxActions`\n * (up to 1,000,000) and `maxElapsedMillis` (up to six hours) together.\n */\n static unrestricted(\n bounds: Partial<\n Pick<BrowserPolicy, \"maxActions\" | \"maxElapsedMillis\" | \"maxReturnedBytes\">\n > = {},\n ): BrowserPolicy {\n return BrowserPolicy.make({\n network: { _tag: \"Unrestricted\" },\n maxActions: bounds.maxActions ?? 100,\n maxElapsedMillis: bounds.maxElapsedMillis ?? 5 * 60_000,\n maxReturnedBytes: bounds.maxReturnedBytes ?? 2 * 1024 * 1024,\n });\n }\n}\n\nexport const TargetUrl = Schema.NonEmptyString.check(\n Schema.isMaxLength(8192),\n Schema.makeFilter((value) => {\n try {\n const url = new URL(value);\n\n return (\n [\"http:\", \"https:\"].includes(url.protocol) &&\n url.hostname !== \"\" &&\n !url.username &&\n !url.password\n );\n } catch {\n return false;\n }\n }),\n);\n\nexport const Selector = Schema.NonEmptyString.check(Schema.isMaxLength(1024));\n\nexport class NavigateRequest extends Schema.Class<NavigateRequest>(\"BrowserNavigateRequest\")({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\n/**\n * A navigation left in flight. `timeoutMillis` is how long the browser may take to reach\n * DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.\n */\nexport class StartNavigationRequest extends Schema.Class<StartNavigationRequest>(\n \"BrowserStartNavigationRequest\",\n)({\n url: TargetUrl,\n timeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 600000 })),\n ),\n}) {}\n\nexport class ReadTextRequest extends Schema.Class<ReadTextRequest>(\"BrowserReadTextRequest\")({\n selector: Schema.optionalKey(Selector),\n}) {}\n\nexport class ClickRequest extends Schema.Class<ClickRequest>(\"BrowserClickRequest\")({\n selector: Selector,\n}) {}\n\nexport class FillRequest extends Schema.Class<FillRequest>(\"BrowserFillRequest\")({\n selector: Selector,\n value: Schema.String.check(Schema.isMaxLength(65536)),\n}) {}\n\n/**\n * One observed control and the one state a form gives it: replacement text, the checked state a\n * checkbox, radio or switch should end in (it is clicked only when it differs, and a native radio\n * is never asked to clear itself), or issued option IDs of a native select from the same\n * observation.\n */\nexport const FormField = Schema.Struct({\n elementId: Identifier,\n value: Schema.optionalKey(FillRequest.fields.value),\n checked: Schema.optionalKey(Schema.Boolean),\n options: Schema.optionalKey(SelectOptions),\n}).check(\n Schema.makeFilter(\n (field) =>\n Number(field.value !== undefined) +\n Number(field.checked !== undefined) +\n Number(field.options !== undefined) ===\n 1,\n { title: \"exactly one of value, checked or options\" },\n ),\n);\n\nexport type FormField = typeof FormField.Type;\n\n/** At most 32 distinct fields, and a submit control that is not one of them. */\nexport class FillFormRequest extends Schema.Class<FillFormRequest>(\"BrowserFillFormRequest\")(\n Schema.Struct({\n observationId: Identifier,\n fields: Schema.Array(FormField).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(32),\n Schema.makeFilter(\n (fields) => new Set(fields.map((field) => field.elementId)).size === fields.length,\n { title: \"each field at most once\" },\n ),\n ),\n submit: Schema.optionalKey(Identifier),\n }).check(\n Schema.makeFilter(\n (request) =>\n request.submit === undefined ||\n !request.fields.some((field) => field.elementId === request.submit),\n { title: \"a submit control that is not also a field\" },\n ),\n ),\n) {}\n\n/**\n * Host choices about how a form proceeds. `verify` (default true) re-reads every field before\n * submit and stops when one no longer holds what its own step left there. `settleMillis`\n * (default 50, at most 5000; 0 skips it) is how long each dispatched step lets the page's own\n * handlers run, after at least two rendered frames, before its result is read back.\n */\nexport const FillFormOptions = Schema.Struct({\n verify: Schema.optionalKey(Schema.Boolean),\n settleMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 5000 })),\n ),\n});\n\nexport type FillFormOptions = typeof FillFormOptions.Type;\n\n/**\n * Where a form stopped and why. `error.outcome` says whether this step itself was dispatched;\n * nothing after it was. `elementId` names the control it stopped at, when there is one: a\n * verification that could not read the form at all names none.\n */\nexport class FormStop extends Schema.Class<FormStop>(\"BrowserFormStop\")({\n stage: Schema.Literals([\"field\", \"verify\", \"submit\"]),\n elementId: Schema.optionalKey(Identifier),\n error: BrowserError,\n}) {}\n\n/**\n * What a form did, in order. `stopped` is present when it did not finish: the fields before it\n * stay set, because a form is not a transaction. `submitted` is true only when the submit click\n * completed; a stop at `submit` with an `unknown` outcome may have sent it.\n */\nexport class ScrollRequest extends Schema.Class<ScrollRequest>(\"BrowserScrollRequest\")({\n deltaX: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n deltaY: Schema.Int.check(Schema.isBetween({ minimum: -100000, maximum: 100000 })),\n}) {}\n\n/**\n * CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It\n * is not a document offset, a device pixel, or a coordinate inside a child frame.\n */\nexport class ViewportPoint extends Schema.Class<ViewportPoint>(\"BrowserViewportPoint\")({\n x: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n y: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 16384 })),\n}) {}\n\n/** A box in the viewport of the frame it was read from, in CSS pixels. */\nexport class ViewportRect extends Schema.Class<ViewportRect>(\"BrowserViewportRect\")({\n x: Schema.Finite,\n y: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n}) {}\n\n/**\n * What a host needs to decide whether a control may be acted on. Host-only: a destination can\n * carry a token, so none of this is part of the model-facing `Observation`. It never includes a\n * field's value or any markup.\n */\nexport class ControlFacts extends Schema.Class<ControlFacts>(\"BrowserControlFacts\")({\n kind: ObservedControl.fields.kind,\n label: ObservedControl.fields.label,\n disabled: Schema.Boolean,\n checked: Schema.optionalKey(Schema.Boolean),\n selected: Schema.optionalKey(Schema.Boolean),\n required: Schema.optionalKey(Schema.Boolean),\n multiple: Schema.optionalKey(Schema.Boolean),\n editable: Schema.Boolean,\n inputType: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(32))),\n autocomplete: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n /** A resolved link target, or where this control submits its form. Absent when over-long. */\n destination: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(2048))),\n formMethod: Schema.optionalKey(Schema.Literals([\"get\", \"post\", \"dialog\"])),\n box: ViewportRect,\n placement: Schema.Literals([\"inside\", \"partial\", \"outside\"]),\n /** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */\n hitTest: Schema.Literals([\"self\", \"covered\", \"uncertain\", \"unsampled\"]),\n /** Only then is `box` in the main frame's viewport, the space pointer input uses. */\n mainFrame: Schema.Boolean,\n}) {}\n\n/**\n * Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues\n * no element references and never replaces the observation an agent's tools act on, so\n * inspecting, checkpointing and then acting on the inspected node all compose.\n *\n * It is host-only, because it carries control facts. Text and picture are read one after the\n * other, never atomically: the interval says when, and `documentChanged` says the document was\n * replaced in between, so the two may describe different documents.\n */\nexport class Checkpoint extends Schema.Class<Checkpoint>(\"BrowserCheckpoint\")({\n target: Target,\n revision: Schema.Natural,\n url: Schema.String.check(Schema.isMaxLength(8192)),\n text: Schema.String.check(Schema.isMaxLength(131072)),\n textTruncated: Schema.Boolean,\n controls: Schema.Array(ControlFacts).check(Schema.isMaxLength(64)),\n controlsTruncated: Schema.Boolean,\n viewport: ViewportEvidence,\n picture: Schema.optionalKey(\n Schema.Struct({ mediaType: Schema.Literal(\"image/png\"), bytes: Schema.Uint8Array }),\n ),\n documentChanged: Schema.Boolean,\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\nconst ReadingBounds = {\n maxTextBytes: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 131072 })),\n ),\n maxControls: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 64 }))),\n};\n\n/** Omitted bounds default at admission; `scope` defaults to the whole document. */\nexport const ObservationOptions = Schema.Struct({\n scope: Schema.optionalKey(Schema.Literals([\"document\", \"viewport\"])),\n match: Schema.optionalKey(ReadingMatch),\n ...ReadingBounds,\n});\n\nexport type ObservationOptions = typeof ObservationOptions.Type;\n\n/** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */\nexport const CheckpointOptions = Schema.Struct({\n ...ReadingBounds,\n picture: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type CheckpointOptions = typeof CheckpointOptions.Type;\n\n/** One native pointer move. Easing and pacing are the caller's: send the points you want. */\nexport class PointerMoveRequest extends Schema.Class<PointerMoveRequest>(\n \"BrowserPointerMoveRequest\",\n)({ to: ViewportPoint }) {}\n\n/** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */\nexport class HoverRequest extends Schema.Class<HoverRequest>(\"BrowserHoverRequest\")({\n selector: Selector,\n}) {}\n\nconst WheelDelta = Schema.Finite.check(Schema.isBetween({ minimum: -100000, maximum: 100000 }));\n\n/**\n * One native wheel event where the pointer is, or at `at` after moving there first. The browser\n * chooses what scrolls, exactly as it would for a person, so a nested scroll container under\n * the pointer scrolls instead of the page.\n */\nexport class WheelRequest extends Schema.Class<WheelRequest>(\"BrowserWheelRequest\")({\n deltaX: WheelDelta,\n deltaY: WheelDelta,\n at: Schema.optionalKey(ViewportPoint),\n}) {}\n\n/**\n * The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is\n * closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.\n */\nexport const NamedKey = Schema.Literals([\n \"Enter\",\n \"Tab\",\n \"Backspace\",\n \"Delete\",\n \"Escape\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"PageUp\",\n \"PageDown\",\n]);\n\nexport type NamedKey = typeof NamedKey.Type;\n\n/** One printable ASCII character, space included: every one is a key on the US layout. */\nconst PrintableKey = Schema.String.check(Schema.isPattern(/^[\\x20-\\x7e]$/));\n\nexport const KeyModifier = Schema.Literals([\"Shift\", \"Control\", \"Alt\", \"Meta\"]);\n\nexport type KeyModifier = typeof KeyModifier.Type;\n\n/** One key, down then up, with any modifiers held around it. */\nexport const KeyStroke = Schema.Struct({\n key: Schema.Union([NamedKey, PrintableKey]),\n modifiers: Schema.optionalKey(\n Schema.Array(KeyModifier).check(\n Schema.makeFilter((held) => new Set(held).size === held.length, {\n title: \"each modifier at most once\",\n }),\n ),\n ),\n});\n\nexport type KeyStroke = typeof KeyStroke.Type;\n\n/**\n * One real key stroke. It goes to whatever has focus in the page, exactly as it would for a\n * person, unless `into` names the one element that must already have it. It never focuses that\n * element, because that would hide a scripted focus inside a native-input operation: click it\n * first.\n */\nexport class PressRequest extends Schema.Class<PressRequest>(\"BrowserPressRequest\")({\n ...KeyStroke.fields,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/** Counted in characters, not UTF-16 units, because that is how many strokes it costs. */\nconst TypedText = Schema.NonEmptyString.check(\n Schema.makeFilter((text) => [...text].length <= 256, { title: \"at most 256 characters\" }),\n Schema.makeFilter(\n (text) =>\n [...text].every((character) => {\n const point = character.codePointAt(0) ?? 0;\n\n // An unpaired surrogate is not a character, and would not survive the wire as one.\n return point > 0x1f && point !== 0x7f && (point < 0xd800 || point > 0xdfff);\n }),\n { title: \"no control characters or unpaired surrogates\" },\n ),\n);\n\n/**\n * Text as the real key strokes that produce it, two native commands for each character, one\n * after another under a single action timeout: send a long passage as several shorter runs.\n * A character the US layout cannot produce is inserted as text, as an input method commits it,\n * and raises no key events. Control characters are refused, so a line break can never press\n * Enter from inside a run of text: a named key is always its own `press`. `into` works as it\n * does for `PressRequest`: a guard on where the text lands, never a focus.\n */\nexport class TypeRequest extends Schema.Class<TypeRequest>(\"BrowserTypeRequest\")({\n text: TypedText,\n into: Schema.optionalKey(Selector),\n}) {}\n\n/**\n * What native input was dispatched, where and when. `position` is the point this owner\n * commanded, null before it has placed the pointer, or unknown when Playwright chose the click\n * point internally. For clicks, the interval brackets Playwright's supported click call, which\n * can include its actionability and navigation waits; the browser's exact dispatch instant is\n * unavailable. The interval is on the host monotonic clock that stamps\n * `CapturedFrame.receivedMonotonicNanos`, so input and\n * pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not\n * claim the page finished scrolling, or that any frame shows it. A receipt never says which\n * key was pressed or what was typed.\n */\nexport class InputReceipt extends Schema.Class<InputReceipt>(\"BrowserInputReceipt\")({\n target: Target,\n kind: Schema.Literals([\"pointer-move\", \"hover\", \"wheel\", \"click\", \"press\", \"type\"]),\n position: Schema.NullOr(ViewportPoint),\n delta: Schema.optionalKey(Schema.Struct({ x: WheelDelta, y: WheelDelta })),\n startedMonotonicNanos: Schema.BigInt,\n completedMonotonicNanos: Schema.BigInt,\n}) {}\n\n/** `set` dispatched input; `unchanged` needed none, because a toggle already held its state. */\nexport class FormFieldResult extends Schema.Class<FormFieldResult>(\"BrowserFormFieldResult\")({\n elementId: Identifier,\n status: Schema.Literals([\"set\", \"unchanged\"]),\n input: Schema.optionalKey(InputReceipt),\n}) {}\n\n/** The bounded receipts for any toggle clicks and the one optional submit click. */\nexport class FillFormResult extends Schema.Class<FillFormResult>(\"BrowserFillFormResult\")({\n fields: Schema.Array(FormFieldResult).check(Schema.isMaxLength(32)),\n submitted: Schema.Boolean,\n url: TargetUrl,\n submitInput: Schema.optionalKey(InputReceipt),\n stopped: Schema.optionalKey(FormStop),\n}) {}\n\nexport class ScreenshotRequest extends Schema.Class<ScreenshotRequest>(\"BrowserScreenshotRequest\")({\n fullPage: Schema.Boolean,\n}) {}\n\nexport class NavigationResult extends Schema.Class<NavigationResult>(\"BrowserNavigationResult\")({\n url: TargetUrl,\n}) {}\n\nexport class ActionResult extends Schema.Class<ActionResult>(\"BrowserActionResult\")({\n url: TargetUrl,\n /** Present for clicks; fill and scripted scroll results have no native input receipt. */\n input: Schema.optionalKey(InputReceipt),\n}) {}\n\nexport class TextResult extends Schema.Class<TextResult>(\"BrowserTextResult\")({\n text: Schema.String.check(Schema.isMaxLength(8 * 1024 * 1024)),\n}) {}\n\nexport class ScreenshotResult extends Schema.Class<ScreenshotResult>(\"BrowserScreenshotResult\")({\n mediaType: Schema.Literal(\"image/png\"),\n bytes: Schema.Uint8Array,\n}) {}\n\nconst FileMediaType = Schema.NonEmptyString.check(\n Schema.isMaxLength(128),\n Schema.isPattern(/^[a-z0-9][a-z0-9!#$&^_+.-]*\\/[a-z0-9][a-z0-9!#$&^_+.-]*$/),\n);\n\n/** Small selection is in-memory by design: bytes the caller already holds, never a path. */\nexport class InlineFile extends Schema.Class<InlineFile>(\"BrowserInlineFile\")({\n name: SafeFilename,\n mediaType: FileMediaType,\n bytes: Schema.Uint8Array.check(\n Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1024 * 1024, {\n title: \"between one byte and one mebibyte\",\n }),\n ),\n}) {}\n\nexport const InlineFiles = Schema.Array(InlineFile).check(\n Schema.isMaxLength(8),\n Schema.makeFilter(\n (files) =>\n files.length > 0 &&\n files.reduce((total, file) => total + file.bytes.byteLength, 0) <= 4 * 1024 * 1024,\n { title: \"at most four mebibytes of in-memory selection\" },\n ),\n);\n\nexport const AutomationOptions = Schema.Struct({\n actionTimeoutMillis: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 60000 })),\n ),\n /** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */\n maxHostReads: Schema.optionalKey(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1_000_000 })),\n ),\n maxPages: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 32 }))),\n initialPage: Schema.optionalKey(\n Schema.Union([\n Schema.Struct({ targetId: Identifier }),\n Schema.Struct({ newPage: Schema.Literal(true) }),\n ]),\n ),\n popupPolicy: Schema.optionalKey(Schema.Literals([\"retain\", \"close\", \"pause\"])),\n dialogPolicy: Schema.optionalKey(Schema.Literals([\"dismiss\", \"pause\"])),\n pageControl: Schema.optionalKey(Schema.Boolean),\n});\n\nexport type AutomationOptions = typeof AutomationOptions.Type;\n"],"mappings":";;;AAIA,MAAa,aAAa,OAAO,eAAe,MAC9C,OAAO,YAAY,GAAG,GACtB,OAAO,UAAU,kBAAkB,CACrC;AAEA,MAAa,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;AAGnE,MAAa,eAAe,OAAO,eAAe,MAChD,OAAO,YAAY,GAAG,GACtB,OAAO,YACJ,UACC,UAAU,OACV,UAAU,QAEV,CAAC,sBAAsB,KAAK,KAAK,KACjC,CAAC,QAAQ,KAAK,KAAK,KACnB,CAAC,MAAM,KAAK,KAAK,KACjB,CAAC,gDAAgD,KAAK,KAAK,GAC7D,EAAE,OAAO,yCAAyC,CACpD,CACF;AAEA,IAAa,WAAb,cAA8B,OAAO,MAAgB,iBAAiB,CAAC,CACrE,OAAO,OAAO;CACZ,OAAO,YAAY,MAAM,OAAO,oBAAoB,IAAI,CAAC;CACzD,QAAQ,YAAY,MAAM,OAAO,oBAAoB,IAAI,CAAC;AAC5D,CAAC,CAAC,CAAC,MACD,OAAO,YAAY,MAAM,EAAE,QAAQ,EAAE,UAAU,SAAW,EACxD,OAAO,oCACT,CAAC,CACH,CACF,CAAC,CAAC,CAAC;;AAIH,IAAa,SAAb,cAA4B,OAAO,MAAc,eAAe,CAAC,CAAC;CAChE,YAAY,OA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