pyagentbrowser 0.36.0.2__tar.gz → 0.37.0__tar.gz

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.
Files changed (187) hide show
  1. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/Cargo.lock +2 -2
  2. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/PKG-INFO +1 -1
  3. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/agent-browser-adapter/Cargo.toml +1 -1
  4. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/pyagentbrowser/Cargo.toml +1 -1
  5. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/read-and-capture.md +35 -0
  6. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/webmcp.md +17 -0
  7. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/reference/namespaces.md +6 -0
  8. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/pyproject.toml +1 -1
  9. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/_allowlist.py +1 -0
  10. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/_browser_common.py +4 -2
  11. pyagentbrowser-0.37.0/src/agentbrowser/_upstream.json +4 -0
  12. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/_version.py +1 -1
  13. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/browser.py +5 -4
  14. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/browser_async.py +5 -4
  15. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/Cargo.toml +1 -1
  16. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/commands.rs +278 -39
  17. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/flags.rs +8 -0
  18. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/mcp.rs +101 -10
  19. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/actions.rs +913 -219
  20. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cdp/client.rs +112 -2
  21. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/e2e_tests.rs +935 -19
  22. pyagentbrowser-0.37.0/third_party/agent-browser/cli/src/native/recording.rs +978 -0
  23. pyagentbrowser-0.37.0/third_party/agent-browser/cli/src/native/test_fixtures/webmcp_delayed_probe.html +26 -0
  24. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webmcp.rs +1 -0
  25. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/SKILL.md +9 -3
  26. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/authentication.md +2 -0
  27. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/commands.md +14 -3
  28. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/video-recording.md +51 -6
  29. pyagentbrowser-0.36.0.2/src/agentbrowser/_upstream.json +0 -4
  30. pyagentbrowser-0.36.0.2/third_party/agent-browser/cli/src/native/recording.rs +0 -323
  31. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/.agent-plugin/plugin.json +0 -0
  32. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/.agent-plugin/skills/pyagentbrowser/SKILL.md +0 -0
  33. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/.agent-plugin/skills/pyagentbrowser/agents/openai.yaml +0 -0
  34. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/.agent-plugin/skills/pyagentbrowser/references/api-map.md +0 -0
  35. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/.agent-plugin/skills/pyagentbrowser/references/lifecycle-and-safety.md +0 -0
  36. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/Cargo.toml +0 -0
  37. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/LICENSE +0 -0
  38. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/NOTICE +0 -0
  39. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/README.md +0 -0
  40. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/_agent_plugins_maturin.py +0 -0
  41. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/agent-browser-adapter/build.rs +0 -0
  42. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/agent-browser-adapter/src/lib.rs +0 -0
  43. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/agent-browser-adapter/tests/smoke.rs +0 -0
  44. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/pyagentbrowser/build.rs +0 -0
  45. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/crates/pyagentbrowser/src/lib.rs +0 -0
  46. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/concepts/evidence.md +0 -0
  47. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/concepts/runtime-model.md +0 -0
  48. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/concepts/safety.md +0 -0
  49. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/getting-started.md +0 -0
  50. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/agent-skills.md +0 -0
  51. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/async.md +0 -0
  52. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/cdp.md +0 -0
  53. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/dashboard.md +0 -0
  54. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/interact.md +0 -0
  55. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/native-protocol.md +0 -0
  56. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/network-and-diagnostics.md +0 -0
  57. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/guides/tabs-and-state.md +0 -0
  58. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/index.md +0 -0
  59. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/introduction.md +0 -0
  60. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/reference/browser.md +0 -0
  61. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/reference/environment.md +0 -0
  62. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/reference/models.md +0 -0
  63. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/troubleshooting.md +0 -0
  64. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/docs/why.md +0 -0
  65. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/examples/async_usage.py +0 -0
  66. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/examples/basic_navigation.py +0 -0
  67. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/examples/cdp_frame_eval.py +0 -0
  68. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/examples/confirmation_policy.py +0 -0
  69. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/examples/restore_session.py +0 -0
  70. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/examples/screenshot_capture.py +0 -0
  71. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/rust-toolchain.toml +0 -0
  72. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/__init__.py +0 -0
  73. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/_evidence.py +0 -0
  74. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/_native.pyi +0 -0
  75. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/agent.py +0 -0
  76. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/agent_async.py +0 -0
  77. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/__init__.py +0 -0
  78. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/_protocol.py +0 -0
  79. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/_resolution.py +0 -0
  80. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/client.py +0 -0
  81. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/controller.py +0 -0
  82. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/errors.py +0 -0
  83. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/models.py +0 -0
  84. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/page.py +0 -0
  85. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/target.py +0 -0
  86. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/cdp/transport.py +0 -0
  87. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/command_params.py +0 -0
  88. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/domains.py +0 -0
  89. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/domains_async.py +0 -0
  90. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/install.py +0 -0
  91. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/launch.py +0 -0
  92. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/models.py +0 -0
  93. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/py.typed +0 -0
  94. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/query.py +0 -0
  95. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/query_async.py +0 -0
  96. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/session.py +0 -0
  97. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/session_async.py +0 -0
  98. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/session_id.py +0 -0
  99. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/src/agentbrowser/skills.py +0 -0
  100. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/LICENSE +0 -0
  101. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/cdp-protocol/browser_protocol.json +0 -0
  102. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/cdp-protocol/js_protocol.json +0 -0
  103. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/ca_bundle.rs +0 -0
  104. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/color.rs +0 -0
  105. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/connection.rs +0 -0
  106. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/install.rs +0 -0
  107. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/a11y/LICENSE-axe-core-THIRD-PARTY.txt +0 -0
  108. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/a11y/LICENSE-axe-core.txt +0 -0
  109. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/a11y/axe.min.js +0 -0
  110. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/a11y/mod.rs +0 -0
  111. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/auth.rs +0 -0
  112. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/browser.rs +0 -0
  113. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cdp/chrome.rs +0 -0
  114. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cdp/discovery.rs +0 -0
  115. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cdp/lightpanda.rs +0 -0
  116. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cdp/mod.rs +0 -0
  117. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cdp/types.rs +0 -0
  118. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/cookies.rs +0 -0
  119. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/daemon.rs +0 -0
  120. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/diff.rs +0 -0
  121. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/element.rs +0 -0
  122. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/inspect_server.rs +0 -0
  123. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/interaction.rs +0 -0
  124. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/mod.rs +0 -0
  125. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/network.rs +0 -0
  126. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/parity_tests.rs +0 -0
  127. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/policy.rs +0 -0
  128. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/providers.rs +0 -0
  129. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/react/installHook.js +0 -0
  130. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/react/mod.rs +0 -0
  131. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/react/renders.rs +0 -0
  132. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/react/scripts.rs +0 -0
  133. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/react/suspense.rs +0 -0
  134. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/react/tree.rs +0 -0
  135. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/screenshot.rs +0 -0
  136. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/snapshot.rs +0 -0
  137. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/state.rs +0 -0
  138. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/storage.rs +0 -0
  139. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/cdp_loop.rs +0 -0
  140. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/chat.rs +0 -0
  141. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/dashboard.rs +0 -0
  142. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/discovery.rs +0 -0
  143. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/http.rs +0 -0
  144. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/mod.rs +0 -0
  145. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/stream/websocket.rs +0 -0
  146. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/tab_binding.rs +0 -0
  147. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/drag_probe.html +0 -0
  148. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/html5_drag_probe.html +0 -0
  149. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/pointer_capture_probe.html +0 -0
  150. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/snapshot_diff_probe.html +0 -0
  151. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/upload_probe.html +0 -0
  152. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/webmcp_frame_probe.html +0 -0
  153. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/test_fixtures/webmcp_probe.html +0 -0
  154. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/tracing.rs +0 -0
  155. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/appium.rs +0 -0
  156. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/backend.rs +0 -0
  157. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/client.rs +0 -0
  158. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/ios.rs +0 -0
  159. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/mod.rs +0 -0
  160. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/safari.rs +0 -0
  161. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/native/webdriver/types.rs +0 -0
  162. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/plugins.rs +0 -0
  163. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/read.rs +0 -0
  164. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/test_utils.rs +0 -0
  165. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/cli/src/validation.rs +0 -0
  166. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/agentcore/SKILL.md +0 -0
  167. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/profiling.md +0 -0
  168. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/proxy-support.md +0 -0
  169. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/session-management.md +0 -0
  170. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/snapshot-refs.md +0 -0
  171. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/streaming.md +0 -0
  172. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/trust-boundaries.md +0 -0
  173. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/references/webgpu.md +0 -0
  174. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/templates/authenticated-session.sh +0 -0
  175. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/templates/capture-workflow.sh +0 -0
  176. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/core/templates/form-automation.sh +0 -0
  177. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/derive-client/SKILL.md +0 -0
  178. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/dogfood/SKILL.md +0 -0
  179. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/dogfood/references/issue-taxonomy.md +0 -0
  180. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/dogfood/templates/dogfood-report-template.md +0 -0
  181. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/electron/SKILL.md +0 -0
  182. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/protected-vercel-deployments/SKILL.md +0 -0
  183. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/slack/SKILL.md +0 -0
  184. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/slack/references/slack-tasks.md +0 -0
  185. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/slack/templates/slack-report-template.md +0 -0
  186. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/vercel-sandbox/SKILL.md +0 -0
  187. {pyagentbrowser-0.36.0.2 → pyagentbrowser-0.37.0}/third_party/agent-browser/skill-data/webmcp-gen/SKILL.md +0 -0
