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,20 @@
|
|
|
1
|
+
import type { RegisterHost, GateHost, SessionHost, ActionHost, ConfigHost, ServerServicesHost } from "./host.js";
|
|
2
|
+
/**
|
|
3
|
+
* Navigation + core action tools — the verbs an agent drives a page with:
|
|
4
|
+
* navigate / click / fill / press / shortcut / drag / double_click / hover /
|
|
5
|
+
* select / wait_for / scroll / choose_option / go_back / go_forward /
|
|
6
|
+
* set_viewport.
|
|
7
|
+
*
|
|
8
|
+
* RFC 0004 P3 / D3 (SRP) + D4 (DRY): the registrations were split by cohesive
|
|
9
|
+
* family into four sibling modules (core / gesture / form / history), and the four
|
|
10
|
+
* canonical confirm-gated target-resolving handlers (click / fill / hover /
|
|
11
|
+
* select) now ride the `actionTool` wrapper. This module stays the single entry
|
|
12
|
+
* point `server.ts` + `tool-metadata.ts` call, and invokes each family in the
|
|
13
|
+
* EXACT prior source order so the registered-name set + the derived maps stay
|
|
14
|
+
* byte-identical.
|
|
15
|
+
*
|
|
16
|
+
* The parameter is narrowed to the sub-ports this family touches (RFC 0004 P3 /
|
|
17
|
+
* D3 ISP) — the signature compiles a guarantee that the action family reaches
|
|
18
|
+
* nothing outside gating, session resolution, action dispatch, and config.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerActionTools(host: RegisterHost & GateHost & SessionHost & ActionHost & ConfigHost & ServerServicesHost): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { registerActionCoreTools } from "./action-core-tools.js";
|
|
2
|
+
import { registerActionGestureTools } from "./action-gesture-tools.js";
|
|
3
|
+
import { registerActionFormTools } from "./action-form-tools.js";
|
|
4
|
+
import { registerActionHistoryTools } from "./action-history-tools.js";
|
|
5
|
+
/**
|
|
6
|
+
* Navigation + core action tools — the verbs an agent drives a page with:
|
|
7
|
+
* navigate / click / fill / press / shortcut / drag / double_click / hover /
|
|
8
|
+
* select / wait_for / scroll / choose_option / go_back / go_forward /
|
|
9
|
+
* set_viewport.
|
|
10
|
+
*
|
|
11
|
+
* RFC 0004 P3 / D3 (SRP) + D4 (DRY): the registrations were split by cohesive
|
|
12
|
+
* family into four sibling modules (core / gesture / form / history), and the four
|
|
13
|
+
* canonical confirm-gated target-resolving handlers (click / fill / hover /
|
|
14
|
+
* select) now ride the `actionTool` wrapper. This module stays the single entry
|
|
15
|
+
* point `server.ts` + `tool-metadata.ts` call, and invokes each family in the
|
|
16
|
+
* EXACT prior source order so the registered-name set + the derived maps stay
|
|
17
|
+
* byte-identical.
|
|
18
|
+
*
|
|
19
|
+
* The parameter is narrowed to the sub-ports this family touches (RFC 0004 P3 /
|
|
20
|
+
* D3 ISP) — the signature compiles a guarantee that the action family reaches
|
|
21
|
+
* nothing outside gating, session resolution, action dispatch, and config.
|
|
22
|
+
*/
|
|
23
|
+
export function registerActionTools(host) {
|
|
24
|
+
registerActionCoreTools(host);
|
|
25
|
+
registerActionGestureTools(host);
|
|
26
|
+
registerActionFormTools(host);
|
|
27
|
+
registerActionHistoryTools(host);
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RegisterHost, GateHost, SessionHost, ActionHost, EgressHost, ServerServicesHost } from "./host.js";
|
|
2
|
+
/**
|
|
3
|
+
* Act-then-trace + flake-check compound primitives: act_and_sample / act_and_diff
|
|
4
|
+
* / flake_check. Each dispatches an inner batch-allowed action and reports a
|
|
5
|
+
* sampled metric / DOM diff / determinism verdict. Split out of
|
|
6
|
+
* `extensions-batch-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
|
|
7
|
+
* through the shared `ToolHost` seam in the same source order. The host owns the
|
|
8
|
+
* closures; this module owns the registrations.
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerBatchActTools(host: RegisterHost & GateHost & SessionHost & ActionHost & EgressHost & ServerServicesHost): void;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { captureDomMap, diffDomMaps } from "../page/dom_diff.js";
|
|
2
|
+
import { sampleMetric, ELEMENT_METRICS } from "../page/sample.js";
|
|
3
|
+
import { runFlakeCheck } from "../util/flake-check.js";
|
|
4
|
+
import { SESSION_ARG, REF_OR_SELECTOR } from "./schemas.js";
|
|
5
|
+
/** A structured `{ok:false, error}` envelope as a tool text response. */
|
|
6
|
+
function batchJsonError(error) {
|
|
7
|
+
return {
|
|
8
|
+
content: [{ type: "text", text: JSON.stringify({ ok: false, error }, null, 2) }],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Act-then-trace + flake-check compound primitives: act_and_sample / act_and_diff
|
|
13
|
+
* / flake_check. Each dispatches an inner batch-allowed action and reports a
|
|
14
|
+
* sampled metric / DOM diff / determinism verdict. Split out of
|
|
15
|
+
* `extensions-batch-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
|
|
16
|
+
* through the shared `ToolHost` seam in the same source order. The host owns the
|
|
17
|
+
* closures; this module owns the registrations.
|
|
18
|
+
*/
|
|
19
|
+
export function registerBatchActTools(host) {
|
|
20
|
+
const { z, register, gateCheck, entryFor, asTarget, toolHandlers, egressFor, batchAllowedTools: BATCH_ALLOWED_TOOLS, } = host;
|
|
21
|
+
// The per-call cap shared with `batch` — `flake_check` reuses the same whitelist
|
|
22
|
+
// + ceiling (kept a local literal in each family module, byte-identical to the
|
|
23
|
+
// prior single declaration).
|
|
24
|
+
const BATCH_MAX_CALLS = 32;
|
|
25
|
+
// ---------- act-then-trace ----------
|
|
26
|
+
register("act_and_sample", {
|
|
27
|
+
capability: "read",
|
|
28
|
+
description: "run ONE action and capture a metric trace *across its transition*, in one call — closes the state-capture-latency blind spot (a separate read lands after the spinner/pending UI already resolved). The sampler (fixed-enum, no agent JS) starts, the inner action dispatches concurrently, both are awaited. `action` is `{tool,args}` from the batch whitelist (no `batch`/`await_human`/recording/self); the inner tool's capability + deadline + the confirm hooks still apply. Sample target via `ref`/`selector`/`named` (or omit for the document scroller; not coords). Returns `{ action: <inner result>, ...sampleResult }`.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
action: z.object({
|
|
31
|
+
tool: z.string().describe("Inner tool name (batch whitelist)."),
|
|
32
|
+
args: z
|
|
33
|
+
.record(z.unknown())
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Inner tool args (same shape as a top-level call)."),
|
|
36
|
+
}),
|
|
37
|
+
...REF_OR_SELECTOR,
|
|
38
|
+
metric: z.enum(ELEMENT_METRICS).describe("Fixed metric to trace (same enum as `sample`)."),
|
|
39
|
+
durationMs: z.number().int().positive().max(30_000).describe("Trace window (ms, ≤30000)."),
|
|
40
|
+
everyFrame: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Sample every animation frame (rAF). Default false → fixed interval."),
|
|
44
|
+
intervalMs: z
|
|
45
|
+
.number()
|
|
46
|
+
.int()
|
|
47
|
+
.positive()
|
|
48
|
+
.max(5000)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Interval (ms, default 100, min 16). Ignored when everyFrame:true."),
|
|
51
|
+
summary: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Series-omission control (summary always returned). true=omit series; false=always include; omit=auto-omit for large windows (>300 pts, sets `autoSummarised`)."),
|
|
55
|
+
...SESSION_ARG,
|
|
56
|
+
},
|
|
57
|
+
}, async (args) => {
|
|
58
|
+
const g = gateCheck("act_and_sample");
|
|
59
|
+
if (g)
|
|
60
|
+
return g;
|
|
61
|
+
const innerTool = args.action.tool;
|
|
62
|
+
if (!BATCH_ALLOWED_TOOLS.has(innerTool) || innerTool === "act_and_sample") {
|
|
63
|
+
return batchJsonError(`act_and_sample: inner tool "${innerTool}" not allowed (must be in the batch whitelist; no batch / await_human / recording / self)`);
|
|
64
|
+
}
|
|
65
|
+
const ig = gateCheck(innerTool);
|
|
66
|
+
if (ig)
|
|
67
|
+
return ig; // enforce the inner tool's own capability gate
|
|
68
|
+
const e = await entryFor(args.session);
|
|
69
|
+
let sampleTarget;
|
|
70
|
+
if (args.ref || args.selector || args.named || args.coords) {
|
|
71
|
+
const t = asTarget(args, "act_and_sample", e.refs);
|
|
72
|
+
if ("coords" in t) {
|
|
73
|
+
return batchJsonError("act_and_sample: sample target can't be coords — use ref/selector/named or omit for the window");
|
|
74
|
+
}
|
|
75
|
+
sampleTarget = t;
|
|
76
|
+
}
|
|
77
|
+
// Start the sampler, then dispatch the inner action concurrently so the
|
|
78
|
+
// trace spans the transition. Sampler self-bounds via durationMs; the
|
|
79
|
+
// inner action self-bounds via the anti-wedge deadline. Both await.
|
|
80
|
+
const samplePromise = sampleMetric(e.session.page(), e.refs, {
|
|
81
|
+
target: sampleTarget,
|
|
82
|
+
metric: args.metric,
|
|
83
|
+
durationMs: args.durationMs,
|
|
84
|
+
everyFrame: args.everyFrame,
|
|
85
|
+
intervalMs: args.intervalMs,
|
|
86
|
+
summary: args.summary,
|
|
87
|
+
});
|
|
88
|
+
const innerArgs = { ...(args.action.args ?? {}), session: args.session };
|
|
89
|
+
const [sRes, aRes] = await Promise.allSettled([
|
|
90
|
+
samplePromise,
|
|
91
|
+
toolHandlers[innerTool](innerArgs),
|
|
92
|
+
]);
|
|
93
|
+
const parseInner = (resp) => {
|
|
94
|
+
const first = resp.content[0];
|
|
95
|
+
if (!first || first.type !== "text" || first.text === undefined)
|
|
96
|
+
return first ?? null;
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(first.text);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return first.text;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const sampleOut = sRes.status === "fulfilled"
|
|
105
|
+
? sRes.value
|
|
106
|
+
: { error: sRes.reason instanceof Error ? sRes.reason.message : String(sRes.reason) };
|
|
107
|
+
const actionOut = aRes.status === "fulfilled"
|
|
108
|
+
? parseInner(aRes.value)
|
|
109
|
+
: {
|
|
110
|
+
ok: false,
|
|
111
|
+
error: aRes.reason instanceof Error ? aRes.reason.message : String(aRes.reason),
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{
|
|
116
|
+
type: "text",
|
|
117
|
+
text: JSON.stringify({ action: actionOut, sample: sampleOut }, null, 2),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
register("act_and_diff", {
|
|
123
|
+
capability: "read",
|
|
124
|
+
description: "Run ONE action and report the DOM changes it caused within a `scope` — for selection-heavy UIs where the state change (which clip/row became selected) shows only as class / `aria-*` / `data-*` / inline-style changes, invisible to snapshot/find/text_search. Captures a structural DOM map before, dispatches the inner action, captures after, diffs. `action` is `{tool,args}` from the batch whitelist (no `batch`/`await_human`/recording/self); the inner tool's capability + deadline still apply. Returns `{ action: <inner result>, diff: { changed:[{path,tag,testId,classDelta,styleDelta,attrDelta}], added, removed, counts } }`.",
|
|
125
|
+
inputSchema: {
|
|
126
|
+
action: z.object({
|
|
127
|
+
tool: z.string().describe("Inner tool name (batch whitelist)."),
|
|
128
|
+
args: z.record(z.unknown()).optional().describe("Inner tool args."),
|
|
129
|
+
}),
|
|
130
|
+
scope: z
|
|
131
|
+
.string()
|
|
132
|
+
.optional()
|
|
133
|
+
.describe("CSS selector to bound the diff (default: document.body). Must exist before AND after the action."),
|
|
134
|
+
...SESSION_ARG,
|
|
135
|
+
},
|
|
136
|
+
}, async (args) => {
|
|
137
|
+
const g = gateCheck("act_and_diff");
|
|
138
|
+
if (g)
|
|
139
|
+
return g;
|
|
140
|
+
const innerTool = args.action.tool;
|
|
141
|
+
if (!BATCH_ALLOWED_TOOLS.has(innerTool) || innerTool === "act_and_diff") {
|
|
142
|
+
return {
|
|
143
|
+
content: [
|
|
144
|
+
{
|
|
145
|
+
type: "text",
|
|
146
|
+
text: JSON.stringify({
|
|
147
|
+
ok: false,
|
|
148
|
+
error: `act_and_diff: inner tool "${innerTool}" not allowed (batch whitelist; no batch / await_human / recording / self)`,
|
|
149
|
+
}, null, 2),
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const ig = gateCheck(innerTool);
|
|
155
|
+
if (ig)
|
|
156
|
+
return ig;
|
|
157
|
+
const e = await entryFor(args.session);
|
|
158
|
+
const parseInner = (resp) => {
|
|
159
|
+
const first = resp.content[0];
|
|
160
|
+
if (!first || first.type !== "text" || first.text === undefined)
|
|
161
|
+
return first ?? null;
|
|
162
|
+
try {
|
|
163
|
+
return JSON.parse(first.text);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return first.text;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
try {
|
|
170
|
+
const before = await captureDomMap(e.session.page(), args.scope);
|
|
171
|
+
const innerArgs = { ...(args.action.args ?? {}), session: args.session };
|
|
172
|
+
const actionResp = await toolHandlers[innerTool](innerArgs);
|
|
173
|
+
const after = await captureDomMap(e.session.page(), args.scope);
|
|
174
|
+
const diff = diffDomMaps(before, after);
|
|
175
|
+
// Egress sink — `diff.changed[].classDelta` / `styleDelta` / `attrDelta`
|
|
176
|
+
// surface raw attribute / inline-style values (e.g. `aria-label="hunter2"`
|
|
177
|
+
// or `style="background-image: url(?token=hunter2)"`). The inner-action
|
|
178
|
+
// response was already masked by its own handler; the diff is the
|
|
179
|
+
// remaining literal-value channel and is masked here.
|
|
180
|
+
const maskedDiff = egressFor(e).maskDeep(diff);
|
|
181
|
+
return {
|
|
182
|
+
content: [
|
|
183
|
+
{
|
|
184
|
+
type: "text",
|
|
185
|
+
text: JSON.stringify({ action: parseInner(actionResp), diff: maskedDiff }, null, 2),
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
return {
|
|
192
|
+
content: [
|
|
193
|
+
{
|
|
194
|
+
type: "text",
|
|
195
|
+
text: JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }, null, 2),
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
// ---------- flake-check ----------
|
|
202
|
+
register("flake_check", {
|
|
203
|
+
capability: "action",
|
|
204
|
+
description: "Run the same call sequence N times and report what shifted between runs — for diagnosing intermittent CI flakes BEFORE chasing them through logs. Inner calls are dispatched through the `batch` whitelist (capability + confirm hooks unchanged); each run uses `stopOnError:false` internally so a mid-sequence failure does NOT hide the variance picture for later steps. Returns per-step success-rate, distinct errors, distinct resolution signatures, the earliest `firstDivergence` step where ok shifted across runs, and a `cachedResolvers[]` artifact — `{step → resolved ref/selectorHint}` for steps where every run agreed AND succeeded. The artifact mirrors the `ActionDescriptor` shape for `plan` steps so a follow-up call can re-execute against a fresh snapshot. `stopOnAllGreen: K` short-circuits when K consecutive runs are all-green (skips redundant work once you've proved the sequence is stable).",
|
|
205
|
+
inputSchema: {
|
|
206
|
+
calls: z
|
|
207
|
+
.array(z.object({
|
|
208
|
+
tool: z.string().describe("Tool name (must be in the batch whitelist)"),
|
|
209
|
+
args: z
|
|
210
|
+
.record(z.unknown())
|
|
211
|
+
.optional()
|
|
212
|
+
.describe("Args for the inner tool, same shape as a top-level call"),
|
|
213
|
+
label: z
|
|
214
|
+
.string()
|
|
215
|
+
.optional()
|
|
216
|
+
.describe("opaque label echoed in the result entry for cross-referencing"),
|
|
217
|
+
expect: z
|
|
218
|
+
.object({
|
|
219
|
+
valueEquals: z.string().optional(),
|
|
220
|
+
displayTextIncludes: z.string().optional(),
|
|
221
|
+
controlDisplayTextIncludes: z.string().optional(),
|
|
222
|
+
containerTextIncludes: z.string().optional(),
|
|
223
|
+
controlChanged: z.boolean().optional(),
|
|
224
|
+
})
|
|
225
|
+
.optional()
|
|
226
|
+
.describe("optional post-call assertions on the inner ActionResult — same shorthand vocabulary as `batch`."),
|
|
227
|
+
}))
|
|
228
|
+
.min(1)
|
|
229
|
+
.max(BATCH_MAX_CALLS)
|
|
230
|
+
.describe(`Up to ${BATCH_MAX_CALLS} inner calls. Same shape and whitelist as \`batch\`.`),
|
|
231
|
+
n: z
|
|
232
|
+
.number()
|
|
233
|
+
.int()
|
|
234
|
+
.min(3)
|
|
235
|
+
.max(20)
|
|
236
|
+
.describe("How many times to repeat the call sequence. Bounded [3, 20] — fewer than 3 can't surface intermittent flakes; more than 20 burns server time without sharpening the picture."),
|
|
237
|
+
stopOnAllGreen: z
|
|
238
|
+
.number()
|
|
239
|
+
.int()
|
|
240
|
+
.min(1)
|
|
241
|
+
.max(20)
|
|
242
|
+
.optional()
|
|
243
|
+
.describe("Short-circuit when this many consecutive runs all-pass. Off by default."),
|
|
244
|
+
},
|
|
245
|
+
}, async ({ calls, n, stopOnAllGreen, }) => {
|
|
246
|
+
const g = gateCheck("flake_check");
|
|
247
|
+
if (g)
|
|
248
|
+
return g;
|
|
249
|
+
// Reject self-nesting + the same human-blocking / recording tools `batch`
|
|
250
|
+
// already excludes. The whitelist is the source of truth.
|
|
251
|
+
for (const c of calls) {
|
|
252
|
+
if (!BATCH_ALLOWED_TOOLS.has(c.tool)) {
|
|
253
|
+
return {
|
|
254
|
+
content: [
|
|
255
|
+
{
|
|
256
|
+
type: "text",
|
|
257
|
+
text: JSON.stringify({
|
|
258
|
+
ok: false,
|
|
259
|
+
error: `flake_check: inner tool "${c.tool}" not allowed (batch whitelist; no batch / flake_check / await_human / recording)`,
|
|
260
|
+
}, null, 2),
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const report = await runFlakeCheck(calls, {
|
|
267
|
+
n,
|
|
268
|
+
...(stopOnAllGreen !== undefined ? { stopOnAllGreen } : {}),
|
|
269
|
+
allowed: BATCH_ALLOWED_TOOLS,
|
|
270
|
+
handlers: toolHandlers,
|
|
271
|
+
});
|
|
272
|
+
return {
|
|
273
|
+
content: [{ type: "text", text: JSON.stringify(report, null, 2) }],
|
|
274
|
+
};
|
|
275
|
+
});
|
|
276
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RegisterHost, GateHost, SessionHost, ServerServicesHost } from "./host.js";
|
|
2
|
+
/**
|
|
3
|
+
* Human-in-the-loop + batch protocol primitives: await_human / batch. Split out of
|
|
4
|
+
* `extensions-batch-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
|
|
5
|
+
* through the shared `ToolHost` seam in the same source order. The host owns the
|
|
6
|
+
* closures; this module owns the registrations.
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerBatchHumanTools(host: RegisterHost & GateHost & SessionHost & ServerServicesHost): void;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { runBatch } from "../util/batch.js";
|
|
2
|
+
import { log } from "../util/logging.js";
|
|
3
|
+
import { SESSION_ARG } from "./schemas.js";
|
|
4
|
+
/** Build the DevTools-prompt body for an `await_human` call. Extracting the
|
|
5
|
+
* four-way kind dispatch into a pure helper keeps the handler under the
|
|
6
|
+
* complexity budget (RFC 0004 P3 / D3) — byte-identical to the prior inline
|
|
7
|
+
* ternary chain. */
|
|
8
|
+
function buildAwaitHumanPrompt(kind, prompt, choices) {
|
|
9
|
+
if (kind === "choose" && choices) {
|
|
10
|
+
return `${prompt}\n${choices.map((c, i) => ` [${i}] ${c}`).join("\n")}\n→ call __browx.choose(<index>) in DevTools to respond`;
|
|
11
|
+
}
|
|
12
|
+
if (kind === "confirm")
|
|
13
|
+
return `${prompt} → call __browx.confirm(true|false)`;
|
|
14
|
+
if (kind === "input")
|
|
15
|
+
return `${prompt} → call __browx.input('your text')`;
|
|
16
|
+
return `${prompt} → call __browx.proceed() to release`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Human-in-the-loop + batch protocol primitives: await_human / batch. Split out of
|
|
20
|
+
* `extensions-batch-tools` by cohesive family (RFC 0004 P3 / D3 SRP); registered
|
|
21
|
+
* through the shared `ToolHost` seam in the same source order. The host owns the
|
|
22
|
+
* closures; this module owns the registrations.
|
|
23
|
+
*/
|
|
24
|
+
export function registerBatchHumanTools(host) {
|
|
25
|
+
const { z, register, gateCheck, entryFor, toolHandlers, batchAllowedTools: BATCH_ALLOWED_TOOLS, } = host;
|
|
26
|
+
// ---------- human↔agent helper ----------
|
|
27
|
+
register("await_human", {
|
|
28
|
+
capability: "human",
|
|
29
|
+
description: "Block until the human responds in the page. Operator reads `prompt` from the server's stderr (or a future banner UI) and triggers a response from DevTools:\n" +
|
|
30
|
+
" - `acknowledge` → `__browx.proceed()` (or `signal('proceed')`)\n" +
|
|
31
|
+
" - `confirm` → `__browx.confirm(true|false)`\n" +
|
|
32
|
+
" - `choose` → `__browx.choose(<index-into-choices>)`\n" +
|
|
33
|
+
" - `input` → `__browx.input('typed text')`\n" +
|
|
34
|
+
"Returns `{ kind, value, timedOut }`. `pick_element` kind (in-page hover-pick overlay) is deferred to .",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
kind: z.enum(["acknowledge", "confirm", "choose", "input"]).default("acknowledge"),
|
|
37
|
+
prompt: z
|
|
38
|
+
.string()
|
|
39
|
+
.describe("Human-readable instruction shown to the operator (logged to stderr)."),
|
|
40
|
+
choices: z
|
|
41
|
+
.array(z.string())
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('For `kind:"choose"` — labels shown in the prompt; the human responds with an index into this list.'),
|
|
44
|
+
timeoutMs: z
|
|
45
|
+
.number()
|
|
46
|
+
.int()
|
|
47
|
+
.positive()
|
|
48
|
+
.max(3_600_000)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Human response window (ms). Human-paced default 300000 (5min); hard max 3600000 (1h). " +
|
|
51
|
+
"there is no infinite wait — an unanswered prompt times out (the only previously " +
|
|
52
|
+
"unbounded path). For unattended runs use `approve_actions` instead of a long wait."),
|
|
53
|
+
...SESSION_ARG,
|
|
54
|
+
},
|
|
55
|
+
}, async ({ kind, prompt, choices, timeoutMs, session }) => {
|
|
56
|
+
const g = gateCheck("await_human");
|
|
57
|
+
if (g)
|
|
58
|
+
return g;
|
|
59
|
+
const e = await entryFor(session);
|
|
60
|
+
// kill the only infinite path. 0/unset → 5min human-paced default,
|
|
61
|
+
// hard-capped at 1h. await_human is human-paced — NOT under the 5s
|
|
62
|
+
// action default — but never unbounded.
|
|
63
|
+
const humanMs = Math.min(timeoutMs && timeoutMs > 0 ? timeoutMs : 300_000, 3_600_000);
|
|
64
|
+
const promptBody = buildAwaitHumanPrompt(kind, prompt, choices);
|
|
65
|
+
log.info(`await_human (${kind}): ${promptBody}`);
|
|
66
|
+
const signalName = kind === "acknowledge" ? "proceed" : "respond";
|
|
67
|
+
try {
|
|
68
|
+
const sig = await e.bridge.awaitSignal(signalName, humanMs);
|
|
69
|
+
// For typed kinds the page sends `{ kind, value }`; for acknowledge it sends any/null.
|
|
70
|
+
let value = sig.data;
|
|
71
|
+
if (kind !== "acknowledge" &&
|
|
72
|
+
sig.data &&
|
|
73
|
+
typeof sig.data === "object" &&
|
|
74
|
+
"value" in sig.data) {
|
|
75
|
+
value = sig.data.value;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{ type: "text", text: JSON.stringify({ kind, value, timedOut: false }, null, 2) },
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
const timedOut = e instanceof Error && e.message.includes("timed out");
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: JSON.stringify({
|
|
90
|
+
kind,
|
|
91
|
+
value: null,
|
|
92
|
+
timedOut,
|
|
93
|
+
error: timedOut ? undefined : e instanceof Error ? e.message : String(e),
|
|
94
|
+
}, null, 2),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
// ---------- batch protocol primitive ----------
|
|
101
|
+
const BATCH_MAX_CALLS = 32;
|
|
102
|
+
register("batch", {
|
|
103
|
+
description: "Run a sequence of tool calls server-side and return their results as one response. Eliminates round-trip overhead for known-safe sequences (e.g. fill several fields then submit). Each call is dispatched through the same handlers as a top-level call; capability gating, confirmation hooks, and ActionResults are unchanged. Stops at the first failure unless `stopOnError: false`. Disallows nested `batch` and human-blocking tools.",
|
|
104
|
+
inputSchema: {
|
|
105
|
+
calls: z
|
|
106
|
+
.array(z.object({
|
|
107
|
+
tool: z.string().describe("Tool name (must be in the batch whitelist)"),
|
|
108
|
+
args: z
|
|
109
|
+
.record(z.unknown())
|
|
110
|
+
.optional()
|
|
111
|
+
.describe("Args for the inner tool, same shape as a top-level call"),
|
|
112
|
+
label: z
|
|
113
|
+
.string()
|
|
114
|
+
.optional()
|
|
115
|
+
.describe("opaque label echoed in the result entry for cross-referencing"),
|
|
116
|
+
expect: z
|
|
117
|
+
.object({
|
|
118
|
+
valueEquals: z.string().optional(),
|
|
119
|
+
displayTextIncludes: z.string().optional(),
|
|
120
|
+
controlDisplayTextIncludes: z.string().optional(),
|
|
121
|
+
containerTextIncludes: z.string().optional(),
|
|
122
|
+
controlChanged: z.boolean().optional(),
|
|
123
|
+
})
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("optional post-call assertions on the inner ActionResult's element probe. Failing any assertion marks the call ok=false with `error: 'expect failed: …'` and respects `stopOnError`."),
|
|
126
|
+
}))
|
|
127
|
+
.min(1)
|
|
128
|
+
.max(BATCH_MAX_CALLS)
|
|
129
|
+
.describe(`Up to ${BATCH_MAX_CALLS} inner calls. Run sequentially.`),
|
|
130
|
+
stopOnError: z
|
|
131
|
+
.boolean()
|
|
132
|
+
.optional()
|
|
133
|
+
.describe("Default true. When true, the first inner-call failure halts the batch. When false, every call is attempted and individual results carry their own ok/error."),
|
|
134
|
+
},
|
|
135
|
+
}, async ({ calls, stopOnError, }) => {
|
|
136
|
+
const g = gateCheck("batch");
|
|
137
|
+
if (g)
|
|
138
|
+
return g;
|
|
139
|
+
const report = await runBatch(calls, {
|
|
140
|
+
allowed: BATCH_ALLOWED_TOOLS,
|
|
141
|
+
handlers: toolHandlers,
|
|
142
|
+
stopOnError,
|
|
143
|
+
});
|
|
144
|
+
return {
|
|
145
|
+
content: [{ type: "text", text: JSON.stringify(report, null, 2) }],
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ToolHost } from "./host.js";
|
|
2
|
+
/**
|
|
3
|
+
* Canvas-app automation primitives.
|
|
4
|
+
*
|
|
5
|
+
* Five MCP tools + a pure-RGBA diff:
|
|
6
|
+
*
|
|
7
|
+
* - `canvas_capture` — framebuffer / 2D ImageData / PNG bytes.
|
|
8
|
+
* - `canvas_diff` — pixel/region delta over RGBA captures
|
|
9
|
+
* (PNG inputs deferred — base64 byte
|
|
10
|
+
* equality only, see warnings).
|
|
11
|
+
* - `gesture_chain` — multi-step pointer program (custom
|
|
12
|
+
* paint strokes, lasso paths, gestures
|
|
13
|
+
* the canned `drag` / `gesture_swipe`
|
|
14
|
+
* family doesn't cover).
|
|
15
|
+
* - `canvas_world_to_screen` + `canvas_screen_to_world` —
|
|
16
|
+
* affine helpers, two modes: explicit
|
|
17
|
+
* (caller passes transform) or
|
|
18
|
+
* discovery (page-side probe of common
|
|
19
|
+
* app globals — Figma / Tldraw /
|
|
20
|
+
* Excalidraw / generic).
|
|
21
|
+
* - `canvas_query` — dispatcher to a canvas-app adapter
|
|
22
|
+
* plugin (landed separately).
|
|
23
|
+
*
|
|
24
|
+
* Capability `canvas` — off-by-default, loud-warned at boot. Same posture
|
|
25
|
+
* class as `eval` / `network-body` / `secrets` / `extensions` /
|
|
26
|
+
* `device-emulation` / `diagnostics`. `canvas_diff` is pure-byte math
|
|
27
|
+
* and rides `read` (no canvas-pixel touch of its own).
|
|
28
|
+
*
|
|
29
|
+
* The primitives are app-agnostic — discovery probes common globals but
|
|
30
|
+
* those are heuristic; the structured failure path tells the caller to
|
|
31
|
+
* pass `transform` explicitly OR install a canvas-app adapter plugin.
|
|
32
|
+
* Honours the `feedback_design_for_problem_class` rule: build for the
|
|
33
|
+
* problem class (canvas-app substrate), don't hard-bind to any one app.
|
|
34
|
+
*
|
|
35
|
+
* BYO-vision: browxai does NOT bundle OCR or a hosted vision API.
|
|
36
|
+
* `canvas_capture` is the pixel source; composition with the host
|
|
37
|
+
* agent's own multimodal vision is the loop (see `docs/tool-reference.md`
|
|
38
|
+
* "Canvas-app automation — BYO vision pattern").
|
|
39
|
+
*/
|
|
40
|
+
export declare function registerCanvasTools(host: ToolHost): void;
|