agentenv-framework-protocol 0.1.516__tar.gz → 0.1.521__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 (179) hide show
  1. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/PKG-INFO +11 -1
  2. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/README.md +10 -0
  3. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/pyproject.toml +1 -1
  4. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/browser_cdp.py +22 -12
  5. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website_browser/__init__.py +3 -3
  6. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website_browser/control.py +6 -6
  7. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website_browser/environment.py +49 -18
  8. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_browser_cdp.py +56 -3
  9. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_browser.py +35 -11
  10. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/.gitignore +0 -0
  11. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/LICENSE +0 -0
  12. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/NOTICE +0 -0
  13. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/THIRD_PARTY_NOTICES.md +0 -0
  14. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/__init__.py +0 -0
  15. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/advanced_agent.py +0 -0
  16. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/basic_agent.py +0 -0
  17. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/custom_extensions_agent.py +0 -0
  18. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/multimodal_agent.py +0 -0
  19. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/reference_model.py +0 -0
  20. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/streaming_agent.py +0 -0
  21. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/.gitignore +0 -0
  22. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/Dockerfile +0 -0
  23. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/Dockerfile.dockerignore +0 -0
  24. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/README.md +0 -0
  25. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/data/seed.json +0 -0
  26. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/env.toml +0 -0
  27. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/site.py +0 -0
  28. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/web/index.html +0 -0
  29. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/web/package-lock.json +0 -0
  30. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/web/package.json +0 -0
  31. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/web/src/main.js +0 -0
  32. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/web/src/style.css +0 -0
  33. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/examples/website/notes/web/vite.config.js +0 -0
  34. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/__init__.py +0 -0
  35. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/__init__.py +0 -0
  36. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +0 -0
  37. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
  38. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
  39. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
  40. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
  41. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
  42. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
  43. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
  44. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
  45. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/a2a_agent/tasks/v1.py +0 -0
  46. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/agent_env_environment.py +0 -0
  47. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/client.py +0 -0
  48. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/__init__.py +0 -0
  49. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_declare.py +0 -0
  50. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_desktop.py +0 -0
  51. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_job.py +0 -0
  52. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_linux.py +0 -0
  53. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_load.py +0 -0
  54. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_macos.py +0 -0
  55. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_reaping.py +0 -0
  56. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_session_posix.py +0 -0
  57. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_session_windows.py +0 -0
  58. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_windows.py +0 -0
  59. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_with_fds.py +0 -0
  60. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/_x11.py +0 -0
  61. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/app.py +0 -0
  62. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/app_data.py +0 -0
  63. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/app_runtime.py +0 -0
  64. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/apps.py +0 -0
  65. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/card.py +0 -0
  66. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/checks.py +0 -0
  67. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
  68. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
  69. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/checks.py +0 -0
  70. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/client.py +0 -0
  71. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
  72. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
  73. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
  74. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
  75. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/report.py +0 -0
  76. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
  77. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/dataplane.py +0 -0
  78. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/driver.py +0 -0
  79. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/errors.py +0 -0
  80. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/extensions.py +0 -0
  81. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/frames.py +0 -0
  82. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/keys.py +0 -0
  83. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/launch.py +0 -0
  84. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/manifest.py +0 -0
  85. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/operations.py +0 -0
  86. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/platform.py +0 -0
  87. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/prefix.py +0 -0
  88. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/queue.py +0 -0
  89. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/recording.py +0 -0
  90. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/results.py +0 -0
  91. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/run_install_step.py +0 -0
  92. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/runtime.py +0 -0
  93. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/seed.py +0 -0
  94. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/serve.py +0 -0
  95. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/serve_app.py +0 -0
  96. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/served.py +0 -0
  97. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/session.py +0 -0
  98. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/settings.py +0 -0
  99. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/skill.py +0 -0
  100. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/spaces.py +0 -0
  101. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/svc.py +0 -0
  102. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/computer/tools.py +0 -0
  103. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/errors.py +0 -0
  104. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/manifest.py +0 -0
  105. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/preflight.py +0 -0
  106. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/tool_access.py +0 -0
  107. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/tool_client.py +0 -0
  108. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/tool_context.py +0 -0
  109. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/transfers.py +0 -0
  110. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/types.py +0 -0
  111. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/__init__.py +0 -0
  112. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/clock.py +0 -0
  113. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/conformance.py +0 -0
  114. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/environment.py +0 -0
  115. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/errors.py +0 -0
  116. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/readiness.py +0 -0
  117. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/routes.py +0 -0
  118. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website/session.py +0 -0
  119. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website_browser/data.py +0 -0
  120. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website_browser/devtools.py +0 -0
  121. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/src/agentenv_protocol/website_browser/shapes.py +0 -0
  122. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/computer_fake.py +0 -0
  123. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/probe_fake.py +0 -0
  124. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_agent.py +0 -0
  125. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_agent_examples.py +0 -0
  126. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_cdp_config.py +0 -0
  127. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_object_transfers.py +0 -0
  128. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_peer_agents.py +0 -0
  129. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_proxy.py +0 -0
  130. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_staging.py +0 -0
  131. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_a2a_trajectory_log.py +0 -0
  132. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_agent_env_environment.py +0 -0
  133. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_browser_data.py +0 -0
  134. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_browser_state.py +0 -0
  135. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_client.py +0 -0
  136. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_app_data.py +0 -0
  137. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_app_server.py +0 -0
  138. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_conformance.py +0 -0
  139. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_conformance_checks.py +0 -0
  140. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_conformance_page.py +0 -0
  141. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_conformance_recording.py +0 -0
  142. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_dataplane.py +0 -0
  143. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_declare.py +0 -0
  144. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_driver.py +0 -0
  145. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_driver_keys.py +0 -0
  146. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_extensions.py +0 -0
  147. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_frames.py +0 -0
  148. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_macos.py +0 -0
  149. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_page.py +0 -0
  150. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_queue.py +0 -0
  151. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_recording.py +0 -0
  152. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_seed.py +0 -0
  153. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_serve.py +0 -0
  154. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_served.py +0 -0
  155. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_session_windows.py +0 -0
  156. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_spaces.py +0 -0
  157. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_svc_forward.py +0 -0
  158. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_tool_prefix.py +0 -0
  159. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_computer_windows_driver.py +0 -0
  160. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_control_token.py +0 -0
  161. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_data_objects.py +0 -0
  162. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_errors.py +0 -0
  163. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_extension_methods.py +0 -0
  164. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_intake.py +0 -0
  165. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_manifest.py +0 -0
  166. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_preflight.py +0 -0
  167. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_tool_access.py +0 -0
  168. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_tool_annotations.py +0 -0
  169. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_tool_client.py +0 -0
  170. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_tool_context.py +0 -0
  171. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_tool_context_fastmcp.py +0 -0
  172. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_tool_context_injection.py +0 -0
  173. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_api.py +0 -0
  174. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_conformance.py +0 -0
  175. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_environment.py +0 -0
  176. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_live.py +0 -0
  177. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_mcp.py +0 -0
  178. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_notes_example.py +0 -0
  179. {agentenv_framework_protocol-0.1.516 → agentenv_framework_protocol-0.1.521}/tests/test_website_readiness.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentenv-framework-protocol
