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,318 @@
|
|
|
1
|
+
// Interactive WebSocket primitives — capability `action`. The read-only
|
|
2
|
+
// `WsBuffer` is the observation half (`ws_read` + `ActionResult.network.wsFrames`);
|
|
3
|
+
// this is the mutation half:
|
|
4
|
+
//
|
|
5
|
+
// • `ws_send({wsId, message})` — push a payload onto a live page-side
|
|
6
|
+
// WebSocket the agent identified via
|
|
7
|
+
// `ws_read` / `__browxWs.list()`.
|
|
8
|
+
// • `ws_intercept({pattern, ...})` — route-handler-style pattern matching
|
|
9
|
+
// for INBOUND WS messages. Three response
|
|
10
|
+
// modes:
|
|
11
|
+
// - `drop` — discard the message before the page handler runs;
|
|
12
|
+
// - `echo` — re-send the same payload back to the server;
|
|
13
|
+
// - `{data:string}` — replace the inbound payload with `data`.
|
|
14
|
+
// • `ws_unintercept({pattern})` — remove one interceptor (or all).
|
|
15
|
+
//
|
|
16
|
+
// CDP has no native "send a WS frame on an existing socket" primitive — frames
|
|
17
|
+
// are observable but not injectable from outside the page. So both halves run
|
|
18
|
+
// page-side via a wrapper installed on `window.WebSocket` at document-start
|
|
19
|
+
// (`Page.addInitScript`). The wrapper:
|
|
20
|
+
//
|
|
21
|
+
// • Assigns each `WebSocket` a monotonic `wsId` (`ws-1`, `ws-2`, …) and
|
|
22
|
+
// surfaces them via `window.__browxWs.list()` — the registry the agent
|
|
23
|
+
// queries before `ws_send`. The ws IDs are observable to the agent
|
|
24
|
+
// directly through `__browxWs.list()`, but a server-side index lets the
|
|
25
|
+
// server-side dispatch validate ID liveness before evaluate().
|
|
26
|
+
// • Exposes `__browxWs.send(wsId, payload)`. This calls the real (pre-
|
|
27
|
+
// wrap) `WebSocket.prototype.send` so app-level event listeners do NOT
|
|
28
|
+
// see a fake event — only the server does.
|
|
29
|
+
// • Exposes `__browxWs.intercept(pattern, mode, replacement)`. Pattern is a
|
|
30
|
+
// glob (the `*` / `**` family — see `globToRegex` below; matches
|
|
31
|
+
// against `socket.url` at match-time). When an inbound `message` event
|
|
32
|
+
// fires on a matching socket, the wrapper consults its interceptor
|
|
33
|
+
// queue BEFORE dispatching to app handlers:
|
|
34
|
+
// drop — stopImmediatePropagation; don't deliver.
|
|
35
|
+
// echo — call the real `send()` with the inbound `data`; also
|
|
36
|
+
// delivers to app handlers (the contract is "the page
|
|
37
|
+
// thinks it got the message AND a mirror went out").
|
|
38
|
+
// replace — synthesise a fresh `MessageEvent` with the replacement
|
|
39
|
+
// payload, dispatch THAT, suppress the original.
|
|
40
|
+
// • Tracks active interceptors so `unintercept({pattern})` removes one
|
|
41
|
+
// and `unintercept({})` clears the whole set.
|
|
42
|
+
//
|
|
43
|
+
// Server-side this file mints the init script (one constant — same shape as
|
|
44
|
+
// `BROWX_PAGE_SCRIPT`) and exposes a registry the MCP handlers can call.
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Pattern matching — shared with the route family's semantic intent (glob,
|
|
47
|
+
// not regex). The route tools hand the glob straight to Playwright; here we
|
|
48
|
+
// need to evaluate it ourselves both in-page (against `socket.url` on every
|
|
49
|
+
// inbound frame) and server-side (interceptor key lookup), so we compile it
|
|
50
|
+
// to a regex once. `*` matches a single path segment; `**` matches any
|
|
51
|
+
// number of characters (including `/`); everything else is literal.
|
|
52
|
+
//
|
|
53
|
+
// Exported for unit tests + reuse by the page-side script (stringified into
|
|
54
|
+
// the init script so the wrapper has the same matcher as the registry).
|
|
55
|
+
export function globToRegex(pat) {
|
|
56
|
+
let out = "^";
|
|
57
|
+
for (let i = 0; i < pat.length; i++) {
|
|
58
|
+
const c = pat[i];
|
|
59
|
+
if (c === "*") {
|
|
60
|
+
if (pat[i + 1] === "*") {
|
|
61
|
+
out += ".*";
|
|
62
|
+
i++;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
out += "[^/]*";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if ("\\^$.+?()[]{}|".includes(c)) {
|
|
69
|
+
out += "\\" + c;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
out += c;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
out += "$";
|
|
76
|
+
return new RegExp(out);
|
|
77
|
+
}
|
|
78
|
+
/** Per-session interactive-WS registry. Tracks the active interceptors so
|
|
79
|
+
* `unintercept` / `list` can answer locally; the page-side wrapper is the
|
|
80
|
+
* authoritative runtime, but each server-side call mirrors the change
|
|
81
|
+
* into this table before evaluating so a re-`add` of the same pattern
|
|
82
|
+
* cleanly replaces the prior entry on both sides. */
|
|
83
|
+
export class WsInteractiveRegistry {
|
|
84
|
+
interceptors = new Map();
|
|
85
|
+
/** Idempotent — installs the init script + (best-effort) re-injects into
|
|
86
|
+
* the current document so the wrapper is live BEFORE `ws_send`
|
|
87
|
+
* / `ws_intercept` is called. Safe to call multiple times: the in-page
|
|
88
|
+
* guard `if (window.__browxWs) return;` short-circuits a re-run, and
|
|
89
|
+
* `addInitScript` accumulates harmlessly across calls.
|
|
90
|
+
*
|
|
91
|
+
* Called lazily by `send`/`intercept` so a session that never uses the
|
|
92
|
+
* interactive primitives pays zero overhead. */
|
|
93
|
+
async install(page) {
|
|
94
|
+
await page.context().addInitScript({ content: WS_PAGE_SCRIPT });
|
|
95
|
+
// re-inject for the current document — addInitScript only fires on
|
|
96
|
+
// future navigations. Tolerant of detached pages.
|
|
97
|
+
for (const p of page.context().pages()) {
|
|
98
|
+
await p.evaluate(WS_PAGE_SCRIPT).catch(() => undefined);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** Send `message` on the page-side WS identified by `wsId`. Returns
|
|
102
|
+
* `{ ok:true, wsId, url, bytes }` on success; `{ ok:false, error }`
|
|
103
|
+
* if the wrapper didn't find the id or the socket isn't OPEN. */
|
|
104
|
+
async send(page, args) {
|
|
105
|
+
await this.install(page);
|
|
106
|
+
const { wsId, message } = args;
|
|
107
|
+
const r = await page.evaluate(({ id, msg }) => {
|
|
108
|
+
const w = globalThis.__browxWs;
|
|
109
|
+
if (!w)
|
|
110
|
+
return { ok: false, error: "__browxWs not installed (init-script race?)" };
|
|
111
|
+
return w.send(id, msg);
|
|
112
|
+
}, { id: wsId, msg: message });
|
|
113
|
+
return { ...r, wsId };
|
|
114
|
+
}
|
|
115
|
+
async addInterceptor(page, spec) {
|
|
116
|
+
await this.install(page);
|
|
117
|
+
const mode = spec.response === "drop" ? "drop" : spec.response === "echo" ? "echo" : "replace";
|
|
118
|
+
const replacement = typeof spec.response === "object" ? spec.response.data : undefined;
|
|
119
|
+
const key = spec.pattern;
|
|
120
|
+
this.interceptors.set(key, {
|
|
121
|
+
pattern: key,
|
|
122
|
+
mode,
|
|
123
|
+
...(replacement !== undefined ? { replacement } : {}),
|
|
124
|
+
});
|
|
125
|
+
await page.evaluate(({ pattern, mode, replacement }) => {
|
|
126
|
+
const w = globalThis.__browxWs;
|
|
127
|
+
if (!w)
|
|
128
|
+
return;
|
|
129
|
+
w.intercept(pattern, mode, replacement);
|
|
130
|
+
}, { pattern: key, mode, replacement: replacement ?? null });
|
|
131
|
+
return { key, active: this.list() };
|
|
132
|
+
}
|
|
133
|
+
async removeInterceptor(page, sel) {
|
|
134
|
+
await this.install(page);
|
|
135
|
+
let removed;
|
|
136
|
+
if (sel.pattern === undefined) {
|
|
137
|
+
removed = [...this.interceptors.keys()];
|
|
138
|
+
this.interceptors.clear();
|
|
139
|
+
}
|
|
140
|
+
else if (this.interceptors.has(sel.pattern)) {
|
|
141
|
+
removed = [sel.pattern];
|
|
142
|
+
this.interceptors.delete(sel.pattern);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
removed = [];
|
|
146
|
+
}
|
|
147
|
+
await page.evaluate(({ pattern }) => {
|
|
148
|
+
const w = globalThis.__browxWs;
|
|
149
|
+
if (!w)
|
|
150
|
+
return;
|
|
151
|
+
if (pattern === null)
|
|
152
|
+
w.unintercept(undefined);
|
|
153
|
+
else
|
|
154
|
+
w.unintercept(pattern);
|
|
155
|
+
}, { pattern: sel.pattern ?? null });
|
|
156
|
+
return { removed, active: this.list() };
|
|
157
|
+
}
|
|
158
|
+
/** Server-side mirror of the active patterns — order = insertion. */
|
|
159
|
+
list() {
|
|
160
|
+
return [...this.interceptors.keys()];
|
|
161
|
+
}
|
|
162
|
+
/** Read the page-side `__browxWs.list()` registry to surface live WS
|
|
163
|
+
* endpoints + their `wsId`. Best-effort: returns `[]` if the wrapper
|
|
164
|
+
* isn't installed (`install` is the lazy installer; this method is
|
|
165
|
+
* for `ws_send` discoverability and shouldn't itself force install). */
|
|
166
|
+
async listSockets(page) {
|
|
167
|
+
const r = await page.evaluate(() => {
|
|
168
|
+
const w = globalThis.__browxWs;
|
|
169
|
+
if (!w)
|
|
170
|
+
return [];
|
|
171
|
+
return w.list();
|
|
172
|
+
});
|
|
173
|
+
return r;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
// Page-side wrapper script. Wraps `window.WebSocket` exactly once. Keep this
|
|
178
|
+
// in lockstep with `globToRegex` above (the matcher is reimplemented inline
|
|
179
|
+
// — the script must be self-contained — and the test asserts both produce
|
|
180
|
+
// identical regexes). browser-only JS, no TS-only syntax.
|
|
181
|
+
export const WS_PAGE_SCRIPT = `(() => {
|
|
182
|
+
if (window.__browxWs) return;
|
|
183
|
+
var NativeWebSocket = window.WebSocket;
|
|
184
|
+
if (!NativeWebSocket) return;
|
|
185
|
+
var nativeSend = NativeWebSocket.prototype.send;
|
|
186
|
+
var sockets = new Map(); // wsId -> WebSocket
|
|
187
|
+
var nextId = 1;
|
|
188
|
+
var interceptors = []; // { pattern, regex, mode, replacement }
|
|
189
|
+
|
|
190
|
+
function globToRegex(pat) {
|
|
191
|
+
var out = "^";
|
|
192
|
+
for (var i = 0; i < pat.length; i++) {
|
|
193
|
+
var c = pat[i];
|
|
194
|
+
if (c === "*") {
|
|
195
|
+
if (pat[i + 1] === "*") { out += ".*"; i++; }
|
|
196
|
+
else { out += "[^/]*"; }
|
|
197
|
+
} else if ("\\\\^$.+?()[]{}|".indexOf(c) >= 0) {
|
|
198
|
+
out += "\\\\" + c;
|
|
199
|
+
} else { out += c; }
|
|
200
|
+
}
|
|
201
|
+
out += "$";
|
|
202
|
+
return new RegExp(out);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function matchOne(url) {
|
|
206
|
+
for (var i = 0; i < interceptors.length; i++) {
|
|
207
|
+
if (interceptors[i].regex.test(url)) return interceptors[i];
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function Wrapped(url, protocols) {
|
|
213
|
+
var sock = arguments.length > 1 ? new NativeWebSocket(url, protocols) : new NativeWebSocket(url);
|
|
214
|
+
var id = "ws-" + (nextId++);
|
|
215
|
+
sockets.set(id, sock);
|
|
216
|
+
sock.__browxId = id;
|
|
217
|
+
// Wrap message dispatch. We replace addEventListener("message", …) AND
|
|
218
|
+
// onmessage so both registration paths route through the interceptor.
|
|
219
|
+
var liveListeners = [];
|
|
220
|
+
var origAdd = sock.addEventListener.bind(sock);
|
|
221
|
+
var origRemove = sock.removeEventListener.bind(sock);
|
|
222
|
+
sock.addEventListener = function (type, listener, opts) {
|
|
223
|
+
if (type === "message" && typeof listener === "function") {
|
|
224
|
+
liveListeners.push(listener);
|
|
225
|
+
return; // we'll dispatch ourselves
|
|
226
|
+
}
|
|
227
|
+
return origAdd(type, listener, opts);
|
|
228
|
+
};
|
|
229
|
+
sock.removeEventListener = function (type, listener, opts) {
|
|
230
|
+
if (type === "message" && typeof listener === "function") {
|
|
231
|
+
var i = liveListeners.indexOf(listener);
|
|
232
|
+
if (i >= 0) liveListeners.splice(i, 1);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
return origRemove(type, listener, opts);
|
|
236
|
+
};
|
|
237
|
+
var onmessageFn = null;
|
|
238
|
+
Object.defineProperty(sock, "onmessage", {
|
|
239
|
+
configurable: true,
|
|
240
|
+
get: function () { return onmessageFn; },
|
|
241
|
+
set: function (v) { onmessageFn = typeof v === "function" ? v : null; },
|
|
242
|
+
});
|
|
243
|
+
function dispatch(payload) {
|
|
244
|
+
var ev = new MessageEvent("message", { data: payload });
|
|
245
|
+
for (var i = 0; i < liveListeners.length; i++) {
|
|
246
|
+
try { liveListeners[i].call(sock, ev); } catch (_) {}
|
|
247
|
+
}
|
|
248
|
+
if (onmessageFn) {
|
|
249
|
+
try { onmessageFn.call(sock, ev); } catch (_) {}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
origAdd("message", function (ev) {
|
|
253
|
+
var hit = matchOne(sock.url || "");
|
|
254
|
+
if (!hit) { dispatch(ev.data); return; }
|
|
255
|
+
if (hit.mode === "drop") return;
|
|
256
|
+
if (hit.mode === "echo") {
|
|
257
|
+
try { nativeSend.call(sock, ev.data); } catch (_) {}
|
|
258
|
+
dispatch(ev.data);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
// replace
|
|
262
|
+
dispatch(hit.replacement == null ? "" : hit.replacement);
|
|
263
|
+
});
|
|
264
|
+
// Expose the id post-construction; the agent reads it via __browxWs.list().
|
|
265
|
+
return sock;
|
|
266
|
+
}
|
|
267
|
+
// Preserve constants + name so feature-detection (\`'OPEN' in WebSocket\`) keeps working.
|
|
268
|
+
Wrapped.CONNECTING = NativeWebSocket.CONNECTING;
|
|
269
|
+
Wrapped.OPEN = NativeWebSocket.OPEN;
|
|
270
|
+
Wrapped.CLOSING = NativeWebSocket.CLOSING;
|
|
271
|
+
Wrapped.CLOSED = NativeWebSocket.CLOSED;
|
|
272
|
+
Wrapped.prototype = NativeWebSocket.prototype;
|
|
273
|
+
try { Object.defineProperty(Wrapped, "name", { value: "WebSocket" }); } catch (_) {}
|
|
274
|
+
window.WebSocket = Wrapped;
|
|
275
|
+
|
|
276
|
+
window.__browxWs = {
|
|
277
|
+
send: function (id, msg) {
|
|
278
|
+
var sock = sockets.get(id);
|
|
279
|
+
if (!sock) return { ok: false, error: "no socket with id " + id };
|
|
280
|
+
if (sock.readyState !== 1) return { ok: false, error: "socket " + id + " is not OPEN (readyState=" + sock.readyState + ")" };
|
|
281
|
+
try {
|
|
282
|
+
nativeSend.call(sock, msg);
|
|
283
|
+
return { ok: true, url: sock.url || "", bytes: typeof msg === "string" ? msg.length : 0 };
|
|
284
|
+
} catch (e) {
|
|
285
|
+
return { ok: false, error: e && e.message ? e.message : String(e) };
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
intercept: function (pattern, mode, replacement) {
|
|
289
|
+
// Replace any prior interceptor on the same pattern (server-side
|
|
290
|
+
// mirror does the same).
|
|
291
|
+
for (var i = interceptors.length - 1; i >= 0; i--) {
|
|
292
|
+
if (interceptors[i].pattern === pattern) interceptors.splice(i, 1);
|
|
293
|
+
}
|
|
294
|
+
interceptors.push({
|
|
295
|
+
pattern: pattern,
|
|
296
|
+
regex: globToRegex(pattern),
|
|
297
|
+
mode: mode,
|
|
298
|
+
replacement: replacement == null ? null : replacement,
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
unintercept: function (pattern) {
|
|
302
|
+
if (pattern === undefined || pattern === null) {
|
|
303
|
+
interceptors.length = 0;
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
for (var i = interceptors.length - 1; i >= 0; i--) {
|
|
307
|
+
if (interceptors[i].pattern === pattern) interceptors.splice(i, 1);
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
list: function () {
|
|
311
|
+
var out = [];
|
|
312
|
+
sockets.forEach(function (sock, id) {
|
|
313
|
+
out.push({ wsId: id, url: sock.url || "", readyState: sock.readyState });
|
|
314
|
+
});
|
|
315
|
+
return out;
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
})();`;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type PluginPaths } from "./resolver.js";
|
|
2
|
+
import { type PackageManager, type PmOperation } from "./package-manager.js";
|
|
3
|
+
export interface LockEntry {
|
|
4
|
+
/** npm package name. */
|
|
5
|
+
readonly name: string;
|
|
6
|
+
/** Installed version (read from the package's package.json after install). */
|
|
7
|
+
readonly version: string;
|
|
8
|
+
/** Where the package was installed from (`npm`, `file:./path`, etc.). */
|
|
9
|
+
readonly source: string;
|
|
10
|
+
/** sha256 over the package's package.json + main entry — the
|
|
11
|
+
* reproducibility pin. Mismatch on next install means the underlying
|
|
12
|
+
* package contents changed. */
|
|
13
|
+
readonly contentSha256: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LockFile {
|
|
16
|
+
/** Version of the lock format itself. Bumped on incompatible change. */
|
|
17
|
+
readonly lockfileVersion: 1;
|
|
18
|
+
/** Entries keyed by package name. */
|
|
19
|
+
readonly entries: Record<string, LockEntry>;
|
|
20
|
+
}
|
|
21
|
+
/** Tolerant lock read — also consumed by `browxai doctor` for lock-health checks. */
|
|
22
|
+
export declare function readLock(paths: PluginPaths): LockFile;
|
|
23
|
+
/** Content pin over an installed package — the same hash `plugins-lock.json`
|
|
24
|
+
* stores as `contentSha256`. Exported so `browxai doctor` can recompute it
|
|
25
|
+
* and detect drift against the pinned value. */
|
|
26
|
+
export declare function sha256OfPackage(pkgRoot: string): string;
|
|
27
|
+
export type { PackageManager, PmOperation } from "./package-manager.js";
|
|
28
|
+
/** Emitted when neither pnpm nor npm is on PATH — actionable, names the
|
|
29
|
+
* requirement. Exported for the CLI tests. */
|
|
30
|
+
export declare const NO_PACKAGE_MANAGER_ERROR = "browxai plugin: no package manager found. Managing workspace plugins requires `pnpm` (preferred) or `npm` on PATH \u2014 install one (https://pnpm.io/installation or https://nodejs.org) and re-run.";
|
|
31
|
+
/**
|
|
32
|
+
* Probe for an available package manager. The adapters are walked in ascending
|
|
33
|
+
* probe priority (pnpm at 0 wins — it is the project's declared manager and what
|
|
34
|
+
* CI uses; npm at 1 is the fallback so `npm install -g browxai` adopters aren't
|
|
35
|
+
* dead-ended with a bare ENOENT). Returns null when none is on PATH. Adding a
|
|
36
|
+
* manager is a new adapter registration, not an edit here.
|
|
37
|
+
*/
|
|
38
|
+
export declare function detectPackageManager(probe?: (cmd: string) => boolean): PackageManager | null;
|
|
39
|
+
/** Translate an operation (+ optional target spec) into manager argv. */
|
|
40
|
+
export declare function pmArgs(pm: PackageManager, op: PmOperation, target?: string): ReadonlyArray<string>;
|
|
41
|
+
/** CLI dispatcher — invoked by `src/cli.ts` for the `plugin` subcommand. The
|
|
42
|
+
* help branch (no verb / `help` / `--help` / `-h`) and the unknown-verb
|
|
43
|
+
* diagnostic stay inline — they are the subcommand's fixed contract; the
|
|
44
|
+
* extensibility verbs resolve through the add-only registry above. */
|
|
45
|
+
export declare function runPlugin(args: ReadonlyArray<string>): Promise<number>;
|