tabwright 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aria-snapshot.d.ts +0 -1
- package/dist/aria-snapshot.js +9 -1
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.d.ts +0 -1
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.js +0 -1
- package/dist/bippy.js +1 -1
- package/dist/browser-config.d.ts +0 -1
- package/dist/browser-config.js +0 -1
- package/dist/browser-install.d.ts +0 -1
- package/dist/browser-install.js +0 -1
- package/dist/browser-launch.d.ts +0 -1
- package/dist/browser-launch.js +0 -1
- package/dist/builtin-capabilities.d.ts +0 -1
- package/dist/builtin-capabilities.js +0 -1
- package/dist/capability-agent-skill.d.ts +0 -1
- package/dist/capability-agent-skill.js +0 -1
- package/dist/capability-auth-state.d.ts +0 -1
- package/dist/capability-auth-state.js +0 -1
- package/dist/capability-auth.d.ts +0 -1
- package/dist/capability-auth.js +0 -1
- package/dist/capability-options.d.ts +0 -1
- package/dist/capability-options.js +0 -1
- package/dist/capability-package.d.ts +0 -1
- package/dist/capability-package.js +0 -1
- package/dist/capability-registry.d.ts +0 -1
- package/dist/capability-registry.js +0 -1
- package/dist/capability-runner.d.ts +0 -1
- package/dist/capability-runner.js +0 -1
- package/dist/capability-studio.d.ts +0 -1
- package/dist/capability-studio.js +0 -1
- package/dist/cdp-log.d.ts +0 -1
- package/dist/cdp-log.js +0 -1
- package/dist/cdp-relay.d.ts +0 -1
- package/dist/cdp-relay.js +0 -1
- package/dist/cdp-session.d.ts +0 -1
- package/dist/cdp-session.js +0 -1
- package/dist/cdp-types.d.ts +0 -1
- package/dist/cdp-types.js +0 -1
- package/dist/chrome-discovery.d.ts +0 -1
- package/dist/chrome-discovery.js +0 -1
- package/dist/clean-html.d.ts +0 -1
- package/dist/clean-html.js +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +9 -2
- package/dist/cloud-client.d.ts +0 -1
- package/dist/cloud-client.js +0 -1
- package/dist/create-logger.d.ts +0 -1
- package/dist/create-logger.js +0 -1
- package/dist/debugger-examples-types.d.ts +0 -1
- package/dist/debugger-examples-types.js +0 -1
- package/dist/debugger-examples.d.ts +0 -1
- package/dist/debugger-examples.js +0 -1
- package/dist/debugger.d.ts +0 -1
- package/dist/debugger.js +0 -1
- package/dist/diff-utils.d.ts +0 -1
- package/dist/diff-utils.js +0 -1
- package/dist/doctor.d.ts +0 -1
- package/dist/doctor.js +5 -7
- package/dist/editor-examples.d.ts +0 -1
- package/dist/editor-examples.js +0 -1
- package/dist/editor.d.ts +0 -1
- package/dist/editor.js +0 -1
- package/dist/env-compat.d.ts +0 -1
- package/dist/env-compat.js +0 -1
- package/dist/executor.d.ts +0 -1
- package/dist/executor.js +1 -2
- package/dist/extension/background.js +7 -3
- package/dist/extension/manifest.json +1 -1
- package/dist/ghost-browser.d.ts +0 -1
- package/dist/ghost-browser.js +0 -1
- package/dist/ghost-cursor-controller.d.ts +0 -1
- package/dist/ghost-cursor-controller.js +0 -1
- package/dist/ghost-cursor.d.ts +0 -1
- package/dist/ghost-cursor.js +0 -1
- package/dist/htmlrewrite.d.ts +0 -1
- package/dist/htmlrewrite.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/kill-port.d.ts +0 -1
- package/dist/kill-port.js +0 -1
- package/dist/kitty-graphics.d.ts +0 -1
- package/dist/kitty-graphics.js +0 -1
- package/dist/mcp.d.ts +0 -1
- package/dist/mcp.js +0 -1
- package/dist/package-paths.d.ts +0 -1
- package/dist/package-paths.js +0 -1
- package/dist/page-markdown.d.ts +0 -1
- package/dist/page-markdown.js +0 -1
- package/dist/performance-examples.d.ts +0 -1
- package/dist/performance-examples.js +0 -1
- package/dist/playwright-import.d.ts +0 -1
- package/dist/playwright-import.js +0 -1
- package/dist/product-paths.d.ts +0 -1
- package/dist/product-paths.js +0 -1
- package/dist/protocol.d.ts +0 -1
- package/dist/protocol.js +0 -1
- package/dist/react-source.d.ts +0 -1
- package/dist/react-source.js +0 -1
- package/dist/readability.js +1 -1
- package/dist/relay-client.d.ts +0 -1
- package/dist/relay-client.js +0 -1
- package/dist/relay-state.d.ts +0 -1
- package/dist/relay-state.js +0 -1
- package/dist/replay-ai-index.d.ts +0 -1
- package/dist/replay-ai-index.js +0 -1
- package/dist/replay-eval.d.ts +0 -1
- package/dist/replay-eval.js +0 -1
- package/dist/replay-handoff.d.ts +0 -1
- package/dist/replay-handoff.js +0 -1
- package/dist/replay-workflow-compiler.d.ts +0 -1
- package/dist/replay-workflow-compiler.js +0 -1
- package/dist/rrweb-recording-relay.d.ts +0 -1
- package/dist/rrweb-recording-relay.js +0 -1
- package/dist/rrweb-recording.d.ts +0 -1
- package/dist/rrweb-recording.js +0 -1
- package/dist/scoped-fs.d.ts +0 -1
- package/dist/scoped-fs.js +0 -1
- package/dist/selector-generator.js +1 -1
- package/dist/start-relay-server.d.ts +0 -1
- package/dist/start-relay-server.js +0 -1
- package/dist/styles-examples.d.ts +0 -1
- package/dist/styles-examples.js +0 -1
- package/dist/styles.d.ts +0 -1
- package/dist/styles.js +0 -1
- package/dist/tabwright-agent-skill.d.ts +0 -1
- package/dist/tabwright-agent-skill.js +0 -1
- package/dist/test-declarations.d.ts +0 -1
- package/dist/test-declarations.js +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +2 -2
- package/dist/wait-for-page-load.d.ts +0 -1
- package/dist/wait-for-page-load.js +0 -1
- package/dist/workflow-capability.d.ts +0 -1
- package/dist/workflow-capability.js +0 -1
- package/package.json +9 -4
- package/readme.md +35 -0
- package/dist/aria-snapshot.d.ts.map +0 -1
- package/dist/aria-snapshot.js.map +0 -1
- package/dist/aria-snapshot.test.d.ts +0 -2
- package/dist/aria-snapshot.test.d.ts.map +0 -1
- package/dist/aria-snapshot.test.js +0 -270
- package/dist/aria-snapshot.test.js.map +0 -1
- package/dist/aria-snapshot.unit.test.d.ts +0 -2
- package/dist/aria-snapshot.unit.test.d.ts.map +0 -1
- package/dist/aria-snapshot.unit.test.js +0 -542
- package/dist/aria-snapshot.unit.test.js.map +0 -1
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.d.ts.map +0 -1
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.js.map +0 -1
- package/dist/browser-config.d.ts.map +0 -1
- package/dist/browser-config.js.map +0 -1
- package/dist/browser-install.d.ts.map +0 -1
- package/dist/browser-install.js.map +0 -1
- package/dist/browser-launch.d.ts.map +0 -1
- package/dist/browser-launch.js.map +0 -1
- package/dist/builtin-capabilities.d.ts.map +0 -1
- package/dist/builtin-capabilities.js.map +0 -1
- package/dist/capability-agent-skill.d.ts.map +0 -1
- package/dist/capability-agent-skill.js.map +0 -1
- package/dist/capability-auth-state.d.ts.map +0 -1
- package/dist/capability-auth-state.js.map +0 -1
- package/dist/capability-auth.d.ts.map +0 -1
- package/dist/capability-auth.js.map +0 -1
- package/dist/capability-cli-confirmation.test.d.ts +0 -2
- package/dist/capability-cli-confirmation.test.d.ts.map +0 -1
- package/dist/capability-cli-confirmation.test.js +0 -79
- package/dist/capability-cli-confirmation.test.js.map +0 -1
- package/dist/capability-options.d.ts.map +0 -1
- package/dist/capability-options.js.map +0 -1
- package/dist/capability-options.test.d.ts +0 -2
- package/dist/capability-options.test.d.ts.map +0 -1
- package/dist/capability-options.test.js +0 -81
- package/dist/capability-options.test.js.map +0 -1
- package/dist/capability-package.d.ts.map +0 -1
- package/dist/capability-package.js.map +0 -1
- package/dist/capability-package.test.d.ts +0 -2
- package/dist/capability-package.test.d.ts.map +0 -1
- package/dist/capability-package.test.js +0 -179
- package/dist/capability-package.test.js.map +0 -1
- package/dist/capability-registry.d.ts.map +0 -1
- package/dist/capability-registry.js.map +0 -1
- package/dist/capability-registry.test.d.ts +0 -2
- package/dist/capability-registry.test.d.ts.map +0 -1
- package/dist/capability-registry.test.js +0 -1683
- package/dist/capability-registry.test.js.map +0 -1
- package/dist/capability-runner.d.ts.map +0 -1
- package/dist/capability-runner.js.map +0 -1
- package/dist/capability-search-relevance.test.d.ts +0 -2
- package/dist/capability-search-relevance.test.d.ts.map +0 -1
- package/dist/capability-search-relevance.test.js +0 -67
- package/dist/capability-search-relevance.test.js.map +0 -1
- package/dist/capability-studio.d.ts.map +0 -1
- package/dist/capability-studio.js.map +0 -1
- package/dist/capability-studio.test.d.ts +0 -2
- package/dist/capability-studio.test.d.ts.map +0 -1
- package/dist/capability-studio.test.js +0 -41
- package/dist/capability-studio.test.js.map +0 -1
- package/dist/cdp-log.d.ts.map +0 -1
- package/dist/cdp-log.js.map +0 -1
- package/dist/cdp-log.test.d.ts +0 -2
- package/dist/cdp-log.test.d.ts.map +0 -1
- package/dist/cdp-log.test.js +0 -109
- package/dist/cdp-log.test.js.map +0 -1
- package/dist/cdp-relay.d.ts.map +0 -1
- package/dist/cdp-relay.js.map +0 -1
- package/dist/cdp-session.d.ts.map +0 -1
- package/dist/cdp-session.js.map +0 -1
- package/dist/cdp-types.d.ts.map +0 -1
- package/dist/cdp-types.js.map +0 -1
- package/dist/channel-owner-inspect.test.d.ts +0 -2
- package/dist/channel-owner-inspect.test.d.ts.map +0 -1
- package/dist/channel-owner-inspect.test.js +0 -75
- package/dist/channel-owner-inspect.test.js.map +0 -1
- package/dist/chrome-discovery.d.ts.map +0 -1
- package/dist/chrome-discovery.js.map +0 -1
- package/dist/chrome-discovery.test.d.ts +0 -2
- package/dist/chrome-discovery.test.d.ts.map +0 -1
- package/dist/chrome-discovery.test.js +0 -41
- package/dist/chrome-discovery.test.js.map +0 -1
- package/dist/clean-html.d.ts.map +0 -1
- package/dist/clean-html.js.map +0 -1
- package/dist/cli-help.test.d.ts +0 -2
- package/dist/cli-help.test.d.ts.map +0 -1
- package/dist/cli-help.test.js +0 -98
- package/dist/cli-help.test.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cloud-client.d.ts.map +0 -1
- package/dist/cloud-client.js.map +0 -1
- package/dist/create-logger.d.ts.map +0 -1
- package/dist/create-logger.js.map +0 -1
- package/dist/debugger-examples-types.d.ts.map +0 -1
- package/dist/debugger-examples-types.js.map +0 -1
- package/dist/debugger-examples.d.ts.map +0 -1
- package/dist/debugger-examples.js.map +0 -1
- package/dist/debugger.d.ts.map +0 -1
- package/dist/debugger.js.map +0 -1
- package/dist/diff-utils.d.ts.map +0 -1
- package/dist/diff-utils.js.map +0 -1
- package/dist/diff-utils.test.d.ts +0 -2
- package/dist/diff-utils.test.d.ts.map +0 -1
- package/dist/diff-utils.test.js +0 -137
- package/dist/diff-utils.test.js.map +0 -1
- package/dist/doctor.d.ts.map +0 -1
- package/dist/doctor.js.map +0 -1
- package/dist/doctor.test.d.ts +0 -2
- package/dist/doctor.test.d.ts.map +0 -1
- package/dist/doctor.test.js +0 -208
- package/dist/doctor.test.js.map +0 -1
- package/dist/editor-examples.d.ts.map +0 -1
- package/dist/editor-examples.js.map +0 -1
- package/dist/editor.d.ts.map +0 -1
- package/dist/editor.js.map +0 -1
- package/dist/env-compat.d.ts.map +0 -1
- package/dist/env-compat.js.map +0 -1
- package/dist/executor.d.ts.map +0 -1
- package/dist/executor.js.map +0 -1
- package/dist/executor.unit.test.d.ts +0 -2
- package/dist/executor.unit.test.d.ts.map +0 -1
- package/dist/executor.unit.test.js +0 -143
- package/dist/executor.unit.test.js.map +0 -1
- package/dist/extension-connection.test.d.ts +0 -2
- package/dist/extension-connection.test.d.ts.map +0 -1
- package/dist/extension-connection.test.js +0 -708
- package/dist/extension-connection.test.js.map +0 -1
- package/dist/extension-icon-warning.test.d.ts +0 -2
- package/dist/extension-icon-warning.test.d.ts.map +0 -1
- package/dist/extension-icon-warning.test.js +0 -33
- package/dist/extension-icon-warning.test.js.map +0 -1
- package/dist/ghost-browser.d.ts.map +0 -1
- package/dist/ghost-browser.js.map +0 -1
- package/dist/ghost-cursor-controller.d.ts.map +0 -1
- package/dist/ghost-cursor-controller.js.map +0 -1
- package/dist/ghost-cursor.d.ts.map +0 -1
- package/dist/ghost-cursor.js.map +0 -1
- package/dist/htmlrewrite.d.ts.map +0 -1
- package/dist/htmlrewrite.js.map +0 -1
- package/dist/htmlrewrite.test.d.ts +0 -2
- package/dist/htmlrewrite.test.d.ts.map +0 -1
- package/dist/htmlrewrite.test.js +0 -7975
- package/dist/htmlrewrite.test.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/kill-port.d.ts.map +0 -1
- package/dist/kill-port.js.map +0 -1
- package/dist/kitty-graphics.d.ts.map +0 -1
- package/dist/kitty-graphics.js.map +0 -1
- package/dist/kitty-graphics.test.d.ts +0 -2
- package/dist/kitty-graphics.test.d.ts.map +0 -1
- package/dist/kitty-graphics.test.js +0 -125
- package/dist/kitty-graphics.test.js.map +0 -1
- package/dist/locator-selector.test.d.ts +0 -2
- package/dist/locator-selector.test.d.ts.map +0 -1
- package/dist/locator-selector.test.js +0 -98
- package/dist/locator-selector.test.js.map +0 -1
- package/dist/mcp-client.d.ts +0 -20
- package/dist/mcp-client.d.ts.map +0 -1
- package/dist/mcp-client.js +0 -56
- package/dist/mcp-client.js.map +0 -1
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js.map +0 -1
- package/dist/on-mouse-action.test.d.ts +0 -2
- package/dist/on-mouse-action.test.d.ts.map +0 -1
- package/dist/on-mouse-action.test.js +0 -180
- package/dist/on-mouse-action.test.js.map +0 -1
- package/dist/options-page.test.d.ts +0 -2
- package/dist/options-page.test.d.ts.map +0 -1
- package/dist/options-page.test.js +0 -773
- package/dist/options-page.test.js.map +0 -1
- package/dist/package-paths.d.ts.map +0 -1
- package/dist/package-paths.js.map +0 -1
- package/dist/page-markdown.d.ts.map +0 -1
- package/dist/page-markdown.js.map +0 -1
- package/dist/performance-examples.d.ts.map +0 -1
- package/dist/performance-examples.js.map +0 -1
- package/dist/playwright-import.d.ts.map +0 -1
- package/dist/playwright-import.js.map +0 -1
- package/dist/popup-relocation.test.d.ts +0 -7
- package/dist/popup-relocation.test.d.ts.map +0 -1
- package/dist/popup-relocation.test.js +0 -139
- package/dist/popup-relocation.test.js.map +0 -1
- package/dist/product-paths.d.ts.map +0 -1
- package/dist/product-paths.js.map +0 -1
- package/dist/product-paths.test.d.ts +0 -2
- package/dist/product-paths.test.d.ts.map +0 -1
- package/dist/product-paths.test.js +0 -39
- package/dist/product-paths.test.js.map +0 -1
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js.map +0 -1
- package/dist/protocol.test.d.ts +0 -2
- package/dist/protocol.test.d.ts.map +0 -1
- package/dist/protocol.test.js +0 -31
- package/dist/protocol.test.js.map +0 -1
- package/dist/react-source.d.ts.map +0 -1
- package/dist/react-source.js.map +0 -1
- package/dist/relay-client.d.ts.map +0 -1
- package/dist/relay-client.js.map +0 -1
- package/dist/relay-client.test.d.ts +0 -2
- package/dist/relay-client.test.d.ts.map +0 -1
- package/dist/relay-client.test.js +0 -305
- package/dist/relay-client.test.js.map +0 -1
- package/dist/relay-core.test.d.ts +0 -2
- package/dist/relay-core.test.d.ts.map +0 -1
- package/dist/relay-core.test.js +0 -1427
- package/dist/relay-core.test.js.map +0 -1
- package/dist/relay-navigation.test.d.ts +0 -2
- package/dist/relay-navigation.test.d.ts.map +0 -1
- package/dist/relay-navigation.test.js +0 -661
- package/dist/relay-navigation.test.js.map +0 -1
- package/dist/relay-session.test.d.ts +0 -2
- package/dist/relay-session.test.d.ts.map +0 -1
- package/dist/relay-session.test.js +0 -1121
- package/dist/relay-session.test.js.map +0 -1
- package/dist/relay-state.d.ts.map +0 -1
- package/dist/relay-state.js.map +0 -1
- package/dist/relay-state.test.d.ts +0 -2
- package/dist/relay-state.test.d.ts.map +0 -1
- package/dist/relay-state.test.js +0 -594
- package/dist/relay-state.test.js.map +0 -1
- package/dist/replay-ai-index.d.ts.map +0 -1
- package/dist/replay-ai-index.js.map +0 -1
- package/dist/replay-ai-index.test.d.ts +0 -2
- package/dist/replay-ai-index.test.d.ts.map +0 -1
- package/dist/replay-ai-index.test.js +0 -255
- package/dist/replay-ai-index.test.js.map +0 -1
- package/dist/replay-cli.test.d.ts +0 -2
- package/dist/replay-cli.test.d.ts.map +0 -1
- package/dist/replay-cli.test.js +0 -275
- package/dist/replay-cli.test.js.map +0 -1
- package/dist/replay-eval.d.ts.map +0 -1
- package/dist/replay-eval.js.map +0 -1
- package/dist/replay-handoff.d.ts.map +0 -1
- package/dist/replay-handoff.js.map +0 -1
- package/dist/replay-handoff.test.d.ts +0 -2
- package/dist/replay-handoff.test.d.ts.map +0 -1
- package/dist/replay-handoff.test.js +0 -123
- package/dist/replay-handoff.test.js.map +0 -1
- package/dist/replay-workflow-compiler.d.ts.map +0 -1
- package/dist/replay-workflow-compiler.js.map +0 -1
- package/dist/replay-workflow-compiler.test.d.ts +0 -2
- package/dist/replay-workflow-compiler.test.d.ts.map +0 -1
- package/dist/replay-workflow-compiler.test.js +0 -223
- package/dist/replay-workflow-compiler.test.js.map +0 -1
- package/dist/rrweb-recording-relay.d.ts.map +0 -1
- package/dist/rrweb-recording-relay.js.map +0 -1
- package/dist/rrweb-recording-relay.test.d.ts +0 -2
- package/dist/rrweb-recording-relay.test.d.ts.map +0 -1
- package/dist/rrweb-recording-relay.test.js +0 -85
- package/dist/rrweb-recording-relay.test.js.map +0 -1
- package/dist/rrweb-recording.d.ts.map +0 -1
- package/dist/rrweb-recording.js.map +0 -1
- package/dist/scoped-fs.d.ts.map +0 -1
- package/dist/scoped-fs.js.map +0 -1
- package/dist/scoped-fs.test.d.ts +0 -5
- package/dist/scoped-fs.test.d.ts.map +0 -1
- package/dist/scoped-fs.test.js +0 -73
- package/dist/scoped-fs.test.js.map +0 -1
- package/dist/skill-stub.test.d.ts +0 -2
- package/dist/skill-stub.test.d.ts.map +0 -1
- package/dist/skill-stub.test.js +0 -22
- package/dist/skill-stub.test.js.map +0 -1
- package/dist/snapshot-tools.test.d.ts +0 -2
- package/dist/snapshot-tools.test.d.ts.map +0 -1
- package/dist/snapshot-tools.test.js +0 -856
- package/dist/snapshot-tools.test.js.map +0 -1
- package/dist/start-relay-server.d.ts.map +0 -1
- package/dist/start-relay-server.js.map +0 -1
- package/dist/styles-examples.d.ts.map +0 -1
- package/dist/styles-examples.js.map +0 -1
- package/dist/styles.d.ts.map +0 -1
- package/dist/styles.js.map +0 -1
- package/dist/tabwright-agent-skill.d.ts.map +0 -1
- package/dist/tabwright-agent-skill.js.map +0 -1
- package/dist/tabwright-agent-skill.test.d.ts +0 -2
- package/dist/tabwright-agent-skill.test.d.ts.map +0 -1
- package/dist/tabwright-agent-skill.test.js +0 -51
- package/dist/tabwright-agent-skill.test.js.map +0 -1
- package/dist/test-declarations.d.ts.map +0 -1
- package/dist/test-declarations.js.map +0 -1
- package/dist/test-utils.d.ts +0 -69
- package/dist/test-utils.d.ts.map +0 -1
- package/dist/test-utils.js +0 -448
- package/dist/test-utils.js.map +0 -1
- package/dist/test-utils.test.d.ts +0 -2
- package/dist/test-utils.test.d.ts.map +0 -1
- package/dist/test-utils.test.js +0 -55
- package/dist/test-utils.test.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
- package/dist/wait-for-page-load.d.ts.map +0 -1
- package/dist/wait-for-page-load.js.map +0 -1
- package/dist/workflow-capability.d.ts.map +0 -1
- package/dist/workflow-capability.js.map +0 -1
- package/dist/workflow-script-flow.test.d.ts +0 -2
- package/dist/workflow-script-flow.test.d.ts.map +0 -1
- package/dist/workflow-script-flow.test.js +0 -285
- package/dist/workflow-script-flow.test.js.map +0 -1
- package/src/__snapshots__/x.com.processed.html +0 -1003
- package/src/__snapshots__/x.com.processed.withStyles.html +0 -2720
- package/src/a11y-client.ts +0 -241
- package/src/aria-snapshot.test.ts +0 -311
- package/src/aria-snapshot.ts +0 -1681
- package/src/aria-snapshot.unit.test.ts +0 -615
- package/src/aria-snapshots/github-interactive.txt +0 -193
- package/src/aria-snapshots/github-raw.txt +0 -309
- package/src/aria-snapshots/hackernews-interactive.txt +0 -477
- package/src/aria-snapshots/hackernews-raw.txt +0 -428
- package/src/aria-snapshots/prosemirror-interactive.txt +0 -66
- package/src/aria-snapshots/prosemirror-raw.txt +0 -145
- package/src/assets/aria-labels-hacker-news.png +0 -0
- package/src/assets/aria-labels-old-reddit.png +0 -0
- package/src/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.ts +0 -5
- package/src/assets/cursors/screen-studio/pointer-macos-tahoe.svg +0 -18
- package/src/assets/x.com.html +0 -32946
- package/src/browser-config.ts +0 -179
- package/src/browser-install.ts +0 -284
- package/src/browser-launch.ts +0 -75
- package/src/builtin-capabilities.ts +0 -2765
- package/src/capability-agent-skill.ts +0 -305
- package/src/capability-auth-state.ts +0 -197
- package/src/capability-auth.ts +0 -249
- package/src/capability-cli-confirmation.test.ts +0 -90
- package/src/capability-options.test.ts +0 -89
- package/src/capability-options.ts +0 -57
- package/src/capability-package.test.ts +0 -204
- package/src/capability-package.ts +0 -555
- package/src/capability-registry.test.ts +0 -1905
- package/src/capability-registry.ts +0 -1234
- package/src/capability-runner.ts +0 -801
- package/src/capability-search-relevance.test.ts +0 -73
- package/src/capability-studio.test.ts +0 -45
- package/src/capability-studio.ts +0 -641
- package/src/cdp-log.test.ts +0 -131
- package/src/cdp-log.ts +0 -112
- package/src/cdp-relay.ts +0 -2944
- package/src/cdp-session.ts +0 -77
- package/src/cdp-types.ts +0 -158
- package/src/channel-owner-inspect.test.ts +0 -94
- package/src/chrome-discovery.test.ts +0 -50
- package/src/chrome-discovery.ts +0 -220
- package/src/clean-html.ts +0 -141
- package/src/cli-help.test.ts +0 -123
- package/src/cli.ts +0 -3181
- package/src/cloud-client.ts +0 -179
- package/src/create-logger.ts +0 -38
- package/src/debugger-examples-types.ts +0 -16
- package/src/debugger-examples.ts +0 -66
- package/src/debugger.ts +0 -708
- package/src/diff-utils.test.ts +0 -152
- package/src/diff-utils.ts +0 -70
- package/src/doctor.test.ts +0 -244
- package/src/doctor.ts +0 -321
- package/src/editor-examples.ts +0 -158
- package/src/editor.ts +0 -426
- package/src/env-compat.ts +0 -28
- package/src/executor.ts +0 -1824
- package/src/executor.unit.test.ts +0 -168
- package/src/extension-connection.test.ts +0 -855
- package/src/extension-icon-warning.test.ts +0 -45
- package/src/ghost-browser.ts +0 -149
- package/src/ghost-cursor-client.ts +0 -494
- package/src/ghost-cursor-controller.ts +0 -129
- package/src/ghost-cursor.ts +0 -123
- package/src/htmlrewrite.test.ts +0 -8008
- package/src/htmlrewrite.ts +0 -390
- package/src/index.ts +0 -53
- package/src/kill-port.ts +0 -219
- package/src/kitty-graphics.test.ts +0 -139
- package/src/kitty-graphics.ts +0 -79
- package/src/locator-selector.test.ts +0 -119
- package/src/mcp-client.ts +0 -78
- package/src/mcp.ts +0 -629
- package/src/on-mouse-action.test.ts +0 -226
- package/src/options-page.test.ts +0 -839
- package/src/package-paths.ts +0 -38
- package/src/page-markdown.ts +0 -240
- package/src/performance-examples.ts +0 -186
- package/src/playwright-import.ts +0 -59
- package/src/popup-relocation.test.ts +0 -163
- package/src/product-paths.test.ts +0 -47
- package/src/product-paths.ts +0 -28
- package/src/protocol.test.ts +0 -52
- package/src/protocol.ts +0 -351
- package/src/react-source.ts +0 -379
- package/src/relay-client.test.ts +0 -375
- package/src/relay-client.ts +0 -572
- package/src/relay-core.test.ts +0 -1603
- package/src/relay-navigation.test.ts +0 -790
- package/src/relay-session.test.ts +0 -1375
- package/src/relay-state.test.ts +0 -729
- package/src/relay-state.ts +0 -561
- package/src/replay-ai-index.test.ts +0 -278
- package/src/replay-ai-index.ts +0 -872
- package/src/replay-cli.test.ts +0 -325
- package/src/replay-eval.ts +0 -1039
- package/src/replay-handoff.test.ts +0 -163
- package/src/replay-handoff.ts +0 -109
- package/src/replay-workflow-compiler.test.ts +0 -250
- package/src/replay-workflow-compiler.ts +0 -700
- package/src/resource.md +0 -409
- package/src/rrweb-recording-relay.test.ts +0 -99
- package/src/rrweb-recording-relay.ts +0 -400
- package/src/rrweb-recording.ts +0 -322
- package/src/scoped-fs.test.ts +0 -80
- package/src/scoped-fs.ts +0 -420
- package/src/skill-stub.test.ts +0 -24
- package/src/snapshot-tools.test.ts +0 -1017
- package/src/snapshots/hacker-news-accessibility-full.md +0 -81
- package/src/snapshots/hacker-news-accessibility-interactive.md +0 -43
- package/src/snapshots/page-markdown-output.txt +0 -16
- package/src/snapshots/shadcn-ui-accessibility-full.md +0 -201
- package/src/snapshots/shadcn-ui-accessibility-interactive.md +0 -109
- package/src/start-relay-server.ts +0 -69
- package/src/styles-examples.ts +0 -84
- package/src/styles.ts +0 -343
- package/src/tabwright-agent-skill.test.ts +0 -61
- package/src/tabwright-agent-skill.ts +0 -105
- package/src/test-declarations.ts +0 -13
- package/src/test-utils.test.ts +0 -70
- package/src/test-utils.ts +0 -566
- package/src/utils.ts +0 -78
- package/src/wait-for-page-load.ts +0 -198
- package/src/workflow-capability.ts +0 -417
- package/src/workflow-script-flow.test.ts +0 -388
package/src/doctor.ts
DELETED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { compareVersions, supportsRelayFeatures, type ExtensionStatus } from './relay-client.js'
|
|
2
|
-
import { RELAY_REVIEW_FEATURES } from './protocol.js'
|
|
3
|
-
import type { TabwrightAgentSkillStatus } from './tabwright-agent-skill.js'
|
|
4
|
-
|
|
5
|
-
export type DoctorCheckStatus = 'pass' | 'warn' | 'fail' | 'info'
|
|
6
|
-
|
|
7
|
-
export interface DoctorSession {
|
|
8
|
-
id: string
|
|
9
|
-
browser: string | null
|
|
10
|
-
extensionId: string | null
|
|
11
|
-
cwd: string | null
|
|
12
|
-
connected?: boolean
|
|
13
|
-
pageUrl?: string | null
|
|
14
|
-
pagesCount?: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface DoctorCheck {
|
|
18
|
-
id: 'relay' | 'extension' | 'session' | 'capabilities' | 'skill'
|
|
19
|
-
status: DoctorCheckStatus
|
|
20
|
-
message: string
|
|
21
|
-
detail?: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface DoctorNextStep {
|
|
25
|
-
title: string
|
|
26
|
-
command?: string
|
|
27
|
-
fallbackCommand?: string
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface DoctorReport {
|
|
31
|
-
ready: boolean
|
|
32
|
-
version: string
|
|
33
|
-
cwd: string
|
|
34
|
-
checks: DoctorCheck[]
|
|
35
|
-
next: DoctorNextStep
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function buildDoctorReport(options: {
|
|
39
|
-
version: string
|
|
40
|
-
cwd: string
|
|
41
|
-
remote: boolean
|
|
42
|
-
relayVersion: string | null
|
|
43
|
-
relayFeatures?: string[] | null
|
|
44
|
-
relayError?: string | null
|
|
45
|
-
extensions: ExtensionStatus[]
|
|
46
|
-
sessions: DoctorSession[]
|
|
47
|
-
capabilityCount: number
|
|
48
|
-
skillStatus?: TabwrightAgentSkillStatus
|
|
49
|
-
}): DoctorReport {
|
|
50
|
-
const usableSessions = options.sessions.filter((session) => {
|
|
51
|
-
if (session.connected === false) {
|
|
52
|
-
return false
|
|
53
|
-
}
|
|
54
|
-
if (!session.extensionId) {
|
|
55
|
-
return true
|
|
56
|
-
}
|
|
57
|
-
return options.extensions.some((extension) => {
|
|
58
|
-
return (
|
|
59
|
-
(extension.extensionId === session.extensionId || extension.stableKey === session.extensionId) &&
|
|
60
|
-
extension.activeTargets > 0
|
|
61
|
-
)
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
const newerExtension = options.extensions.find((extension) => {
|
|
65
|
-
return extension.playwriterVersion && compareVersions(extension.playwriterVersion, options.version) > 0
|
|
66
|
-
})
|
|
67
|
-
const relayFeatureMismatch =
|
|
68
|
-
options.relayFeatures !== undefined &&
|
|
69
|
-
!supportsRelayFeatures({ features: options.relayFeatures, requiredFeatures: RELAY_REVIEW_FEATURES })
|
|
70
|
-
const relayCheck: DoctorCheck = (() => {
|
|
71
|
-
if (!options.relayVersion) {
|
|
72
|
-
return {
|
|
73
|
-
id: 'relay',
|
|
74
|
-
status: 'fail',
|
|
75
|
-
message: `${options.remote ? 'Remote' : 'Local'} relay is not reachable.`,
|
|
76
|
-
detail:
|
|
77
|
-
options.relayError ||
|
|
78
|
-
(options.remote
|
|
79
|
-
? 'Check the relay host, token, and network path.'
|
|
80
|
-
: 'Tabwright could not start or reach the relay. Read the relay log for the underlying error.'),
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (compareVersions(options.relayVersion, options.version) < 0) {
|
|
84
|
-
return {
|
|
85
|
-
id: 'relay',
|
|
86
|
-
status: 'warn',
|
|
87
|
-
message: `Relay ${options.relayVersion} is older than CLI ${options.version}.`,
|
|
88
|
-
detail: 'Restart Tabwright so the CLI can replace the older relay.',
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (relayFeatureMismatch) {
|
|
92
|
-
return {
|
|
93
|
-
id: 'relay',
|
|
94
|
-
status: 'warn',
|
|
95
|
-
message: `Relay ${options.relayVersion} is reachable, but current saved-data features are missing.`,
|
|
96
|
-
detail: 'Core browser control may still work. Restart Tabwright before using recordings or capabilities.',
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
id: 'relay',
|
|
101
|
-
status: 'pass',
|
|
102
|
-
message: `Relay ${options.relayVersion} is reachable.`,
|
|
103
|
-
}
|
|
104
|
-
})()
|
|
105
|
-
|
|
106
|
-
const extensionCheck: DoctorCheck = (() => {
|
|
107
|
-
if (options.extensions.length === 0) {
|
|
108
|
-
return {
|
|
109
|
-
id: 'extension',
|
|
110
|
-
status: usableSessions.length > 0 ? 'info' : 'fail',
|
|
111
|
-
message: 'No Chrome extension connection was found.',
|
|
112
|
-
detail:
|
|
113
|
-
'User-Chrome workflows and replay recording require the extension; direct, headless, and cloud sessions do not.',
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const activeTargets = options.extensions.reduce((total, extension) => {
|
|
118
|
-
return total + extension.activeTargets
|
|
119
|
-
}, 0)
|
|
120
|
-
if (activeTargets === 0) {
|
|
121
|
-
return {
|
|
122
|
-
id: 'extension',
|
|
123
|
-
status: 'warn',
|
|
124
|
-
message: `${options.extensions.length} extension connection(s) found, but no tab is enabled.`,
|
|
125
|
-
detail: 'Open the target tab and click the Tabwright extension icon until it turns green.',
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const legacyCount = options.extensions.filter((extension) => {
|
|
130
|
-
return extension.connectionHealth === 'legacy' || !extension.features
|
|
131
|
-
}).length
|
|
132
|
-
const missingFeatures = [
|
|
133
|
-
...new Set(
|
|
134
|
-
options.extensions.flatMap((extension) => {
|
|
135
|
-
return extension.missingFeatures || []
|
|
136
|
-
}),
|
|
137
|
-
),
|
|
138
|
-
]
|
|
139
|
-
const compatibilityDetails = [
|
|
140
|
-
legacyCount > 0
|
|
141
|
-
? `${legacyCount} connection(s) use the legacy handshake, so optional feature support is unknown.`
|
|
142
|
-
: '',
|
|
143
|
-
missingFeatures.length > 0 ? `Missing optional features: ${missingFeatures.join(', ')}.` : '',
|
|
144
|
-
].filter((detail) => {
|
|
145
|
-
return detail.length > 0
|
|
146
|
-
})
|
|
147
|
-
if (compatibilityDetails.length > 0) {
|
|
148
|
-
const versionDetail = newerExtension?.playwriterVersion
|
|
149
|
-
? ` Extension ${newerExtension.playwriterVersion} is newer than CLI ${options.version}.`
|
|
150
|
-
: ''
|
|
151
|
-
return {
|
|
152
|
-
id: 'extension',
|
|
153
|
-
status: 'warn',
|
|
154
|
-
message: `${options.extensions.length} extension connection(s), ${activeTargets} enabled tab(s); core browser control is available with limited optional features.`,
|
|
155
|
-
detail: `${compatibilityDetails.join(' ')}${versionDetail}`,
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (newerExtension?.playwriterVersion) {
|
|
160
|
-
return {
|
|
161
|
-
id: 'extension',
|
|
162
|
-
status: 'info',
|
|
163
|
-
message: `${options.extensions.length} extension connection(s), ${activeTargets} enabled tab(s); negotiated features are ready.`,
|
|
164
|
-
detail: `Extension ${newerExtension.playwriterVersion} is newer than CLI ${options.version}, but the advertised feature set is fully supported.`,
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return {
|
|
169
|
-
id: 'extension',
|
|
170
|
-
status: 'pass',
|
|
171
|
-
message: `${options.extensions.length} extension connection(s), ${activeTargets} enabled tab(s).`,
|
|
172
|
-
}
|
|
173
|
-
})()
|
|
174
|
-
|
|
175
|
-
const sessionCheck: DoctorCheck =
|
|
176
|
-
usableSessions.length > 0
|
|
177
|
-
? {
|
|
178
|
-
id: 'session',
|
|
179
|
-
status: 'pass',
|
|
180
|
-
message: `${usableSessions.length} usable session(s).`,
|
|
181
|
-
detail: `Healthy session: ${usableSessions[0]!.id}. Only reuse a session you created for this task.`,
|
|
182
|
-
}
|
|
183
|
-
: {
|
|
184
|
-
id: 'session',
|
|
185
|
-
status: 'warn',
|
|
186
|
-
message:
|
|
187
|
-
options.sessions.length > 0
|
|
188
|
-
? 'Session records exist, but none are currently usable.'
|
|
189
|
-
: 'No active session exists yet.',
|
|
190
|
-
detail:
|
|
191
|
-
options.sessions.length > 0
|
|
192
|
-
? 'Reconnect or enable the matching browser before reusing a session.'
|
|
193
|
-
: 'Create one before running Playwright code.',
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const capabilityCheck: DoctorCheck =
|
|
197
|
-
options.capabilityCount > 0
|
|
198
|
-
? {
|
|
199
|
-
id: 'capabilities',
|
|
200
|
-
status: 'pass',
|
|
201
|
-
message: `${options.capabilityCount} saved ${options.capabilityCount === 1 ? 'capability is' : 'capabilities are'} discoverable from this directory.`,
|
|
202
|
-
}
|
|
203
|
-
: {
|
|
204
|
-
id: 'capabilities',
|
|
205
|
-
status: 'info',
|
|
206
|
-
message: 'No saved capabilities are discoverable from this directory yet.',
|
|
207
|
-
detail: 'This does not block browser control. Record or create a capability after the first successful task.',
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const skillCheck: DoctorCheck | null = (() => {
|
|
211
|
-
if (!options.skillStatus) {
|
|
212
|
-
return null
|
|
213
|
-
}
|
|
214
|
-
if (options.skillStatus.state === 'current') {
|
|
215
|
-
return {
|
|
216
|
-
id: 'skill',
|
|
217
|
-
status: 'pass',
|
|
218
|
-
message: 'The installed Tabwright skill matches this CLI.',
|
|
219
|
-
detail: options.skillStatus.installedPath,
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return {
|
|
223
|
-
id: 'skill',
|
|
224
|
-
status: 'warn',
|
|
225
|
-
message:
|
|
226
|
-
options.skillStatus.state === 'missing'
|
|
227
|
-
? 'The Tabwright skill is not installed for Codex.'
|
|
228
|
-
: 'The installed Tabwright skill does not match this CLI.',
|
|
229
|
-
detail: `Run: ${options.skillStatus.installCommand}`,
|
|
230
|
-
}
|
|
231
|
-
})()
|
|
232
|
-
|
|
233
|
-
const next: DoctorNextStep = (() => {
|
|
234
|
-
if (!options.relayVersion) {
|
|
235
|
-
return {
|
|
236
|
-
title: options.remote
|
|
237
|
-
? 'Check the remote relay host, token, and network path, then run doctor again.'
|
|
238
|
-
: 'Read the relay log, fix the startup error, then run doctor again.',
|
|
239
|
-
...(options.remote ? {} : { command: 'tabwright logfile' }),
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
if (relayFeatureMismatch) {
|
|
244
|
-
return {
|
|
245
|
-
title: 'Restart the local service so recordings and capabilities become available.',
|
|
246
|
-
command: 'tabwright session list',
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (options.skillStatus && options.skillStatus.state !== 'current') {
|
|
251
|
-
return {
|
|
252
|
-
title:
|
|
253
|
-
options.skillStatus.state === 'missing'
|
|
254
|
-
? 'Install the Tabwright skill bundled with this CLI.'
|
|
255
|
-
: 'Update the installed Tabwright skill to match this CLI.',
|
|
256
|
-
command: options.skillStatus.installCommand,
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
const enabledExtension = options.extensions.find((extension) => {
|
|
261
|
-
return extension.activeTargets > 0
|
|
262
|
-
})
|
|
263
|
-
if (enabledExtension) {
|
|
264
|
-
return {
|
|
265
|
-
title: 'Create a task-owned session for the enabled Chrome tab.',
|
|
266
|
-
command: enabledExtension.stableKey
|
|
267
|
-
? `tabwright session new --browser ${enabledExtension.stableKey}`
|
|
268
|
-
: 'tabwright session new',
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (usableSessions.length > 0) {
|
|
273
|
-
return {
|
|
274
|
-
title: 'Create a task-owned headless session instead of reusing another agent session.',
|
|
275
|
-
command: 'tabwright session new --browser headless',
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (options.extensions.length > 0) {
|
|
280
|
-
return {
|
|
281
|
-
title: 'Open the target tab and click the Tabwright extension icon until it turns green.',
|
|
282
|
-
fallbackCommand: 'tabwright session new --browser headless',
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return {
|
|
287
|
-
title: 'Connect your Chrome extension, or start a standalone headless session.',
|
|
288
|
-
command: 'tabwright session new --browser headless',
|
|
289
|
-
}
|
|
290
|
-
})()
|
|
291
|
-
|
|
292
|
-
return {
|
|
293
|
-
ready: relayCheck.status !== 'fail' && extensionCheck.status !== 'fail' && sessionCheck.status === 'pass',
|
|
294
|
-
version: options.version,
|
|
295
|
-
cwd: options.cwd,
|
|
296
|
-
checks: [relayCheck, extensionCheck, sessionCheck, capabilityCheck, ...(skillCheck ? [skillCheck] : [])],
|
|
297
|
-
next,
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export function formatDoctorReport(report: DoctorReport): string {
|
|
302
|
-
const symbols: Record<DoctorCheckStatus, string> = {
|
|
303
|
-
pass: 'PASS',
|
|
304
|
-
warn: 'WARN',
|
|
305
|
-
fail: 'FAIL',
|
|
306
|
-
info: 'INFO',
|
|
307
|
-
}
|
|
308
|
-
const checks = report.checks.flatMap((check) => {
|
|
309
|
-
return [`[${symbols[check.status]}] ${check.message}`, ...(check.detail ? [` ${check.detail}`] : [])]
|
|
310
|
-
})
|
|
311
|
-
return [
|
|
312
|
-
`Tabwright doctor ${report.version}`,
|
|
313
|
-
`Directory: ${report.cwd}`,
|
|
314
|
-
'',
|
|
315
|
-
...checks,
|
|
316
|
-
'',
|
|
317
|
-
`Next: ${report.next.title}`,
|
|
318
|
-
...(report.next.command ? [` ${report.next.command}`] : []),
|
|
319
|
-
...(report.next.fallbackCommand ? [`Fallback: ${report.next.fallbackCommand}`] : []),
|
|
320
|
-
].join('\n')
|
|
321
|
-
}
|
package/src/editor-examples.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { page, getCDPSession, createEditor, console } from './debugger-examples-types.js'
|
|
2
|
-
|
|
3
|
-
// Example: List available scripts
|
|
4
|
-
async function listScripts() {
|
|
5
|
-
const cdp = await getCDPSession({ page })
|
|
6
|
-
const editor = createEditor({ cdp })
|
|
7
|
-
await editor.enable()
|
|
8
|
-
|
|
9
|
-
const scripts = editor.list({ pattern: /app/ })
|
|
10
|
-
console.log(scripts)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Example: Read a script with line numbers
|
|
14
|
-
async function readScript() {
|
|
15
|
-
const cdp = await getCDPSession({ page })
|
|
16
|
-
const editor = createEditor({ cdp })
|
|
17
|
-
await editor.enable()
|
|
18
|
-
|
|
19
|
-
const { content, totalLines } = await editor.read({
|
|
20
|
-
url: 'https://example.com/app.js',
|
|
21
|
-
})
|
|
22
|
-
console.log('Total lines:', totalLines)
|
|
23
|
-
console.log(content)
|
|
24
|
-
|
|
25
|
-
const { content: partial } = await editor.read({
|
|
26
|
-
url: 'https://example.com/app.js',
|
|
27
|
-
offset: 100,
|
|
28
|
-
limit: 50,
|
|
29
|
-
})
|
|
30
|
-
console.log(partial)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Example: Edit a script (exact string replacement)
|
|
34
|
-
async function editScript() {
|
|
35
|
-
const cdp = await getCDPSession({ page })
|
|
36
|
-
const editor = createEditor({ cdp })
|
|
37
|
-
await editor.enable()
|
|
38
|
-
|
|
39
|
-
await editor.edit({
|
|
40
|
-
url: 'https://example.com/app.js',
|
|
41
|
-
oldString: 'const DEBUG = false',
|
|
42
|
-
newString: 'const DEBUG = true',
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const dryRunResult = await editor.edit({
|
|
46
|
-
url: 'https://example.com/app.js',
|
|
47
|
-
oldString: 'old code',
|
|
48
|
-
newString: 'new code',
|
|
49
|
-
dryRun: true,
|
|
50
|
-
})
|
|
51
|
-
console.log('Dry run result:', dryRunResult)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Example: Search across all scripts
|
|
55
|
-
async function searchScripts() {
|
|
56
|
-
const cdp = await getCDPSession({ page })
|
|
57
|
-
const editor = createEditor({ cdp })
|
|
58
|
-
await editor.enable()
|
|
59
|
-
|
|
60
|
-
const matches = await editor.grep({ regex: /console\.log/ })
|
|
61
|
-
console.log(matches)
|
|
62
|
-
|
|
63
|
-
const todoMatches = await editor.grep({
|
|
64
|
-
regex: /TODO|FIXME/i,
|
|
65
|
-
pattern: /app/,
|
|
66
|
-
})
|
|
67
|
-
console.log(todoMatches)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Example: Write entire script content
|
|
71
|
-
async function writeScript() {
|
|
72
|
-
const cdp = await getCDPSession({ page })
|
|
73
|
-
const editor = createEditor({ cdp })
|
|
74
|
-
await editor.enable()
|
|
75
|
-
|
|
76
|
-
const { content } = await editor.read({ url: 'https://example.com/app.js' })
|
|
77
|
-
const newContent = content.replace(/console\.log/g, 'console.debug')
|
|
78
|
-
|
|
79
|
-
await editor.write({
|
|
80
|
-
url: 'https://example.com/app.js',
|
|
81
|
-
content: newContent,
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Example: Edit an inline script (scripts without URL get inline://{id} URLs)
|
|
86
|
-
async function editInlineScript() {
|
|
87
|
-
const cdp = await getCDPSession({ page })
|
|
88
|
-
const editor = createEditor({ cdp })
|
|
89
|
-
await editor.enable()
|
|
90
|
-
|
|
91
|
-
const matches = await editor.grep({ regex: /myFunction/ })
|
|
92
|
-
if (matches.length > 0) {
|
|
93
|
-
const { url } = matches[0]
|
|
94
|
-
console.log('Found in:', url)
|
|
95
|
-
|
|
96
|
-
await editor.edit({
|
|
97
|
-
url,
|
|
98
|
-
oldString: 'return false',
|
|
99
|
-
newString: 'return true',
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Example: List and read CSS stylesheets
|
|
105
|
-
async function readStylesheet() {
|
|
106
|
-
const cdp = await getCDPSession({ page })
|
|
107
|
-
const editor = createEditor({ cdp })
|
|
108
|
-
await editor.enable()
|
|
109
|
-
|
|
110
|
-
const stylesheets = await editor.list({ pattern: /\.css/ })
|
|
111
|
-
console.log('Stylesheets:', stylesheets)
|
|
112
|
-
|
|
113
|
-
if (stylesheets.length > 0) {
|
|
114
|
-
const { content, totalLines } = await editor.read({
|
|
115
|
-
url: stylesheets[0],
|
|
116
|
-
})
|
|
117
|
-
console.log('Total lines:', totalLines)
|
|
118
|
-
console.log(content)
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Example: Edit a CSS stylesheet
|
|
123
|
-
async function editStylesheet() {
|
|
124
|
-
const cdp = await getCDPSession({ page })
|
|
125
|
-
const editor = createEditor({ cdp })
|
|
126
|
-
await editor.enable()
|
|
127
|
-
|
|
128
|
-
await editor.edit({
|
|
129
|
-
url: 'https://example.com/styles.css',
|
|
130
|
-
oldString: 'color: red',
|
|
131
|
-
newString: 'color: blue',
|
|
132
|
-
})
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Example: Search CSS for specific properties
|
|
136
|
-
async function searchStyles() {
|
|
137
|
-
const cdp = await getCDPSession({ page })
|
|
138
|
-
const editor = createEditor({ cdp })
|
|
139
|
-
await editor.enable()
|
|
140
|
-
|
|
141
|
-
const matches = await editor.grep({
|
|
142
|
-
regex: /background-color/,
|
|
143
|
-
pattern: /\.css/,
|
|
144
|
-
})
|
|
145
|
-
console.log(matches)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export {
|
|
149
|
-
listScripts,
|
|
150
|
-
readScript,
|
|
151
|
-
editScript,
|
|
152
|
-
searchScripts,
|
|
153
|
-
writeScript,
|
|
154
|
-
editInlineScript,
|
|
155
|
-
readStylesheet,
|
|
156
|
-
editStylesheet,
|
|
157
|
-
searchStyles,
|
|
158
|
-
}
|