3
- Version: 0.1.516
3
+ Version: 0.1.521
4
4
  Summary: Open data-plane protocol and server SDK for agent environments.
5
5
  Project-URL: Homepage, https://www.agentenvframework.com
6
6
  Project-URL: Documentation, https://www.agentenvframework.com/docs
@@ -325,6 +325,16 @@ Code that names none runs under `client.authorized({env_url: client.control_head
325
325
  within it, a call to an address under `env_url` sends those headers. agent-env runs every task
326
326
  step, a verifier's `verify` included, under such a grant for each environment it deployed.
327
327
 
328
+ The env gateway agent-env deploys in front of an environment's servers takes the same token in the
329
+ same header, but for now checks it only on tool access (`POST /tools/disable`, `POST /tools/enable`)
330
+ and on the writes of triggers and notifications (`/triggers/register`, `/triggers/remove`,
331
+ `/triggers/clear`, `/notifications/config`, `/notifications/take`, `/notifications/clear`). A call to
332
+ one of those without it gets 401 and `{"ok": false, "error": "this route takes the env's control
333
+ token"}`. Its other routes, the clock's writes, the state reads, `/svc` and `/agentenv` among them,
334
+ stay open while callers outside agent-env use them without the token. No card, the gateway's or an
335
+ environment's, marks which routes take it: a client sends the token to every route but the MCP
336
+ endpoint and the card, and an open route ignores it.
337
+
328
338
  ### Tool access without a gateway
329
339
 
330
340
  An environment agents reach directly, with no gateway in front, can enforce per-role tool access
@@ -258,6 +258,16 @@ Code that names none runs under `client.authorized({env_url: client.control_head
258
258
  within it, a call to an address under `env_url` sends those headers. agent-env runs every task
259
259
  step, a verifier's `verify` included, under such a grant for each environment it deployed.
260
260
 
261
+ The env gateway agent-env deploys in front of an environment's servers takes the same token in the
262
+ same header, but for now checks it only on tool access (`POST /tools/disable`, `POST /tools/enable`)
263
+ and on the writes of triggers and notifications (`/triggers/register`, `/triggers/remove`,
264
+ `/triggers/clear`, `/notifications/config`, `/notifications/take`, `/notifications/clear`). A call to
265
+ one of those without it gets 401 and `{"ok": false, "error": "this route takes the env's control
266
+ token"}`. Its other routes, the clock's writes, the state reads, `/svc` and `/agentenv` among them,
267
+ stay open while callers outside agent-env use them without the token. No card, the gateway's or an
268
+ environment's, marks which routes take it: a client sends the token to every route but the MCP
269
+ endpoint and the card, and an open route ignores it.
270
+
261
271
  ### Tool access without a gateway
262
272
 
263
273
  An environment agents reach directly, with no gateway in front, can enforce per-role tool access
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentenv-framework-protocol"
3
- version = "0.1.516"
3
+ version = "0.1.521"
4
4
  description = "Open data-plane protocol and server SDK for agent environments."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -59,11 +59,13 @@ GUARDED = {"refuse": "refused", "send": "changed", "answer": "answered", "close"
59
59
 
60
60
  @dataclass
61
61
  class Address:
62
- """A user's CDP address: ``http_url``, the base clients discover from, and ``ws_url``, the browser's WebSocket."""
62
+ """A user's CDP address: ``http_url``, the base clients discover from, and ``ws_url``, the browser's WebSocket;
63
+ ``named`` when it's under an origin the caller named, where its agent reaches the env."""
63
64
 
64
65
  user: str
65
66
  http_url: str
66
67
  ws_url: str
68
+ named: bool = False
67
69
 
68
70
 
69
71
  def reached(request: Request) -> str:
@@ -74,6 +76,12 @@ def reached(request: Request) -> str:
74
76
  return f"{proto}://{host}{request.headers.get('x-forwarded-prefix', '')}".rstrip("/")
75
77
 
76
78
 
79
+ def under(origin: str, request: Request) -> str:
80
+ """The address a request reached the browser at, under ``origin``, where the caller's agent reaches the env: the
81
+ origin, then the path prefix the driver forwarded."""
82
+ return f"{origin.rstrip('/')}{request.headers.get('x-forwarded-prefix', '')}".rstrip("/")
83
+
84
+
77
85
  def websocket_form(url: str) -> str:
78
86
  return "wss://" + url.removeprefix("https://") if url.startswith("https://") else \
79
87
  "ws://" + url.removeprefix("http://")
@@ -83,31 +91,33 @@ def _hash(token: str) -> str:
83
91
  return hashlib.sha256(token.encode()).hexdigest()
84
92
 
85
93
 
86
- def _address(user: str, base: str, token: str) -> Address:
94
+ def _address(user: str, base: str, named: bool, token: str) -> Address:
87
95
  root = f"{base}{ROUTE}{token}"
88
- return Address(user, f"{root}/", f"{websocket_form(root)}/devtools/browser")
96
+ return Address(user, f"{root}/", f"{websocket_form(root)}/devtools/browser", named)
89
97
 
90
98
 
91
99
  class Tokens:
92
100
  """The tokens minted, one per user: in memory, so asking twice gives the same address, and in ``path`` only by
93
- hash, with the user and the base address, so an address still works after the server restarts while the
94
- computer's session, which can read the file, can't use one."""
101
+ hash, with the user, the base address and whether its caller named it, so an address still works after the server
102
+ restarts while the computer's session, which can read the file, can't use one."""
95
103
 
96
104
  def __init__(self, path: Path) -> None:
97
105
  self.path = path
98
106
  self._minted: dict[str, Address] = {}
99
107
  try:
100
108
  stored = json.loads(path.read_text())
101
- self._known = {digest: (entry["user"], entry["base"]) for digest, entry in stored.items()}
109
+ self._known = {digest: (entry["user"], entry["base"], entry["named"])
110
+ for digest, entry in stored.items()}
102
111
  except (OSError, ValueError, TypeError, KeyError):
103
112
  self._known = {}
104
113
 
105
- def mint(self, user: str, base: str) -> Address:
106
- """``user``'s address under ``base``: the one minted before, else a new one."""
114
+ def mint(self, user: str, base: str, *, named: bool = False) -> Address:
115
+ """``user``'s address under ``base``, ``named`` when its caller named where its agent reaches the env: the one
116
+ minted before, else a new one."""
107
117
  if user not in self._minted:
108
118
  token = secrets.token_urlsafe(TOKEN_BYTES)
109
- self._minted[user] = _address(user, base, token)
110
- self._known[_hash(token)] = (user, base)
119
+ self._minted[user] = _address(user, base, named, token)
120
+ self._known[_hash(token)] = (user, base, named)
111
121
  self._save()
112
122
  return self._minted[user]
113
123
 
@@ -124,8 +134,8 @@ class Tokens:
124
134
  def _save(self) -> None:
125
135
  self.path.parent.mkdir(parents=True, exist_ok=True)
126
136
  part = self.path.with_name(f".{self.path.name}.part")
127
- part.write_text(json.dumps({digest: {"user": user, "base": base}
128
- for digest, (user, base) in self._known.items()}))
137
+ part.write_text(json.dumps({digest: {"user": user, "base": base, "named": named}
138
+ for digest, (user, base, named) in self._known.items()}))
129
139
  os.replace(part, self.path)
130
140
 
131
141
 
@@ -2,9 +2,9 @@
2
2
  its build installs and starts; this class adds what agentenv owns, the same in both: its flags after the subclass's
3
3
  command, the unattended-use policies, a CDP connection over the browser's debugging pipe, the settings every browser
4
4
  takes, a fresh cache and the deploy's prompt answers at every launch, another window for a launch while it runs, its
5
- skill and ``browser/v1`` on its card. It runs alone, headless, on a computer with no display, a browser computer's,
6
- whose screen is its page; which site proxy it goes through comes from a variable agentenv sets, never from its
7
- settings."""
5
+ skill and ``browser/v1`` on its card. It runs alone on a computer with no display, a browser computer's, whose screen
6
+ is its page, headful on an X server that computer gives it alone, else headless; which site proxy it goes through comes
7
+ from a variable agentenv sets, never from its settings."""
8
8
  from .control import (ACTIVE_CHECK_TIMEOUT_S, AGENT, AGENTENV, CAPTURE_TIMEOUT_S, DOWNLOADS, EXIT, FAILED,
9
9
  HASH_CHUNK_BYTES, LIVE_START_TAB_TIMEOUT_S, LOADED, PAGE_INPUT, PAGES, PIN_TIMEOUT_S, STOP,
10
10
  TIMED_OUT, UNKNOWN, UNNAVIGATED_CAPTURE_TIMEOUT_S, UPLOADS, BrowserControl)
@@ -26,7 +26,7 @@ logger = logging.getLogger(__name__)
26
26
  AGENTENV, UNKNOWN, EXIT, STOP = "agentenv", "unknown", "exit", "stop"
27
27
  #: How long the active tab's check waits on each page.
28
28
  ACTIVE_CHECK_TIMEOUT_S = 2.0
29
- #: How long a tab opened headless may take to be attached and held to its window's size, which is also how long a page
29
+ #: How long a tab opened alone may take to be attached and held to its window's size, which is also how long a page
30
30
  #: of agentenv's own may take to reach an origin, and how often it's asked meanwhile.
31
31
  PIN_TIMEOUT_S = 10.0
32
32
  ARRIVAL_POLL_S = 0.05
@@ -75,7 +75,7 @@ class BrowserControl:
75
75
  self._closing: set[str] = set()
76
76
  self._open_dialogs: dict[str, dict] = {}
77
77
  self._answering: set[str] = set()
78
- #: The file chooser each page's session opened that waits, headless, and the tab agentenv last brought to the
78
+ #: The file chooser each page's session opened that waits, alone, and the tab agentenv last brought to the
79
79
  #: front.
80
80
  self._choosers: dict[str, dict] = {}
81
81
  self._front: Optional[str] = None
@@ -132,7 +132,7 @@ class BrowserControl:
132
132
 
133
133
  async def open_tab(self, url: Optional[str] = None, background: bool = False) -> str:
134
134
  """A new tab at ``url``, else blank, brought to the front, or with ``background`` behind the active tab, which
135
- stays active, brought back only if the new tab took its place; its id. Headless, it opens blank and goes to
135
+ stays active, brought back only if the new tab took its place; its id. Alone, it opens blank and goes to
136
136
  ``url`` once it's held to the window's size, so its page loads at that size."""
137
137
  active = await self.active_tab() if background else None
138
138
  held = self.viewport is not None and url
@@ -151,7 +151,7 @@ class BrowserControl:
151
151
  async def load_start_tabs(self, urls: list[str], site_of: Callable[[str], Optional[str]], own_timeout_s: float,
152
152
  live_timeout_s: float = LIVE_START_TAB_TIMEOUT_S) -> list[dict]:
153
153
  """Each of ``urls`` in a start tab, in order, the first then active: in the tabs open now, in opened order, and
154
- in tabs it opens blank after them; each held to the window's size, headless, before it goes to its URL, and
154
+ in tabs it opens blank after them; each held to the window's size, alone, before it goes to its URL, and
155
155
  all loading at once. A tab settles once it has loaded, once it has failed, which on one of the env's own sites,
156
156
  as ``site_of`` names them, an error status is too, or once it has been waited on ``own_timeout_s`` on such a
157
157
  site, else ``live_timeout_s``. Each tab's outcome, in order, kept though the browser has gone and the first
@@ -635,8 +635,8 @@ class BrowserControl:
635
635
  self._spawn(self._let_run(params["sessionId"]))
636
636
 
637
637
  async def _let_run(self, session: str) -> None:
638
- """A page it attached to, enabled and, headless, held to its window's size, then told to run: a page attached as
639
- it opens, a popup say, or any new page headless, waits for that before it runs."""
638
+ """A page it attached to, enabled and, alone, held to its window's size, then told to run: a page attached as
639
+ it opens, a popup say, or any new page alone, waits for that before it runs."""
640
640
  target = self._sessions.get(session)
641
641
  try:
642
642
  await self.devtools.call("Page.enable", session_id=session)
@@ -18,7 +18,7 @@ from starlette.websockets import WebSocket
18
18
 
19
19
  from ..agent_env_environment import (OP_ADD_DATA, add_data, add_websocket_route, agent_skill, extension, get_data,
20
20
  reset_data)
21
- from ..browser_cdp import ROUTE, Relay, Tokens, reached, websocket_form
21
+ from ..browser_cdp import ROUTE, Relay, Tokens, reached, under, websocket_form
22
22
  from ..computer import AppDeclaration, ComputerAppEnvironment, Launch, install_step, ready_check
23
23
  from ..computer import app as computer_app
24
24
  from ..computer import app_data
@@ -42,7 +42,7 @@ SITES = SOCKET.parent / "sites.json"
42
42
  #: port, since the browser is reached only over its pipe.
43
43
  OWNED_FLAGS = ("--user-data-dir", "--remote-debugging-", "--remote-allow-origins", "--proxy-", "--no-proxy-server",
44
44
  "--headless", "--window-size", "--lang", "--force-webrtc-ip-handling-policy", "--disk-cache-dir",
45
- "--disable-dev-shm-usage")
45
+ "--disable-dev-shm-usage", "--enable-unsafe-swiftshader")
46
46
  #: Below this much /dev/shm, as Docker's 64 MiB default, the browser keeps its shared memory in files instead.
47
47
  SHM_MIN_BYTES = 1 << 30
48
48
  #: Chromium's content setting that denies a permission without a prompt.
@@ -163,7 +163,8 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
163
163
 
164
164
  def agentenv_flags(self) -> list[str]:
165
165
  """The flags agentenv owns. A browser alone goes out only through its site proxy, so it won't launch without
166
- one; in a computer it goes through one when the computer has one, loopback aside."""
166
+ one; in a computer it goes through one when the computer has one, loopback aside. Alone it runs headful on the
167
+ X server its computer gives it, where WebGL draws with SwiftShader since no GPU is there, else headless."""
167
168
  settings, alone, proxy = self.settings, _alone(), os.environ.get(SITE_PROXY_ENV)
168
169
  flags = [f"--user-data-dir={self.profile_dir()}", f"--disk-cache-dir={self.cache_dir()}",
169
170
  "--remote-debugging-pipe", "--no-first-run", "--no-default-browser-check", f"--lang={settings.locale}"]
@@ -179,8 +180,7 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
179
180
  "names none")
180
181
  if alone:
181
182
  flags.append(f"--window-size={settings.window.width},{settings.window.height}")
182
- if alone:
183
- flags.append("--headless=new")
183
+ flags.append("--enable-unsafe-swiftshader" if _x_server() else "--headless=new")
184
184
  return flags
185
185
 
186
186
  def _launch_for(self, launch: Launch) -> Launch:
@@ -304,12 +304,13 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
304
304
  "is its window's, a PNG of it, and CDP input calls sent to it in order. navigate and history open a URL in "
305
305
  "the active tab, or go back, forward or reload; tabs/list, tabs/open, tabs/activate and tabs/close manage "
306
306
  "its tabs by their ids; dialog/answer answers the dialog open on the active tab; files/choose gives the file "
307
- "chooser open on it files in ~/Uploads, headless; and page/state is the active tab's id, URL and title and "
307
+ "chooser open on it files in ~/Uploads, alone; and page/state is the active tab's id, URL and title and "
308
308
  "what is open on it. cookies/get, cookies/set and cookies/delete, and local_storage/get, local_storage/set and "
309
309
  "local_storage/clear, read and change its default context's cookies and local storage as Playwright's "
310
310
  "storageState has them, a cookie's max_age set as an expiry on the browser's clock; downloads/list and "
311
311
  "downloads/get are its downloads, get with its file, uploaded under a write_namespace grant or inline. cdp "
312
- "returns a user's CDP address, http_url to discover from and ws_url to connect to, "
312
+ "returns a user's CDP address, http_url to discover from and ws_url to connect to, under origin, where the "
313
+ "caller's agent reaches the env, when it names one, else at the address the call reached the browser at, "
313
314
  "with a token agentenv mints in its path: each connection to it gets its own browser-level session behind a "
314
315
  "guard, and record lists them as cdp_connections, each with the commands the guard refused or changed. "
315
316
  "sites/set hands it the env's own sites, by name and domains: a start tab on one must load, its document's "
@@ -333,11 +334,14 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
333
334
  return {}
334
335
 
335
336
  @extension(BROWSER, op="cdp")
336
- async def browser_cdp(self, user: str, request: Request) -> dict:
337
- """``user``'s CDP address at the address this call reached the browser at, once it's ready: the same one each
338
- time it's asked for, as the server that minted it keeps it."""
337
+ async def browser_cdp(self, user: str, request: Request, origin: Optional[str] = None) -> dict:
338
+ """``user``'s CDP address once the browser's ready, the same one each time it's asked for, as the server that
339
+ minted it keeps it: under ``origin``, where the caller's agent reaches the env, when the caller names it, as a
340
+ deploy names the env's other addresses, since a tunnel in front of the env may not say how it was reached;
341
+ else at the address this call reached the browser at."""
342
+ base = under(_origin(origin), request) if origin is not None else reached(request)
339
343
  await self._until_ready()
340
- address = self.cdp_tokens.mint(user, reached(request))
344
+ address = self.cdp_tokens.mint(user, base, named=origin is not None)
341
345
  return {"http_url": address.http_url, "ws_url": address.ws_url}
342
346
 
343
347
  def create_app(self) -> Any:
@@ -349,11 +353,11 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
349
353
  return app
350
354
 
351
355
  async def _cdp_discovery(self, request: Request) -> Response:
352
- """``json/version`` and ``json/list`` under a CDP address, answered from the browser, with its WebSocket at the
353
- address the client reached: a browser on a pipe has no endpoints of its own. 403 for a token agentenv didn't
354
- mint."""
356
+ """``json/version`` and ``json/list`` under a CDP address, answered from the browser, with its WebSocket as
357
+ minted when its caller named the origin, else at the address the client reached: a browser on a pipe has no
358
+ endpoints of its own. 403 for a token agentenv didn't mint."""
355
359
  token = request.path_params["token"]
356
- if self.cdp_tokens.address(token) is None:
360
+ if (address := self.cdp_tokens.address(token)) is None:
357
361
  return JSONResponse({"error": "agentenv didn't mint this CDP address"}, status_code=403)
358
362
  try:
359
363
  version = await self.devtools.call("Browser.getVersion")
@@ -362,7 +366,8 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
362
366
  "Browser": version.get("product"), "Protocol-Version": version.get("protocolVersion"),
363
367
  "User-Agent": version.get("userAgent"), "V8-Version": version.get("jsVersion"),
364
368
  "WebKit-Version": version.get("revision"),
365
- "webSocketDebuggerUrl": f"{websocket_form(reached(request))}{ROUTE}{token}/devtools/browser"})
369
+ "webSocketDebuggerUrl": address.ws_url if address.named else
370
+ f"{websocket_form(reached(request))}{ROUTE}{token}/devtools/browser"})
366
371
  tabs = await self.control.tab_list()
