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
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import os from 'node:os'
|
|
3
|
-
import path from 'node:path'
|
|
4
|
-
import { requireCapability, type CapabilityRecord } from './capability-registry.js'
|
|
5
|
-
|
|
6
|
-
export type AgentSkillTarget = 'codex'
|
|
7
|
-
export type AgentSkillFileStatus = 'created' | 'updated' | 'unchanged'
|
|
8
|
-
|
|
9
|
-
export interface AgentSkillFileResult {
|
|
10
|
-
relativePath: string
|
|
11
|
-
path: string
|
|
12
|
-
status: AgentSkillFileStatus
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface CapabilityAgentSkillResult {
|
|
16
|
-
target: AgentSkillTarget
|
|
17
|
-
capabilityId: string
|
|
18
|
-
dir: string
|
|
19
|
-
files: AgentSkillFileResult[]
|
|
20
|
-
next: string[]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface CapabilityAgentSkillShowResult {
|
|
24
|
-
target: AgentSkillTarget
|
|
25
|
-
capabilityId: string
|
|
26
|
-
dir: string
|
|
27
|
-
files: Array<{
|
|
28
|
-
relativePath: string
|
|
29
|
-
path: string
|
|
30
|
-
content: string
|
|
31
|
-
}>
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface CapabilityAgentSkillStatus {
|
|
35
|
-
target: AgentSkillTarget
|
|
36
|
-
draftExists: boolean
|
|
37
|
-
draftPath: string
|
|
38
|
-
installedExists: boolean
|
|
39
|
-
installedPath: string
|
|
40
|
-
initCommand: string
|
|
41
|
-
showCommand: string
|
|
42
|
-
installCommand: string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const SKILL_TEMPLATE_MARKER = '<!-- TABWRIGHT_AGENT_SKILL_TEMPLATE: edit before install -->'
|
|
46
|
-
|
|
47
|
-
export function initCapabilityAgentSkill(options: {
|
|
48
|
-
id: string
|
|
49
|
-
cwd?: string
|
|
50
|
-
target?: AgentSkillTarget
|
|
51
|
-
overwrite?: boolean
|
|
52
|
-
}): CapabilityAgentSkillResult {
|
|
53
|
-
const target = options.target || 'codex'
|
|
54
|
-
const capability = requireCapability({ id: options.id, cwd: options.cwd })
|
|
55
|
-
const dir = getCapabilityAgentSkillDir({ capability, target })
|
|
56
|
-
const files = [
|
|
57
|
-
writeSkillFile({
|
|
58
|
-
filePath: path.join(dir, 'SKILL.md'),
|
|
59
|
-
relativePath: 'SKILL.md',
|
|
60
|
-
content: buildCodexSkillTemplate(capability),
|
|
61
|
-
overwrite: options.overwrite,
|
|
62
|
-
}),
|
|
63
|
-
writeSkillFile({
|
|
64
|
-
filePath: path.join(dir, 'agents', 'openai.yaml'),
|
|
65
|
-
relativePath: 'agents/openai.yaml',
|
|
66
|
-
content: buildOpenAiAgentTemplate(capability),
|
|
67
|
-
overwrite: options.overwrite,
|
|
68
|
-
}),
|
|
69
|
-
]
|
|
70
|
-
return {
|
|
71
|
-
target,
|
|
72
|
-
capabilityId: capability.manifest.id,
|
|
73
|
-
dir,
|
|
74
|
-
files,
|
|
75
|
-
next: [
|
|
76
|
-
`Edit ${path.join(dir, 'SKILL.md')} with the real usage workflow and display rules.`,
|
|
77
|
-
`tabwright capability skill install ${capability.manifest.id}`,
|
|
78
|
-
],
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function installCapabilityAgentSkill(options: {
|
|
83
|
-
id: string
|
|
84
|
-
cwd?: string
|
|
85
|
-
target?: AgentSkillTarget
|
|
86
|
-
overwrite?: boolean
|
|
87
|
-
codexHome?: string
|
|
88
|
-
capability?: CapabilityRecord
|
|
89
|
-
}): CapabilityAgentSkillResult {
|
|
90
|
-
const target = options.target || 'codex'
|
|
91
|
-
const capability = options.capability || requireCapability({ id: options.id, cwd: options.cwd })
|
|
92
|
-
const dir = getCapabilityAgentSkillDir({ capability, target })
|
|
93
|
-
const skillPath = path.join(dir, 'SKILL.md')
|
|
94
|
-
if (!fs.existsSync(skillPath)) {
|
|
95
|
-
throw new Error(`Agent skill draft not found for ${capability.manifest.id}. Run: tabwright capability skill init ${capability.manifest.id}`)
|
|
96
|
-
}
|
|
97
|
-
const skillContent = fs.readFileSync(skillPath, 'utf-8')
|
|
98
|
-
assertSkillReadyToInstall({ capability, content: skillContent, filePath: skillPath })
|
|
99
|
-
const sourceFiles = getExistingAgentSkillFiles(dir)
|
|
100
|
-
const codexSkillDir = path.join(getCodexHome(options.codexHome), 'skills', capability.manifest.id)
|
|
101
|
-
const files = sourceFiles.map((file) => {
|
|
102
|
-
return writeSkillFile({
|
|
103
|
-
filePath: path.join(codexSkillDir, ...file.relativePath.split('/')),
|
|
104
|
-
relativePath: file.relativePath,
|
|
105
|
-
content: fs.readFileSync(file.path, 'utf-8'),
|
|
106
|
-
overwrite: options.overwrite,
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
return {
|
|
110
|
-
target,
|
|
111
|
-
capabilityId: capability.manifest.id,
|
|
112
|
-
dir: codexSkillDir,
|
|
113
|
-
files,
|
|
114
|
-
next: [`Restart or open a new agent thread so it can load the ${capability.manifest.id} skill.`],
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function showCapabilityAgentSkill(options: {
|
|
119
|
-
id: string
|
|
120
|
-
cwd?: string
|
|
121
|
-
target?: AgentSkillTarget
|
|
122
|
-
}): CapabilityAgentSkillShowResult {
|
|
123
|
-
const target = options.target || 'codex'
|
|
124
|
-
const capability = requireCapability({ id: options.id, cwd: options.cwd })
|
|
125
|
-
const dir = getCapabilityAgentSkillDir({ capability, target })
|
|
126
|
-
const files = getExistingAgentSkillFiles(dir).map((file) => {
|
|
127
|
-
return {
|
|
128
|
-
relativePath: file.relativePath,
|
|
129
|
-
path: file.path,
|
|
130
|
-
content: fs.readFileSync(file.path, 'utf-8'),
|
|
131
|
-
}
|
|
132
|
-
})
|
|
133
|
-
if (!files.some((file) => {
|
|
134
|
-
return file.relativePath === 'SKILL.md'
|
|
135
|
-
})) {
|
|
136
|
-
throw new Error(`Agent skill draft not found for ${capability.manifest.id}. Run: tabwright capability skill init ${capability.manifest.id}`)
|
|
137
|
-
}
|
|
138
|
-
return {
|
|
139
|
-
target,
|
|
140
|
-
capabilityId: capability.manifest.id,
|
|
141
|
-
dir,
|
|
142
|
-
files,
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export function getCapabilityAgentSkillStatus(options: {
|
|
147
|
-
capability: CapabilityRecord
|
|
148
|
-
target?: AgentSkillTarget
|
|
149
|
-
codexHome?: string
|
|
150
|
-
}): CapabilityAgentSkillStatus {
|
|
151
|
-
const target = options.target || 'codex'
|
|
152
|
-
const draftDir = getCapabilityAgentSkillDir({ capability: options.capability, target })
|
|
153
|
-
const installedDir = path.join(getCodexHome(options.codexHome), 'skills', options.capability.manifest.id)
|
|
154
|
-
return {
|
|
155
|
-
target,
|
|
156
|
-
draftExists: fs.existsSync(path.join(draftDir, 'SKILL.md')),
|
|
157
|
-
draftPath: path.join(draftDir, 'SKILL.md'),
|
|
158
|
-
installedExists: fs.existsSync(path.join(installedDir, 'SKILL.md')),
|
|
159
|
-
installedPath: path.join(installedDir, 'SKILL.md'),
|
|
160
|
-
initCommand: `tabwright capability skill init ${options.capability.manifest.id}`,
|
|
161
|
-
showCommand: `tabwright capability skill show ${options.capability.manifest.id}`,
|
|
162
|
-
installCommand: `tabwright capability skill install ${options.capability.manifest.id}`,
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function getCapabilityAgentSkillDir(options: { capability: CapabilityRecord; target: AgentSkillTarget }): string {
|
|
167
|
-
return path.join(options.capability.dir, 'agent-skills', options.target)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function getCodexHome(codexHome?: string): string {
|
|
171
|
-
return codexHome || process.env.CODEX_HOME || path.join(os.homedir(), '.codex')
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function getExistingAgentSkillFiles(dir: string): Array<{ relativePath: string; path: string }> {
|
|
175
|
-
const skillPath = path.join(dir, 'SKILL.md')
|
|
176
|
-
const openAiPath = path.join(dir, 'agents', 'openai.yaml')
|
|
177
|
-
const files: Array<{ relativePath: string; path: string }> = []
|
|
178
|
-
if (fs.existsSync(skillPath)) {
|
|
179
|
-
files.push({ relativePath: 'SKILL.md', path: skillPath })
|
|
180
|
-
}
|
|
181
|
-
if (fs.existsSync(openAiPath)) {
|
|
182
|
-
files.push({ relativePath: 'agents/openai.yaml', path: openAiPath })
|
|
183
|
-
}
|
|
184
|
-
return files
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function writeSkillFile(options: {
|
|
188
|
-
filePath: string
|
|
189
|
-
relativePath: string
|
|
190
|
-
content: string
|
|
191
|
-
overwrite?: boolean
|
|
192
|
-
}): AgentSkillFileResult {
|
|
193
|
-
if (fs.existsSync(options.filePath)) {
|
|
194
|
-
const existing = fs.readFileSync(options.filePath, 'utf-8')
|
|
195
|
-
if (existing === options.content) {
|
|
196
|
-
return { relativePath: options.relativePath, path: options.filePath, status: 'unchanged' }
|
|
197
|
-
}
|
|
198
|
-
if (!options.overwrite) {
|
|
199
|
-
throw new Error(`Agent skill file already exists with different content: ${options.filePath}. Use --force to overwrite.`)
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
fs.mkdirSync(path.dirname(options.filePath), { recursive: true })
|
|
203
|
-
const status = fs.existsSync(options.filePath) ? 'updated' : 'created'
|
|
204
|
-
fs.writeFileSync(options.filePath, options.content)
|
|
205
|
-
return { relativePath: options.relativePath, path: options.filePath, status }
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function assertSkillReadyToInstall(options: {
|
|
209
|
-
capability: CapabilityRecord
|
|
210
|
-
content: string
|
|
211
|
-
filePath: string
|
|
212
|
-
}): void {
|
|
213
|
-
if (options.content.includes(SKILL_TEMPLATE_MARKER)) {
|
|
214
|
-
throw new Error(`Agent skill still contains the scaffold marker: ${options.filePath}. Edit the skill content before installing it.`)
|
|
215
|
-
}
|
|
216
|
-
if (!options.content.includes(`name: ${options.capability.manifest.id}`)) {
|
|
217
|
-
throw new Error(`Agent skill frontmatter must include name: ${options.capability.manifest.id}`)
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function buildCodexSkillTemplate(capability: CapabilityRecord): string {
|
|
222
|
-
const operationIds = Object.keys(capability.manifest.operations)
|
|
223
|
-
const hasOperations = operationIds.length > 0
|
|
224
|
-
const requiresConfirmation = hasOperations
|
|
225
|
-
? Object.values(capability.manifest.operations).some((operation) => {
|
|
226
|
-
return operation.requiresConfirmation
|
|
227
|
-
})
|
|
228
|
-
: capability.manifest.requiresConfirmation
|
|
229
|
-
const description = [
|
|
230
|
-
`TODO: Explain when agents should use the ${capability.manifest.id} Tabwright capability.`,
|
|
231
|
-
'Mention concrete user phrasing, exact-match signals, and when not to use it.',
|
|
232
|
-
].join(' ')
|
|
233
|
-
const routeCommand = `tabwright capability route "<user-task-or-url>" --json`
|
|
234
|
-
const runCommand = [
|
|
235
|
-
'tabwright capability run',
|
|
236
|
-
capability.manifest.id,
|
|
237
|
-
capability.manifest.runtime === 'browser' ? '--browser user' : '',
|
|
238
|
-
"--input-json '<json-input>'",
|
|
239
|
-
'--json',
|
|
240
|
-
capability.manifest.status === 'trusted' ? '' : '--force',
|
|
241
|
-
requiresConfirmation
|
|
242
|
-
? hasOperations
|
|
243
|
-
? '--confirm <confirmation-token>'
|
|
244
|
-
: `--confirm ${capability.manifest.id}`
|
|
245
|
-
: '',
|
|
246
|
-
]
|
|
247
|
-
.filter((part) => {
|
|
248
|
-
return part.length > 0
|
|
249
|
-
})
|
|
250
|
-
.join(' ')
|
|
251
|
-
return [
|
|
252
|
-
'---',
|
|
253
|
-
`name: ${capability.manifest.id}`,
|
|
254
|
-
`description: ${quoteYamlString(description)}`,
|
|
255
|
-
'---',
|
|
256
|
-
'',
|
|
257
|
-
SKILL_TEMPLATE_MARKER,
|
|
258
|
-
'',
|
|
259
|
-
'## When To Use',
|
|
260
|
-
'',
|
|
261
|
-
'- TODO: Describe the concrete user intent, URL pattern, page state, or data shape that should trigger this capability.',
|
|
262
|
-
'- TODO: State when this capability should not be used.',
|
|
263
|
-
'',
|
|
264
|
-
'## Workflow',
|
|
265
|
-
'',
|
|
266
|
-
'1. Use route when exact-match metadata may apply:',
|
|
267
|
-
'',
|
|
268
|
-
'```bash',
|
|
269
|
-
routeCommand,
|
|
270
|
-
'```',
|
|
271
|
-
'',
|
|
272
|
-
requiresConfirmation
|
|
273
|
-
? hasOperations
|
|
274
|
-
? `2. Select one operation (${operationIds.join(', ')}). Read operations may run directly; for a confirmation-required operation, stop for approval and use its exact confirmationToken:`
|
|
275
|
-
: '2. Stop and obtain explicit user approval for the concrete input and side effect. Only then run with structured input:'
|
|
276
|
-
: '2. Run the returned `shellCommand` exactly, or run the capability with structured input:',
|
|
277
|
-
'',
|
|
278
|
-
'```bash',
|
|
279
|
-
runCommand,
|
|
280
|
-
'```',
|
|
281
|
-
'',
|
|
282
|
-
'3. If the capability requires browser/session/auth state, describe the required refresh or browser command.',
|
|
283
|
-
'',
|
|
284
|
-
'## Output And Display',
|
|
285
|
-
'',
|
|
286
|
-
'- TODO: Define the default answer shape.',
|
|
287
|
-
'- TODO: Say when to show a short summary versus when to point to artifacts.',
|
|
288
|
-
'- TODO: Say whether large outputs should be saved, filtered, or exported only on request.',
|
|
289
|
-
'',
|
|
290
|
-
].join('\n')
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function buildOpenAiAgentTemplate(capability: CapabilityRecord): string {
|
|
294
|
-
return [
|
|
295
|
-
'interface:',
|
|
296
|
-
` display_name: ${quoteYamlString(capability.manifest.title)}`,
|
|
297
|
-
` short_description: ${quoteYamlString(capability.manifest.description || capability.manifest.title)}`,
|
|
298
|
-
` default_prompt: ${quoteYamlString(`Use ${capability.manifest.id} for <task>`)}`,
|
|
299
|
-
'',
|
|
300
|
-
].join('\n')
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function quoteYamlString(value: string): string {
|
|
304
|
-
return JSON.stringify(value)
|
|
305
|
-
}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import {
|
|
4
|
-
readCapabilityRuns,
|
|
5
|
-
readCapabilitySecrets,
|
|
6
|
-
type CapabilityAuthType,
|
|
7
|
-
type CapabilityRecord,
|
|
8
|
-
} from './capability-registry.js'
|
|
9
|
-
|
|
10
|
-
const AUTH_STATE_FILENAME = 'auth-state.json'
|
|
11
|
-
const EXPIRING_WINDOW_MS = 24 * 60 * 60 * 1000
|
|
12
|
-
|
|
13
|
-
export type CapabilityAuthStatus = 'not-required' | 'missing' | 'authenticated' | 'expiring' | 'expired' | 'unknown'
|
|
14
|
-
|
|
15
|
-
export interface StoredCapabilityAuthState {
|
|
16
|
-
schemaVersion: 1
|
|
17
|
-
refreshedAt: string
|
|
18
|
-
expiresAt?: string
|
|
19
|
-
cookieNames: string[]
|
|
20
|
-
browserKey?: string
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface CapabilityAuthState {
|
|
24
|
-
type: CapabilityAuthType
|
|
25
|
-
status: CapabilityAuthStatus
|
|
26
|
-
canRefresh: boolean
|
|
27
|
-
browserUrls: string[]
|
|
28
|
-
requiredCookieNames: string[]
|
|
29
|
-
cookieNames: string[]
|
|
30
|
-
refreshedAt?: string
|
|
31
|
-
expiresAt?: string
|
|
32
|
-
browserKey?: string
|
|
33
|
-
reason?: string
|
|
34
|
-
refreshCommand?: string
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function writeStoredCapabilityAuthState(options: {
|
|
38
|
-
capability: CapabilityRecord
|
|
39
|
-
state: StoredCapabilityAuthState
|
|
40
|
-
}): string {
|
|
41
|
-
const statePath = path.join(options.capability.dir, AUTH_STATE_FILENAME)
|
|
42
|
-
fs.mkdirSync(options.capability.dir, { recursive: true })
|
|
43
|
-
fs.writeFileSync(statePath, `${JSON.stringify(options.state, null, 2)}\n`, { mode: 0o600 })
|
|
44
|
-
if (process.platform !== 'win32') {
|
|
45
|
-
fs.chmodSync(statePath, 0o600)
|
|
46
|
-
}
|
|
47
|
-
return statePath
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function removeCapabilityAuthFiles(options: { capabilityDir: string }): void {
|
|
51
|
-
const filenames: string[] = ['secrets.json', AUTH_STATE_FILENAME]
|
|
52
|
-
filenames.map((filename) => {
|
|
53
|
-
fs.rmSync(path.join(options.capabilityDir, filename), { force: true })
|
|
54
|
-
return filename
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function getCapabilityAuthState(options: { capability: CapabilityRecord; now?: Date }): CapabilityAuthState {
|
|
59
|
-
const auth = options.capability.manifest.auth
|
|
60
|
-
const canRefresh = auth.type === 'cookie' && auth.refresh === 'from-browser' && auth.browserUrls.length > 0
|
|
61
|
-
const refreshCommand = canRefresh
|
|
62
|
-
? `tabwright capability refresh-auth ${options.capability.manifest.id} --browser user --json`
|
|
63
|
-
: undefined
|
|
64
|
-
const base = {
|
|
65
|
-
type: auth.type,
|
|
66
|
-
canRefresh,
|
|
67
|
-
browserUrls: auth.browserUrls,
|
|
68
|
-
requiredCookieNames: auth.requiredCookieNames,
|
|
69
|
-
refreshCommand,
|
|
70
|
-
}
|
|
71
|
-
if (auth.type === 'none') {
|
|
72
|
-
return { ...base, status: 'not-required', cookieNames: [] }
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const secretKey = auth.secretKey || 'cookieHeader'
|
|
76
|
-
const secrets = (() => {
|
|
77
|
-
try {
|
|
78
|
-
return readCapabilitySecrets({ capability: options.capability })
|
|
79
|
-
} catch {
|
|
80
|
-
return {}
|
|
81
|
-
}
|
|
82
|
-
})()
|
|
83
|
-
if (typeof secrets[secretKey] !== 'string' || secrets[secretKey].length === 0) {
|
|
84
|
-
return {
|
|
85
|
-
...base,
|
|
86
|
-
status: 'missing',
|
|
87
|
-
cookieNames: [],
|
|
88
|
-
reason: 'No saved authentication is available on this device.',
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const stored = readStoredCapabilityAuthState({ capability: options.capability })
|
|
93
|
-
if (!stored) {
|
|
94
|
-
return {
|
|
95
|
-
...base,
|
|
96
|
-
status: 'unknown',
|
|
97
|
-
cookieNames: [],
|
|
98
|
-
reason: 'Saved authentication predates status tracking. Refresh it to inspect expiry.',
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const runFailure = latestAuthFailure({ capability: options.capability, refreshedAt: stored.refreshedAt })
|
|
103
|
-
if (runFailure) {
|
|
104
|
-
return {
|
|
105
|
-
...base,
|
|
106
|
-
...stored,
|
|
107
|
-
status: 'expired',
|
|
108
|
-
reason: runFailure,
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Cookie timestamps cover client-side expiry; failure signals cover sessions revoked earlier by the server.
|
|
113
|
-
const now = options.now || new Date()
|
|
114
|
-
const expiresAt = stored.expiresAt ? Date.parse(stored.expiresAt) : Number.NaN
|
|
115
|
-
if (!Number.isNaN(expiresAt) && expiresAt <= now.getTime()) {
|
|
116
|
-
return {
|
|
117
|
-
...base,
|
|
118
|
-
...stored,
|
|
119
|
-
status: 'expired',
|
|
120
|
-
reason: 'The saved browser cookies have expired.',
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (!Number.isNaN(expiresAt) && expiresAt - now.getTime() <= EXPIRING_WINDOW_MS) {
|
|
124
|
-
return {
|
|
125
|
-
...base,
|
|
126
|
-
...stored,
|
|
127
|
-
status: 'expiring',
|
|
128
|
-
reason: 'The saved browser cookies expire within 24 hours.',
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return { ...base, ...stored, status: 'authenticated' }
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function readStoredCapabilityAuthState(options: { capability: CapabilityRecord }): StoredCapabilityAuthState | null {
|
|
135
|
-
const statePath = path.join(options.capability.dir, AUTH_STATE_FILENAME)
|
|
136
|
-
if (!fs.existsSync(statePath)) {
|
|
137
|
-
return null
|
|
138
|
-
}
|
|
139
|
-
const parsed: unknown = (() => {
|
|
140
|
-
try {
|
|
141
|
-
return JSON.parse(fs.readFileSync(statePath, 'utf-8'))
|
|
142
|
-
} catch {
|
|
143
|
-
return null
|
|
144
|
-
}
|
|
145
|
-
})()
|
|
146
|
-
if (!isRecord(parsed) || parsed.schemaVersion !== 1 || typeof parsed.refreshedAt !== 'string') {
|
|
147
|
-
return null
|
|
148
|
-
}
|
|
149
|
-
const cookieNames = Array.isArray(parsed.cookieNames)
|
|
150
|
-
? parsed.cookieNames.filter((value): value is string => {
|
|
151
|
-
return typeof value === 'string'
|
|
152
|
-
})
|
|
153
|
-
: []
|
|
154
|
-
return {
|
|
155
|
-
schemaVersion: 1,
|
|
156
|
-
refreshedAt: parsed.refreshedAt,
|
|
157
|
-
expiresAt: typeof parsed.expiresAt === 'string' ? parsed.expiresAt : undefined,
|
|
158
|
-
cookieNames,
|
|
159
|
-
browserKey: typeof parsed.browserKey === 'string' ? parsed.browserKey : undefined,
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function latestAuthFailure(options: { capability: CapabilityRecord; refreshedAt: string }): string | null {
|
|
164
|
-
const refreshedAt = Date.parse(options.refreshedAt)
|
|
165
|
-
const relevantRun = readCapabilityRuns({ capability: options.capability, limit: 50 })
|
|
166
|
-
.filter((run) => {
|
|
167
|
-
return Number.isNaN(refreshedAt) || Date.parse(run.createdAt) >= refreshedAt
|
|
168
|
-
})
|
|
169
|
-
.reverse()
|
|
170
|
-
.find((run) => {
|
|
171
|
-
if (run.status === 'success') {
|
|
172
|
-
return true
|
|
173
|
-
}
|
|
174
|
-
if (!run.error) {
|
|
175
|
-
return false
|
|
176
|
-
}
|
|
177
|
-
const normalizedError = run.error.toLowerCase()
|
|
178
|
-
return options.capability.manifest.auth.failureSignals.some((signal) => {
|
|
179
|
-
return normalizedError.includes(signal.toLowerCase())
|
|
180
|
-
})
|
|
181
|
-
})
|
|
182
|
-
if (!relevantRun || relevantRun.status === 'success' || !relevantRun.error) {
|
|
183
|
-
return null
|
|
184
|
-
}
|
|
185
|
-
const normalizedError = relevantRun.error.toLowerCase()
|
|
186
|
-
const matchedSignal = options.capability.manifest.auth.failureSignals.find((signal) => {
|
|
187
|
-
return normalizedError.includes(signal.toLowerCase())
|
|
188
|
-
})
|
|
189
|
-
if (!matchedSignal) {
|
|
190
|
-
return null
|
|
191
|
-
}
|
|
192
|
-
return `The latest run reported an authentication failure: ${matchedSignal}`
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
196
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
197
|
-
}
|