@orkestrel/scaffold 0.0.114 → 0.0.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/main.js +137 -15
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/orchestration.md +5 -3
- package/dist/host/agents/platforms/windows.md +1 -0
- package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +4 -1
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +8 -2
- package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +1 -0
- package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +9 -3
- package/dist/host/claude/agents/analyst.md +1 -1
- package/dist/host/claude/agents/astra.md +2 -2
- package/dist/host/claude/agents/builder.md +4 -4
- package/dist/host/claude/agents/opus.md +3 -3
- package/dist/host/claude/agents/orkestrel.md +5 -7
- package/dist/host/claude/agents/planner.md +8 -2
- package/dist/host/claude/rules/campaign.md +2 -1
- package/dist/host/claude/rules/documentation.md +1 -0
- package/dist/host/claude/rules/names.md +3 -1
- package/dist/host/claude/rules/tests.md +7 -4
- package/dist/host/claude/rules/writing.md +1 -0
- package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-align/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-build/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-journey/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-polish/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
- package/dist/host/codex/agents/analyst.toml +8 -5
- package/dist/host/codex/agents/astra.toml +4 -5
- package/dist/host/codex/agents/builder.toml +5 -5
- package/dist/host/codex/agents/opus.toml +3 -4
- package/dist/host/codex/agents/orkestrel.toml +2 -1
- package/dist/host/codex/agents/planner.toml +8 -5
- package/dist/host/codex/agents/reviewer.toml +5 -4
- package/dist/host/guides/abort.md +17 -17
- package/dist/host/guides/agent.md +445 -445
- package/dist/host/guides/brief.md +143 -143
- package/dist/host/guides/browser.md +731 -731
- package/dist/host/guides/budget.md +39 -39
- package/dist/host/guides/capture.md +298 -298
- package/dist/host/guides/console.md +109 -109
- package/dist/host/guides/contract.md +335 -335
- package/dist/host/guides/csv.md +30 -30
- package/dist/host/guides/database.md +163 -163
- package/dist/host/guides/emitter.md +17 -17
- package/dist/host/guides/form.md +99 -99
- package/dist/host/guides/guide.md +361 -183
- package/dist/host/guides/html.md +49 -49
- package/dist/host/guides/indexeddb.md +40 -40
- package/dist/host/guides/interpret.md +139 -139
- package/dist/host/guides/lsp.md +114 -114
- package/dist/host/guides/markdown.md +68 -68
- package/dist/host/guides/mcp.md +3745 -3745
- package/dist/host/guides/middleware.md +170 -170
- package/dist/host/guides/msg.md +95 -95
- package/dist/host/guides/ndjson.md +8 -8
- package/dist/host/guides/ollama.md +56 -56
- package/dist/host/guides/pool.md +21 -21
- package/dist/host/guides/probe.md +82 -82
- package/dist/host/guides/process.md +99 -99
- package/dist/host/guides/program.md +98 -96
- package/dist/host/guides/qualifier.md +70 -70
- package/dist/host/guides/queue.md +37 -37
- package/dist/host/guides/rater.md +38 -38
- package/dist/host/guides/reason.md +308 -308
- package/dist/host/guides/relation.md +50 -50
- package/dist/host/guides/router.md +58 -58
- package/dist/host/guides/scaffold.md +554 -419
- package/dist/host/guides/sea.md +128 -128
- package/dist/host/guides/server.md +100 -100
- package/dist/host/guides/sqlite.md +28 -28
- package/dist/host/guides/sse.md +20 -20
- package/dist/host/guides/study.md +444 -444
- package/dist/host/guides/table.md +82 -82
- package/dist/host/guides/template.md +41 -41
- package/dist/host/guides/terminal.md +121 -121
- package/dist/host/guides/test.md +273 -273
- package/dist/host/guides/timeout.md +18 -18
- package/dist/host/guides/tool.md +27 -27
- package/dist/host/guides/toolbox.md +166 -166
- package/dist/host/guides/websocket.md +54 -54
- package/dist/host/guides/worker.md +24 -24
- package/dist/host/guides/workflow.md +187 -187
- package/dist/host/guides/workspace.md +55 -55
- package/dist/host/manifest.json +93 -93
- package/dist/host/tests/setupPolicy.ts +5 -3
- package/dist/src/core/index.cjs +89 -3
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +229 -144
- package/dist/src/core/index.d.ts +229 -144
- package/dist/src/core/index.js +87 -4
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +292 -66
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +188 -6
- package/dist/src/server/index.d.ts +188 -6
- package/dist/src/server/index.js +287 -69
- package/dist/src/server/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -94,195 +94,195 @@ The core supplies the entities a browser session and an agent use. Its host-spec
|
|
|
94
94
|
|
|
95
95
|
#### Context and page
|
|
96
96
|
|
|
97
|
-
|
|
|
98
|
-
| ----------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
-
| `BrowserContext` | class | Owns pages and shared state inside one Chromium browser context. |
|
|
100
|
-
| `BrowserTransition` | class | Runs one asynchronous transition at a time, shared by every caller that joins it. |
|
|
101
|
-
| `createBrowserContext` | function | Creates a wrapper over an existing browser context on a CDP client. |
|
|
102
|
-
| `BrowserBindingCall` | interface | Describes a decoded page-to-host binding call. |
|
|
103
|
-
| `BrowserCaptureResult` | interface | Carries a receipt's capture or the bounded reason no capture was available. |
|
|
104
|
-
| `BrowserChord` | interface | Describes a parsed keyboard chord. |
|
|
105
|
-
| `BrowserClockInterface` | interface | Controls Chromium virtual time for deterministic page timers. |
|
|
106
|
-
| `BrowserConsoleMessage` | interface | Represents one console API call. |
|
|
107
|
-
| `BrowserContextInterface` | interface | Represents an isolated browser session over a CDP browser context. |
|
|
108
|
-
| `BrowserCookie` | interface | Represents one cookie returned from a browser context. |
|
|
109
|
-
| `BrowserCookieFilter` | interface | Describes narrowing criteria for removing context cookies. |
|
|
110
|
-
| `BrowserCookieInput` | interface | Describes the input used to create or replace a browser cookie. |
|
|
111
|
-
| `BrowserCookieManagerInterface` | interface | Provides cookie operations scoped to one browser context. |
|
|
112
|
-
| `BrowserCookiePartition` | interface | Describes a cookie partition key used by CHIPS-partitioned cookies. |
|
|
113
|
-
| `BrowserCoverageInterface` | interface | Drives the coverage capture lifecycle. |
|
|
114
|
-
| `BrowserCoverageRange` | interface | Describes a source range reported by JavaScript or CSS coverage. |
|
|
115
|
-
| `BrowserCoverageResult` | interface | Describes combined JavaScript and CSS usage. |
|
|
116
|
-
| `BrowserCredentials` | interface | Describes the HTTP basic-auth credentials applied to context pages. |
|
|
117
|
-
| `BrowserDestination` | interface | Pairs a document that recorded a surviving submission with the submission's destination. |
|
|
118
|
-
| `BrowserDiagnosticsInterface` | interface | Groups the diagnostics by capability. |
|
|
119
|
-
| `BrowserDialogInterface` | interface | Represents one active JavaScript dialog. |
|
|
120
|
-
| `BrowserDocument` | interface | Represents one document captured in a CDP DOM snapshot. |
|
|
121
|
-
| `BrowserDownloadInterface` | interface | Represents one context download tracked through Chromium's Browser domain. |
|
|
122
|
-
| `BrowserDownloadProgress` | interface | Describes a protocol-neutral download progress update. |
|
|
123
|
-
| `BrowserDownloadStart` | interface | Describes a decoded `Browser.downloadWillBegin` event. |
|
|
124
|
-
| `BrowserEmulationManagerInterface` | interface | Configures context-scoped emulation. |
|
|
125
|
-
| `BrowserFileChooserInterface` | interface | Represents one intercepted file chooser. |
|
|
126
|
-
| `BrowserFrameInfo` | interface | Describes serializable frame metadata decoded from CDP `Page.getFrameTree`. |
|
|
127
|
-
| `BrowserFrameInterface` | interface | Provides the operations shared by a top-level page and an iframe document. |
|
|
128
|
-
| `BrowserFunctionCoverage` | interface | Describes function coverage inside one script. |
|
|
129
|
-
| `BrowserGeolocation` | interface | Describes a geographic location override. |
|
|
130
|
-
| `BrowserHandleInterface` | interface | Represents a remote JavaScript object retained in one frame execution context. |
|
|
131
|
-
| `BrowserHAR` | interface | Describes the standards-shaped HAR 1.2 document produced by the network manager. |
|
|
132
|
-
| `BrowserHARContent` | interface | Describes response body metadata in an HTTP archive. |
|
|
133
|
-
| `BrowserHARCookie` | interface | Represents one cookie in an HTTP archive. |
|
|
134
|
-
| `BrowserHARCreator` | interface | Describes the tool identity embedded in an HTTP archive. |
|
|
135
|
-
| `BrowserHAREntry` | interface | Represents one completed HTTP exchange in a HAR recording. |
|
|
136
|
-
| `BrowserHARLog` | interface | Describes the HAR 1.2 log object. |
|
|
137
|
-
| `BrowserHARManagerInterface` | interface | Provides HAR recording and replay operations. |
|
|
138
|
-
| `BrowserHARPost` | interface | Describes request body metadata in an HTTP archive. |
|
|
139
|
-
| `BrowserHARRequest` | interface | Describes a HAR 1.2 request entry. |
|
|
140
|
-
| `BrowserHARResponse` | interface | Describes a HAR 1.2 response entry. |
|
|
141
|
-
| `BrowserHARTimings` | interface | Holds HAR 1.2 phase timings in milliseconds. |
|
|
142
|
-
| `BrowserHARValue` | interface | Represents one name/value pair in an HTTP archive. |
|
|
143
|
-
| `BrowserKey` | interface | Describes normalized CDP keyboard key data. |
|
|
144
|
-
| `BrowserKeyboardInterface` | interface | Provides keyboard input operations bound to one frame target session. |
|
|
145
|
-
| `BrowserLayout` | interface | Describes layout data associated with one captured DOM node. |
|
|
146
|
-
| `BrowserMargin` | interface | Describes the paper margin lengths accepted by Chromium print-to-PDF. |
|
|
147
|
-
| `BrowserMedia` | interface | Describes browser color and media feature overrides. |
|
|
148
|
-
| `BrowserMetric` | interface | Represents one Performance-domain metric. |
|
|
149
|
-
| `BrowserMouseInterface` | interface | Provides mouse input operations bound to one frame target session. |
|
|
150
|
-
| `BrowserNavigationManagerInterface` | interface | Provides URL and network-idle waits associated with one page. |
|
|
151
|
-
| `BrowserNavigationRecordInterface` | interface | Settles the navigation an input into one frame started, from the steps the page accepted after the record opened. |
|
|
152
|
-
| `BrowserNavigationResult` | interface | Describes the outcome of a top-level navigation command. |
|
|
153
|
-
| `BrowserNetworkManagerInterface` | interface | Provides page-scoped network observation and interception. |
|
|
154
|
-
| `BrowserPageError` | interface | Represents one uncaught page exception. |
|
|
155
|
-
| `BrowserPageInterface` | interface | Abstracts a single top-level browser page, extending `BrowserFrameInterface` with navigation, screenshots, frame discovery, DOM snapshots, a journey recorder, and target teardown. |
|
|
156
|
-
| `BrowserPassage` | interface | Describes the projection and context of one bounded reading window. |
|
|
157
|
-
| `BrowserPDFResult` | interface | Describes the result of printing a page to PDF. |
|
|
158
|
-
| `BrowserPerformanceInterface` | interface | Reads Performance-domain metrics. |
|
|
159
|
-
| `BrowserPermissionManagerInterface` | interface | Provides permission override operations scoped to one browser context. |
|
|
160
|
-
| `BrowserPopupManagerInterface` | interface | Opens the records that settle the popups an input into a page opens. |
|
|
161
|
-
| `BrowserPopupRecordInterface` | interface | Settles the popups an input opened, from the `Page.windowOpen` reports the page's own session sends after the record opened. |
|
|
162
|
-
| `BrowserProfile` | interface | Describes a sampled CPU profile. |
|
|
163
|
-
| `BrowserProfileFrame` | interface | Describes a JavaScript call frame from a CPU profile. |
|
|
164
|
-
| `BrowserProfileNode` | interface | Represents one node in a sampled CPU profile. |
|
|
165
|
-
| `BrowserProfilerInterface` | interface | Drives the sampled CPU profile lifecycle. |
|
|
166
|
-
| `BrowserProxy` | interface | Describes proxy settings used when creating an isolated browser context. |
|
|
167
|
-
| `BrowserQuad` | interface | Describes a decoded content quad and its actionable center. |
|
|
168
|
-
| `BrowserReceipt` | interface | Describes one tool receipt before rendering. |
|
|
169
|
-
| `BrowserRequest` | interface | Represents one observed browser request. |
|
|
170
|
-
| `BrowserRequestFailure` | interface | Represents one failed browser request. |
|
|
171
|
-
| `BrowserResponse` | interface | Represents one observed browser response. |
|
|
172
|
-
| `BrowserRouteDefinition` | interface | Represents one installed network route. |
|
|
173
|
-
| `BrowserRouteInterface` | interface | Represents one paused Fetch-domain request. |
|
|
174
|
-
| `BrowserRouteManagerInterface` | interface | Manages the request handlers installed on a page network. |
|
|
175
|
-
| `BrowserRouteQuery` | interface | Describes route matching criteria. Omitted fields match all values. |
|
|
176
|
-
| `BrowserScreenshotResult` | interface | Describes the result of a page screenshot. |
|
|
177
|
-
| `BrowserScriptCoverage` | interface | Describes JavaScript script coverage. |
|
|
178
|
-
| `BrowserScriptManagerInterface` | interface | Manages initialization scripts and host bindings for one page. |
|
|
179
|
-
| `BrowserSecurity` | interface | Describes the TLS details supplied with a browser response. |
|
|
180
|
-
| `BrowserSettlementResult` | interface | Describes the navigation a record settled. |
|
|
181
|
-
| `BrowserStackFrame` | interface | Represents one browser-side stack frame. |
|
|
182
|
-
| `BrowserStorageEntry` | interface | Represents one key/value pair from web storage. |
|
|
183
|
-
| `BrowserStorageManagerInterface` | interface | Provides storage-state import, export, and clearing operations. |
|
|
184
|
-
| `BrowserStorageOrigin` | interface | Describes an origin-scoped local and session storage snapshot. |
|
|
185
|
-
| `BrowserStorageState` | interface | Describes a portable browser authentication and storage snapshot. |
|
|
186
|
-
| `BrowserStyleCoverage` | interface | Describes CSS stylesheet coverage. |
|
|
187
|
-
| `BrowserTab` | interface | Describes one open tab of a toolset's context, which the `read` header lists. |
|
|
188
|
-
| `BrowserTiming` | interface | Holds network timing values in milliseconds relative to request time. |
|
|
189
|
-
| `BrowserTimingRange` | interface | Describes the start/end pair for one network timing phase. |
|
|
190
|
-
| `BrowserTouchInterface` | interface | Provides touch input operations bound to one frame target session. |
|
|
191
|
-
| `BrowserTraceInterface` | interface | Drives the trace capture lifecycle. |
|
|
192
|
-
| `BrowserTraceResult` | interface | Describes the result of a trace capture. |
|
|
193
|
-
| `BrowserTransitionInterface` | interface | Represents one asynchronous transition shared by every caller that arrives while it runs. |
|
|
194
|
-
| `BrowserUserAgent` | interface | Describes user-agent metadata accepted by Chromium emulation. |
|
|
195
|
-
| `BrowserViewInterface` | interface | Provides the document operations shared by remote and DOM-native views. |
|
|
196
|
-
| `BrowserViewport` | interface | Describes the viewport dimensions for a browser page. |
|
|
197
|
-
| `BrowserWorkerInterface` | interface | Represents a script worker attached to a page target. |
|
|
198
|
-
| `BrowserWriterInterface` | interface | Provides a pluggable sink for persisting captured browser bytes to a path. |
|
|
199
|
-
| `BrowserCallOptions` | interface | Describes the options every asynchronous page, frame, handle, and worker call accepts. |
|
|
200
|
-
| `BrowserClickOptions` | interface | Describes the options for a trusted mouse click. |
|
|
201
|
-
| `BrowserContextOptions` | interface | Configures a wrapper around an existing browser context. |
|
|
202
|
-
| `BrowserCoverageOptions` | interface | Describes the options for a coverage capture. |
|
|
203
|
-
| `BrowserDownloadOptions` | interface | Describes the download policy for a browser context. |
|
|
204
|
-
| `BrowserDragOptions` | interface | Describes the options for a trusted mouse drag. |
|
|
205
|
-
| `BrowserEmulationOptions` | interface | Describes network and rendering overrides inherited by context pages. |
|
|
206
|
-
| `BrowserFollowOptions` | interface | Configures one step a toolset follows. |
|
|
207
|
-
| `BrowserHAROptions` | interface | Describes the options for a HAR recording. |
|
|
208
|
-
| `BrowserInputOptions` | interface | Describes the options shared by every trusted input operation. |
|
|
209
|
-
| `BrowserIsolateOptions` | interface | Configures a new isolated browser context. |
|
|
210
|
-
| `BrowserNavigationOptions` | interface | Describes the options for page navigation. |
|
|
211
|
-
| `BrowserNetworkOptions` | interface | Configures the supplied network overrides without changing omitted keys. |
|
|
212
|
-
| `BrowserOperationOptions` | type | Collects every option a trusted-input operation can carry. |
|
|
213
|
-
| `BrowserPageOptions` | interface | Describes the options for creating a page through its context. |
|
|
214
|
-
| `BrowserPDFOptions` | interface | Describes the options for printing a Chromium page to PDF. |
|
|
215
|
-
| `BrowserRouteContinueOptions` | interface | Describes the overrides supplied when continuing an intercepted request. |
|
|
216
|
-
| `BrowserRouteFulfillOptions` | interface | Describes the synthetic response supplied when fulfilling an intercepted request. |
|
|
217
|
-
| `BrowserScreenshotOptions` | interface | Describes the options for taking a page screenshot. |
|
|
218
|
-
| `BrowserSettlementOptions` | interface | Configures a record's settlement. |
|
|
219
|
-
| `BrowserStorageOptions` | interface | Describes the options for collecting storage state from selected origins. |
|
|
220
|
-
| `BrowserTraceOptions` | interface | Describes the options for a Chromium trace capture. |
|
|
221
|
-
| `BrowserTraversalOptions` | interface | Describes the options for traversing a browser snapshot. |
|
|
222
|
-
| `BrowserWaitOptions` | interface | Configures a text or element wait, including whether absence satisfies it. |
|
|
223
|
-
| `validateBrowserContextOptions` | function | Validates isolated-context options before creating remote state. |
|
|
224
|
-
| `validateBrowserEmulationOptions` | function | Validates context emulation boundaries before partial application. |
|
|
225
|
-
| `validateBrowserInputOptions` | function | Validates the bounded delay, count, and steps of one trusted-input operation. |
|
|
226
|
-
| `BrowserBindingHandler` | type | Runs a host function exposed into page JavaScript. |
|
|
227
|
-
| `BrowserContextDisposal` | type | Records Chromium's disposal acknowledgement or the failure that left disposal unconfirmed. |
|
|
228
|
-
| `BrowserContextEventMap` | type | Maps the browser-context lifecycle events. |
|
|
229
|
-
| `BrowserDestinationRelationship` | type | Names the frame a submission targets relative to the frame whose document submitted, mirroring the HTML `_self`, `_parent`, and `_top` keywords. |
|
|
230
|
-
| `BrowserDialogCategory` | type | Names a JavaScript dialog category reported by Chromium. |
|
|
231
|
-
| `BrowserDownloadEventMap` | type | Maps the download progress events. |
|
|
232
|
-
| `BrowserDownloadStatus` | type | Names a download lifecycle phase. |
|
|
233
|
-
| `BrowserEpochFunction` | type | Reads the navigation epoch of the frame a reading was captured from. |
|
|
234
|
-
| `BrowserMouseButton` | type | Names a mouse button understood by Chromium's Input domain. |
|
|
235
|
-
| `BrowserNavigationCondition` | type | Names the page load condition for navigation — the CDP load event awaited by `navigate()`. |
|
|
236
|
-
| `BrowserNavigationEventMap` | type | Maps the navigation steps a page accepts from the session that owns each frame, which it hands to its navigation and element managers. |
|
|
237
|
-
| `BrowserNavigationReason` | type | Names why a frame requested a navigation, mirroring the CDP `Page.ClientNavigationReason` values that `Page.frameRequestedNavigation` carries as of Chromium 141. |
|
|
238
|
-
| `BrowserNavigationStage` | type | Names how far a settled navigation got: requested, committed, or loaded. |
|
|
239
|
-
| `BrowserNetworkEventMap` | type | Maps the network events a page's network manager emits. |
|
|
240
|
-
| `BrowserPageEventMap` | type | Maps the typed page, frame, target, and user-visible browser events. |
|
|
241
|
-
| `BrowserPagesFunction` | type | Returns the context's live pages at call time. |
|
|
242
|
-
| `BrowserRouteHandler` | type | Runs for a matching intercepted request. |
|
|
243
|
-
| `BrowserSameSite` | type | Names a cookie same-site policy understood by Chromium. |
|
|
244
|
-
| `BrowserScreenshotScale` | type | Names a screenshot coordinate scale. |
|
|
245
|
-
| `BrowserSessionFunction` | type | Resolves the current CDP session for a frame id. |
|
|
246
|
-
| `BrowserSiblingRelation` | type | Names a structural sibling relationship relative to a browser node. |
|
|
247
|
-
| `BrowserStepOutcome` | type | Names how one step ended. |
|
|
248
|
-
| `BrowserTeardownFunction` | type | Runs one teardown step to settlement while the first failure is retained. |
|
|
249
|
-
| `BrowserTransitionFunction` | type | Runs the work one `BrowserTransitionInterface` transition performs. |
|
|
250
|
-
| `BrowserViewEventMap` | type | Maps the `console` and `error` events of a view that observes its document's output. |
|
|
251
|
-
| `BrowserWorkerCategory` | type | Names a worker target category. |
|
|
252
|
-
| `browserHARHeadersToRecord` | function | Converts HAR name/value headers into a Fetch-domain header record. |
|
|
253
|
-
| `buildBrowserHAREntry` | function | Builds a standards-shaped HAR 1.2 entry from one observed exchange. |
|
|
254
|
-
| `computeBrowserButtons` | function | Computes the CDP Input pressed-button bitmask. |
|
|
255
|
-
| `computeBrowserModifiers` | function | Computes the CDP Input modifier bitmask. |
|
|
256
|
-
| `extractBrowserChord` | function | Extracts a keyboard chord such as `Control+Shift+P` into its parts, throwing a `BrowserError` on an empty chord or an unsupported modifier. |
|
|
257
|
-
| `isBrowserPage` | function | Checks whether a value exposes the page capabilities used by a browser toolset. |
|
|
258
|
-
| `matchesBrowserCookieURL` | function | Matches a decoded cookie against one request URL. |
|
|
259
|
-
| `matchesBrowserRoute` | function | Matches a request against route criteria. |
|
|
260
|
-
| `matchesBrowserURL` | function | Matches a URL using Chromium-style `*` and `**` glob segments. |
|
|
261
|
-
| `normalizeBrowserKey` | function | Normalizes named keys and modifier aliases before trusted keyboard input. |
|
|
262
|
-
| `renderBrowserPassage` | function | Renders a bounded window with numbered rows and an exact continuation. |
|
|
263
|
-
| `renderBrowserReceipt` | function | Renders a tool receipt: the action and its status on one line, the interrupting dialog, then a blank line and the fresh view. |
|
|
264
|
-
| `renderBrowserReceiptWindow` | function | Fits an unnumbered receipt and a complete page window inside one result limit. |
|
|
265
|
-
| `requireBrowserString` | function | Requires an evaluated browser value to be a string. |
|
|
266
|
-
| `settleBrowserTeardown` | function | Awaits every teardown step in order and returns the first failure. |
|
|
267
|
-
| `validateBrowserHAR` | function | Validates the HAR 1.2 fields required for deterministic replay. |
|
|
268
|
-
| `validateBrowserPageOpen` | function | Refuses work on a disconnected or closed page. |
|
|
269
|
-
| `validateBrowserRange` | function | Validates a finite numeric range. |
|
|
270
|
-
| `validateBrowserTimeout` | function | Validates a public browser timeout before protocol work begins. |
|
|
271
|
-
| `validateBrowserViewport` | function | Validates Chromium viewport metrics. |
|
|
272
|
-
| `BROWSER_DEFAULT_TIMEOUT_MS` | const | Sets the default timeout for browser connection, requests, and navigation, `30_000` milliseconds. |
|
|
273
|
-
| `BROWSER_DEFAULT_VIEWPORT_HEIGHT` | const | Sets the default viewport height, `720` pixels. |
|
|
274
|
-
| `BROWSER_DEFAULT_VIEWPORT_WIDTH` | const | Sets the default viewport width, `1280` pixels. |
|
|
275
|
-
| `BROWSER_FRAME_WORLD_NAME` | const | Names the isolated world used for iframe evaluation, `'__orkestrelBrowserFrame'`. |
|
|
276
|
-
| `BROWSER_HAR_CREATOR` | const | Names the tool identity embedded in HAR 1.2 documents. |
|
|
277
|
-
| `BROWSER_KEY_MODIFIERS` | const | Maps a canonical modifier name to its CDP Input modifier bit value. |
|
|
278
|
-
| `BROWSER_MOUSE_BUTTON_MASKS` | const | Maps each public mouse button to its CDP Input pressed-button bit value. |
|
|
279
|
-
| `BROWSER_NAVIGATION_REASONS` | const | Lists every CDP `Page.ClientNavigationReason` value a page accepts as a navigation's reason, as of Chromium 141; a page reads any other reason as undefined. |
|
|
280
|
-
| `BROWSER_RELOAD_NAVIGATION_TYPES` | const | Lists the CDP `Page.frameStartedNavigating` `navigationType` values that repeat or restore a history entry rather than follow a request, as of Chromium 141. |
|
|
281
|
-
| `BROWSER_SCHEMES` | const | Names the URL schemes the `navigate` tool accepts by default: `http:` and `https:`. |
|
|
282
|
-
| `BROWSER_SCREENSHOT_ATTRIBUTE` | const | Names the attribute that tags temporary screenshot styles and masks. |
|
|
283
|
-
| `BROWSER_STABLE_FRAME_COUNT` | const | Sets the number of animation frames whose element bounds must agree before trusted input. |
|
|
284
|
-
| `BROWSER_STOP_LOADING_TIMEOUT_MS` | const | Bounds the best-effort `Page.stopLoading` call issued after a failed `navigate()` at `1_000` milliseconds. |
|
|
285
|
-
| `BROWSER_WAIT_EVENTS` | const | Names the finished transitions and animations that wake a parked wait. |
|
|
97
|
+
| Name | Kind | Signature | Summary |
|
|
98
|
+
| ----------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| `BrowserContext` | class | `new (client: CDPClientInterface, options?: BrowserContextOptions) => BrowserContextInterface` | Owns pages and shared state inside one Chromium browser context. |
|
|
100
|
+
| `BrowserTransition` | class | `new <T = void>() => BrowserTransitionInterface<T>` | Runs one asynchronous transition at a time, shared by every caller that joins it. |
|
|
101
|
+
| `createBrowserContext` | function | `(client: CDPClientInterface, options?: BrowserContextOptions) => BrowserContextInterface` | Creates a wrapper over an existing browser context on a CDP client. |
|
|
102
|
+
| `BrowserBindingCall` | interface | `{ id, name, args, context }` | Describes a decoded page-to-host binding call. |
|
|
103
|
+
| `BrowserCaptureResult` | interface | `{ outline?, note?, tabs, focus }` | Carries a receipt's capture or the bounded reason no capture was available. |
|
|
104
|
+
| `BrowserChord` | interface | `{ modifiers, key }` | Describes a parsed keyboard chord. |
|
|
105
|
+
| `BrowserClockInterface` | interface | `{ active, start(), pause(), resume(), advance(), stop() }` | Controls Chromium virtual time for deterministic page timers. |
|
|
106
|
+
| `BrowserConsoleMessage` | interface | `{ level, text, values, timestamp, stack }` | Represents one console API call. |
|
|
107
|
+
| `BrowserContextInterface` | interface | `{ emitter, id, disposal, cookies, permissions, storage, emulation, page(), pages(), create(), sync(), destroy(), close() }` | Represents an isolated browser session over a CDP browser context. |
|
|
108
|
+
| `BrowserCookie` | interface | `{ name, value, domain, path, expires, http, secure, site, partition }` | Represents one cookie returned from a browser context. |
|
|
109
|
+
| `BrowserCookieFilter` | interface | `{ name?, domain?, path? }` | Describes narrowing criteria for removing context cookies. |
|
|
110
|
+
| `BrowserCookieInput` | interface | `{ name, value, url?, domain?, path?, expires?, http?, secure?, site?, priority?, partition? }` | Describes the input used to create or replace a browser cookie. |
|
|
111
|
+
| `BrowserCookieManagerInterface` | interface | `{ cookies(), set(), remove(), clear() }` | Provides cookie operations scoped to one browser context. |
|
|
112
|
+
| `BrowserCookiePartition` | interface | `{ site, ancestor? }` | Describes a cookie partition key used by CHIPS-partitioned cookies. |
|
|
113
|
+
| `BrowserCoverageInterface` | interface | `{ active, start(), stop(), destroy() }` | Drives the coverage capture lifecycle. |
|
|
114
|
+
| `BrowserCoverageRange` | interface | `{ start, end, count }` | Describes a source range reported by JavaScript or CSS coverage. |
|
|
115
|
+
| `BrowserCoverageResult` | interface | `{ scripts, styles }` | Describes combined JavaScript and CSS usage. |
|
|
116
|
+
| `BrowserCredentials` | interface | `{ username, password }` | Describes the HTTP basic-auth credentials applied to context pages. |
|
|
117
|
+
| `BrowserDestination` | interface | `{ frame, relationship }` | Pairs a document that recorded a surviving submission with the submission's destination. |
|
|
118
|
+
| `BrowserDiagnosticsInterface` | interface | `{ trace, coverage, performance, profiler, destroy() }` | Groups the diagnostics by capability. |
|
|
119
|
+
| `BrowserDialogInterface` | interface | `{ category, message, default, accept(), dismiss() }` | Represents one active JavaScript dialog. |
|
|
120
|
+
| `BrowserDocument` | interface | `{ index, frame, url, title, nodes, scroll, width, height }` | Represents one document captured in a CDP DOM snapshot. |
|
|
121
|
+
| `BrowserDownloadInterface` | interface | `{ emitter, id, url, name, status, received, total, path, abort() }` | Represents one context download tracked through Chromium's Browser domain. |
|
|
122
|
+
| `BrowserDownloadProgress` | interface | `{ status, received, total, path? }` | Describes a protocol-neutral download progress update. |
|
|
123
|
+
| `BrowserDownloadStart` | interface | `{ id, url, name, frame }` | Describes a decoded `Browser.downloadWillBegin` event. |
|
|
124
|
+
| `BrowserEmulationManagerInterface` | interface | `{ apply(), clear() }` | Configures context-scoped emulation. |
|
|
125
|
+
| `BrowserFileChooserInterface` | interface | `{ multiple, upload(), dismiss() }` | Represents one intercepted file chooser. |
|
|
126
|
+
| `BrowserFrameInfo` | interface | `{ id, parent, name, url }` | Describes serializable frame metadata decoded from CDP `Page.getFrameTree`. |
|
|
127
|
+
| `BrowserFrameInterface` | interface | `{ id, parent, name, url, title(), read(), evaluate(), handle(), send(), subscribe(), unsubscribe() }` | Provides the operations shared by a top-level page and an iframe document. |
|
|
128
|
+
| `BrowserFunctionCoverage` | interface | `{ name, ranges, block }` | Describes function coverage inside one script. |
|
|
129
|
+
| `BrowserGeolocation` | interface | `{ latitude, longitude, accuracy? }` | Describes a geographic location override. |
|
|
130
|
+
| `BrowserHandleInterface` | interface | `{ id, value(), call(), property(), properties(), destroy() }` | Represents a remote JavaScript object retained in one frame execution context. |
|
|
131
|
+
| `BrowserHAR` | interface | `{ log }` | Describes the standards-shaped HAR 1.2 document produced by the network manager. |
|
|
132
|
+
| `BrowserHARContent` | interface | `{ size, mimeType, text?, encoding? }` | Describes response body metadata in an HTTP archive. |
|
|
133
|
+
| `BrowserHARCookie` | interface | `{ path?, domain?, expires?, httpOnly?, secure? }` | Represents one cookie in an HTTP archive. |
|
|
134
|
+
| `BrowserHARCreator` | interface | `{ name, version }` | Describes the tool identity embedded in an HTTP archive. |
|
|
135
|
+
| `BrowserHAREntry` | interface | `{ startedDateTime, time, request, response, cache, timings }` | Represents one completed HTTP exchange in a HAR recording. |
|
|
136
|
+
| `BrowserHARLog` | interface | `{ version, creator, entries }` | Describes the HAR 1.2 log object. |
|
|
137
|
+
| `BrowserHARManagerInterface` | interface | `{ active, start(), stop(), replay(), clear() }` | Provides HAR recording and replay operations. |
|
|
138
|
+
| `BrowserHARPost` | interface | `{ mimeType, text }` | Describes request body metadata in an HTTP archive. |
|
|
139
|
+
| `BrowserHARRequest` | interface | `{ method, url, httpVersion, cookies, headers, queryString, postData?, headersSize, bodySize }` | Describes a HAR 1.2 request entry. |
|
|
140
|
+
| `BrowserHARResponse` | interface | `{ status, statusText, httpVersion, cookies, headers, content, redirectURL, headersSize, bodySize }` | Describes a HAR 1.2 response entry. |
|
|
141
|
+
| `BrowserHARTimings` | interface | `{ blocked, dns, connect, send, wait, receive, ssl }` | Holds HAR 1.2 phase timings in milliseconds. |
|
|
142
|
+
| `BrowserHARValue` | interface | `{ name, value }` | Represents one name/value pair in an HTTP archive. |
|
|
143
|
+
| `BrowserKey` | interface | `{ key, code, text, number }` | Describes normalized CDP keyboard key data. |
|
|
144
|
+
| `BrowserKeyboardInterface` | interface | `{ down(), up(), press(), type(), insert() }` | Provides keyboard input operations bound to one frame target session. |
|
|
145
|
+
| `BrowserLayout` | interface | `{ bounds, styles, text, paint, offset, scroll, client }` | Describes layout data associated with one captured DOM node. |
|
|
146
|
+
| `BrowserMargin` | interface | `{ top?, right?, bottom?, left? }` | Describes the paper margin lengths accepted by Chromium print-to-PDF. |
|
|
147
|
+
| `BrowserMedia` | interface | `{ output?, scheme?, contrast?, motion?, colors? }` | Describes browser color and media feature overrides. |
|
|
148
|
+
| `BrowserMetric` | interface | `{ name, value }` | Represents one Performance-domain metric. |
|
|
149
|
+
| `BrowserMouseInterface` | interface | `{ move(), down(), up(), click(), drag(), wheel() }` | Provides mouse input operations bound to one frame target session. |
|
|
150
|
+
| `BrowserNavigationManagerInterface` | interface | `{ wait(), idle(), record() }` | Provides URL and network-idle waits associated with one page. |
|
|
151
|
+
| `BrowserNavigationRecordInterface` | interface | `{ wait(), settle(), destroy() }` | Settles the navigation an input into one frame started, from the steps the page accepted after the record opened. |
|
|
152
|
+
| `BrowserNavigationResult` | interface | `{ url, response, same }` | Describes the outcome of a top-level navigation command. |
|
|
153
|
+
| `BrowserNetworkManagerInterface` | interface | `{ clear(), routes, apply(), emitter, har, start(), body(), text(), json(), destroy() }` | Provides page-scoped network observation and interception. |
|
|
154
|
+
| `BrowserPageError` | interface | `{ message, stack, timestamp }` | Represents one uncaught page exception. |
|
|
155
|
+
| `BrowserPageInterface` | interface | `{ elements, trusted, keyboard, mouse, touch, wait(), emitter, registry, network, navigation, popups, scripts, accessibility, diagnostics, clock, opener, target, closed, navigate(), reload(), back(), forward(), screenshot(), pdf(), frame(), frames(), snapshot(), recorder, destroy(), close() }` | Abstracts a single top-level browser page, extending `BrowserFrameInterface` with navigation, screenshots, frame discovery, DOM snapshots, a journey recorder, and target teardown. |
|
|
156
|
+
| `BrowserPassage` | interface | `{ url, title, lines, from, to?, search?, tabs, changed, note? }` | Describes the projection and context of one bounded reading window. |
|
|
157
|
+
| `BrowserPDFResult` | interface | `{ bytes, path }` | Describes the result of printing a page to PDF. |
|
|
158
|
+
| `BrowserPerformanceInterface` | interface | `{ metrics() }` | Reads Performance-domain metrics. |
|
|
159
|
+
| `BrowserPermissionManagerInterface` | interface | `{ grant(), deny(), clear() }` | Provides permission override operations scoped to one browser context. |
|
|
160
|
+
| `BrowserPopupManagerInterface` | interface | `{ record() }` | Opens the records that settle the popups an input into a page opens. |
|
|
161
|
+
| `BrowserPopupRecordInterface` | interface | `{ settle(), destroy() }` | Settles the popups an input opened, from the `Page.windowOpen` reports the page's own session sends after the record opened. |
|
|
162
|
+
| `BrowserProfile` | interface | `{ start, end, nodes, samples, deltas }` | Describes a sampled CPU profile. |
|
|
163
|
+
| `BrowserProfileFrame` | interface | `{ function, script, url, line, column }` | Describes a JavaScript call frame from a CPU profile. |
|
|
164
|
+
| `BrowserProfileNode` | interface | `{ id, frame, hit, children }` | Represents one node in a sampled CPU profile. |
|
|
165
|
+
| `BrowserProfilerInterface` | interface | `{ active, start(), stop(), destroy() }` | Drives the sampled CPU profile lifecycle. |
|
|
166
|
+
| `BrowserProxy` | interface | `{ server, bypass? }` | Describes proxy settings used when creating an isolated browser context. |
|
|
167
|
+
| `BrowserQuad` | interface | `{ points, center }` | Describes a decoded content quad and its actionable center. |
|
|
168
|
+
| `BrowserReceipt` | interface | `{ action, status?, dialog?, view?, trusted? }` | Describes one tool receipt before rendering. |
|
|
169
|
+
| `BrowserRequest` | interface | `{ id, loader, frame, url, method, headers, post, resource, timestamp, walltime, redirect }` | Represents one observed browser request. |
|
|
170
|
+
| `BrowserRequestFailure` | interface | `{ id, error, cancelled, blocked }` | Represents one failed browser request. |
|
|
171
|
+
| `BrowserResponse` | interface | `{ id, loader, frame, url, status, phrase, headers, mime, protocol, address, port, cached, worker, timestamp, timing, security }` | Represents one observed browser response. |
|
|
172
|
+
| `BrowserRouteDefinition` | interface | `{ query, handler }` | Represents one installed network route. |
|
|
173
|
+
| `BrowserRouteInterface` | interface | `{ id, request, handled, abort(), continue(), fulfill() }` | Represents one paused Fetch-domain request. |
|
|
174
|
+
| `BrowserRouteManagerInterface` | interface | `{ add(), remove(), clear() }` | Manages the request handlers installed on a page network. |
|
|
175
|
+
| `BrowserRouteQuery` | interface | `{ url?, method?, resource? }` | Describes route matching criteria. Omitted fields match all values. |
|
|
176
|
+
| `BrowserScreenshotResult` | interface | `{ bytes, path }` | Describes the result of a page screenshot. |
|
|
177
|
+
| `BrowserScriptCoverage` | interface | `{ id, url, functions }` | Describes JavaScript script coverage. |
|
|
178
|
+
| `BrowserScriptManagerInterface` | interface | `{ add(), remove(), expose(), revoke(), destroy() }` | Manages initialization scripts and host bindings for one page. |
|
|
179
|
+
| `BrowserSecurity` | interface | `{ protocol, issuer, from, to }` | Describes the TLS details supplied with a browser response. |
|
|
180
|
+
| `BrowserSettlementResult` | interface | `{ url, stage, reason }` | Describes the navigation a record settled. |
|
|
181
|
+
| `BrowserStackFrame` | interface | `{ url, function, line, column }` | Represents one browser-side stack frame. |
|
|
182
|
+
| `BrowserStorageEntry` | interface | `{ name, value }` | Represents one key/value pair from web storage. |
|
|
183
|
+
| `BrowserStorageManagerInterface` | interface | `{ snapshot(), restore(), clear() }` | Provides storage-state import, export, and clearing operations. |
|
|
184
|
+
| `BrowserStorageOrigin` | interface | `{ origin, local, session }` | Describes an origin-scoped local and session storage snapshot. |
|
|
185
|
+
| `BrowserStorageState` | interface | `{ cookies, origins }` | Describes a portable browser authentication and storage snapshot. |
|
|
186
|
+
| `BrowserStyleCoverage` | interface | `{ id, ranges }` | Describes CSS stylesheet coverage. |
|
|
187
|
+
| `BrowserTab` | interface | `{ id, current }` | Describes one open tab of a toolset's context, which the `read` header lists. |
|
|
188
|
+
| `BrowserTiming` | interface | `{ request, proxy, dns, connect, ssl, send, receive }` | Holds network timing values in milliseconds relative to request time. |
|
|
189
|
+
| `BrowserTimingRange` | interface | `{ start, end }` | Describes the start/end pair for one network timing phase. |
|
|
190
|
+
| `BrowserTouchInterface` | interface | `{ tap() }` | Provides touch input operations bound to one frame target session. |
|
|
191
|
+
| `BrowserTraceInterface` | interface | `{ active, start(), stop(), destroy() }` | Drives the trace capture lifecycle. |
|
|
192
|
+
| `BrowserTraceResult` | interface | `{ bytes, path }` | Describes the result of a trace capture. |
|
|
193
|
+
| `BrowserTransitionInterface` | interface | `{ pending, execute() }` | Represents one asynchronous transition shared by every caller that arrives while it runs. |
|
|
194
|
+
| `BrowserUserAgent` | interface | `{ value, language?, platform? }` | Describes user-agent metadata accepted by Chromium emulation. |
|
|
195
|
+
| `BrowserViewInterface` | interface | `{ url, trusted, elements, emitter?, screenshot?(), title(), read(), wait() }` | Provides the document operations shared by remote and DOM-native views. |
|
|
196
|
+
| `BrowserViewport` | interface | `{ width, height, scale?, mobile?, touch?, landscape? }` | Describes the viewport dimensions for a browser page. |
|
|
197
|
+
| `BrowserWorkerInterface` | interface | `{ id, url, category, evaluate(), send(), destroy(), close() }` | Represents a script worker attached to a page target. |
|
|
198
|
+
| `BrowserWriterInterface` | interface | `{ write() }` | Provides a pluggable sink for persisting captured browser bytes to a path. |
|
|
199
|
+
| `BrowserCallOptions` | interface | `{ timeout?, signal? }` | Describes the options every asynchronous page, frame, handle, and worker call accepts. |
|
|
200
|
+
| `BrowserClickOptions` | interface | `{ button?, count? }` | Describes the options for a trusted mouse click. |
|
|
201
|
+
| `BrowserContextOptions` | interface | `{ id?, viewport?, writer?, reference?, on?, error?, downloads?, emulation? }` | Configures a wrapper around an existing browser context. |
|
|
202
|
+
| `BrowserCoverageOptions` | interface | `{ javascript?, css?, detailed? }` | Describes the options for a coverage capture. |
|
|
203
|
+
| `BrowserDownloadOptions` | interface | `{ path, named? }` | Describes the download policy for a browser context. |
|
|
204
|
+
| `BrowserDragOptions` | interface | `{ button?, steps? }` | Describes the options for a trusted mouse drag. |
|
|
205
|
+
| `BrowserEmulationOptions` | interface | `{ viewport?, user?, locale?, timezone?, geolocation?, media?, offline?, headers?, credentials? }` | Describes network and rendering overrides inherited by context pages. |
|
|
206
|
+
| `BrowserFollowOptions` | interface | `{ caller?, secret? }` | Configures one step a toolset follows. |
|
|
207
|
+
| `BrowserHAROptions` | interface | `{ path?, content? }` | Describes the options for a HAR recording. |
|
|
208
|
+
| `BrowserInputOptions` | interface | `{ delay? }` | Describes the options shared by every trusted input operation. |
|
|
209
|
+
| `BrowserIsolateOptions` | interface | `{ proxy?, origins? }` | Configures a new isolated browser context. |
|
|
210
|
+
| `BrowserNavigationOptions` | interface | `{ condition? }` | Describes the options for page navigation. |
|
|
211
|
+
| `BrowserNetworkOptions` | interface | `{ headers?, offline?, credentials? }` | Configures the supplied network overrides without changing omitted keys. |
|
|
212
|
+
| `BrowserOperationOptions` | type | `BrowserClickOptions & BrowserDragOptions` | Collects every option a trusted-input operation can carry. |
|
|
213
|
+
| `BrowserPageOptions` | interface | `{ on?, error?, url?, viewport?, timeout? }` | Describes the options for creating a page through its context. |
|
|
214
|
+
| `BrowserPDFOptions` | interface | `{ path?, landscape?, background?, scale?, width?, height?, margin?, ranges?, header?, footer?, tagged?, outline? }` | Describes the options for printing a Chromium page to PDF. |
|
|
215
|
+
| `BrowserRouteContinueOptions` | interface | `{ url?, method?, headers?, post? }` | Describes the overrides supplied when continuing an intercepted request. |
|
|
216
|
+
| `BrowserRouteFulfillOptions` | interface | `{ status?, phrase?, headers?, body? }` | Describes the synthetic response supplied when fulfilling an intercepted request. |
|
|
217
|
+
| `BrowserScreenshotOptions` | interface | `{ path?, full?, format?, quality?, clip?, transparent?, animations?, caret?, scale?, mask?, color? }` | Describes the options for taking a page screenshot. |
|
|
218
|
+
| `BrowserSettlementOptions` | interface | `{ destinations? }` | Configures a record's settlement. |
|
|
219
|
+
| `BrowserStorageOptions` | interface | `{ origins? }` | Describes the options for collecting storage state from selected origins. |
|
|
220
|
+
| `BrowserTraceOptions` | interface | `{ path?, categories?, screenshots?, samples? }` | Describes the options for a Chromium trace capture. |
|
|
221
|
+
| `BrowserTraversalOptions` | interface | `{ root? }` | Describes the options for traversing a browser snapshot. |
|
|
222
|
+
| `BrowserWaitOptions` | interface | `{ absent? }` | Configures a text or element wait, including whether absence satisfies it. |
|
|
223
|
+
| `validateBrowserContextOptions` | function | `(options?: BrowserIsolateOptions) => void` | Validates isolated-context options before creating remote state. |
|
|
224
|
+
| `validateBrowserEmulationOptions` | function | `(options: BrowserEmulationOptions) => void` | Validates context emulation boundaries before partial application. |
|
|
225
|
+
| `validateBrowserInputOptions` | function | `(options?: BrowserOperationOptions) => void` | Validates the bounded delay, count, and steps of one trusted-input operation. |
|
|
226
|
+
| `BrowserBindingHandler` | type | `(...args: unknown[]) => unknown \| Promise<unknown>` | Runs a host function exposed into page JavaScript. |
|
|
227
|
+
| `BrowserContextDisposal` | type | `{ readonly confirmed: true; } \| { readonly confirmed: false; readonly error: unknown; }` | Records Chromium's disposal acknowledgement or the failure that left disposal unconfirmed. |
|
|
228
|
+
| `BrowserContextEventMap` | type | `{ readonly page: readonly [page: BrowserPageInterface]; readonly close: readonly []; }` | Maps the browser-context lifecycle events. |
|
|
229
|
+
| `BrowserDestinationRelationship` | type | `'self' \| 'parent' \| 'top'` | Names the frame a submission targets relative to the frame whose document submitted, mirroring the HTML `_self`, `_parent`, and `_top` keywords. |
|
|
230
|
+
| `BrowserDialogCategory` | type | `'alert' \| 'confirm' \| 'prompt' \| 'beforeunload'` | Names a JavaScript dialog category reported by Chromium. |
|
|
231
|
+
| `BrowserDownloadEventMap` | type | `{ readonly progress: readonly [received: number, total: number]; readonly complete: readonly [path: string \| undefined]; readonly abort: readonly []; }` | Maps the download progress events. |
|
|
232
|
+
| `BrowserDownloadStatus` | type | `'pending' \| 'complete' \| 'aborted'` | Names a download lifecycle phase. |
|
|
233
|
+
| `BrowserEpochFunction` | type | `() => number` | Reads the navigation epoch of the frame a reading was captured from. |
|
|
234
|
+
| `BrowserMouseButton` | type | `'left' \| 'middle' \| 'right' \| 'back' \| 'forward'` | Names a mouse button understood by Chromium's Input domain. |
|
|
235
|
+
| `BrowserNavigationCondition` | type | `'commit' \| 'load' \| 'domcontentloaded' \| 'idle'` | Names the page load condition for navigation — the CDP load event awaited by `navigate()`. |
|
|
236
|
+
| `BrowserNavigationEventMap` | type | `{ readonly request: readonly [ frame: string, url: string, loader: string \| undefined, reason: BrowserNavigationReason \| undefined ]; readonly commit: readonly [frame: string, url: string, loader: string \| undefined, same: boolean]; readonly load: readonly [frame: string, loader: string \| undefined]; readonly detach: readonly [frame: string, swapped: boolean]; }` | Maps the navigation steps a page accepts from the session that owns each frame, which it hands to its navigation and element managers. |
|
|
237
|
+
| `BrowserNavigationReason` | type | `'anchorClick' \| 'formSubmissionGet' \| 'formSubmissionPost' \| 'httpHeaderRefresh' \| 'initialFrameNavigation' \| 'metaTagRefresh' \| 'other' \| 'pageBlockInterstitial' \| 'reload' \| 'scriptInitiated'` | Names why a frame requested a navigation, mirroring the CDP `Page.ClientNavigationReason` values that `Page.frameRequestedNavigation` carries as of Chromium 141. |
|
|
238
|
+
| `BrowserNavigationStage` | type | `'requested' \| 'committed' \| 'loaded'` | Names how far a settled navigation got: requested, committed, or loaded. |
|
|
239
|
+
| `BrowserNetworkEventMap` | type | `{ readonly request: readonly [request: BrowserRequest]; readonly response: readonly [response: BrowserResponse]; readonly failure: readonly [failure: BrowserRequestFailure]; readonly finish: readonly [id: string]; readonly socket: readonly [socket: BrowserWebSocketInterface]; }` | Maps the network events a page's network manager emits. |
|
|
240
|
+
| `BrowserPageEventMap` | type | `{ readonly navigate: readonly [url: string, same: boolean]; readonly session: readonly [frame: BrowserFrameInterface]; readonly attach: readonly [frame: BrowserFrameInterface]; readonly detach: readonly [frame: string]; readonly popup: readonly [page: BrowserPageInterface]; readonly dialog: readonly [dialog: BrowserDialogInterface]; readonly chooser: readonly [chooser: BrowserFileChooserInterface]; readonly download: readonly [download: BrowserDownloadInterface]; readonly console: readonly [message: BrowserConsoleMessage]; readonly error: readonly [error: BrowserPageError]; readonly crash: readonly []; readonly worker: readonly [worker: BrowserWorkerInterface]; readonly request: readonly [request: BrowserRequest]; readonly response: readonly [response: BrowserResponse]; readonly failure: readonly [failure: BrowserRequestFailure]; readonly socket: readonly [socket: BrowserWebSocketInterface]; readonly close: readonly []; }` | Maps the typed page, frame, target, and user-visible browser events. |
|
|
241
|
+
| `BrowserPagesFunction` | type | `() => readonly BrowserPageInterface[]` | Returns the context's live pages at call time. |
|
|
242
|
+
| `BrowserRouteHandler` | type | `(route: BrowserRouteInterface) => void \| Promise<void>` | Runs for a matching intercepted request. |
|
|
243
|
+
| `BrowserSameSite` | type | `'Strict' \| 'Lax' \| 'None'` | Names a cookie same-site policy understood by Chromium. |
|
|
244
|
+
| `BrowserScreenshotScale` | type | `'css' \| 'device'` | Names a screenshot coordinate scale. |
|
|
245
|
+
| `BrowserSessionFunction` | type | `(frame: string) => Promise<string>` | Resolves the current CDP session for a frame id. |
|
|
246
|
+
| `BrowserSiblingRelation` | type | `'preceding' \| 'following'` | Names a structural sibling relationship relative to a browser node. |
|
|
247
|
+
| `BrowserStepOutcome` | type | `'done' \| 'refused' \| 'timeout' \| 'interrupted'` | Names how one step ended. |
|
|
248
|
+
| `BrowserTeardownFunction` | type | `() => Promise<unknown>` | Runs one teardown step to settlement while the first failure is retained. |
|
|
249
|
+
| `BrowserTransitionFunction` | type | `() => Promise<T>` | Runs the work one `BrowserTransitionInterface` transition performs. |
|
|
250
|
+
| `BrowserViewEventMap` | type | `{ readonly console: readonly [message: BrowserConsoleMessage]; readonly error: readonly [error: BrowserPageError]; }` | Maps the `console` and `error` events of a view that observes its document's output. |
|
|
251
|
+
| `BrowserWorkerCategory` | type | `'worker' \| 'service_worker' \| 'shared_worker'` | Names a worker target category. |
|
|
252
|
+
| `browserHARHeadersToRecord` | function | `(headers: readonly BrowserHARValue[]) => Readonly<Record<string, string>>` | Converts HAR name/value headers into a Fetch-domain header record. |
|
|
253
|
+
| `buildBrowserHAREntry` | function | `(pending: { readonly request: BrowserRequest; readonly started: number; readonly response: BrowserResponse \| undefined; }, duration: number, body?: Uint8Array, error?: string) => BrowserHAREntry` | Builds a standards-shaped HAR 1.2 entry from one observed exchange. |
|
|
254
|
+
| `computeBrowserButtons` | function | `(buttons: readonly BrowserMouseButton[]) => number` | Computes the CDP Input pressed-button bitmask. |
|
|
255
|
+
| `computeBrowserModifiers` | function | `(modifiers: readonly string[]) => number` | Computes the CDP Input modifier bitmask. |
|
|
256
|
+
| `extractBrowserChord` | function | `(value: string) => BrowserChord` | Extracts a keyboard chord such as `Control+Shift+P` into its parts, throwing a `BrowserError` on an empty chord or an unsupported modifier. |
|
|
257
|
+
| `isBrowserPage` | function | `(value: unknown) => value is BrowserPageInterface` | Checks whether a value exposes the page capabilities used by a browser toolset. |
|
|
258
|
+
| `matchesBrowserCookieURL` | function | `(cookie: BrowserCookie, value: string) => boolean` | Matches a decoded cookie against one request URL. |
|
|
259
|
+
| `matchesBrowserRoute` | function | `(request: BrowserRequest, query: BrowserRouteQuery) => boolean` | Matches a request against route criteria. |
|
|
260
|
+
| `matchesBrowserURL` | function | `(url: string, pattern: string) => boolean` | Matches a URL using Chromium-style `*` and `**` glob segments. |
|
|
261
|
+
| `normalizeBrowserKey` | function | `(value: string) => string` | Normalizes named keys and modifier aliases before trusted keyboard input. |
|
|
262
|
+
| `renderBrowserPassage` | function | `(passage: BrowserPassage, limit: number) => string` | Renders a bounded window with numbered rows and an exact continuation. |
|
|
263
|
+
| `renderBrowserReceipt` | function | `(receipt: BrowserReceipt) => string` | Renders a tool receipt: the action and its status on one line, the interrupting dialog, then a blank line and the fresh view. |
|
|
264
|
+
| `renderBrowserReceiptWindow` | function | `(passage: BrowserPassage, receipt: string, limit: number) => string` | Fits an unnumbered receipt and a complete page window inside one result limit. |
|
|
265
|
+
| `requireBrowserString` | function | `(value: unknown, field: string) => string` | Requires an evaluated browser value to be a string. |
|
|
266
|
+
| `settleBrowserTeardown` | function | `(...steps: readonly BrowserTeardownFunction[]) => Promise<unknown>` | Awaits every teardown step in order and returns the first failure. |
|
|
267
|
+
| `validateBrowserHAR` | function | `(value: unknown) => asserts value is BrowserHAR` | Validates the HAR 1.2 fields required for deterministic replay. |
|
|
268
|
+
| `validateBrowserPageOpen` | function | `(page: BrowserPageInterface, client: CDPClientInterface) => void` | Refuses work on a disconnected or closed page. |
|
|
269
|
+
| `validateBrowserRange` | function | `(value: number, field: string, minimum: number, maximum: number, inclusive?: boolean) => void` | Validates a finite numeric range. |
|
|
270
|
+
| `validateBrowserTimeout` | function | `(timeout: number) => void` | Validates a public browser timeout before protocol work begins. |
|
|
271
|
+
| `validateBrowserViewport` | function | `(viewport: BrowserViewport) => void` | Validates Chromium viewport metrics. |
|
|
272
|
+
| `BROWSER_DEFAULT_TIMEOUT_MS` | const | `30000` | Sets the default timeout for browser connection, requests, and navigation, `30_000` milliseconds. |
|
|
273
|
+
| `BROWSER_DEFAULT_VIEWPORT_HEIGHT` | const | `720` | Sets the default viewport height, `720` pixels. |
|
|
274
|
+
| `BROWSER_DEFAULT_VIEWPORT_WIDTH` | const | `1280` | Sets the default viewport width, `1280` pixels. |
|
|
275
|
+
| `BROWSER_FRAME_WORLD_NAME` | const | `"__orkestrelBrowserFrame"` | Names the isolated world used for iframe evaluation, `'__orkestrelBrowserFrame'`. |
|
|
276
|
+
| `BROWSER_HAR_CREATOR` | const | `Readonly<{ name: "@orkestrel/browser"; version: "0.0.30"; }>` | Names the tool identity embedded in HAR 1.2 documents. |
|
|
277
|
+
| `BROWSER_KEY_MODIFIERS` | const | `Readonly<Record<string, number>>` | Maps a canonical modifier name to its CDP Input modifier bit value. |
|
|
278
|
+
| `BROWSER_MOUSE_BUTTON_MASKS` | const | `Readonly<Record<BrowserMouseButton, number>>` | Maps each public mouse button to its CDP Input pressed-button bit value. |
|
|
279
|
+
| `BROWSER_NAVIGATION_REASONS` | const | `readonly BrowserNavigationReason[]` | Lists every CDP `Page.ClientNavigationReason` value a page accepts as a navigation's reason, as of Chromium 141; a page reads any other reason as undefined. |
|
|
280
|
+
| `BROWSER_RELOAD_NAVIGATION_TYPES` | const | `readonly string[]` | Lists the CDP `Page.frameStartedNavigating` `navigationType` values that repeat or restore a history entry rather than follow a request, as of Chromium 141. |
|
|
281
|
+
| `BROWSER_SCHEMES` | const | `readonly string[]` | Names the URL schemes the `navigate` tool accepts by default: `http:` and `https:`. |
|
|
282
|
+
| `BROWSER_SCREENSHOT_ATTRIBUTE` | const | `"data-orkestrel-screenshot"` | Names the attribute that tags temporary screenshot styles and masks. |
|
|
283
|
+
| `BROWSER_STABLE_FRAME_COUNT` | const | `2` | Sets the number of animation frames whose element bounds must agree before trusted input. |
|
|
284
|
+
| `BROWSER_STOP_LOADING_TIMEOUT_MS` | const | `1000` | Bounds the best-effort `Page.stopLoading` call issued after a failed `navigate()` at `1_000` milliseconds. |
|
|
285
|
+
| `BROWSER_WAIT_EVENTS` | const | `readonly string[]` | Names the finished transitions and animations that wake a parked wait. |
|
|
286
286
|
|
|
287
287
|
##### Page helpers
|
|
288
288
|
|
|
@@ -471,86 +471,86 @@ validateBrowserViewport({ width: 1280, height: 720 })
|
|
|
471
471
|
|
|
472
472
|
#### Elements and readings
|
|
473
473
|
|
|
474
|
-
|
|
|
475
|
-
| ------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
476
|
-
| `BrowserContent` | class | Represents one captured document, parsed one time and projected to Markdown or plain text in bounded slices. |
|
|
477
|
-
| `BrowserSnapshot` | class | Represents a navigable, serializable browser DOM snapshot. |
|
|
478
|
-
| `createBrowserContent` | function | Creates a `BrowserContentInterface` over a captured document, parsing its HTML one time. |
|
|
479
|
-
| `createBrowserSnapshot` | function | Creates a navigable `BrowserSnapshotInterface` over decoded `BrowserSnapshotInput` data. |
|
|
480
|
-
| `BrowserAccessibilityInterface` | interface | Inspects the accessibility tree. |
|
|
481
|
-
| `BrowserAccessibilitySnapshot` | interface | Describes a serializable accessibility-tree snapshot. |
|
|
482
|
-
| `BrowserAXNode` | interface | Represents one decoded Chromium accessibility node. |
|
|
483
|
-
| `BrowserElementGeometry` | interface | Retains both session-local and page-composed element geometry. |
|
|
484
|
-
| `BrowserElementInterface` | interface | Provides actions and reading through a stable document element reference. |
|
|
485
|
-
| `BrowserElementManagerInput` | interface | Provides the protocol and ownership boundaries used by a page element manager. |
|
|
486
|
-
| `BrowserElementManagerInterface` | interface | Captures, queries, and retains references to a view's elements. |
|
|
487
|
-
| `BrowserElementQuery` | interface | Describes an accessibility or CSS query within an optional element reference. |
|
|
488
|
-
| `BrowserElementRefusal` | interface | Describes how an element action reports one refusal its compiled in-page check throws: the reason, and the detail that follows the element's name, or `undefined` for the reason's own wording. |
|
|
489
|
-
| `BrowserElementSubject` | interface | Identifies a manager failure without inventing an element reference. |
|
|
490
|
-
| `BrowserLine` | interface | Carries the ordered spans of one addressed document line. |
|
|
491
|
-
| `BrowserLineSpan` | interface | Distinguishes searchable text from generated syntax and actionable references. |
|
|
492
|
-
| `BrowserNode` | interface | Represents one serializable DOM node decoded from a CDP DOM snapshot. |
|
|
493
|
-
| `BrowserNodeQuery` | interface | Describes a declarative browser-node matcher used by `matchesBrowserNode`. |
|
|
494
|
-
| `BrowserOutline` | interface | Carries document-order lines, element counts, and the focused element's row. |
|
|
495
|
-
| `BrowserOutlineNode` | interface | Associates an outline row with its frame, session, and optional actionable reference. |
|
|
496
|
-
| `BrowserPageElementInterface` | interface | Provides trusted page input and capture for a referenced element. |
|
|
497
|
-
| `BrowserPoint` | interface | Describes a point in viewport CSS pixels. |
|
|
498
|
-
| `BrowserContentInput` | interface | Describes the captured document a reading is built from. |
|
|
499
|
-
| `BrowserContentInterface` | interface | Represents one captured document, parsed one time and projected to Markdown or plain text in bounded slices. |
|
|
500
|
-
| `BrowserReadResult` | interface | Describes one slice of a reading's projection. |
|
|
501
|
-
| `BrowserSearch` | interface | Carries the opening line and optional search text of an addressed window. |
|
|
502
|
-
| `BrowserSnapshotInput` | interface | Describes the serializable input for a navigable browser snapshot — the form a `BrowserSnapshot` is built from and serializes back to. |
|
|
503
|
-
| `BrowserSnapshotInterface` | interface | Represents a navigable, serializable snapshot of every document attached to a page, extending `BrowserSnapshotInput` with walking, structural relationships, search, and path derivation over plain `BrowserNode` values. |
|
|
504
|
-
| `BrowserAccessibilityOptions` | interface | Describes the options for an accessibility snapshot. |
|
|
505
|
-
| `BrowserOutlineOptions` | interface | Configures an outline's element limit and optional subtree. |
|
|
506
|
-
| `BrowserReadOptions` | interface | Describes the options for one slice of a reading's Markdown or plain-text projection. |
|
|
507
|
-
| `BrowserSnapshotOptions` | interface | Describes the options configuring capture through `BrowserPageInterface` `snapshot()`. The snapshot entity's creation input is `BrowserSnapshotInput`. |
|
|
508
|
-
| `validateBrowserAccessibilityOptions` | function | Validates Accessibility-domain snapshot bounds. |
|
|
509
|
-
| `BrowserElementReason` | type | Identifies the refusal an element action reports. |
|
|
510
|
-
| `BrowserElementWorldFunction` | type | Resolves the page-owned isolated world for a particular frame and session. |
|
|
511
|
-
| `BrowserNodePredicate` | type | Names the predicate form accepted by `BrowserSnapshotInterface` find, filter, and closest methods. |
|
|
512
|
-
| `BrowserReadinessFunction` | type | Waits for the current document's DOM readiness. |
|
|
513
|
-
| `BrowserRect` | type | Represents a rectangle in CSS pixels: x, y, width, height. |
|
|
514
|
-
| `BrowserReferenceFunction` | type | Allocates the next reference from the owning browser context. |
|
|
515
|
-
| `abbreviateBrowserText` | function | Abbreviates displayed metadata without splitting a Unicode code point. |
|
|
516
|
-
| `belongsBrowserOutline` | function | Checks whether a node descends from another within one session's captured tree. |
|
|
517
|
-
| `boundBrowserText` | function | Bounds a tool string at a character limit, appending a footer that names the cut and the caller's closing clause. |
|
|
518
|
-
| `collectBrowserWords` | function | Collects distinct lowercase words of at least 3 letters or digits. |
|
|
519
|
-
| `composeBrowserPoint` | function | Composes a frame-local point with its ancestor frame offsets. |
|
|
520
|
-
| `extractBrowserSlice` | function | Extracts one bounded slice of a projected text, cutting after a line break where one fits. |
|
|
521
|
-
| `filterBrowserOutline` | function | Filters document-order outline rows by accessibility role and name. |
|
|
522
|
-
| `findBrowserText` | function | Finds the first line contributing a whitespace-normalized match across consecutive text spans. |
|
|
523
|
-
| `isBrowserNodeQuery` | function | Tests whether a browser-node matcher is a declarative query rather than a predicate. |
|
|
524
|
-
| `isBrowserNodeVisible` | function | Tests whether a captured node has a non-empty rendered layout box. |
|
|
525
|
-
| `matchesBrowserNode` | function | Tests a captured node against a declarative query. |
|
|
526
|
-
| `normalizeBrowserName` | function | Normalizes an accessible name for display and matching. |
|
|
527
|
-
| `renderBrowserElement` | function | Renders an element as its outline row reads: role, quoted name, and reference. |
|
|
528
|
-
| `renderBrowserFooter` | function | Renders an exact addressed-range footer, including the next line when content remains. |
|
|
529
|
-
| `renderBrowserLine` | function | Joins a projected line's spans without adding an address. |
|
|
530
|
-
| `renderBrowserOutline` | function | Renders document-order accessibility lines with a bounded element count. |
|
|
531
|
-
| `renderBrowserOutlineRow` | function | Renders one outline row: the node's role, quoted accessible name, reference, and states. |
|
|
532
|
-
| `renderBrowserSearch` | function | Renders shared search text and chooses its context line within the requested range. |
|
|
533
|
-
| `renderBrowserSpans` | function | Renders an element as searchable text separated from references and syntax. |
|
|
534
|
-
| `renderBrowserWindow` | function | Selects whole addressed rows after reserving the header and exact footer. |
|
|
535
|
-
| `requireBrowserReference` | function | Requires a tool argument to be an element reference in any spelling `parseBrowserReference` accepts, and returns its canonical form. |
|
|
536
|
-
| `scanBrowserLines` | function | Finds the highest-scoring text lines within an inclusive range using whole words and prefixes. |
|
|
537
|
-
| `validateBrowserLines` | function | Refuses invalid line coordinates before selecting content. |
|
|
538
|
-
| `validateBrowserPoint` | function | Validates viewport input coordinates. |
|
|
539
|
-
| `wrapBrowserLine` | function | Wraps spans before numbering, marking hard continuations with a leading ↳. |
|
|
540
|
-
| `BROWSER_ELEMENT_REFUSALS` | const | Maps the first line of each refusal the compiled element functions throw, without its `Error:` prefix, to the reason and the one-line detail an element action reports it with. |
|
|
541
|
-
| `BROWSER_INTERACTIVE_ROLES` | const | Names accessibility roles that receive actionable outline references. |
|
|
542
|
-
| `BROWSER_OUTLINE_LIMIT` | const | Bounds the default number of actionable elements in an outline. |
|
|
543
|
-
| `BROWSER_OUTLINE_OMITTED_ROLES` | const | Names accessibility roles whose own rows add no outline content. |
|
|
544
|
-
| `BROWSER_READ_CHANGED_NOTE` | const | Reports changed line numbers without restarting a continuation. |
|
|
545
|
-
| `BROWSER_READ_CONTEXT` | const | Opens a search window one line before its first match. |
|
|
546
|
-
| `BROWSER_READ_LINES` | const | Caps a default reading window at 100 addressed lines. |
|
|
547
|
-
| `BROWSER_READ_MATCHES` | const | Caps the displayed search hit list at 50 line numbers. |
|
|
548
|
-
| `BROWSER_READ_WIDTH` | const | Wraps projection rows at 800 UTF-16 units, leaving room for receipt metadata. |
|
|
549
|
-
| `BROWSER_REFERENCE_PREFIX` | const | Prefixes stable element references within a browser context. |
|
|
550
|
-
| `BROWSER_SEARCH_PATTERN` | const | Matches one word of an outline search and of a row's role and name: a run of at least 3 letters or digits. |
|
|
551
|
-
| `BROWSER_SNAPSHOT_NODE_LIMIT` | const | Sets the default maximum node count accepted from a decoded CDP DOM snapshot, `100_000`. |
|
|
552
|
-
| `BROWSER_TEXT_ROLES` | const | Names accessibility roles rendered as text without an actionable reference. |
|
|
553
|
-
| `BROWSER_TYPED_ROLES` | const | Names the accessibility roles the `type` tool writes to: `textbox`, `searchbox`, and `spinbutton` take typed text, and `combobox` and `listbox` take a select control's option or, for a text input with suggestions, typed text. |
|
|
474
|
+
| Name | Kind | Signature | Summary |
|
|
475
|
+
| ------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
476
|
+
| `BrowserContent` | class | `new (input: BrowserContentInput) => BrowserContentInterface` | Represents one captured document, parsed one time and projected to Markdown or plain text in bounded slices. |
|
|
477
|
+
| `BrowserSnapshot` | class | `new (input: BrowserSnapshotInput) => BrowserSnapshotInterface` | Represents a navigable, serializable browser DOM snapshot. |
|
|
478
|
+
| `createBrowserContent` | function | `(input: BrowserContentInput) => BrowserContentInterface` | Creates a `BrowserContentInterface` over a captured document, parsing its HTML one time. |
|
|
479
|
+
| `createBrowserSnapshot` | function | `(input: BrowserSnapshotInput) => BrowserSnapshotInterface` | Creates a navigable `BrowserSnapshotInterface` over decoded `BrowserSnapshotInput` data. |
|
|
480
|
+
| `BrowserAccessibilityInterface` | interface | `{ snapshot() }` | Inspects the accessibility tree. |
|
|
481
|
+
| `BrowserAccessibilitySnapshot` | interface | `{ roots, nodes }` | Describes a serializable accessibility-tree snapshot. |
|
|
482
|
+
| `BrowserAXNode` | interface | `{ id, parent, children, backend, frame, ignored, role, name, description, value, properties }` | Represents one decoded Chromium accessibility node. |
|
|
483
|
+
| `BrowserElementGeometry` | interface | `{ local, page }` | Retains both session-local and page-composed element geometry. |
|
|
484
|
+
| `BrowserElementInterface` | interface | `{ reference, role, name, click(), fill(), select(), focus(), read(), submit() }` | Provides actions and reading through a stable document element reference. |
|
|
485
|
+
| `BrowserElementManagerInput` | interface | `{ navigation, steps, page, client, session, resolve, world, reference, ready, recover }` | Provides the protocol and ownership boundaries used by a page element manager. |
|
|
486
|
+
| `BrowserElementManagerInterface` | interface | `{ outline(), find(), wait(), element(), elements(), clear() }` | Captures, queries, and retains references to a view's elements. |
|
|
487
|
+
| `BrowserElementQuery` | interface | `{ role?, name?, css?, within?, exact? }` | Describes an accessibility or CSS query within an optional element reference. |
|
|
488
|
+
| `BrowserElementRefusal` | interface | `{ reason, detail }` | Describes how an element action reports one refusal its compiled in-page check throws: the reason, and the detail that follows the element's name, or `undefined` for the reason's own wording. |
|
|
489
|
+
| `BrowserElementSubject` | interface | `{ subject }` | Identifies a manager failure without inventing an element reference. |
|
|
490
|
+
| `BrowserLine` | interface | `{ spans }` | Carries the ordered spans of one addressed document line. |
|
|
491
|
+
| `BrowserLineSpan` | interface | `{ category, text }` | Distinguishes searchable text from generated syntax and actionable references. |
|
|
492
|
+
| `BrowserNode` | interface | `{ document, frame, index, id, parent, category, name, value, attributes, text, input, checked, selected, clickable, shadow, content, pseudo, source, origin, layout }` | Represents one serializable DOM node decoded from a CDP DOM snapshot. |
|
|
493
|
+
| `BrowserNodeQuery` | interface | `{ name?, text?, attributes?, frame?, visible?, clickable? }` | Describes a declarative browser-node matcher used by `matchesBrowserNode`. |
|
|
494
|
+
| `BrowserOutline` | interface | `{ url, title, lines, listed, found, focus }` | Carries document-order lines, element counts, and the focused element's row. |
|
|
495
|
+
| `BrowserOutlineNode` | interface | `{ session, reference, tool? }` | Associates an outline row with its frame, session, and optional actionable reference. |
|
|
496
|
+
| `BrowserPageElementInterface` | interface | `{ frame, hover(), press(), upload(), drag(), quad(), screenshot() }` | Provides trusted page input and capture for a referenced element. |
|
|
497
|
+
| `BrowserPoint` | interface | `{ x, y }` | Describes a point in viewport CSS pixels. |
|
|
498
|
+
| `BrowserContentInput` | interface | `{ url, title, html, epoch?, navigation? }` | Describes the captured document a reading is built from. |
|
|
499
|
+
| `BrowserContentInterface` | interface | `{ url, title, html, stale, markdown(), text() }` | Represents one captured document, parsed one time and projected to Markdown or plain text in bounded slices. |
|
|
500
|
+
| `BrowserReadResult` | interface | `{ text, offset, total }` | Describes one slice of a reading's projection. |
|
|
501
|
+
| `BrowserSearch` | interface | `{ from, text? }` | Carries the opening line and optional search text of an addressed window. |
|
|
502
|
+
| `BrowserSnapshotInput` | interface | `{ documents, styles }` | Describes the serializable input for a navigable browser snapshot — the form a `BrowserSnapshot` is built from and serializes back to. |
|
|
503
|
+
| `BrowserSnapshotInterface` | interface | `{ depth(), breadth(), descendants(), document(), children(), parent(), siblings(), ancestors(), common(), distance(), find(), filter(), closest(), path() }` | Represents a navigable, serializable snapshot of every document attached to a page, extending `BrowserSnapshotInput` with walking, structural relationships, search, and path derivation over plain `BrowserNode` values. |
|
|
504
|
+
| `BrowserAccessibilityOptions` | interface | `{ root?, depth? }` | Describes the options for an accessibility snapshot. |
|
|
505
|
+
| `BrowserOutlineOptions` | interface | `{ limit?, within?, secrets? }` | Configures an outline's element limit and optional subtree. |
|
|
506
|
+
| `BrowserReadOptions` | interface | `{ distill?, offset?, limit? }` | Describes the options for one slice of a reading's Markdown or plain-text projection. |
|
|
507
|
+
| `BrowserSnapshotOptions` | interface | `{ styles?, paint?, rects?, limit? }` | Describes the options configuring capture through `BrowserPageInterface` `snapshot()`. The snapshot entity's creation input is `BrowserSnapshotInput`. |
|
|
508
|
+
| `validateBrowserAccessibilityOptions` | function | `(options?: BrowserAccessibilityOptions) => void` | Validates Accessibility-domain snapshot bounds. |
|
|
509
|
+
| `BrowserElementReason` | type | `'GONE' \| 'HIDDEN' \| 'OCCLUDED' \| 'DISABLED' \| 'UNTRUSTED' \| 'UNKNOWN'` | Identifies the refusal an element action reports. |
|
|
510
|
+
| `BrowserElementWorldFunction` | type | `(frame: string, session: string, options?: BrowserCallOptions) => Promise<number>` | Resolves the page-owned isolated world for a particular frame and session. |
|
|
511
|
+
| `BrowserNodePredicate` | type | `(node: BrowserNode) => boolean` | Names the predicate form accepted by `BrowserSnapshotInterface` find, filter, and closest methods. |
|
|
512
|
+
| `BrowserReadinessFunction` | type | `(options?: BrowserCallOptions) => Promise<void>` | Waits for the current document's DOM readiness. |
|
|
513
|
+
| `BrowserRect` | type | `readonly [x: number, y: number, width: number, height: number]` | Represents a rectangle in CSS pixels: x, y, width, height. |
|
|
514
|
+
| `BrowserReferenceFunction` | type | `() => string` | Allocates the next reference from the owning browser context. |
|
|
515
|
+
| `abbreviateBrowserText` | function | `(text: string, limit: number) => string` | Abbreviates displayed metadata without splitting a Unicode code point. |
|
|
516
|
+
| `belongsBrowserOutline` | function | `(node: BrowserOutlineNode, ancestor: BrowserOutlineNode, indexed: ReadonlyMap<string, BrowserOutlineNode>) => boolean` | Checks whether a node descends from another within one session's captured tree. |
|
|
517
|
+
| `boundBrowserText` | function | `(text: string, limit: number, footer: string) => string` | Bounds a tool string at a character limit, appending a footer that names the cut and the caller's closing clause. |
|
|
518
|
+
| `collectBrowserWords` | function | `(text: string) => ReadonlySet<string>` | Collects distinct lowercase words of at least 3 letters or digits. |
|
|
519
|
+
| `composeBrowserPoint` | function | `(point: BrowserPoint, offsets: readonly BrowserPoint[]) => BrowserPoint` | Composes a frame-local point with its ancestor frame offsets. |
|
|
520
|
+
| `extractBrowserSlice` | function | `(text: string, offset?: number, limit?: number) => BrowserReadResult` | Extracts one bounded slice of a projected text, cutting after a line break where one fits. |
|
|
521
|
+
| `filterBrowserOutline` | function | `(nodes: readonly BrowserOutlineNode[], query: BrowserElementQuery) => readonly BrowserOutlineNode[]` | Filters document-order outline rows by accessibility role and name. |
|
|
522
|
+
| `findBrowserText` | function | `(lines: readonly BrowserLine[], text: string) => number` | Finds the first line contributing a whitespace-normalized match across consecutive text spans. |
|
|
523
|
+
| `isBrowserNodeQuery` | function | `(value: BrowserNodeQuery \| BrowserNodePredicate) => value is BrowserNodeQuery` | Tests whether a browser-node matcher is a declarative query rather than a predicate. |
|
|
524
|
+
| `isBrowserNodeVisible` | function | `(node: BrowserNode) => boolean` | Tests whether a captured node has a non-empty rendered layout box. |
|
|
525
|
+
| `matchesBrowserNode` | function | `(node: BrowserNode, query: BrowserNodeQuery) => boolean` | Tests a captured node against a declarative query. |
|
|
526
|
+
| `normalizeBrowserName` | function | `(value: string) => string` | Normalizes an accessible name for display and matching. |
|
|
527
|
+
| `renderBrowserElement` | function | `(element: BrowserElementInterface) => string` | Renders an element as its outline row reads: role, quoted name, and reference. |
|
|
528
|
+
| `renderBrowserFooter` | function | `(from: number, to: number, total: number, tool?: string) => string` | Renders an exact addressed-range footer, including the next line when content remains. |
|
|
529
|
+
| `renderBrowserLine` | function | `(line: BrowserLine) => string` | Joins a projected line's spans without adding an address. |
|
|
530
|
+
| `renderBrowserOutline` | function | `(url: string, title: string, source: readonly BrowserOutlineNode[], limit: number, secrets?: readonly string[]) => BrowserOutline` | Renders document-order accessibility lines with a bounded element count. |
|
|
531
|
+
| `renderBrowserOutlineRow` | function | `(node: BrowserOutlineNode) => string` | Renders one outline row: the node's role, quoted accessible name, reference, and states. |
|
|
532
|
+
| `renderBrowserSearch` | function | `(lines: readonly BrowserLine[], from: number, to?: number, search?: string) => BrowserSearch` | Renders shared search text and chooses its context line within the requested range. |
|
|
533
|
+
| `renderBrowserSpans` | function | `(node: BrowserOutlineNode, url: string) => readonly BrowserLineSpan[]` | Renders an element as searchable text separated from references and syntax. |
|
|
534
|
+
| `renderBrowserWindow` | function | `(lines: readonly BrowserLine[], from: number, to: number \| undefined, header: string, limit: number, tool?: string, partial?: boolean) => string` | Selects whole addressed rows after reserving the header and exact footer. |
|
|
535
|
+
| `requireBrowserReference` | function | `(value: unknown) => string` | Requires a tool argument to be an element reference in any spelling `parseBrowserReference` accepts, and returns its canonical form. |
|
|
536
|
+
| `scanBrowserLines` | function | `(lines: readonly BrowserLine[], search: string, from?: number, to?: number) => readonly number[]` | Finds the highest-scoring text lines within an inclusive range using whole words and prefixes. |
|
|
537
|
+
| `validateBrowserLines` | function | `(from: number, to?: number, total?: number) => void` | Refuses invalid line coordinates before selecting content. |
|
|
538
|
+
| `validateBrowserPoint` | function | `(point: BrowserPoint) => void` | Validates viewport input coordinates. |
|
|
539
|
+
| `wrapBrowserLine` | function | `(line: BrowserLine) => readonly BrowserLine[]` | Wraps spans before numbering, marking hard continuations with a leading ↳. |
|
|
540
|
+
| `BROWSER_ELEMENT_REFUSALS` | const | `ReadonlyMap<string, BrowserElementRefusal>` | Maps the first line of each refusal the compiled element functions throw, without its `Error:` prefix, to the reason and the one-line detail an element action reports it with. |
|
|
541
|
+
| `BROWSER_INTERACTIVE_ROLES` | const | `ReadonlySet<string>` | Names accessibility roles that receive actionable outline references. |
|
|
542
|
+
| `BROWSER_OUTLINE_LIMIT` | const | `150` | Bounds the default number of actionable elements in an outline. |
|
|
543
|
+
| `BROWSER_OUTLINE_OMITTED_ROLES` | const | `ReadonlySet<string>` | Names accessibility roles whose own rows add no outline content. |
|
|
544
|
+
| `BROWSER_READ_CHANGED_NOTE` | const | `"The page changed since the last view; line numbers might differ."` | Reports changed line numbers without restarting a continuation. |
|
|
545
|
+
| `BROWSER_READ_CONTEXT` | const | `1` | Opens a search window one line before its first match. |
|
|
546
|
+
| `BROWSER_READ_LINES` | const | `100` | Caps a default reading window at 100 addressed lines. |
|
|
547
|
+
| `BROWSER_READ_MATCHES` | const | `50` | Caps the displayed search hit list at 50 line numbers. |
|
|
548
|
+
| `BROWSER_READ_WIDTH` | const | `800` | Wraps projection rows at 800 UTF-16 units, leaving room for receipt metadata. |
|
|
549
|
+
| `BROWSER_REFERENCE_PREFIX` | const | `"e"` | Prefixes stable element references within a browser context. |
|
|
550
|
+
| `BROWSER_SEARCH_PATTERN` | const | `RegExp` | Matches one word of an outline search and of a row's role and name: a run of at least 3 letters or digits. |
|
|
551
|
+
| `BROWSER_SNAPSHOT_NODE_LIMIT` | const | `100000` | Sets the default maximum node count accepted from a decoded CDP DOM snapshot, `100_000`. |
|
|
552
|
+
| `BROWSER_TEXT_ROLES` | const | `ReadonlySet<string>` | Names accessibility roles rendered as text without an actionable reference. |
|
|
553
|
+
| `BROWSER_TYPED_ROLES` | const | `ReadonlySet<string>` | Names the accessibility roles the `type` tool writes to: `textbox`, `searchbox`, and `spinbutton` take typed text, and `combobox` and `listbox` take a select control's option or, for a text input with suggestions, typed text. |
|
|
554
554
|
|
|
555
555
|
##### Render numbered lines
|
|
556
556
|
|
|
@@ -680,53 +680,53 @@ compileSubmitReleaseExpression(1)
|
|
|
680
680
|
|
|
681
681
|
#### Toolset
|
|
682
682
|
|
|
683
|
-
|
|
|
684
|
-
| -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
685
|
-
| `BrowserToolset` | class | Publishes the browser vocabulary as `@orkestrel/tool` tools over one view and adopts the view's own tools beside them. |
|
|
686
|
-
| `createBrowserToolset` | function | Creates a toolset over a caller-owned view, enabling page tools when the view is a page. |
|
|
687
|
-
| `BrowserAction` | interface | Describes what became of one action the toolset performed. |
|
|
688
|
-
| `BrowserHoldInterface` | interface | Owns the toolset while a replay runs; `destroy` releases it. |
|
|
689
|
-
| `BrowserInvocation` | interface | Describes a WebMCP invocation observed on the protocol. |
|
|
690
|
-
| `BrowserInvocationResult` | interface | Carries a terminal WebMCP status and its untrusted output or error. |
|
|
691
|
-
| `BrowserRegistryInterface` | interface | Mirrors the experimental WebMCP protocol domain for a page. |
|
|
692
|
-
| `BrowserTool` | interface | Describes a registered WebMCP tool and its owning document. |
|
|
693
|
-
| `BrowserToolAnnotation` | interface | Transliterates the WebMCP protocol's `Annotation` type, retaining its wire spelling. |
|
|
694
|
-
| `BrowserToolRemoval` | interface | Identifies a removed WebMCP tool by document and name. |
|
|
695
|
-
| `BrowserToolsetInterface` | interface | Publishes the browser vocabulary as tools over one current view and adopts the page's own tools beside them. |
|
|
696
|
-
| `BrowserToolsetResult` | interface | Carries a performed call's tool result beside its structured action, present when the call reached a handler, and the value a failed handler threw. |
|
|
697
|
-
| `BrowserToolSourceInterface` | interface | Supplies page-registered tools to a toolset through a contract free of protocol types. |
|
|
698
|
-
| `BrowserActionabilityOptions` | interface | Describes the actionability checks performed before element input. |
|
|
699
|
-
| `BrowserRegistryOptions` | interface | Configures registry listeners and listener-error handling. |
|
|
700
|
-
| `BrowserToolsetOptions` | interface | Configures a browser toolset. |
|
|
701
|
-
| `BrowserToolsetReadOptions` | interface | Configures a fresh line window within a whole-result character limit. |
|
|
702
|
-
| `BrowserRegistryEventMap` | type | Maps registry changes and observed WebMCP invocation events. |
|
|
703
|
-
| `BrowserToolName` | type | Names a tool the browser toolset reserves: the generic tools, the staged `dialog`, the opt-in `switch`, and the journey tools `record`, `save`, `journeys`, `edit`, `replay`, `forget`, and `capture`, which a toolset constructed with `journeys` reserves. |
|
|
704
|
-
| `BrowserToolsetEventMap` | type | Maps the events a toolset emits. |
|
|
705
|
-
| `BrowserToolsetReason` | type | Names why a toolset declined a page tool. |
|
|
706
|
-
| `BrowserToolSourceEventMap` | type | Maps the signal a tool source emits when its page's tools change. |
|
|
707
|
-
| `deriveBrowserToolSchema` | function | Derives the advertised input schema from an authored one, adding a required `purpose` parameter when the schema requires nothing. |
|
|
708
|
-
| `redactBrowserText` | function | Redacts registered secrets before projection wrapping or output clipping. |
|
|
709
|
-
| `renderBrowserToolOutput` | function | Renders tool strings unchanged, content-array text blocks joined, and other values as bounded JSON. |
|
|
710
|
-
| `validateBrowserToolArguments` | function | Refuses a tool call that carries a parameter its definition does not advertise, naming the parameters the tool takes. |
|
|
711
|
-
| `BROWSER_ACTION_OUTCOMES` | const | Lists every outcome a `BrowserAction` and a run step carry: `done`, `refused`, `timeout`, and `interrupted`. |
|
|
712
|
-
| `BROWSER_ACTION_STAGES` | const | Lists every navigation stage a `BrowserAction` and a run step carry: `requested`, `committed`, and `loaded`. |
|
|
713
|
-
| `BROWSER_OBSERVATION_TOOL_NAMES` | const | Names the tools that observe the view without recording an action. |
|
|
714
|
-
| `BROWSER_REGISTRY_ABSENT_CODE` | const | Identifies the CDP method-not-found response when WebMCP is absent. |
|
|
715
|
-
| `BROWSER_REGISTRY_OUTPUT_LIMIT` | const | Bounds adopted tool JSON output and error messages to 4096 UTF-16 code units. |
|
|
716
|
-
| `BROWSER_SUBMIT_KEY` | const | Names the isolated-world property that holds the `submit` observer an action installs before its input, `'__orkestrelSubmit'`. |
|
|
717
|
-
| `BROWSER_TOOL_CAPTURE_MS` | const | Reserves `1_000` milliseconds of an action receipt's `BROWSER_TOOL_TIMEOUT_MS` deadline for the view capture, so a receipt whose navigation wait reaches its bound still carries the view. |
|
|
718
|
-
| `BROWSER_TOOL_CHANGED_NOTE` | const | Holds the note an action receipt carries in place of the view when the page changed under the capture twice: once after the action, and again during the one retry that follows the page's readiness. |
|
|
719
|
-
| `BROWSER_TOOL_COPY` | const | Holds the advertised definition of each reserved tool: its description, its JSON Schema parameters, and its annotations. |
|
|
720
|
-
| `BROWSER_TOOL_CUT_FOOTER` | const | Holds the clause that ends a cut result without an addressed page window. |
|
|
721
|
-
| `BROWSER_TOOL_DEADLINE_NOTE` | const | Holds the note an action receipt carries in place of the view when the receipt's deadline passed before the view could be captured. |
|
|
722
|
-
| `BROWSER_TOOL_HANDLED_STATUS` | const | Holds the status of a handled submission whose settle observed a change. |
|
|
723
|
-
| `BROWSER_TOOL_LIMIT` | const | Bounds each tool result and error message at `4_000` UTF-16 code units including its footer. |
|
|
724
|
-
| `BROWSER_TOOL_NAME_PATTERN` | const | Matches a page tool name the toolset can advertise: 1 to 64 ASCII letters, digits, underscores, and hyphens. |
|
|
725
|
-
| `BROWSER_TOOL_NAMES` | const | Names the eight page tools: `read`, `click`, `type`, `press`, `navigate`, `wait`, `dialog`, and `switch`. |
|
|
726
|
-
| `BROWSER_TOOL_PENDING_NOTE` | const | Holds the refusal for a hold requested while an earlier input remains pending. |
|
|
727
|
-
| `BROWSER_TOOL_TIMEOUT_LIMIT_MS` | const | Caps the `wait` tool's `timeout` parameter at `30_000` milliseconds. |
|
|
728
|
-
| `BROWSER_TOOL_TIMEOUT_MS` | const | Sets the `wait` tool's default and an action receipt's bound on a requested navigation, `5_000` milliseconds. |
|
|
729
|
-
| `BROWSER_TOOL_UNCHANGED_STATUS` | const | Holds the status of a handled submission with no rendered change before the deadline. |
|
|
683
|
+
| Name | Kind | Signature | Summary |
|
|
684
|
+
| -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
685
|
+
| `BrowserToolset` | class | `new (view: BrowserViewInterface, options?: BrowserToolsetOptions) => BrowserToolsetInterface` | Publishes the browser vocabulary as `@orkestrel/tool` tools over one view and adopts the view's own tools beside them. |
|
|
686
|
+
| `createBrowserToolset` | function | `(view: BrowserViewInterface, options?: BrowserToolsetOptions) => BrowserToolsetInterface` | Creates a toolset over a caller-owned view, enabling page tools when the view is a page. |
|
|
687
|
+
| `BrowserAction` | interface | `{ action, start?, arguments, target?, tab?, secret?, outcome, stage?, reason?, receipt, elapsed }` | Describes what became of one action the toolset performed. |
|
|
688
|
+
| `BrowserHoldInterface` | interface | `{ token, name, destroy() }` | Owns the toolset while a replay runs; `destroy` releases it. |
|
|
689
|
+
| `BrowserInvocation` | interface | `{ id, tool, frame, input }` | Describes a WebMCP invocation observed on the protocol. |
|
|
690
|
+
| `BrowserInvocationResult` | interface | `{ id, status, output, error }` | Carries a terminal WebMCP status and its untrusted output or error. |
|
|
691
|
+
| `BrowserRegistryInterface` | interface | `{ emitter, start(), tool(), tools(), adopt(), execute(), destroy() }` | Mirrors the experimental WebMCP protocol domain for a page. |
|
|
692
|
+
| `BrowserTool` | interface | `{ name, description, schema, annotation, frame, node }` | Describes a registered WebMCP tool and its owning document. |
|
|
693
|
+
| `BrowserToolAnnotation` | interface | `{ readOnly?, untrustedContent?, consequential?, debugging?, autosubmit? }` | Transliterates the WebMCP protocol's `Annotation` type, retaining its wire spelling. |
|
|
694
|
+
| `BrowserToolRemoval` | interface | `{ frame, name }` | Identifies a removed WebMCP tool by document and name. |
|
|
695
|
+
| `BrowserToolsetInterface` | interface | `{ describe(), redact(), read(), emitter, tools, native, view, limit, held, execute(), follow(), tabs(), hold(), start(), destroy() }` | Publishes the browser vocabulary as tools over one current view and adopts the page's own tools beside them. |
|
|
696
|
+
| `BrowserToolsetResult` | interface | `{ result, action?, fault? }` | Carries a performed call's tool result beside its structured action, present when the call reached a handler, and the value a failed handler threw. |
|
|
697
|
+
| `BrowserToolSourceInterface` | interface | `{ emitter, adopt(), tools?() }` | Supplies page-registered tools to a toolset through a contract free of protocol types. |
|
|
698
|
+
| `BrowserActionabilityOptions` | interface | `{ visible?, stable?, events?, enabled?, editable?, position? }` | Describes the actionability checks performed before element input. |
|
|
699
|
+
| `BrowserRegistryOptions` | interface | `{ on?, error? }` | Configures registry listeners and listener-error handling. |
|
|
700
|
+
| `BrowserToolsetOptions` | interface | `{ notes?, on?, error?, tools?, source?, context?, limit?, schemes?, journeys? }` | Configures a browser toolset. |
|
|
701
|
+
| `BrowserToolsetReadOptions` | interface | `{ from?, to?, search?, limit? }` | Configures a fresh line window within a whole-result character limit. |
|
|
702
|
+
| `BrowserRegistryEventMap` | type | `{ readonly change: readonly []; readonly invoke: readonly [invocation: BrowserInvocation]; readonly respond: readonly [result: BrowserInvocationResult]; }` | Maps registry changes and observed WebMCP invocation events. |
|
|
703
|
+
| `BrowserToolName` | type | `'read' \| 'click' \| 'type' \| 'press' \| 'navigate' \| 'wait' \| 'dialog' \| 'switch' \| 'record' \| 'save' \| 'journeys' \| 'edit' \| 'replay' \| 'forget' \| 'capture'` | Names a tool the browser toolset reserves: the generic tools, the staged `dialog`, the opt-in `switch`, and the journey tools `record`, `save`, `journeys`, `edit`, `replay`, `forget`, and `capture`, which a toolset constructed with `journeys` reserves. |
|
|
704
|
+
| `BrowserToolsetEventMap` | type | `{ readonly adopt: readonly [tool: ToolInterface]; readonly skip: readonly [name: string, reason: BrowserToolsetReason]; readonly select: readonly [view: BrowserViewInterface]; readonly action: readonly [action: BrowserAction]; readonly hold: readonly [name: string]; readonly release: readonly [name: string]; }` | Maps the events a toolset emits. |
|
|
705
|
+
| `BrowserToolsetReason` | type | `'reserved' \| 'held' \| 'pattern' \| 'schema' \| 'debugging'` | Names why a toolset declined a page tool. |
|
|
706
|
+
| `BrowserToolSourceEventMap` | type | `{ readonly change: readonly []; }` | Maps the signal a tool source emits when its page's tools change. |
|
|
707
|
+
| `deriveBrowserToolSchema` | function | `(schema: Readonly<Record<string, unknown>> \| undefined) => Readonly<Record<string, unknown>> \| undefined` | Derives the advertised input schema from an authored one, adding a required `purpose` parameter when the schema requires nothing. |
|
|
708
|
+
| `redactBrowserText` | function | `(text: string, secrets: readonly string[]) => string` | Redacts registered secrets before projection wrapping or output clipping. |
|
|
709
|
+
| `renderBrowserToolOutput` | function | `(value: unknown) => string` | Renders tool strings unchanged, content-array text blocks joined, and other values as bounded JSON. |
|
|
710
|
+
| `validateBrowserToolArguments` | function | `(definition: ToolDefinition, args: Readonly<Record<string, unknown>>) => void` | Refuses a tool call that carries a parameter its definition does not advertise, naming the parameters the tool takes. |
|
|
711
|
+
| `BROWSER_ACTION_OUTCOMES` | const | `readonly BrowserStepOutcome[]` | Lists every outcome a `BrowserAction` and a run step carry: `done`, `refused`, `timeout`, and `interrupted`. |
|
|
712
|
+
| `BROWSER_ACTION_STAGES` | const | `readonly BrowserNavigationStage[]` | Lists every navigation stage a `BrowserAction` and a run step carry: `requested`, `committed`, and `loaded`. |
|
|
713
|
+
| `BROWSER_OBSERVATION_TOOL_NAMES` | const | `readonly string[]` | Names the tools that observe the view without recording an action. |
|
|
714
|
+
| `BROWSER_REGISTRY_ABSENT_CODE` | const | `-32601` | Identifies the CDP method-not-found response when WebMCP is absent. |
|
|
715
|
+
| `BROWSER_REGISTRY_OUTPUT_LIMIT` | const | `4096` | Bounds adopted tool JSON output and error messages to 4096 UTF-16 code units. |
|
|
716
|
+
| `BROWSER_SUBMIT_KEY` | const | `"__orkestrelSubmit"` | Names the isolated-world property that holds the `submit` observer an action installs before its input, `'__orkestrelSubmit'`. |
|
|
717
|
+
| `BROWSER_TOOL_CAPTURE_MS` | const | `1000` | Reserves `1_000` milliseconds of an action receipt's `BROWSER_TOOL_TIMEOUT_MS` deadline for the view capture, so a receipt whose navigation wait reaches its bound still carries the view. |
|
|
718
|
+
| `BROWSER_TOOL_CHANGED_NOTE` | const | `"(The page changed before the view could be read; call read.)"` | Holds the note an action receipt carries in place of the view when the page changed under the capture twice: once after the action, and again during the one retry that follows the page's readiness. |
|
|
719
|
+
| `BROWSER_TOOL_COPY` | const | `Readonly<Record<BrowserToolName, ToolDefinition>>` | Holds the advertised definition of each reserved tool: its description, its JSON Schema parameters, and its annotations. |
|
|
720
|
+
| `BROWSER_TOOL_CUT_FOOTER` | const | `"the rest was cut"` | Holds the clause that ends a cut result without an addressed page window. |
|
|
721
|
+
| `BROWSER_TOOL_DEADLINE_NOTE` | const | `"(The view could not be read before the deadline; call read.)"` | Holds the note an action receipt carries in place of the view when the receipt's deadline passed before the view could be captured. |
|
|
722
|
+
| `BROWSER_TOOL_HANDLED_STATUS` | const | `"the page handled the submission and changed"` | Holds the status of a handled submission whose settle observed a change. |
|
|
723
|
+
| `BROWSER_TOOL_LIMIT` | const | `4000` | Bounds each tool result and error message at `4_000` UTF-16 code units including its footer. |
|
|
724
|
+
| `BROWSER_TOOL_NAME_PATTERN` | const | `RegExp` | Matches a page tool name the toolset can advertise: 1 to 64 ASCII letters, digits, underscores, and hyphens. |
|
|
725
|
+
| `BROWSER_TOOL_NAMES` | const | `readonly BrowserToolName[]` | Names the eight page tools: `read`, `click`, `type`, `press`, `navigate`, `wait`, `dialog`, and `switch`. |
|
|
726
|
+
| `BROWSER_TOOL_PENDING_NOTE` | const | `"An earlier input is still pending; call read."` | Holds the refusal for a hold requested while an earlier input remains pending. |
|
|
727
|
+
| `BROWSER_TOOL_TIMEOUT_LIMIT_MS` | const | `30000` | Caps the `wait` tool's `timeout` parameter at `30_000` milliseconds. |
|
|
728
|
+
| `BROWSER_TOOL_TIMEOUT_MS` | const | `5000` | Sets the `wait` tool's default and an action receipt's bound on a requested navigation, `5_000` milliseconds. |
|
|
729
|
+
| `BROWSER_TOOL_UNCHANGED_STATUS` | const | `"the page handled the submission and has not changed yet; do not submit again; call read or wait for the text you expect"` | Holds the status of a handled submission with no rendered change before the deadline. |
|
|
730
730
|
|
|
731
731
|
##### Element and tool helpers
|
|
732
732
|
|
|
@@ -823,96 +823,96 @@ const waitQuery = compileQueryWaitExpression(5_000, 'wait-2')
|
|
|
823
823
|
|
|
824
824
|
#### Journeys and stores
|
|
825
825
|
|
|
826
|
-
|
|
|
827
|
-
| -------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
828
|
-
| `BrowserRecorder` | class | Records semantic steps from completed toolset actions and omits refused or timed-out actions. |
|
|
829
|
-
| `BrowserReplay` | class | Prepares and replays a journey under a toolset hold, retaining its executed prefix. |
|
|
830
|
-
| `MemoryBrowserJourneyStore` | class | Keeps owned journey snapshots and revision counters across deletion. |
|
|
831
|
-
| `MemoryBrowserRunStore` | class | Keeps owned runs under their journey names and producer ids without directories. |
|
|
832
|
-
| `createBrowserRecorder` | function | Creates a recorder over toolset actions. |
|
|
833
|
-
| `createBrowserReplay` | function | Creates a replay of one journey revision. |
|
|
834
|
-
| `createMemoryBrowserJourneyStore` | function | Creates an in-memory journey store with persistent revision counters. |
|
|
835
|
-
| `createMemoryBrowserRunStore` | function | Creates an in-memory run store without capture directories. |
|
|
836
|
-
| `BrowserCodegenGesture` | interface | Carries a sanitized gesture from the page listener without password values. |
|
|
837
|
-
| `BrowserCodegenScript` | interface | Carries the module `compileBrowserJourney` emits with the gap steps that refuse it. |
|
|
838
|
-
| `BrowserJourney` | interface | Describes one user intent as data; `next` is the number the next added step takes. |
|
|
839
|
-
| `BrowserJourneyInput` | interface | Names and describes a journey built from recorded steps. |
|
|
840
|
-
| `BrowserJourneyParameter` | interface | Declares one parameter a journey takes: its default, or none when it is a secret. |
|
|
841
|
-
| `BrowserJourneyRevision` | interface | Carries a journey with the revision the store assigned; `revision` is absent for a journey the store never held. |
|
|
842
|
-
| `BrowserJourneyStep` | interface | Describes a step with its identity: `s` followed by a positive integer, stable across edits and never reused. |
|
|
843
|
-
| `BrowserJourneyStepInput` | interface | Describes one step before it holds an id: a call of a toolset tool with its element or tab named as data. |
|
|
844
|
-
| `BrowserJourneyStoreInterface` | interface | Keeps journeys by name with a revision per write. |
|
|
845
|
-
| `BrowserJourneyTab` | interface | Names the tab a `switch` step moves to, portably. |
|
|
846
|
-
| `BrowserJourneyTarget` | interface | Names the element an acting step acts on the way a receipt names it, with the record-time evidence a developer reads when a resolution is refused. |
|
|
847
|
-
| `BrowserJourneyValidationContext` | interface | Identifies the parameter binding that failed journey validation. |
|
|
848
|
-
| `BrowserRecorderInterface` | interface | Records the steps of a journey from one source as they happen and turns them into a journey. |
|
|
849
|
-
| `BrowserReplayInterface` | interface | Replays one journey over a toolset. |
|
|
850
|
-
| `BrowserRun` | interface | Describes one run of a journey; `inputs` omits secret values; `fault` carries the run file's write failure or the failure that stopped it before a step ran. |
|
|
851
|
-
| `BrowserRunSlot` | interface | Names the run directory a store created, as data. |
|
|
852
|
-
| `BrowserRunStep` | interface | Describes one replayed step; `action`, `trigger`, and `result` carry the meaning of the skill's `JournalStep` fields. |
|
|
853
|
-
| `BrowserRunStoreInterface` | interface | Keeps runs by the journey name and run id the run carries. |
|
|
854
|
-
| `BrowserStoreFault` | interface | Names one entry a listing could not read. |
|
|
855
|
-
| `BrowserStorePage` | interface | Carries one page of a listing with the entries it could not read. |
|
|
856
|
-
| `BrowserHARReplayOptions` | interface | Describes HAR replay behavior. |
|
|
857
|
-
| `BrowserJourneyOptions` | interface | Configures the journey toolset a toolset constructs. |
|
|
858
|
-
| `BrowserJourneyWriteOptions` | interface | Constrains a journey write atomically at the store. |
|
|
859
|
-
| `BrowserRecorderOptions` | interface | Configures a recorder. |
|
|
860
|
-
| `BrowserReplayOptions` | interface | Configures one replay. |
|
|
861
|
-
| `BrowserStoreOptions` | interface | Carries the signal a store call honours. |
|
|
862
|
-
| `BrowserStorePageOptions` | interface | Configures one page of a store listing, with cancellation. |
|
|
863
|
-
| `validateBrowserJourneyWriteOptions` | function | Validates the mutually exclusive conditions of a journey write before side effects. |
|
|
864
|
-
| `BrowserCodegenLanguage` | type | Names the target language for a compiled codegen script. |
|
|
865
|
-
| `BrowserJourneyBinding` | type | Binds a native action's string argument to a literal or to one declared parameter by name. |
|
|
866
|
-
| `BrowserJourneyEdit` | type | Describes one change to a journey; `editBrowserJourney` applies a batch to a copy, in order, and refuses it whole on the first invalid edit. |
|
|
867
|
-
| `BrowserJourneyEditRequest` | type | Describes an edit as the `edit` tool receives it over the wire: an added or updated step can name `ref` instead of a target, converted from the current view before the pure editor runs. |
|
|
868
|
-
| `BrowserRecorderEventMap` | type | Maps the events a recorder emits. |
|
|
869
|
-
| `BrowserReplayEventMap` | type | Maps the events a replay emits. |
|
|
870
|
-
| `BrowserRunOutcome` | type | Names how a run ended. |
|
|
871
|
-
| `buildBrowserJourney` | function | Builds a validated journey from recorded steps and declares their secret bindings. |
|
|
872
|
-
| `collectBrowserJourneyBindings` | function | Collects parameter uses from native arguments and target names, keeping page arguments literal. |
|
|
873
|
-
| `collectBrowserJourneyTextBindings` | function | Collects the parameter names a native `type` step's `text` binds. |
|
|
874
|
-
| `deriveBrowserJourneySecret` | function | Derives an unused lower camel case secret parameter name from an accessible name. |
|
|
875
|
-
| `deriveBrowserJourneyTrigger` | function | Derives the trigger text a run records for an action. |
|
|
876
|
-
| `editBrowserJourney` | function | Applies an ordered edit batch to a copy and validates its nonempty result and final bindings. |
|
|
877
|
-
| `generateBrowserRunId` | function | Generates a run id from an ISO timestamp and a cryptographic hexadecimal suffix. |
|
|
878
|
-
| `isBrowserJourneyBinding` | function | Checks whether a native string argument is a literal or a parameter binding. |
|
|
879
|
-
| `isBrowserJourneyTab` | function | Checks whether a tab carries its portable URL and title. |
|
|
880
|
-
| `isBrowserJourneyTarget` | function | Checks whether a target carries its role, name, and optional evidence. |
|
|
881
|
-
| `isBrowserJourneyValidationContext` | function | Checks whether a validation context identifies a parameter, step, and field. |
|
|
882
|
-
| `isBrowserSecretBinding` | function | Checks whether a step binds a declared secret through type.text. |
|
|
883
|
-
| `normalizeBrowserJourneyReason` | function | Normalizes a failure to its first paragraph without an invariant label, directive, or final period. |
|
|
884
|
-
| `renderBrowserJourney` | function | Renders a journey with its parameter declarations and stable step ids. |
|
|
885
|
-
| `renderBrowserJourneyFault` | function | Renders an unreadable journey from its name and path-free reason. |
|
|
886
|
-
| `renderBrowserRun` | function | Renders a run heading and its receipts, followed by the supplied final view. |
|
|
887
|
-
| `renderBrowserRunResult` | function | Renders a step receipt without its tool directive or appended view. |
|
|
888
|
-
| `resolveBrowserJourneyBinding` | function | Resolves a native string binding from supplied inputs. |
|
|
889
|
-
| `validateBrowserJourney` | function | Validates the journey format and its name, nonempty steps, ids, bindings, secrets, JSON, and actions. |
|
|
890
|
-
| `validateBrowserJourneyEdit` | function | Validates an edit structure and names the operation and field in each refusal. |
|
|
891
|
-
| `validateBrowserJourneyName` | function | Checks a journey name before store access. |
|
|
892
|
-
| `validateBrowserJourneyParameter` | function | Validates a parameter declaration, including the secret-default exclusion. |
|
|
893
|
-
| `validateBrowserJourneyStep` | function | Validates one step independently of ids and parameter declarations. |
|
|
894
|
-
| `validateBrowserRun` | function | Validates a persisted run and the journey it carries. |
|
|
895
|
-
| `validateBrowserStorePage` | function | Checks the offset and limit of a store page. |
|
|
896
|
-
| `BROWSER_CODEGEN_BINDING_NAME` | const | Names the CDP runtime binding the codegen recorder script calls into, `'__orkestrelBrowserCodegen'`. |
|
|
897
|
-
| `BROWSER_CODEGEN_SOURCE` | const | Holds the self-contained document listener installed before a frame resumes. Password input carries a marker; only Enter carries a key. Node indices are local to a document. |
|
|
898
|
-
| `BROWSER_JOURNEY_ACTIONS` | const | Names the native actions a journey step can hold: `click`, `type`, `press`, `navigate`, `wait`, `dialog`, and `switch`. |
|
|
899
|
-
| `BROWSER_JOURNEY_EMPTY_LIST` | const | Holds the result the `journeys` tool returns when no journey is saved. |
|
|
900
|
-
| `BROWSER_JOURNEY_FORMAT_VERSION` | const | Holds the journey and run file format this package writes and reads, `1`. |
|
|
901
|
-
| `BROWSER_JOURNEY_IDLE_REFUSAL` | const | Holds the refusal `save` returns when no journey is recording. |
|
|
902
|
-
| `BROWSER_JOURNEY_SAVE_SAVED_REFUSAL` | const | Holds the refusal `save` returns after a successful save when no journey is recording. |
|
|
903
|
-
| `BROWSER_JOURNEY_NAME_PATTERN` | const | Matches a journey name: lowercase letters and digits in words joined by single hyphens, at most 64 characters, and never a Windows reserved device name. |
|
|
904
|
-
| `BROWSER_JOURNEY_NON_STEP_TOOLS` | const | Names observation and journey tools that cannot become journey steps. |
|
|
905
|
-
| `BROWSER_JOURNEY_PARAMETER_PATTERN` | const | Matches a journey parameter name: a lowercase letter followed by letters and digits. |
|
|
906
|
-
| `BROWSER_JOURNEY_READONLY_REFUSAL` | const | Holds the refusal `record`, `save`, `edit`, and `forget` return when the journeys are read-only. |
|
|
907
|
-
| `BROWSER_JOURNEY_RECORDING_REFUSAL` | const | Holds the refusal `record` returns while another journey is recording. |
|
|
908
|
-
| `BROWSER_JOURNEY_EMPTY_REFUSAL` | const | Holds the refusal `save` returns while the recording has no steps. |
|
|
909
|
-
| `BROWSER_JOURNEY_RECORD_EMPTY_REFUSAL` | const | Holds the refusal `record` returns for the same empty recording. |
|
|
910
|
-
| `BROWSER_JOURNEY_RECORD_STEPS_REFUSAL` | const | Holds the refusal `record` returns for the same recording with steps. |
|
|
911
|
-
| `BROWSER_JOURNEY_EDIT_CHOICE_REFUSAL` | const | Holds the refusal `edit` returns without a journey when several journeys are saved. |
|
|
912
|
-
| `BROWSER_JOURNEY_EDIT_EMPTY_REFUSAL` | const | Holds the refusal `edit` returns without a journey when no journey is saved. |
|
|
913
|
-
| `BROWSER_JOURNEY_STEP_KEYS` | const | Names native tool arguments represented by journey targets, tabs, or secret bindings. |
|
|
914
|
-
| `BROWSER_JOURNEY_TOOL_NAMES` | const | Names the journey tools a toolset constructed with `journeys` registers and reserves: `record`, `save`, `journeys`, `edit`, `replay`, `forget`, and `capture`. |
|
|
915
|
-
| `BROWSER_RUN_ID_PATTERN` | const | Matches a run id containing an ISO timestamp with hyphenated time and a hexadecimal suffix. |
|
|
826
|
+
| Name | Kind | Signature | Summary |
|
|
827
|
+
| -------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
828
|
+
| `BrowserRecorder` | class | `new (toolset: BrowserToolsetInterface, options?: BrowserRecorderOptions) => BrowserRecorderInterface` | Records semantic steps from completed toolset actions and omits refused or timed-out actions. |
|
|
829
|
+
| `BrowserReplay` | class | `new (toolset: BrowserToolsetInterface, revision: BrowserJourneyRevision, options?: BrowserReplayOptions) => BrowserReplayInterface` | Prepares and replays a journey under a toolset hold, retaining its executed prefix. |
|
|
830
|
+
| `MemoryBrowserJourneyStore` | class | `new () => BrowserJourneyStoreInterface` | Keeps owned journey snapshots and revision counters across deletion. |
|
|
831
|
+
| `MemoryBrowserRunStore` | class | `new () => BrowserRunStoreInterface` | Keeps owned runs under their journey names and producer ids without directories. |
|
|
832
|
+
| `createBrowserRecorder` | function | `(toolset: BrowserToolsetInterface, options?: BrowserRecorderOptions) => BrowserRecorderInterface` | Creates a recorder over toolset actions. |
|
|
833
|
+
| `createBrowserReplay` | function | `(toolset: BrowserToolsetInterface, revision: BrowserJourneyRevision, options?: BrowserReplayOptions) => BrowserReplayInterface` | Creates a replay of one journey revision. |
|
|
834
|
+
| `createMemoryBrowserJourneyStore` | function | `() => BrowserJourneyStoreInterface` | Creates an in-memory journey store with persistent revision counters. |
|
|
835
|
+
| `createMemoryBrowserRunStore` | function | `() => BrowserRunStoreInterface` | Creates an in-memory run store without capture directories. |
|
|
836
|
+
| `BrowserCodegenGesture` | interface | `{ event, index, top, control, form, detail?, key?, value?, secret?, roundtrip?, gap? }` | Carries a sanitized gesture from the page listener without password values. |
|
|
837
|
+
| `BrowserCodegenScript` | interface | `{ source, gaps }` | Carries the module `compileBrowserJourney` emits with the gap steps that refuse it. |
|
|
838
|
+
| `BrowserJourney` | interface | `{ format, name, description, start?, parameters, next, steps }` | Describes one user intent as data; `next` is the number the next added step takes. |
|
|
839
|
+
| `BrowserJourneyInput` | interface | `{ name, description }` | Names and describes a journey built from recorded steps. |
|
|
840
|
+
| `BrowserJourneyParameter` | interface | `{ default?, secret? }` | Declares one parameter a journey takes: its default, or none when it is a secret. |
|
|
841
|
+
| `BrowserJourneyRevision` | interface | `{ journey, revision? }` | Carries a journey with the revision the store assigned; `revision` is absent for a journey the store never held. |
|
|
842
|
+
| `BrowserJourneyStep` | interface | `{ id }` | Describes a step with its identity: `s` followed by a positive integer, stable across edits and never reused. |
|
|
843
|
+
| `BrowserJourneyStepInput` | interface | `{ action, arguments, target?, tab?, gap? }` | Describes one step before it holds an id: a call of a toolset tool with its element or tab named as data. |
|
|
844
|
+
| `BrowserJourneyStoreInterface` | interface | `{ get(), set(), delete(), list() }` | Keeps journeys by name with a revision per write. |
|
|
845
|
+
| `BrowserJourneyTab` | interface | `{ url, title }` | Names the tab a `switch` step moves to, portably. |
|
|
846
|
+
| `BrowserJourneyTarget` | interface | `{ role, name, css?, reference? }` | Names the element an acting step acts on the way a receipt names it, with the record-time evidence a developer reads when a resolution is refused. |
|
|
847
|
+
| `BrowserJourneyValidationContext` | interface | `{ parameter, step, field }` | Identifies the parameter binding that failed journey validation. |
|
|
848
|
+
| `BrowserRecorderInterface` | interface | `{ emitter, active, start(), stop(), steps(), journey(), clear(), destroy() }` | Records the steps of a journey from one source as they happen and turns them into a journey. |
|
|
849
|
+
| `BrowserReplayInterface` | interface | `{ emitter, execute() }` | Replays one journey over a toolset. |
|
|
850
|
+
| `BrowserRun` | interface | `{ format, id, journey, revision?, inputs, steps, outcome, output?, elapsed, fault? }` | Describes one run of a journey; `inputs` omits secret values; `fault` carries the run file's write failure or the failure that stopped it before a step ran. |
|
|
851
|
+
| `BrowserRunSlot` | interface | `{ id, directory? }` | Names the run directory a store created, as data. |
|
|
852
|
+
| `BrowserRunStep` | interface | `{ id, action, trigger, arguments, outcome, stage?, reason?, result, capture?, elapsed }` | Describes one replayed step; `action`, `trigger`, and `result` carry the meaning of the skill's `JournalStep` fields. |
|
|
853
|
+
| `BrowserRunStoreInterface` | interface | `{ write?(), create(), get(), set(), capture(), delete(), clear(), list() }` | Keeps runs by the journey name and run id the run carries. |
|
|
854
|
+
| `BrowserStoreFault` | interface | `{ name, reason }` | Names one entry a listing could not read. |
|
|
855
|
+
| `BrowserStorePage` | interface | `{ entries, truncated, faults }` | Carries one page of a listing with the entries it could not read. |
|
|
856
|
+
| `BrowserHARReplayOptions` | interface | `{ fallback? }` | Describes HAR replay behavior. |
|
|
857
|
+
| `BrowserJourneyOptions` | interface | `{ store, runs?, limit?, readonly? }` | Configures the journey toolset a toolset constructs. |
|
|
858
|
+
| `BrowserJourneyWriteOptions` | interface | `{ revision?, exclusive? }` | Constrains a journey write atomically at the store. |
|
|
859
|
+
| `BrowserRecorderOptions` | interface | `{ on?, error? }` | Configures a recorder. |
|
|
860
|
+
| `BrowserReplayOptions` | interface | `{ on?, error?, inputs?, runs? }` | Configures one replay. |
|
|
861
|
+
| `BrowserStoreOptions` | interface | `{ signal? }` | Carries the signal a store call honours. |
|
|
862
|
+
| `BrowserStorePageOptions` | interface | `{ offset?, limit? }` | Configures one page of a store listing, with cancellation. |
|
|
863
|
+
| `validateBrowserJourneyWriteOptions` | function | `(options?: BrowserJourneyWriteOptions) => void` | Validates the mutually exclusive conditions of a journey write before side effects. |
|
|
864
|
+
| `BrowserCodegenLanguage` | type | `'javascript' \| 'typescript'` | Names the target language for a compiled codegen script. |
|
|
865
|
+
| `BrowserJourneyBinding` | type | `string \| { readonly parameter: string; }` | Binds a native action's string argument to a literal or to one declared parameter by name. |
|
|
866
|
+
| `BrowserJourneyEdit` | type | `{ readonly operation: 'add'; readonly step: BrowserJourneyStepInput; readonly before?: string; readonly after?: string; } \| { readonly operation: 'remove'; readonly id: string; } \| { readonly operation: 'update'; readonly id: string; readonly arguments?: Readonly<Record<string, BrowserJourneyBinding \| JSONValue>>; readonly target?: BrowserJourneyTarget; readonly tab?: BrowserJourneyTab; } \| { readonly operation: 'declare'; readonly name: string; readonly parameter: BrowserJourneyParameter; }` | Describes one change to a journey; `editBrowserJourney` applies a batch to a copy, in order, and refuses it whole on the first invalid edit. |
|
|
867
|
+
| `BrowserJourneyEditRequest` | type | `BrowserJourneyEdit \| { readonly operation: 'add'; readonly step: Omit<BrowserJourneyStepInput, 'target'> & { readonly ref?: string; }; readonly before?: string; readonly after?: string; } \| { readonly operation: 'update'; readonly id: string; readonly ref?: string; readonly arguments?: Readonly<Record<string, BrowserJourneyBinding \| JSONValue>>; }` | Describes an edit as the `edit` tool receives it over the wire: an added or updated step can name `ref` instead of a target, converted from the current view before the pure editor runs. |
|
|
868
|
+
| `BrowserRecorderEventMap` | type | `{ readonly start: readonly []; readonly step: readonly [step: BrowserJourneyStep]; readonly stop: readonly [steps: readonly BrowserJourneyStep[]]; readonly clear: readonly []; }` | Maps the events a recorder emits. |
|
|
869
|
+
| `BrowserReplayEventMap` | type | `{ readonly step: readonly [step: BrowserRunStep]; }` | Maps the events a replay emits. |
|
|
870
|
+
| `BrowserRunOutcome` | type | `'complete' \| 'stopped' \| 'aborted'` | Names how a run ended. |
|
|
871
|
+
| `buildBrowserJourney` | function | `(steps: readonly BrowserJourneyStep[], options: BrowserJourneyInput) => BrowserJourney` | Builds a validated journey from recorded steps and declares their secret bindings. |
|
|
872
|
+
| `collectBrowserJourneyBindings` | function | `(steps: readonly BrowserJourneyStepInput[]) => ReadonlyMap<string, readonly string[]>` | Collects parameter uses from native arguments and target names, keeping page arguments literal. |
|
|
873
|
+
| `collectBrowserJourneyTextBindings` | function | `(steps: readonly BrowserJourneyStepInput[]) => readonly string[]` | Collects the parameter names a native `type` step's `text` binds. |
|
|
874
|
+
| `deriveBrowserJourneySecret` | function | `(name: string, taken?: readonly string[]) => string` | Derives an unused lower camel case secret parameter name from an accessible name. |
|
|
875
|
+
| `deriveBrowserJourneyTrigger` | function | `(step: BrowserJourneyStepInput, inputs?: Readonly<Record<string, string>>) => string` | Derives the trigger text a run records for an action. |
|
|
876
|
+
| `editBrowserJourney` | function | `(journey: BrowserJourney, edits: readonly BrowserJourneyEdit[]) => BrowserJourney` | Applies an ordered edit batch to a copy and validates its nonempty result and final bindings. |
|
|
877
|
+
| `generateBrowserRunId` | function | `() => string` | Generates a run id from an ISO timestamp and a cryptographic hexadecimal suffix. |
|
|
878
|
+
| `isBrowserJourneyBinding` | function | `(value: unknown) => value is BrowserJourneyBinding` | Checks whether a native string argument is a literal or a parameter binding. |
|
|
879
|
+
| `isBrowserJourneyTab` | function | `(value: unknown) => value is BrowserJourneyTab` | Checks whether a tab carries its portable URL and title. |
|
|
880
|
+
| `isBrowserJourneyTarget` | function | `(value: unknown) => value is BrowserJourneyTarget` | Checks whether a target carries its role, name, and optional evidence. |
|
|
881
|
+
| `isBrowserJourneyValidationContext` | function | `(value: unknown) => value is BrowserJourneyValidationContext` | Checks whether a validation context identifies a parameter, step, and field. |
|
|
882
|
+
| `isBrowserSecretBinding` | function | `(step: unknown, parameters: unknown) => step is { readonly action: 'type'; readonly arguments: { readonly text: { readonly parameter: string; }; }; }` | Checks whether a step binds a declared secret through type.text. |
|
|
883
|
+
| `normalizeBrowserJourneyReason` | function | `(error: unknown) => string` | Normalizes a failure to its first paragraph without an invariant label, directive, or final period. |
|
|
884
|
+
| `renderBrowserJourney` | function | `(journey: BrowserJourney) => string` | Renders a journey with its parameter declarations and stable step ids. |
|
|
885
|
+
| `renderBrowserJourneyFault` | function | `(fault: BrowserStoreFault) => string` | Renders an unreadable journey from its name and path-free reason. |
|
|
886
|
+
| `renderBrowserRun` | function | `(run: BrowserRun, view?: string) => string` | Renders a run heading and its receipts, followed by the supplied final view. |
|
|
887
|
+
| `renderBrowserRunResult` | function | `(result: string) => string` | Renders a step receipt without its tool directive or appended view. |
|
|
888
|
+
| `resolveBrowserJourneyBinding` | function | `(value: unknown, inputs: Readonly<Record<string, string>>) => string` | Resolves a native string binding from supplied inputs. |
|
|
889
|
+
| `validateBrowserJourney` | function | `(value: unknown) => asserts value is BrowserJourney` | Validates the journey format and its name, nonempty steps, ids, bindings, secrets, JSON, and actions. |
|
|
890
|
+
| `validateBrowserJourneyEdit` | function | `(value: unknown) => asserts value is BrowserJourneyEdit` | Validates an edit structure and names the operation and field in each refusal. |
|
|
891
|
+
| `validateBrowserJourneyName` | function | `(name: string) => void` | Checks a journey name before store access. |
|
|
892
|
+
| `validateBrowserJourneyParameter` | function | `(value: unknown) => asserts value is BrowserJourneyParameter` | Validates a parameter declaration, including the secret-default exclusion. |
|
|
893
|
+
| `validateBrowserJourneyStep` | function | `(value: unknown) => asserts value is BrowserJourneyStepInput` | Validates one step independently of ids and parameter declarations. |
|
|
894
|
+
| `validateBrowserRun` | function | `(value: unknown) => asserts value is BrowserRun` | Validates a persisted run and the journey it carries. |
|
|
895
|
+
| `validateBrowserStorePage` | function | `(offset: number, limit: number) => void` | Checks the offset and limit of a store page. |
|
|
896
|
+
| `BROWSER_CODEGEN_BINDING_NAME` | const | `"__orkestrelBrowserCodegen"` | Names the CDP runtime binding the codegen recorder script calls into, `'__orkestrelBrowserCodegen'`. |
|
|
897
|
+
| `BROWSER_CODEGEN_SOURCE` | const | `"(() => {\n\tconst binding = '__orkestrelBrowserCodegen'\n\twindow[binding + '__state']?.controller.abort()\n\tconst state = { controller: new AbortController(), nodes: [], indices: new WeakMap() }\n\twindow[binding + '__state'] = state\n\tfor (const event of ['click', 'input', 'change', 'keydown', 'focusout', 'submit', 'contextmenu', 'drop']) {\n\t\tdocument.addEventListener(event, (event) => {\n\t\t\tif (!event.isTrusted \|\| typeof window[binding] !== 'function') return\n\t\t\tif (event.type === 'keydown' && event.key !== 'Enter') return\n\t\t\tconst element = event.composedPath()[0]\n\t\t\tif (!(element instanceof Element)) return\n\t\t\tconst known = state.indices.get(element)\n\t\t\tconst index = known === undefined ? state.nodes.push(element) - 1 : known\n\t\t\tif (known === undefined) {\n\t\t\t\tstate.indices.set(element, index)\n\t\t\t}\n\t\t\tconst control = element.tagName === 'SELECT' ? (element.multiple ? 'multiple' : 'select')\n\t\t\t\t: element.tagName === 'OPTION' ? 'option'\n\t\t\t\t: element.tagName === 'INPUT' && element.type === 'password' ? 'password'\n\t\t\t\t: element.tagName === 'TEXTAREA' \|\| element.isContentEditable \|\|\n\t\t\t\t\t(element.tagName === 'INPUT' && ['text', 'search', 'url', 'tel', 'email', 'number'].includes(element.type)) ? 'text' : 'other'\n\t\t\tconst payload = { event: event.type, index, top: window === window.top && element.ownerDocument === document, control, form: !!element.form }\n\t\t\tif (event.type === 'click') payload.detail = event.detail\n\t\t\tif (event.type === 'keydown') payload.key = 'Enter'\n\t\t\tif (event.type === 'input' && control === 'password') payload.secret = true\n\t\t\tif (event.type === 'input' && control === 'text') payload.value = element.isContentEditable ? element.textContent \|\| '' : element.value\n\t\t\tif (event.type === 'change' && control === 'select') {\n\t\t\t\tpayload.value = element.value\n\t\t\t\tpayload.roundtrip = Array.from(element.options).find(option => option.value === element.value) === element.selectedOptions[0]\n\t\t\t}\n\t\t\tif (element.getRootNode() !== document) {\n\t\t\t\tpayload.event = 'unsupported'\n\t\t\t\tpayload.gap = 'the element is in a shadow root'\n\t\t\t} else if (event.type === 'contextmenu' \|\| event.type === 'drop' \|\| (event.type === 'click' && (event.ctrlKey \|\| event.metaKey \|\| event.altKey \|\| event.shiftKey) && !['select', 'multiple', 'option'].includes(control))) {\n\t\t\t\tpayload.event = 'unsupported'\n\t\t\t\tpayload.gap = 'an unsupported gesture'\n\t\t\t}\n\t\t\twindow[binding](JSON.stringify(payload.event === 'unsupported' ? { event: payload.event, index, top: payload.top, control, form: payload.form, gap: payload.gap } : payload))\n\t\t}, { capture: true, signal: state.controller.signal })\n\t}\n})()"` | Holds the self-contained document listener installed before a frame resumes. Password input carries a marker; only Enter carries a key. Node indices are local to a document. |
|
|
898
|
+
| `BROWSER_JOURNEY_ACTIONS` | const | `readonly BrowserToolName[]` | Names the native actions a journey step can hold: `click`, `type`, `press`, `navigate`, `wait`, `dialog`, and `switch`. |
|
|
899
|
+
| `BROWSER_JOURNEY_EMPTY_LIST` | const | `"No journeys are saved; call record to start one."` | Holds the result the `journeys` tool returns when no journey is saved. |
|
|
900
|
+
| `BROWSER_JOURNEY_FORMAT_VERSION` | const | `BrowserJourney['format']` | Holds the journey and run file format this package writes and reads, `1`. |
|
|
901
|
+
| `BROWSER_JOURNEY_IDLE_REFUSAL` | const | `"No journey is recording, so nothing can be saved; answer the user. A journey holds only the actions after record, so call record before them."` | Holds the refusal `save` returns when no journey is recording. |
|
|
902
|
+
| `BROWSER_JOURNEY_SAVE_SAVED_REFUSAL` | const | `"Nothing is recording, so there is nothing to save; {name} is already saved. Answer the user."` | Holds the refusal `save` returns after a successful save when no journey is recording. |
|
|
903
|
+
| `BROWSER_JOURNEY_NAME_PATTERN` | const | `RegExp` | Matches a journey name: lowercase letters and digits in words joined by single hyphens, at most 64 characters, and never a Windows reserved device name. |
|
|
904
|
+
| `BROWSER_JOURNEY_NON_STEP_TOOLS` | const | `readonly string[]` | Names observation and journey tools that cannot become journey steps. |
|
|
905
|
+
| `BROWSER_JOURNEY_PARAMETER_PATTERN` | const | `RegExp` | Matches a journey parameter name: a lowercase letter followed by letters and digits. |
|
|
906
|
+
| `BROWSER_JOURNEY_READONLY_REFUSAL` | const | `"The journeys are read-only; call replay."` | Holds the refusal `record`, `save`, `edit`, and `forget` return when the journeys are read-only. |
|
|
907
|
+
| `BROWSER_JOURNEY_RECORDING_REFUSAL` | const | `"{name} is recording; call save before you record another."` | Holds the refusal `record` returns while another journey is recording. |
|
|
908
|
+
| `BROWSER_JOURNEY_EMPTY_REFUSAL` | const | `"Nothing is recorded for {name} yet, and it is still recording. Click and type the flow's steps now, then call save."` | Holds the refusal `save` returns while the recording has no steps. |
|
|
909
|
+
| `BROWSER_JOURNEY_RECORD_EMPTY_REFUSAL` | const | `"{name} is already recording and has no steps yet. Click and type the flow's steps now, then call save."` | Holds the refusal `record` returns for the same empty recording. |
|
|
910
|
+
| `BROWSER_JOURNEY_RECORD_STEPS_REFUSAL` | const | `"{name} is already recording with {count} {steps}; call save when the flow is done."` | Holds the refusal `record` returns for the same recording with steps. |
|
|
911
|
+
| `BROWSER_JOURNEY_EDIT_CHOICE_REFUSAL` | const | `"Edit requires journey, one of {names}; call edit with that name beside edits."` | Holds the refusal `edit` returns without a journey when several journeys are saved. |
|
|
912
|
+
| `BROWSER_JOURNEY_EDIT_EMPTY_REFUSAL` | const | `"No journey is saved, so there is nothing to edit; call record to start one."` | Holds the refusal `edit` returns without a journey when no journey is saved. |
|
|
913
|
+
| `BROWSER_JOURNEY_STEP_KEYS` | const | `readonly string[]` | Names native tool arguments represented by journey targets, tabs, or secret bindings. |
|
|
914
|
+
| `BROWSER_JOURNEY_TOOL_NAMES` | const | `readonly BrowserToolName[]` | Names the journey tools a toolset constructed with `journeys` registers and reserves: `record`, `save`, `journeys`, `edit`, `replay`, `forget`, and `capture`. |
|
|
915
|
+
| `BROWSER_RUN_ID_PATTERN` | const | `RegExp` | Matches a run id containing an ISO timestamp with hyphenated time and a hexadecimal suffix. |
|
|
916
916
|
|
|
917
917
|
##### Journey helpers
|
|
918
918
|
|
|
@@ -1025,40 +1025,40 @@ compileBrowserJourney(journey, { language: 'typescript' }) // { source, gaps: []
|
|
|
1025
1025
|
|
|
1026
1026
|
These entities own state for one traversal, edit, or replay. Construct a fresh entity for each operation. The existing capture, rendering, and replay entry points construct them for callers.
|
|
1027
1027
|
|
|
1028
|
-
|
|
|
1029
|
-
| --------------------------------- | --------- | --------------------------------------------------------------------------------------- |
|
|
1030
|
-
| `BrowserLineWrap` | class | Wraps one semantic line while retaining its continuation and reference boundaries. |
|
|
1031
|
-
| `BrowserOutlineRows` | class | Projects outline nodes into wrapped lines while retaining listing totals and focus. |
|
|
1032
|
-
| `BrowserOutlineAncestors` | class | Traverses outline parents lazily through the supplied index. |
|
|
1033
|
-
| `BrowserOrdinals` | class | Yields positive ordinals for fallback secret parameter names. |
|
|
1034
|
-
| `BrowserJourneyEditor` | class | Applies one journey edit batch and retains the edit responsible for a refusal. |
|
|
1035
|
-
| `renderBrowserSearchQuote` | function | Chooses a bounded reference-bearing quote for a search outside the requested range. |
|
|
1036
|
-
| `boundBrowserTail` | function | Fits a character-range footer by narrowing a UTF-16 slice boundary. |
|
|
1037
|
-
| `findBrowserWrapSpace` | function | Finds a soft wrap before a reference token without splitting its preceding name. |
|
|
1038
|
-
| `skipBrowserWhitespace` | function | Finds the next non-whitespace offset after a soft line break. |
|
|
1039
|
-
| `BrowserNavigationStep` | type | Carries one recorded navigation event and its frame identity. |
|
|
1040
|
-
| `BrowserNavigationSelection` | interface | Carries the settlement selected after a navigation event. |
|
|
1041
|
-
| `BrowserJourneyEditorInterface` | interface | Exposes the result of one atomic journey edit batch. |
|
|
1042
|
-
| `BrowserToolObservation` | interface | Identifies one form-submission observation and the frames it watches. |
|
|
1043
|
-
| `BrowserToolSettlement` | interface | Carries the initial command outcome and the receipt deadline. |
|
|
1044
|
-
| `BrowserWindowRow` | interface | Retains an accepted projection row and its footer eligibility. |
|
|
1045
|
-
| `BrowserTextRange` | type | Names the UTF-16 boundaries of a reference span. |
|
|
1046
|
-
| `BrowserTeardown` | class | Runs teardown steps in order while retaining the first failure, including undefined. |
|
|
1047
|
-
| `BrowserTeardownInterface` | interface | Exposes completion after every teardown step has run. |
|
|
1048
|
-
| `BrowserSnapshotTables` | interface | Names the undecoded tables supplied by a CDP snapshot response. |
|
|
1049
|
-
| `isBrowserSnapshotTables` | function | Checks the outer tables of a CDP snapshot without decoding their entries. |
|
|
1050
|
-
| `BrowserOutlineRowsInput` | interface | Supplies the nodes, location, limits, and secrets for an outline projection. |
|
|
1051
|
-
| `BrowserToolHandler` | type | Executes a tool action and returns its body and footer. |
|
|
1052
|
-
| `BrowserJourneyPagesInterface` | type | Iterates pages of journey revisions from a store. |
|
|
1053
|
-
| `BrowserReplayExecution` | class | Owns the hold, captures, and completion of one prepared replay call. |
|
|
1054
|
-
| `BrowserJourneyPages` | class | Iterates a store listing while retaining its offset between page requests. |
|
|
1055
|
-
| `BrowserNavigationScan` | class | Yields the settlement selected after each navigation step. |
|
|
1056
|
-
| `BrowserReplayExecutionInterface` | interface | Exposes the result of one prepared replay execution. |
|
|
1057
|
-
| `BROWSER_ERROR_CODES` | const | Holds the declared codes accepted by the browser error guard. |
|
|
1058
|
-
| `BROWSER_ERROR_BRAND` | const | Identifies browser errors across installed copies and module formats. |
|
|
1059
|
-
| `BROWSER_STEP_ERROR_BRAND` | const | Identifies journey step errors across installed copies and module formats. |
|
|
1060
|
-
| `isBrowserErrorContext` | function | Checks error metadata, including non-finite numbers that describe refused input values. |
|
|
1061
|
-
| `isBrowserAction` | function | Checks whether a step error carries the declared action members. |
|
|
1028
|
+
| Name | Kind | Signature | Summary |
|
|
1029
|
+
| --------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
1030
|
+
| `BrowserLineWrap` | class | `new (line: BrowserLine) => BrowserLineWrap` | Wraps one semantic line while retaining its continuation and reference boundaries. |
|
|
1031
|
+
| `BrowserOutlineRows` | class | `new (input: BrowserOutlineRowsInput) => BrowserOutlineRows` | Projects outline nodes into wrapped lines while retaining listing totals and focus. |
|
|
1032
|
+
| `BrowserOutlineAncestors` | class | `new (node: BrowserOutlineNode \| undefined, indexed: ReadonlyMap<string, BrowserOutlineNode>) => BrowserOutlineAncestors` | Traverses outline parents lazily through the supplied index. |
|
|
1033
|
+
| `BrowserOrdinals` | class | `new () => BrowserOrdinals` | Yields positive ordinals for fallback secret parameter names. |
|
|
1034
|
+
| `BrowserJourneyEditor` | class | `new (journey: BrowserJourney, edits: readonly BrowserJourneyEdit[]) => BrowserJourneyEditorInterface` | Applies one journey edit batch and retains the edit responsible for a refusal. |
|
|
1035
|
+
| `renderBrowserSearchQuote` | function | `(passage: BrowserPassage, found: BrowserSearch, header: readonly string[], limit: number, total: number) => string \| undefined` | Chooses a bounded reference-bearing quote for a search outside the requested range. |
|
|
1036
|
+
| `boundBrowserTail` | function | `(text: string, limit: number, footer: string, end: number) => string` | Fits a character-range footer by narrowing a UTF-16 slice boundary. |
|
|
1037
|
+
| `findBrowserWrapSpace` | function | `(text: string, offset: number, whitespace: number, references: readonly BrowserTextRange[]) => number` | Finds a soft wrap before a reference token without splitting its preceding name. |
|
|
1038
|
+
| `skipBrowserWhitespace` | function | `(text: string, offset: number) => number` | Finds the next non-whitespace offset after a soft line break. |
|
|
1039
|
+
| `BrowserNavigationStep` | type | `{ readonly event: 'request'; readonly frame: string; readonly url: string; readonly loader: string \| undefined; readonly reason: BrowserNavigationReason \| undefined; } \| { readonly event: 'commit'; readonly frame: string; readonly url: string; readonly loader: string \| undefined; readonly same: boolean; } \| { readonly event: 'load'; readonly frame: string; readonly loader: string \| undefined; } \| { readonly event: 'detach'; readonly frame: string; readonly swapped: boolean; }` | Carries one recorded navigation event and its frame identity. |
|
|
1040
|
+
| `BrowserNavigationSelection` | interface | `{ done, result }` | Carries the settlement selected after a navigation event. |
|
|
1041
|
+
| `BrowserJourneyEditorInterface` | interface | `{ journey }` | Exposes the result of one atomic journey edit batch. |
|
|
1042
|
+
| `BrowserToolObservation` | interface | `{ token, frames }` | Identifies one form-submission observation and the frames it watches. |
|
|
1043
|
+
| `BrowserToolSettlement` | interface | `{ first, deadline }` | Carries the initial command outcome and the receipt deadline. |
|
|
1044
|
+
| `BrowserWindowRow` | interface | `{ index, row, heading, eligible }` | Retains an accepted projection row and its footer eligibility. |
|
|
1045
|
+
| `BrowserTextRange` | type | `readonly [start: number, end: number]` | Names the UTF-16 boundaries of a reference span. |
|
|
1046
|
+
| `BrowserTeardown` | class | `new (steps: readonly BrowserTeardownFunction[]) => BrowserTeardownInterface` | Runs teardown steps in order while retaining the first failure, including undefined. |
|
|
1047
|
+
| `BrowserTeardownInterface` | interface | `{ result }` | Exposes completion after every teardown step has run. |
|
|
1048
|
+
| `BrowserSnapshotTables` | interface | `{ strings, documents }` | Names the undecoded tables supplied by a CDP snapshot response. |
|
|
1049
|
+
| `isBrowserSnapshotTables` | function | `(value: unknown) => value is BrowserSnapshotTables` | Checks the outer tables of a CDP snapshot without decoding their entries. |
|
|
1050
|
+
| `BrowserOutlineRowsInput` | interface | `{ nodes, url, limit, secrets }` | Supplies the nodes, location, limits, and secrets for an outline projection. |
|
|
1051
|
+
| `BrowserToolHandler` | type | `(args: Readonly<Record<string, unknown>>, context: ToolContext) => Promise<readonly [body: string, footer: string]>` | Executes a tool action and returns its body and footer. |
|
|
1052
|
+
| `BrowserJourneyPagesInterface` | type | `AsyncIterableIterator<BrowserStorePage<BrowserJourneyRevision>>` | Iterates pages of journey revisions from a store. |
|
|
1053
|
+
| `BrowserReplayExecution` | class | `new (toolset: BrowserToolsetInterface, revision: BrowserJourneyRevision, inputs: Readonly<Record<string, string>>, emitter: Emitter<BrowserReplayEventMap>, options?: BrowserReplayOptions, call?: BrowserCallOptions) => BrowserReplayExecutionInterface` | Owns the hold, captures, and completion of one prepared replay call. |
|
|
1054
|
+
| `BrowserJourneyPages` | class | `new (store: BrowserJourneyStoreInterface, signal: AbortSignal, empty: boolean) => BrowserJourneyPagesInterface` | Iterates a store listing while retaining its offset between page requests. |
|
|
1055
|
+
| `BrowserNavigationScan` | class | `new (steps: Iterable<BrowserNavigationStep>, frames: ReadonlySet<string>, any: boolean) => BrowserNavigationScan` | Yields the settlement selected after each navigation step. |
|
|
1056
|
+
| `BrowserReplayExecutionInterface` | interface | `{ result }` | Exposes the result of one prepared replay execution. |
|
|
1057
|
+
| `BROWSER_ERROR_CODES` | const | `readonly BrowserErrorCode[]` | Holds the declared codes accepted by the browser error guard. |
|
|
1058
|
+
| `BROWSER_ERROR_BRAND` | const | `unique symbol` | Identifies browser errors across installed copies and module formats. |
|
|
1059
|
+
| `BROWSER_STEP_ERROR_BRAND` | const | `unique symbol` | Identifies journey step errors across installed copies and module formats. |
|
|
1060
|
+
| `isBrowserErrorContext` | function | `(value: unknown) => value is JSONRecord` | Checks error metadata, including non-finite numbers that describe refused input values. |
|
|
1061
|
+
| `isBrowserAction` | function | `(value: unknown) => value is BrowserAction` | Checks whether a step error carries the declared action members. |
|
|
1062
1062
|
|
|
1063
1063
|
The quote helper uses a passage and search result prepared by the projection pipeline.
|
|
1064
1064
|
|
|
@@ -1087,14 +1087,14 @@ isBrowserSnapshotTables({ strings: [], documents: [] }) // true
|
|
|
1087
1087
|
|
|
1088
1088
|
#### Errors
|
|
1089
1089
|
|
|
1090
|
-
|
|
|
1091
|
-
| ------------------------ | -------- | --------------------------------------------------------------------------------------------- |
|
|
1092
|
-
| `BrowserError` | class | Reports a browser failure with a typed code and optional JSON context. |
|
|
1093
|
-
| `BrowserStepError` | class | Reports an incomplete journey step with its action and the code `STEP`. |
|
|
1094
|
-
| `BrowserErrorCode` | type | Identifies a browser refusal, lifecycle failure, or protocol failure. |
|
|
1095
|
-
| `describeBrowserRefusal` | function | Describes an element refusal, adding a fresh-reference instruction for `GONE`. |
|
|
1096
|
-
| `isBrowserError` | function | Checks whether an error carries the browser brand and declared members across package copies. |
|
|
1097
|
-
| `isBrowserStepError` | function | Checks whether a branded browser error carries the step brand and declared action members. |
|
|
1090
|
+
| Name | Kind | Signature | Summary |
|
|
1091
|
+
| ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
1092
|
+
| `BrowserError` | class | `new (code: BrowserErrorCode, message: string, context?: JSONRecord) => BrowserError` | Reports a browser failure with a typed code and optional JSON context. |
|
|
1093
|
+
| `BrowserStepError` | class | `new (id: string, action: BrowserAction) => BrowserStepError` | Reports an incomplete journey step with its action and the code `STEP`. |
|
|
1094
|
+
| `BrowserErrorCode` | type | `'ARGUMENT' \| 'CAPTURE_UNAVAILABLE' \| 'CAPTURE_UNTRUSTED' \| 'CLOSED' \| 'CONNECTION' \| 'DISCONNECTED' \| 'DOCUMENT' \| 'DOCUMENT_DESTROYED' \| 'DOCUMENT_OWN' \| 'DOCUMENT_SUBMIT' \| 'ELEMENT' \| 'ELEMENT_QUERY' \| 'HAR' \| 'STORE_ACCESS' \| 'JOURNEY_AMBIGUOUS' \| 'JOURNEY_DIALOG' \| 'JOURNEY_EDIT' \| 'JOURNEY_EMPTY' \| 'STORE_FILE' \| 'STORE_FORMAT' \| 'JOURNEY_GAP' \| 'JOURNEY_INPUT' \| 'JOURNEY_INVALID' \| 'STORE_LOCKED' \| 'JOURNEY_MISSING' \| 'STORE_PATH' \| 'JOURNEY_PLACEMENT' \| 'JOURNEY_READONLY' \| 'JOURNEY_RECORDING' \| 'JOURNEY_SAVED' \| 'JOURNEY_STALE' \| 'JOURNEY_TARGET' \| 'JSON' \| 'NAVIGATION' \| 'PROTOCOL' \| 'REMOTE' \| 'RESULT_LIMIT' \| 'SERVER_BUSY' \| 'SERVER_CRASH' \| 'SERVER_ENVIRONMENT' \| 'SERVER_EXHAUSTED' \| 'SERVER_HOLDER' \| 'SERVER_LAUNCH' \| 'SERVER_SWEEP' \| 'SERVER_TEARDOWN' \| 'SERVER_UNAVAILABLE' \| 'SERVER_UNRESOLVED' \| 'STEP' \| 'TARGET_HELD' \| 'TIMEOUT' \| 'TOOLSET_BUSY' \| 'TOOLSET_CAPTURE' \| 'TOOLSET_CONTEXT' \| 'TOOLSET_DIALOG' \| 'TOOLSET_LIMIT' \| 'TOOLSET_OBSERVE' \| 'TOOLSET_PAGE' \| 'TOOLSET_RECEIPT' \| 'TOOLSET_RESERVED' \| 'TOOLSET_ROLE' \| 'TOOLSET_SCHEME' \| 'TOOLSET_SETTLED' \| 'TOOLSET_TAB'` | Identifies a browser refusal, lifecycle failure, or protocol failure. |
|
|
1095
|
+
| `describeBrowserRefusal` | function | `(subject: string \| BrowserElementSubject, reason: BrowserElementReason, detail?: string) => string` | Describes an element refusal, adding a fresh-reference instruction for `GONE`. |
|
|
1096
|
+
| `isBrowserError` | function | `(value: unknown) => value is BrowserError` | Checks whether an error carries the browser brand and declared members across package copies. |
|
|
1097
|
+
| `isBrowserStepError` | function | `(value: unknown) => value is BrowserStepError` | Checks whether a branded browser error carries the step brand and declared action members. |
|
|
1098
1098
|
|
|
1099
1099
|
A caught `BrowserStepError` is also a `BrowserError`; check the step guard first when the action matters. Branch on `code`, and use `context.reason` for an `ELEMENT` refusal. `describeBrowserRefusal` builds its receipt. Abort signals reject with their original `signal.reason`, so a caught value need not be a browser error.
|
|
1100
1100
|
|
|
@@ -1182,109 +1182,109 @@ if (isBrowserError(error)) error.code // 'ARGUMENT'
|
|
|
1182
1182
|
|
|
1183
1183
|
#### Protocol layer
|
|
1184
1184
|
|
|
1185
|
-
|
|
|
1186
|
-
| ---------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1187
|
-
| `CDPClient` | class | Provides a lightweight Chrome DevTools Protocol client over a `CDPTransportInterface`. |
|
|
1188
|
-
| `createCDPClient` | function | Creates a `CDPClientInterface` bound to the given `CDPTransportInterface`. |
|
|
1189
|
-
| `BrowserStreamChunk` | interface | Represents one decoded IO stream read. |
|
|
1190
|
-
| `BrowserWebSocketFrame` | interface | Describes a WebSocket frame payload. |
|
|
1191
|
-
| `BrowserWebSocketInterface` | interface | Represents one observed WebSocket connection. |
|
|
1192
|
-
| `CDPClientInterface` | interface | Provides a lightweight Chrome DevTools Protocol client over a `CDPTransportInterface`. |
|
|
1193
|
-
| `CDPTarget` | interface | Represents one entry of the CDP `Target.getTargets` result. |
|
|
1194
|
-
| `CDPTransportInterface` | interface | Represents the text pipe a `CDPClient` sends and receives JSON-RPC frames over. |
|
|
1195
|
-
| `CDPClientOptions` | interface | Describes the options for creating a `CDPClient` instance. |
|
|
1196
|
-
| `CDPSendOptions` | interface | Describes the options for one CDP method call. |
|
|
1197
|
-
| `BrowserWebSocketEventMap` | type | Maps the WebSocket lifecycle events. |
|
|
1198
|
-
| `CDPClientEventMap` | type | Maps the events a `CDPClientInterface` emits. |
|
|
1199
|
-
| `CDPHandler` | type | Receives a subscribed CDP event with its params record. |
|
|
1200
|
-
| `CDPTransportEventMap` | type | Maps the events emitted by a `CDPTransportInterface` — the raw text pipe a `CDPClientInterface` sends and receives JSON-RPC frames over. |
|
|
1201
|
-
| `browserHeadersToProtocol` | function | Converts a header record to Fetch-domain name/value entries. |
|
|
1202
|
-
| `browserPDFToParams` | function | Validates and compiles Page.printToPDF parameters. |
|
|
1203
|
-
| `browserScreenshotToParams` | function | Validates and compiles basic Page.captureScreenshot parameters. |
|
|
1204
|
-
| `compileActionabilityFunction` | function | Compiles the element-side actionability pass used before trusted input. |
|
|
1205
|
-
| `compileBrowserBindingCleanup` | function | Compiles current-document cleanup for one page-side host binding facade. |
|
|
1206
|
-
| `compileBrowserBindingResult` | function | Compiles delivery of a host binding result to one execution context. |
|
|
1207
|
-
| `compileBrowserBindingSource` | function | Compiles the page-side promise facade for one Runtime binding. |
|
|
1208
|
-
| `compileBrowserJourney` | function | Compiles a journey into a standalone module that performs each step through the `follow` method of a toolset the module constructs on the page. The module checks its inputs before any step. |
|
|
1209
|
-
| `compileBrowserJourneyValue` | function | Compiles a JSON value into the JavaScript literal a generated journey module carries. |
|
|
1210
|
-
| `compileGuardedEvaluateExpression` | function | Compiles a `Runtime.evaluate` expression so the in-page code stringifies its own result and throws a recognizable sentinel error before an oversized result would overflow the CDP transport frame. |
|
|
1211
|
-
| `compileHitFunction` | function | Compiles the descendant hit check for a resolved element. |
|
|
1212
|
-
| `compileQueryWaitExpression` | function | Compiles a wait woken by mutations and finished transitions and animations, with one deadline and explicit disconnect ownership. |
|
|
1213
|
-
| `compileReadFunction` | function | Compiles the in-page function that reads the document's URL, title, and rendered HTML. |
|
|
1214
|
-
| `compileScreenshotCleanupExpression` | function | Compiles cleanup for temporary screenshot styles and masks. |
|
|
1215
|
-
| `compileScreenshotPreparationExpression` | function | Compiles temporary animation, caret, and mask setup for a screenshot. |
|
|
1216
|
-
| `compileSelectFunction` | function | Compiles text selection or select-option assignment against the resolved element. |
|
|
1217
|
-
| `compileStorageClearExpression` | function | Compiles an expression that clears local and session storage. |
|
|
1218
|
-
| `compileStorageReadExpression` | function | Compiles an expression that serializes local and session storage. |
|
|
1219
|
-
| `compileStorageRestoreExpression` | function | Compiles an expression that restores one origin's web storage. |
|
|
1220
|
-
| `compileSubmitObserverExpression` | function | Compiles the installation of a capture-phase `submit` observer owned by `token` on the window of the world it runs in. |
|
|
1221
|
-
| `compileSubmitReadExpression` | function | Compiles the read of the `submit` observer `compileSubmitObserverExpression` installs for `token`, preserving the observer until cleanup. |
|
|
1222
|
-
| `compileSubmitReleaseExpression` | function | Compiles token-scoped cleanup of submission listeners and change observation. |
|
|
1223
|
-
| `compileSubmitWaitExpression` | function | Compiles a bounded wait for the first rendered change after submission. |
|
|
1224
|
-
| `compileTextWaitExpression` | function | Compiles a wait for the presence or absence of visible text, coalesced by tasks. |
|
|
1225
|
-
| `concatBytes` | function | Concatenates byte chunks without Node-specific buffers. |
|
|
1226
|
-
| `cookieToProtocol` | function | Converts a typed cookie input into Chromium protocol fields. |
|
|
1227
|
-
| `keyToBrowserInput` | function | Normalizes one key to CDP keyboard event data. |
|
|
1228
|
-
| `mediaToFeatures` | function | Converts typed media preferences to Chromium emulated media features. |
|
|
1229
|
-
| `parseBrowserAXString` | function | Coerces a string-valued Accessibility-domain AXValue to a string, or `undefined` off-shape. |
|
|
1230
|
-
| `parseBrowserBindingCall` | function | Coerces one Runtime binding invocation to a `BrowserBindingCall`, or `undefined` off-shape. |
|
|
1231
|
-
| `parseBrowserConsoleMessage` | function | Coerces one `Runtime.consoleAPICalled` event to a `BrowserConsoleMessage`, or `undefined` off-shape. |
|
|
1232
|
-
| `parseBrowserCookiePartition` | function | Coerces an optional Chromium cookie partition key to a `BrowserCookiePartition`, or `undefined` off-shape. |
|
|
1233
|
-
| `parseBrowserDownloadProgress` | function | Coerces one `Browser.downloadProgress` event to a `BrowserDownloadProgress`, or `undefined` off-shape. |
|
|
1234
|
-
| `parseBrowserDownloadStart` | function | Coerces one `Browser.downloadWillBegin` event to a `BrowserDownloadStart`, or `undefined` off-shape. |
|
|
1235
|
-
| `parseBrowserInvocation` | function | Coerces a WebMCP `toolInvoked` event without parsing its authored input text. |
|
|
1236
|
-
| `parseBrowserInvocationResult` | function | Coerces a WebMCP `toolResponded` event, preserving output and terminal status. |
|
|
1237
|
-
| `parseBrowserJourney` | function | Parses a journey without throwing when validation fails. |
|
|
1238
|
-
| `parseBrowserJourneyEdit` | function | Parses an edit without throwing when its structure fails validation. |
|
|
1239
|
-
| `parseBrowserPageError` | function | Coerces one `Runtime.exceptionThrown` event to a `BrowserPageError`, or `undefined` off-shape. |
|
|
1240
|
-
| `parseBrowserRect` | function | Coerces a four-number CSS-pixel rectangle to a `BrowserRect`, or `undefined` off-shape. |
|
|
1241
|
-
| `parseBrowserReference` | function | Parses the supported element-reference spellings into their canonical form. |
|
|
1242
|
-
| `parseBrowserToolInteger` | function | Parses an integer or a canonical unsigned decimal string for a tool coordinate. |
|
|
1243
|
-
| `parseBrowserRemoval` | function | Coerces a WebMCP `RemovedTool` object to its document and name key. |
|
|
1244
|
-
| `parseBrowserRequest` | function | Coerces one `Network.requestWillBeSent` or `Fetch.requestPaused` event to a `BrowserRequest`, or `undefined` off-shape. |
|
|
1245
|
-
| `parseBrowserRequestFailure` | function | Coerces one `Network.loadingFailed` event to a `BrowserRequestFailure`, or `undefined` off-shape. |
|
|
1246
|
-
| `parseBrowserResponse` | function | Coerces one `Network.responseReceived` event to a `BrowserResponse`, or `undefined` off-shape. |
|
|
1247
|
-
| `parseBrowserResponseRecord` | function | Coerces one Chromium response object plus its event identity to a `BrowserResponse`, or `undefined` off-shape. |
|
|
1248
|
-
| `parseBrowserRun` | function | Parses a run without throwing when validation fails. |
|
|
1249
|
-
| `parseBrowserSecurity` | function | Coerces Chromium TLS security details to a `BrowserSecurity`, or `undefined` off-shape. |
|
|
1250
|
-
| `parseBrowserTiming` | function | Coerces Chromium response timing to a `BrowserTiming`, or `undefined` off-shape. |
|
|
1251
|
-
| `parseBrowserTimingRange` | function | Coerces one named start/end pair of Chromium network timing to a `BrowserTimingRange`, or `undefined` off-shape. |
|
|
1252
|
-
| `parseBrowserTool` | function | Coerces a WebMCP `Tool` object to its browser-domain representation. |
|
|
1253
|
-
| `parseBrowserWebSocketFrame` | function | Coerces one WebSocket frame event to a `BrowserWebSocketFrame`, or `undefined` off-shape. |
|
|
1254
|
-
| `parseCodegenActionPayload` | function | Parses a sanitized document gesture, refusing malformed or secret-bearing payloads. |
|
|
1255
|
-
| `parseNumberArray` | function | Coerces an unknown value to an all-number array, or `undefined` off-shape. |
|
|
1256
|
-
| `parseSnapshotString` | function | Coerces one CDP snapshot string-table index to its string, or `undefined` off-shape. |
|
|
1257
|
-
| `readBrowserAccessibility` | function | Decodes Accessibility-domain nodes into a flat serializable tree, throwing a `BrowserError` off-shape. |
|
|
1258
|
-
| `readBrowserAttributes` | function | Decodes flattened CDP node attributes into a frozen record, skipping every off-shape pair. |
|
|
1259
|
-
| `readBrowserAXValue` | function | Decodes an Accessibility-domain AXValue, or `undefined` when the record carries none. |
|
|
1260
|
-
| `readBrowserCookie` | function | Decodes one Chromium cookie, throwing a `BrowserError` off-shape. |
|
|
1261
|
-
| `readBrowserCookies` | function | Decodes the cookies `Storage.getCookies` returns, throwing a `BrowserError` off-shape. |
|
|
1262
|
-
| `readBrowserCoverageRanges` | function | Decodes and normalizes coverage ranges, throwing a `BrowserError` off-shape. |
|
|
1263
|
-
| `readBrowserFrames` | function | Decodes a flattened CDP `Page.getFrameTree` result into depth-first frame metadata, skipping every off-shape frame, then appends each attached out-of-process iframe target the tree does not list. |
|
|
1264
|
-
| `readBrowserHeaders` | function | Decodes a Chromium Headers object into string values, skipping every entry that is neither a string nor a finite number. |
|
|
1265
|
-
| `readBrowserMetrics` | function | Decodes Performance-domain metrics, throwing a `BrowserError` off-shape. |
|
|
1266
|
-
| `readBrowserProfile` | function | Decodes one CPU profile, throwing a `BrowserError` off-shape. |
|
|
1267
|
-
| `readBrowserProfileFrame` | function | Decodes a CPU profile call frame, throwing a `BrowserError` off-shape. |
|
|
1268
|
-
| `readBrowserQuad` | function | Decodes the first `DOM.getContentQuads` quad and its center, throwing a `BrowserError` off-shape. |
|
|
1269
|
-
| `readBrowserRemoteValue` | function | Decodes a Runtime remote object's printable value, falling back to its unserializable form and then its description, or `undefined` when it carries none. |
|
|
1270
|
-
| `readBrowserScriptCoverage` | function | Decodes JavaScript precise coverage, throwing a `BrowserError` off-shape. |
|
|
1271
|
-
| `readBrowserScriptIdentifier` | function | Decodes the `Page.addScriptToEvaluateOnNewDocument` result, throwing a `BrowserError` off-shape. |
|
|
1272
|
-
| `readBrowserSnapshot` | function | Decodes a CDP `DOMSnapshot.captureSnapshot` result into a serializable `BrowserSnapshotInput`, throwing a `BrowserError` off-shape and a `BrowserError` past the configured node limit. |
|
|
1273
|
-
| `readBrowserStack` | function | Decodes a Chromium runtime stack trace, skipping every off-shape call frame. |
|
|
1274
|
-
| `readBrowserStorageEntries` | function | Decodes a list of web-storage entries, throwing a `BrowserError` off-shape. |
|
|
1275
|
-
| `readBrowserStorageOrigin` | function | Decodes one in-page web-storage snapshot, throwing a `BrowserError` off-shape. |
|
|
1276
|
-
| `readBrowserStreamChunk` | function | Decodes one `IO.read` response, throwing a `BrowserError` off-shape. |
|
|
1277
|
-
| `readBrowserStyleCoverage` | function | Decodes CSS rule usage, throwing a `BrowserError` off-shape. |
|
|
1278
|
-
| `readBrowserToolString` | function | Reads a required string argument from a tool call. |
|
|
1279
|
-
| `readBrowserWorld` | function | Reads the execution context id from a CDP `Page.createIsolatedWorld` reply. |
|
|
1280
|
-
| `readEvaluationResult` | function | Decodes one CDP `Runtime.evaluate` result, throwing a `BrowserError` on a failed evaluation and a `BrowserError` past the guarded result size. |
|
|
1281
|
-
| `readRareBooleanData` | function | Decodes CDP snapshot sparse boolean data into a set of node indexes, skipping every off-shape entry. |
|
|
1282
|
-
| `readRareIntegerData` | function | Decodes CDP snapshot sparse integer data into a node-index map, skipping every off-shape entry. |
|
|
1283
|
-
| `readRareStringData` | function | Decodes CDP snapshot sparse string data into a node-index map, skipping every off-shape entry. |
|
|
1284
|
-
| `BROWSER_CONTEXT_LOSS_PATTERN` | const | Matches protocol errors caused by replacement or closure of an execution context. |
|
|
1285
|
-
| `BROWSER_RESULT_LIMIT` | const | Caps the serialized-character length for an `evaluate()`/`read()` result at `2_500_000`, enforced in-page before the result is returned to CDP. |
|
|
1286
|
-
| `BROWSER_RESULT_LIMIT_PATTERN` | const | Matches the in-page result-limit sentinel error message, anchored immediately after the `Error:` (optionally `Uncaught Error:`) prefix Chromium prepends to a thrown error's description, `/^(?:Uncaught )?Error: \[\[ORKESTREL_BROWSER_RESULT_LIMIT\]\](\d+)/`. |
|
|
1287
|
-
| `BROWSER_RESULT_LIMIT_SENTINEL_PREFIX` | const | Names the distinctive prefix for the in-page result-limit sentinel error, `'[[ORKESTREL_BROWSER_RESULT_LIMIT]]'`, immediately followed by the serialized length. |
|
|
1185
|
+
| Name | Kind | Signature | Summary |
|
|
1186
|
+
| ---------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1187
|
+
| `CDPClient` | class | `new (options: CDPClientOptions) => CDPClientInterface` | Provides a lightweight Chrome DevTools Protocol client over a `CDPTransportInterface`. |
|
|
1188
|
+
| `createCDPClient` | function | `(options: CDPClientOptions) => CDPClientInterface` | Creates a `CDPClientInterface` bound to the given `CDPTransportInterface`. |
|
|
1189
|
+
| `BrowserStreamChunk` | interface | `{ bytes, eof }` | Represents one decoded IO stream read. |
|
|
1190
|
+
| `BrowserWebSocketFrame` | interface | `{ opcode, data, masked, timestamp }` | Describes a WebSocket frame payload. |
|
|
1191
|
+
| `BrowserWebSocketInterface` | interface | `{ emitter, id, url }` | Represents one observed WebSocket connection. |
|
|
1192
|
+
| `CDPClientInterface` | interface | `{ emitter, connected, connect(), reconnect(), send(), subscribe(), unsubscribe(), close() }` | Provides a lightweight Chrome DevTools Protocol client over a `CDPTransportInterface`. |
|
|
1193
|
+
| `CDPTarget` | interface | `{ id, category, title, url }` | Represents one entry of the CDP `Target.getTargets` result. |
|
|
1194
|
+
| `CDPTransportInterface` | interface | `{ emitter, start(), send(), close() }` | Represents the text pipe a `CDPClient` sends and receives JSON-RPC frames over. |
|
|
1195
|
+
| `CDPClientOptions` | interface | `{ transport, timeout?, on?, error? }` | Describes the options for creating a `CDPClient` instance. |
|
|
1196
|
+
| `CDPSendOptions` | interface | `{ session?, timeout?, signal? }` | Describes the options for one CDP method call. |
|
|
1197
|
+
| `BrowserWebSocketEventMap` | type | `{ readonly receive: readonly [frame: BrowserWebSocketFrame]; readonly transmit: readonly [frame: BrowserWebSocketFrame]; readonly error: readonly [message: string]; readonly close: readonly [timestamp: number]; }` | Maps the WebSocket lifecycle events. |
|
|
1198
|
+
| `CDPClientEventMap` | type | `{ readonly connect: readonly []; readonly close: readonly []; readonly drop: readonly []; readonly error: readonly [error: unknown]; }` | Maps the events a `CDPClientInterface` emits. |
|
|
1199
|
+
| `CDPHandler` | type | `(params: Readonly<Record<string, unknown>>) => void` | Receives a subscribed CDP event with its params record. |
|
|
1200
|
+
| `CDPTransportEventMap` | type | `{ readonly message: readonly [data: string]; readonly close: readonly []; readonly error: readonly [error: unknown]; }` | Maps the events emitted by a `CDPTransportInterface` — the raw text pipe a `CDPClientInterface` sends and receives JSON-RPC frames over. |
|
|
1201
|
+
| `browserHeadersToProtocol` | function | `(headers: Readonly<Record<string, string>>) => ReadonlyArray<Readonly<Record<string, string>>>` | Converts a header record to Fetch-domain name/value entries. |
|
|
1202
|
+
| `browserPDFToParams` | function | `(options?: BrowserPDFOptions) => Readonly<Record<string, unknown>>` | Validates and compiles Page.printToPDF parameters. |
|
|
1203
|
+
| `browserScreenshotToParams` | function | `(options?: BrowserScreenshotOptions) => Readonly<Record<string, unknown>>` | Validates and compiles basic Page.captureScreenshot parameters. |
|
|
1204
|
+
| `compileActionabilityFunction` | function | `(options: BrowserActionabilityOptions) => string` | Compiles the element-side actionability pass used before trusted input. |
|
|
1205
|
+
| `compileBrowserBindingCleanup` | function | `(name: string) => string` | Compiles current-document cleanup for one page-side host binding facade. |
|
|
1206
|
+
| `compileBrowserBindingResult` | function | `(name: string, id: string, success: boolean, value: unknown) => string` | Compiles delivery of a host binding result to one execution context. |
|
|
1207
|
+
| `compileBrowserBindingSource` | function | `(name: string) => string` | Compiles the page-side promise facade for one Runtime binding. |
|
|
1208
|
+
| `compileBrowserJourney` | function | `(journey: BrowserJourney, options?: { readonly language?: BrowserCodegenLanguage; }) => BrowserCodegenScript` | Compiles a journey into a standalone module that performs each step through the `follow` method of a toolset the module constructs on the page. The module checks its inputs before any step. |
|
|
1209
|
+
| `compileBrowserJourneyValue` | function | `(value: JSONValue, bindings?: ReadonlyMap<string, string>) => string` | Compiles a JSON value into the JavaScript literal a generated journey module carries. |
|
|
1210
|
+
| `compileGuardedEvaluateExpression` | function | `(expression: string, limit: number) => string` | Compiles a `Runtime.evaluate` expression so the in-page code stringifies its own result and throws a recognizable sentinel error before an oversized result would overflow the CDP transport frame. |
|
|
1211
|
+
| `compileHitFunction` | function | `() => string` | Compiles the descendant hit check for a resolved element. |
|
|
1212
|
+
| `compileQueryWaitExpression` | function | `(deadline: number, key: string, predicate?: string) => string` | Compiles a wait woken by mutations and finished transitions and animations, with one deadline and explicit disconnect ownership. |
|
|
1213
|
+
| `compileReadFunction` | function | `() => string` | Compiles the in-page function that reads the document's URL, title, and rendered HTML. |
|
|
1214
|
+
| `compileScreenshotCleanupExpression` | function | `(token: string) => string` | Compiles cleanup for temporary screenshot styles and masks. |
|
|
1215
|
+
| `compileScreenshotPreparationExpression` | function | `(options?: BrowserScreenshotOptions, masks?: readonly BrowserRect[]) => string \| undefined` | Compiles temporary animation, caret, and mask setup for a screenshot. |
|
|
1216
|
+
| `compileSelectFunction` | function | `(values?: readonly string[]) => string` | Compiles text selection or select-option assignment against the resolved element. |
|
|
1217
|
+
| `compileStorageClearExpression` | function | `() => string` | Compiles an expression that clears local and session storage. |
|
|
1218
|
+
| `compileStorageReadExpression` | function | `() => string` | Compiles an expression that serializes local and session storage. |
|
|
1219
|
+
| `compileStorageRestoreExpression` | function | `(origin: BrowserStorageOrigin) => string` | Compiles an expression that restores one origin's web storage. |
|
|
1220
|
+
| `compileSubmitObserverExpression` | function | `(token: number) => string` | Compiles the installation of a capture-phase `submit` observer owned by `token` on the window of the world it runs in. |
|
|
1221
|
+
| `compileSubmitReadExpression` | function | `(token: number) => string` | Compiles the read of the `submit` observer `compileSubmitObserverExpression` installs for `token`, preserving the observer until cleanup. |
|
|
1222
|
+
| `compileSubmitReleaseExpression` | function | `(token: number) => string` | Compiles token-scoped cleanup of submission listeners and change observation. |
|
|
1223
|
+
| `compileSubmitWaitExpression` | function | `(token: number, timeout: number) => string` | Compiles a bounded wait for the first rendered change after submission. |
|
|
1224
|
+
| `compileTextWaitExpression` | function | `(text: string, deadline: number, key: string, absent?: boolean) => string` | Compiles a wait for the presence or absence of visible text, coalesced by tasks. |
|
|
1225
|
+
| `concatBytes` | function | `(chunks: readonly Uint8Array[]) => Uint8Array` | Concatenates byte chunks without Node-specific buffers. |
|
|
1226
|
+
| `cookieToProtocol` | function | `(cookie: BrowserCookieInput) => Readonly<Record<string, unknown>>` | Converts a typed cookie input into Chromium protocol fields. |
|
|
1227
|
+
| `keyToBrowserInput` | function | `(value: string) => BrowserKey` | Normalizes one key to CDP keyboard event data. |
|
|
1228
|
+
| `mediaToFeatures` | function | `(media: BrowserMedia) => ReadonlyArray<Readonly<Record<string, string>>>` | Converts typed media preferences to Chromium emulated media features. |
|
|
1229
|
+
| `parseBrowserAXString` | function | `(value: unknown) => string \| undefined` | Coerces a string-valued Accessibility-domain AXValue to a string, or `undefined` off-shape. |
|
|
1230
|
+
| `parseBrowserBindingCall` | function | `(value: unknown) => BrowserBindingCall \| undefined` | Coerces one Runtime binding invocation to a `BrowserBindingCall`, or `undefined` off-shape. |
|
|
1231
|
+
| `parseBrowserConsoleMessage` | function | `(value: unknown) => BrowserConsoleMessage \| undefined` | Coerces one `Runtime.consoleAPICalled` event to a `BrowserConsoleMessage`, or `undefined` off-shape. |
|
|
1232
|
+
| `parseBrowserCookiePartition` | function | `(value: unknown) => BrowserCookiePartition \| undefined` | Coerces an optional Chromium cookie partition key to a `BrowserCookiePartition`, or `undefined` off-shape. |
|
|
1233
|
+
| `parseBrowserDownloadProgress` | function | `(value: unknown) => readonly [id: string, progress: BrowserDownloadProgress] \| undefined` | Coerces one `Browser.downloadProgress` event to a `BrowserDownloadProgress`, or `undefined` off-shape. |
|
|
1234
|
+
| `parseBrowserDownloadStart` | function | `(value: unknown) => BrowserDownloadStart \| undefined` | Coerces one `Browser.downloadWillBegin` event to a `BrowserDownloadStart`, or `undefined` off-shape. |
|
|
1235
|
+
| `parseBrowserInvocation` | function | `(value: unknown) => BrowserInvocation \| undefined` | Coerces a WebMCP `toolInvoked` event without parsing its authored input text. |
|
|
1236
|
+
| `parseBrowserInvocationResult` | function | `(value: unknown) => BrowserInvocationResult \| undefined` | Coerces a WebMCP `toolResponded` event, preserving output and terminal status. |
|
|
1237
|
+
| `parseBrowserJourney` | function | `(value: unknown) => BrowserJourney \| undefined` | Parses a journey without throwing when validation fails. |
|
|
1238
|
+
| `parseBrowserJourneyEdit` | function | `(value: unknown) => BrowserJourneyEdit \| undefined` | Parses an edit without throwing when its structure fails validation. |
|
|
1239
|
+
| `parseBrowserPageError` | function | `(value: unknown) => BrowserPageError \| undefined` | Coerces one `Runtime.exceptionThrown` event to a `BrowserPageError`, or `undefined` off-shape. |
|
|
1240
|
+
| `parseBrowserRect` | function | `(value: unknown) => BrowserRect \| undefined` | Coerces a four-number CSS-pixel rectangle to a `BrowserRect`, or `undefined` off-shape. |
|
|
1241
|
+
| `parseBrowserReference` | function | `(value: string) => string \| undefined` | Parses the supported element-reference spellings into their canonical form. |
|
|
1242
|
+
| `parseBrowserToolInteger` | function | `(value: unknown) => number \| undefined` | Parses an integer or a canonical unsigned decimal string for a tool coordinate. |
|
|
1243
|
+
| `parseBrowserRemoval` | function | `(value: unknown) => BrowserToolRemoval \| undefined` | Coerces a WebMCP `RemovedTool` object to its document and name key. |
|
|
1244
|
+
| `parseBrowserRequest` | function | `(value: unknown) => BrowserRequest \| undefined` | Coerces one `Network.requestWillBeSent` or `Fetch.requestPaused` event to a `BrowserRequest`, or `undefined` off-shape. |
|
|
1245
|
+
| `parseBrowserRequestFailure` | function | `(value: unknown) => BrowserRequestFailure \| undefined` | Coerces one `Network.loadingFailed` event to a `BrowserRequestFailure`, or `undefined` off-shape. |
|
|
1246
|
+
| `parseBrowserResponse` | function | `(value: unknown) => BrowserResponse \| undefined` | Coerces one `Network.responseReceived` event to a `BrowserResponse`, or `undefined` off-shape. |
|
|
1247
|
+
| `parseBrowserResponseRecord` | function | `(value: unknown, id: string, loader: string, frame: string \| undefined, timestamp: number) => BrowserResponse \| undefined` | Coerces one Chromium response object plus its event identity to a `BrowserResponse`, or `undefined` off-shape. |
|
|
1248
|
+
| `parseBrowserRun` | function | `(value: unknown) => BrowserRun \| undefined` | Parses a run without throwing when validation fails. |
|
|
1249
|
+
| `parseBrowserSecurity` | function | `(value: unknown) => BrowserSecurity \| undefined` | Coerces Chromium TLS security details to a `BrowserSecurity`, or `undefined` off-shape. |
|
|
1250
|
+
| `parseBrowserTiming` | function | `(value: unknown) => BrowserTiming \| undefined` | Coerces Chromium response timing to a `BrowserTiming`, or `undefined` off-shape. |
|
|
1251
|
+
| `parseBrowserTimingRange` | function | `(value: unknown, start: string, end: string) => BrowserTimingRange \| undefined` | Coerces one named start/end pair of Chromium network timing to a `BrowserTimingRange`, or `undefined` off-shape. |
|
|
1252
|
+
| `parseBrowserTool` | function | `(value: unknown) => BrowserTool \| undefined` | Coerces a WebMCP `Tool` object to its browser-domain representation. |
|
|
1253
|
+
| `parseBrowserWebSocketFrame` | function | `(value: unknown) => BrowserWebSocketFrame \| undefined` | Coerces one WebSocket frame event to a `BrowserWebSocketFrame`, or `undefined` off-shape. |
|
|
1254
|
+
| `parseCodegenActionPayload` | function | `(payload: unknown) => BrowserCodegenGesture \| undefined` | Parses a sanitized document gesture, refusing malformed or secret-bearing payloads. |
|
|
1255
|
+
| `parseNumberArray` | function | `(value: unknown) => readonly number[] \| undefined` | Coerces an unknown value to an all-number array, or `undefined` off-shape. |
|
|
1256
|
+
| `parseSnapshotString` | function | `(strings: readonly string[], index: unknown) => string \| undefined` | Coerces one CDP snapshot string-table index to its string, or `undefined` off-shape. |
|
|
1257
|
+
| `readBrowserAccessibility` | function | `(value: unknown) => BrowserAccessibilitySnapshot` | Decodes Accessibility-domain nodes into a flat serializable tree, throwing a `BrowserError` off-shape. |
|
|
1258
|
+
| `readBrowserAttributes` | function | `(value: unknown, strings: readonly string[]) => Readonly<Record<string, string>>` | Decodes flattened CDP node attributes into a frozen record, skipping every off-shape pair. |
|
|
1259
|
+
| `readBrowserAXValue` | function | `(value: unknown) => unknown` | Decodes an Accessibility-domain AXValue, or `undefined` when the record carries none. |
|
|
1260
|
+
| `readBrowserCookie` | function | `(value: unknown, index: number) => BrowserCookie` | Decodes one Chromium cookie, throwing a `BrowserError` off-shape. |
|
|
1261
|
+
| `readBrowserCookies` | function | `(value: unknown) => readonly BrowserCookie[]` | Decodes the cookies `Storage.getCookies` returns, throwing a `BrowserError` off-shape. |
|
|
1262
|
+
| `readBrowserCoverageRanges` | function | `(value: unknown, script: number) => readonly BrowserCoverageRange[]` | Decodes and normalizes coverage ranges, throwing a `BrowserError` off-shape. |
|
|
1263
|
+
| `readBrowserFrames` | function | `(value: unknown, targets?: readonly BrowserFrameInfo[]) => readonly BrowserFrameInfo[]` | Decodes a flattened CDP `Page.getFrameTree` result into depth-first frame metadata, skipping every off-shape frame, then appends each attached out-of-process iframe target the tree does not list. |
|
|
1264
|
+
| `readBrowserHeaders` | function | `(value: unknown) => Readonly<Record<string, string>>` | Decodes a Chromium Headers object into string values, skipping every entry that is neither a string nor a finite number. |
|
|
1265
|
+
| `readBrowserMetrics` | function | `(value: unknown) => readonly BrowserMetric[]` | Decodes Performance-domain metrics, throwing a `BrowserError` off-shape. |
|
|
1266
|
+
| `readBrowserProfile` | function | `(value: unknown) => BrowserProfile` | Decodes one CPU profile, throwing a `BrowserError` off-shape. |
|
|
1267
|
+
| `readBrowserProfileFrame` | function | `(value: unknown, node: number) => BrowserProfileFrame` | Decodes a CPU profile call frame, throwing a `BrowserError` off-shape. |
|
|
1268
|
+
| `readBrowserQuad` | function | `(value: unknown) => BrowserQuad` | Decodes the first `DOM.getContentQuads` quad and its center, throwing a `BrowserError` off-shape. |
|
|
1269
|
+
| `readBrowserRemoteValue` | function | `(value: unknown) => unknown` | Decodes a Runtime remote object's printable value, falling back to its unserializable form and then its description, or `undefined` when it carries none. |
|
|
1270
|
+
| `readBrowserScriptCoverage` | function | `(value: unknown) => readonly BrowserScriptCoverage[]` | Decodes JavaScript precise coverage, throwing a `BrowserError` off-shape. |
|
|
1271
|
+
| `readBrowserScriptIdentifier` | function | `(value: unknown) => string` | Decodes the `Page.addScriptToEvaluateOnNewDocument` result, throwing a `BrowserError` off-shape. |
|
|
1272
|
+
| `readBrowserSnapshot` | function | `(value: unknown, styles?: readonly string[], limit?: number) => BrowserSnapshotInput` | Decodes a CDP `DOMSnapshot.captureSnapshot` result into a serializable `BrowserSnapshotInput`, throwing a `BrowserError` off-shape and a `BrowserError` past the configured node limit. |
|
|
1273
|
+
| `readBrowserStack` | function | `(value: unknown) => readonly BrowserStackFrame[]` | Decodes a Chromium runtime stack trace, skipping every off-shape call frame. |
|
|
1274
|
+
| `readBrowserStorageEntries` | function | `(value: unknown, origin: string, storage: 'local' \| 'session') => readonly BrowserStorageEntry[]` | Decodes a list of web-storage entries, throwing a `BrowserError` off-shape. |
|
|
1275
|
+
| `readBrowserStorageOrigin` | function | `(value: unknown, origin: string) => BrowserStorageOrigin` | Decodes one in-page web-storage snapshot, throwing a `BrowserError` off-shape. |
|
|
1276
|
+
| `readBrowserStreamChunk` | function | `(value: unknown) => BrowserStreamChunk` | Decodes one `IO.read` response, throwing a `BrowserError` off-shape. |
|
|
1277
|
+
| `readBrowserStyleCoverage` | function | `(value: unknown) => readonly BrowserStyleCoverage[]` | Decodes CSS rule usage, throwing a `BrowserError` off-shape. |
|
|
1278
|
+
| `readBrowserToolString` | function | `(args: Readonly<Record<string, unknown>>, key: string) => string` | Reads a required string argument from a tool call. |
|
|
1279
|
+
| `readBrowserWorld` | function | `(value: unknown, frame: string) => number` | Reads the execution context id from a CDP `Page.createIsolatedWorld` reply. |
|
|
1280
|
+
| `readEvaluationResult` | function | `(value: unknown) => unknown` | Decodes one CDP `Runtime.evaluate` result, throwing a `BrowserError` on a failed evaluation and a `BrowserError` past the guarded result size. |
|
|
1281
|
+
| `readRareBooleanData` | function | `(value: unknown) => ReadonlySet<number>` | Decodes CDP snapshot sparse boolean data into a set of node indexes, skipping every off-shape entry. |
|
|
1282
|
+
| `readRareIntegerData` | function | `(value: unknown) => ReadonlyMap<number, number>` | Decodes CDP snapshot sparse integer data into a node-index map, skipping every off-shape entry. |
|
|
1283
|
+
| `readRareStringData` | function | `(value: unknown, strings: readonly string[]) => ReadonlyMap<number, string>` | Decodes CDP snapshot sparse string data into a node-index map, skipping every off-shape entry. |
|
|
1284
|
+
| `BROWSER_CONTEXT_LOSS_PATTERN` | const | `RegExp` | Matches protocol errors caused by replacement or closure of an execution context. |
|
|
1285
|
+
| `BROWSER_RESULT_LIMIT` | const | `2500000` | Caps the serialized-character length for an `evaluate()`/`read()` result at `2_500_000`, enforced in-page before the result is returned to CDP. |
|
|
1286
|
+
| `BROWSER_RESULT_LIMIT_PATTERN` | const | `RegExp` | Matches the in-page result-limit sentinel error message, anchored immediately after the `Error:` (optionally `Uncaught Error:`) prefix Chromium prepends to a thrown error's description, `/^(?:Uncaught )?Error: \[\[ORKESTREL_BROWSER_RESULT_LIMIT\]\](\d+)/`. |
|
|
1287
|
+
| `BROWSER_RESULT_LIMIT_SENTINEL_PREFIX` | const | `"[[ORKESTREL_BROWSER_RESULT_LIMIT]]"` | Names the distinctive prefix for the in-page result-limit sentinel error, `'[[ORKESTREL_BROWSER_RESULT_LIMIT]]'`, immediately followed by the serialized length. |
|
|
1288
1288
|
|
|
1289
1289
|
##### Protocol decoding
|
|
1290
1290
|
|
|
@@ -1351,92 +1351,92 @@ await browser.destroy()
|
|
|
1351
1351
|
|
|
1352
1352
|
#### Context and page
|
|
1353
1353
|
|
|
1354
|
-
|
|
|
1355
|
-
| --------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1356
|
-
| `Browser` | class | Discovers, launches, connects to, and owns Chromium-family browser sessions. |
|
|
1357
|
-
| `FileBrowserWriter` | class | Persists captured browser bytes to the filesystem through `node:fs/promises`. |
|
|
1358
|
-
| `createBrowser` | function | Creates a raw-CDP `BrowserInterface` façade with discovery, connection, and lifecycle management. |
|
|
1359
|
-
| `createBrowserProfile` | function | Resolves a persistent caller profile or creates an isolated temporary one. |
|
|
1360
|
-
| `createFileBrowserWriter` | function | Creates a filesystem-backed `BrowserWriterInterface` that persists bytes through `node:fs/promises`. |
|
|
1361
|
-
| `BrowserDiscoveryResult` | interface | Describes the result of passive browser discovery. |
|
|
1362
|
-
| `BrowserInterface` | interface | Wraps a browser with discovery, connection management, and lifecycle control. |
|
|
1363
|
-
| `BrowserProfileRecord` | interface | Names the browser a browse profile serves, which a later start's sweep reads. |
|
|
1364
|
-
| `BrowserProfileResult` | interface | Describes the resolved browser profile directory used for a Chromium-family launch. |
|
|
1365
|
-
| `BrowserServerCatalog` | interface | Describes the JSON catalog returned by the holder tools. |
|
|
1366
|
-
| `BrowserOptions` | interface | Describes the options for creating a `Browser` instance. |
|
|
1367
|
-
| `SystemBrowserOptions` | interface | Describes the options overriding the candidate sources for `findSystemBrowsers`. |
|
|
1368
|
-
| `BrowserConnection` | type | Names how the browser connection was established. |
|
|
1369
|
-
| `BrowserEngine` | type | Names a supported browser engine (raw CDP targets Chromium-family browsers only). |
|
|
1370
|
-
| `BrowserEventMap` | type | Maps the events a `BrowserInterface` emits. |
|
|
1371
|
-
| `BrowserLaunchFunction` | type | Creates a browser a browse server connects while warming its pool. |
|
|
1372
|
-
| `BrowserStatus` | type | Names the lifecycle status of a browser wrapper. |
|
|
1373
|
-
| `SystemBrowser` | type | Represents one discovered browser executable on this machine. |
|
|
1374
|
-
| `browserToEngine` | function | Classifies a `/json/version` `Browser` string into a `BrowserEngine` (`Edg/` → edge, `Chrome/` → chrome, else chromium). |
|
|
1375
|
-
| `buildInstallPaths` | function | Builds the default well-known install-path candidates for a platform, deriving Windows roots from env vars. |
|
|
1376
|
-
| `buildStoreBases` | function | Builds the default Playwright browser store base directories to search for a managed Chromium. |
|
|
1377
|
-
| `buildWindowsRoots` | function | Derives Windows install roots from env vars, falling back to well-known literals when absent. |
|
|
1378
|
-
| `describeBrowserServerLoss` | function | Describes a browser loss with its code, cause, and the session state it invalidates. |
|
|
1379
|
-
| `findEnvOverrides` | function | Checks the env-override keys (`PLAYWRIGHT_EXECUTABLE_PATH`, `CHROME_PATH`) in order and returns every one that exists. |
|
|
1380
|
-
| `findInstallPaths` | function | Returns every candidate path that exists on disk, in the given order. |
|
|
1381
|
-
| `findStorePaths` | function | Searches one store base for the top-level `chromium` link and every `chromium-*` install, highest revision first. |
|
|
1382
|
-
| `findSystemBrowsers` | function | Enumerates every Chrome/Chromium/Edge executable discoverable on this machine, deduplicated by normalized absolute path. |
|
|
1383
|
-
| `formatBrowserLockEntry` | function | Formats a process identifier and UUID token as a lock entry name. |
|
|
1384
|
-
| `launchBrowserProcess` | function | Launches a browser process with raw-CDP debugging flags. |
|
|
1385
|
-
| `normalizeExecutablePath` | function | Normalizes an executable path for cross-source deduplication (case-insensitive on Windows). |
|
|
1386
|
-
| `probePathNames` | function | Probes PATH (`which`/`where`) for every resolvable command name, in the given order. |
|
|
1387
|
-
| `readBrowserEndpoint` | function | Reads the CDP endpoint a launched browser announces on its standard error. |
|
|
1388
|
-
| `readFirstLine` | function | Returns the first non-empty line of a command's output, without its surrounding whitespace. |
|
|
1389
|
-
| `removeBrowserProfile` | function | Removes a library-owned isolated browser profile. |
|
|
1390
|
-
| `BROWSER_DEFAULT_HOST` | const | Sets the default host probed for an existing browser and used for launches, `'127.0.0.1'`, which avoids `localhost` resolving to `::1` when Chromium binds `127.0.0.1`. |
|
|
1391
|
-
| `BROWSER_DRAIN_INTERVAL_MS` | const | Sets the interval in milliseconds between liveness probes of a terminated browser process group. |
|
|
1392
|
-
| `BROWSER_ENGINE_HINTS` | const | Lists the case-insensitive substrings identifying an executable path/name's browser engine, checked by `parseBrowserEngine` in the order `edge` → `chromium` → `chrome`. |
|
|
1393
|
-
| `BROWSER_ENV_PATH_KEYS` | const | Lists the environment variables checked, in order, for an explicit browser executable path override: `PLAYWRIGHT_EXECUTABLE_PATH`, then `CHROME_PATH`. |
|
|
1394
|
-
| `BROWSER_EXECUTABLE_NAMES` | const | Lists the command names probed on PATH when no well-known executable path exists. |
|
|
1395
|
-
| `BROWSER_EXECUTABLE_PATHS` | const | Lists the well-known Chrome/Chromium/Edge executable paths with no platform-specific root, keyed by `process.platform`, leaving `win32` empty because its roots come from `BROWSER_WINDOWS_SUFFIXES`. |
|
|
1396
|
-
| `BROWSER_FILE_STORE_LIMIT` | const | Bounds a file-store listing page by default. |
|
|
1397
|
-
| `BROWSER_HEADLESS_ARG` | const | Names the flag that enables headless mode on a launched browser process, `'--headless=new'`. |
|
|
1398
|
-
| `BROWSER_KILL_GRACE_MS` | const | Bounds each launched-process exit window during TERM-to-KILL teardown at `3_000` milliseconds. |
|
|
1399
|
-
| `BROWSER_LAUNCH_ARGS` | const | Lists the flags always passed to a launched browser process, alongside the caller's own. |
|
|
1400
|
-
| `BROWSER_PORT_PROBE_TIMEOUT_MS` | const | Bounds the `discover: false` port-occupancy probe before launching at `200` milliseconds, which is short because the probe only needs to detect an already-listening CDP endpoint rather than perform full discovery. |
|
|
1401
|
-
| `BROWSER_PROCESS_EXIT_CAUSE` | const | Names the machine-readable error-context cause for an owned browser process exiting, `'process-exit'`. |
|
|
1402
|
-
| `BROWSER_PROFILE_PREFIX` | const | Names the prefix for isolated browser profiles created beneath the operating-system temp directory, `'orkestrel-browser-'`. |
|
|
1403
|
-
| `BROWSER_SERVER_BUSY` | const | Names the refusal when every browser is admitted to a holder. |
|
|
1404
|
-
| `BROWSER_SERVER_CONTEXTS` | const | Sets the default context capacity per browser, including the shared holder. |
|
|
1405
|
-
| `BROWSER_SERVER_CONTEXTS_LIMIT` | const | Limits context capacity to the largest measured per-browser count. |
|
|
1406
|
-
| `BROWSER_SERVER_COPY` | const | Defines the holder tools independently of the shared browser's vocabulary. |
|
|
1407
|
-
| `BROWSER_SERVER_CRASH` | const | Names the notice that a browser and its session state were lost. |
|
|
1408
|
-
| `BROWSER_SERVER_EXHAUSTED` | const | Names the diagnostic when the warm floor spends its restart bound. |
|
|
1409
|
-
| `BROWSER_SERVER_LAUNCH` | const | Names a failed attempt to warm a browser. |
|
|
1410
|
-
| `BROWSER_SERVER_OPTIONS` | const | Names a refused browser server option. |
|
|
1411
|
-
| `BROWSER_SERVER_POOL_LIMIT` | const | Limits the number of warm browsers to 3. |
|
|
1412
|
-
| `BROWSER_SERVER_POOL_SIZE` | const | Sets the default number of warm browsers to 1. |
|
|
1413
|
-
| `BROWSER_SERVER_RECORD` | const | Names the browser process record in each profile. |
|
|
1414
|
-
| `BROWSER_SERVER_RESTARTS` | const | Permits one failed refill before the next failure spends the bound. |
|
|
1415
|
-
| `BROWSER_SERVER_SWEEP` | const | Names a failed profile sweep. |
|
|
1416
|
-
| `BROWSER_SERVER_TEARDOWN` | const | Names a failed browser server teardown. |
|
|
1417
|
-
| `BROWSER_SERVER_UNAVAILABLE` | const | Names the refusal when no browser can serve a call. |
|
|
1418
|
-
| `BROWSER_SERVER_UNRESOLVED` | const | Names an interrupted call whose outcome is unknown. |
|
|
1419
|
-
| `BROWSER_TRANSPORT_LOSS_CAUSE` | const | Names the machine-readable error-context cause for a CDP transport disconnecting while its browser remains alive, `'transport-loss'`. |
|
|
1420
|
-
| `BROWSER_TRANSPORT_LOSS_DEFER_MS` | const | Defers once for `50` milliseconds when a transport loss is observed on an owned process, so a near-simultaneous process-exit event, which libuv might reap slightly later than the socket close, decides the diagnosis first. |
|
|
1421
|
-
| `BROWSER_WINDOWS_ROOT_FALLBACKS` | const | Lists the fallback Windows install roots used when `PROGRAMFILES`, `PROGRAMFILES(X86)`, or `LOCALAPPDATA` is absent. |
|
|
1422
|
-
| `BROWSER_WINDOWS_SUFFIXES` | const | Lists the Windows install-root-relative suffixes for Chrome/Edge/Chromium, joined against each candidate root (`PROGRAMFILES`, `PROGRAMFILES(X86)`, `LOCALAPPDATA`). |
|
|
1354
|
+
| Name | Kind | Signature | Summary |
|
|
1355
|
+
| --------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1356
|
+
| `Browser` | class | `new (options?: BrowserOptions) => BrowserInterface` | Discovers, launches, connects to, and owns Chromium-family browser sessions. |
|
|
1357
|
+
| `FileBrowserWriter` | class | `new () => BrowserWriterInterface` | Persists captured browser bytes to the filesystem through `node:fs/promises`. |
|
|
1358
|
+
| `createBrowser` | function | `(options?: BrowserOptions) => BrowserInterface` | Creates a raw-CDP `BrowserInterface` façade with discovery, connection, and lifecycle management. |
|
|
1359
|
+
| `createBrowserProfile` | function | `(path?: string) => Promise<BrowserProfileResult>` | Resolves a persistent caller profile or creates an isolated temporary one. |
|
|
1360
|
+
| `createFileBrowserWriter` | function | `() => BrowserWriterInterface` | Creates a filesystem-backed `BrowserWriterInterface` that persists bytes through `node:fs/promises`. |
|
|
1361
|
+
| `BrowserDiscoveryResult` | interface | `{ endpoint, browser }` | Describes the result of passive browser discovery. |
|
|
1362
|
+
| `BrowserInterface` | interface | `{ endpoint, ping(), emitter, engine, status, connection, owned, pid, discover(), connect(), adopt(), disconnect(), context(), contexts(), isolate(), create(), destroy(), close() }` | Wraps a browser with discovery, connection management, and lifecycle control. |
|
|
1363
|
+
| `BrowserProfileRecord` | interface | `{ pid, endpoint }` | Names the browser a browse profile serves, which a later start's sweep reads. |
|
|
1364
|
+
| `BrowserProfileResult` | interface | `{ path, temporary }` | Describes the resolved browser profile directory used for a Chromium-family launch. |
|
|
1365
|
+
| `BrowserServerCatalog` | interface | `{ holder, tools }` | Describes the JSON catalog returned by the holder tools. |
|
|
1366
|
+
| `BrowserOptions` | interface | `{ on?, error?, headless?, executable?, profile?, cdp?, timeout?, viewport?, signal?, args?, browsers? }` | Describes the options for creating a `Browser` instance. |
|
|
1367
|
+
| `SystemBrowserOptions` | interface | `{ env?, paths?, names?, stores?, engine? }` | Describes the options overriding the candidate sources for `findSystemBrowsers`. |
|
|
1368
|
+
| `BrowserConnection` | type | `'cdp' \| 'launch' \| 'persistent'` | Names how the browser connection was established. |
|
|
1369
|
+
| `BrowserEngine` | type | `'chromium' \| 'chrome' \| 'edge'` | Names a supported browser engine (raw CDP targets Chromium-family browsers only). |
|
|
1370
|
+
| `BrowserEventMap` | type | `{ readonly idle: readonly []; readonly discover: readonly [result: BrowserDiscoveryResult]; readonly connect: readonly [connection: BrowserConnection]; readonly disconnect: readonly []; readonly launch: readonly [engine: BrowserEngine]; readonly page: readonly [page: BrowserPageInterface]; readonly context: readonly [context: BrowserContextInterface]; readonly error: readonly [error: unknown]; readonly destroy: readonly []; }` | Maps the events a `BrowserInterface` emits. |
|
|
1371
|
+
| `BrowserLaunchFunction` | type | `(options: BrowserOptions) => BrowserInterface` | Creates a browser a browse server connects while warming its pool. |
|
|
1372
|
+
| `BrowserStatus` | type | `'idle' \| 'connecting' \| 'connected' \| 'disconnected' \| 'error'` | Names the lifecycle status of a browser wrapper. |
|
|
1373
|
+
| `SystemBrowser` | type | `{ readonly executable: string; readonly engine: BrowserEngine; }` | Represents one discovered browser executable on this machine. |
|
|
1374
|
+
| `browserToEngine` | function | `(browser?: string) => BrowserEngine` | Classifies a `/json/version` `Browser` string into a `BrowserEngine` (`Edg/` → edge, `Chrome/` → chrome, else chromium). |
|
|
1375
|
+
| `buildInstallPaths` | function | `(platform: string, env: Readonly<Record<string, string \| undefined>>) => readonly string[]` | Builds the default well-known install-path candidates for a platform, deriving Windows roots from env vars. |
|
|
1376
|
+
| `buildStoreBases` | function | `(env: Readonly<Record<string, string \| undefined>>, platform: string) => readonly string[]` | Builds the default Playwright browser store base directories to search for a managed Chromium. |
|
|
1377
|
+
| `buildWindowsRoots` | function | `(env: Readonly<Record<string, string \| undefined>>) => readonly string[]` | Derives Windows install roots from env vars, falling back to well-known literals when absent. |
|
|
1378
|
+
| `describeBrowserServerLoss` | function | `(code: string, cause: unknown, url?: string) => string` | Describes a browser loss with its code, cause, and the session state it invalidates. |
|
|
1379
|
+
| `findEnvOverrides` | function | `(env: Readonly<Record<string, string \| undefined>>) => readonly string[]` | Checks the env-override keys (`PLAYWRIGHT_EXECUTABLE_PATH`, `CHROME_PATH`) in order and returns every one that exists. |
|
|
1380
|
+
| `findInstallPaths` | function | `(paths: readonly string[]) => readonly string[]` | Returns every candidate path that exists on disk, in the given order. |
|
|
1381
|
+
| `findStorePaths` | function | `(base: string, platform: string) => readonly string[]` | Searches one store base for the top-level `chromium` link and every `chromium-*` install, highest revision first. |
|
|
1382
|
+
| `findSystemBrowsers` | function | `(options?: SystemBrowserOptions) => readonly SystemBrowser[]` | Enumerates every Chrome/Chromium/Edge executable discoverable on this machine, deduplicated by normalized absolute path. |
|
|
1383
|
+
| `formatBrowserLockEntry` | function | `(pid: number, token: string) => string` | Formats a process identifier and UUID token as a lock entry name. |
|
|
1384
|
+
| `launchBrowserProcess` | function | `(executable: string, port: number \| undefined, headless: boolean, profile?: string, extra?: readonly string[]) => ChildProcess` | Launches a browser process with raw-CDP debugging flags. |
|
|
1385
|
+
| `normalizeExecutablePath` | function | `(path: string, platform: string) => string` | Normalizes an executable path for cross-source deduplication (case-insensitive on Windows). |
|
|
1386
|
+
| `probePathNames` | function | `(names: readonly string[], platform: string) => readonly string[]` | Probes PATH (`which`/`where`) for every resolvable command name, in the given order. |
|
|
1387
|
+
| `readBrowserEndpoint` | function | `(stream: Readable, signal: AbortSignal) => Promise<string>` | Reads the CDP endpoint a launched browser announces on its standard error. |
|
|
1388
|
+
| `readFirstLine` | function | `(output: string) => string \| undefined` | Returns the first non-empty line of a command's output, without its surrounding whitespace. |
|
|
1389
|
+
| `removeBrowserProfile` | function | `(profile: BrowserProfileResult) => Promise<void>` | Removes a library-owned isolated browser profile. |
|
|
1390
|
+
| `BROWSER_DEFAULT_HOST` | const | `"127.0.0.1"` | Sets the default host probed for an existing browser and used for launches, `'127.0.0.1'`, which avoids `localhost` resolving to `::1` when Chromium binds `127.0.0.1`. |
|
|
1391
|
+
| `BROWSER_DRAIN_INTERVAL_MS` | const | `100` | Sets the interval in milliseconds between liveness probes of a terminated browser process group. |
|
|
1392
|
+
| `BROWSER_ENGINE_HINTS` | const | `Readonly<Record<BrowserEngine, readonly string[]>>` | Lists the case-insensitive substrings identifying an executable path/name's browser engine, checked by `parseBrowserEngine` in the order `edge` → `chromium` → `chrome`. |
|
|
1393
|
+
| `BROWSER_ENV_PATH_KEYS` | const | `readonly string[]` | Lists the environment variables checked, in order, for an explicit browser executable path override: `PLAYWRIGHT_EXECUTABLE_PATH`, then `CHROME_PATH`. |
|
|
1394
|
+
| `BROWSER_EXECUTABLE_NAMES` | const | `readonly string[]` | Lists the command names probed on PATH when no well-known executable path exists. |
|
|
1395
|
+
| `BROWSER_EXECUTABLE_PATHS` | const | `Readonly<Record<string, readonly string[]>>` | Lists the well-known Chrome/Chromium/Edge executable paths with no platform-specific root, keyed by `process.platform`, leaving `win32` empty because its roots come from `BROWSER_WINDOWS_SUFFIXES`. |
|
|
1396
|
+
| `BROWSER_FILE_STORE_LIMIT` | const | `100` | Bounds a file-store listing page by default. |
|
|
1397
|
+
| `BROWSER_HEADLESS_ARG` | const | `"--headless=new"` | Names the flag that enables headless mode on a launched browser process, `'--headless=new'`. |
|
|
1398
|
+
| `BROWSER_KILL_GRACE_MS` | const | `3000` | Bounds each launched-process exit window during TERM-to-KILL teardown at `3_000` milliseconds. |
|
|
1399
|
+
| `BROWSER_LAUNCH_ARGS` | const | `readonly string[]` | Lists the flags always passed to a launched browser process, alongside the caller's own. |
|
|
1400
|
+
| `BROWSER_PORT_PROBE_TIMEOUT_MS` | const | `200` | Bounds the `discover: false` port-occupancy probe before launching at `200` milliseconds, which is short because the probe only needs to detect an already-listening CDP endpoint rather than perform full discovery. |
|
|
1401
|
+
| `BROWSER_PROCESS_EXIT_CAUSE` | const | `"process-exit"` | Names the machine-readable error-context cause for an owned browser process exiting, `'process-exit'`. |
|
|
1402
|
+
| `BROWSER_PROFILE_PREFIX` | const | `"orkestrel-browser-"` | Names the prefix for isolated browser profiles created beneath the operating-system temp directory, `'orkestrel-browser-'`. |
|
|
1403
|
+
| `BROWSER_SERVER_BUSY` | const | `"SERVER_BUSY"` | Names the refusal when every browser is admitted to a holder. |
|
|
1404
|
+
| `BROWSER_SERVER_CONTEXTS` | const | `2` | Sets the default context capacity per browser, including the shared holder. |
|
|
1405
|
+
| `BROWSER_SERVER_CONTEXTS_LIMIT` | const | `4` | Limits context capacity to the largest measured per-browser count. |
|
|
1406
|
+
| `BROWSER_SERVER_COPY` | const | `Readonly<Record<BrowserServerToolName, ToolDefinition>>` | Defines the holder tools independently of the shared browser's vocabulary. |
|
|
1407
|
+
| `BROWSER_SERVER_CRASH` | const | `"SERVER_CRASH"` | Names the notice that a browser and its session state were lost. |
|
|
1408
|
+
| `BROWSER_SERVER_EXHAUSTED` | const | `"SERVER_EXHAUSTED"` | Names the diagnostic when the warm floor spends its restart bound. |
|
|
1409
|
+
| `BROWSER_SERVER_LAUNCH` | const | `"SERVER_LAUNCH"` | Names a failed attempt to warm a browser. |
|
|
1410
|
+
| `BROWSER_SERVER_OPTIONS` | const | `"ARGUMENT"` | Names a refused browser server option. |
|
|
1411
|
+
| `BROWSER_SERVER_POOL_LIMIT` | const | `3` | Limits the number of warm browsers to 3. |
|
|
1412
|
+
| `BROWSER_SERVER_POOL_SIZE` | const | `1` | Sets the default number of warm browsers to 1. |
|
|
1413
|
+
| `BROWSER_SERVER_RECORD` | const | `"browse.json"` | Names the browser process record in each profile. |
|
|
1414
|
+
| `BROWSER_SERVER_RESTARTS` | const | `1` | Permits one failed refill before the next failure spends the bound. |
|
|
1415
|
+
| `BROWSER_SERVER_SWEEP` | const | `"SERVER_SWEEP"` | Names a failed profile sweep. |
|
|
1416
|
+
| `BROWSER_SERVER_TEARDOWN` | const | `"SERVER_TEARDOWN"` | Names a failed browser server teardown. |
|
|
1417
|
+
| `BROWSER_SERVER_UNAVAILABLE` | const | `"SERVER_UNAVAILABLE"` | Names the refusal when no browser can serve a call. |
|
|
1418
|
+
| `BROWSER_SERVER_UNRESOLVED` | const | `"SERVER_UNRESOLVED"` | Names an interrupted call whose outcome is unknown. |
|
|
1419
|
+
| `BROWSER_TRANSPORT_LOSS_CAUSE` | const | `"transport-loss"` | Names the machine-readable error-context cause for a CDP transport disconnecting while its browser remains alive, `'transport-loss'`. |
|
|
1420
|
+
| `BROWSER_TRANSPORT_LOSS_DEFER_MS` | const | `50` | Defers once for `50` milliseconds when a transport loss is observed on an owned process, so a near-simultaneous process-exit event, which libuv might reap slightly later than the socket close, decides the diagnosis first. |
|
|
1421
|
+
| `BROWSER_WINDOWS_ROOT_FALLBACKS` | const | `Readonly<Record<string, string>>` | Lists the fallback Windows install roots used when `PROGRAMFILES`, `PROGRAMFILES(X86)`, or `LOCALAPPDATA` is absent. |
|
|
1422
|
+
| `BROWSER_WINDOWS_SUFFIXES` | const | `readonly string[]` | Lists the Windows install-root-relative suffixes for Chrome/Edge/Chromium, joined against each candidate root (`PROGRAMFILES`, `PROGRAMFILES(X86)`, `LOCALAPPDATA`). |
|
|
1423
1423
|
|
|
1424
1424
|
##### Launch and holder state
|
|
1425
1425
|
|
|
1426
|
-
|
|
|
1427
|
-
| ------------------------------ | --------- | ---------------------------------------------------------------------------------------- |
|
|
1428
|
-
| `BrowserProcessDrainInterface` | interface | Exposes whether a process remainder disappeared before its deadline. |
|
|
1429
|
-
| `BrowserServerSlot` | interface | Pairs a pooled browser with its profile directory. |
|
|
1430
|
-
| `BrowserServerGeneration` | interface | Owns a holder's context, toolset, and download directory. |
|
|
1431
|
-
| `BrowserServerHolder` | interface | Identifies an admitted holder and its cancellation lifetime. |
|
|
1432
|
-
| `BrowserServerLease` | interface | Pairs a pool token with the generation it owns. |
|
|
1433
|
-
| `BrowserEndpoint` | class | Reads the announced CDP endpoint while continuing to drain the browser's standard error. |
|
|
1434
|
-
| `BrowserProcessDrain` | class | Waits for a process remainder whose host exposes no exit event. |
|
|
1426
|
+
| Name | Kind | Signature | Summary |
|
|
1427
|
+
| ------------------------------ | --------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
1428
|
+
| `BrowserProcessDrainInterface` | interface | `{ result }` | Exposes whether a process remainder disappeared before its deadline. |
|
|
1429
|
+
| `BrowserServerSlot` | interface | `{ browser, profile }` | Pairs a pooled browser with its profile directory. |
|
|
1430
|
+
| `BrowserServerGeneration` | interface | `{ context, toolset, directory }` | Owns a holder's context, toolset, and download directory. |
|
|
1431
|
+
| `BrowserServerHolder` | interface | `{ id, purpose, abort }` | Identifies an admitted holder and its cancellation lifetime. |
|
|
1432
|
+
| `BrowserServerLease` | interface | `{ token, generation }` | Pairs a pool token with the generation it owns. |
|
|
1433
|
+
| `BrowserEndpoint` | class | `new (stream: Readable, signal: AbortSignal) => BrowserEndpoint` | Reads the announced CDP endpoint while continuing to drain the browser's standard error. |
|
|
1434
|
+
| `BrowserProcessDrain` | class | `new (inspect: () => boolean \| undefined, timeout: number) => BrowserProcessDrainInterface` | Waits for a process remainder whose host exposes no exit event. |
|
|
1435
1435
|
|
|
1436
1436
|
##### Discover and launch
|
|
1437
1437
|
|
|
1438
|
-
|
|
|
1439
|
-
|
|
|
1438
|
+
| Name | Kind | Signature | Summary |
|
|
1439
|
+
| ---- | ---- | --------- | ------- |
|
|
1440
1440
|
|
|
1441
1441
|
The following fence composes system-browser discovery, a launch, and the endpoint read that replaces HTTP readiness polling.
|
|
1442
1442
|
|
|
@@ -1495,54 +1495,54 @@ await removeBrowserProfile(profile)
|
|
|
1495
1495
|
|
|
1496
1496
|
#### Toolset
|
|
1497
1497
|
|
|
1498
|
-
|
|
|
1499
|
-
| --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1500
|
-
| `BrowserMCPServer` | class | Implements `BrowserMCPServerInterface`: serves the browser vocabulary and the journey tools over the Model Context Protocol on stdio, and warms Chromium at server start. |
|
|
1501
|
-
| `createBrowserMCPServer` | function | Creates the browse server, which serves the browser vocabulary and the journey tools over the Model Context Protocol on stdio and warms Chromium at server start. |
|
|
1502
|
-
| `BrowserMCPServerInterface` | interface | Serves the browser vocabulary and the journey tools over MCP on stdio. |
|
|
1503
|
-
| `BrowserMCPServerOptions` | interface | Configures the browse server. |
|
|
1504
|
-
| `BrowserServerToolName` | type | Names the server tools that manage independent browser holders. |
|
|
1505
|
-
| `BROWSER_DEVTOOLS_PATTERN` | const | Matches the stderr line Chromium prints when its CDP endpoint accepts connections, and captures the `ws://` endpoint the line names. |
|
|
1506
|
-
| `BROWSER_SERVER_HOLDER` | const | Names the refusal for an unknown or ended holder. |
|
|
1498
|
+
| Name | Kind | Signature | Summary |
|
|
1499
|
+
| --------------------------- | --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1500
|
+
| `BrowserMCPServer` | class | `new (options?: BrowserMCPServerOptions) => BrowserMCPServerInterface` | Implements `BrowserMCPServerInterface`: serves the browser vocabulary and the journey tools over the Model Context Protocol on stdio, and warms Chromium at server start. |
|
|
1501
|
+
| `createBrowserMCPServer` | function | `(options?: BrowserMCPServerOptions) => BrowserMCPServerInterface` | Creates the browse server, which serves the browser vocabulary and the journey tools over the Model Context Protocol on stdio and warms Chromium at server start. |
|
|
1502
|
+
| `BrowserMCPServerInterface` | interface | `{ start(), destroy() }` | Serves the browser vocabulary and the journey tools over MCP on stdio. |
|
|
1503
|
+
| `BrowserMCPServerOptions` | interface | `{ root?, browser?, journeys?, stdio?, pool?, log? }` | Configures the browse server. |
|
|
1504
|
+
| `BrowserServerToolName` | type | `'acquire' \| 'execute' \| 'tools' \| 'destroy'` | Names the server tools that manage independent browser holders. |
|
|
1505
|
+
| `BROWSER_DEVTOOLS_PATTERN` | const | `RegExp` | Matches the stderr line Chromium prints when its CDP endpoint accepts connections, and captures the `ws://` endpoint the line names. |
|
|
1506
|
+
| `BROWSER_SERVER_HOLDER` | const | `"SERVER_HOLDER"` | Names the refusal for an unknown or ended holder. |
|
|
1507
1507
|
|
|
1508
1508
|
#### Journeys and stores
|
|
1509
1509
|
|
|
1510
|
-
|
|
|
1511
|
-
| -------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1512
|
-
| `FileBrowserJourneyStore` | class | Persists journeys with exclusive writes and revision counters retained across deletion. |
|
|
1513
|
-
| `FileBrowserRunStore` | class | Persists runs and captures only in directories allocated by this instance. |
|
|
1514
|
-
| `createFileBrowserJourneyStore` | function | Creates a journey store over an existing filesystem root. |
|
|
1515
|
-
| `createFileBrowserRunStore` | function | Creates a run store over an existing filesystem root. |
|
|
1516
|
-
| `FileBrowserStoreOptions` | interface | Configures a file store: its root under the checkout and the listing cap. |
|
|
1517
|
-
| `BROWSER_JOURNEY_LOCK_ATTEMPTS` | const | Bounds attempts to acquire a journey lock after concurrent recovery. |
|
|
1518
|
-
| `BROWSER_JOURNEY_LOCK_DIRECTORY` | const | Names the exclusive journey write lock directory. |
|
|
1519
|
-
| `BROWSER_JOURNEY_REVISION_FILE` | const | Names the retained journey revision counter. |
|
|
1520
|
-
| `BROWSER_JOURNEY_SNAPSHOT_FILE` | const | Names the persisted journey snapshot. |
|
|
1521
|
-
| `BROWSER_RUN_DIRECTORY` | const | Names the journey directory holding its runs. |
|
|
1522
|
-
| `BROWSER_RUN_FILE` | const | Names the persisted run snapshot. |
|
|
1523
|
-
| `BROWSER_STORE_CACHE_DIRS` | const | Names the per-OS default Playwright browser cache directory, relative to the home directory (win32 uses `LOCALAPPDATA` directly). |
|
|
1524
|
-
| `BROWSER_STORE_DEFAULT_DIRS` | const | Lists the well-known Playwright browser store base directories checked in addition to `PLAYWRIGHT_BROWSERS_PATH`, starting with `/opt/pw-browsers`. |
|
|
1525
|
-
| `BROWSER_STORE_ENV_KEY` | const | Names the environment variable that carries an additional Playwright browser store base directory, `'PLAYWRIGHT_BROWSERS_PATH'`. |
|
|
1526
|
-
| `BROWSER_STORE_GLOBS` | const | Names the glob pattern (relative to a store base) matching a versioned Chromium binary, keyed by `process.platform`. |
|
|
1527
|
-
| `BROWSER_STORE_LINK_NAME` | const | Names the top-level Chromium symlink or binary Playwright maintains inside a browser store base, `'chromium'`. |
|
|
1510
|
+
| Name | Kind | Signature | Summary |
|
|
1511
|
+
| -------------------------------- | --------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1512
|
+
| `FileBrowserJourneyStore` | class | `new (options: FileBrowserStoreOptions) => BrowserJourneyStoreInterface` | Persists journeys with exclusive writes and revision counters retained across deletion. |
|
|
1513
|
+
| `FileBrowserRunStore` | class | `new (options: FileBrowserStoreOptions) => BrowserRunStoreInterface` | Persists runs and captures only in directories allocated by this instance. |
|
|
1514
|
+
| `createFileBrowserJourneyStore` | function | `(options: FileBrowserStoreOptions) => BrowserJourneyStoreInterface` | Creates a journey store over an existing filesystem root. |
|
|
1515
|
+
| `createFileBrowserRunStore` | function | `(options: FileBrowserStoreOptions) => BrowserRunStoreInterface` | Creates a run store over an existing filesystem root. |
|
|
1516
|
+
| `FileBrowserStoreOptions` | interface | `{ root, limit? }` | Configures a file store: its root under the checkout and the listing cap. |
|
|
1517
|
+
| `BROWSER_JOURNEY_LOCK_ATTEMPTS` | const | `8` | Bounds attempts to acquire a journey lock after concurrent recovery. |
|
|
1518
|
+
| `BROWSER_JOURNEY_LOCK_DIRECTORY` | const | `"journey.lock"` | Names the exclusive journey write lock directory. |
|
|
1519
|
+
| `BROWSER_JOURNEY_REVISION_FILE` | const | `"revision"` | Names the retained journey revision counter. |
|
|
1520
|
+
| `BROWSER_JOURNEY_SNAPSHOT_FILE` | const | `"journey.json"` | Names the persisted journey snapshot. |
|
|
1521
|
+
| `BROWSER_RUN_DIRECTORY` | const | `"runs"` | Names the journey directory holding its runs. |
|
|
1522
|
+
| `BROWSER_RUN_FILE` | const | `"run.json"` | Names the persisted run snapshot. |
|
|
1523
|
+
| `BROWSER_STORE_CACHE_DIRS` | const | `Readonly<Record<string, string>>` | Names the per-OS default Playwright browser cache directory, relative to the home directory (win32 uses `LOCALAPPDATA` directly). |
|
|
1524
|
+
| `BROWSER_STORE_DEFAULT_DIRS` | const | `readonly string[]` | Lists the well-known Playwright browser store base directories checked in addition to `PLAYWRIGHT_BROWSERS_PATH`, starting with `/opt/pw-browsers`. |
|
|
1525
|
+
| `BROWSER_STORE_ENV_KEY` | const | `"PLAYWRIGHT_BROWSERS_PATH"` | Names the environment variable that carries an additional Playwright browser store base directory, `'PLAYWRIGHT_BROWSERS_PATH'`. |
|
|
1526
|
+
| `BROWSER_STORE_GLOBS` | const | `Readonly<Record<string, string>>` | Names the glob pattern (relative to a store base) matching a versioned Chromium binary, keyed by `process.platform`. |
|
|
1527
|
+
| `BROWSER_STORE_LINK_NAME` | const | `"chromium"` | Names the top-level Chromium symlink or binary Playwright maintains inside a browser store base, `'chromium'`. |
|
|
1528
1528
|
|
|
1529
1529
|
#### Protocol layer
|
|
1530
1530
|
|
|
1531
|
-
|
|
|
1532
|
-
| ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1533
|
-
| `WebSocketCDPTransport` | class | Provides a raw CDP text transport backed by `@orkestrel/websocket`. |
|
|
1534
|
-
| `createWebSocketCDPTransport` | function | Creates a Node `WebSocket`-backed `CDPTransportInterface` for the given CDP debugger URL. |
|
|
1535
|
-
| `BrowserCDPOptions` | interface | Configures the CDP (Chrome DevTools Protocol) connection. |
|
|
1536
|
-
| `WebSocketCDPTransportOptions` | interface | Describes the options for creating a `WebSocketCDPTransport` instance. |
|
|
1537
|
-
| `fetchCDPTargets` | function | Fetches the current CDP target list from a browser's `/json/list` endpoint, as a `Result` carrying either the targets or a coded `BrowserError`. |
|
|
1538
|
-
| `parseBrowserEngine` | function | Classifies an executable path/name into a `BrowserEngine` by case-insensitive hint, checked in the order edge → chromium → chrome. |
|
|
1539
|
-
| `parseBrowserLockEntry` | function | Parses the holder process identifier from a lock entry name. |
|
|
1540
|
-
| `parseBrowserProfileRecord` | function | Parses a profile record naming a positive process identifier and a loopback DevTools endpoint. |
|
|
1541
|
-
| `parseBrowserViewport` | function | Parses positive integer viewport dimensions in WIDTHxHEIGHT form. |
|
|
1542
|
-
| `BROWSER_CDP_LIST_PATH` | const | Names the path appended to the CDP host to list open targets — pages, workers, and every other target category Chromium reports — `'/json/list'`. |
|
|
1543
|
-
| `BROWSER_CDP_PROTOCOL` | const | Names the protocol prefix for CDP discovery requests, `'http'`. |
|
|
1544
|
-
| `BROWSER_CDP_VERSION_PATH` | const | Names the path appended to the CDP host to fetch version metadata, `'/json/version'`, which is where endpoint discovery reads. |
|
|
1545
|
-
| `BROWSER_DEFAULT_CDP_PORT` | const | Sets the default CDP port probed for an existing browser and used for launches, `9222`. |
|
|
1531
|
+
| Name | Kind | Signature | Summary |
|
|
1532
|
+
| ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1533
|
+
| `WebSocketCDPTransport` | class | `new (options: WebSocketCDPTransportOptions) => CDPTransportInterface` | Provides a raw CDP text transport backed by `@orkestrel/websocket`. |
|
|
1534
|
+
| `createWebSocketCDPTransport` | function | `(options: WebSocketCDPTransportOptions) => CDPTransportInterface` | Creates a Node `WebSocket`-backed `CDPTransportInterface` for the given CDP debugger URL. |
|
|
1535
|
+
| `BrowserCDPOptions` | interface | `{ port?, host?, endpoint?, discover? }` | Configures the CDP (Chrome DevTools Protocol) connection. |
|
|
1536
|
+
| `WebSocketCDPTransportOptions` | interface | `{ on?, error?, url, timeout? }` | Describes the options for creating a `WebSocketCDPTransport` instance. |
|
|
1537
|
+
| `fetchCDPTargets` | function | `(port: number, timeout: number, host?: string) => Promise<Result<readonly CDPTarget[], BrowserError>>` | Fetches the current CDP target list from a browser's `/json/list` endpoint, as a `Result` carrying either the targets or a coded `BrowserError`. |
|
|
1538
|
+
| `parseBrowserEngine` | function | `(executable: string) => BrowserEngine \| undefined` | Classifies an executable path/name into a `BrowserEngine` by case-insensitive hint, checked in the order edge → chromium → chrome. |
|
|
1539
|
+
| `parseBrowserLockEntry` | function | `(name: string) => number \| undefined` | Parses the holder process identifier from a lock entry name. |
|
|
1540
|
+
| `parseBrowserProfileRecord` | function | `(text: string) => BrowserProfileRecord \| undefined` | Parses a profile record naming a positive process identifier and a loopback DevTools endpoint. |
|
|
1541
|
+
| `parseBrowserViewport` | function | `(value: string \| undefined) => BrowserViewport \| undefined` | Parses positive integer viewport dimensions in WIDTHxHEIGHT form. |
|
|
1542
|
+
| `BROWSER_CDP_LIST_PATH` | const | `"/json/list"` | Names the path appended to the CDP host to list open targets — pages, workers, and every other target category Chromium reports — `'/json/list'`. |
|
|
1543
|
+
| `BROWSER_CDP_PROTOCOL` | const | `"http"` | Names the protocol prefix for CDP discovery requests, `'http'`. |
|
|
1544
|
+
| `BROWSER_CDP_VERSION_PATH` | const | `"/json/version"` | Names the path appended to the CDP host to fetch version metadata, `'/json/version'`, which is where endpoint discovery reads. |
|
|
1545
|
+
| `BROWSER_DEFAULT_CDP_PORT` | const | `9222` | Sets the default CDP port probed for an existing browser and used for launches, `9222`. |
|
|
1546
1546
|
|
|
1547
1547
|
##### Connect a transport and writer
|
|
1548
1548
|
|
|
@@ -1562,62 +1562,62 @@ The browser face supplies an untrusted DOM view. Drive a same-origin child docum
|
|
|
1562
1562
|
|
|
1563
1563
|
#### Elements and readings
|
|
1564
1564
|
|
|
1565
|
-
|
|
|
1566
|
-
| ----------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1567
|
-
| `BrowserDOMView` | class | Reads and drives a DOM document from a realm that can reach it, without trusted input. |
|
|
1568
|
-
| `BrowserDOMWait` | class | Parks one condition on DOM mutations and finished transitions and animations until it holds, with one deadline and coalesced wake tasks. |
|
|
1569
|
-
| `createBrowserDOMView` | function | Creates a view that reads and drives a DOM document without trusted input. |
|
|
1570
|
-
| `BrowserDOMElementInterface` | interface | Provides DOM actions through a stable element reference, without trusted input. |
|
|
1571
|
-
| `BrowserDOMViewInterface` | interface | Provides the document operations of a view that drives a DOM document in its own realm. |
|
|
1572
|
-
| `BrowserDOMWaitInterface` | interface | Settles one wait parked on DOM mutations and finished transitions and animations. |
|
|
1573
|
-
| `BrowserMutationWait` | interface | Describes one wait parked on DOM mutations and finished transitions and animations. |
|
|
1574
|
-
| `BrowserNameContext` | interface | Carries the accessible-name traversal context. |
|
|
1575
|
-
| `BrowserDOMViewOptions` | interface | Configures a view that drives one browser document. |
|
|
1576
|
-
| `collectBrowserRoots` | function | Collects the tree roots a wait observes under a node: the node's own root, then every open shadow root and every same-origin frame document at or beneath it, recursively. |
|
|
1577
|
-
| `computeBrowserAlternative` | function | Computes the text one node contributes to an accessible name: its own text alternative, or its content. |
|
|
1578
|
-
| `computeBrowserName` | function | Computes the accessible name of an element, trimmed and whitespace-collapsed. |
|
|
1579
|
-
| `computeBrowserRole` | function | Computes the ARIA role of an element from its `role` attribute or its implicit mapping. |
|
|
1580
|
-
| `computeBrowserText` | function | Computes the text an element's content contributes to an accessible name, in the flat tree, trimmed and whitespace-collapsed. |
|
|
1581
|
-
| `isBrowserDocument` | function | Narrows a value to a `Document` attached to a window. |
|
|
1582
|
-
| `listenBrowserNavigation` | function | Subscribes one listener to a window's navigation events until a signal aborts. |
|
|
1583
|
-
| `matchesBrowserActivation` | function | Checks whether a click on an element activates the `label` that contains it, following the HTML label activation rule. |
|
|
1584
|
-
| `matchesBrowserBlock` | function | Checks whether an element starts a block of its own, the unit that separates runs of text. |
|
|
1585
|
-
| `matchesBrowserHidden` | function | Checks whether an element and its subtree are hidden from the rendered page. |
|
|
1586
|
-
| `matchesBrowserInvisible` | function | Checks whether an element renders nothing visible of its own. |
|
|
1587
|
-
| `matchesBrowserOmitted` | function | Checks whether an element sits in an omitted subtree: the element or a flat-tree ancestor that `readBrowserParent` reaches matches `matchesBrowserHidden`, through assigned slots, shadow hosts, and the frame elements of same-origin documents. |
|
|
1588
|
-
| `matchesBrowserPopup` | function | Checks whether activating an element opens another browsing context. |
|
|
1589
|
-
| `readBrowserBlock` | function | Reads the nearest block container of an element, the unit that separates runs of text. |
|
|
1590
|
-
| `readBrowserCapture` | function | Reads the URL, title, and rendered markup a DOM reading is built from, refusing a capture over the result limit before any parse. |
|
|
1591
|
-
| `readBrowserContent` | function | Reads the untrimmed text an element's content contributes to an accessible name, in the flat tree. |
|
|
1592
|
-
| `readBrowserParent` | function | Reads an element's parent in the flat tree: the slot it is assigned to in an open shadow root, its parent element, the host of the open shadow root it sits at the top of, or the frame element of its same-origin document. |
|
|
1593
|
-
| `readBrowserStates` | function | Reads the pressed, expanded, and selected states the DOM outline assigns to an element's role. |
|
|
1594
|
-
| `readBrowserToken` | function | Reads a lowercased ARIA token, preserving whitespace and treating empty or undefined tokens as absent. |
|
|
1595
|
-
| `skipBrowserSubtree` | function | Moves a tree walker past the subtree of its current node. |
|
|
1596
|
-
| `BROWSER_CONTENT_NAMED_ROLES` | const | Names the ARIA roles whose accessible name the accessible-name computation takes from the element's content when no attribute or label names it. |
|
|
1597
|
-
| `BROWSER_CONTEXT_TARGETS` | const | Names the link and form targets that navigate the current browsing context or one of its ancestors. `_blank` opens another browsing context, and any other name targets the browsing context carrying that name, which `matchesBrowserPopup` resolves. |
|
|
1598
|
-
| `BROWSER_DOCUMENT_TIMEOUT_MS` | const | Sets the default `wait` deadline for DOM waits in a browser document toolset, `5_000` milliseconds. |
|
|
1599
|
-
| `BROWSER_EXPANDED_ROLES` | const | Names the roles whose ARIA expansion state the DOM outline reads. |
|
|
1600
|
-
| `BROWSER_IMPLICIT_ROLES` | const | Maps an HTML element to the ARIA role the HTML Accessibility API Mappings specification gives it when it carries no `role` attribute. |
|
|
1601
|
-
| `BROWSER_INTERACTIVE_CONTENT` | const | Selects the HTML interactive content a click inside a `label` can land on without activating the label, as the HTML interactive-content category lists it: `a` with `href`, `audio` and `video` with `controls`, `button`, `details`, `embed`, `iframe`, `img` with `usemap` or `controls`, `input` other than `hidden`, `label`, `select`, and `textarea`. |
|
|
1602
|
-
| `BROWSER_SELECTED_ROLES` | const | Names the roles whose selection state the DOM outline reads. |
|
|
1603
|
-
| `BROWSER_TYPED_INPUTS` | const | Names the `input` type states whose value an untrusted `fill` sets as typed text. |
|
|
1565
|
+
| Name | Kind | Signature | Summary |
|
|
1566
|
+
| ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1567
|
+
| `BrowserDOMView` | class | `new (options: BrowserDOMViewOptions) => BrowserDOMViewInterface` | Reads and drives a DOM document from a realm that can reach it, without trusted input. |
|
|
1568
|
+
| `BrowserDOMWait` | class | `new <T>(wait: BrowserMutationWait<T>) => BrowserDOMWaitInterface<T>` | Parks one condition on DOM mutations and finished transitions and animations until it holds, with one deadline and coalesced wake tasks. |
|
|
1569
|
+
| `createBrowserDOMView` | function | `(options: BrowserDOMViewOptions) => BrowserDOMViewInterface` | Creates a view that reads and drives a DOM document without trusted input. |
|
|
1570
|
+
| `BrowserDOMElementInterface` | interface | `{}` | Provides DOM actions through a stable element reference, without trusted input. |
|
|
1571
|
+
| `BrowserDOMViewInterface` | interface | `{ elements, destroy() }` | Provides the document operations of a view that drives a DOM document in its own realm. |
|
|
1572
|
+
| `BrowserDOMWaitInterface` | interface | `{ roots, execute() }` | Settles one wait parked on DOM mutations and finished transitions and animations. |
|
|
1573
|
+
| `BrowserMutationWait` | interface | `{ roots, check, timeout, start, now?, signal?, subject }` | Describes one wait parked on DOM mutations and finished transitions and animations. |
|
|
1574
|
+
| `BrowserNameContext` | interface | `{ hidden?, target? }` | Carries the accessible-name traversal context. |
|
|
1575
|
+
| `BrowserDOMViewOptions` | interface | `{ document, own? }` | Configures a view that drives one browser document. |
|
|
1576
|
+
| `collectBrowserRoots` | function | `(root: Document \| ShadowRoot \| Element) => readonly Node[]` | Collects the tree roots a wait observes under a node: the node's own root, then every open shadow root and every same-origin frame document at or beneath it, recursively. |
|
|
1577
|
+
| `computeBrowserAlternative` | function | `(node: Node, context?: BrowserNameContext) => string` | Computes the text one node contributes to an accessible name: its own text alternative, or its content. |
|
|
1578
|
+
| `computeBrowserName` | function | `(element: Element, role?: string \| undefined) => string` | Computes the accessible name of an element, trimmed and whitespace-collapsed. |
|
|
1579
|
+
| `computeBrowserRole` | function | `(element: Element) => string \| undefined` | Computes the ARIA role of an element from its `role` attribute or its implicit mapping. |
|
|
1580
|
+
| `computeBrowserText` | function | `(root: Element \| ShadowRoot, context?: BrowserNameContext) => string` | Computes the text an element's content contributes to an accessible name, in the flat tree, trimmed and whitespace-collapsed. |
|
|
1581
|
+
| `isBrowserDocument` | function | `(value: unknown) => value is Document` | Narrows a value to a `Document` attached to a window. |
|
|
1582
|
+
| `listenBrowserNavigation` | function | `(window: Window, listener: (event: Event) => void, signal: AbortSignal) => void` | Subscribes one listener to a window's navigation events until a signal aborts. |
|
|
1583
|
+
| `matchesBrowserActivation` | function | `(target: Element, label: Element) => boolean` | Checks whether a click on an element activates the `label` that contains it, following the HTML label activation rule. |
|
|
1584
|
+
| `matchesBrowserBlock` | function | `(element: Element) => boolean` | Checks whether an element starts a block of its own, the unit that separates runs of text. |
|
|
1585
|
+
| `matchesBrowserHidden` | function | `(element: Element) => boolean` | Checks whether an element and its subtree are hidden from the rendered page. |
|
|
1586
|
+
| `matchesBrowserInvisible` | function | `(element: Element) => boolean` | Checks whether an element renders nothing visible of its own. |
|
|
1587
|
+
| `matchesBrowserOmitted` | function | `(element: Element) => boolean` | Checks whether an element sits in an omitted subtree: the element or a flat-tree ancestor that `readBrowserParent` reaches matches `matchesBrowserHidden`, through assigned slots, shadow hosts, and the frame elements of same-origin documents. |
|
|
1588
|
+
| `matchesBrowserPopup` | function | `(element: Element) => boolean` | Checks whether activating an element opens another browsing context. |
|
|
1589
|
+
| `readBrowserBlock` | function | `(element: Element \| null, root: Node) => Node` | Reads the nearest block container of an element, the unit that separates runs of text. |
|
|
1590
|
+
| `readBrowserCapture` | function | `(node: Element) => BrowserContentInput` | Reads the URL, title, and rendered markup a DOM reading is built from, refusing a capture over the result limit before any parse. |
|
|
1591
|
+
| `readBrowserContent` | function | `(root: Element \| ShadowRoot, context?: BrowserNameContext) => string` | Reads the untrimmed text an element's content contributes to an accessible name, in the flat tree. |
|
|
1592
|
+
| `readBrowserParent` | function | `(element: Element) => Element \| null` | Reads an element's parent in the flat tree: the slot it is assigned to in an open shadow root, its parent element, the host of the open shadow root it sits at the top of, or the frame element of its same-origin document. |
|
|
1593
|
+
| `readBrowserStates` | function | `(element: Element, role: string) => Readonly<Record<string, string \| boolean>>` | Reads the pressed, expanded, and selected states the DOM outline assigns to an element's role. |
|
|
1594
|
+
| `readBrowserToken` | function | `(element: Element, attribute: string) => string \| undefined` | Reads a lowercased ARIA token, preserving whitespace and treating empty or undefined tokens as absent. |
|
|
1595
|
+
| `skipBrowserSubtree` | function | `(walker: TreeWalker) => Node \| null` | Moves a tree walker past the subtree of its current node. |
|
|
1596
|
+
| `BROWSER_CONTENT_NAMED_ROLES` | const | `ReadonlySet<string>` | Names the ARIA roles whose accessible name the accessible-name computation takes from the element's content when no attribute or label names it. |
|
|
1597
|
+
| `BROWSER_CONTEXT_TARGETS` | const | `ReadonlySet<string>` | Names the link and form targets that navigate the current browsing context or one of its ancestors. `_blank` opens another browsing context, and any other name targets the browsing context carrying that name, which `matchesBrowserPopup` resolves. |
|
|
1598
|
+
| `BROWSER_DOCUMENT_TIMEOUT_MS` | const | `5000` | Sets the default `wait` deadline for DOM waits in a browser document toolset, `5_000` milliseconds. |
|
|
1599
|
+
| `BROWSER_EXPANDED_ROLES` | const | `ReadonlySet<string>` | Names the roles whose ARIA expansion state the DOM outline reads. |
|
|
1600
|
+
| `BROWSER_IMPLICIT_ROLES` | const | `ReadonlyMap<string, string>` | Maps an HTML element to the ARIA role the HTML Accessibility API Mappings specification gives it when it carries no `role` attribute. |
|
|
1601
|
+
| `BROWSER_INTERACTIVE_CONTENT` | const | `"a[href], audio[controls], button, details, embed, iframe, img[usemap], img[controls], input:not([type=\"hidden\" i]), label, select, textarea, video[controls]"` | Selects the HTML interactive content a click inside a `label` can land on without activating the label, as the HTML interactive-content category lists it: `a` with `href`, `audio` and `video` with `controls`, `button`, `details`, `embed`, `iframe`, `img` with `usemap` or `controls`, `input` other than `hidden`, `label`, `select`, and `textarea`. |
|
|
1602
|
+
| `BROWSER_SELECTED_ROLES` | const | `ReadonlySet<string>` | Names the roles whose selection state the DOM outline reads. |
|
|
1603
|
+
| `BROWSER_TYPED_INPUTS` | const | `ReadonlySet<string>` | Names the `input` type states whose value an untrusted `fill` sets as typed text. |
|
|
1604
1604
|
|
|
1605
1605
|
##### Capture state
|
|
1606
1606
|
|
|
1607
|
-
|
|
|
1608
|
-
| ---------------------------- | --------- | ---------------------------------------------------------------------------------- |
|
|
1609
|
-
| `BrowserAncestors` | class | Traverses ancestors lazily while retaining the previously yielded node. |
|
|
1610
|
-
| `BrowserCaptureSiblings` | class | Traverses paired live and inert siblings while preserving pointers across pruning. |
|
|
1611
|
-
| `BrowserDOMOutline` | class | Captures one flat-tree subtree while retaining its text and visibility state. |
|
|
1612
|
-
| `readBrowserCaptureValue` | function | Derives rendered form values and SVG fragments for an inert capture. |
|
|
1613
|
-
| `readBrowserCaptureOmission` | function | Checks shadow-slot ancestors for capture omission without skipping style reads. |
|
|
1614
|
-
| `BrowserDOMOutlineInput` | interface | Supplies the document subtree, row sinks, and traversal operations for an outline. |
|
|
1615
|
-
| `BrowserDOMOutlineInterface` | interface | Captures the rows of one document subtree. |
|
|
1616
|
-
| `BrowserAncestorReader` | type | Reads the next ancestor, ending at the platform's null boundary. |
|
|
1617
|
-
| `BrowserCaptureSibling` | interface | Pairs the current live and inert nodes during sibling traversal. |
|
|
1618
|
-
| `BrowserCaptureCursor` | interface | Retains the sibling pointers read before a capture prunes its copy. |
|
|
1619
|
-
| `BrowserCaptureValue` | interface | Carries rendered lines, fragments, or a container retained by a capture. |
|
|
1620
|
-
| `BrowserDOMSubmission` | class | Observes whether one form submission dispatches its submit event. |
|
|
1607
|
+
| Name | Kind | Signature | Summary |
|
|
1608
|
+
| ---------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
1609
|
+
| `BrowserAncestors` | class | `new <T>(node: T \| null, parent: BrowserAncestorReader<T>) => BrowserAncestors<T>` | Traverses ancestors lazily while retaining the previously yielded node. |
|
|
1610
|
+
| `BrowserCaptureSiblings` | class | `new (live: Element, twin: Element) => BrowserCaptureSiblings` | Traverses paired live and inert siblings while preserving pointers across pruning. |
|
|
1611
|
+
| `BrowserDOMOutline` | class | `new (input: BrowserDOMOutlineInput) => BrowserDOMOutlineInterface` | Captures one flat-tree subtree while retaining its text and visibility state. |
|
|
1612
|
+
| `readBrowserCaptureValue` | function | `(live: Element, twin: Element, view: Window & typeof globalThis, inert: Document, invisible: boolean, tag: string) => BrowserCaptureValue \| undefined` | Derives rendered form values and SVG fragments for an inert capture. |
|
|
1613
|
+
| `readBrowserCaptureOmission` | function | `(live: Element, child: Node, view: (Window & typeof globalThis) \| null, rendered: boolean, excluded: boolean) => boolean` | Checks shadow-slot ancestors for capture omission without skipping style reads. |
|
|
1614
|
+
| `BrowserDOMOutlineInput` | interface | `{ root, rows, muted, positions, watch, walk, text, row }` | Supplies the document subtree, row sinks, and traversal operations for an outline. |
|
|
1615
|
+
| `BrowserDOMOutlineInterface` | interface | `{ capture() }` | Captures the rows of one document subtree. |
|
|
1616
|
+
| `BrowserAncestorReader` | type | `(node: T) => T \| null` | Reads the next ancestor, ending at the platform's null boundary. |
|
|
1617
|
+
| `BrowserCaptureSibling` | interface | `{ child, mirror, element, counterpart }` | Pairs the current live and inert nodes during sibling traversal. |
|
|
1618
|
+
| `BrowserCaptureCursor` | interface | `{ child, mirror, element, counterpart }` | Retains the sibling pointers read before a capture prunes its copy. |
|
|
1619
|
+
| `BrowserCaptureValue` | interface | `{ fragments?, lines?, container? }` | Carries rendered lines, fragments, or a container retained by a capture. |
|
|
1620
|
+
| `BrowserDOMSubmission` | class | `new () => EventListenerObject` | Observes whether one form submission dispatches its submit event. |
|
|
1621
1621
|
|
|
1622
1622
|
```ts
|
|
1623
1623
|
import { readBrowserCaptureValue, readBrowserCaptureOmission } from '@orkestrel/browser/browser'
|
|
@@ -1684,11 +1684,11 @@ if (isBrowserDocument(document)) {
|
|
|
1684
1684
|
|
|
1685
1685
|
#### Protocol layer
|
|
1686
1686
|
|
|
1687
|
-
|
|
|
1688
|
-
| --------------------------- | --------- | ------------------------------------------------------------------------ |
|
|
1689
|
-
| `SocketCDPTransport` | class | Provides a raw CDP text transport over the browser's native `WebSocket`. |
|
|
1690
|
-
| `createSocketCDPTransport` | function | Creates a CDP transport over the browser's native `WebSocket`. |
|
|
1691
|
-
| `SocketCDPTransportOptions` | interface | Configures a CDP transport over the browser's `WebSocket`. |
|
|
1687
|
+
| Name | Kind | Signature | Summary |
|
|
1688
|
+
| --------------------------- | --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
1689
|
+
| `SocketCDPTransport` | class | `new (options: SocketCDPTransportOptions) => CDPTransportInterface` | Provides a raw CDP text transport over the browser's native `WebSocket`. |
|
|
1690
|
+
| `createSocketCDPTransport` | function | `(options: SocketCDPTransportOptions) => CDPTransportInterface` | Creates a CDP transport over the browser's native `WebSocket`. |
|
|
1691
|
+
| `SocketCDPTransportOptions` | interface | `{ on?, error?, url, timeout? }` | Configures a CDP transport over the browser's `WebSocket`. |
|
|
1692
1692
|
|
|
1693
1693
|
## Methods
|
|
1694
1694
|
|