367
372
  except (ConnectionError, DevToolsError, asyncio.TimeoutError) as e:
368
373
  return JSONResponse({"error": f"the browser isn't answering: {e}"}, status_code=503)
@@ -600,7 +605,7 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
600
605
 
601
606
  def extension_params(self, uri: str) -> dict:
602
607
  if uri == BROWSER:
603
- params: dict[str, Any] = {"chromium": self.version, "clock": "real"}
608
+ params: dict[str, Any] = {"chromium": self.version, "clock": "real", "mode": _mode()}
604
609
  if _alone():
605
610
  params["window"] = self.settings.window.model_dump()
606
611
  return params
@@ -650,10 +655,36 @@ def start_tab_why(tab: dict) -> str:
650
655
 
651
656
 
652
657
  def _alone() -> bool:
653
- """Whether it runs on a computer with no display, a browser computer's, alone and headless."""
658
+ """Whether it runs on a computer with no display, a browser computer's, alone: its page is that computer's screen."""
654
659
  return computer_app.detect().display == "none"
655
660
 
656
661
 
662
+ def _x_server() -> bool:
663
+ """Whether an X server is there for it, as a browser computer gives its browser one no agent sees."""
664
+ return bool(os.environ.get("DISPLAY"))
665
+
666
+
667
+ def _mode() -> str:
668
+ """How it runs: headless alone with no X server, else headful, on its own X server alone or on the desktop."""
669
+ return "headless" if _alone() and not _x_server() else "headful"
670
+
671
+
672
+ def _origin(value: Any) -> str:
673
+ """``value`` as an origin a CDP address is minted under, its scheme in lower case as the address's WebSocket form
674
+ reads it: an http or https URL, a path allowed, with no query, fragment or credentials; InvalidArgument for anything
675
+ else."""
676
+ try:
677
+ parts = urlsplit(value)
678
+ valid = (value.isprintable() and parts.scheme in ("http", "https") and bool(parts.hostname)
679
+ and "@" not in parts.netloc and not parts.query and not parts.fragment
680
+ and (parts.port is None or 0 < parts.port))
681
+ except (AttributeError, TypeError, ValueError):
682
+ valid = False
683
+ if not valid:
684
+ raise InvalidArgument("origin is an http or https URL with no query, fragment or credentials")
685
+ return f"{parts.scheme}://{parts.netloc}{parts.path}"
686
+
687
+
657
688
  def _parsed(model: type[BaseModel], items: Any, what: str) -> list:
