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/styles.ts
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import type { ICDPSession } from './cdp-session.js'
|
|
2
|
-
import type { Locator } from '@xmorse/playwright-core'
|
|
3
|
-
|
|
4
|
-
export interface StyleSource {
|
|
5
|
-
url: string
|
|
6
|
-
line: number
|
|
7
|
-
column: number
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type StyleDeclarations = Record<string, string>
|
|
11
|
-
|
|
12
|
-
export interface StyleRule {
|
|
13
|
-
selector: string
|
|
14
|
-
source: StyleSource | null
|
|
15
|
-
origin: 'regular' | 'user-agent' | 'injected' | 'inspector'
|
|
16
|
-
declarations: StyleDeclarations
|
|
17
|
-
inheritedFrom: string | null
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface StylesResult {
|
|
21
|
-
element: string
|
|
22
|
-
inlineStyle: StyleDeclarations | null
|
|
23
|
-
rules: StyleRule[]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface CSSProperty {
|
|
27
|
-
name: string
|
|
28
|
-
value: string
|
|
29
|
-
important?: boolean
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface CSSStyle {
|
|
33
|
-
cssProperties: CSSProperty[]
|
|
34
|
-
cssText?: string
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface CSSRule {
|
|
38
|
-
selectorList: { text: string }
|
|
39
|
-
style: CSSStyle
|
|
40
|
-
styleSheetId?: string
|
|
41
|
-
origin: string
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface RuleMatch {
|
|
45
|
-
rule: CSSRule
|
|
46
|
-
matchingSelectors: number[]
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface InheritedStyleEntry {
|
|
50
|
-
inlineStyle?: CSSStyle
|
|
51
|
-
matchedCSSRules: RuleMatch[]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface SourceRange {
|
|
55
|
-
startLine: number
|
|
56
|
-
startColumn: number
|
|
57
|
-
endLine: number
|
|
58
|
-
endColumn: number
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface CSSStyleSheetHeader {
|
|
62
|
-
styleSheetId: string
|
|
63
|
-
sourceURL?: string
|
|
64
|
-
origin: string
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export async function getStylesForLocator({
|
|
68
|
-
locator,
|
|
69
|
-
cdp: cdpSession,
|
|
70
|
-
includeUserAgentStyles = false,
|
|
71
|
-
}: {
|
|
72
|
-
locator: Locator
|
|
73
|
-
cdp: ICDPSession
|
|
74
|
-
includeUserAgentStyles?: boolean
|
|
75
|
-
}): Promise<StylesResult> {
|
|
76
|
-
const cdp = cdpSession
|
|
77
|
-
await cdp.send('DOM.enable')
|
|
78
|
-
await cdp.send('CSS.enable')
|
|
79
|
-
|
|
80
|
-
const elementHandle = await locator.elementHandle()
|
|
81
|
-
if (!elementHandle) {
|
|
82
|
-
throw new Error('Could not get element handle from locator')
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const remoteObject = (elementHandle as any)._channel?.objectId
|
|
86
|
-
? { objectId: (elementHandle as any)._channel.objectId }
|
|
87
|
-
: null
|
|
88
|
-
|
|
89
|
-
let backendNodeId: number
|
|
90
|
-
if (remoteObject?.objectId) {
|
|
91
|
-
const nodeInfo = await cdp.send('DOM.describeNode', {
|
|
92
|
-
objectId: remoteObject.objectId,
|
|
93
|
-
})
|
|
94
|
-
backendNodeId = nodeInfo.node.backendNodeId
|
|
95
|
-
} else {
|
|
96
|
-
const box = await elementHandle.boundingBox()
|
|
97
|
-
if (!box) {
|
|
98
|
-
throw new Error('Element has no bounding box')
|
|
99
|
-
}
|
|
100
|
-
const docResult = await cdp.send('DOM.getDocument', { depth: 0 })
|
|
101
|
-
const nodeAtPoint = await cdp.send('DOM.getNodeForLocation', {
|
|
102
|
-
x: Math.round(box.x + box.width / 2),
|
|
103
|
-
y: Math.round(box.y + box.height / 2),
|
|
104
|
-
})
|
|
105
|
-
backendNodeId = nodeAtPoint.backendNodeId
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const pushResult = await cdp.send('DOM.pushNodesByBackendIdsToFrontend', {
|
|
109
|
-
backendNodeIds: [backendNodeId],
|
|
110
|
-
})
|
|
111
|
-
const nodeId = pushResult.nodeIds[0]
|
|
112
|
-
|
|
113
|
-
if (!nodeId) {
|
|
114
|
-
throw new Error('Could not get nodeId for element')
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const nodeInfo = await cdp.send('DOM.describeNode', { nodeId })
|
|
118
|
-
const elementDescription = formatElementDescription(nodeInfo.node)
|
|
119
|
-
|
|
120
|
-
const matchedStyles = await cdp.send('CSS.getMatchedStylesForNode', { nodeId })
|
|
121
|
-
|
|
122
|
-
const stylesheetUrls = new Map<string, string>()
|
|
123
|
-
|
|
124
|
-
const processStyleSheetId = async (styleSheetId: string | undefined): Promise<StyleSource | null> => {
|
|
125
|
-
if (!styleSheetId) {
|
|
126
|
-
return null
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (!stylesheetUrls.has(styleSheetId)) {
|
|
130
|
-
try {
|
|
131
|
-
const header = await cdp.send('CSS.getStyleSheetText', { styleSheetId })
|
|
132
|
-
stylesheetUrls.set(styleSheetId, '')
|
|
133
|
-
} catch {
|
|
134
|
-
stylesheetUrls.set(styleSheetId, '')
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return null
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const rules: StyleRule[] = []
|
|
142
|
-
|
|
143
|
-
if (matchedStyles.matchedCSSRules) {
|
|
144
|
-
for (const ruleMatch of matchedStyles.matchedCSSRules) {
|
|
145
|
-
const rule = ruleMatch.rule
|
|
146
|
-
const sourceRange = (rule as any).selectorList?.range as SourceRange | undefined
|
|
147
|
-
const styleSheetId = rule.styleSheetId
|
|
148
|
-
|
|
149
|
-
let source: StyleSource | null = null
|
|
150
|
-
if (styleSheetId && sourceRange) {
|
|
151
|
-
const styleSheet = (matchedStyles as any).cssStyleSheetHeaders?.find(
|
|
152
|
-
(h: CSSStyleSheetHeader) => h.styleSheetId === styleSheetId,
|
|
153
|
-
)
|
|
154
|
-
const url =
|
|
155
|
-
styleSheet?.sourceURL || (rule as any).origin === 'user-agent' ? 'user-agent' : `stylesheet:${styleSheetId}`
|
|
156
|
-
|
|
157
|
-
source = {
|
|
158
|
-
url: (rule as any).styleSheetId ? await getStylesheetUrl(cdp, styleSheetId) : 'user-agent',
|
|
159
|
-
line: sourceRange.startLine + 1,
|
|
160
|
-
column: sourceRange.startColumn,
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
rules.push({
|
|
165
|
-
selector: rule.selectorList.text,
|
|
166
|
-
source,
|
|
167
|
-
origin: rule.origin as StyleRule['origin'],
|
|
168
|
-
declarations: extractDeclarations(rule.style),
|
|
169
|
-
inheritedFrom: null,
|
|
170
|
-
})
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (matchedStyles.inherited) {
|
|
175
|
-
for (let i = 0; i < matchedStyles.inherited.length; i++) {
|
|
176
|
-
const inheritedEntry = matchedStyles.inherited[i] as InheritedStyleEntry
|
|
177
|
-
const ancestorDesc = `ancestor[${i + 1}]`
|
|
178
|
-
|
|
179
|
-
if (inheritedEntry.inlineStyle) {
|
|
180
|
-
const declarations = extractDeclarations(inheritedEntry.inlineStyle)
|
|
181
|
-
if (Object.keys(declarations).length > 0) {
|
|
182
|
-
rules.push({
|
|
183
|
-
selector: 'element.style',
|
|
184
|
-
source: null,
|
|
185
|
-
origin: 'regular',
|
|
186
|
-
declarations,
|
|
187
|
-
inheritedFrom: ancestorDesc,
|
|
188
|
-
})
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
for (const ruleMatch of inheritedEntry.matchedCSSRules) {
|
|
193
|
-
const rule = ruleMatch.rule
|
|
194
|
-
const sourceRange = (rule as any).selectorList?.range as SourceRange | undefined
|
|
195
|
-
const styleSheetId = rule.styleSheetId
|
|
196
|
-
|
|
197
|
-
let source: StyleSource | null = null
|
|
198
|
-
if (styleSheetId && sourceRange) {
|
|
199
|
-
source = {
|
|
200
|
-
url: await getStylesheetUrl(cdp, styleSheetId),
|
|
201
|
-
line: sourceRange.startLine + 1,
|
|
202
|
-
column: sourceRange.startColumn,
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const declarations = extractDeclarations(rule.style)
|
|
207
|
-
if (Object.keys(declarations).length > 0) {
|
|
208
|
-
rules.push({
|
|
209
|
-
selector: rule.selectorList.text,
|
|
210
|
-
source,
|
|
211
|
-
origin: rule.origin as StyleRule['origin'],
|
|
212
|
-
declarations,
|
|
213
|
-
inheritedFrom: ancestorDesc,
|
|
214
|
-
})
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
let inlineStyle: StyleDeclarations | null = null
|
|
221
|
-
if (matchedStyles.inlineStyle) {
|
|
222
|
-
const declarations = extractDeclarations(matchedStyles.inlineStyle as CSSStyle)
|
|
223
|
-
if (Object.keys(declarations).length > 0) {
|
|
224
|
-
inlineStyle = declarations
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const filteredRules = includeUserAgentStyles ? rules : rules.filter((r) => r.origin !== 'user-agent')
|
|
229
|
-
|
|
230
|
-
return {
|
|
231
|
-
element: elementDescription,
|
|
232
|
-
inlineStyle,
|
|
233
|
-
rules: filteredRules,
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function extractDeclarations(style: CSSStyle): StyleDeclarations {
|
|
238
|
-
if (!style?.cssProperties) {
|
|
239
|
-
return {}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const result: StyleDeclarations = {}
|
|
243
|
-
for (const prop of style.cssProperties) {
|
|
244
|
-
if (!prop.value || prop.value === 'initial' || prop.name.startsWith('-webkit-')) {
|
|
245
|
-
continue
|
|
246
|
-
}
|
|
247
|
-
const value = prop.important ? `${prop.value} !important` : prop.value
|
|
248
|
-
result[prop.name] = value
|
|
249
|
-
}
|
|
250
|
-
return result
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function formatElementDescription(node: any): string {
|
|
254
|
-
let desc = node.localName || node.nodeName?.toLowerCase() || 'element'
|
|
255
|
-
|
|
256
|
-
if (node.attributes) {
|
|
257
|
-
const attrs: Record<string, string> = {}
|
|
258
|
-
for (let i = 0; i < node.attributes.length; i += 2) {
|
|
259
|
-
attrs[node.attributes[i]] = node.attributes[i + 1]
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (attrs.id) {
|
|
263
|
-
desc += `#${attrs.id}`
|
|
264
|
-
}
|
|
265
|
-
if (attrs.class) {
|
|
266
|
-
desc += `.${attrs.class.split(' ').join('.')}`
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return desc
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
async function getStylesheetUrl(cdp: ICDPSession, styleSheetId: string): Promise<string> {
|
|
274
|
-
try {
|
|
275
|
-
await cdp.send('CSS.getStyleSheetText', { styleSheetId })
|
|
276
|
-
return `stylesheet:${styleSheetId}`
|
|
277
|
-
} catch {
|
|
278
|
-
return `stylesheet:${styleSheetId}`
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export function formatStylesAsText(styles: StylesResult): string {
|
|
283
|
-
const lines: string[] = []
|
|
284
|
-
|
|
285
|
-
lines.push(`Element: ${styles.element}`)
|
|
286
|
-
lines.push('')
|
|
287
|
-
|
|
288
|
-
if (styles.inlineStyle) {
|
|
289
|
-
lines.push('Inline styles:')
|
|
290
|
-
for (const [prop, value] of Object.entries(styles.inlineStyle)) {
|
|
291
|
-
lines.push(` ${prop}: ${value}`)
|
|
292
|
-
}
|
|
293
|
-
lines.push('')
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const directRules = styles.rules.filter((r) => !r.inheritedFrom)
|
|
297
|
-
const inheritedRules = styles.rules.filter((r) => r.inheritedFrom)
|
|
298
|
-
|
|
299
|
-
if (directRules.length > 0) {
|
|
300
|
-
lines.push('Matched rules:')
|
|
301
|
-
for (const rule of directRules) {
|
|
302
|
-
lines.push(` ${rule.selector} {`)
|
|
303
|
-
const sourceInfo = rule.source ? ` /* ${rule.source.url}:${rule.source.line}:${rule.source.column} */` : ''
|
|
304
|
-
if (sourceInfo) {
|
|
305
|
-
lines.push(` ${sourceInfo}`)
|
|
306
|
-
}
|
|
307
|
-
for (const [prop, value] of Object.entries(rule.declarations)) {
|
|
308
|
-
lines.push(` ${prop}: ${value};`)
|
|
309
|
-
}
|
|
310
|
-
lines.push(' }')
|
|
311
|
-
}
|
|
312
|
-
lines.push('')
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
if (inheritedRules.length > 0) {
|
|
316
|
-
const byAncestor = new Map<string, StyleRule[]>()
|
|
317
|
-
for (const rule of inheritedRules) {
|
|
318
|
-
const key = rule.inheritedFrom!
|
|
319
|
-
if (!byAncestor.has(key)) {
|
|
320
|
-
byAncestor.set(key, [])
|
|
321
|
-
}
|
|
322
|
-
byAncestor.get(key)!.push(rule)
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
for (const [ancestor, rules] of byAncestor) {
|
|
326
|
-
lines.push(`Inherited from ${ancestor}:`)
|
|
327
|
-
for (const rule of rules) {
|
|
328
|
-
lines.push(` ${rule.selector} {`)
|
|
329
|
-
const sourceInfo = rule.source ? ` /* ${rule.source.url}:${rule.source.line}:${rule.source.column} */` : ''
|
|
330
|
-
if (sourceInfo) {
|
|
331
|
-
lines.push(` ${sourceInfo}`)
|
|
332
|
-
}
|
|
333
|
-
for (const [prop, value] of Object.entries(rule.declarations)) {
|
|
334
|
-
lines.push(` ${prop}: ${value};`)
|
|
335
|
-
}
|
|
336
|
-
lines.push(' }')
|
|
337
|
-
}
|
|
338
|
-
lines.push('')
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
return lines.join('\n')
|
|
343
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { afterEach, describe, expect, test } from 'vitest'
|
|
4
|
-
import { getTabwrightAgentSkillStatus, installTabwrightAgentSkill } from './tabwright-agent-skill.js'
|
|
5
|
-
|
|
6
|
-
const tempDirs: string[] = []
|
|
7
|
-
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
tempDirs.splice(0).map((dir) => {
|
|
10
|
-
fs.rmSync(dir, { recursive: true, force: true })
|
|
11
|
-
return dir
|
|
12
|
-
})
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
function createFixture(): { bundledSkillPath: string; codexHome: string } {
|
|
16
|
-
const tmpRoot = path.resolve(process.cwd(), '..', 'tmp')
|
|
17
|
-
fs.mkdirSync(tmpRoot, { recursive: true })
|
|
18
|
-
const dir = fs.mkdtempSync(path.join(tmpRoot, 'tabwright-agent-skill-test-'))
|
|
19
|
-
tempDirs.push(dir)
|
|
20
|
-
const bundledSkillPath = path.join(dir, 'bundled', 'SKILL.md')
|
|
21
|
-
fs.mkdirSync(path.dirname(bundledSkillPath), { recursive: true })
|
|
22
|
-
fs.writeFileSync(bundledSkillPath, '---\nname: tabwright\ndescription: Test skill\n---\n\nUse Tabwright.\n')
|
|
23
|
-
return { bundledSkillPath, codexHome: path.join(dir, 'codex-home') }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
describe('Tabwright agent skill installation', () => {
|
|
27
|
-
test('installs the bundled skill and reports it current', () => {
|
|
28
|
-
const fixture = createFixture()
|
|
29
|
-
const missing = getTabwrightAgentSkillStatus(fixture)
|
|
30
|
-
expect(missing.state).toBe('missing')
|
|
31
|
-
expect(missing.installCommand).toBe('tabwright skill install --target codex')
|
|
32
|
-
|
|
33
|
-
const installed = installTabwrightAgentSkill(fixture)
|
|
34
|
-
expect(installed.fileStatus).toBe('created')
|
|
35
|
-
expect(installed.state).toBe('current')
|
|
36
|
-
expect(fs.readFileSync(installed.installedPath, 'utf-8')).toBe(
|
|
37
|
-
fs.readFileSync(fixture.bundledSkillPath, 'utf-8'),
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
const unchanged = installTabwrightAgentSkill(fixture)
|
|
41
|
-
expect(unchanged.fileStatus).toBe('unchanged')
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
test('requires force before replacing a different installed skill', () => {
|
|
45
|
-
const fixture = createFixture()
|
|
46
|
-
const installedPath = path.join(fixture.codexHome, 'skills', 'tabwright', 'SKILL.md')
|
|
47
|
-
fs.mkdirSync(path.dirname(installedPath), { recursive: true })
|
|
48
|
-
fs.writeFileSync(installedPath, 'locally edited skill\n')
|
|
49
|
-
|
|
50
|
-
const outdated = getTabwrightAgentSkillStatus(fixture)
|
|
51
|
-
expect(outdated.state).toBe('outdated')
|
|
52
|
-
expect(outdated.installCommand).toBe('tabwright skill install --target codex --force')
|
|
53
|
-
expect(() => {
|
|
54
|
-
installTabwrightAgentSkill(fixture)
|
|
55
|
-
}).toThrow(/Use --force to overwrite/)
|
|
56
|
-
|
|
57
|
-
const updated = installTabwrightAgentSkill({ ...fixture, overwrite: true })
|
|
58
|
-
expect(updated.fileStatus).toBe('updated')
|
|
59
|
-
expect(updated.state).toBe('current')
|
|
60
|
-
})
|
|
61
|
-
})
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import crypto from 'node:crypto'
|
|
2
|
-
import fs from 'node:fs'
|
|
3
|
-
import os from 'node:os'
|
|
4
|
-
import path from 'node:path'
|
|
5
|
-
import { getInstalledTabwrightPackageDir } from './package-paths.js'
|
|
6
|
-
|
|
7
|
-
export type TabwrightAgentSkillTarget = 'codex'
|
|
8
|
-
export type TabwrightAgentSkillState = 'missing' | 'current' | 'outdated'
|
|
9
|
-
|
|
10
|
-
export interface TabwrightAgentSkillStatus {
|
|
11
|
-
target: TabwrightAgentSkillTarget
|
|
12
|
-
state: TabwrightAgentSkillState
|
|
13
|
-
bundledPath: string
|
|
14
|
-
installedPath: string
|
|
15
|
-
bundledSha256: string
|
|
16
|
-
installedSha256?: string
|
|
17
|
-
installCommand: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface TabwrightAgentSkillInstallResult extends TabwrightAgentSkillStatus {
|
|
21
|
-
fileStatus: 'created' | 'updated' | 'unchanged'
|
|
22
|
-
next: string[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function getBundledTabwrightAgentSkillPath(options: { bundledSkillPath?: string } = {}): string {
|
|
26
|
-
if (options.bundledSkillPath) {
|
|
27
|
-
return options.bundledSkillPath
|
|
28
|
-
}
|
|
29
|
-
const packageDir = getInstalledTabwrightPackageDir()
|
|
30
|
-
const repositoryRoot = path.join(packageDir, '..')
|
|
31
|
-
const packagedSkillPath = path.join(packageDir, 'dist', 'agent-skills', 'tabwright', 'SKILL.md')
|
|
32
|
-
const repositorySkillPath = path.join(repositoryRoot, 'skills', 'tabwright', 'SKILL.md')
|
|
33
|
-
const candidates = fs.existsSync(path.join(repositoryRoot, '.git'))
|
|
34
|
-
? [repositorySkillPath, packagedSkillPath]
|
|
35
|
-
: [packagedSkillPath]
|
|
36
|
-
const bundledPath = candidates.find((candidate) => {
|
|
37
|
-
return fs.existsSync(candidate)
|
|
38
|
-
})
|
|
39
|
-
if (!bundledPath) {
|
|
40
|
-
throw new Error(`Bundled Tabwright skill not found under ${packageDir}. Rebuild or reinstall the CLI.`)
|
|
41
|
-
}
|
|
42
|
-
return bundledPath
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function getTabwrightAgentSkillStatus(options: {
|
|
46
|
-
target?: TabwrightAgentSkillTarget
|
|
47
|
-
codexHome?: string
|
|
48
|
-
bundledSkillPath?: string
|
|
49
|
-
} = {}): TabwrightAgentSkillStatus {
|
|
50
|
-
const target = options.target || 'codex'
|
|
51
|
-
const bundledPath = getBundledTabwrightAgentSkillPath({ bundledSkillPath: options.bundledSkillPath })
|
|
52
|
-
const installedPath = path.join(getCodexHome(options.codexHome), 'skills', 'tabwright', 'SKILL.md')
|
|
53
|
-
const bundledContent = fs.readFileSync(bundledPath, 'utf-8')
|
|
54
|
-
const installedContent = fs.existsSync(installedPath) ? fs.readFileSync(installedPath, 'utf-8') : undefined
|
|
55
|
-
const state: TabwrightAgentSkillState = (() => {
|
|
56
|
-
if (installedContent === undefined) {
|
|
57
|
-
return 'missing'
|
|
58
|
-
}
|
|
59
|
-
return installedContent === bundledContent ? 'current' : 'outdated'
|
|
60
|
-
})()
|
|
61
|
-
return {
|
|
62
|
-
target,
|
|
63
|
-
state,
|
|
64
|
-
bundledPath,
|
|
65
|
-
installedPath,
|
|
66
|
-
bundledSha256: sha256(bundledContent),
|
|
67
|
-
...(installedContent === undefined ? {} : { installedSha256: sha256(installedContent) }),
|
|
68
|
-
installCommand: `tabwright skill install --target ${target}${state === 'outdated' ? ' --force' : ''}`,
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function installTabwrightAgentSkill(options: {
|
|
73
|
-
target?: TabwrightAgentSkillTarget
|
|
74
|
-
codexHome?: string
|
|
75
|
-
bundledSkillPath?: string
|
|
76
|
-
overwrite?: boolean
|
|
77
|
-
} = {}): TabwrightAgentSkillInstallResult {
|
|
78
|
-
const before = getTabwrightAgentSkillStatus(options)
|
|
79
|
-
if (before.state === 'current') {
|
|
80
|
-
return {
|
|
81
|
-
...before,
|
|
82
|
-
fileStatus: 'unchanged',
|
|
83
|
-
next: ['Restart or open a new Codex thread so it can load the Tabwright skill.'],
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (before.state === 'outdated' && !options.overwrite) {
|
|
87
|
-
throw new Error(`Installed Tabwright skill differs from this CLI: ${before.installedPath}. Use --force to overwrite.`)
|
|
88
|
-
}
|
|
89
|
-
fs.mkdirSync(path.dirname(before.installedPath), { recursive: true })
|
|
90
|
-
fs.copyFileSync(before.bundledPath, before.installedPath)
|
|
91
|
-
const after = getTabwrightAgentSkillStatus(options)
|
|
92
|
-
return {
|
|
93
|
-
...after,
|
|
94
|
-
fileStatus: before.state === 'missing' ? 'created' : 'updated',
|
|
95
|
-
next: ['Restart or open a new Codex thread so it can load the Tabwright skill.'],
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function getCodexHome(codexHome?: string): string {
|
|
100
|
-
return path.resolve(codexHome || process.env.CODEX_HOME || path.join(os.homedir(), '.codex'))
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function sha256(content: string): string {
|
|
104
|
-
return crypto.createHash('sha256').update(content).digest('hex')
|
|
105
|
-
}
|
package/src/test-declarations.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ExtensionState } from 'mcp-extension/src/types.js'
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
var toggleExtensionForActiveTab: () => Promise<{ isConnected: boolean; state: ExtensionState }>
|
|
5
|
-
var getExtensionState: () => ExtensionState
|
|
6
|
-
var disconnectEverything: () => Promise<void>
|
|
7
|
-
|
|
8
|
-
// Browser globals used in evaluate() calls
|
|
9
|
-
var window: any
|
|
10
|
-
var document: any
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {}
|
package/src/test-utils.test.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { describe, expect, test } from 'vitest'
|
|
4
|
-
import { startTabwrightCDPRelayServer } from './cdp-relay.js'
|
|
5
|
-
import {
|
|
6
|
-
getExtensionServiceWorker,
|
|
7
|
-
getLegacyExtensionLaunchArgs,
|
|
8
|
-
isExtensionLoadUnavailableError,
|
|
9
|
-
launchPersistentContextWithExtensions,
|
|
10
|
-
} from './test-utils.js'
|
|
11
|
-
|
|
12
|
-
describe('extension test browser launch', () => {
|
|
13
|
-
test('builds the legacy extension launch fallback flags', () => {
|
|
14
|
-
const extensionPaths = ['./extension-one', './extension-two']
|
|
15
|
-
const args = getLegacyExtensionLaunchArgs({ extensionPaths })
|
|
16
|
-
const resolvedPaths = extensionPaths.map((extensionPath) => {
|
|
17
|
-
return path.resolve(extensionPath)
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
expect(args).toContain(`--disable-extensions-except=${resolvedPaths.join(',')}`)
|
|
21
|
-
expect(args).toContain(`--load-extension=${resolvedPaths.join(',')}`)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test('recognizes older browsers without Extensions.loadUnpacked', () => {
|
|
25
|
-
expect(
|
|
26
|
-
isExtensionLoadUnavailableError(
|
|
27
|
-
new Error("Protocol error (Extensions.loadUnpacked): 'Extensions.loadUnpacked' wasn't found"),
|
|
28
|
-
),
|
|
29
|
-
).toBe(true)
|
|
30
|
-
expect(isExtensionLoadUnavailableError(new Error('Method not found'))).toBe(true)
|
|
31
|
-
expect(isExtensionLoadUnavailableError(new Error('Manifest is invalid'))).toBe(false)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
test.runIf(Boolean(process.env.PLAYWRITER_TEST_EXTENSION_PATH))(
|
|
35
|
-
'loads an unpacked extension in the installed Chrome build',
|
|
36
|
-
async () => {
|
|
37
|
-
const extensionPath = process.env.PLAYWRITER_TEST_EXTENSION_PATH
|
|
38
|
-
if (!extensionPath) {
|
|
39
|
-
throw new Error('PLAYWRITER_TEST_EXTENSION_PATH is required')
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const tempRoot = path.join(process.cwd(), 'tmp')
|
|
43
|
-
fs.mkdirSync(tempRoot, { recursive: true })
|
|
44
|
-
const userDataDir = fs.mkdtempSync(path.join(tempRoot, 'pw-extension-load-test-'))
|
|
45
|
-
const relayServer = await startTabwrightCDPRelayServer({
|
|
46
|
-
port: Number(process.env.PLAYWRITER_TEST_RELAY_PORT) || 19_997,
|
|
47
|
-
})
|
|
48
|
-
try {
|
|
49
|
-
const browserContext = await launchPersistentContextWithExtensions({
|
|
50
|
-
userDataDir,
|
|
51
|
-
extensionPaths: [extensionPath],
|
|
52
|
-
})
|
|
53
|
-
try {
|
|
54
|
-
const serviceWorker = await getExtensionServiceWorker(browserContext).catch(async (error: unknown) => {
|
|
55
|
-
const session = await browserContext.browser()?.newBrowserCDPSession()
|
|
56
|
-
const targets = session ? await session.send('Target.getTargets') : null
|
|
57
|
-
throw new Error(`No extension service worker target was visible: ${JSON.stringify(targets)}`, { cause: error })
|
|
58
|
-
})
|
|
59
|
-
expect(serviceWorker.url()).toMatch(/^chrome-extension:\/\//)
|
|
60
|
-
} finally {
|
|
61
|
-
await browserContext.close()
|
|
62
|
-
}
|
|
63
|
-
} finally {
|
|
64
|
-
relayServer.close()
|
|
65
|
-
fs.rmSync(userDataDir, { recursive: true, force: true })
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
60_000,
|
|
69
|
-
)
|
|
70
|
-
})
|