@@ -45,7 +45,7 @@ dependencies = [
45
45
 
46
46
  [[package]]
47
47
  name = "agent-browser"
48
- version = "0.36.0"
48
+ version = "0.37.0"
49
49
  dependencies = [
50
50
  "aes-gcm",
51
51
  "async-trait",
@@ -1484,7 +1484,7 @@ checksum = "e0c5ccf5294c6ccd63a74f1565028353830a9c2f5eb0c682c355c471726a6e3f"
1484
1484
 
1485
1485
  [[package]]
1486
1486
  name = "pyagentbrowser"
1487
- version = "0.36.0+py.2"
1487
+ version = "0.37.0"
1488
1488
  dependencies = [
1489
1489
  "agent-browser",
1490
1490
  "pyo3",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyagentbrowser
3
- Version: 0.36.0.2
3
+ Version: 0.37.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "agent-browser"
3
- version = "0.36.0"
3
+ version = "0.37.0"
4
4
  edition = "2021"
5
5
  description = "Library adapter for the agent-browser upstream submodule"
6
6
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pyagentbrowser"
3
- version = "0.36.0+py.2"
3
+ version = "0.37.0"
4
4
  edition.workspace = true
5
5
  description = "Python bindings for agent-browser's native Rust browser automation engine"
6
6
  license = "Apache-2.0"
@@ -61,6 +61,41 @@ Screenshots can target the page or one selector. Set `format` to `png` or `jpeg`
61
61
 
62
62
  Install `pyagentbrowser[images]` for `Screenshot.pil()` and `Screenshot.image`. Notebook frontends can display PNG and JPEG screenshot bytes directly. `Screenshot.marimo()` returns an image for a [marimo](https://marimo.io/) reactive Python notebook when marimo is installed.
63
63
 
64
+ ## Record the active page
65
+
66
+ The native recorder captures the active tab at 30 frames per second by default.
67
+ Install [FFmpeg](https://ffmpeg.org/download.html), the video encoder, and make
68
+ `ffmpeg` available on `PATH` before starting a recording.
69
+ The FFmpeg build needs `libvpx` for WebM or `libx264` for MP4 output.
70
+
71
+ ```python
72
+ from agentbrowser import Browser
73
+
74
+ with Browser.launch() as browser:
75
+ browser.page.set_content('<button id="start">Start</button>')
76
+ browser.native.data("recording_start", path="take.webm", fps=30)
77
+ browser.evaluate("""
78
+ document.getElementById('start').animate(
79
+ [{transform: 'translateX(0)'}, {transform: 'translateX(200px)'}],
80
+ {duration: 1000, fill: 'forwards'}
81
+ ).finished.then(() => { document.body.dataset.done = 'true' })
82
+ """)
83
+ browser.page.wait_for_function("document.body.dataset.done === 'true'")
84
+ recording = browser.native.data("recording_stop")
85
+ print(recording["path"], recording["fps"])
86
+ ```
87
+
88
+ `recording_start` and `recording_restart` accept integer `fps` values from 1
89
+ through 60. Use a `.webm` or `.mp4` output path. `recording_restart` stops the
90
+ current take and starts another at the requested path. Invalid frame rates or
91
+ extensionless paths are rejected before replacing an active take.
92
+
93
+ Pass `url="https://example.com"` to either action to navigate the active tab
94
+ before recording. These URL calls invalidate direct CDP frame and
95
+ execution-context handles. Omit `url` to capture the current page and its live
96
+ state. Open a tab with `browser.tabs.new()` first when the recording needs a
97
+ separate page.
98
+
64
99
  ## Write a PDF
65
100
 
66
101
  ```python
@@ -61,6 +61,23 @@ with Browser.launch() as browser:
61
61
 
62
62
  Tool names can repeat across frames. Pass the selected tool's `frame_id` to bind the call to its page context.
63
63
 
64
+ ## Inspect availability after navigation
65
+
66
+ Raw navigation data includes `webmcp` when the enabled Chrome integration finds
67
+ allowed page tools within its bounded discovery window:
68
+
69
+ ```python
70
+ from agentbrowser import Browser
71
+
72
+ with Browser.launch() as browser:
73
+ navigation = browser.native.data("navigate", url="https://example.com")
74
+ print(navigation.get("webmcp"))
75
+ ```
76
+
77
+ The field reports `experimental`, `available`, and `toolCount`. An absent field
78
+ can mean the page registers its tools later. Call `browser.webmcp.list()` after
79
+ the page is ready to discover those tools.
80
+
64
81
  ## Detach from long-running work
65
82
 
66
83
  The focused snippet assumes `browser`, `tool`, and `params` belong to an active controller and a tool selected from `webmcp.list()`.
@@ -81,6 +81,12 @@ description: Exact method contracts for page, query, capture, tabs, state, netwo
81
81
  | `close(*, id=None, label=None, index=None)` | Close a selected or active tab and return `TabCloseResult`. Numeric `index` maps to the stable `tN` suffix. |
82
82
 
83
83
  Labels are unique within one session. They start with an ASCII letter and contain letters, digits, hyphens, or underscores.
84
+
85
+ New tabs inherit configured session headers, credentials, user agent, locale,
86
+ timezone, geolocation, offline mode, routes, color scheme, and init scripts
87
+ before their first navigation. The native `click` action with `newTab=True`
88
+ uses the same setup path.
89
+
84
90
  ## `browser.session`
85
91
 
86
92
  `session.status() -> SessionStatus` reports native session identity, process state, browser state, restore validation, and the latest persistence result. It can inspect a lazy session before Chrome launches.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyagentbrowser"
3
- version = "0.36.0.2"
3
+ version = "0.37.0"
4
4
  description = "Python SDK for controlling the native agent-browser engine in-process"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -22,6 +22,7 @@ URL_TARGET_FIELDS: dict[str, tuple[str, ...]] = {
22
22
  "pushstate": ("url",),
23
23
  "read": ("url",),
24
24
  "recording_start": ("url",),
25
+ "recording_restart": ("url",),
25
26
  "tab_new": ("url",),
26
27
  "vitals": ("url",),
27
28
  }
@@ -11,6 +11,7 @@ from agentbrowser.models import (
11
11
  SnapshotDiff,
12
12
  )
13
13
 
14
+ CDP_URL_ACTIONS = frozenset({"a11y", "recording_start", "recording_restart"})
14
15
  CDP_INVALIDATING_ACTIONS = frozenset(
15
16
  {
16
17
  "navigate",
@@ -105,8 +106,9 @@ def action_invalidates_cdp(
105
106
  action: str,
106
107
  params: Mapping[str, Any] | None = None,
107
108
  ) -> bool:
108
- if action == "a11y":
109
- return params is not None and isinstance(params.get("url"), str)
109
+ if action in CDP_URL_ACTIONS:
110
+ url = params.get("url") if params is not None else None
111
+ return isinstance(url, str) and (action == "a11y" or bool(url))
110
112
  return action in CDP_INVALIDATING_ACTIONS
111
113
 
112
114
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "commit": "471ab3852b47b98847f1d9c855c272bb62d0d50b",
3
+ "version": "0.37.0"
4
+ }
@@ -4,7 +4,7 @@ import json
4
4
  from pathlib import Path
5
5
 
6
6
  PACKAGE_NAME = "pyagentbrowser"
7
- PACKAGE_VERSION = "0.36.0.2"
7
+ PACKAGE_VERSION = "0.37.0"
8
8
 
9
9
  _UPSTREAM = json.loads(Path(__file__).with_name("_upstream.json").read_text())
10
10
  UPSTREAM_VERSION = str(_UPSTREAM["version"])
@@ -9,6 +9,7 @@ from typing import TYPE_CHECKING, Any, Generic, Literal, Self, TypeVar, cast, ov
9
9
  from weakref import proxy as weak_proxy
10
10
 
11
11
  from agentbrowser._browser_common import (
12
+ CDP_URL_ACTIONS,
12
13
  INTERNAL_SHUTDOWN_ACTION,
13
14
  action_clears_pending_confirmation,
14
15
  action_closes_browser,
@@ -774,7 +775,7 @@ class Browser:
774
775
  params=params,
775
776
  force_cdp_invalidation=compound_invalidation,
776
777
  )
777
- elif compound_invalidation and action == "a11y":
778
+ elif compound_invalidation:
778
779
  self._invalidate_cdp()
779
780
  return response
780
781
 
@@ -818,9 +819,9 @@ class Browser:
818
819
  params.get("confirmation_id") if action in {"confirm", "deny"} else None
819
820
  )
820
821
  pending_id = str(confirmation_value) if confirmation_value is not None else None
821
- # URL audits navigate before axe runs. Preserve that lifecycle fact
822
- # across confirmation because the confirmed response omits the URL.
823
- compound_invalidation = action == "a11y" and action_invalidates_cdp(action, params)
822
+ # URL commands can fail after navigation. Preserve invalidation across
823
+ # confirmation because the confirmed response omits the URL.
824
+ compound_invalidation = action in CDP_URL_ACTIONS and action_invalidates_cdp(action, params)
824
825
  if action == "confirm" and pending_id in self._pending_cdp_invalidations:
825
826
  compound_invalidation = True
826
827
  return pending_id, compound_invalidation
@@ -10,6 +10,7 @@ from typing import TYPE_CHECKING, Any, Generic, Literal, Self, TypeVar, cast, ov
10
10
  from weakref import proxy as weak_proxy
11
11
 
12
12
  from agentbrowser._browser_common import (
13
+ CDP_URL_ACTIONS,
13
14
  action_clears_pending_confirmation,
14
15
  action_closes_browser,
15
16
  action_invalidates_cdp,
@@ -746,7 +747,7 @@ class AsyncBrowser:
746
747
  params=params,
747
748
  force_cdp_invalidation=compound_invalidation,
748
749
  )
749
- elif compound_invalidation and action == "a11y":
750
+ elif compound_invalidation:
750
751
  self._invalidate_cdp()
751
752
  return response
752
753
 
@@ -790,9 +791,9 @@ class AsyncBrowser:
790
791
  params.get("confirmation_id") if action in {"confirm", "deny"} else None
791
792
  )
792
793
  pending_id = str(confirmation_value) if confirmation_value is not None else None
793
- # URL audits navigate before axe runs. Preserve that lifecycle fact
794
- # across confirmation because the confirmed response omits the URL.
795
- compound_invalidation = action == "a11y" and action_invalidates_cdp(action, params)
794
+ # URL commands can fail after navigation. Preserve invalidation across
795
+ # confirmation because the confirmed response omits the URL.
796
+ compound_invalidation = action in CDP_URL_ACTIONS and action_invalidates_cdp(action, params)
796
797
  if action == "confirm" and pending_id in self._pending_cdp_invalidations:
797
798
  compound_invalidation = True
798
799
  return pending_id, compound_invalidation
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "agent-browser"
3
- version = "0.36.0"
3
+ version = "0.37.0"
4
4
  edition = "2021"
5
5
  description = "Fast browser automation CLI for AI agents"
6
6
  license = "Apache-2.0"
@@ -1672,52 +1672,28 @@ fn parse_command_inner(args: &[String], flags: &Flags) -> Result<Value, ParseErr
1672
1672
  "record" => {
1673
1673
  const VALID: &[&str] = &["start", "stop", "restart"];
1674
1674
  match rest.first().copied() {
1675
- Some("start") => {
1676
- let path = rest.get(1).ok_or_else(|| ParseError::MissingArguments {
1677
- context: "record start".to_string(),
1678
- usage: "record start <output.webm> [url]",
1679
- })?;
1680
- // Optional URL parameter
1681
- let url = rest.get(2);
1682
- let mut cmd = json!({ "id": id, "action": "recording_start", "path": path });
1683
- if let Some(u) = url {
1684
- // Add https:// prefix if needed (preserve special schemes)
1685
- let url_str = if u.starts_with("http") || u.contains("://") {
1686
- u.to_string()
1687
- } else {
1688
- format!("https://{}", u)
1689
- };
1690
- cmd["url"] = json!(url_str);
1691
- }
1692
- Ok(cmd)
1693
- }
1675
+ Some("start") => parse_record_take(
1676
+ &id,
1677
+ "recording_start",
1678
+ &rest[1..],
1679
+ "record start",
1680
+ "record start <output.webm|output.mp4> [url] [--fps <n>]",
1681
+ ),
1694
1682
  Some("stop") => Ok(json!({ "id": id, "action": "recording_stop" })),
1695
- Some("restart") => {
1696
- let path = rest.get(1).ok_or_else(|| ParseError::MissingArguments {
1697
- context: "record restart".to_string(),
1698
- usage: "record restart <output.webm> [url]",
1699
- })?;
1700
- // Optional URL parameter
1701
- let url = rest.get(2);
1702
- let mut cmd = json!({ "id": id, "action": "recording_restart", "path": path });
1703
- if let Some(u) = url {
1704
- // Add https:// prefix if needed (preserve special schemes)
1705
- let url_str = if u.starts_with("http") || u.contains("://") {
1706
- u.to_string()
1707
- } else {
1708
- format!("https://{}", u)
1709
- };
1710
- cmd["url"] = json!(url_str);
1711
- }
1712
- Ok(cmd)
1713
- }
1683
+ Some("restart") => parse_record_take(
1684
+ &id,
1685
+ "recording_restart",
1686
+ &rest[1..],
1687
+ "record restart",
1688
+ "record restart <output.webm|output.mp4> [url] [--fps <n>]",
1689
+ ),
1714
1690
  Some(sub) => Err(ParseError::UnknownSubcommand {
1715
1691
  subcommand: sub.to_string(),
1716
1692
  valid_options: VALID,
1717
1693
  }),
1718
1694
  None => Err(ParseError::MissingArguments {
1719
1695
  context: "record".to_string(),
1720
- usage: "record <start|stop|restart> [path] [url]",
1696
+ usage: "record <start|stop|restart> [path] [url] [--fps <n>]",
1721
1697
  }),
1722
1698
  }
1723
1699
  }
@@ -2345,6 +2321,100 @@ fn parse_read(rest: &[&str], id: &str, flags: &Flags) -> Result<Value, ParseErro
2345
2321
  Ok(cmd)
2346
2322
  }
2347
2323
 
2324
+ /// Parse the arguments shared by `record start` and `record restart`:
2325
+ /// `<path> [url] [--fps <n>]`.
2326
+ ///
2327
+ /// `rest` excludes the subcommand. `path` needs an extension so ffmpeg can
2328
+ /// pick a container (`.webm` and `.mp4` are the tuned ones). Recording
2329
+ /// defaults to
2330
+ /// `recording::DEFAULT_FPS`; `--fps` accepts anything up to
2331
+ /// `recording::MAX_FPS`, with 60 reserved for motion-heavy takes.
2332
+ fn parse_record_take(
2333
+ id: &str,
2334
+ action: &str,
2335
+ rest: &[&str],
2336
+ context: &str,
2337
+ usage: &'static str,
2338
+ ) -> Result<Value, ParseError> {
2339
+ let max_fps = crate::native::recording::MAX_FPS;
2340
+ let mut path: Option<&str> = None;
2341
+ let mut url: Option<&str> = None;
2342
+ let mut fps: Option<u32> = None;
2343
+
2344
+ let mut i = 0;
2345
+ while i < rest.len() {
2346
+ match rest[i] {
2347
+ "--fps" => {
2348
+ let value = rest
2349
+ .get(i + 1)
2350
+ .ok_or_else(|| ParseError::MissingArguments {
2351
+ context: format!("{} --fps", context),
2352
+ usage,
2353
+ })?;
2354
+ let parsed = value.parse::<u32>().map_err(|_| ParseError::InvalidValue {
2355
+ message: format!("Invalid fps: '{}' is not a valid integer", value),
2356
+ usage,
2357
+ })?;
2358
+ if parsed == 0 || parsed > max_fps {
2359
+ return Err(ParseError::InvalidValue {
2360
+ message: format!(
2361
+ "Invalid fps: {} is out of range (valid range: 1-{})",
2362
+ parsed, max_fps
2363
+ ),
2364
+ usage,
2365
+ });
2366
+ }
2367
+ fps = Some(parsed);
2368
+ i += 2;
2369
+ }
2370
+ flag if flag.starts_with("--") => {
2371
+ return Err(ParseError::InvalidValue {
2372
+ message: format!("Unknown flag for {}: {}", context, flag),
2373
+ usage,
2374
+ });
2375
+ }
2376
+ positional => {
2377
+ if path.is_none() {
2378
+ path = Some(positional);
2379
+ } else if url.is_none() {
2380
+ url = Some(positional);
2381
+ } else {
2382
+ return Err(ParseError::InvalidValue {
2383
+ message: format!("Unexpected argument for {}: {}", context, positional),
2384
+ usage,
2385
+ });
2386
+ }
2387
+ i += 1;
2388
+ }
2389
+ }
2390
+ }
2391
+
2392
+ let path = path.ok_or_else(|| ParseError::MissingArguments {
2393
+ context: context.to_string(),
2394
+ usage,
2395
+ })?;
2396
+
2397
+ // ffmpeg picks the container from the extension and only fails at
2398
+ // `record stop`, so reject extensionless paths before the daemon is asked.
2399
+ crate::native::recording::validate_output_path(path)
2400
+ .map_err(|message| ParseError::InvalidValue { message, usage })?;
2401
+
2402
+ let mut cmd = json!({ "id": id, "action": action, "path": path });
2403
+ if let Some(u) = url {
2404
+ // Add https:// prefix if needed (preserve special schemes)
2405
+ let url_str = if u.starts_with("http") || u.contains("://") {
2406
+ u.to_string()
2407
+ } else {
2408
+ format!("https://{}", u)
2409
+ };
2410
+ cmd["url"] = json!(url_str);
2411
+ }
2412
+ if let Some(rate) = fps {
2413
+ cmd["fps"] = json!(rate);
2414
+ }
2415
+ Ok(cmd)
2416
+ }
2417
+
2348
2418
  fn parse_react(rest: &[&str], id: &str) -> Result<Value, ParseError> {
2349
2419
  const VALID: &[&str] = &["tree", "inspect", "renders", "suspense"];
2350
2420
  let sub = rest.first().copied().ok_or(ParseError::MissingArguments {
@@ -4790,6 +4860,175 @@ mod tests {
4790
4860
  assert_eq!(cmd["action"], "recording_start");
4791
4861
  assert_eq!(cmd["path"], "output.webm");
4792
4862
  assert!(cmd.get("url").is_none());
4863
+ // Omitting --fps lets the daemon apply its 30 fps default.
4864
+ assert!(cmd.get("fps").is_none());
4865
+ }
4866
+
4867
+ #[test]
4868
+ fn test_record_start_with_fps() {
4869
+ let cmd =
4870
+ parse_command(&args("record start output.webm --fps 60"), &default_flags()).unwrap();
4871
+ assert_eq!(cmd["action"], "recording_start");
4872
+ assert_eq!(cmd["path"], "output.webm");
4873
+ assert_eq!(cmd["fps"], 60);
4874
+ }
4875
+
4876
+ #[test]
4877
+ fn test_record_start_with_url_and_fps() {
4878
+ let cmd = parse_command(
4879
+ &args("record start demo.webm example.com --fps 24"),
4880
+ &default_flags(),
4881
+ )
4882
+ .unwrap();
4883
+ assert_eq!(cmd["path"], "demo.webm");
4884
+ assert_eq!(cmd["url"], "https://example.com");
4885
+ assert_eq!(cmd["fps"], 24);
4886
+ }
4887
+
4888
+ #[test]
4889
+ fn test_record_start_with_fps_before_url() {
4890
+ let cmd = parse_command(
4891
+ &args("record start demo.webm --fps 60 https://example.com"),
4892
+ &default_flags(),
4893
+ )
4894
+ .unwrap();
4895
+ assert_eq!(cmd["path"], "demo.webm");
4896
+ assert_eq!(cmd["url"], "https://example.com");
4897
+ assert_eq!(cmd["fps"], 60);
4898
+ }
4899
+
4900
+ #[test]
4901
+ fn test_record_start_rejects_fps_above_max() {
4902
+ let result = parse_command(&args("record start demo.webm --fps 120"), &default_flags());
4903
+ assert!(matches!(
4904
+ result.unwrap_err(),
4905
+ ParseError::InvalidValue { .. }
4906
+ ));
4907
+ }
4908
+
4909
+ #[test]
4910
+ fn test_record_start_rejects_zero_fps() {
4911
+ let result = parse_command(&args("record start demo.webm --fps 0"), &default_flags());
4912
+ assert!(matches!(
4913
+ result.unwrap_err(),
4914
+ ParseError::InvalidValue { .. }
4915
+ ));
4916
+ }
4917
+
4918
+ #[test]
4919
+ fn test_record_start_accepts_any_extension() {
4920
+ // .webm and .mp4 are the documented formats; other containers
4921
+ // worked before validation existed and are still passed through.
4922
+ for path in [
4923
+ "demo.mp4",
4924
+ "./out/DEMO.WEBM",
4925
+ "Take.Mp4",
4926
+ "take.mkv",
4927
+ "take.mov",
4928
+ "dir.v2/take.MP4",
4929
+ ] {
4930
+ let cmd = parse_command(&args(&format!("record start {}", path)), &default_flags())
4931
+ .unwrap_or_else(|e| panic!("{} should parse: {:?}", path, e));
4932
+ assert_eq!(cmd["action"], "recording_start");
4933
+ assert_eq!(cmd["path"], path);
4934
+ }
4935
+ }
4936
+
4937
+ #[test]
4938
+ fn test_record_start_rejects_extensionless_path() {
4939
+ for path in ["take", "dir.v2/take", ".hidden"] {
4940
+ let err = parse_command(&args(&format!("record start {}", path)), &default_flags())
4941
+ .unwrap_err();
4942
+ match err {
4943
+ ParseError::InvalidValue { message, usage } => {
4944
+ assert!(message.contains(path), "should name the path: {}", message);
4945
+ assert!(message.contains("no extension"), "message was: {}", message);
4946
+ assert!(
4947
+ message.contains(".webm"),
4948
+ "should suggest .webm: {}",
4949
+ message
4950
+ );
4951
+ assert!(message.contains(".mp4"), "should suggest .mp4: {}", message);
4952
+ assert!(usage.starts_with("record start"), "usage was: {}", usage);
4953
+ }
4954
+ other => panic!("expected InvalidValue for {}, got {:?}", path, other),
4955
+ }
4956
+ }
4957
+ }
4958
+
4959
+ #[test]
4960
+ fn test_record_start_rejects_extensionless_path_with_valid_fps() {
4961
+ // The path is validated once all flags are parsed, so a bad path
4962
+ // is reported even when --fps is fine.
4963
+ let err = parse_command(&args("record start take --fps 60"), &default_flags()).unwrap_err();
4964
+ assert!(
4965
+ matches!(err, ParseError::InvalidValue { ref message, .. } if message.contains("output path"))
4966
+ );
4967
+ }
4968
+
4969
+ #[test]
4970
+ fn test_record_restart_rejects_extensionless_path() {
4971
+ let err = parse_command(&args("record restart take2"), &default_flags()).unwrap_err();
4972
+ match err {
4973
+ ParseError::InvalidValue { message, usage } => {
4974
+ assert!(message.contains("take2"), "message was: {}", message);
4975
+ assert!(usage.starts_with("record restart"), "usage was: {}", usage);
4976
+ }
4977
+ other => panic!("expected InvalidValue, got {:?}", other),
4978
+ }
4979
+ }
4980
+
4981
+ #[test]
4982
+ fn test_record_start_rejects_non_numeric_fps() {
4983
+ let result = parse_command(&args("record start demo.webm --fps fast"), &default_flags());
4984
+ assert!(matches!(
4985
+ result.unwrap_err(),
4986
+ ParseError::InvalidValue { .. }
4987
+ ));
4988
+ }
4989
+
4990
+ #[test]
4991
+ fn test_record_start_rejects_fps_without_value() {
4992
+ let result = parse_command(&args("record start demo.webm --fps"), &default_flags());
4993
+ assert!(matches!(
4994
+ result.unwrap_err(),
4995
+ ParseError::MissingArguments { .. }
4996
+ ));
4997
+ }
4998
+
4999
+ #[test]
5000
+ fn test_record_start_rejects_unknown_flag() {
5001
+ let result = parse_command(&args("record start demo.webm --smooth"), &default_flags());
5002
+ match result.unwrap_err() {
5003
+ ParseError::InvalidValue { message, .. } => {
5004
+ assert!(message.contains("--smooth"), "got: {message}");
5005
+ }
5006
+ other => panic!("expected InvalidValue, got {other:?}"),
5007
+ }
5008
+ }
5009
+
5010
+ #[test]
5011
+ fn test_record_start_rejects_extra_positional() {
5012
+ let result = parse_command(
5013
+ &args("record start demo.webm example.com extra"),
5014
+ &default_flags(),
5015
+ );
5016
+ assert!(matches!(
5017
+ result.unwrap_err(),
5018
+ ParseError::InvalidValue { .. }
5019
+ ));
5020
+ }
5021
+
5022
+ #[test]
5023
+ fn test_record_restart_with_fps() {
5024
+ let cmd = parse_command(
5025
+ &args("record restart take2.webm --fps 60"),
5026
+ &default_flags(),
5027
+ )
5028
+ .unwrap();
5029
+ assert_eq!(cmd["action"], "recording_restart");
5030
+ assert_eq!(cmd["path"], "take2.webm");
5031
+ assert_eq!(cmd["fps"], 60);
4793
5032
  }
4794
5033
 
4795
5034
  #[test]
@@ -1456,6 +1456,14 @@ mod tests {
1456
1456
  assert_eq!(cleaned, vec!["open", "example.com"]);
1457
1457
  }
1458
1458
 
1459
+ #[test]
1460
+ fn test_clean_args_keeps_record_fps() {
1461
+ // --fps belongs to `record`, so it must reach the command parser even
1462
+ // when global flags are mixed in.
1463
+ let cleaned = clean_args(&args("--json record start demo.webm --fps 60"));
1464
+ assert_eq!(cleaned, vec!["record", "start", "demo.webm", "--fps", "60"]);
1465
+ }
1466
+
1459
1467
  #[test]
1460
1468
  fn test_parse_idle_timeout_flag_converts_to_ms() {
1461
1469
  let flags = parse_flags(&args("--idle-timeout 10s open example.com"));