658
689
  """Each of ``items`` as ``model``; InvalidArgument naming the fields that don't fit and never their values, which
659
690
  for a cookie are its credentials."""
@@ -1,7 +1,8 @@
1
1
  """A website browser's CDP addresses: a user's token minted once, kept by hash only, so it still works after the server
2
2
  restarts and the computer's session can't use the file; the relay giving each WebSocket connection its own
3
3
  browser-level session over one pipe, its answers and events and nobody else's, until the browser goes; the guard on
4
- each command; and the cdp operation and discovery answered at the address the call reached."""
4
+ each command; and the cdp operation and discovery answered at the address the call reached, or under the origin its
5
+ caller names, which behind a tunnel that ends TLS is the only way to an https address."""
5
6
  from __future__ import annotations
6
7
 
7
8
  import asyncio
@@ -30,6 +31,8 @@ from agentenv_protocol.website_browser import SITE_PROXY_ENV, WebsiteBrowserEnvi
30
31
 
31
32
  FORWARDED = {"x-forwarded-host": "computer.test:443", "x-forwarded-proto": "https",
32
33
  "x-forwarded-prefix": "/svc/chromium"}
34
+ #: What the driver forwards behind a tunnel that ends TLS: the tunnel's host, and http, how the tunnel reached it.
35
+ BEHIND_TLS = {"x-forwarded-host": "t.tunnel.test", "x-forwarded-proto": "http", "x-forwarded-prefix": "/svc/chromium"}
33
36
 
34
37
 
35
38
  @computer_app(supports=[{"os": {"type": "linux", "display": ["x11", "none"]}, "arch": ["amd64"]}])
@@ -138,13 +141,15 @@ def test_a_users_token_is_minted_once_kept_by_hash_and_still_known_after_a_resta
138
141
  tokens = Tokens(path)
139
142
  ada = tokens.mint("ada", "https://computer.test/svc/chromium")
140
143
  again, bob = tokens.mint("ada", "https://elsewhere.test"), tokens.mint("bob", "https://computer.test/svc/chromium")
141
- token = ada.http_url.split("/cdp/")[1].strip("/")
144
+ cy = tokens.mint("cy", "https://t.tunnel.test/svc/chromium", named=True)
145
+ token, cys = (address.http_url.split("/cdp/")[1].strip("/") for address in (ada, cy))
142
146
  restarted = Tokens(path)
143
147
 
144
148
  assert again == ada and bob != ada and ada.http_url == f"https://computer.test/svc/chromium/cdp/{token}/"
145
149
  assert ada.ws_url == f"wss://computer.test/svc/chromium/cdp/{token}/devtools/browser"
146
150
  assert token not in path.read_text() and restarted.address(token) == ada and tokens.address("guess") is None
147
151
  assert restarted.mint("ada", "https://computer.test").http_url != ada.http_url
152
+ assert not ada.named and restarted.address(cys) == cy and cy.named
148
153
 
149
154
 
150
155
  @pytest.mark.asyncio
@@ -349,4 +354,52 @@ async def test_the_cdp_operation_and_discovery_answer_at_the_address_reached_and
349
354
  browser_methods = next(e["params"]["methods"] for e in card["capabilities"]["extensions"]
350
355
  if e["uri"] == "urn:agentenv:browser/v1")
351
356
  assert computer_app_params["agent_routes"] == ["/cdp/"]
352
- assert browser_methods["cdp"]["request"]["properties"] == {"user": {"type": "string"}}
357
+ assert browser_methods["cdp"]["request"]["properties"] == {"user": {"type": "string"},
358
+ "origin": {"type": "string", "default": None}}
359
+
360
+
361
+ @pytest.mark.asyncio
362
+ async def test_under_an_origin_its_caller_names_an_address_is_https_and_discovery_answers_wss_though_reached_over_http(
363
+ monkeypatch, tmp_path):
364
+ browser = _browser(monkeypatch, tmp_path)
365
+
366
+ async def ready():
367
+ return None
368
+
369
+ async def call(method, params=None, *, session_id=None, timeout_s=None):
370
+ return {"product": "Chrome/156.0.8078.4", "protocolVersion": "1.3"}
371
+
372
+ monkeypatch.setattr(browser, "_until_ready", ready)
373
+ monkeypatch.setattr(browser.devtools, "call", call)
374
+ asgi = browser.create_app().streamable_http_app()
375
+ async with httpx.AsyncClient(transport=httpx.ASGITransport(app=asgi), base_url="http://app") as http:
376
+ ada = (await http.post("/agentenv/ext/browser/cdp", json={"user": "ada", "origin": "https://t.tunnel.test/"},
377
+ headers=BEHIND_TLS)).json()
378
+ bob = (await http.post("/agentenv/ext/browser/cdp", json={"user": "bob"}, headers=BEHIND_TLS)).json()
379
+ cy = (await http.post("/agentenv/ext/browser/cdp", json={"user": "cy", "origin": "HTTPS://t.tunnel.test"},
380
+ headers=BEHIND_TLS)).json()
381
+ paths = [address["http_url"].split("/svc/chromium", 1)[1] for address in (ada, bob)]
382
+ seen = [(await http.get(f"{path}json/version", headers=BEHIND_TLS)).json()["webSocketDebuggerUrl"]
383
+ for path in paths]
384
+
385
+ token = ada["http_url"].split("/cdp/")[1].strip("/")
386
+ assert ada == {"http_url": f"https://t.tunnel.test/svc/chromium/cdp/{token}/",
387
+ "ws_url": f"wss://t.tunnel.test/svc/chromium/cdp/{token}/devtools/browser"}
388
+ assert seen[0] == ada["ws_url"]
389
+ assert bob["ws_url"].startswith("ws://t.tunnel.test/") and seen[1] == bob["ws_url"]
390
+ assert cy["http_url"].startswith("https://t.tunnel.test/svc/chromium/cdp/")
391
+ assert cy["ws_url"].startswith("wss://t.tunnel.test/svc/chromium/cdp/")
392
+
393
+
394
+ @pytest.mark.asyncio
395
+ @pytest.mark.parametrize("origin", ["ftp://t.test", "t.test", "https://", "https://t.test/?q=1", "https://t.test/#top",
396
+ "https://ada:pw@t.test", "https://t.test:0", "https://t.test:99999",
397
+ "https://t.test/\n", 7])
398
+ async def test_an_origin_that_isnt_an_http_or_https_url_is_refused_and_mints_nothing(monkeypatch, tmp_path, origin):
399
+ browser = _browser(monkeypatch, tmp_path)
400
+ asgi = browser.create_app().streamable_http_app()
401
+ async with httpx.AsyncClient(transport=httpx.ASGITransport(app=asgi), base_url="http://app") as http:
402
+ answer = await http.post("/agentenv/ext/browser/cdp", json={"user": "ada", "origin": origin})
403
+
404
+ assert answer.status_code == 400 and "origin is an http or https URL" in answer.text, answer.text
405
+ assert not browser.cdp_tokens.path.exists()
@@ -1,5 +1,5 @@
1
- """WebsiteBrowserEnvironment: agentenv's flags after a subclass's command, in a computer and alone, and the proxy rule
2
- for each; a subclass refused for carrying one of them; the start tabs, the time zone and the window from its settings;
1
+ """WebsiteBrowserEnvironment: agentenv's flags after a subclass's command, in a computer and alone, headful on an X
2
+ server alone or headless with none, and the proxy rule for each; a subclass refused for carrying one of them; the start tabs, the time zone and the window from its settings;
3
3
  its launch run with no desktop when alone; a CDP connection over a new debugging pipe at each launch, which its ready
4
4
  check asks, and a browser launched again when its server restarts; its shared memory in files only on a small
5
5
  /dev/shm; an empty cache and the deploy's prompt answers in its profile at each launch; its policies, card params and
@@ -121,9 +121,13 @@ def _settings(monkeypatch, **values) -> None:
121
121
  monkeypatch.setenv(APP_SETTINGS_ENV, json.dumps({"chromium": values}))
122
122
 
123
123
 
124
- def _alone(monkeypatch) -> None:
125
- """On a computer with no display, a browser computer's."""
124
+ def _alone(monkeypatch, x_server: bool = False) -> None:
125
+ """On a computer with no display, a browser computer's, with an X server only the browser uses or none."""
126
126
  monkeypatch.setattr(app, "detect", lambda: Platform(os="linux", display="none"))
