effect-browser 0.0.0-reserved.0 → 0.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +664 -3
  3. package/dist/Association-zlgInoaj.mjs +134 -0
  4. package/dist/Association-zlgInoaj.mjs.map +1 -0
  5. package/dist/Bootstrap-B9UUXsvF.d.mts +183 -0
  6. package/dist/Bootstrap-Be-2Ddmh.mjs +187 -0
  7. package/dist/Bootstrap-Be-2Ddmh.mjs.map +1 -0
  8. package/dist/Bootstrap.d.mts +3 -0
  9. package/dist/Bootstrap.mjs +2 -0
  10. package/dist/Browser.d.mts +177 -0
  11. package/dist/Browser.mjs +14 -0
  12. package/dist/Browser.mjs.map +1 -0
  13. package/dist/BrowserData-DJAnUHoZ.d.mts +412 -0
  14. package/dist/BrowserData.d.mts +3 -0
  15. package/dist/BrowserData.mjs +494 -0
  16. package/dist/BrowserData.mjs.map +1 -0
  17. package/dist/BrowserRuntime-fZz1b0VI.mjs +5169 -0
  18. package/dist/BrowserRuntime-fZz1b0VI.mjs.map +1 -0
  19. package/dist/BrowserRuntime.d.mts +139 -0
  20. package/dist/BrowserRuntime.mjs +2 -0
  21. package/dist/Capture.d.mts +40 -0
  22. package/dist/Capture.mjs +476 -0
  23. package/dist/Capture.mjs.map +1 -0
  24. package/dist/CaptureData-AmqVP_Ba.mjs +162 -0
  25. package/dist/CaptureData-AmqVP_Ba.mjs.map +1 -0
  26. package/dist/CaptureData.d.mts +148 -0
  27. package/dist/CaptureData.mjs +2 -0
  28. package/dist/Chromium.d.mts +84 -0
  29. package/dist/Chromium.mjs +381 -0
  30. package/dist/Chromium.mjs.map +1 -0
  31. package/dist/Errors.d.mts +106 -0
  32. package/dist/Errors.mjs +155 -0
  33. package/dist/Errors.mjs.map +1 -0
  34. package/dist/PageControl.d.mts +15 -0
  35. package/dist/PageControl.mjs +28 -0
  36. package/dist/PageControl.mjs.map +1 -0
  37. package/dist/PageControlAssociation-DabEg5AR.mjs +10 -0
  38. package/dist/PageControlAssociation-DabEg5AR.mjs.map +1 -0
  39. package/dist/index.d.mts +10 -0
  40. package/dist/index.mjs +9 -0
  41. package/package.json +67 -5
