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/capability-auth.ts
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
|
-
import {
|
|
3
|
-
readCapabilitySecrets,
|
|
4
|
-
requireCapability,
|
|
5
|
-
writeCapabilitySecrets,
|
|
6
|
-
type CapabilityRecord,
|
|
7
|
-
} from './capability-registry.js'
|
|
8
|
-
import { writeStoredCapabilityAuthState } from './capability-auth-state.js'
|
|
9
|
-
import type { ExecuteResult } from './executor.js'
|
|
10
|
-
|
|
11
|
-
export interface CapabilityAuthExecutor {
|
|
12
|
-
execute(
|
|
13
|
-
code: string,
|
|
14
|
-
timeout?: number,
|
|
15
|
-
options?: { includeStructuredResult?: boolean },
|
|
16
|
-
): Promise<ExecuteResult>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface CapabilityAuthRefreshResult {
|
|
20
|
-
capability: CapabilityRecord
|
|
21
|
-
saved: boolean
|
|
22
|
-
secretKey: string
|
|
23
|
-
cookieCount: number
|
|
24
|
-
cookieNames: string[]
|
|
25
|
-
urls: string[]
|
|
26
|
-
expiresAt?: string
|
|
27
|
-
path: string
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface CapabilityAuthCookie {
|
|
31
|
-
name: string
|
|
32
|
-
value: string
|
|
33
|
-
expires?: number
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export async function refreshCapabilityAuthWithExecutor(options: {
|
|
37
|
-
executor: CapabilityAuthExecutor
|
|
38
|
-
id: string
|
|
39
|
-
cwd?: string
|
|
40
|
-
timeout?: number
|
|
41
|
-
browserKey?: string
|
|
42
|
-
}): Promise<CapabilityAuthRefreshResult> {
|
|
43
|
-
const capability = requireCapability({ id: options.id, cwd: options.cwd })
|
|
44
|
-
if (capability.manifest.auth.type !== 'cookie' || capability.manifest.auth.refresh !== 'from-browser') {
|
|
45
|
-
throw new Error(`Capability ${options.id} does not declare browser-refreshable cookie auth`)
|
|
46
|
-
}
|
|
47
|
-
if (capability.manifest.auth.browserUrls.length === 0) {
|
|
48
|
-
throw new Error(`Capability ${options.id} auth.browserUrls is required for cookie refresh`)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const executeResult = await options.executor.execute(buildCookieRefreshCode({ capability }), options.timeout || 10000, {
|
|
52
|
-
includeStructuredResult: true,
|
|
53
|
-
})
|
|
54
|
-
if (executeResult.isError) {
|
|
55
|
-
throw new Error(`Failed to refresh capability auth: ${executeResult.text}`)
|
|
56
|
-
}
|
|
57
|
-
const parsed = parseRefreshResult(executeResult.structuredResult)
|
|
58
|
-
writeStoredCapabilityAuthState({
|
|
59
|
-
capability,
|
|
60
|
-
state: {
|
|
61
|
-
schemaVersion: 1,
|
|
62
|
-
refreshedAt: new Date().toISOString(),
|
|
63
|
-
expiresAt: parsed.expiresAt,
|
|
64
|
-
cookieNames: parsed.cookieNames,
|
|
65
|
-
browserKey: options.browserKey,
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
return {
|
|
69
|
-
capability,
|
|
70
|
-
...parsed,
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function buildCookieRefreshCode(options: { capability: CapabilityRecord }): string {
|
|
75
|
-
const secretKey = options.capability.manifest.auth.secretKey || 'cookieHeader'
|
|
76
|
-
const secretsPath = path.join(options.capability.dir, 'secrets.json')
|
|
77
|
-
return [
|
|
78
|
-
'const fs = await globalThis.import("node:fs")',
|
|
79
|
-
`const urls = ${JSON.stringify(options.capability.manifest.auth.browserUrls)};`,
|
|
80
|
-
`const requiredCookieNames = ${JSON.stringify(options.capability.manifest.auth.requiredCookieNames)};`,
|
|
81
|
-
`const secretKey = ${JSON.stringify(secretKey)};`,
|
|
82
|
-
`const secretsPath = ${JSON.stringify(secretsPath)};`,
|
|
83
|
-
`const secretsDir = ${JSON.stringify(options.capability.dir)};`,
|
|
84
|
-
'const cdp = await getCDPSession({ page });',
|
|
85
|
-
'const result = await cdp.send("Network.getCookies", { urls });',
|
|
86
|
-
'const cookies = Array.isArray(result.cookies) ? result.cookies : [];',
|
|
87
|
-
'const cookieNames = cookies.map((cookie) => cookie.name).filter((name) => typeof name === "string");',
|
|
88
|
-
'const missingCookieNames = requiredCookieNames.filter((name) => !cookieNames.includes(name));',
|
|
89
|
-
'if (missingCookieNames.length > 0) {',
|
|
90
|
-
' throw new Error(`Missing required cookies: ${missingCookieNames.join(", ")}`);',
|
|
91
|
-
'}',
|
|
92
|
-
'const cookieHeader = cookies.map((cookie) => `${cookie.name}=${cookie.value}`).join("; ");',
|
|
93
|
-
'if (!cookieHeader) {',
|
|
94
|
-
' throw new Error("No cookies were available for capability auth refresh");',
|
|
95
|
-
'}',
|
|
96
|
-
'const existingSecrets = fs.existsSync(secretsPath) ? JSON.parse(fs.readFileSync(secretsPath, "utf-8")) : {};',
|
|
97
|
-
'const nextSecrets = {',
|
|
98
|
-
' ...existingSecrets,',
|
|
99
|
-
' [secretKey]: cookieHeader,',
|
|
100
|
-
' updatedAt: new Date().toISOString(),',
|
|
101
|
-
'};',
|
|
102
|
-
'fs.mkdirSync(secretsDir, { recursive: true });',
|
|
103
|
-
'fs.writeFileSync(secretsPath, JSON.stringify(nextSecrets, null, 2), { mode: 0o600 });',
|
|
104
|
-
'if (process.platform !== "win32") {',
|
|
105
|
-
' fs.chmodSync(secretsPath, 0o600);',
|
|
106
|
-
'}',
|
|
107
|
-
'const expiryCookies = requiredCookieNames.length > 0',
|
|
108
|
-
' ? cookies.filter((cookie) => requiredCookieNames.includes(cookie.name))',
|
|
109
|
-
' : [];',
|
|
110
|
-
'const expiryValues = expiryCookies.map((cookie) => cookie.expires).filter((expires) => typeof expires === "number" && expires > 0);',
|
|
111
|
-
'const expiresAt = expiryCookies.length > 0 && expiryValues.length === expiryCookies.length',
|
|
112
|
-
' ? new Date(Math.min(...expiryValues) * 1000).toISOString()',
|
|
113
|
-
' : undefined;',
|
|
114
|
-
'return {',
|
|
115
|
-
' saved: true,',
|
|
116
|
-
' secretKey,',
|
|
117
|
-
' cookieCount: cookies.length,',
|
|
118
|
-
' cookieNames,',
|
|
119
|
-
' urls,',
|
|
120
|
-
' expiresAt,',
|
|
121
|
-
' path: secretsPath,',
|
|
122
|
-
'};',
|
|
123
|
-
`//# sourceURL=tabwright-capability-auth://${options.capability.manifest.id}`,
|
|
124
|
-
'',
|
|
125
|
-
].join('\n')
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function refreshCapabilityAuthFromCookies(options: {
|
|
129
|
-
id: string
|
|
130
|
-
cookies: CapabilityAuthCookie[]
|
|
131
|
-
cwd?: string
|
|
132
|
-
browserKey?: string
|
|
133
|
-
}): CapabilityAuthRefreshResult {
|
|
134
|
-
const capability = requireBrowserRefreshableCookieCapability({ id: options.id, cwd: options.cwd })
|
|
135
|
-
const cookieNames = options.cookies.map((cookie) => {
|
|
136
|
-
return cookie.name
|
|
137
|
-
})
|
|
138
|
-
const missingCookieNames = capability.manifest.auth.requiredCookieNames.filter((name) => {
|
|
139
|
-
return !cookieNames.includes(name)
|
|
140
|
-
})
|
|
141
|
-
if (missingCookieNames.length > 0) {
|
|
142
|
-
throw new Error(`Missing required cookies: ${missingCookieNames.join(', ')}`)
|
|
143
|
-
}
|
|
144
|
-
const cookieHeader = options.cookies
|
|
145
|
-
.map((cookie) => {
|
|
146
|
-
return `${cookie.name}=${cookie.value}`
|
|
147
|
-
})
|
|
148
|
-
.join('; ')
|
|
149
|
-
if (!cookieHeader) {
|
|
150
|
-
throw new Error('No cookies were available for capability auth refresh')
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const secretKey = capability.manifest.auth.secretKey || 'cookieHeader'
|
|
154
|
-
const existingSecrets = readCapabilitySecrets({ capability })
|
|
155
|
-
writeCapabilitySecrets({
|
|
156
|
-
capability,
|
|
157
|
-
secrets: {
|
|
158
|
-
...existingSecrets,
|
|
159
|
-
[secretKey]: cookieHeader,
|
|
160
|
-
updatedAt: new Date().toISOString(),
|
|
161
|
-
},
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
const requiredCookies = capability.manifest.auth.requiredCookieNames.map((name) => {
|
|
165
|
-
return options.cookies.find((cookie) => {
|
|
166
|
-
return cookie.name === name
|
|
167
|
-
})
|
|
168
|
-
})
|
|
169
|
-
const expiryValues = requiredCookies
|
|
170
|
-
.map((cookie) => {
|
|
171
|
-
return cookie?.expires
|
|
172
|
-
})
|
|
173
|
-
.filter((expires): expires is number => {
|
|
174
|
-
return typeof expires === 'number' && expires > 0
|
|
175
|
-
})
|
|
176
|
-
// Do not invent an expiry for session cookies: only all timestamped required cookies produce a deadline.
|
|
177
|
-
const expiresAt =
|
|
178
|
-
requiredCookies.length > 0 && expiryValues.length === requiredCookies.length
|
|
179
|
-
? new Date(Math.min(...expiryValues) * 1000).toISOString()
|
|
180
|
-
: undefined
|
|
181
|
-
writeStoredCapabilityAuthState({
|
|
182
|
-
capability,
|
|
183
|
-
state: {
|
|
184
|
-
schemaVersion: 1,
|
|
185
|
-
refreshedAt: new Date().toISOString(),
|
|
186
|
-
expiresAt,
|
|
187
|
-
cookieNames,
|
|
188
|
-
browserKey: options.browserKey,
|
|
189
|
-
},
|
|
190
|
-
})
|
|
191
|
-
return {
|
|
192
|
-
capability,
|
|
193
|
-
saved: true,
|
|
194
|
-
secretKey,
|
|
195
|
-
cookieCount: options.cookies.length,
|
|
196
|
-
cookieNames,
|
|
197
|
-
urls: capability.manifest.auth.browserUrls,
|
|
198
|
-
expiresAt,
|
|
199
|
-
path: path.join(capability.dir, 'secrets.json'),
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function parseRefreshResult(value: unknown): Omit<CapabilityAuthRefreshResult, 'capability'> {
|
|
204
|
-
if (!isRecord(value)) {
|
|
205
|
-
throw new Error('Capability auth refresh did not return an object')
|
|
206
|
-
}
|
|
207
|
-
const saved = value.saved === true
|
|
208
|
-
const secretKey = typeof value.secretKey === 'string' ? value.secretKey : ''
|
|
209
|
-
const cookieCount = typeof value.cookieCount === 'number' ? value.cookieCount : 0
|
|
210
|
-
const cookieNames = Array.isArray(value.cookieNames)
|
|
211
|
-
? value.cookieNames.filter((item): item is string => {
|
|
212
|
-
return typeof item === 'string'
|
|
213
|
-
})
|
|
214
|
-
: []
|
|
215
|
-
const urls = Array.isArray(value.urls)
|
|
216
|
-
? value.urls.filter((item): item is string => {
|
|
217
|
-
return typeof item === 'string'
|
|
218
|
-
})
|
|
219
|
-
: []
|
|
220
|
-
const expiresAt = typeof value.expiresAt === 'string' ? value.expiresAt : undefined
|
|
221
|
-
const secretsPath = typeof value.path === 'string' ? value.path : ''
|
|
222
|
-
if (!saved || !secretKey || !secretsPath) {
|
|
223
|
-
throw new Error('Capability auth refresh returned an incomplete result')
|
|
224
|
-
}
|
|
225
|
-
return {
|
|
226
|
-
saved,
|
|
227
|
-
secretKey,
|
|
228
|
-
cookieCount,
|
|
229
|
-
cookieNames,
|
|
230
|
-
urls,
|
|
231
|
-
expiresAt,
|
|
232
|
-
path: secretsPath,
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function requireBrowserRefreshableCookieCapability(options: { id: string; cwd?: string }): CapabilityRecord {
|
|
237
|
-
const capability = requireCapability({ id: options.id, cwd: options.cwd })
|
|
238
|
-
if (capability.manifest.auth.type !== 'cookie' || capability.manifest.auth.refresh !== 'from-browser') {
|
|
239
|
-
throw new Error(`Capability ${options.id} does not declare browser-refreshable cookie auth`)
|
|
240
|
-
}
|
|
241
|
-
if (capability.manifest.auth.browserUrls.length === 0) {
|
|
242
|
-
throw new Error(`Capability ${options.id} auth.browserUrls is required for cookie refresh`)
|
|
243
|
-
}
|
|
244
|
-
return capability
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
248
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
249
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { execFile } from 'node:child_process'
|
|
4
|
-
import { promisify } from 'node:util'
|
|
5
|
-
import { fileURLToPath } from 'node:url'
|
|
6
|
-
import { describe, expect, test } from 'vitest'
|
|
7
|
-
import { createCapability, updateCapabilityManifest, updateCapabilityScript } from './capability-registry.js'
|
|
8
|
-
|
|
9
|
-
const execFileAsync = promisify(execFile)
|
|
10
|
-
const currentDir = path.dirname(fileURLToPath(import.meta.url))
|
|
11
|
-
const tabwrightDir = path.resolve(currentDir, '..')
|
|
12
|
-
const viteNodeBinary = path.join(
|
|
13
|
-
tabwrightDir,
|
|
14
|
-
'node_modules',
|
|
15
|
-
'.bin',
|
|
16
|
-
process.platform === 'win32' ? 'vite-node.cmd' : 'vite-node',
|
|
17
|
-
)
|
|
18
|
-
const cliPath = path.join(currentDir, 'cli.ts')
|
|
19
|
-
|
|
20
|
-
function createTempDir(prefix: string): string {
|
|
21
|
-
const tempRoot = path.join(tabwrightDir, 'tmp')
|
|
22
|
-
fs.mkdirSync(tempRoot, { recursive: true })
|
|
23
|
-
return fs.mkdtempSync(path.join(tempRoot, prefix))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function runCli(options: { cwd: string; args: string[] }): Promise<{ stdout: string; stderr: string }> {
|
|
27
|
-
return execFileAsync(viteNodeBinary, [cliPath, ...options.args], {
|
|
28
|
-
cwd: options.cwd,
|
|
29
|
-
env: process.env,
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
describe('capability CLI confirmation', () => {
|
|
34
|
-
test('force cannot execute a confirmation-required script without the exact id', async () => {
|
|
35
|
-
const cwd = createTempDir('capability-cli-confirmation-')
|
|
36
|
-
try {
|
|
37
|
-
const capability = createCapability({
|
|
38
|
-
id: 'confirmed-cli-write',
|
|
39
|
-
location: 'project',
|
|
40
|
-
cwd,
|
|
41
|
-
runtime: 'node',
|
|
42
|
-
})
|
|
43
|
-
updateCapabilityScript({
|
|
44
|
-
id: capability.manifest.id,
|
|
45
|
-
cwd,
|
|
46
|
-
source: 'artifacts.writeText({ filename: "executed.txt", text: "yes" }); return { ok: true };',
|
|
47
|
-
})
|
|
48
|
-
updateCapabilityManifest({
|
|
49
|
-
id: capability.manifest.id,
|
|
50
|
-
cwd,
|
|
51
|
-
allowUnvalidatedTrust: true,
|
|
52
|
-
patch: { status: 'trusted', sideEffect: 'write', requiresConfirmation: true },
|
|
53
|
-
})
|
|
54
|
-
const markerPath = path.join(capability.dir, 'artifacts', 'executed.txt')
|
|
55
|
-
|
|
56
|
-
await expect(
|
|
57
|
-
runCli({
|
|
58
|
-
cwd,
|
|
59
|
-
args: ['capability', 'run', capability.manifest.id, '--force', '--input-json', '{}', '--json'],
|
|
60
|
-
}),
|
|
61
|
-
).rejects.toMatchObject({
|
|
62
|
-
code: 1,
|
|
63
|
-
stderr: expect.stringContaining('requires explicit user confirmation'),
|
|
64
|
-
})
|
|
65
|
-
expect(fs.existsSync(markerPath)).toBe(false)
|
|
66
|
-
|
|
67
|
-
const runStartedAt = Date.now()
|
|
68
|
-
const { stdout, stderr } = await runCli({
|
|
69
|
-
cwd,
|
|
70
|
-
args: [
|
|
71
|
-
'capability',
|
|
72
|
-
'run',
|
|
73
|
-
capability.manifest.id,
|
|
74
|
-
'--force',
|
|
75
|
-
'--confirm',
|
|
76
|
-
capability.manifest.id,
|
|
77
|
-
'--input-json',
|
|
78
|
-
'{}',
|
|
79
|
-
'--json',
|
|
80
|
-
],
|
|
81
|
-
})
|
|
82
|
-
expect(JSON.parse(stdout)).toMatchObject({ capability: capability.manifest.id, output: { ok: true } })
|
|
83
|
-
expect(stderr).toBe('')
|
|
84
|
-
expect(fs.readFileSync(markerPath, 'utf-8')).toBe('yes')
|
|
85
|
-
expect(Date.now() - runStartedAt).toBeLessThan(5000)
|
|
86
|
-
} finally {
|
|
87
|
-
fs.rmSync(cwd, { recursive: true, force: true })
|
|
88
|
-
}
|
|
89
|
-
}, 30000)
|
|
90
|
-
})
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { describe, expect, test } from 'vitest'
|
|
4
|
-
import { createCapability } from './capability-registry.js'
|
|
5
|
-
import { listCapabilityOptions } from './capability-options.js'
|
|
6
|
-
|
|
7
|
-
function createTempDir(prefix: string): string {
|
|
8
|
-
const tempRoot = path.join(process.cwd(), 'tmp')
|
|
9
|
-
fs.mkdirSync(tempRoot, { recursive: true })
|
|
10
|
-
return fs.mkdtempSync(path.join(tempRoot, prefix))
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
describe('capability options view', () => {
|
|
14
|
-
test('lists capabilities with read-only agent skill status', () => {
|
|
15
|
-
const cwd = createTempDir('capability-options-')
|
|
16
|
-
try {
|
|
17
|
-
const capability = createCapability({
|
|
18
|
-
id: 'options-tool',
|
|
19
|
-
title: 'Options Tool',
|
|
20
|
-
location: 'project',
|
|
21
|
-
cwd,
|
|
22
|
-
})
|
|
23
|
-
const skillPath = path.join(capability.dir, 'agent-skills', 'codex', 'SKILL.md')
|
|
24
|
-
fs.mkdirSync(path.dirname(skillPath), { recursive: true })
|
|
25
|
-
fs.writeFileSync(skillPath, '---\nname: options-tool\n---\n')
|
|
26
|
-
|
|
27
|
-
const response = listCapabilityOptions({ cwd })
|
|
28
|
-
expect(response.cwd).toBe(cwd)
|
|
29
|
-
expect(response.capabilities).toEqual(
|
|
30
|
-
expect.arrayContaining([
|
|
31
|
-
expect.objectContaining({
|
|
32
|
-
id: 'options-tool',
|
|
33
|
-
title: 'Options Tool',
|
|
34
|
-
agentSkill: expect.objectContaining({
|
|
35
|
-
draftExists: true,
|
|
36
|
-
initCommand: 'tabwright capability skill init options-tool',
|
|
37
|
-
installCommand: 'tabwright capability skill install options-tool',
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
]),
|
|
41
|
-
)
|
|
42
|
-
} finally {
|
|
43
|
-
fs.rmSync(cwd, { recursive: true, force: true })
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
test('keeps the capability list available when run logs or entry scripts are damaged', () => {
|
|
48
|
-
const cwd = createTempDir('capability-options-damaged-')
|
|
49
|
-
try {
|
|
50
|
-
const damagedRuns = createCapability({
|
|
51
|
-
id: 'damaged-runs',
|
|
52
|
-
title: 'Damaged Runs',
|
|
53
|
-
location: 'project',
|
|
54
|
-
cwd,
|
|
55
|
-
})
|
|
56
|
-
fs.writeFileSync(path.join(damagedRuns.dir, 'runs.jsonl'), '{"id":\n')
|
|
57
|
-
|
|
58
|
-
const missingScript = createCapability({
|
|
59
|
-
id: 'missing-script',
|
|
60
|
-
title: 'Missing Script',
|
|
61
|
-
location: 'project',
|
|
62
|
-
cwd,
|
|
63
|
-
})
|
|
64
|
-
fs.rmSync(missingScript.scriptPath)
|
|
65
|
-
|
|
66
|
-
const response = listCapabilityOptions({ cwd })
|
|
67
|
-
const damagedRunsItem = response.capabilities.find((capability) => capability.id === 'damaged-runs')
|
|
68
|
-
const missingScriptItem = response.capabilities.find((capability) => capability.id === 'missing-script')
|
|
69
|
-
|
|
70
|
-
expect(damagedRunsItem).toEqual(expect.objectContaining({ recentRuns: [] }))
|
|
71
|
-
expect(missingScriptItem).toEqual(
|
|
72
|
-
expect.objectContaining({
|
|
73
|
-
lifecycle: expect.objectContaining({
|
|
74
|
-
stage: 'drifted',
|
|
75
|
-
contractHealth: expect.objectContaining({
|
|
76
|
-
state: 'drifted',
|
|
77
|
-
reasons: expect.arrayContaining([expect.stringContaining('Cannot validate the capability entry script')]),
|
|
78
|
-
}),
|
|
79
|
-
}),
|
|
80
|
-
autonomousInvocation: expect.objectContaining({
|
|
81
|
-
allowed: false,
|
|
82
|
-
}),
|
|
83
|
-
}),
|
|
84
|
-
)
|
|
85
|
-
} finally {
|
|
86
|
-
fs.rmSync(cwd, { recursive: true, force: true })
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
})
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
listCapabilities,
|
|
3
|
-
toCapabilityContract,
|
|
4
|
-
type CapabilityRecord,
|
|
5
|
-
} from './capability-registry.js'
|
|
6
|
-
import {
|
|
7
|
-
getCapabilityAgentSkillStatus,
|
|
8
|
-
type CapabilityAgentSkillStatus,
|
|
9
|
-
} from './capability-agent-skill.js'
|
|
10
|
-
import { getCapabilityAuthState } from './capability-auth-state.js'
|
|
11
|
-
|
|
12
|
-
export interface CapabilityOptionsItem extends Record<string, unknown> {
|
|
13
|
-
agentSkill: CapabilityAgentSkillStatus
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface CapabilityOptionsListResponse {
|
|
17
|
-
cwd: string
|
|
18
|
-
capabilities: CapabilityOptionsItem[]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface CapabilityOptionsDetailResponse {
|
|
22
|
-
cwd: string
|
|
23
|
-
capability: CapabilityOptionsItem
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function listCapabilityOptions(options: { cwd: string }): CapabilityOptionsListResponse {
|
|
27
|
-
return {
|
|
28
|
-
cwd: options.cwd,
|
|
29
|
-
capabilities: listCapabilities({ cwd: options.cwd }).map((capability) => {
|
|
30
|
-
return toCapabilityOptionsItem(capability)
|
|
31
|
-
}),
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function getCapabilityOptionsDetail(options: {
|
|
36
|
-
cwd: string
|
|
37
|
-
id: string
|
|
38
|
-
}): CapabilityOptionsDetailResponse | null {
|
|
39
|
-
const capability = listCapabilities({ cwd: options.cwd }).find((candidate) => {
|
|
40
|
-
return candidate.manifest.id === options.id
|
|
41
|
-
})
|
|
42
|
-
if (!capability) {
|
|
43
|
-
return null
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
cwd: options.cwd,
|
|
47
|
-
capability: toCapabilityOptionsItem(capability),
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function toCapabilityOptionsItem(capability: CapabilityRecord): CapabilityOptionsItem {
|
|
52
|
-
return {
|
|
53
|
-
...toCapabilityContract(capability),
|
|
54
|
-
authState: getCapabilityAuthState({ capability }),
|
|
55
|
-
agentSkill: getCapabilityAgentSkillStatus({ capability }),
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
4
|
-
import { installCapabilityPackage, packCapability } from './capability-package.js'
|
|
5
|
-
import { createCapability, updateCapabilityManifest, updateCapabilityScript, writeCapabilitySecrets } from './capability-registry.js'
|
|
6
|
-
|
|
7
|
-
describe('capability package sharing', () => {
|
|
8
|
-
let testRoot: string
|
|
9
|
-
let sourceCwd: string
|
|
10
|
-
let recipientCwd: string
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
const tmpRoot = path.join(process.cwd(), 'tmp')
|
|
14
|
-
fs.mkdirSync(tmpRoot, { recursive: true })
|
|
15
|
-
testRoot = fs.mkdtempSync(path.join(tmpRoot, 'capability-package-'))
|
|
16
|
-
sourceCwd = path.join(testRoot, 'source')
|
|
17
|
-
recipientCwd = path.join(testRoot, 'recipient')
|
|
18
|
-
fs.mkdirSync(sourceCwd, { recursive: true })
|
|
19
|
-
fs.mkdirSync(recipientCwd, { recursive: true })
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
vi.unstubAllGlobals()
|
|
24
|
-
fs.rmSync(testRoot, { recursive: true, force: true })
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('packs only shareable files and installs the recipient copy as draft', async () => {
|
|
28
|
-
const source = createCapability({
|
|
29
|
-
id: 'shared-query',
|
|
30
|
-
title: 'Shared query',
|
|
31
|
-
description: 'Queries shared data.',
|
|
32
|
-
location: 'project',
|
|
33
|
-
cwd: sourceCwd,
|
|
34
|
-
runtime: 'node',
|
|
35
|
-
})
|
|
36
|
-
updateCapabilityScript({
|
|
37
|
-
id: source.manifest.id,
|
|
38
|
-
cwd: sourceCwd,
|
|
39
|
-
source: 'return { ok: true }\n',
|
|
40
|
-
})
|
|
41
|
-
updateCapabilityManifest({
|
|
42
|
-
id: source.manifest.id,
|
|
43
|
-
cwd: sourceCwd,
|
|
44
|
-
allowUnvalidatedTrust: true,
|
|
45
|
-
patch: {
|
|
46
|
-
status: 'trusted',
|
|
47
|
-
auth: {
|
|
48
|
-
type: 'cookie',
|
|
49
|
-
refresh: 'from-browser',
|
|
50
|
-
browserUrls: ['https://example.com'],
|
|
51
|
-
requiredCookieNames: ['session'],
|
|
52
|
-
failureSignals: ['unauthorized'],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
})
|
|
56
|
-
const capabilityDir = source.dir
|
|
57
|
-
writeCapabilitySecrets({ capability: source, secrets: { cookieHeader: 'secret-value' } })
|
|
58
|
-
fs.writeFileSync(path.join(capabilityDir, 'runs.jsonl'), '{"private":"run"}\n')
|
|
59
|
-
fs.mkdirSync(path.join(capabilityDir, 'artifacts'), { recursive: true })
|
|
60
|
-
fs.writeFileSync(path.join(capabilityDir, 'artifacts', 'private.json'), '{}\n')
|
|
61
|
-
fs.mkdirSync(path.join(capabilityDir, 'agent-skills', 'codex', 'agents'), { recursive: true })
|
|
62
|
-
fs.writeFileSync(
|
|
63
|
-
path.join(capabilityDir, 'agent-skills', 'codex', 'SKILL.md'),
|
|
64
|
-
'---\nname: shared-query\ndescription: Use shared query.\n---\n',
|
|
65
|
-
)
|
|
66
|
-
fs.writeFileSync(path.join(capabilityDir, 'agent-skills', 'codex', 'agents', 'openai.yaml'), 'name: Shared query\n')
|
|
67
|
-
|
|
68
|
-
const archivePath = path.join(testRoot, 'shared-query.tgz')
|
|
69
|
-
const packed = await packCapability({ id: source.manifest.id, cwd: sourceCwd, output: archivePath })
|
|
70
|
-
const installed = await installCapabilityPackage({
|
|
71
|
-
source: packed.path,
|
|
72
|
-
cwd: recipientCwd,
|
|
73
|
-
location: 'project',
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
expect(packed.files).toEqual([
|
|
77
|
-
'README.md',
|
|
78
|
-
'agent-skills/codex/SKILL.md',
|
|
79
|
-
'agent-skills/codex/agents/openai.yaml',
|
|
80
|
-
'capability.json',
|
|
81
|
-
'script.js',
|
|
82
|
-
])
|
|
83
|
-
expect(installed.capability.manifest.status).toBe('draft')
|
|
84
|
-
expect(fs.readFileSync(installed.capability.scriptPath, 'utf-8')).toBe('return { ok: true }\n')
|
|
85
|
-
expect(installed.agentSkillAvailable).toBe(true)
|
|
86
|
-
expect(fs.existsSync(path.join(installed.capability.dir, 'secrets.json'))).toBe(false)
|
|
87
|
-
expect(fs.existsSync(path.join(installed.capability.dir, 'runs.jsonl'))).toBe(false)
|
|
88
|
-
expect(fs.existsSync(path.join(installed.capability.dir, 'artifacts'))).toBe(false)
|
|
89
|
-
expect(installed.integrity).toBe(packed.integrity)
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
it('installs directly from a capability directory without copying local state', async () => {
|
|
93
|
-
const source = createCapability({
|
|
94
|
-
id: 'directory-query',
|
|
95
|
-
location: 'project',
|
|
96
|
-
cwd: sourceCwd,
|
|
97
|
-
runtime: 'node',
|
|
98
|
-
})
|
|
99
|
-
updateCapabilityScript({ id: source.manifest.id, cwd: sourceCwd, source: 'return input\n' })
|
|
100
|
-
writeCapabilitySecrets({ capability: source, secrets: { token: 'do-not-copy' } })
|
|
101
|
-
|
|
102
|
-
const installed = await installCapabilityPackage({
|
|
103
|
-
source: source.dir,
|
|
104
|
-
cwd: recipientCwd,
|
|
105
|
-
location: 'project',
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
expect(installed.capability.manifest.status).toBe('draft')
|
|
109
|
-
expect(fs.existsSync(path.join(installed.capability.dir, 'secrets.json'))).toBe(false)
|
|
110
|
-
expect(installed.files).toEqual(['README.md', 'capability.json', 'script.js'])
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
it('requires force before replacing package files and clears recipient authentication', async () => {
|
|
114
|
-
const source = createCapability({
|
|
115
|
-
id: 'replace-query',
|
|
116
|
-
location: 'project',
|
|
117
|
-
cwd: sourceCwd,
|
|
118
|
-
runtime: 'node',
|
|
119
|
-
})
|
|
120
|
-
updateCapabilityScript({ id: source.manifest.id, cwd: sourceCwd, source: 'return { version: 2 }\n' })
|
|
121
|
-
const archive = await packCapability({
|
|
122
|
-
id: source.manifest.id,
|
|
123
|
-
cwd: sourceCwd,
|
|
124
|
-
output: path.join(testRoot, 'replace-query.tgz'),
|
|
125
|
-
})
|
|
126
|
-
const existing = createCapability({
|
|
127
|
-
id: source.manifest.id,
|
|
128
|
-
location: 'project',
|
|
129
|
-
cwd: recipientCwd,
|
|
130
|
-
runtime: 'node',
|
|
131
|
-
})
|
|
132
|
-
writeCapabilitySecrets({ capability: existing, secrets: { token: 'recipient-only' } })
|
|
133
|
-
fs.writeFileSync(path.join(existing.dir, 'auth-state.json'), '{"schemaVersion":1}\n')
|
|
134
|
-
|
|
135
|
-
await expect(
|
|
136
|
-
installCapabilityPackage({ source: archive.path, cwd: recipientCwd, location: 'project' }),
|
|
137
|
-
).rejects.toThrow('Use --force')
|
|
138
|
-
|
|
139
|
-
const installed = await installCapabilityPackage({
|
|
140
|
-
source: archive.path,
|
|
141
|
-
cwd: recipientCwd,
|
|
142
|
-
location: 'project',
|
|
143
|
-
overwrite: true,
|
|
144
|
-
})
|
|
145
|
-
expect(fs.readFileSync(installed.capability.scriptPath, 'utf-8')).toBe('return { version: 2 }\n')
|
|
146
|
-
expect(fs.existsSync(path.join(installed.capability.dir, 'secrets.json'))).toBe(false)
|
|
147
|
-
expect(fs.existsSync(path.join(installed.capability.dir, 'auth-state.json'))).toBe(false)
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
it('installs a package downloaded from an HTTPS URL', async () => {
|
|
151
|
-
const source = createCapability({
|
|
152
|
-
id: 'remote-query',
|
|
153
|
-
location: 'project',
|
|
154
|
-
cwd: sourceCwd,
|
|
155
|
-
runtime: 'node',
|
|
156
|
-
})
|
|
157
|
-
const packed = await packCapability({
|
|
158
|
-
id: source.manifest.id,
|
|
159
|
-
cwd: sourceCwd,
|
|
160
|
-
output: path.join(testRoot, 'remote-query.tgz'),
|
|
161
|
-
})
|
|
162
|
-
const archive = fs.readFileSync(packed.path)
|
|
163
|
-
vi.stubGlobal(
|
|
164
|
-
'fetch',
|
|
165
|
-
vi.fn(async () => {
|
|
166
|
-
return new Response(archive, {
|
|
167
|
-
status: 200,
|
|
168
|
-
headers: { 'content-length': String(archive.length) },
|
|
169
|
-
})
|
|
170
|
-
}),
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
const installed = await installCapabilityPackage({
|
|
174
|
-
source: 'https://example.com/remote-query.tgz',
|
|
175
|
-
cwd: recipientCwd,
|
|
176
|
-
location: 'project',
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
expect(installed.source).toBe('https://example.com/remote-query.tgz')
|
|
180
|
-
expect(installed.capability.manifest.id).toBe('remote-query')
|
|
181
|
-
expect(installed.capability.manifest.status).toBe('draft')
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
it('requires force before overwriting an existing package archive', async () => {
|
|
185
|
-
const source = createCapability({
|
|
186
|
-
id: 'archive-overwrite',
|
|
187
|
-
location: 'project',
|
|
188
|
-
cwd: sourceCwd,
|
|
189
|
-
runtime: 'node',
|
|
190
|
-
})
|
|
191
|
-
const output = path.join(testRoot, 'archive-overwrite.tgz')
|
|
192
|
-
await packCapability({ id: source.manifest.id, cwd: sourceCwd, output })
|
|
193
|
-
|
|
194
|
-
await expect(packCapability({ id: source.manifest.id, cwd: sourceCwd, output })).rejects.toThrow('Use --force')
|
|
195
|
-
|
|
196
|
-
const overwritten = await packCapability({
|
|
197
|
-
id: source.manifest.id,
|
|
198
|
-
cwd: sourceCwd,
|
|
199
|
-
output,
|
|
200
|
-
overwrite: true,
|
|
201
|
-
})
|
|
202
|
-
expect(fs.existsSync(overwritten.path)).toBe(true)
|
|
203
|
-
})
|
|
204
|
-
})
|