127
+ if x_server:
128
+ monkeypatch.setenv("DISPLAY", ":99")
129
+ else:
130
+ monkeypatch.delenv("DISPLAY", raising=False)
127
131
 
128
132
 
129
133
  def test_in_a_computer_its_flags_follow_its_command_then_its_start_tabs_and_its_window_is_waited_for(browser_home):
@@ -161,6 +165,21 @@ def test_alone_it_goes_through_its_proxy_headless_at_its_window_and_its_launch_w
161
165
  assert browser._computer_app.desktop is False and browser._computer_app.timeout_s == 30
162
166
 
163
167
 
168
+ def test_alone_on_an_x_server_it_runs_headful_at_its_window_with_webgl_and_its_launch_waits_on_no_window(monkeypatch):
169
+ _alone(monkeypatch, x_server=True)
170
+ monkeypatch.setenv(SITE_PROXY_ENV, PROXY)
171
+ _settings(monkeypatch, window={"width": 1024, "height": 768})
172
+
173
+ browser = Browser()
174
+ launch = browser.launch
175
+
176
+ assert f"--proxy-bypass-list={ALONE_BYPASS}" in launch.command
177
+ assert launch.command[-3:] == ["--window-size=1024,768", "--enable-unsafe-swiftshader", "about:blank"]
178
+ assert not any(flag.startswith("--headless") for flag in launch.command)
179
+ assert launch.window is None and launch.ready is None
180
+ assert browser._computer_app.desktop is False
181
+
182
+
164
183
  def test_alone_its_launch_keeps_the_port_and_command_it_waits_on_and_their_timeout(monkeypatch):