@@ -0,0 +1,177 @@
1
+ import { f as Plan, g as ReadinessOutcome, s as Bootstrap_d_exports, t as BindingDiagnostics } from "./Bootstrap-B9UUXsvF.mjs";
2
+ import { BrowserError, InitializationError } from "./Errors.mjs";
3
+ import { C as ObservationOptions, D as PageInfo, F as ScreenshotResult, G as TextResult, H as StartNavigationRequest, I as ScrollRequest, K as TypeRequest, L as SelectOptions, M as ReadTextRequest, P as ScreenshotRequest, Q as WheelRequest, S as Observation, T as ObservedElement, U as Target, V as SessionStatus, Z as WaitForElementRequest, b as NavigateRequest, c as ClickRequest, d as FrameInfo, f as HoverRequest, g as InputReceipt, i as BrowserDiagnostics, j as PressRequest, k as PointerMoveRequest, l as ControlFacts, o as Checkpoint, q as Viewport, s as CheckpointOptions, t as ActionResult, u as FillRequest, v as KeyStroke, x as NavigationResult } from "./BrowserData-DJAnUHoZ.mjs";
4
+ import { Effect, Scope } from "effect";
5
+ //#region src/Browser.d.ts
6
+ /**
7
+ * A host's decision about one control, made on facts read from the exact node immediately
8
+ * before input. Returning anything but `true`, or throwing, sends nothing and fails `denied`.
9
+ * It is a plain synchronous function on purpose: it runs while the owner's permit is held, where
10
+ * waiting on a model or a network call would stall every other operation. It is not an atomic
11
+ * check-and-input transaction, because page script can still run before the native input lands.
12
+ */
13
+ export interface ElementAdmission {
14
+ readonly admit: (facts: ControlFacts) => boolean;
15
+ }
16
+ /**
17
+ * A navigation the browser is still performing. The owner's permit was released when it was
18
+ * dispatched, so while it loads a host may read, `checkpoint`, hold and resume this page, and
19
+ * use any other page. Anything that would change this page fails `busy` until it settles.
20
+ *
21
+ * Leaving its scope unsettled fences the session, exactly as an interrupted mutation does,
22
+ * because nothing then knows what the browser did. It is never replayed.
23
+ */
24
+ export interface NavigationOperation {
25
+ /** What was navigated, read before dispatch. */
26
+ readonly target: Target;
27
+ /**
28
+ * The document reached DOMContentLoaded. It belongs to this one navigation: a successor that
29
+ * reaches the same URL fails it instead. Interrupting a waiter stops nothing in the browser.
30
+ */
31
+ readonly completed: Effect.Effect<NavigationResult, BrowserError>;
32
+ /**
33
+ * Asks the browser to stop loading and waits for this navigation to settle, after which
34
+ * `completed` fails `interrupted`. Success is a known outcome and the session stays usable:
35
+ * the page holds whatever had loaded. It does not undo anything the page already did.
36
+ * An already-completed navigation cannot stop a successor. Concurrent callers share their
37
+ * active attempt. Before dispatch, cancellation or a busy refusal permits a later request
38
+ * once native setup has retired. A dispatched attempt's outcome, including failure or
39
+ * interruption, is retained permanently; an uncertain stop is never replayed.
40
+ */
41
+ readonly stop: Effect.Effect<void, BrowserError>;
42
+ }
43
+ /** Common operations. Direct, retained and pinned views choose their target at different times. */
44
+ export interface TargetOperations {
45
+ readonly navigate: (request: NavigateRequest) => Effect.Effect<NavigationResult, BrowserError>;
46
+ /** `navigate`, left in flight: the same single dispatch, completed by the caller. */
47
+ readonly startNavigation: (request: StartNavigationRequest) => Effect.Effect<NavigationOperation, BrowserError, Scope.Scope>;
48
+ readonly readText: (request: ReadTextRequest) => Effect.Effect<TextResult, BrowserError>;
49
+ readonly click: (request: ClickRequest) => Effect.Effect<ActionResult, BrowserError>;
50
+ readonly fill: (request: FillRequest) => Effect.Effect<ActionResult, BrowserError>;
51
+ /** Script in the page: instantaneous, and it raises no wheel event. */
52
+ readonly scroll: (request: ScrollRequest) => Effect.Effect<ActionResult, BrowserError>;
53
+ /** One real pointer move, in main-frame viewport pixels. */
54
+ readonly pointerMove: (request: PointerMoveRequest) => Effect.Effect<InputReceipt, BrowserError>;
55
+ /** Places the pointer on one exact element where it is, or fails `not-visible` unsent. */
56
+ readonly hover: (request: HoverRequest) => Effect.Effect<InputReceipt, BrowserError>;
57
+ /** One real wheel event; the browser decides what under the pointer scrolls. */
58
+ readonly wheel: (request: WheelRequest) => Effect.Effect<InputReceipt, BrowserError>;
59
+ /** One real key stroke to whatever has focus, or fails `not-focused` unsent if `into` lacks it. */
60
+ readonly press: (request: PressRequest) => Effect.Effect<InputReceipt, BrowserError>;
61
+ /** Text as the real key strokes that produce it, under the same focus rule as `press`. */
62
+ readonly type: (request: TypeRequest) => Effect.Effect<InputReceipt, BrowserError>;
63
+ readonly screenshot: (request: ScreenshotRequest) => Effect.Effect<ScreenshotResult, BrowserError>;
64
+ }
65
+ /**
66
+ * One explicit page/frame target. Selection may move independently; each operation re-resolves
67
+ * this identity inside the same owner and connection. Closing/detaching it or reconnecting makes
68
+ * the handle stale before dispatch.
69
+ */
70
+ export interface PinnedTarget extends TargetOperations {
71
+ readonly target: Target;
72
+ }
73
+ /** A checked selection retained at acquisition; moving selection away and back makes it stale. */
74
+ export interface RetainedTarget extends TargetOperations {}
75
+ /**
76
+ * Host control over one owned browser. This is not a serializable model value: copying a
77
+ * session object cannot copy its capture, page-control or connection authority.
78
+ *
79
+ * The inherited target operations resolve the selected page/frame when their Effect executes.
80
+ * Use `retain` to retain the current selection with stale-on-selection-change semantics, or
81
+ * `pinPage` / `pinFrame` when work must stay on an explicit target while selection moves.
82
+ */
83
+ export interface BrowserSession<E = never> extends TargetOperations {
84
+ /** The implementation which owns this live connection. */
85
+ readonly implementation: string;
86
+ /** Copied host-only state, readable without admission in every lifecycle phase. */
87
+ readonly status: Effect.Effect<SessionStatus>;
88
+ /** Bounded native/policy diagnostics. Typed callback causes remain in bindingDiagnostics. */
89
+ readonly diagnostics: Effect.Effect<BrowserDiagnostics>;
90
+ /** Close this scope and require its own ownership-specific cleanup evidence. */
91
+ readonly closeChecked: Effect.Effect<void, BrowserError>;
92
+ /** First fail-session callback cause, preserving the consumer's error type on the host. */
93
+ readonly failure: Effect.Effect<never, E | InitializationError>;
94
+ /** Bounded host-only evidence; consumer causes are never projected into a page reply. */
95
+ readonly bindingDiagnostics: Effect.Effect<BindingDiagnostics<E>>;
96
+ /** Resolve, validate and retain the selection under owner admission. */
97
+ readonly retain: Effect.Effect<RetainedTarget, BrowserError>;
98
+ readonly target: Effect.Effect<Target, BrowserError>;
99
+ /**
100
+ * The one observation whose nodes later actions may name. `scope: "viewport"` keeps only text
101
+ * and controls that are on screen and reachable, plus bounded choices of visible native
102
+ * selects; the default reads the whole document. It carries no destination, form or field value.
103
+ */
104
+ readonly observe: (options?: ObservationOptions) => Effect.Effect<Observation, BrowserError>;
105
+ /**
106
+ * Passive evidence for a recorder, with a picture when asked. It issues no references and
107
+ * leaves the observation above exactly as it was. Host-only: it carries control facts.
108
+ */
109
+ readonly checkpoint: (options?: CheckpointOptions) => Effect.Effect<Checkpoint, BrowserError>;
110
+ /** Host-only facts about one observed control, read from that exact node just now. */
111
+ readonly controlFacts: (reference: ObservedElement) => Effect.Effect<ControlFacts, BrowserError>;
112
+ /**
113
+ * After a page hold, nothing observed on that page may be acted on unchecked. This checks one
114
+ * reference: still attached, and still the control that was inspected. It never searches by
115
+ * selector or label for a substitute, and it sends nothing.
116
+ */
117
+ readonly revalidateElement: (reference: ObservedElement) => Effect.Effect<ObservedElement, BrowserError>;
118
+ readonly clickElement: (reference: ObservedElement, admission?: ElementAdmission) => Effect.Effect<ActionResult, BrowserError>;
119
+ readonly fillElement: (reference: ObservedElement, value: string, admission?: ElementAdmission) => Effect.Effect<ActionResult, BrowserError>;
120
+ /** One selection using this exact select and its issued option element IDs, with fresh checks. */
121
+ readonly selectOption: (reference: ObservedElement, options: SelectOptions, admission?: ElementAdmission) => Effect.Effect<ActionResult, BrowserError>;
122
+ readonly hoverElement: (reference: ObservedElement, admission?: ElementAdmission) => Effect.Effect<InputReceipt, BrowserError>;
123
+ /** A key stroke sent only if the exact node an observation named already has focus. */
124
+ readonly pressElement: (reference: ObservedElement, stroke: KeyStroke, admission?: ElementAdmission) => Effect.Effect<InputReceipt, BrowserError>;
125
+ /** Real typing with `fillElement`'s exactness: that node must already have focus. */
126
+ readonly typeElement: (reference: ObservedElement, text: string, admission?: ElementAdmission) => Effect.Effect<InputReceipt, BrowserError>;
127
+ readonly pages: Effect.Effect<ReadonlyArray<PageInfo>, BrowserError>;
128
+ readonly frames: Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;
129
+ /** List frames on one exact page without selecting it. */
130
+ readonly framesOf: (page: PageInfo) => Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;
131
+ /** Pin the page's main frame without changing the session selection. */
132
+ readonly pinPage: (page: PageInfo) => Effect.Effect<PinnedTarget, BrowserError>;
133
+ /** Pin one frame that currently belongs to the exact page, without changing selection. */
134
+ readonly pinFrame: (page: PageInfo, frame: FrameInfo) => Effect.Effect<PinnedTarget, BrowserError>;
135
+ readonly selectPage: (page: PageInfo) => Effect.Effect<void, BrowserError>;
136
+ readonly selectFrame: (frameId: string) => Effect.Effect<void, BrowserError>;
137
+ /** Create a tab without selecting it and return that exact tab's checked identity. */
138
+ readonly createPage: Effect.Effect<PageInfo, BrowserError>;
139
+ readonly closePage: (page: PageInfo) => Effect.Effect<void, BrowserError>;
140
+ readonly resizeViewport: (viewport: Viewport) => Effect.Effect<void, BrowserError>;
141
+ /**
142
+ * Wait on the original observed node within the host deadline. Hidden includes its detachment;
143
+ * document replacement is stale. Success observes a condition, without authorizing later input.
144
+ */
145
+ readonly waitForElement: (request: WaitForElementRequest) => Effect.Effect<void, BrowserError>;
146
+ readonly waitFor: (request: {
147
+ readonly selector: string;
148
+ readonly state: "visible" | "hidden" | "attached" | "detached";
149
+ }) => Effect.Effect<void, BrowserError>;
150
+ /** Navigation observation is registered before the single click dispatch. */
151
+ readonly clickAndWait: (request: ClickRequest) => Effect.Effect<ActionResult, BrowserError>;
152
+ /**
153
+ * Readiness of the current document only. Dependent operations wait for it themselves;
154
+ * this reports it without charging an action, so a caller can decide what to do about a
155
+ * document that predates the registrations.
156
+ */
157
+ readonly ready: Effect.Effect<ReadinessOutcome, InitializationError>;
158
+ }
159
+ /** Helpers that do not supervise callback failures accept any live browser session. */
160
+ export type AnySession = BrowserSession<unknown>;
161
+ /** Dependencies are captured at acquisition, not erased into an environment-free service Layer. */
162
+ export interface OpenOptions<E = never, R = never> {
163
+ readonly bootstrap?: Plan<E, R>;
164
+ }
165
+ /**
166
+ * Acquire, supervise and close one browser in a fresh scope. The callback keeps the concrete
167
+ * Chromium or provider session type. Its scoped work is joined before checked browser cleanup,
168
+ * and cleanup failures remain typed even when the callback has already failed or was cancelled.
169
+ * Acquisition is evaluated once; an uncertain result is never retried.
170
+ */
171
+ export declare const scoped: {
172
+ <S extends BrowserSession<unknown>, A, E2, R2>(f: (session: S) => Effect.Effect<A, E2, R2>): <E, AE, AR>(open: Effect.Effect<S & BrowserSession<E>, AE, AR>) => Effect.Effect<A, AE | E | E2 | InitializationError | BrowserError, Exclude<AR | R2, Scope.Scope>>;
173
+ <S, E, AE, AR, A, E2, R2>(open: Effect.Effect<S & BrowserSession<E>, AE, AR>, f: (session: S & BrowserSession<E>) => Effect.Effect<A, E2, R2>): Effect.Effect<A, AE | E | E2 | InitializationError | BrowserError, Exclude<AR | R2, Scope.Scope>>;
174
+ };
175
+ //#endregion
176
+ export {};
177
+ //# sourceMappingURL=Browser.d.mts.map
@@ -0,0 +1,14 @@
1
+ import { Effect } from "effect";
2
+ import { dual } from "effect/Function";
3
+ //#region src/Browser.ts
4
+ /**
5
+ * Acquire, supervise and close one browser in a fresh scope. The callback keeps the concrete
6
+ * Chromium or provider session type. Its scoped work is joined before checked browser cleanup,
7
+ * and cleanup failures remain typed even when the callback has already failed or was cancelled.
8
+ * Acquisition is evaluated once; an uncertain result is never retried.
9
+ */
10
+ const scoped = dual(2, (open, f) => Effect.scoped(Effect.flatMap(open, (session) => Effect.scoped(Effect.raceFirst(session.failure, Effect.suspend(() => f(session)))).pipe(Effect.onExit(() => session.closeChecked)))));
11
+ //#endregion
12
+ export { scoped };
13
+
14
+ //# sourceMappingURL=Browser.mjs.map
@@ -0,0 +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 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 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":";;;;;;;;;AAoPA,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"}
@@ -0,0 +1,412 @@
1
+ import { Schema } from "effect";
2
+ //#region src/BrowserData.d.ts
3
+ declare const Identifier: Schema.NonEmptyString;
4
+ declare const PositiveInt: Schema.Int;
5
+ /** Portable basename only; never a local or remote filesystem path. */
6
+ declare const SafeFilename: Schema.NonEmptyString;
7
+ declare const Viewport_base: Schema.Class<Viewport, Schema.Struct<{
8
+ readonly width: Schema.Int;
9
+ readonly height: Schema.Int;
10
+ }>, {}>;
11
+ declare class Viewport extends Viewport_base {}
12
+ declare const Target_base: Schema.Class<Target, Schema.Struct<{
13
+ readonly generation: Schema.Natural;
14
+ readonly pageId: Schema.NonEmptyString;
15
+ readonly frameId: Schema.NonEmptyString;
16
+ }>, {}>;
17
+ /** Page/frame IDs are connection-local; targetId is a separate Chromium identity. */
18
+ declare class Target extends Target_base {}
19
+ declare const PageInfo_base: Schema.Class<PageInfo, Schema.Struct<{
20
+ readonly pageId: Schema.NonEmptyString;
21
+ readonly targetId: Schema.NonEmptyString;
22
+ readonly url: Schema.String;
23
+ readonly title: Schema.String;
24
+ readonly selected: Schema.Boolean;
25
+ }>, {}>;
26
+ declare class PageInfo extends PageInfo_base {}
27
+ declare const FrameInfo_base: Schema.Class<FrameInfo, Schema.Struct<{
28
+ readonly frameId: Schema.NonEmptyString;
29
+ readonly parentFrameId: Schema.NullOr<Schema.NonEmptyString>;
30
+ readonly url: Schema.String;
31
+ readonly name: Schema.String;
32
+ }>, {}>;
33
+ declare class FrameInfo extends FrameInfo_base {}
34
+ declare const SessionPhase: Schema.Literals<readonly ["acquiring", "open", "paused", "detached", "faulted", "uncertain", "closing", "closed"]>;
35
+ type SessionPhase = typeof SessionPhase.Type;
36
+ 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
+ type SessionReason = typeof SessionReason.Type;
38
+ declare const SessionStatus_base: Schema.Class<SessionStatus, Schema.Struct<{
39
+ readonly phase: Schema.Literals<readonly ["acquiring", "open", "paused", "detached", "faulted", "uncertain", "closing", "closed"]>;
40
+ 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 generation: Schema.Natural;
42
+ readonly busy: Schema.Boolean;
43
+ readonly unresolvedDispatch: Schema.Boolean;
44
+ }>, {}>;
45
+ /** Host-only admission evidence. Neither an admission token nor proof of remote termination. */
46
+ declare class SessionStatus extends SessionStatus_base {}
47
+ declare const BrowserDiagnostic_base: Schema.Class<BrowserDiagnostic, Schema.Struct<{
48
+ 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"]>;
49
+ readonly disposition: Schema.Literals<readonly ["pending", "confirmed", "not-dispatched", "unknown"]>;
50
+ readonly generation: Schema.Natural;
51
+ readonly monotonicNanos: Schema.BigInt;
52
+ }>, {}>;
53
+ /** Bounded host facts only: no target identity, page content, native exception or consumer cause. */
54
+ declare class BrowserDiagnostic extends BrowserDiagnostic_base {}
55
+ declare const BrowserDiagnostics_base: Schema.Class<BrowserDiagnostics, Schema.Struct<{
56
+ readonly records: Schema.$Array<typeof BrowserDiagnostic>;
57
+ readonly total: Schema.Natural;
58
+ readonly dropped: Schema.Natural;
59
+ readonly truncated: Schema.Boolean;
60
+ }>, {}>;
61
+ declare class BrowserDiagnostics extends BrowserDiagnostics_base {}
62
+ declare const ObservedControl_base: Schema.Class<ObservedControl, Schema.Struct<{
63
+ readonly elementId: Schema.NonEmptyString;
64
+ readonly kind: Schema.Literals<readonly ["link", "button", "input", "select", "textarea", "other"]>;
65
+ readonly label: Schema.String;
66
+ readonly disabled: Schema.Boolean;
67
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
68
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
69
+ readonly inputType: Schema.optionalKey<Schema.String>;
70
+ readonly required: Schema.optionalKey<Schema.Boolean>;
71
+ /** Native select state. A select is never represented by one `selected` boolean. */
72
+ readonly multiple: Schema.optionalKey<Schema.Boolean>;
73
+ /** The issued select this native option belongs to, in the same observation. */
74
+ readonly selectElementId: Schema.optionalKey<Schema.NonEmptyString>;
75
+ /** Some choices could not be issued within this reading's shared control/value bounds. */
76
+ readonly optionsTruncated: Schema.optionalKey<Schema.Boolean>;
77
+ }>, {}>;
78
+ declare class ObservedControl extends ObservedControl_base {}
79
+ declare const ViewportEvidence_base: Schema.Class<ViewportEvidence, Schema.Struct<{
80
+ readonly width: Schema.Finite;
81
+ readonly height: Schema.Finite;
82
+ /** Text that crossed a viewport edge; only its lines on screen were kept. */
83
+ readonly clippedText: Schema.Natural;
84
+ /** Left out: the browser found another element at the sampled point. */
85
+ readonly coveredText: Schema.Natural;
86
+ readonly uncertainText: Schema.Natural;
87
+ /** Controls that intersect the viewport but cannot be reached there. */
88
+ readonly unreachableControls: Schema.Natural;
89
+ /** The traversal budget ran out first, so this reading is known to be incomplete. */
90
+ readonly exhausted: Schema.Boolean;
91
+ }>, {}>;
92
+ /**
93
+ * How a viewport reading was bounded and what it left out. These are counts, so they are safe
94
+ * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is
95
+ * kept when its line boxes intersect the viewport and the browser finds its own element at a
96
+ * sampled point. `uncertainText` lay under something that takes no pointer events, which
97
+ * hit-testing cannot see through, so it is left out rather than called visible.
98
+ */
99
+ declare class ViewportEvidence extends ViewportEvidence_base {}
100
+ declare const Observation_base: Schema.Class<Observation, Schema.Struct<{
101
+ readonly target: typeof Target;
102
+ readonly observationId: Schema.NonEmptyString;
103
+ readonly revision: Schema.Natural;
104
+ readonly scope: Schema.Literals<readonly ["document", "viewport"]>;
105
+ readonly url: Schema.String;
106
+ readonly text: Schema.String;
107
+ readonly controls: Schema.$Array<typeof ObservedControl>;
108
+ readonly controlsTruncated: Schema.Boolean;
109
+ readonly textTruncated: Schema.Boolean;
110
+ readonly viewport: typeof ViewportEvidence;
111
+ }>, {}>;
112
+ /**
113
+ * Revision is admission fencing, not a claim of a complete DOM version or atomic snapshot. A
114
+ * `viewport` reading holds what is on screen and reachable, plus the bounded choices of its
115
+ * native selects. Those choices are not a claim that a closed dropdown's rows were visible.
116
+ * A `document` reading is the whole body, wherever it is. Nothing here carries a destination,
117
+ * a form or a field value.
118
+ */
119
+ declare class Observation extends Observation_base {}
120
+ declare const ObservedElement_base: Schema.Class<ObservedElement, Schema.Struct<{
121
+ readonly observationId: Schema.NonEmptyString;
122
+ readonly elementId: Schema.NonEmptyString;
123
+ }>, {}>;
124
+ declare class ObservedElement extends ObservedElement_base {}
125
+ declare const WaitForElementRequest_base: Schema.Class<WaitForElementRequest, Schema.Struct<{
126
+ readonly reference: typeof ObservedElement;
127
+ readonly state: Schema.Literals<readonly ["visible", "hidden", "enabled", "disabled"]>;
128
+ readonly timeoutMillis: Schema.optionalKey<Schema.Int>;
129
+ }>, {}>;
130
+ /** Observe a condition of this exact node. A replacement never satisfies the reference. */
131
+ declare class WaitForElementRequest extends WaitForElementRequest_base {}
132
+ /** Issued option element IDs from one observed native select; never values, labels or indices. */
133
+ declare const SelectOptions: Schema.$Array<Schema.NonEmptyString>;
134
+ type SelectOptions = typeof SelectOptions.Type;
135
+ declare const PageSuspension_base: Schema.Class<PageSuspension, Schema.Struct<{
136
+ readonly pageId: Schema.NonEmptyString;
137
+ readonly targetId: Schema.NonEmptyString;
138
+ readonly suspensionId: Schema.NonEmptyString;
139
+ }>, {}>;
140
+ /** Live, connection-owned receipt. It is not a durable promise that remote clocks remain held. */
141
+ declare class PageSuspension extends PageSuspension_base {}
142
+ declare const PageExecutionState_base: Schema.Class<PageExecutionState, Schema.Struct<{
143
+ readonly pageId: Schema.NonEmptyString;
144
+ readonly targetId: Schema.NonEmptyString;
145
+ readonly state: Schema.Literals<readonly ["running", "suspended", "unknown"]>;
146
+ readonly suspensionId: Schema.optionalKey<Schema.NonEmptyString>;
147
+ }>, {}>;
148
+ declare class PageExecutionState extends PageExecutionState_base {}
149
+ declare const BrowserPolicy_base: Schema.Class<BrowserPolicy, Schema.Struct<{
150
+ readonly network: Schema.Struct<{
151
+ readonly _tag: Schema.Literal<"Unrestricted">;
152
+ }>;
153
+ readonly maxActions: Schema.Int;
154
+ readonly maxElapsedMillis: Schema.Int;
155
+ readonly maxReturnedBytes: Schema.Int;
156
+ }>, {}>;
157
+ /** Explicit opt-out: this integration does not claim whole-browser network containment. */
158
+ declare class BrowserPolicy extends BrowserPolicy_base {
159
+ /**
160
+ * Conservative bounds for trusted host code: 100 actions, five minutes, 2 MiB returned.
161
+ * The network choice is spelled out in the name because this runtime cannot prove a
162
+ * narrower one; override any bound, never the network.
163
+ */
164
+ static unrestricted(bounds?: Partial<Pick<BrowserPolicy, "maxActions" | "maxElapsedMillis" | "maxReturnedBytes">>): BrowserPolicy;
165
+ }
166
+ declare const TargetUrl: Schema.NonEmptyString;
167
+ declare const Selector: Schema.NonEmptyString;
168
+ declare const NavigateRequest_base: Schema.Class<NavigateRequest, Schema.Struct<{
169
+ readonly url: Schema.NonEmptyString;
170
+ readonly timeoutMillis: Schema.optionalKey<Schema.Int>;
171
+ }>, {}>;
172
+ declare class NavigateRequest extends NavigateRequest_base {}
173
+ declare const StartNavigationRequest_base: Schema.Class<StartNavigationRequest, Schema.Struct<{
174
+ readonly url: Schema.NonEmptyString;
175
+ readonly timeoutMillis: Schema.optionalKey<Schema.Int>;
176
+ }>, {}>;
177
+ /**
178
+ * A navigation left in flight. `timeoutMillis` is how long the browser may take to reach
179
+ * DOMContentLoaded; omitted, it is the action timeout, as it is for `navigate`.
180
+ */
181
+ declare class StartNavigationRequest extends StartNavigationRequest_base {}
182
+ declare const ReadTextRequest_base: Schema.Class<ReadTextRequest, Schema.Struct<{
183
+ readonly selector: Schema.optionalKey<Schema.NonEmptyString>;
184
+ }>, {}>;
185
+ declare class ReadTextRequest extends ReadTextRequest_base {}
186
+ declare const ClickRequest_base: Schema.Class<ClickRequest, Schema.Struct<{
187
+ readonly selector: Schema.NonEmptyString;
188
+ }>, {}>;
189
+ declare class ClickRequest extends ClickRequest_base {}
190
+ declare const FillRequest_base: Schema.Class<FillRequest, Schema.Struct<{
191
+ readonly selector: Schema.NonEmptyString;
192
+ readonly value: Schema.String;
193
+ }>, {}>;
194
+ declare class FillRequest extends FillRequest_base {}
195
+ declare const ScrollRequest_base: Schema.Class<ScrollRequest, Schema.Struct<{
196
+ readonly deltaX: Schema.Int;
197
+ readonly deltaY: Schema.Int;
198
+ }>, {}>;
199
+ declare class ScrollRequest extends ScrollRequest_base {}
200
+ declare const ViewportPoint_base: Schema.Class<ViewportPoint, Schema.Struct<{
201
+ readonly x: Schema.Finite;
202
+ readonly y: Schema.Finite;
203
+ }>, {}>;
204
+ /**
205
+ * CSS pixels in the main frame's viewport, the space Chromium dispatches pointer input in. It
206
+ * is not a document offset, a device pixel, or a coordinate inside a child frame.
207
+ */
208
+ declare class ViewportPoint extends ViewportPoint_base {}
209
+ declare const ViewportRect_base: Schema.Class<ViewportRect, Schema.Struct<{
210
+ readonly x: Schema.Finite;
211
+ readonly y: Schema.Finite;
212
+ readonly width: Schema.Finite;
213
+ readonly height: Schema.Finite;
214
+ }>, {}>;
215
+ /** A box in the viewport of the frame it was read from, in CSS pixels. */
216
+ declare class ViewportRect extends ViewportRect_base {}
217
+ declare const ControlFacts_base: Schema.Class<ControlFacts, Schema.Struct<{
218
+ readonly kind: Schema.Literals<readonly ["link", "button", "input", "select", "textarea", "other"]>;
219
+ readonly label: Schema.String;
220
+ readonly disabled: Schema.Boolean;
221
+ readonly checked: Schema.optionalKey<Schema.Boolean>;
222
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
223
+ readonly required: Schema.optionalKey<Schema.Boolean>;
224
+ readonly multiple: Schema.optionalKey<Schema.Boolean>;
225
+ readonly editable: Schema.Boolean;
226
+ readonly inputType: Schema.optionalKey<Schema.String>;
227
+ readonly autocomplete: Schema.optionalKey<Schema.String>;
228
+ /** A resolved link target, or where this control submits its form. Absent when over-long. */
229
+ readonly destination: Schema.optionalKey<Schema.String>;
230
+ readonly formMethod: Schema.optionalKey<Schema.Literals<readonly ["get", "post", "dialog"]>>;
231
+ readonly box: typeof ViewportRect;
232
+ readonly placement: Schema.Literals<readonly ["inside", "partial", "outside"]>;
233
+ /** `self`: the browser finds this control at its visible centre. Not a pixel comparison. */
234
+ readonly hitTest: Schema.Literals<readonly ["self", "covered", "uncertain", "unsampled"]>;
235
+ /** Only then is `box` in the main frame's viewport, the space pointer input uses. */
236
+ readonly mainFrame: Schema.Boolean;
237
+ }>, {}>;
238
+ /**
239
+ * What a host needs to decide whether a control may be acted on. Host-only: a destination can
240
+ * carry a token, so none of this is part of the model-facing `Observation`. It never includes a
241
+ * field's value or any markup.
242
+ */
243
+ declare class ControlFacts extends ControlFacts_base {}
244
+ declare const Checkpoint_base: Schema.Class<Checkpoint, Schema.Struct<{
245
+ readonly target: typeof Target;
246
+ readonly revision: Schema.Natural;
247
+ readonly url: Schema.String;
248
+ readonly text: Schema.String;
249
+ readonly textTruncated: Schema.Boolean;
250
+ readonly controls: Schema.$Array<typeof ControlFacts>;
251
+ readonly controlsTruncated: Schema.Boolean;
252
+ readonly viewport: typeof ViewportEvidence;
253
+ readonly picture: Schema.optionalKey<Schema.Struct<{
254
+ readonly mediaType: Schema.Literal<"image/png">;
255
+ readonly bytes: Schema.Uint8Array;
256
+ }>>;
257
+ readonly documentChanged: Schema.Boolean;
258
+ readonly startedMonotonicNanos: Schema.BigInt;
259
+ readonly completedMonotonicNanos: Schema.BigInt;
260
+ }>, {}>;
261
+ /**
262
+ * Passive evidence for a recorder: what was on screen, and optionally a picture of it. It issues
263
+ * no element references and never replaces the observation an agent's tools act on, so
264
+ * inspecting, checkpointing and then acting on the inspected node all compose.
265
+ *
266
+ * It is host-only, because it carries control facts. Text and picture are read one after the
267
+ * other, never atomically: the interval says when, and `documentChanged` says the document was
268
+ * replaced in between, so the two may describe different documents.
269
+ */
270
+ declare class Checkpoint extends Checkpoint_base {}
271
+ /** Omitted bounds default at admission; `scope` defaults to the whole document. */
272
+ declare const ObservationOptions: Schema.Struct<{
273
+ readonly maxTextBytes: Schema.optionalKey<Schema.Int>;
274
+ readonly maxControls: Schema.optionalKey<Schema.Int>;
275
+ readonly scope: Schema.optionalKey<Schema.Literals<readonly ["document", "viewport"]>>;
276
+ }>;
277
+ type ObservationOptions = typeof ObservationOptions.Type;
278
+ /** A checkpoint always reads the viewport. `picture` adds a PNG of it, within the byte policy. */
279
+ declare const CheckpointOptions: Schema.Struct<{
280
+ readonly maxTextBytes: Schema.optionalKey<Schema.Int>;
281
+ readonly maxControls: Schema.optionalKey<Schema.Int>;
282
+ readonly picture: Schema.optionalKey<Schema.Boolean>;
283
+ }>;
284
+ type CheckpointOptions = typeof CheckpointOptions.Type;
285
+ declare const PointerMoveRequest_base: Schema.Class<PointerMoveRequest, Schema.Struct<{
286
+ readonly to: typeof ViewportPoint;
287
+ }>, {}>;
288
+ /** One native pointer move. Easing and pacing are the caller's: send the points you want. */
289
+ declare class PointerMoveRequest extends PointerMoveRequest_base {}
290
+ declare const HoverRequest_base: Schema.Class<HoverRequest, Schema.Struct<{
291
+ readonly selector: Schema.NonEmptyString;
292
+ }>, {}>;
293
+ /** Moves the pointer onto one exact element where it is. It never scrolls to reach it. */
294
+ declare class HoverRequest extends HoverRequest_base {}
295
+ declare const WheelRequest_base: Schema.Class<WheelRequest, Schema.Struct<{
296
+ readonly deltaX: Schema.Finite;
297
+ readonly deltaY: Schema.Finite;
298
+ readonly at: Schema.optionalKey<typeof ViewportPoint>;
299
+ }>, {}>;
300
+ /**
301
+ * One native wheel event where the pointer is, or at `at` after moving there first. The browser
302
+ * chooses what scrolls, exactly as it would for a person, so a nested scroll container under
303
+ * the pointer scrolls instead of the page.
304
+ */
305
+ declare class WheelRequest extends WheelRequest_base {}
306
+ /**
307
+ * The keys a `press` may name, spelled as the `KeyboardEvent.key` the page will see. The set is
308
+ * closed on purpose: a key name is parsed by the native engine, so none reaches it unreviewed.
309
+ */
310
+ declare const NamedKey: Schema.Literals<readonly ["Enter", "Tab", "Backspace", "Delete", "Escape", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"]>;
311
+ type NamedKey = typeof NamedKey.Type;
312
+ declare const KeyModifier: Schema.Literals<readonly ["Shift", "Control", "Alt", "Meta"]>;
313
+ type KeyModifier = typeof KeyModifier.Type;
314
+ /** One key, down then up, with any modifiers held around it. */
315
+ declare const KeyStroke: Schema.Struct<{
316
+ readonly key: Schema.Union<readonly [Schema.Literals<readonly ["Enter", "Tab", "Backspace", "Delete", "Escape", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"]>, Schema.String]>;
317
+ readonly modifiers: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["Shift", "Control", "Alt", "Meta"]>>>;
318
+ }>;
319
+ type KeyStroke = typeof KeyStroke.Type;
320
+ declare const PressRequest_base: Schema.Class<PressRequest, Schema.Struct<{
321
+ readonly key: Schema.Union<readonly [Schema.Literals<readonly ["Enter", "Tab", "Backspace", "Delete", "Escape", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"]>, Schema.String]>;
322
+ readonly modifiers: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["Shift", "Control", "Alt", "Meta"]>>>;
323
+ readonly into: Schema.optionalKey<Schema.NonEmptyString>;
324
+ }>, {}>;
325
+ /**
326
+ * One real key stroke. It goes to whatever has focus in the page, exactly as it would for a
327
+ * person, unless `into` names the one element that must already have it. It never focuses that
328
+ * element, because that would hide a scripted focus inside a native-input operation: click it
329
+ * first.
330
+ */
331
+ declare class PressRequest extends PressRequest_base {}
332
+ declare const TypeRequest_base: Schema.Class<TypeRequest, Schema.Struct<{
333
+ readonly text: Schema.NonEmptyString;
334
+ readonly into: Schema.optionalKey<Schema.NonEmptyString>;
335
+ }>, {}>;
336
+ /**
337
+ * Text as the real key strokes that produce it, two native commands for each character, one
338
+ * after another under a single action timeout: send a long passage as several shorter runs.
339
+ * A character the US layout cannot produce is inserted as text, as an input method commits it,
340
+ * and raises no key events. Control characters are refused, so a line break can never press
341
+ * Enter from inside a run of text: a named key is always its own `press`. `into` works as it
342
+ * does for `PressRequest`: a guard on where the text lands, never a focus.
343
+ */
344
+ declare class TypeRequest extends TypeRequest_base {}
345
+ declare const InputReceipt_base: Schema.Class<InputReceipt, Schema.Struct<{
346
+ readonly target: typeof Target;
347
+ readonly kind: Schema.Literals<readonly ["pointer-move", "hover", "wheel", "press", "type"]>;
348
+ readonly position: Schema.NullOr<typeof ViewportPoint>;
349
+ readonly delta: Schema.optionalKey<Schema.Struct<{
350
+ readonly x: Schema.Finite;
351
+ readonly y: Schema.Finite;
352
+ }>>;
353
+ readonly startedMonotonicNanos: Schema.BigInt;
354
+ readonly completedMonotonicNanos: Schema.BigInt;
355
+ }>, {}>;
356
+ /**
357
+ * What native input was dispatched, where and when. `position` is the point this owner
358
+ * commanded, or null when it has not yet placed the pointer on this page. The interval is on
359
+ * the host monotonic clock that stamps `CapturedFrame.receivedMonotonicNanos`, so input and
360
+ * pixels share one timeline. A wheel event is dispatched, not awaited: the receipt does not
361
+ * claim the page finished scrolling, or that any frame shows it. A receipt never says which
362
+ * key was pressed or what was typed.
363
+ */
364
+ declare class InputReceipt extends InputReceipt_base {}
365
+ declare const ScreenshotRequest_base: Schema.Class<ScreenshotRequest, Schema.Struct<{
366
+ readonly fullPage: Schema.Boolean;
367
+ }>, {}>;
368
+ declare class ScreenshotRequest extends ScreenshotRequest_base {}
369
+ declare const NavigationResult_base: Schema.Class<NavigationResult, Schema.Struct<{
370
+ readonly url: Schema.NonEmptyString;
371
+ }>, {}>;
372
+ declare class NavigationResult extends NavigationResult_base {}
373
+ declare const ActionResult_base: Schema.Class<ActionResult, Schema.Struct<{
374
+ readonly url: Schema.NonEmptyString;
375
+ }>, {}>;
376
+ declare class ActionResult extends ActionResult_base {}
377
+ declare const TextResult_base: Schema.Class<TextResult, Schema.Struct<{
378
+ readonly text: Schema.String;
379
+ }>, {}>;
380
+ declare class TextResult extends TextResult_base {}
381
+ declare const ScreenshotResult_base: Schema.Class<ScreenshotResult, Schema.Struct<{
382
+ readonly mediaType: Schema.Literal<"image/png">;
383
+ readonly bytes: Schema.Uint8Array;
384
+ }>, {}>;
385
+ declare class ScreenshotResult extends ScreenshotResult_base {}
386
+ declare const InlineFile_base: Schema.Class<InlineFile, Schema.Struct<{
387
+ readonly name: Schema.NonEmptyString;
388
+ readonly mediaType: Schema.NonEmptyString;
389
+ readonly bytes: Schema.Uint8Array;
390
+ }>, {}>;
391
+ /** Small selection is in-memory by design: bytes the caller already holds, never a path. */
392
+ declare class InlineFile extends InlineFile_base {}
393
+ declare const InlineFiles: Schema.$Array<typeof InlineFile>;
394
+ declare const AutomationOptions: Schema.Struct<{
395
+ readonly actionTimeoutMillis: Schema.optionalKey<Schema.Int>;
396
+ /** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */
397
+ readonly maxHostReads: Schema.optionalKey<Schema.Int>;
398
+ readonly maxPages: Schema.optionalKey<Schema.Int>;
399
+ readonly initialPage: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
400
+ readonly targetId: Schema.NonEmptyString;
401
+ }>, Schema.Struct<{
402
+ readonly newPage: Schema.Literal<true>;
403
+ }>]>>;
404
+ readonly popupPolicy: Schema.optionalKey<Schema.Literals<readonly ["retain", "close", "pause"]>>;
405
+ readonly dialogPolicy: Schema.optionalKey<Schema.Literals<readonly ["dismiss", "pause"]>>;
406
+ readonly pageControl: Schema.optionalKey<Schema.Boolean>;
407
+ }>;
408
+ type AutomationOptions = typeof AutomationOptions.Type;
409
+ //#endregion
410
+ export { PositiveInt as A, SessionReason as B, ObservationOptions as C, PageInfo as D, PageExecutionState as E, ScreenshotResult as F, TextResult as G, StartNavigationRequest as H, ScrollRequest as I, ViewportEvidence as J, TypeRequest as K, SelectOptions as L, ReadTextRequest as M, SafeFilename as N, PageSuspension as O, ScreenshotRequest as P, WheelRequest as Q, Selector as R, Observation as S, ObservedElement as T, Target as U, SessionStatus as V, TargetUrl as W, ViewportRect as X, ViewportPoint as Y, WaitForElementRequest as Z, KeyModifier as _, BrowserPolicy as a, NavigateRequest as b, ClickRequest as c, FrameInfo as d, HoverRequest as f, InputReceipt as g, InlineFiles as h, BrowserDiagnostics as i, PressRequest as j, PointerMoveRequest as k, ControlFacts as l, InlineFile as m, AutomationOptions as n, Checkpoint as o, Identifier as p, Viewport as q, BrowserDiagnostic as r, CheckpointOptions as s, ActionResult as t, FillRequest as u, KeyStroke as v, ObservedControl as w, NavigationResult as x, NamedKey as y, SessionPhase as z };
411
+ export {};
412
+ //# sourceMappingURL=BrowserData-DJAnUHoZ.d.mts.map