effect-browser 0.2.0-beta.7 → 0.2.0-beta.8

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 (68) hide show
  1. package/README.md +486 -152
  2. package/dist/Browser-n-bKgBNN.d.mts +372 -0
  3. package/dist/Browser.d.mts +3 -200
  4. package/dist/Browser.mjs +9 -1
  5. package/dist/Browser.mjs.map +1 -1
  6. package/dist/{BrowserData-KHk4o__c.d.mts → BrowserData-CPIIIHol.d.mts} +81 -7
  7. package/dist/BrowserData.d.mts +2 -2
  8. package/dist/BrowserData.mjs +104 -6
  9. package/dist/BrowserData.mjs.map +1 -1
  10. package/dist/{BrowserRuntime-hxkTNlRa.d.mts → BrowserRuntime-CFe9uUTv.d.mts} +16 -11
  11. package/dist/{BrowserRuntime-Cr76CN4I.mjs → BrowserRuntime-HJ1yYlFS.mjs} +4990 -4309
  12. package/dist/BrowserRuntime-HJ1yYlFS.mjs.map +1 -0
  13. package/dist/BrowserRuntime.d.mts +2 -2
  14. package/dist/BrowserRuntime.mjs +2 -1
  15. package/dist/Capture.d.mts +9 -7
  16. package/dist/Capture.mjs +157 -32
  17. package/dist/Capture.mjs.map +1 -1
  18. package/dist/{CaptureData-Dys0Ko9d.mjs → CaptureData-CYriZHX1.mjs} +25 -6
  19. package/dist/CaptureData-CYriZHX1.mjs.map +1 -0
  20. package/dist/CaptureData.d.mts +62 -3
  21. package/dist/CaptureData.mjs +2 -2
  22. package/dist/Chromium.d.mts +2 -2
  23. package/dist/Chromium.mjs +19 -10
  24. package/dist/Chromium.mjs.map +1 -1
  25. package/dist/Errors.d.mts +66 -17
  26. package/dist/Errors.mjs +47 -5
  27. package/dist/Errors.mjs.map +1 -1
  28. package/dist/Images-CaaPNeed.mjs +76 -0
  29. package/dist/Images-CaaPNeed.mjs.map +1 -0
  30. package/dist/OperationOptions-DAeRS6O9.mjs +55 -0
  31. package/dist/OperationOptions-DAeRS6O9.mjs.map +1 -0
  32. package/dist/PageControl.d.mts +6 -6
  33. package/dist/PageControl.mjs +16 -10
  34. package/dist/PageControl.mjs.map +1 -1
  35. package/dist/PageRegistry-B3q9DS3g.mjs +164 -0
  36. package/dist/PageRegistry-B3q9DS3g.mjs.map +1 -0
  37. package/dist/Plan-D8qQ48Ic.mjs +512 -0
  38. package/dist/Plan-D8qQ48Ic.mjs.map +1 -0
  39. package/dist/Plan.d.mts +3 -0
  40. package/dist/Plan.mjs +2 -0
  41. package/dist/PlanData-B668RxbQ.d.mts +4831 -0
  42. package/dist/PlanData.d.mts +3 -0
  43. package/dist/PlanData.mjs +268 -0
  44. package/dist/PlanData.mjs.map +1 -0
  45. package/dist/PlanInput-BJcPPncs.mjs +75 -0
  46. package/dist/PlanInput-BJcPPncs.mjs.map +1 -0
  47. package/dist/PublicSession-Bs61Eal8.mjs +5601 -0
  48. package/dist/PublicSession-Bs61Eal8.mjs.map +1 -0
  49. package/dist/Testing.d.mts +48 -6
  50. package/dist/Testing.mjs +651 -113
  51. package/dist/Testing.mjs.map +1 -1
  52. package/dist/Timeline-fV22Xk-S.d.mts +29 -0
  53. package/dist/Timeline.d.mts +4 -0
  54. package/dist/Timeline.mjs +20 -0
  55. package/dist/Timeline.mjs.map +1 -0
  56. package/dist/TimelineData-BsOn-YGZ.d.mts +3818 -0
  57. package/dist/TimelineData.d.mts +3 -0
  58. package/dist/TimelineData.mjs +482 -0
  59. package/dist/TimelineData.mjs.map +1 -0
  60. package/dist/index.d.mts +5 -1
  61. package/dist/index.mjs +5 -1
  62. package/package.json +17 -1
  63. package/dist/Association-CH3kPHXE.mjs +0 -167
  64. package/dist/Association-CH3kPHXE.mjs.map +0 -1
  65. package/dist/BrowserRuntime-Cr76CN4I.mjs.map +0 -1
  66. package/dist/CaptureData-Dys0Ko9d.mjs.map +0 -1
  67. package/dist/PageControlAssociation-DabEg5AR.mjs +0 -10
  68. package/dist/PageControlAssociation-DabEg5AR.mjs.map +0 -1