165
184
  @linux(launch=Launch(command=["chromium/chrome"], window={"class": "Chromium"},
166
185
  ready=Ready(window=True, port=9000, command=["true"], timeout_s=45)))
@@ -186,7 +205,8 @@ def test_alone_it_refuses_to_launch_without_a_site_proxy(monkeypatch):
186
205
 
187
206
  @pytest.mark.parametrize("flag", ["--remote-debugging-port=9222", "--remote-allow-origins=*", "--headless",
188
207
  "--proxy-server=http://elsewhere:3128", "--user-data-dir=/tmp/profile",
189
- "--disk-cache-dir=/tmp/cache", "--disable-dev-shm-usage"])
208
+ "--disk-cache-dir=/tmp/cache", "--disable-dev-shm-usage",
209
+ "--enable-unsafe-swiftshader"])
190
210
  def test_a_subclass_whose_command_carries_a_flag_agentenv_owns_is_refused_when_declared(flag):
191
211
  @linux(launch=Launch(command=["chromium/chrome", flag]))
192
212
  class Widened(WebsiteBrowserEnvironment):
@@ -434,14 +454,18 @@ def test_its_policies_are_agentenvs_with_its_own_over_them_where_its_build_reads
434
454
  assert [step.name for step in Browser.declaration().install_steps] == ["write_policies"]
