browxai 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +139 -0
- package/THIRD_PARTY_NOTICES.md +45 -0
- package/dist/cli/chrome.d.ts +1 -0
- package/dist/cli/chrome.js +130 -0
- package/dist/cli/command-registry.d.ts +15 -0
- package/dist/cli/command-registry.js +35 -0
- package/dist/cli/doctor-plugins.d.ts +18 -0
- package/dist/cli/doctor-plugins.js +338 -0
- package/dist/cli/doctor.d.ts +9 -0
- package/dist/cli/doctor.js +407 -0
- package/dist/cli/init.d.ts +1 -0
- package/dist/cli/init.js +200 -0
- package/dist/cli/register-commands.d.ts +1 -0
- package/dist/cli/register-commands.js +22 -0
- package/dist/cli/serve.d.ts +14 -0
- package/dist/cli/serve.js +151 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +129 -0
- package/dist/engine/adapters/adb.d.ts +72 -0
- package/dist/engine/adapters/adb.js +200 -0
- package/dist/engine/adapters/android-cdp.d.ts +54 -0
- package/dist/engine/adapters/android-cdp.js +110 -0
- package/dist/engine/adapters/android.engine.d.ts +1 -0
- package/dist/engine/adapters/android.engine.js +31 -0
- package/dist/engine/adapters/chromium.engine.d.ts +1 -0
- package/dist/engine/adapters/chromium.engine.js +44 -0
- package/dist/engine/adapters/firefox.engine.d.ts +1 -0
- package/dist/engine/adapters/firefox.engine.js +43 -0
- package/dist/engine/adapters/playwright-chromium.d.ts +43 -0
- package/dist/engine/adapters/playwright-chromium.js +56 -0
- package/dist/engine/adapters/playwright-firefox.d.ts +52 -0
- package/dist/engine/adapters/playwright-firefox.js +97 -0
- package/dist/engine/adapters/playwright-webkit.d.ts +40 -0
- package/dist/engine/adapters/playwright-webkit.js +79 -0
- package/dist/engine/adapters/safari/bidi-client.d.ts +46 -0
- package/dist/engine/adapters/safari/bidi-client.js +130 -0
- package/dist/engine/adapters/safari/launch.d.ts +56 -0
- package/dist/engine/adapters/safari/launch.js +104 -0
- package/dist/engine/adapters/safari/webdriver-client.d.ts +102 -0
- package/dist/engine/adapters/safari/webdriver-client.js +175 -0
- package/dist/engine/adapters/safari.engine.d.ts +1 -0
- package/dist/engine/adapters/safari.engine.js +52 -0
- package/dist/engine/adapters/safaridriver-hybrid.d.ts +56 -0
- package/dist/engine/adapters/safaridriver-hybrid.js +127 -0
- package/dist/engine/adapters/webkit.engine.d.ts +1 -0
- package/dist/engine/adapters/webkit.engine.js +47 -0
- package/dist/engine/capabilities.d.ts +53 -0
- package/dist/engine/capabilities.js +122 -0
- package/dist/engine/capability-registry.d.ts +9 -0
- package/dist/engine/capability-registry.js +20 -0
- package/dist/engine/index.d.ts +18 -0
- package/dist/engine/index.js +14 -0
- package/dist/engine/register-engines.d.ts +5 -0
- package/dist/engine/register-engines.js +16 -0
- package/dist/engine/registry.d.ts +145 -0
- package/dist/engine/registry.js +67 -0
- package/dist/engine/select.d.ts +48 -0
- package/dist/engine/select.js +128 -0
- package/dist/engine/session-cdp.d.ts +13 -0
- package/dist/engine/session-cdp.js +22 -0
- package/dist/engine/tool-gate.d.ts +19 -0
- package/dist/engine/tool-gate.js +226 -0
- package/dist/engine/types.d.ts +71 -0
- package/dist/engine/types.js +16 -0
- package/dist/helper/bridge.d.ts +48 -0
- package/dist/helper/bridge.js +200 -0
- package/dist/helper/browx-page.d.ts +1 -0
- package/dist/helper/browx-page.js +47 -0
- package/dist/helper/overlay-hide.d.ts +9 -0
- package/dist/helper/overlay-hide.js +49 -0
- package/dist/helper/stealth.d.ts +10 -0
- package/dist/helper/stealth.js +88 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -0
- package/dist/page/a11y.d.ts +81 -0
- package/dist/page/a11y.js +219 -0
- package/dist/page/action-substrate.d.ts +64 -0
- package/dist/page/action-substrate.js +118 -0
- package/dist/page/actionresult-blocks.d.ts +99 -0
- package/dist/page/actionresult-blocks.js +144 -0
- package/dist/page/actionresult-shape.d.ts +48 -0
- package/dist/page/actionresult-shape.js +155 -0
- package/dist/page/actionresult-types.d.ts +368 -0
- package/dist/page/actionresult-types.js +4 -0
- package/dist/page/actionresult.d.ts +4 -0
- package/dist/page/actionresult.js +299 -0
- package/dist/page/actions-probe.d.ts +32 -0
- package/dist/page/actions-probe.js +294 -0
- package/dist/page/actions-scroll.d.ts +40 -0
- package/dist/page/actions-scroll.js +53 -0
- package/dist/page/actions.d.ts +132 -0
- package/dist/page/actions.js +453 -0
- package/dist/page/archive-assets.d.ts +39 -0
- package/dist/page/archive-assets.js +187 -0
- package/dist/page/archive.d.ts +47 -0
- package/dist/page/archive.js +349 -0
- package/dist/page/asset-export.d.ts +122 -0
- package/dist/page/asset-export.js +376 -0
- package/dist/page/await_network.d.ts +16 -0
- package/dist/page/await_network.js +23 -0
- package/dist/page/bbox.d.ts +37 -0
- package/dist/page/bbox.js +115 -0
- package/dist/page/canvas-capture.d.ts +82 -0
- package/dist/page/canvas-capture.js +257 -0
- package/dist/page/canvas-diff.d.ts +51 -0
- package/dist/page/canvas-diff.js +131 -0
- package/dist/page/canvas-gesture.d.ts +53 -0
- package/dist/page/canvas-gesture.js +167 -0
- package/dist/page/canvas-transform.d.ts +96 -0
- package/dist/page/canvas-transform.js +150 -0
- package/dist/page/canvas.d.ts +8 -0
- package/dist/page/canvas.js +50 -0
- package/dist/page/capture-substrate.d.ts +111 -0
- package/dist/page/capture-substrate.js +139 -0
- package/dist/page/clipboard.d.ts +25 -0
- package/dist/page/clipboard.js +50 -0
- package/dist/page/clock.d.ts +36 -0
- package/dist/page/clock.js +167 -0
- package/dist/page/compose.d.ts +55 -0
- package/dist/page/compose.js +169 -0
- package/dist/page/console.d.ts +39 -0
- package/dist/page/console.js +73 -0
- package/dist/page/coverage.d.ts +97 -0
- package/dist/page/coverage.js +280 -0
- package/dist/page/dom-export.d.ts +41 -0
- package/dist/page/dom-export.js +193 -0
- package/dist/page/dom-walk.d.ts +91 -0
- package/dist/page/dom-walk.js +267 -0
- package/dist/page/dom_diff.d.ts +48 -0
- package/dist/page/dom_diff.js +121 -0
- package/dist/page/downloads.d.ts +80 -0
- package/dist/page/downloads.js +244 -0
- package/dist/page/drop-files.d.ts +78 -0
- package/dist/page/drop-files.js +310 -0
- package/dist/page/element-export-discovery.d.ts +64 -0
- package/dist/page/element-export-discovery.js +346 -0
- package/dist/page/element-export.d.ts +46 -0
- package/dist/page/element-export.js +251 -0
- package/dist/page/emulation-substrate.d.ts +53 -0
- package/dist/page/emulation-substrate.js +87 -0
- package/dist/page/emulation.d.ts +60 -0
- package/dist/page/emulation.js +162 -0
- package/dist/page/export-playwright-script.d.ts +47 -0
- package/dist/page/export-playwright-script.js +304 -0
- package/dist/page/extract-resolve.d.ts +22 -0
- package/dist/page/extract-resolve.js +341 -0
- package/dist/page/extract-schema.d.ts +20 -0
- package/dist/page/extract-schema.js +200 -0
- package/dist/page/extract-types.d.ts +127 -0
- package/dist/page/extract-types.js +8 -0
- package/dist/page/extract-warnings.d.ts +8 -0
- package/dist/page/extract-warnings.js +56 -0
- package/dist/page/extract.d.ts +9 -0
- package/dist/page/extract.js +174 -0
- package/dist/page/fill-form.d.ts +58 -0
- package/dist/page/fill-form.js +261 -0
- package/dist/page/find.d.ts +158 -0
- package/dist/page/find.js +470 -0
- package/dist/page/frames.d.ts +45 -0
- package/dist/page/frames.js +133 -0
- package/dist/page/generate-locator.d.ts +57 -0
- package/dist/page/generate-locator.js +136 -0
- package/dist/page/gestures.d.ts +128 -0
- package/dist/page/gestures.js +198 -0
- package/dist/page/har.d.ts +91 -0
- package/dist/page/har.js +174 -0
- package/dist/page/heap.d.ts +97 -0
- package/dist/page/heap.js +285 -0
- package/dist/page/inspect.d.ts +34 -0
- package/dist/page/inspect.js +75 -0
- package/dist/page/layout-thrash.d.ts +34 -0
- package/dist/page/layout-thrash.js +232 -0
- package/dist/page/learning.d.ts +21 -0
- package/dist/page/learning.js +84 -0
- package/dist/page/locator.d.ts +54 -0
- package/dist/page/locator.js +142 -0
- package/dist/page/memory-diff.d.ts +48 -0
- package/dist/page/memory-diff.js +105 -0
- package/dist/page/network-mask.d.ts +8 -0
- package/dist/page/network-mask.js +18 -0
- package/dist/page/network-playwright.d.ts +96 -0
- package/dist/page/network-playwright.js +353 -0
- package/dist/page/network-substrate-select.d.ts +18 -0
- package/dist/page/network-substrate-select.js +32 -0
- package/dist/page/network-substrate.d.ts +109 -0
- package/dist/page/network-substrate.js +161 -0
- package/dist/page/network-ws.d.ts +46 -0
- package/dist/page/network-ws.js +113 -0
- package/dist/page/network.d.ts +194 -0
- package/dist/page/network.js +415 -0
- package/dist/page/overflow-detect.d.ts +102 -0
- package/dist/page/overflow-detect.js +449 -0
- package/dist/page/pdf.d.ts +69 -0
- package/dist/page/pdf.js +109 -0
- package/dist/page/perf-audit-analysers.d.ts +40 -0
- package/dist/page/perf-audit-analysers.js +369 -0
- package/dist/page/perf-audit-runner.d.ts +20 -0
- package/dist/page/perf-audit-runner.js +195 -0
- package/dist/page/perf-audit-types.d.ts +41 -0
- package/dist/page/perf-audit-types.js +5 -0
- package/dist/page/perf-audit.d.ts +37 -0
- package/dist/page/perf-audit.js +377 -0
- package/dist/page/perf.d.ts +127 -0
- package/dist/page/perf.js +373 -0
- package/dist/page/plan.d.ts +192 -0
- package/dist/page/plan.js +308 -0
- package/dist/page/point_probe.d.ts +46 -0
- package/dist/page/point_probe.js +99 -0
- package/dist/page/recording.d.ts +67 -0
- package/dist/page/recording.js +172 -0
- package/dist/page/refs.d.ts +92 -0
- package/dist/page/refs.js +134 -0
- package/dist/page/regions.d.ts +23 -0
- package/dist/page/regions.js +32 -0
- package/dist/page/routes.d.ts +40 -0
- package/dist/page/routes.js +87 -0
- package/dist/page/safari-actions.d.ts +12 -0
- package/dist/page/safari-actions.js +144 -0
- package/dist/page/sample.d.ts +64 -0
- package/dist/page/sample.js +216 -0
- package/dist/page/screenshot-on.d.ts +51 -0
- package/dist/page/screenshot-on.js +150 -0
- package/dist/page/screenshot-save.d.ts +36 -0
- package/dist/page/screenshot-save.js +53 -0
- package/dist/page/screenshot-schedule.d.ts +50 -0
- package/dist/page/screenshot-schedule.js +155 -0
- package/dist/page/script-substrate.d.ts +32 -0
- package/dist/page/script-substrate.js +47 -0
- package/dist/page/seed-random.d.ts +45 -0
- package/dist/page/seed-random.js +144 -0
- package/dist/page/set-of-marks.d.ts +96 -0
- package/dist/page/set-of-marks.js +245 -0
- package/dist/page/shadow.d.ts +136 -0
- package/dist/page/shadow.js +400 -0
- package/dist/page/shortcut.d.ts +50 -0
- package/dist/page/shortcut.js +147 -0
- package/dist/page/snapshot-substrate-safari.d.ts +30 -0
- package/dist/page/snapshot-substrate-safari.js +84 -0
- package/dist/page/snapshot-substrate-select.d.ts +24 -0
- package/dist/page/snapshot-substrate-select.js +34 -0
- package/dist/page/snapshot-substrate.d.ts +58 -0
- package/dist/page/snapshot-substrate.js +135 -0
- package/dist/page/snapshot.d.ts +24 -0
- package/dist/page/snapshot.js +162 -0
- package/dist/page/solve-captcha.d.ts +76 -0
- package/dist/page/solve-captcha.js +286 -0
- package/dist/page/storage-substrate-types.d.ts +221 -0
- package/dist/page/storage-substrate-types.js +6 -0
- package/dist/page/storage-substrate.d.ts +215 -0
- package/dist/page/storage-substrate.js +280 -0
- package/dist/page/structural.d.ts +9 -0
- package/dist/page/structural.js +152 -0
- package/dist/page/substrate-bundle-safari.d.ts +8 -0
- package/dist/page/substrate-bundle-safari.js +42 -0
- package/dist/page/substrate-bundle.d.ts +6 -0
- package/dist/page/substrate-bundle.js +53 -0
- package/dist/page/text_search.d.ts +44 -0
- package/dist/page/text_search.js +90 -0
- package/dist/page/upload.d.ts +28 -0
- package/dist/page/upload.js +62 -0
- package/dist/page/verify.d.ts +63 -0
- package/dist/page/verify.js +451 -0
- package/dist/page/video.d.ts +115 -0
- package/dist/page/video.js +169 -0
- package/dist/page/visibility.d.ts +22 -0
- package/dist/page/visibility.js +94 -0
- package/dist/page/watch.d.ts +29 -0
- package/dist/page/watch.js +99 -0
- package/dist/page/workers.d.ts +126 -0
- package/dist/page/workers.js +490 -0
- package/dist/page/ws-interactive.d.ts +82 -0
- package/dist/page/ws-interactive.js +318 -0
- package/dist/plugin/cli.d.ts +45 -0
- package/dist/plugin/cli.js +496 -0
- package/dist/plugin/command-registry.d.ts +9 -0
- package/dist/plugin/command-registry.js +23 -0
- package/dist/plugin/depgraph.d.ts +37 -0
- package/dist/plugin/depgraph.js +186 -0
- package/dist/plugin/manifest.d.ts +182 -0
- package/dist/plugin/manifest.js +219 -0
- package/dist/plugin/package-manager.d.ts +22 -0
- package/dist/plugin/package-manager.js +40 -0
- package/dist/plugin/resolver.d.ts +85 -0
- package/dist/plugin/resolver.js +166 -0
- package/dist/plugin/runtime.d.ts +77 -0
- package/dist/plugin/runtime.js +402 -0
- package/dist/plugin/types.d.ts +113 -0
- package/dist/plugin/types.js +4 -0
- package/dist/policy/confirm.d.ts +76 -0
- package/dist/policy/confirm.js +162 -0
- package/dist/policy/origin.d.ts +17 -0
- package/dist/policy/origin.js +79 -0
- package/dist/sdk/client.d.ts +21 -0
- package/dist/sdk/client.js +174 -0
- package/dist/sdk/index.d.ts +32 -0
- package/dist/sdk/index.js +61 -0
- package/dist/sdk/plugin-types.d.ts +33 -0
- package/dist/sdk/plugin-types.js +22 -0
- package/dist/sdk/registry.d.ts +17 -0
- package/dist/sdk/registry.js +94 -0
- package/dist/sdk/socket-transport.d.ts +20 -0
- package/dist/sdk/socket-transport.js +90 -0
- package/dist/sdk/tool-types.d.ts +634 -0
- package/dist/sdk/tool-types.js +28 -0
- package/dist/sdk/transport-in-process.d.ts +21 -0
- package/dist/sdk/transport-in-process.js +44 -0
- package/dist/sdk/transport-registry.d.ts +19 -0
- package/dist/sdk/transport-registry.js +31 -0
- package/dist/sdk/transport-socket.d.ts +12 -0
- package/dist/sdk/transport-socket.js +77 -0
- package/dist/sdk/transport-stdio-child.d.ts +10 -0
- package/dist/sdk/transport-stdio-child.js +47 -0
- package/dist/sdk/transport.d.ts +10 -0
- package/dist/sdk/transport.js +35 -0
- package/dist/sdk/types.d.ts +176 -0
- package/dist/sdk/types.js +10 -0
- package/dist/server.d.ts +33 -0
- package/dist/server.js +327 -0
- package/dist/session/artifacts.d.ts +52 -0
- package/dist/session/artifacts.js +177 -0
- package/dist/session/byob-attach.d.ts +26 -0
- package/dist/session/byob-attach.js +187 -0
- package/dist/session/byob.d.ts +8 -0
- package/dist/session/byob.js +20 -0
- package/dist/session/cache-storage.d.ts +100 -0
- package/dist/session/cache-storage.js +166 -0
- package/dist/session/device-emu.d.ts +149 -0
- package/dist/session/device-emu.js +545 -0
- package/dist/session/device.d.ts +14 -0
- package/dist/session/device.js +44 -0
- package/dist/session/dialog.d.ts +62 -0
- package/dist/session/dialog.js +164 -0
- package/dist/session/emulation.d.ts +69 -0
- package/dist/session/emulation.js +168 -0
- package/dist/session/extensions.d.ts +113 -0
- package/dist/session/extensions.js +237 -0
- package/dist/session/fs-picker.d.ts +144 -0
- package/dist/session/fs-picker.js +666 -0
- package/dist/session/idb-storage.d.ts +86 -0
- package/dist/session/idb-storage.js +229 -0
- package/dist/session/incognito.d.ts +3 -0
- package/dist/session/incognito.js +20 -0
- package/dist/session/launch-options.d.ts +41 -0
- package/dist/session/launch-options.js +200 -0
- package/dist/session/managed.d.ts +3 -0
- package/dist/session/managed.js +16 -0
- package/dist/session/metrics.d.ts +45 -0
- package/dist/session/metrics.js +75 -0
- package/dist/session/notification.d.ts +122 -0
- package/dist/session/notification.js +426 -0
- package/dist/session/permission.d.ts +144 -0
- package/dist/session/permission.js +600 -0
- package/dist/session/playwright-post-wire.d.ts +8 -0
- package/dist/session/playwright-post-wire.js +148 -0
- package/dist/session/policy-buffer.d.ts +21 -0
- package/dist/session/policy-buffer.js +47 -0
- package/dist/session/profile-snapshot.d.ts +11 -0
- package/dist/session/profile-snapshot.js +53 -0
- package/dist/session/registry.d.ts +365 -0
- package/dist/session/registry.js +98 -0
- package/dist/session/safari-post-wire.d.ts +8 -0
- package/dist/session/safari-post-wire.js +28 -0
- package/dist/session/safari-session.d.ts +10 -0
- package/dist/session/safari-session.js +39 -0
- package/dist/session/storage.d.ts +148 -0
- package/dist/session/storage.js +350 -0
- package/dist/session/types.d.ts +113 -0
- package/dist/session/types.js +5 -0
- package/dist/session/wedge.d.ts +15 -0
- package/dist/session/wedge.js +41 -0
- package/dist/tools/action-core-tools.d.ts +13 -0
- package/dist/tools/action-core-tools.js +156 -0
- package/dist/tools/action-form-tools.d.ts +12 -0
- package/dist/tools/action-form-tools.js +179 -0
- package/dist/tools/action-gesture-tools.d.ts +9 -0
- package/dist/tools/action-gesture-tools.js +115 -0
- package/dist/tools/action-history-tools.d.ts +8 -0
- package/dist/tools/action-history-tools.js +67 -0
- package/dist/tools/action-tool.d.ts +42 -0
- package/dist/tools/action-tool.js +58 -0
- package/dist/tools/action-tools.d.ts +20 -0
- package/dist/tools/action-tools.js +28 -0
- package/dist/tools/batch-act-tools.d.ts +10 -0
- package/dist/tools/batch-act-tools.js +276 -0
- package/dist/tools/batch-human-tools.d.ts +8 -0
- package/dist/tools/batch-human-tools.js +148 -0
- package/dist/tools/canvas-tools.d.ts +40 -0
- package/dist/tools/canvas-tools.js +368 -0
- package/dist/tools/capture-report-diagnostics-tools.d.ts +7 -0
- package/dist/tools/capture-report-diagnostics-tools.js +318 -0
- package/dist/tools/capture-report-element-export-tools.d.ts +8 -0
- package/dist/tools/capture-report-element-export-tools.js +197 -0
- package/dist/tools/capture-report-export-tools.d.ts +8 -0
- package/dist/tools/capture-report-export-tools.js +246 -0
- package/dist/tools/capture-report-marks-tools.d.ts +9 -0
- package/dist/tools/capture-report-marks-tools.js +221 -0
- package/dist/tools/capture-report-upload-tools.d.ts +8 -0
- package/dist/tools/capture-report-upload-tools.js +277 -0
- package/dist/tools/config-approval-tools.d.ts +8 -0
- package/dist/tools/config-approval-tools.js +166 -0
- package/dist/tools/deep-coverage-tools.d.ts +8 -0
- package/dist/tools/deep-coverage-tools.js +325 -0
- package/dist/tools/deep-determinism-tools.d.ts +8 -0
- package/dist/tools/deep-determinism-tools.js +276 -0
- package/dist/tools/deep-perf-tools.d.ts +19 -0
- package/dist/tools/deep-perf-tools.js +324 -0
- package/dist/tools/device-emulation-tools.d.ts +9 -0
- package/dist/tools/device-emulation-tools.js +137 -0
- package/dist/tools/extensions-batch-tools.d.ts +18 -0
- package/dist/tools/extensions-batch-tools.js +24 -0
- package/dist/tools/extensions-rebuild.d.ts +22 -0
- package/dist/tools/extensions-rebuild.js +208 -0
- package/dist/tools/extensions-tools.d.ts +2 -0
- package/dist/tools/extensions-tools.js +331 -0
- package/dist/tools/forms-fill-tools.d.ts +8 -0
- package/dist/tools/forms-fill-tools.js +109 -0
- package/dist/tools/forms-plan-tools.d.ts +7 -0
- package/dist/tools/forms-plan-tools.js +159 -0
- package/dist/tools/forms-recording-mode-tools.d.ts +8 -0
- package/dist/tools/forms-recording-mode-tools.js +71 -0
- package/dist/tools/forms-recording-tools.d.ts +14 -0
- package/dist/tools/forms-recording-tools.js +22 -0
- package/dist/tools/forms-refs-tools.d.ts +8 -0
- package/dist/tools/forms-refs-tools.js +90 -0
- package/dist/tools/gesture-coord-tools.d.ts +8 -0
- package/dist/tools/gesture-coord-tools.js +168 -0
- package/dist/tools/gesture-emulation-tools.d.ts +8 -0
- package/dist/tools/gesture-emulation-tools.js +135 -0
- package/dist/tools/gesture-network-tools.d.ts +17 -0
- package/dist/tools/gesture-network-tools.js +27 -0
- package/dist/tools/gesture-route-tools.d.ts +8 -0
- package/dist/tools/gesture-route-tools.js +142 -0
- package/dist/tools/gesture-websocket-tools.d.ts +8 -0
- package/dist/tools/gesture-websocket-tools.js +122 -0
- package/dist/tools/gesture-worker-tools.d.ts +9 -0
- package/dist/tools/gesture-worker-tools.js +200 -0
- package/dist/tools/host-build.d.ts +76 -0
- package/dist/tools/host-build.js +516 -0
- package/dist/tools/host.d.ts +287 -0
- package/dist/tools/host.js +1 -0
- package/dist/tools/input-tools.d.ts +10 -0
- package/dist/tools/input-tools.js +176 -0
- package/dist/tools/live-emulation-tools.d.ts +9 -0
- package/dist/tools/live-emulation-tools.js +353 -0
- package/dist/tools/plugin-runtime.d.ts +36 -0
- package/dist/tools/plugin-runtime.js +274 -0
- package/dist/tools/read-observe-buffer-tools.d.ts +9 -0
- package/dist/tools/read-observe-buffer-tools.js +385 -0
- package/dist/tools/read-observe-capture-tools.d.ts +12 -0
- package/dist/tools/read-observe-capture-tools.js +376 -0
- package/dist/tools/read-observe-dom-tools.d.ts +8 -0
- package/dist/tools/read-observe-dom-tools.js +308 -0
- package/dist/tools/read-observe-extract-tools.d.ts +8 -0
- package/dist/tools/read-observe-extract-tools.js +232 -0
- package/dist/tools/read-observe-verify-tools.d.ts +8 -0
- package/dist/tools/read-observe-verify-tools.js +316 -0
- package/dist/tools/schemas.d.ts +29 -0
- package/dist/tools/schemas.js +58 -0
- package/dist/tools/secrets-captcha-tools.d.ts +9 -0
- package/dist/tools/secrets-captcha-tools.js +231 -0
- package/dist/tools/session-dialog-permission-tools.d.ts +9 -0
- package/dist/tools/session-dialog-permission-tools.js +287 -0
- package/dist/tools/session-lifecycle-tools.d.ts +8 -0
- package/dist/tools/session-lifecycle-tools.js +314 -0
- package/dist/tools/session-notification-device-tools.d.ts +9 -0
- package/dist/tools/session-notification-device-tools.js +156 -0
- package/dist/tools/session-policy-tools.d.ts +16 -0
- package/dist/tools/session-policy-tools.js +22 -0
- package/dist/tools/session-registry.d.ts +28 -0
- package/dist/tools/session-registry.js +427 -0
- package/dist/tools/storage-artifact-har-video-tools.d.ts +8 -0
- package/dist/tools/storage-artifact-har-video-tools.js +311 -0
- package/dist/tools/storage-cache-idb-tools.d.ts +8 -0
- package/dist/tools/storage-cache-idb-tools.js +347 -0
- package/dist/tools/storage-state-cookies-tools.d.ts +8 -0
- package/dist/tools/storage-state-cookies-tools.js +223 -0
- package/dist/tools/storage-tools.d.ts +17 -0
- package/dist/tools/storage-tools.js +25 -0
- package/dist/tools/storage-web-auth-tools.d.ts +10 -0
- package/dist/tools/storage-web-auth-tools.js +230 -0
- package/dist/tools/tool-metadata.d.ts +8 -0
- package/dist/tools/tool-metadata.js +185 -0
- package/dist/util/batch.d.ts +83 -0
- package/dist/util/batch.js +191 -0
- package/dist/util/capabilities.d.ts +504 -0
- package/dist/util/capabilities.js +254 -0
- package/dist/util/config-store.d.ts +103 -0
- package/dist/util/config-store.js +206 -0
- package/dist/util/config.d.ts +11 -0
- package/dist/util/config.js +28 -0
- package/dist/util/credentials.d.ts +136 -0
- package/dist/util/credentials.js +622 -0
- package/dist/util/deadline.d.ts +22 -0
- package/dist/util/deadline.js +62 -0
- package/dist/util/diagnostics.d.ts +161 -0
- package/dist/util/diagnostics.js +579 -0
- package/dist/util/egress-sanitiser.d.ts +29 -0
- package/dist/util/egress-sanitiser.js +52 -0
- package/dist/util/failure.d.ts +8 -0
- package/dist/util/failure.js +50 -0
- package/dist/util/flake-check.d.ts +109 -0
- package/dist/util/flake-check.js +342 -0
- package/dist/util/invariant.d.ts +25 -0
- package/dist/util/invariant.js +66 -0
- package/dist/util/logging.d.ts +6 -0
- package/dist/util/logging.js +12 -0
- package/dist/util/predicates.d.ts +62 -0
- package/dist/util/predicates.js +340 -0
- package/dist/util/secrets.d.ts +104 -0
- package/dist/util/secrets.js +219 -0
- package/dist/util/tokens.d.ts +6 -0
- package/dist/util/tokens.js +24 -0
- package/dist/util/url-sanitizer.d.ts +19 -0
- package/dist/util/url-sanitizer.js +70 -0
- package/dist/util/version.d.ts +2 -0
- package/dist/util/version.js +21 -0
- package/dist/util/workspace.d.ts +7 -0
- package/dist/util/workspace.js +22 -0
- package/package.json +120 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// set-of-marks — composed PNG with numbered bounding boxes painted over
|
|
2
|
+
// caller-supplied candidates. Pure compose over existing primitives (find /
|
|
3
|
+
// snapshot / refs / bbox); no new browser interaction beyond a transient
|
|
4
|
+
// in-page overlay.
|
|
5
|
+
//
|
|
6
|
+
// Numbering shares the `name_ref` / `eN` namespace deliberately. When
|
|
7
|
+
// `label:"ref"`, each box renders the existing `eN` ref; when `label:"index"`
|
|
8
|
+
// (the default), the box renders the 1..N array position AND the result also
|
|
9
|
+
// carries an `{ index → ref }` mapping so the LLM can address the same
|
|
10
|
+
// element either way. We do not invent a parallel ID space.
|
|
11
|
+
//
|
|
12
|
+
// Image-library choice: an in-page overlay drawn via DOM + an absolute-positioned
|
|
13
|
+
// container, then `page.screenshot()`. browxai has no Node-side image library
|
|
14
|
+
// (sharp / canvas / jimp) in `dependencies`, and adding one would pull native
|
|
15
|
+
// bindings + ~MBs of install weight for a single drawing primitive. The
|
|
16
|
+
// in-page overlay is dependency-free, runs in the same coordinate space as
|
|
17
|
+
// `find().evidence.bbox` (CSS pixels, viewport-relative — exactly the rect
|
|
18
|
+
// `visibleRect` returns), and is removed before we return so it never leaks
|
|
19
|
+
// state into a follow-up read.
|
|
20
|
+
import { buildSelectorHint } from "./find.js";
|
|
21
|
+
import { visibleRect, locatorBoundingBox } from "./bbox.js";
|
|
22
|
+
import { walk } from "./a11y.js";
|
|
23
|
+
/** Type guard: does this candidate already carry a bbox (i.e. is it the
|
|
24
|
+
* full `FindCandidate`-shaped object)? */
|
|
25
|
+
function hasBbox(c) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(c, "bbox");
|
|
27
|
+
}
|
|
28
|
+
/** Build the ref→node lookup by walking the composed tree once, so each bare-ref
|
|
29
|
+
* candidate's `backendDOMNodeId` resolves exactly as `find()` would. Returns
|
|
30
|
+
* null + pushes a warning on compose failure. */
|
|
31
|
+
async function buildRefLookup(deps, warnings) {
|
|
32
|
+
try {
|
|
33
|
+
const { tree } = await deps.substrate.compose(deps.refs, deps.testAttributes);
|
|
34
|
+
if (!tree)
|
|
35
|
+
return null;
|
|
36
|
+
const m = new Map();
|
|
37
|
+
for (const { node } of walk(tree)) {
|
|
38
|
+
if (!m.has(node.ref))
|
|
39
|
+
m.set(node.ref, node);
|
|
40
|
+
}
|
|
41
|
+
return m;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
warnings.push(`set-of-marks: bbox lookup for bare ref candidates failed (${err instanceof Error ? err.message : String(err)}); ` +
|
|
45
|
+
`they will be reported without bboxes. Pass the full find() candidate to avoid the lookup.`);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** Build a mark entry from a node (carrying its optional role/name/testId). */
|
|
50
|
+
function markEntryFrom(index, node, bbox) {
|
|
51
|
+
return {
|
|
52
|
+
index,
|
|
53
|
+
ref: node.ref,
|
|
54
|
+
...(node.role !== undefined ? { role: node.role } : {}),
|
|
55
|
+
...(node.name !== undefined ? { name: node.name } : {}),
|
|
56
|
+
...(node.testId !== undefined ? { testId: node.testId } : {}),
|
|
57
|
+
bbox,
|
|
58
|
+
painted: bbox !== null,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Resolve one bare-ref candidate's bbox the same way `find()` does (CDP
|
|
62
|
+
* visibleRect → portable locatorBoundingBox fallback, capped at 1s). */
|
|
63
|
+
async function resolveBareRef(deps, index, ref, lookupByRef, warnings) {
|
|
64
|
+
const looked = lookupByRef?.get(ref);
|
|
65
|
+
if (!looked) {
|
|
66
|
+
warnings.push(`set-of-marks: ref "${ref}" was not surfaced by the current snapshot walk — ` +
|
|
67
|
+
`no bbox to paint. Pass the full find() candidate (with bbox) or call snapshot/find first.`);
|
|
68
|
+
return { index, ref, bbox: null, painted: false };
|
|
69
|
+
}
|
|
70
|
+
let bbox = deps.cdp !== undefined && looked.backendDOMNodeId !== undefined
|
|
71
|
+
? await visibleRect(deps.cdp, looked.backendDOMNodeId)
|
|
72
|
+
: null;
|
|
73
|
+
if (bbox === null) {
|
|
74
|
+
const { hint } = buildSelectorHint(looked);
|
|
75
|
+
bbox = await locatorBoundingBox(deps.page, hint, { timeoutMs: 1000 });
|
|
76
|
+
}
|
|
77
|
+
return markEntryFrom(index, looked, bbox);
|
|
78
|
+
}
|
|
79
|
+
export async function resolveCandidates(deps, candidates) {
|
|
80
|
+
const warnings = [];
|
|
81
|
+
const entries = [];
|
|
82
|
+
// Fast-path: when every candidate already carries a bbox (e.g. piped straight
|
|
83
|
+
// from a prior find()), skip the tree walk entirely.
|
|
84
|
+
const lookupByRef = candidates.every(hasBbox) ? null : await buildRefLookup(deps, warnings);
|
|
85
|
+
for (let i = 0; i < candidates.length; i++) {
|
|
86
|
+
const c = candidates[i];
|
|
87
|
+
if (hasBbox(c)) {
|
|
88
|
+
entries.push(markEntryFrom(i + 1, c, c.bbox));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
entries.push(await resolveBareRef(deps, i + 1, c.ref, lookupByRef, warnings));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { entries, warnings };
|
|
95
|
+
}
|
|
96
|
+
/** Pure label-builder. Exported for unit-test direct coverage. */
|
|
97
|
+
export function labelFor(entry, mode) {
|
|
98
|
+
switch (mode) {
|
|
99
|
+
case "ref":
|
|
100
|
+
return entry.ref;
|
|
101
|
+
case "role":
|
|
102
|
+
return entry.role ?? entry.ref;
|
|
103
|
+
case "index":
|
|
104
|
+
default:
|
|
105
|
+
return String(entry.index);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** Build the in-page overlay-painter script. Inlines the painted boxes
|
|
109
|
+
* (already resolved server-side) — page-side does no DOM walking, only
|
|
110
|
+
* paints absolute-positioned <div>s + a label badge per box, returning the
|
|
111
|
+
* element id of the overlay container so we can remove it after. */
|
|
112
|
+
function buildOverlayScript(paintedBoxes) {
|
|
113
|
+
const data = JSON.stringify(paintedBoxes);
|
|
114
|
+
return `(() => {
|
|
115
|
+
var BOXES = ${data};
|
|
116
|
+
var OVERLAY_ID = 'browxai-set-of-marks-' + Math.random().toString(36).slice(2);
|
|
117
|
+
var root = document.createElement('div');
|
|
118
|
+
root.id = OVERLAY_ID;
|
|
119
|
+
root.setAttribute('aria-hidden', 'true');
|
|
120
|
+
root.style.cssText = [
|
|
121
|
+
'position:fixed',
|
|
122
|
+
'left:0','top:0','right:0','bottom:0',
|
|
123
|
+
'pointer-events:none',
|
|
124
|
+
'z-index:2147483647',
|
|
125
|
+
'margin:0','padding:0',
|
|
126
|
+
'background:transparent',
|
|
127
|
+
].join(';');
|
|
128
|
+
BOXES.forEach(function (b) {
|
|
129
|
+
var box = document.createElement('div');
|
|
130
|
+
box.style.cssText = [
|
|
131
|
+
'position:absolute',
|
|
132
|
+
'left:' + b.x + 'px','top:' + b.y + 'px',
|
|
133
|
+
'width:' + b.width + 'px','height:' + b.height + 'px',
|
|
134
|
+
'box-sizing:border-box',
|
|
135
|
+
'border:2px solid #ff0066',
|
|
136
|
+
'background:rgba(255,0,102,0.08)',
|
|
137
|
+
'border-radius:2px',
|
|
138
|
+
].join(';');
|
|
139
|
+
var badge = document.createElement('div');
|
|
140
|
+
badge.textContent = b.label;
|
|
141
|
+
// Default badge corner: top-left of the box, pulled outward so it
|
|
142
|
+
// doesn't occlude the box's contents. When the box hugs an edge of the
|
|
143
|
+
// viewport, flip the badge to the box's inside corner so it stays in
|
|
144
|
+
// frame for the screenshot.
|
|
145
|
+
var anchorTop = b.y >= 22;
|
|
146
|
+
var anchorLeft = b.x >= 24;
|
|
147
|
+
var tx = anchorLeft ? '-100%' : '100%';
|
|
148
|
+
var ty = anchorTop ? '-100%' : '100%';
|
|
149
|
+
var styles = [
|
|
150
|
+
'position:absolute',
|
|
151
|
+
anchorTop ? 'top:-2px' : 'bottom:-2px',
|
|
152
|
+
anchorLeft ? 'left:-2px' : 'right:-2px',
|
|
153
|
+
'transform:translate(' + tx + ',' + ty + ')',
|
|
154
|
+
'min-width:18px','height:18px','line-height:18px',
|
|
155
|
+
'padding:0 5px','box-sizing:border-box',
|
|
156
|
+
'background:#ff0066','color:#fff',
|
|
157
|
+
'font:bold 12px/18px ui-sans-serif,system-ui,-apple-system,sans-serif',
|
|
158
|
+
'text-align:center','border-radius:9px',
|
|
159
|
+
'box-shadow:0 1px 2px rgba(0,0,0,0.35)',
|
|
160
|
+
'white-space:nowrap',
|
|
161
|
+
];
|
|
162
|
+
badge.style.cssText = styles.join(';');
|
|
163
|
+
box.appendChild(badge);
|
|
164
|
+
root.appendChild(box);
|
|
165
|
+
});
|
|
166
|
+
document.documentElement.appendChild(root);
|
|
167
|
+
return OVERLAY_ID;
|
|
168
|
+
})()`;
|
|
169
|
+
}
|
|
170
|
+
/** Remove the overlay element previously installed by buildOverlayScript. */
|
|
171
|
+
function buildRemoveScript(overlayId) {
|
|
172
|
+
return `(() => {
|
|
173
|
+
var el = document.getElementById(${JSON.stringify(overlayId)});
|
|
174
|
+
if (el && el.parentNode) el.parentNode.removeChild(el);
|
|
175
|
+
return true;
|
|
176
|
+
})()`;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Compose a single PNG screenshot of the current viewport with numbered
|
|
180
|
+
* bounding boxes painted over the supplied candidates. The numbering scheme
|
|
181
|
+
* shares the existing `eN` ref namespace (index↔ref mapping returned).
|
|
182
|
+
*
|
|
183
|
+
* `bbox` is honoured exactly as `find()` reported it — visible-rect with
|
|
184
|
+
* ancestor-overflow + viewport intersection applied (see `src/page/bbox.ts`).
|
|
185
|
+
* A candidate with `bbox: null` is **not** painted; it's listed in `marks`
|
|
186
|
+
* with `painted: false` and a `warnings` entry, so the caller knows the
|
|
187
|
+
* mapping still resolves but the box wasn't visible.
|
|
188
|
+
*
|
|
189
|
+
* The overlay is installed for the duration of the screenshot only and
|
|
190
|
+
* removed before this function returns. Failures during removal are
|
|
191
|
+
* best-effort (we still return the image + the warning).
|
|
192
|
+
*/
|
|
193
|
+
export async function screenshotMarks(page, substrate, refs, opts,
|
|
194
|
+
/** CDP handle for the visible-rect bbox fast path — chromium only. */
|
|
195
|
+
cdp) {
|
|
196
|
+
const testAttributes = opts.testAttributes ?? [];
|
|
197
|
+
const label = opts.label ?? "index";
|
|
198
|
+
const { entries, warnings } = await resolveCandidates({ page, substrate, refs, testAttributes, cdp }, opts.candidates);
|
|
199
|
+
// Only paint entries that have a bbox to paint.
|
|
200
|
+
const paintedBoxes = entries
|
|
201
|
+
.filter((e) => e.bbox !== null)
|
|
202
|
+
.map((e) => ({
|
|
203
|
+
x: e.bbox.x,
|
|
204
|
+
y: e.bbox.y,
|
|
205
|
+
width: e.bbox.width,
|
|
206
|
+
height: e.bbox.height,
|
|
207
|
+
label: labelFor(e, label),
|
|
208
|
+
}));
|
|
209
|
+
let overlayId = null;
|
|
210
|
+
let imageBase64 = "";
|
|
211
|
+
try {
|
|
212
|
+
if (paintedBoxes.length > 0) {
|
|
213
|
+
overlayId = await page.evaluate(buildOverlayScript(paintedBoxes));
|
|
214
|
+
}
|
|
215
|
+
const buf = await page.screenshot({ type: "png", fullPage: false });
|
|
216
|
+
imageBase64 = Buffer.from(buf).toString("base64");
|
|
217
|
+
}
|
|
218
|
+
finally {
|
|
219
|
+
if (overlayId) {
|
|
220
|
+
try {
|
|
221
|
+
await page.evaluate(buildRemoveScript(overlayId));
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
warnings.push(`set-of-marks: overlay removal failed; a stray <div id="${overlayId}"> may persist until the next navigation.`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Tally un-paintable candidates as warnings (one terse line, not one per
|
|
229
|
+
// entry — the per-entry `painted:false` already encodes it).
|
|
230
|
+
const skipped = entries.filter((e) => !e.painted).length;
|
|
231
|
+
if (skipped > 0) {
|
|
232
|
+
warnings.push(`set-of-marks: ${skipped} of ${entries.length} candidate(s) had no bbox (clipped / off-screen / unresolved) and were not painted on the image. ` +
|
|
233
|
+
`Their entries remain in \`marks\` with \`painted:false\` so the index↔ref mapping is still complete.`);
|
|
234
|
+
}
|
|
235
|
+
const mapping = {};
|
|
236
|
+
for (const e of entries)
|
|
237
|
+
mapping[String(e.index)] = e.ref;
|
|
238
|
+
return {
|
|
239
|
+
imageBase64,
|
|
240
|
+
mimeType: "image/png",
|
|
241
|
+
marks: entries,
|
|
242
|
+
mapping,
|
|
243
|
+
warnings,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { CDPSession } from "playwright-core";
|
|
2
|
+
/** One shadow-tree-entry surfaced by `shadow_trees`. */
|
|
3
|
+
export interface ShadowTreeEntry {
|
|
4
|
+
/** The host element's `ref` (from a prior `snapshot` / `find`) when the
|
|
5
|
+
* registry knows it; otherwise the CDP `backendNodeId` rendered as
|
|
6
|
+
* `"backend:<n>"` so an agent can correlate against `inspect()` output. */
|
|
7
|
+
hostRef: string;
|
|
8
|
+
/** Host element tag (lowercased). */
|
|
9
|
+
hostTag: string;
|
|
10
|
+
/** Shadow root mode as CDP reports it. */
|
|
11
|
+
mode: "open" | "closed";
|
|
12
|
+
/** Direct children of the shadow root (depth-1 summary — keeps the output
|
|
13
|
+
* token-bounded). Use `dom_export({includeShadow:true})` for the full
|
|
14
|
+
* recursive dump. */
|
|
15
|
+
children: ShadowChildSummary[];
|
|
16
|
+
/** Total descendant element count under the shadow root, including nested
|
|
17
|
+
* shadow subtrees we descended into. Cheap heuristic for "is this a
|
|
18
|
+
* thin wrapper or a whole sub-app?" */
|
|
19
|
+
descendantCount: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ShadowChildSummary {
|
|
22
|
+
tag: string;
|
|
23
|
+
/** Short text label — first non-empty `textContent`-equivalent slice
|
|
24
|
+
* (capped at 80 chars). Null when the element carries no direct text. */
|
|
25
|
+
text?: string;
|
|
26
|
+
/** Element child count of *this* shadow child (one level deep — same
|
|
27
|
+
* shape as `Element.childElementCount`). Lets the caller decide whether
|
|
28
|
+
* to drill in via `dom_export`. */
|
|
29
|
+
childCount: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ShadowTreesOptions {
|
|
32
|
+
/** Backend node id of the host to limit the walk to. When omitted, walks
|
|
33
|
+
* the entire document and returns every shadow root it finds. */
|
|
34
|
+
rootBackendNodeId?: number;
|
|
35
|
+
/** Hard cap on returned hosts. Default 200 — enough for typical
|
|
36
|
+
* shadow-heavy pages, bounded enough to keep tokens predictable. */
|
|
37
|
+
maxHosts?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ShadowTreesResult {
|
|
40
|
+
trees: ShadowTreeEntry[];
|
|
41
|
+
/** `true` when CDP's `pierce:true` view of the document came back with
|
|
42
|
+
* at least one closed-mode root (proves the closed-shadow path is live
|
|
43
|
+
* on this browser/page). `false` is informational — the page may simply
|
|
44
|
+
* not contain a closed root, or CDP refused the call. */
|
|
45
|
+
closedShadowAvailable: boolean;
|
|
46
|
+
/** Non-fatal warnings — e.g. CDP fell through to open-only, the host
|
|
47
|
+
* ref didn't resolve, we hit the `maxHosts` cap. */
|
|
48
|
+
warnings: string[];
|
|
49
|
+
}
|
|
50
|
+
/** CDP `DOM.Node` subset we care about. Fields are optional — different
|
|
51
|
+
* Chromium versions populate different ones. */
|
|
52
|
+
interface CdpDomNode {
|
|
53
|
+
nodeId?: number;
|
|
54
|
+
backendNodeId?: number;
|
|
55
|
+
nodeType?: number;
|
|
56
|
+
nodeName?: string;
|
|
57
|
+
localName?: string;
|
|
58
|
+
attributes?: string[];
|
|
59
|
+
children?: CdpDomNode[];
|
|
60
|
+
shadowRoots?: CdpDomNode[];
|
|
61
|
+
shadowRootType?: "open" | "closed" | "user-agent";
|
|
62
|
+
contentDocument?: CdpDomNode;
|
|
63
|
+
textValue?: string;
|
|
64
|
+
nodeValue?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Read the full pierced DOM. Returns the root node and a "closed shadow root
|
|
68
|
+
* exists somewhere" flag. Falls back to an open-only document when CDP refuses
|
|
69
|
+
* the `pierce` parameter (older Chromium, attached BYOB endpoints whose CDP
|
|
70
|
+
* vintage differs from the launcher's). Caller is responsible for treating a
|
|
71
|
+
* `null` result as "shadow walk unavailable" — no exception is thrown so the
|
|
72
|
+
* outer tool can still emit a partial result.
|
|
73
|
+
*/
|
|
74
|
+
export declare function fetchPiercedDocument(cdp: CDPSession): Promise<{
|
|
75
|
+
root: CdpDomNode | null;
|
|
76
|
+
closedAvailable: boolean;
|
|
77
|
+
warning?: string;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Walk a CDP-pierced document and collect shadow-root entries. When
|
|
81
|
+
* `rootBackendNodeId` is set, only the subtree rooted at that backend id
|
|
82
|
+
* contributes. When omitted, the entire document is walked.
|
|
83
|
+
*/
|
|
84
|
+
export declare function collectShadowTrees(root: CdpDomNode, opts: ShadowTreesOptions): {
|
|
85
|
+
entries: ShadowTreeEntry[];
|
|
86
|
+
cappedAt?: number;
|
|
87
|
+
};
|
|
88
|
+
/** Page-side counterpart for `shadow_trees` when only open shadow piercing
|
|
89
|
+
* is needed. Cheaper than the CDP `pierce:true` path (no full-document
|
|
90
|
+
* serialisation) and entirely Chromium-version-agnostic. The `hostRef`
|
|
91
|
+
* field is filled in by the caller (the registry is server-side). */
|
|
92
|
+
export declare function runOpenShadowWalk(cdp: CDPSession, rootSelector: string | undefined, max: number): Promise<Array<Omit<ShadowTreeEntry, "hostRef">>>;
|
|
93
|
+
/**
|
|
94
|
+
* A pseudo-DOM-walk entry for an interactive element discovered inside a
|
|
95
|
+
* CLOSED shadow root via the CDP pierce path. Same shape as the open-side
|
|
96
|
+
* `DomWalkEntry` so it can flow through `mergeDomWalkIntoTree` without a
|
|
97
|
+
* second path. Locator fields (`cssPath`) are best-effort — the host's
|
|
98
|
+
* `data-browx-host` data-id-style attribute would let us address closed-
|
|
99
|
+
* shadow elements deterministically, but the live page rarely carries
|
|
100
|
+
* such markers. We surface `tag` + (when present) any test attribute we
|
|
101
|
+
* recognise; agents can act on these via `find()` on the test-attr value
|
|
102
|
+
* (`[data-testid="…"]:visible` works through Playwright's normal
|
|
103
|
+
* locator engine because Playwright auto-pierces open shadow only —
|
|
104
|
+
* closed-shadow elements remain platform-protected and CANNOT be acted on
|
|
105
|
+
* by the action tools, only inspected). The result envelope warns when
|
|
106
|
+
* a closed-shadow candidate is returned.
|
|
107
|
+
*/
|
|
108
|
+
export interface ClosedShadowDomEntry {
|
|
109
|
+
role: string;
|
|
110
|
+
name: string;
|
|
111
|
+
testId: string;
|
|
112
|
+
testIdAttr: string;
|
|
113
|
+
tag: string;
|
|
114
|
+
id: string;
|
|
115
|
+
structuralPath: string;
|
|
116
|
+
cssPath: string;
|
|
117
|
+
/** Always `true` for these entries — drives the snapshot warning. */
|
|
118
|
+
closedShadow: true;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Harvest interactive / test-attr-bearing elements from CLOSED shadow roots
|
|
122
|
+
* only. Open-shadow elements are skipped (the page-side `runDomWalk` already
|
|
123
|
+
* covers them when `pierce: "open"` or `"closed"`). Returns an empty list +
|
|
124
|
+
* no warning when CDP's `pierce` path is unavailable.
|
|
125
|
+
*
|
|
126
|
+
* The walker reads the CDP-pierced DOM tree and identifies closed-mode
|
|
127
|
+
* shadow roots; for each, it harvests element-shaped descendants and
|
|
128
|
+
* extracts the same fields the page-side walker would. Doesn't fetch
|
|
129
|
+
* computed style / `getBoundingClientRect` — closed shadow can't be
|
|
130
|
+
* resolved to a Playwright locator anyway, so a bbox would be a lie.
|
|
131
|
+
*/
|
|
132
|
+
export declare function harvestClosedShadowElements(cdp: CDPSession, testAttrs: string[], maxEntries: number): Promise<{
|
|
133
|
+
entries: ClosedShadowDomEntry[];
|
|
134
|
+
warning?: string;
|
|
135
|
+
}>;
|
|
136
|
+
export {};
|