@@ -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 /**\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"}
1
+ {"version":3,"file":"Browser.mjs","names":[],"sources":["../src/Browser.ts"],"sourcesContent":["import { type Duration, Effect, type Scope, type Stream } 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, BrowserOperation, Containment, InitializationError } from \"./Errors.ts\";\nimport { resolveTargetControlsForSession } from \"./internal/browser/PageRegistry.ts\";\nimport type { PlanOperations } from \"./Plan.ts\";\nimport type { DescriptorEncoded, ResolveGuard, SettledEvidence } from \"./PlanData.ts\";\nimport type { Timeline } from \"./Timeline.ts\";\nimport type { PageEvent, TimelineError } from \"./TimelineData.ts\";\n\n/**\n * Host-only ordinary admission. Omission or zero fails immediately; positive finite duration\n * queues FIFO. Page closure uses reserved fail-fast admission and a deadline-bounded shared close.\n */\nexport interface AdmissionOptions {\n readonly queue?: Duration.Input;\n}\n\n/** Explicit host options, separate from request data and exact-element admission callbacks. */\nexport interface OperationOptions {\n readonly timeoutMillis?: number;\n readonly admission?: AdmissionOptions;\n}\n\n/** Explicit descriptor guard and ordinary host admission; no selector or geometry fallback. */\nexport interface ResolveOptions extends OperationOptions {\n readonly guard?: typeof ResolveGuard.Encoded;\n}\n\n/** Named native quiet signals within the original positive finite deadline. */\nexport interface SettledRequest {\n readonly quiet: Duration.Input;\n readonly within: Duration.Input;\n}\n\n/** A bounded host-memory snapshot; it grants no priority or native authority. */\nexport interface AdmissionStatus {\n readonly active: BrowserOperation | null;\n readonly waiting: number;\n readonly maximum: number;\n readonly oldestWaitMillis: number | null;\n readonly nativePending: number;\n readonly nativeWaitPending: boolean;\n readonly stopSetupPending: boolean;\n}\n\nexport interface SessionAdmissionStatus {\n readonly waiting: number;\n readonly maximum: number;\n readonly nativePending: number;\n readonly nativeMaximum: number;\n readonly nativeWaits: number;\n readonly stopSetups: number;\n readonly registry: AdmissionStatus;\n}\n\n/** Terminal facts remain readable after this page loses live authority. */\nexport interface PageStatus {\n readonly identity: Target;\n readonly phase: \"open\" | \"paused\" | \"closing\" | \"closed\" | \"stale\";\n readonly containment: Containment;\n readonly admission: AdmissionStatus;\n}\n\nexport interface PageOperations {\n readonly navigate: (\n request: NavigateRequest,\n options?: OperationOptions,\n ) => Effect.Effect<NavigationResult, BrowserError>;\n /** `navigate`, left in flight: the same single dispatch, completed by the caller. */\n readonly startNavigation: (\n request: StartNavigationRequest,\n options?: OperationOptions,\n ) => Effect.Effect<NavigationOperation, BrowserError, Scope.Scope>;\n readonly readText: (\n request: ReadTextRequest,\n options?: OperationOptions,\n ) => Effect.Effect<TextResult, BrowserError>;\n readonly click: (\n request: ClickRequest,\n options?: OperationOptions,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly fill: (\n request: FillRequest,\n options?: OperationOptions,\n ) => Effect.Effect<ActionResult, BrowserError>;\n /** Script in the page: instantaneous, and it raises no wheel event. */\n readonly scroll: (\n request: ScrollRequest,\n options?: OperationOptions,\n ) => Effect.Effect<ActionResult, BrowserError>;\n /** One real pointer move, in main-frame viewport pixels. */\n readonly pointerMove: (\n request: PointerMoveRequest,\n options?: OperationOptions,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** Places the pointer on one exact element where it is, or fails `not-visible` unsent. */\n readonly hover: (\n request: HoverRequest,\n options?: OperationOptions,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** One real wheel event; the browser decides what under the pointer scrolls. */\n readonly wheel: (\n request: WheelRequest,\n options?: OperationOptions,\n ) => 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: (\n request: PressRequest,\n options?: OperationOptions,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n /** Text as the real key strokes that produce it, under the same focus rule as `press`. */\n readonly type: (\n request: TypeRequest,\n options?: OperationOptions,\n ) => Effect.Effect<InputReceipt, BrowserError>;\n readonly screenshot: (\n request: ScreenshotRequest,\n options?: OperationOptions,\n ) => Effect.Effect<ScreenshotResult, 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: (\n options?: ObservationOptions,\n operationOptions?: OperationOptions,\n ) => 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: (\n options?: CheckpointOptions,\n operationOptions?: OperationOptions,\n ) => Effect.Effect<Checkpoint, BrowserError>;\n /** Host-only facts about one observed control, read from that exact node just now. */\n readonly controlFacts: (\n reference: ObservedElement,\n options?: OperationOptions,\n ) => 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 options?: OperationOptions,\n ) => Effect.Effect<ObservedElement, BrowserError>;\n readonly clickElement: (\n reference: ObservedElement,\n admission?: ElementAdmission,\n options?: OperationOptions,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly fillElement: (\n reference: ObservedElement,\n value: string,\n admission?: ElementAdmission,\n options?: OperationOptions,\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 operationOptions?: OperationOptions,\n ) => Effect.Effect<ActionResult, BrowserError>;\n readonly hoverElement: (\n reference: ObservedElement,\n admission?: ElementAdmission,\n options?: OperationOptions,\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 options?: OperationOptions,\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 options?: OperationOptions,\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 operationOptions?: OperationOptions,\n ) => Effect.Effect<FillFormResult, 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: (\n request: WaitForElementRequest,\n options?: OperationOptions,\n ) => Effect.Effect<void, BrowserError>;\n readonly waitFor: (\n request: {\n readonly selector: string;\n readonly state: \"visible\" | \"hidden\" | \"attached\" | \"detached\";\n },\n options?: OperationOptions,\n ) => Effect.Effect<void, BrowserError>;\n /** Navigation observation is registered before the single click dispatch. */\n readonly clickAndWait: (\n request: ClickRequest,\n options?: OperationOptions,\n ) => 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: (\n options?: OperationOptions,\n ) => Effect.Effect<Bootstrap.ReadinessOutcome, InitializationError>;\n}\n\n/**\n * Issued live authority for one native frame; navigation keeps the frame and retires its references.\n *\n * Pass the issued object itself. Capture, page control, provider transfers, agent tools and\n * `checkPage` authenticate it by identity, so a spread copy, wrapper or Proxy is refused\n * `UnregisteredSession` even though its copied methods still run. Observe work through the\n * timeline and run receipts rather than by wrapping methods.\n */\nexport interface Frame extends PageOperations, PlanOperations {\n readonly identity: Target;\n readonly status: Effect.Effect<PageStatus>;\n /**\n * The original owner's host monotonic clock, the same one `session.monotonicTimeNanos` reads,\n * so a host bound to this Page or Frame can compute a plan's `startAt` without the session.\n */\n readonly monotonicTimeNanos: Effect.Effect<bigint>;\n /** Resolve full descriptor intent against the complete current native candidate inventory. */\n readonly resolve: (\n descriptor: DescriptorEncoded,\n options?: ResolveOptions,\n ) => Effect.Effect<ObservedElement, BrowserError>;\n /**\n * Quiet DOM mutation, scroll, root geometry and viewport signals in one pinned document.\n * This does not establish network, animation or business completion.\n */\n readonly settled: (\n request: SettledRequest,\n options?: OperationOptions,\n ) => Effect.Effect<SettledEvidence, BrowserError>;\n}\n\n/** Issued live authority for one native page on its original connection; pass it as issued, see `Frame`. */\nexport interface Page extends Frame {\n /** Evidence for this issued Page's original domain; navigation does not change its journal. */\n readonly timeline: Timeline;\n /**\n * Read this page's address and title. Like `listFrames`, it is a read of the page and shares\n * its permit; pass `admission.queue` to wait behind work already running there.\n */\n readonly describe: (options?: OperationOptions) => Effect.Effect<PageInfo, BrowserError>;\n readonly listFrames: (\n options?: OperationOptions,\n ) => Effect.Effect<ReadonlyArray<FrameInfo>, BrowserError>;\n /** Issue a child Frame. Like `session.page`, issuing takes the registry permit, not this page's. */\n readonly frame: (\n info: FrameInfo,\n options?: OperationOptions,\n ) => Effect.Effect<Frame, BrowserError>;\n readonly resizeViewport: (\n viewport: Viewport,\n options?: OperationOptions,\n ) => Effect.Effect<void, BrowserError>;\n /** Reserved fail-fast admission; timeoutMillis bounds joining a close, not admission.queue. */\n readonly close: (options?: OperationOptions) => Effect.Effect<void, BrowserError>;\n}\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 other ordinary operations on that Page. 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 revokes and attempts to close its exact page. Positive closure\n * preserves healthy peers; unconfirmed closure fences the session. Its outcome remains unknown\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/**\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 * Browser operations belong to issued Page and Frame objects. Display selection and owner\n * lifecycle are separate from those exact capabilities.\n */\nexport interface BrowserSession<E = never> {\n /** The original owner's host clock, for same-runtime absolute cue scheduling. */\n readonly monotonicTimeNanos: Effect.Effect<bigint>;\n /** Stable facade: each snapshot/stream captures the current journal when it executes. */\n readonly timeline: Timeline;\n /** Atomic cached Inventory baseline followed by lifecycle evidence on its pinned journal. */\n readonly pages: Stream.Stream<PageEvent, TimelineError>;\n /** The page acquired on the initial connection, independent of later display selection. */\n readonly initialPage: Page;\n /**\n * Authenticate `info` against the live native page and return its canonical issued Page. This\n * takes the registry permit, not the page's own: it never waits for, or fails `busy` on, work\n * already running on that page.\n */\n readonly page: (info: PageInfo, options?: OperationOptions) => Effect.Effect<Page, BrowserError>;\n readonly listPages: (\n options?: OperationOptions,\n ) => Effect.Effect<ReadonlyArray<PageInfo>, BrowserError>;\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 readonly admission: Effect.Effect<SessionAdmissionStatus>;\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 /**\n * Choose the displayed page, which is also the page `detach` records and `reconnect` resumes on.\n * Nothing else: it never retargets a Page or Frame operation, which keep their own exact\n * authority. Pass a Page this session issued; a closed or stale one is refused unsent.\n */\n readonly selectPage: (\n page: Page,\n options?: OperationOptions,\n ) => Effect.Effect<void, BrowserError>;\n /**\n * Open a page in its own window, sized like the others, without selecting it, and return the\n * Page issued for it. Chromium paints every window, so any page can be pictured and read at\n * speed, not only the one in front. Registry admission fails immediately by default; pass a\n * positive finite admission.queue to wait FIFO within the operation deadline.\n */\n readonly createPage: (options?: OperationOptions) => Effect.Effect<Page, BrowserError>;\n}\n\n/** Helpers that do not supervise callback failures accept any live browser session. */\nexport type AnySession = BrowserSession<unknown>;\n\n/**\n * Check that `page` is a Page or Frame this session issued, by identity, and that its authority\n * is still current: a foreign or copied object fails `UnregisteredSession`, a closed, stale or\n * detached one fails with the same refusal its own operations would report. Adapters such as\n * agent-browser hosts call it once when they bind, so a wrong target fails before any work.\n */\nexport const checkPage = (\n session: AnySession,\n page: Page | Frame,\n): Effect.Effect<void, BrowserError> =>\n resolveTargetControlsForSession(session, page).pipe(Effect.asVoid);\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":";;;;;;;;;;AAkbA,MAAa,aACX,SACA,SAEA,gCAAgC,SAAS,IAAI,CAAC,CAAC,KAAK,OAAO,MAAM;;;;;;;AAanE,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"}
@@ -36,6 +36,16 @@ declare const SessionPhase: Schema.Literals<readonly ["acquiring", "open", "paus
36
36
  type SessionPhase = typeof SessionPhase.Type;
37
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
+ declare const Inventory_base: Schema.Class<Inventory, Schema.Struct<{
40
+ readonly generation: Schema.Natural;
41
+ readonly pages: Schema.$Array<typeof PageInfo>;
42
+ }>, {}>;
43
+ /**
44
+ * Bounded fresh metadata from one owner generation. Native URL/title reads are non-atomic.
45
+ * PageInfo is data; callers must acquire an issued Page and observe it explicitly before input.
46
+ * The separate pages lifecycle stream attaches its cached registry snapshot and cursor atomically.
47
+ */
48
+ declare class Inventory extends Inventory_base {}
39
49
  declare const SessionStatus_base: Schema.Class<SessionStatus, Schema.Struct<{
40
50
  readonly phase: Schema.Literals<readonly ["acquiring", "open", "paused", "detached", "faulted", "uncertain", "closing", "closed"]>;
41
51
  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"]>>;
@@ -86,9 +96,33 @@ declare const ObservedControl_base: Schema.Class<ObservedControl, Schema.Struct<
86
96
  readonly optionsTruncated: Schema.optionalKey<Schema.Boolean>;
87
97
  }>, {}>;
88
98
  declare class ObservedControl extends ObservedControl_base {}
99
+ /**
100
+ * The read frame's root document scroll geometry, sampled in CSS pixels with the reading.
101
+ * Offsets can be negative (for example RTL); dimensions are the scrolling element's measured
102
+ * scrollWidth/Height and clientWidth/Height. They do not describe a nested scrolling container
103
+ * or expose unseen text, and do not establish a scroll direction or an end-of-document condition.
104
+ */
105
+ declare const DocumentScroll: Schema.Struct<{
106
+ readonly x: Schema.Finite;
107
+ readonly y: Schema.Finite;
108
+ readonly scrollWidth: Schema.Natural;
109
+ readonly scrollHeight: Schema.Natural;
110
+ readonly clientWidth: Schema.Natural;
111
+ readonly clientHeight: Schema.Natural;
112
+ }>;
113
+ type DocumentScroll = typeof DocumentScroll.Type;
89
114
  declare const ViewportEvidence_base: Schema.Class<ViewportEvidence, Schema.Struct<{
90
115
  readonly width: Schema.Finite;
91
116
  readonly height: Schema.Finite;
117
+ /** Absent when the document has no scrolling element, or in older/scripted readings. */
118
+ readonly documentScroll: Schema.optionalKey<Schema.Struct<{
119
+ readonly x: Schema.Finite;
120
+ readonly y: Schema.Finite;
121
+ readonly scrollWidth: Schema.Natural;
122
+ readonly scrollHeight: Schema.Natural;
123
+ readonly clientWidth: Schema.Natural;
124
+ readonly clientHeight: Schema.Natural;
125
+ }>>;
92
126
  /** Text that crossed a viewport edge; only its lines on screen were kept. */
93
127
  readonly clippedText: Schema.Natural;
94
128
  /** Left out: another element is on top at the sampled point, or a box there paints over it. */
@@ -105,8 +139,9 @@ declare const ViewportEvidence_base: Schema.Class<ViewportEvidence, Schema.Struc
105
139
  readonly exhausted: Schema.Boolean;
106
140
  }>, {}>;
107
141
  /**
108
- * How a viewport reading was bounded and what it left out. These are counts, so they are safe
109
- * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is
142
+ * How a viewport reading was bounded, what it left out, and its document scroll geometry. These
143
+ * counts and measured layout facts can be shown to a model. Visibility is geometry and
144
+ * hit-testing, never a pixel comparison: text is
110
145
  * kept when its line boxes intersect the viewport and the browser finds its own element at a
111
146
  * sampled point. Something that takes no pointer events is invisible to that test, so the
112
147
  * browser is asked what is on top there with pointer events ignored: a box that paints at the
@@ -412,18 +447,24 @@ declare const TypeRequest_base: Schema.Class<TypeRequest, Schema.Struct<{
412
447
  readonly into: Schema.optionalKey<Schema.NonEmptyString>;
413
448
  }>, {}>;
414
449
  /**
415
- * Text as the real key strokes that produce it, two native commands for each character, one
416
- * after another under a single action timeout: send a long passage as several shorter runs.
450
+ * Text as the real key strokes that produce it, with ordered native commands submitted in
451
+ * bounded windows under a single action timeout. An interrupted run is never replayed.
417
452
  * A character the US layout cannot produce is inserted as text, as an input method commits it,
418
453
  * and raises no key events. Control characters are refused, so a line break can never press
419
454
  * Enter from inside a run of text: a named key is always its own `press`. `into` works as it
420
- * does for `PressRequest`: a guard on where the text lands, never a focus.
455
+ * does for `PressRequest`: a guard on where the text lands, never a focus. The exact node is
456
+ * checked before subsequent windows; already submitted input cannot be recalled on focus loss.
421
457
  */
422
458
  declare class TypeRequest extends TypeRequest_base {}
423
459
  declare const InputReceipt_base: Schema.Class<InputReceipt, Schema.Struct<{
424
460
  readonly target: typeof Target;
425
461
  readonly kind: Schema.Literals<readonly ["pointer-move", "hover", "wheel", "click", "press", "type"]>;
426
462
  readonly position: Schema.NullOr<typeof ViewportPoint>;
463
+ readonly intended: Schema.optionalKey<Schema.Struct<{
464
+ readonly position: typeof ViewportPoint;
465
+ readonly relativePosition: typeof ViewportPoint;
466
+ readonly qualification: Schema.Literal<"checked-exact-node-sample">;
467
+ }>>;
427
468
  readonly delta: Schema.optionalKey<Schema.Struct<{
428
469
  readonly x: Schema.Finite;
429
470
  readonly y: Schema.Finite;
@@ -490,7 +531,40 @@ declare const InlineFile_base: Schema.Class<InlineFile, Schema.Struct<{
490
531
  /** Small selection is in-memory by design: bytes the caller already holds, never a path. */
491
532
  declare class InlineFile extends InlineFile_base {}
492
533
  declare const InlineFiles: Schema.$Array<typeof InlineFile>;
534
+ declare const AdmissionLimits: Schema.Struct<{
535
+ readonly pendingPerPage: Schema.optionalKey<Schema.Int>;
536
+ readonly pendingPerSession: Schema.optionalKey<Schema.Int>;
537
+ }>;
538
+ type AdmissionLimits = typeof AdmissionLimits.Type;
539
+ /** Finite metadata retention and subscriber resources; native capture bytes have separate limits. */
540
+ declare const TimelineLimits: Schema.Struct<{
541
+ readonly maxDurationMillis: Schema.optionalKey<Schema.Int>;
542
+ readonly maxEvents: Schema.optionalKey<Schema.Int>;
543
+ readonly maxBytes: Schema.optionalKey<Schema.Int>;
544
+ readonly maxSubscribers: Schema.optionalKey<Schema.Int>;
545
+ readonly maxEventBytes: Schema.optionalKey<Schema.Int>;
546
+ }>;
547
+ type TimelineLimits = typeof TimelineLimits.Type;
493
548
  declare const AutomationOptions: Schema.Struct<{
549
+ readonly timelineLimits: Schema.optionalKey<Schema.Struct<{
550
+ readonly maxDurationMillis: Schema.optionalKey<Schema.Int>;
551
+ readonly maxEvents: Schema.optionalKey<Schema.Int>;
552
+ readonly maxBytes: Schema.optionalKey<Schema.Int>;
553
+ readonly maxSubscribers: Schema.optionalKey<Schema.Int>;
554
+ readonly maxEventBytes: Schema.optionalKey<Schema.Int>;
555
+ }>>;
556
+ readonly admissionLimits: Schema.optionalKey<Schema.Struct<{
557
+ readonly pendingPerPage: Schema.optionalKey<Schema.Int>;
558
+ readonly pendingPerSession: Schema.optionalKey<Schema.Int>;
559
+ }>>;
560
+ readonly observationLimits: Schema.optionalKey<Schema.Struct<{
561
+ readonly maxSnapshotsPerPage: Schema.Int;
562
+ readonly maxSnapshotsPerSession: Schema.Int;
563
+ readonly maxHandlesPerPage: Schema.Int;
564
+ readonly maxHandlesPerSession: Schema.Int;
565
+ readonly maxBytesPerPage: Schema.Int;
566
+ readonly maxBytesPerSession: Schema.Int;
567
+ }>>;
494
568
  readonly actionTimeoutMillis: Schema.optionalKey<Schema.Int>;
495
569
  /** Independent host-only checkpoint/control-facts allowance; normalized to 10,000 by the runtime. */
496
570
  readonly maxHostReads: Schema.optionalKey<Schema.Int>;
@@ -506,6 +580,6 @@ declare const AutomationOptions: Schema.Struct<{
506
580
  }>;
507
581
  type AutomationOptions = typeof AutomationOptions.Type;
508
582
  //#endregion
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 };
583
+ export { Target as $, NavigationResult as A, PressRequest as B, InlineFiles as C, KeyStroke as D, KeyModifier as E, PageExecutionState as F, ScreenshotResult as G, ReadingMatch as H, PageInfo as I, Selector as J, ScrollRequest as K, PageSuspension as L, ObservationOptions as M, ObservedControl as N, NamedKey as O, ObservedElement as P, StartNavigationRequest as Q, PointerMoveRequest as R, InlineFile as S, Inventory as T, SafeFilename as U, ReadTextRequest as V, ScreenshotRequest as W, SessionReason as X, SessionPhase as Y, SessionStatus as Z, FormFieldResult as _, BrowserDiagnostics as a, ViewportEvidence as at, HoverRequest as b, CheckpointOptions as c, WaitForElementRequest as ct, DocumentScroll as d, TargetUrl as et, FillFormOptions as f, FormField as g, FillRequest as h, BrowserDiagnostic as i, Viewport as it, Observation as j, NavigateRequest as k, ClickRequest as l, WheelRequest as lt, FillFormResult as m, AdmissionLimits as n, TimelineLimits as nt, BrowserPolicy as o, ViewportPoint as ot, FillFormRequest as p, SelectOptions as q, AutomationOptions as r, TypeRequest as rt, Checkpoint as s, ViewportRect as st, ActionResult as t, TextResult as tt, ControlFacts as u, FormStop as v, InputReceipt as w, Identifier as x, FrameInfo as y, PositiveInt as z };
510
584
  export {};
511
- //# sourceMappingURL=BrowserData-KHk4o__c.d.mts.map
585
+ //# sourceMappingURL=BrowserData-CPIIIHol.d.mts.map
@@ -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-KHk4o__c.mjs";
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 };
1
+ import { $ as Target, A as NavigationResult, B as PressRequest, C as InlineFiles, D as KeyStroke, E as KeyModifier, F as PageExecutionState, G as ScreenshotResult, H as ReadingMatch, I as PageInfo, J as Selector, K as ScrollRequest, L as PageSuspension, M as ObservationOptions, N as ObservedControl, O as NamedKey, P as ObservedElement, Q as StartNavigationRequest, R as PointerMoveRequest, S as InlineFile, T as Inventory, U as SafeFilename, V as ReadTextRequest, W as ScreenshotRequest, X as SessionReason, Y as SessionPhase, Z as SessionStatus, _ as FormFieldResult, a as BrowserDiagnostics, at as ViewportEvidence, b as HoverRequest, c as CheckpointOptions, ct as WaitForElementRequest, d as DocumentScroll, et as TargetUrl, f as FillFormOptions, g as FormField, h as FillRequest, i as BrowserDiagnostic, it as Viewport, j as Observation, k as NavigateRequest, l as ClickRequest, lt as WheelRequest, m as FillFormResult, n as AdmissionLimits, nt as TimelineLimits, o as BrowserPolicy, ot as ViewportPoint, p as FillFormRequest, q as SelectOptions, r as AutomationOptions, rt as TypeRequest, s as Checkpoint, st as ViewportRect, t as ActionResult, tt as TextResult, u as ControlFacts, v as FormStop, w as InputReceipt, x as Identifier, y as FrameInfo, z as PositiveInt } from "./BrowserData-CPIIIHol.mjs";
2
+ export { ActionResult, AdmissionLimits, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, DocumentScroll, FillFormOptions, FillFormRequest, FillFormResult, FillRequest, FormField, FormFieldResult, FormStop, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, Inventory, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, ReadingMatch, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TimelineLimits, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
3
3
  export {};
@@ -55,6 +55,15 @@ const SessionReason = Schema.Literals([
55
55
  "page-contained"
56
56
  ]);
57
57
  const DiagnosticCounter = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
58
+ /**
59
+ * Bounded fresh metadata from one owner generation. Native URL/title reads are non-atomic.
60
+ * PageInfo is data; callers must acquire an issued Page and observe it explicitly before input.
61
+ * The separate pages lifecycle stream attaches its cached registry snapshot and cursor atomically.
62
+ */
63
+ var Inventory = class extends Schema.Class("BrowserInventory")({
64
+ generation: DiagnosticCounter,
65
+ pages: Schema.Array(PageInfo).check(Schema.isMaxLength(32))
66
+ }) {};
58
67
  /** The bound on one session's model-reachable actions, like the host-read allowance's. */
59
68
  const ActionAllowance = PositiveInt.check(Schema.isLessThanOrEqualTo(1e6));
60
69
  /** Host-only admission evidence. Neither an admission token nor proof of remote termination. */
@@ -115,9 +124,29 @@ var ObservedControl = class extends Schema.Class("BrowserObservedControl")({
115
124
  /** Some choices could not be issued within this reading's shared control/value bounds. */
116
125
  optionsTruncated: Schema.optionalKey(Schema.Boolean)
117
126
  }) {};
127
+ const ScrollOffset = Schema.Finite.check(Schema.isBetween({
128
+ minimum: -Number.MAX_SAFE_INTEGER,
129
+ maximum: Number.MAX_SAFE_INTEGER
130
+ }));
131
+ const ScrollExtent = Schema.Natural.check(Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
132
+ /**
133
+ * The read frame's root document scroll geometry, sampled in CSS pixels with the reading.
134
+ * Offsets can be negative (for example RTL); dimensions are the scrolling element's measured
135
+ * scrollWidth/Height and clientWidth/Height. They do not describe a nested scrolling container
136
+ * or expose unseen text, and do not establish a scroll direction or an end-of-document condition.
137
+ */
138
+ const DocumentScroll = Schema.Struct({
139
+ x: ScrollOffset,
140
+ y: ScrollOffset,
141
+ scrollWidth: ScrollExtent,
142
+ scrollHeight: ScrollExtent,
143
+ clientWidth: ScrollExtent,
144
+ clientHeight: ScrollExtent
145
+ });
118
146
  /**
119
- * How a viewport reading was bounded and what it left out. These are counts, so they are safe
120
- * to show a model. Visibility is geometry and hit-testing, never a pixel comparison: text is
147
+ * How a viewport reading was bounded, what it left out, and its document scroll geometry. These
148
+ * counts and measured layout facts can be shown to a model. Visibility is geometry and
149
+ * hit-testing, never a pixel comparison: text is
121
150
  * kept when its line boxes intersect the viewport and the browser finds its own element at a
122
151
  * sampled point. Something that takes no pointer events is invisible to that test, so the
123
152
  * browser is asked what is on top there with pointer events ignored: a box that paints at the
@@ -127,6 +156,8 @@ var ObservedControl = class extends Schema.Class("BrowserObservedControl")({
127
156
  var ViewportEvidence = class extends Schema.Class("BrowserViewportEvidence")({
128
157
  width: Schema.Finite,
129
158
  height: Schema.Finite,
159
+ /** Absent when the document has no scrolling element, or in older/scripted readings. */
160
+ documentScroll: Schema.optionalKey(DocumentScroll),
130
161
  /** Text that crossed a viewport edge; only its lines on screen were kept. */
131
162
  clippedText: Schema.Natural,
132
163
  /** Left out: another element is on top at the sampled point, or a box there paints over it. */
@@ -494,12 +525,13 @@ const TypedText = Schema.NonEmptyString.check(Schema.makeFilter((text) => [...te
494
525
  return point > 31 && point !== 127 && (point < 55296 || point > 57343);
495
526
  }), { title: "no control characters or unpaired surrogates" }));
496
527
  /**
497
- * Text as the real key strokes that produce it, two native commands for each character, one
498
- * after another under a single action timeout: send a long passage as several shorter runs.
528
+ * Text as the real key strokes that produce it, with ordered native commands submitted in
529
+ * bounded windows under a single action timeout. An interrupted run is never replayed.
499
530
  * A character the US layout cannot produce is inserted as text, as an input method commits it,
500
531
  * and raises no key events. Control characters are refused, so a line break can never press
501
532
  * Enter from inside a run of text: a named key is always its own `press`. `into` works as it
502
- * does for `PressRequest`: a guard on where the text lands, never a focus.
533
+ * does for `PressRequest`: a guard on where the text lands, never a focus. The exact node is
534
+ * checked before subsequent windows; already submitted input cannot be recalled on focus loss.
503
535
  */
504
536
  var TypeRequest = class extends Schema.Class("BrowserTypeRequest")({
505
537
  text: TypedText,
@@ -527,6 +559,11 @@ var InputReceipt = class extends Schema.Class("BrowserInputReceipt")({
527
559
  "type"
528
560
  ]),
529
561
  position: Schema.NullOr(ViewportPoint),
562
+ intended: Schema.optionalKey(Schema.Struct({
563
+ position: ViewportPoint,
564
+ relativePosition: ViewportPoint,
565
+ qualification: Schema.Literal("checked-exact-node-sample")
566
+ })),
530
567
  delta: Schema.optionalKey(Schema.Struct({
531
568
  x: WheelDelta,
532
569
  y: WheelDelta
@@ -568,7 +605,68 @@ var InlineFile = class extends Schema.Class("BrowserInlineFile")({
568
605
  bytes: Schema.Uint8Array.check(Schema.makeFilter((value) => value.byteLength >= 1 && value.byteLength <= 1048576, { title: "between one byte and one mebibyte" }))
569
606
  }) {};
570
607
  const InlineFiles = Schema.Array(InlineFile).check(Schema.isMaxLength(8), Schema.makeFilter((files) => files.length > 0 && files.reduce((total, file) => total + file.bytes.byteLength, 0) <= 4194304, { title: "at most four mebibytes of in-memory selection" }));
608
+ const AdmissionLimits = Schema.Struct({
609
+ pendingPerPage: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
610
+ minimum: 1,
611
+ maximum: 1024
612
+ }))),
613
+ pendingPerSession: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
614
+ minimum: 1,
615
+ maximum: 1024
616
+ })))
617
+ });
618
+ /** Finite metadata retention and subscriber resources; native capture bytes have separate limits. */
619
+ const TimelineLimits = Schema.Struct({
620
+ maxDurationMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
621
+ minimum: 1,
622
+ maximum: 216e5
623
+ }))),
624
+ maxEvents: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
625
+ minimum: 1,
626
+ maximum: 65536
627
+ }))),
628
+ maxBytes: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
629
+ minimum: 2048,
630
+ maximum: 67108864
631
+ }))),
632
+ maxSubscribers: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
633
+ minimum: 1,
634
+ maximum: 256
635
+ }))),
636
+ maxEventBytes: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
637
+ minimum: 2048,
638
+ maximum: 1048576
639
+ })))
640
+ }).check(Schema.makeFilter((limits) => limits.maxEventBytes === void 0 || limits.maxBytes === void 0 || limits.maxEventBytes <= limits.maxBytes, { title: "event metadata fits the retained metadata budget" }));
571
641
  const AutomationOptions = Schema.Struct({
642
+ timelineLimits: Schema.optionalKey(TimelineLimits),
643
+ admissionLimits: Schema.optionalKey(AdmissionLimits),
644
+ observationLimits: Schema.optionalKey(Schema.Struct({
645
+ maxSnapshotsPerPage: Schema.Int.check(Schema.isBetween({
646
+ minimum: 1,
647
+ maximum: 128
648
+ })),
649
+ maxSnapshotsPerSession: Schema.Int.check(Schema.isBetween({
650
+ minimum: 1,
651
+ maximum: 4096
652
+ })),
653
+ maxHandlesPerPage: Schema.Int.check(Schema.isBetween({
654
+ minimum: 1,
655
+ maximum: 65536
656
+ })),
657
+ maxHandlesPerSession: Schema.Int.check(Schema.isBetween({
658
+ minimum: 1,
659
+ maximum: 2097152
660
+ })),
661
+ maxBytesPerPage: Schema.Int.check(Schema.isBetween({
662
+ minimum: 1,
663
+ maximum: 268435456
664
+ })),
665
+ maxBytesPerSession: Schema.Int.check(Schema.isBetween({
666
+ minimum: 1,
667
+ maximum: 1073741824
668
+ }))
669
+ })),
572
670
  actionTimeoutMillis: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
573
671
  minimum: 1,
574
672
  maximum: 6e4
@@ -592,6 +690,6 @@ const AutomationOptions = Schema.Struct({
592
690
  pageControl: Schema.optionalKey(Schema.Boolean)
593
691
  });
594
692
  //#endregion
595
- 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 };
693
+ export { ActionResult, AdmissionLimits, AutomationOptions, BrowserDiagnostic, BrowserDiagnostics, BrowserPolicy, Checkpoint, CheckpointOptions, ClickRequest, ControlFacts, DocumentScroll, FillFormOptions, FillFormRequest, FillFormResult, FillRequest, FormField, FormFieldResult, FormStop, FrameInfo, HoverRequest, Identifier, InlineFile, InlineFiles, InputReceipt, Inventory, KeyModifier, KeyStroke, NamedKey, NavigateRequest, NavigationResult, Observation, ObservationOptions, ObservedControl, ObservedElement, PageExecutionState, PageInfo, PageSuspension, PointerMoveRequest, PositiveInt, PressRequest, ReadTextRequest, ReadingMatch, SafeFilename, ScreenshotRequest, ScreenshotResult, ScrollRequest, SelectOptions, Selector, SessionPhase, SessionReason, SessionStatus, StartNavigationRequest, Target, TargetUrl, TextResult, TimelineLimits, TypeRequest, Viewport, ViewportEvidence, ViewportPoint, ViewportRect, WaitForElementRequest, WheelRequest };
596
694
 
597
695
  //# sourceMappingURL=BrowserData.mjs.map