435
455
 
436
456
 
437
- def test_its_card_declares_browser_v1_with_its_build_and_clock_and_alone_its_window(monkeypatch):
457
+ def test_its_card_declares_browser_v1_with_its_build_clock_and_mode_and_alone_its_window(monkeypatch):
438
458
  in_computer = Browser().extension_params(BROWSER)
439
- _alone(monkeypatch)
440
459
  monkeypatch.setenv(SITE_PROXY_ENV, PROXY)
441
- alone = Browser().extension_params(BROWSER)
442
-
443
- assert in_computer == {"chromium": "156.0.8078.4", "clock": "real"}
444
- assert alone == {"chromium": "156.0.8078.4", "clock": "real", "window": {"width": 1280, "height": 800}}
460
+ _alone(monkeypatch)
461
+ headless = Browser().extension_params(BROWSER)
462
+ _alone(monkeypatch, x_server=True)
463
+ headful = Browser().extension_params(BROWSER)
464
+
465
+ window = {"width": 1280, "height": 800}
466
+ assert in_computer == {"chromium": "156.0.8078.4", "clock": "real", "mode": "headful"}
467
+ assert headless == {"chromium": "156.0.8078.4", "clock": "real", "mode": "headless", "window": window}
468
+ assert headful == {"chromium": "156.0.8078.4", "clock": "real", "mode": "headful", "window": window}
445
469
 
446
470
 
447
471
  @pytest.mark.asyncio