agentenv-framework-protocol 0.1.531__tar.gz → 0.1.533__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.
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/PKG-INFO +39 -5
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/README.md +34 -4
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/pyproject.toml +5 -1
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/__init__.py +10 -6
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/control.py +74 -1
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/data.py +2 -1
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/environment.py +58 -7
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/log.py +16 -4
- agentenv_framework_protocol-0.1.533/src/agentenv_protocol/website_browser/network.py +373 -0
- agentenv_framework_protocol-0.1.533/src/agentenv_protocol/website_browser/recording.py +263 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_browser_data.py +52 -1
- agentenv_framework_protocol-0.1.533/tests/test_browser_network.py +347 -0
- agentenv_framework_protocol-0.1.533/tests/test_browser_recording.py +284 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/NOTICE +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/THIRD_PARTY_NOTICES.md +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/advanced_agent.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/basic_agent.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/custom_extensions_agent.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/multimodal_agent.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/reference_model.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/streaming_agent.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/Dockerfile +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/Dockerfile.dockerignore +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/README.md +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/data/seed.json +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/env.toml +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/site.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/web/index.html +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/web/package-lock.json +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/web/package.json +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/web/src/main.js +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/web/src/style.css +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/examples/website/notes/web/vite.config.js +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/a2a_agent/tasks/v1.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/agent_env_environment.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/client.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_declare.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_desktop.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_job.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_linux.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_load.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_macos.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_reaping.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_session_posix.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_windows.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_with_fds.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/_x11.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/app.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/app_data.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/app_runtime.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/apps.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/card.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/checks.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/checks.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/client.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/report.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/driver.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/errors.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/extensions.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/frames.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/keys.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/launch.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/manifest.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/operations.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/platform.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/prefix.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/queue.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/recording.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/results.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/run_install_step.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/runtime.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/seed.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/serve.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/serve_app.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/served.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/session.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/settings.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/skill.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/spaces.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/svc.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/computer/tools.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/errors.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/manifest.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/preflight.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/transfers.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/types.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/clock.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/conformance.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/environment.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/errors.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/readiness.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/routes.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website/session.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/cdp.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/devtools.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/src/agentenv_protocol/website_browser/shapes.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/computer_fake.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/probe_fake.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_agent.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_agent_examples.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_cdp_config.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_object_transfers.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_proxy.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_staging.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_a2a_trajectory_log.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_agent_env_environment.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_browser_cdp.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_browser_log.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_browser_state.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_client.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_app_data.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_app_server.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_conformance_checks.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_conformance_page.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_conformance_recording.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_declare.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_driver.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_driver_keys.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_extensions.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_frames.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_macos.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_page.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_queue.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_recording.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_seed.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_serve.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_served.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_spaces.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_svc_forward.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_tool_prefix.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_computer_windows_driver.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_control_token.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_data_objects.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_devtools_pipe.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_errors.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_extension_methods.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_intake.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_manifest.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_preflight.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_tool_annotations.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_tool_context_fastmcp.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_tool_context_injection.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_api.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_browser.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_environment.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_live.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_mcp.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/tests/test_website_notes_example.py +0 -0
- {agentenv_framework_protocol-0.1.531 → agentenv_framework_protocol-0.1.533}/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.
|
|
3
|
+
Version: 0.1.533
|
|
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
|
|
@@ -35,9 +35,11 @@ Requires-Dist: python-multipart>=0.0.13; extra == 'agent'
|
|
|
35
35
|
Requires-Dist: regex>=2023.12.25; extra == 'agent'
|
|
36
36
|
Requires-Dist: uvicorn>=0.30; extra == 'agent'
|
|
37
37
|
Provides-Extra: app
|
|
38
|
+
Requires-Dist: brotli>=1.2; extra == 'app'
|
|
38
39
|
Requires-Dist: mcp<2,>=1.25; extra == 'app'
|
|
39
40
|
Requires-Dist: uvicorn>=0.30; extra == 'app'
|
|
40
41
|
Requires-Dist: websockets>=13; extra == 'app'
|
|
42
|
+
Requires-Dist: zstandard>=0.23; extra == 'app'
|
|
41
43
|
Provides-Extra: computer
|
|
42
44
|
Requires-Dist: av>=17; extra == 'computer'
|
|
43
45
|
Requires-Dist: mcp<2,>=1.25; extra == 'computer'
|
|
@@ -47,6 +49,7 @@ Requires-Dist: websockets>=13; extra == 'computer'
|
|
|
47
49
|
Provides-Extra: dev
|
|
48
50
|
Requires-Dist: a2a-sdk[http-server]<0.4,>=0.3.26; extra == 'dev'
|
|
49
51
|
Requires-Dist: av>=17; extra == 'dev'
|
|
52
|
+
Requires-Dist: brotli>=1.2; extra == 'dev'
|
|
50
53
|
Requires-Dist: fastmcp<4,>=3.4; extra == 'dev'
|
|
51
54
|
Requires-Dist: mcp<2,>=1.25; extra == 'dev'
|
|
52
55
|
Requires-Dist: pillow>=10.4; extra == 'dev'
|
|
@@ -55,6 +58,7 @@ Requires-Dist: pytest>=9.0; extra == 'dev'
|
|
|
55
58
|
Requires-Dist: python-multipart>=0.0.13; extra == 'dev'
|
|
56
59
|
Requires-Dist: regex>=2023.12.25; extra == 'dev'
|
|
57
60
|
Requires-Dist: websockets>=13; extra == 'dev'
|
|
61
|
+
Requires-Dist: zstandard>=0.23; extra == 'dev'
|
|
58
62
|
Provides-Extra: macos
|
|
59
63
|
Requires-Dist: pyobjc-framework-quartz>=11; (sys_platform == 'darwin') and extra == 'macos'
|
|
60
64
|
Requires-Dist: pyobjc-framework-screencapturekit>=11; (sys_platform == 'darwin') and extra == 'macos'
|
|
@@ -1027,7 +1031,8 @@ are the profile's template. The base class adds:
|
|
|
1027
1031
|
`notifications`, `deny` (the default), which answers a page's prompt for it, or `ask`; and `dialogs`, who
|
|
1028
1032
|
answers a page's JavaScript dialogs: `agent` (the default), or agentenv, accepting (`accept`, a `prompt()`
|
|
1029
1033
|
with its default text) or dismissing (`dismiss`) each. Either way agentenv leaves a page that asks before
|
|
1030
|
-
it's left (`beforeunload`), so none of its answers blocks a navigation.
|
|
1034
|
+
it's left (`beforeunload`), so none of its answers blocks a navigation. And `network`, on by default, whether
|
|
1035
|
+
`data/get` exports its network log and `browser/v1` `network` reads it.
|
|
1031
1036
|
- **The flags agentenv owns**, after the subclass's command and before `about:blank`, the one tab its command line
|
|
1032
1037
|
opens: its profile, its
|
|
1033
1038
|
HTTP cache under `~/.cache` (`--disk-cache-dir`), `--remote-debugging-pipe`, `--no-first-run`,
|
|
@@ -1099,10 +1104,28 @@ are the profile's template. The base class adds:
|
|
|
1099
1104
|
- A driver passes an agent's tool call to the browser in the `AgentEnv-Tool-Call` header (`tool_call_header`), with
|
|
1100
1105
|
the caller's `AgentEnv-Role`; the page driver sends it on every call it makes for a tool. `data/get` writes the log
|
|
1101
1106
|
beside `browser-state.json` as `browser-log.jsonl`, which `data/add` passes over.
|
|
1107
|
+
- **Its network log** is the one the proxy it goes out through keeps, in the file `AGENTENV_NETWORK_LOG` names
|
|
1108
|
+
(`website_browser.network`): on a browser alone routing sites, the shared site proxy's,
|
|
1109
|
+
`/etc/agentenv/sites/network.jsonl`, which root keeps and the session user reads; else the base's stand-in's,
|
|
1110
|
+
`/var/log/agentenv/network.jsonl`. One JSON object a line, numbered (`seq`) and timed (`at`) as it's written, a
|
|
1111
|
+
proxy started again numbering after the file's last: an `open` line once a request has gone upstream or a tunnel
|
|
1112
|
+
has opened, and an `end` line, naming the same `id`, once it's answered and done or has failed. The shared site
|
|
1113
|
+
proxy keeps each exchange whole: the request as the browser sent it, its headers, the values of the sign-in headers
|
|
1114
|
+
a site declares as `<removed>`, and its body up to 10 MB; the answer as the browser got it, its status, its headers
|
|
1115
|
+
and, for text, JSON, forms, XML and scripts, its body up to 1 MB, as it came, in base64, any other type's size and
|
|
1116
|
+
sha256 alone; a WebSocket's messages and bytes each way; and each tunnel to a live host, refusal and failure. The
|
|
1117
|
+
stand-in, which decrypts nothing, keeps each connection: its host, port, address and bytes each way, and a plain
|
|
1118
|
+
request's method and URL. A browser on a computer with a desktop has none, since no proxy logs for it and nothing
|
|
1119
|
+
names one. When it has one and its `network` setting is on, `data/get` writes it as HAR 1.2, `network.har`,
|
|
1120
|
+
which `data/add` passes over: an entry
|
|
1121
|
+
for each request and tunnel in the order they started, one still going marked `_open`, bodies decoded from gzip and
|
|
1122
|
+
deflate, and br and zstd with the `app` extra's `brotli` and `zstandard`, up to 1 MB, and agentenv's own fields
|
|
1123
|
+
named with `_`: `_tunnel`, `_websocket`, `_failed`, `_refused`, `_truncated`, `_sha256`.
|
|
1102
1124
|
- **`browser/v1`** on its card: `chromium` (its `version`), `clock: "real"` and, alone, `window`; `log {after}`
|
|
1103
|
-
(GET), framework-only, its log's lines after `after`; `
|
|
1104
|
-
|
|
1105
|
-
|
|
1125
|
+
(GET), framework-only, its log's lines after `after`; `network {after}` (GET), framework-only, its network log's
|
|
1126
|
+
lines after `after`, 500 at most and `more` when a read left some; `calls/begin {user, acts?, within_s?}`,
|
|
1127
|
+
framework-only, sent with the tool-call header, which begins the entry of an agent's tool call that `user`'s CDP
|
|
1128
|
+
connections serve and answers its `entry`, and `calls/end {entry, ok, error?}`, which ends it, a call not ended within
|
|
1106
1129
|
`within_s` (600 s by default) written as never said to have ended; and
|
|
1107
1130
|
`record` (GET), framework-only, which returns that record with `launches`, the app server's log of each
|
|
1108
1131
|
launch (with its cause: `boot`, `server_restart`, `launch`, `data/add` or `data/reset`), each stop it made
|
|
@@ -1195,6 +1218,17 @@ are the profile's template. The base class adds:
|
|
|
1195
1218
|
The server keeps each token in memory and only its SHA-256, with its user and base address, in
|
|
1196
1219
|
`.agentenv/cdp-tokens.json`, which code in the computer's session can read but not use; an address
|
|
1197
1220
|
outlives a relaunch of the browser and of the server, and the computer's reset ends it.
|
|
1221
|
+
- **`browser-recording/v1`** on its card, framework-only, with `max_duration_s`, `max_frames` and `frames`:
|
|
1222
|
+
`start {request_id, upload, frames?}` records under the write namespace grant `upload`, a start again with the
|
|
1223
|
+
same `request_id` answering the recording it began; `end {recording_id, upload?, reason?}` ends it, under a fresh
|
|
1224
|
+
grant when one is given, and answers its manifest; `end_all {reason?}` ends every open one. With `frames`, a frame
|
|
1225
|
+
is a JPEG of the tab an agent last acted in, else of the active tab: one at the start, one after each burst of an
|
|
1226
|
+
agent's acting entries (CDP commands and MCP calls, not agentenv's own) has gone quiet for 0.5 s and its tab's page
|
|
1227
|
+
has loaded (up to 5 s), and one at the end, each uploaded as it's taken under `<recording_id>/frames/` and keyed in
|
|
1228
|
+
the manifest to the entries it follows (`after`); a frame it couldn't take is in the manifest with its `error`. At
|
|
1229
|
+
the end it uploads the log's lines since its start, actions and tab events, as `log.jsonl`, and `manifest.json`
|
|
1230
|
+
(`BrowserRecordingManifest`). `start_browser_recording` and `end_browser_recording` run it, registering the frames,
|
|
1231
|
+
log and manifest as one file artifact universe, and the end fails the run when its log or a frame is missing.
|
|
1198
1232
|
- **Its CDP relay**, at those addresses: `json/version` and `json/list` (also with a trailing slash,
|
|
1199
1233
|
and `json`) answered from the browser, since a browser on a pipe has none, with its WebSocket at the
|
|
1200
1234
|
address the client reached it at; and `devtools/browser`, where each WebSocket connection gets a
|
|
@@ -960,7 +960,8 @@ are the profile's template. The base class adds:
|
|
|
960
960
|
`notifications`, `deny` (the default), which answers a page's prompt for it, or `ask`; and `dialogs`, who
|
|
961
961
|
answers a page's JavaScript dialogs: `agent` (the default), or agentenv, accepting (`accept`, a `prompt()`
|
|
962
962
|
with its default text) or dismissing (`dismiss`) each. Either way agentenv leaves a page that asks before
|
|
963
|
-
it's left (`beforeunload`), so none of its answers blocks a navigation.
|
|
963
|
+
it's left (`beforeunload`), so none of its answers blocks a navigation. And `network`, on by default, whether
|
|
964
|
+
`data/get` exports its network log and `browser/v1` `network` reads it.
|
|
964
965
|
- **The flags agentenv owns**, after the subclass's command and before `about:blank`, the one tab its command line
|
|
965
966
|
opens: its profile, its
|
|
966
967
|
HTTP cache under `~/.cache` (`--disk-cache-dir`), `--remote-debugging-pipe`, `--no-first-run`,
|
|
@@ -1032,10 +1033,28 @@ are the profile's template. The base class adds:
|
|
|
1032
1033
|
- A driver passes an agent's tool call to the browser in the `AgentEnv-Tool-Call` header (`tool_call_header`), with
|
|
1033
1034
|
the caller's `AgentEnv-Role`; the page driver sends it on every call it makes for a tool. `data/get` writes the log
|
|
1034
1035
|
beside `browser-state.json` as `browser-log.jsonl`, which `data/add` passes over.
|
|
1036
|
+
- **Its network log** is the one the proxy it goes out through keeps, in the file `AGENTENV_NETWORK_LOG` names
|
|
1037
|
+
(`website_browser.network`): on a browser alone routing sites, the shared site proxy's,
|
|
1038
|
+
`/etc/agentenv/sites/network.jsonl`, which root keeps and the session user reads; else the base's stand-in's,
|
|
1039
|
+
`/var/log/agentenv/network.jsonl`. One JSON object a line, numbered (`seq`) and timed (`at`) as it's written, a
|
|
1040
|
+
proxy started again numbering after the file's last: an `open` line once a request has gone upstream or a tunnel
|
|
1041
|
+
has opened, and an `end` line, naming the same `id`, once it's answered and done or has failed. The shared site
|
|
1042
|
+
proxy keeps each exchange whole: the request as the browser sent it, its headers, the values of the sign-in headers
|
|
1043
|
+
a site declares as `<removed>`, and its body up to 10 MB; the answer as the browser got it, its status, its headers
|
|
1044
|
+
and, for text, JSON, forms, XML and scripts, its body up to 1 MB, as it came, in base64, any other type's size and
|
|
1045
|
+
sha256 alone; a WebSocket's messages and bytes each way; and each tunnel to a live host, refusal and failure. The
|
|
1046
|
+
stand-in, which decrypts nothing, keeps each connection: its host, port, address and bytes each way, and a plain
|
|
1047
|
+
request's method and URL. A browser on a computer with a desktop has none, since no proxy logs for it and nothing
|
|
1048
|
+
names one. When it has one and its `network` setting is on, `data/get` writes it as HAR 1.2, `network.har`,
|
|
1049
|
+
which `data/add` passes over: an entry
|
|
1050
|
+
for each request and tunnel in the order they started, one still going marked `_open`, bodies decoded from gzip and
|
|
1051
|
+
deflate, and br and zstd with the `app` extra's `brotli` and `zstandard`, up to 1 MB, and agentenv's own fields
|
|
1052
|
+
named with `_`: `_tunnel`, `_websocket`, `_failed`, `_refused`, `_truncated`, `_sha256`.
|
|
1035
1053
|
- **`browser/v1`** on its card: `chromium` (its `version`), `clock: "real"` and, alone, `window`; `log {after}`
|
|
1036
|
-
(GET), framework-only, its log's lines after `after`; `
|
|
1037
|
-
|
|
1038
|
-
|
|
1054
|
+
(GET), framework-only, its log's lines after `after`; `network {after}` (GET), framework-only, its network log's
|
|
1055
|
+
lines after `after`, 500 at most and `more` when a read left some; `calls/begin {user, acts?, within_s?}`,
|
|
1056
|
+
framework-only, sent with the tool-call header, which begins the entry of an agent's tool call that `user`'s CDP
|
|
1057
|
+
connections serve and answers its `entry`, and `calls/end {entry, ok, error?}`, which ends it, a call not ended within
|
|
1039
1058
|
`within_s` (600 s by default) written as never said to have ended; and
|
|
1040
1059
|
`record` (GET), framework-only, which returns that record with `launches`, the app server's log of each
|
|
1041
1060
|
launch (with its cause: `boot`, `server_restart`, `launch`, `data/add` or `data/reset`), each stop it made
|
|
@@ -1128,6 +1147,17 @@ are the profile's template. The base class adds:
|
|
|
1128
1147
|
The server keeps each token in memory and only its SHA-256, with its user and base address, in
|
|
1129
1148
|
`.agentenv/cdp-tokens.json`, which code in the computer's session can read but not use; an address
|
|
1130
1149
|
outlives a relaunch of the browser and of the server, and the computer's reset ends it.
|
|
1150
|
+
- **`browser-recording/v1`** on its card, framework-only, with `max_duration_s`, `max_frames` and `frames`:
|
|
1151
|
+
`start {request_id, upload, frames?}` records under the write namespace grant `upload`, a start again with the
|
|
1152
|
+
same `request_id` answering the recording it began; `end {recording_id, upload?, reason?}` ends it, under a fresh
|
|
1153
|
+
grant when one is given, and answers its manifest; `end_all {reason?}` ends every open one. With `frames`, a frame
|
|
1154
|
+
is a JPEG of the tab an agent last acted in, else of the active tab: one at the start, one after each burst of an
|
|
1155
|
+
agent's acting entries (CDP commands and MCP calls, not agentenv's own) has gone quiet for 0.5 s and its tab's page
|
|
1156
|
+
has loaded (up to 5 s), and one at the end, each uploaded as it's taken under `<recording_id>/frames/` and keyed in
|
|
1157
|
+
the manifest to the entries it follows (`after`); a frame it couldn't take is in the manifest with its `error`. At
|
|
1158
|
+
the end it uploads the log's lines since its start, actions and tab events, as `log.jsonl`, and `manifest.json`
|
|
1159
|
+
(`BrowserRecordingManifest`). `start_browser_recording` and `end_browser_recording` run it, registering the frames,
|
|
1160
|
+
log and manifest as one file artifact universe, and the end fails the run when its log or a frame is missing.
|
|
1131
1161
|
- **Its CDP relay**, at those addresses: `json/version` and `json/list` (also with a trailing slash,
|
|
1132
1162
|
and `json`) answered from the browser, since a browser on a pipe has none, with its WebSocket at the
|
|
1133
1163
|
address the client reached it at; and `devtools/browser`, where each WebSocket connection gets a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agentenv-framework-protocol"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.533"
|
|
4
4
|
description = "Open data-plane protocol and server SDK for agent environments."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -38,9 +38,11 @@ agent = [
|
|
|
38
38
|
# A computer app's own server: ComputerAppEnvironment serves its card and computer-app/v1 over mcp's FastMCP, on a Unix
|
|
39
39
|
# socket through uvicorn, and a website browser's CDP relay over WebSockets.
|
|
40
40
|
app = [
|
|
41
|
+
"brotli>=1.2", # a website browser's network log: br answer bodies, decoded for network.har
|
|
41
42
|
"mcp>=1.25,<2",
|
|
42
43
|
"uvicorn>=0.30",
|
|
43
44
|
"websockets>=13",
|
|
45
|
+
"zstandard>=0.23", # and zstd ones
|
|
44
46
|
]
|
|
45
47
|
# A computer driver: ComputerDriverEnvironment serves its tools over mcp's FastMCP, crops and encodes frames, records
|
|
46
48
|
# the display as H.264 with PyAV (computer-recording/v1), and relays WebSockets to its apps on /svc/<app>/.
|
|
@@ -76,6 +78,8 @@ dev = [
|
|
|
76
78
|
"Pillow>=10.4", # the computer extra's frame crops and encodings
|
|
77
79
|
"av>=17", # the computer extra's encoder, and the tests' decoder
|
|
78
80
|
"websockets>=13", # the computer extra's /svc/<app>/ relay
|
|
81
|
+
"brotli>=1.2", # the app extra's network.har decoding
|
|
82
|
+
"zstandard>=0.23",
|
|
79
83
|
]
|
|
80
84
|
[project.urls]
|
|
81
85
|
Homepage = "https://www.agentenvframework.com"
|
|
@@ -12,14 +12,18 @@ from .devtools import MAX_MESSAGE_BYTES, PIPE_IN, PIPE_OUT, DevToolsError, DevTo
|
|
|
12
12
|
from .environment import (ALONE_BYPASS, BLOCK, BROWSER, COMPUTER_BYPASS, OWNED_FLAGS, POLICIES, READY_POLL_S,
|
|
13
13
|
SHM_MIN_BYTES, SITE_PROXY_ENV, SITES, SKILL, BrowserSettings, WebsiteBrowserEnvironment,
|
|
14
14
|
Window, start_tab_why)
|
|
15
|
+
from .network import DEFAULT_NETWORK_LOG, HAR_FILE, NETWORK_LOG_ENV, NetworkLog, har
|
|
16
|
+
from .recording import BROWSER_RECORDING, BrowserRecordingManifest, BrowserRecordings, RecordedFrame
|
|
15
17
|
from .shapes import (BrowserRecord, ClosedTab, Cookie, CookieToSet, Dialog, Download, LaunchEntry, OpenTab,
|
|
16
18
|
OriginStorage, PartitionKey, SiteNames, StartTab, StartTabsLaunch, StorageItem, origin_of)
|
|
17
19
|
|
|
18
|
-
__all__ = ["ACTIVE_CHECK_TIMEOUT_S", "AGENT", "AGENTENV", "ALONE_BYPASS", "BLOCK", "BROWSER", "
|
|
19
|
-
"
|
|
20
|
-
"
|
|
20
|
+
__all__ = ["ACTIVE_CHECK_TIMEOUT_S", "AGENT", "AGENTENV", "ALONE_BYPASS", "BLOCK", "BROWSER", "BROWSER_RECORDING",
|
|
21
|
+
"CAPTURE_TIMEOUT_S", "COMPUTER_BYPASS", "DEFAULT_NETWORK_LOG", "DOWNLOADS", "EXIT", "FAILED", "HAR_FILE",
|
|
22
|
+
"HASH_CHUNK_BYTES", "LIVE_START_TAB_TIMEOUT_S", "LOADED", "MAX_MESSAGE_BYTES", "NETWORK_LOG_ENV",
|
|
23
|
+
"OWNED_FLAGS", "PAGE_INPUT", "PAGES", "PIN_TIMEOUT_S", "PIPE_IN", "PIPE_OUT",
|
|
21
24
|
"POLICIES", "READY_POLL_S", "SHM_MIN_BYTES", "SITE_PROXY_ENV", "SITES", "SKILL", "STOP", "TIMED_OUT",
|
|
22
25
|
"UNKNOWN", "UNNAVIGATED_CAPTURE_TIMEOUT_S", "UPLOADS", "BrowserControl", "BrowserSettings", "DevToolsError",
|
|
23
|
-
"DevToolsPipe", "WebsiteBrowserEnvironment", "Window", "BrowserRecord", "ClosedTab", "Cookie",
|
|
24
|
-
"Dialog", "Download", "LaunchEntry", "OpenTab", "OriginStorage", "PartitionKey", "SiteNames",
|
|
25
|
-
"StartTabsLaunch", "StorageItem", "origin_of", "start_tab_why"
|
|
26
|
+
"DevToolsPipe", "NetworkLog", "WebsiteBrowserEnvironment", "Window", "BrowserRecord", "ClosedTab", "Cookie",
|
|
27
|
+
"CookieToSet", "Dialog", "Download", "LaunchEntry", "OpenTab", "OriginStorage", "PartitionKey", "SiteNames",
|
|
28
|
+
"StartTab", "StartTabsLaunch", "StorageItem", "har", "origin_of", "start_tab_why",
|
|
29
|
+
"BrowserRecordingManifest", "BrowserRecordings", "RecordedFrame"]
|
|
@@ -44,6 +44,13 @@ PAGES = [{"type": "page"}]
|
|
|
44
44
|
#: The CDP input a computer's page driver may send to the active tab, and how long its screenshot may take.
|
|
45
45
|
PAGE_INPUT = frozenset({"Input.dispatchMouseEvent", "Input.dispatchKeyEvent", "Input.insertText"})
|
|
46
46
|
CAPTURE_TIMEOUT_S, UNNAVIGATED_CAPTURE_TIMEOUT_S = 3.0, 1.0
|
|
47
|
+
#: A frame's quality as a JPEG, which is a fifth to a tenth of the PNG's size.
|
|
48
|
+
FRAME_QUALITY = 80
|
|
49
|
+
#: How long a frame's capture may go unanswered before a second capture is sent: Chrome answers a capture of a tab
|
|
50
|
+
#: behind the active one only once another capture of it arrives, and then answers both.
|
|
51
|
+
NUDGE_S = 0.5
|
|
52
|
+
#: How often a wait for a tab to load looks again.
|
|
53
|
+
LOAD_POLL_S = 0.1
|
|
47
54
|
#: Where an agent's files to upload are, and where downloads land, under the session user's home.
|
|
48
55
|
UPLOADS = "Uploads"
|
|
49
56
|
DOWNLOADS = "Downloads"
|
|
@@ -97,11 +104,15 @@ class BrowserControl:
|
|
|
97
104
|
#: Each tab's latest capture, which shows while a dialog keeps its page from painting; and, by session, what
|
|
98
105
|
#: input sent there waits on to learn a dialog opened.
|
|
99
106
|
self._shots: dict[str, str] = {}
|
|
107
|
+
#: Each tab's latest frame, the image and its format, which a frame shows again while a dialog keeps it from
|
|
108
|
+
#: painting.
|
|
109
|
+
self._frames: dict[str, tuple[str, str]] = {}
|
|
100
110
|
self._dialog_opened: dict[str, asyncio.Event] = {}
|
|
101
111
|
self._pinned: dict[str, asyncio.Event] = {}
|
|
102
112
|
self._tasks: set[asyncio.Future] = set()
|
|
103
|
-
#: Each start tab loading, by its session.
|
|
113
|
+
#: Each start tab loading, by its session; and each tab whose page has committed and not yet loaded.
|
|
104
114
|
self._loading: dict[str, _StartLoad] = {}
|
|
115
|
+
self._page_loading: set[str] = set()
|
|
105
116
|
#: Every http and https origin a page or frame it follows loaded since this server started, and the sessions
|
|
106
117
|
#: of agentenv's own pages whose requests it answers itself.
|
|
107
118
|
self.origins: set[str] = set()
|
|
@@ -613,6 +624,63 @@ class BrowserControl:
|
|
|
613
624
|
await self._refresh(target)
|
|
614
625
|
return {**({"png": png} if png is not None else {"blank": True}), "page": self._state_of(target)}
|
|
615
626
|
|
|
627
|
+
async def frame(self, target: Optional[str], load_wait_s: float) -> tuple[str, str, Optional[str], Optional[str]]:
|
|
628
|
+
"""A frame of the tab ``target``, else, for none or one that's gone, of the active tab: once its page has loaded,
|
|
629
|
+
waiting up to ``load_wait_s``, a JPEG of it as it shows, or, with a dialog keeping it from painting, the frame it
|
|
630
|
+
last took, else its last capture, a PNG; a tab that closes while its page loads is the active tab's. The image
|
|
631
|
+
base64, its format and the tab and its URL; DeviceUnavailable with no tab open, or for one that paints nothing
|
|
632
|
+
in time."""
|
|
633
|
+
session = next((s for s, t in self._sessions.items() if t == target), None) if target else None
|
|
634
|
+
if session is None:
|
|
635
|
+
session = await self.active_session()
|
|
636
|
+
target = self._sessions[session]
|
|
637
|
+
deadline = asyncio.get_running_loop().time() + load_wait_s
|
|
638
|
+
while target in self._page_loading and asyncio.get_running_loop().time() < deadline:
|
|
639
|
+
await asyncio.sleep(LOAD_POLL_S)
|
|
640
|
+
if session not in self._sessions:
|
|
641
|
+
session = await self.active_session()
|
|
642
|
+
target = self._sessions[session]
|
|
643
|
+
if session in self._open_dialogs:
|
|
644
|
+
if (earlier := self._frames.get(target)) is None and (shot := self._shots.get(target)) is not None:
|
|
645
|
+
earlier = shot, "png"
|
|
646
|
+
if earlier is None:
|
|
647
|
+
raise DeviceUnavailable("a dialog keeps the tab from painting and it had no capture before it")
|
|
648
|
+
return *earlier, target, self.url_of(target)
|
|
649
|
+
try:
|
|
650
|
+
shot = await self._nudged_capture(session)
|
|
651
|
+
except asyncio.TimeoutError:
|
|
652
|
+
raise DeviceUnavailable(f"the tab painted nothing within {CAPTURE_TIMEOUT_S:g} s") from None
|
|
653
|
+
except (ConnectionError, DevToolsError) as e:
|
|
654
|
+
raise DeviceUnavailable(f"the tab couldn't be captured: {e}") from None
|
|
655
|
+
self._frames[target] = shot["data"], "jpg"
|
|
656
|
+
return shot["data"], "jpg", target, self.url_of(target)
|
|
657
|
+
|
|
658
|
+
async def _nudged_capture(self, session: str) -> dict:
|
|
659
|
+
"""The tab's JPEG from the first of its captures to answer: a second follows one unanswered after ``NUDGE_S``,
|
|
660
|
+
since a tab behind the active one answers only then, all within ``CAPTURE_TIMEOUT_S``."""
|
|
661
|
+
loop = asyncio.get_running_loop()
|
|
662
|
+
deadline = loop.time() + CAPTURE_TIMEOUT_S
|
|
663
|
+
|
|
664
|
+
def capture() -> asyncio.Future:
|
|
665
|
+
return asyncio.ensure_future(self.devtools.call("Page.captureScreenshot", {
|
|
666
|
+
"format": "jpeg", "quality": FRAME_QUALITY, "optimizeForSpeed": True}, session_id=session,
|
|
667
|
+
timeout_s=max(0.0, deadline - loop.time())))
|
|
668
|
+
|
|
669
|
+
captures = {capture()}
|
|
670
|
+
try:
|
|
671
|
+
done, _ = await asyncio.wait(captures, timeout=NUDGE_S)
|
|
672
|
+
if not done:
|
|
673
|
+
captures.add(capture())
|
|
674
|
+
while True:
|
|
675
|
+
done, captures = await asyncio.wait(captures, return_when=asyncio.FIRST_COMPLETED)
|
|
676
|
+
if answers := [c.result() for c in done if c.exception() is None]:
|
|
677
|
+
return answers[0]
|
|
678
|
+
if not captures:
|
|
679
|
+
raise next(iter(done)).exception()
|
|
680
|
+
finally:
|
|
681
|
+
for pending in captures:
|
|
682
|
+
pending.cancel()
|
|
683
|
+
|
|
616
684
|
async def _capture(self, session: str) -> Optional[str]:
|
|
617
685
|
"""The tab's page as it shows now; with a dialog open on it, which keeps it from painting, the last it took."""
|
|
618
686
|
target = self._sessions[session]
|
|
@@ -727,6 +795,8 @@ class BrowserControl:
|
|
|
727
795
|
if session in self._sessions:
|
|
728
796
|
self._saw(params.get("frame", {}).get("url", ""))
|
|
729
797
|
frame = params.get("frame", {})
|
|
798
|
+
if not frame.get("parentId") and (target := self._sessions.get(session)) is not None:
|
|
799
|
+
self._page_loading.add(target)
|
|
730
800
|
if self.log is not None and not frame.get("parentId") and (target := self._sessions.get(session)) in self.tabs:
|
|
731
801
|
self._spawn(self._log_navigated(self.log.reserve(), log_time(), target, frame.get("url", ""),
|
|
732
802
|
frame.get("loaderId")))
|
|
@@ -807,13 +877,16 @@ class BrowserControl:
|
|
|
807
877
|
def _on_Target_detachedFromTarget(self, params: dict, session: Optional[str]) -> None:
|
|
808
878
|
if (target := self._sessions.pop(params["sessionId"], None)) is not None:
|
|
809
879
|
self._shots.pop(target, None)
|
|
880
|
+
self._frames.pop(target, None)
|
|
810
881
|
self._pinned.pop(target, None)
|
|
882
|
+
self._page_loading.discard(target)
|
|
811
883
|
self._choosers.pop(params["sessionId"], None)
|
|
812
884
|
self._dialog_opened.pop(params["sessionId"], None)
|
|
813
885
|
|
|
814
886
|
def _on_Page_loadEventFired(self, params: dict, session: Optional[str]) -> None:
|
|
815
887
|
self._choosers.pop(session, None)
|
|
816
888
|
if (target := self._sessions.get(session)) is not None:
|
|
889
|
+
self._page_loading.discard(target)
|
|
817
890
|
self._spawn(self._refresh(target))
|
|
818
891
|
if (load := self._loading.get(session)) is not None and load.commits:
|
|
819
892
|
load.loaded.add(load.commits[-1])
|
|
@@ -13,6 +13,7 @@ from ..computer.app_data import write_within
|
|
|
13
13
|
from ..computer.dataplane import part_bytes
|
|
14
14
|
from ..types import DataPart, FilePart, uploaded_object_path
|
|
15
15
|
from .control import DOWNLOADS, UPLOADS
|
|
16
|
+
from .network import HAR_FILE
|
|
16
17
|
|
|
17
18
|
#: The browser's typed state, as ``data/get`` returns it beside its files and ``data/add`` reads it back.
|
|
18
19
|
STATE_FILE = "browser-state.json"
|
|
@@ -54,7 +55,7 @@ async def sorted_load(parts: list, profile: str) -> Load:
|
|
|
54
55
|
under = PurePosixPath(path)
|
|
55
56
|
if under in (PurePosixPath(profile), PurePosixPath(DOWNLOADS), PurePosixPath(UPLOADS)):
|
|
56
57
|
raise ValueError(f"{path!r} is a folder of the browser's, not a file in it")
|
|
57
|
-
if path
|
|
58
|
+
if path in (LOG_FILE, HAR_FILE):
|
|
58
59
|
continue
|
|
59
60
|
if path == STATE_FILE:
|
|
60
61
|
if load.state is not None:
|
|
@@ -21,6 +21,7 @@ from ..agent_env_environment import (OP_ADD_DATA, add_data, add_websocket_route,
|
|
|
21
21
|
from .cdp import ROUTE, Relay, Tokens, reached, under, websocket_form
|
|
22
22
|
from .log import (ACTOR, ERROR_CHARS, TOOL_CALL_HEADER, UNLOGGED_OPS, BrowserLog, op_acts, read_tool_call,
|
|
23
23
|
redact_text, redacted_args, redacted_op)
|
|
24
|
+
from .network import HAR_FILE, NetworkLog, log_path
|
|
24
25
|
from ..computer import AppDeclaration, ComputerAppEnvironment, Launch, install_step, ready_check
|
|
25
26
|
from ..computer import app as computer_app
|
|
26
27
|
from ..computer import app_data
|
|
@@ -33,6 +34,7 @@ from ..types import METHOD_ADD, RPC_PATH, EnvironmentExtension, IntakeDeclaratio
|
|
|
33
34
|
from . import data
|
|
34
35
|
from .control import AGENT, DOWNLOADS, EXIT, LIVE_START_TAB_TIMEOUT_S, LOADED, STOP, UPLOADS, BrowserControl, _now
|
|
35
36
|
from .devtools import PIPE_IN, PIPE_OUT, DevToolsError, DevToolsPipe
|
|
37
|
+
from .recording import BROWSER_RECORDING, MAX_DURATION_S, MAX_FRAMES, BrowserRecordings
|
|
36
38
|
from .shapes import BrowserRecord, BrowserState, CookieToSet, OriginStorage, SiteNames, StateToLoad
|
|
37
39
|
|
|
38
40
|
logger = logging.getLogger(__name__)
|
|
@@ -106,6 +108,9 @@ class BrowserSettings(BaseModel):
|
|
|
106
108
|
notifications: Literal["deny", "ask"] = "deny"
|
|
107
109
|
#: Who answers a page's JavaScript dialogs: the agent, or agentenv accepting or dismissing each.
|
|
108
110
|
dialogs: Literal["agent", "accept", "dismiss"] = "agent"
|
|
111
|
+
#: Whether ``data/get`` exports its network log, ``network.har``, and ``browser/v1`` ``network`` reads it: off, a
|
|
112
|
+
#: run's export holds none of the cookies and form bodies the log keeps.
|
|
113
|
+
network: bool = True
|
|
109
114
|
|
|
110
115
|
@field_validator("start_urls")
|
|
111
116
|
@classmethod
|
|
@@ -151,10 +156,14 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
151
156
|
self.log = BrowserLog.for_app(os.environ.get("ENVIRONMENT_NAME") or type(self).__name__.lower(),
|
|
152
157
|
SOCKET.parent)
|
|
153
158
|
self.control.log = self.log
|
|
159
|
+
#: Its network log, as the proxy it goes out through writes it; None when no proxy logs for it.
|
|
160
|
+
self.network = NetworkLog(path) if (path := log_path()) is not None else None
|
|
154
161
|
#: The CDP addresses it has handed out, and the relay agents' connections to them go through.
|
|
155
162
|
self.cdp_tokens = Tokens(SOCKET.parent / "cdp-tokens.json")
|
|
156
163
|
self.relay = Relay(self.devtools, dialogs_answered=self.settings.dialogs != AGENT, log=self.log,
|
|
157
164
|
control=self.control)
|
|
165
|
+
#: Its recordings: frames of the tab an agent last acted in, and its log, uploaded under each one's grant.
|
|
166
|
+
self.recordings = BrowserRecordings(self.log, self.control)
|
|
158
167
|
self.devtools.on_close(self._pipe_closed)
|
|
159
168
|
|
|
160
169
|
@classmethod
|
|
@@ -331,7 +340,13 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
331
340
|
"the env's site and the outcome, loaded, failed or timed_out. log returns its log's lines after the sequence "
|
|
332
341
|
"number after, in order: an action entry for each CDP command, MCP tool call and pixel action an agent took, "
|
|
333
342
|
"marked acting or reading, with who, the tab and its URL and, acting, its parameters with secrets taken out; "
|
|
334
|
-
"and a tab event each time a tab opened, navigated or closed, with what caused it."
|
|
343
|
+
"and a tab event each time a tab opened, navigated or closed, with what caused it. network returns its "
|
|
344
|
+
"network log's lines after the sequence number after, in order, as the proxy it goes out through writes them: "
|
|
345
|
+
"an open line once a request has gone upstream or a tunnel has opened and an end line, with the same id, once "
|
|
346
|
+
"it's done or has failed. The shared site proxy writes a whole exchange, the request and the answer with their "
|
|
347
|
+
"headers and bodies, the sign-in headers a site declares removed, and a WebSocket's message counts; the base's "
|
|
348
|
+
"stand-in writes each connection, its host, address and bytes each way. With the network setting off, or on a "
|
|
349
|
+
"computer with a desktop, where no proxy logs for it, network returns no lines."))
|
|
335
350
|
async def browser_record(self) -> dict:
|
|
336
351
|
return BrowserRecord(**await self.control.record(), launches=self._computer_app.launches(),
|
|
337
352
|
cdp_connections=list(self.relay.connections),
|
|
@@ -341,6 +356,12 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
341
356
|
async def browser_log(self, after: int = 0) -> dict:
|
|
342
357
|
return await self.log.read_async(after)
|
|
343
358
|
|
|
359
|
+
@extension(BROWSER, op="network", method="GET")
|
|
360
|
+
async def browser_network(self, after: int = 0) -> dict:
|
|
361
|
+
if self.network is None or not self.settings.network:
|
|
362
|
+
return {"lines": [], "last": after, "more": False}
|
|
363
|
+
return await self.network.read_async(after)
|
|
364
|
+
|
|
344
365
|
@extension(BROWSER, op="sites/set")
|
|
345
366
|
async def browser_sites_set(self, sites: list[dict]) -> dict:
|
|
346
367
|
"""The env's own sites, each by its name and domains, which it keeps for each launch after: a start tab on one
|
|
@@ -372,6 +393,25 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
372
393
|
raise InvalidArgument(f"no tool call is open as entry {entry}")
|
|
373
394
|
return {}
|
|
374
395
|
|
|
396
|
+
@extension(BROWSER_RECORDING, op="start")
|
|
397
|
+
async def browser_recording_start(self, request_id: str, upload: dict, frames: bool = True) -> dict:
|
|
398
|
+
"""A recording of this browser, its frames and its log uploaded under the write namespace grant ``upload``:
|
|
399
|
+
with ``frames``, a frame of the tab an agent last acted in at the start, after each burst of its actions
|
|
400
|
+
settles and at the end. A start again with the same ``request_id`` answers the recording it began."""
|
|
401
|
+
return await self.recordings.start(request_id, upload, frames)
|
|
402
|
+
|
|
403
|
+
@extension(BROWSER_RECORDING, op="end")
|
|
404
|
+
async def browser_recording_end(self, recording_id: str, upload: Optional[dict] = None,
|
|
405
|
+
reason: str = "end") -> dict:
|
|
406
|
+
"""The recording ``recording_id`` ended, under a fresh grant ``upload`` when one is given: its last frames,
|
|
407
|
+
its log's lines since its start and its manifest uploaded, and the manifest answered."""
|
|
408
|
+
return await self.recordings.end(recording_id, upload, reason)
|
|
409
|
+
|
|
410
|
+
@extension(BROWSER_RECORDING, op="end_all")
|
|
411
|
+
async def browser_recording_end_all(self, reason: str = "teardown") -> dict:
|
|
412
|
+
"""Every open recording ended, under its start's grant, as the env closes or resets: their manifests."""
|
|
413
|
+
return {"recordings": await self.recordings.end_all(reason)}
|
|
414
|
+
|
|
375
415
|
@extension(BROWSER, op="cdp")
|
|
376
416
|
async def browser_cdp(self, user: str, request: Request, origin: Optional[str] = None) -> dict:
|
|
377
417
|
"""``user``'s CDP address once the browser's ready, the same one each time it's asked for, as the server that
|
|
@@ -538,23 +578,28 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
538
578
|
|
|
539
579
|
def declared_extensions(self) -> list[EnvironmentExtension]:
|
|
540
580
|
"""Its data plane moves files by their path, a file tree: its state as ``browser-state.json``, its log, its
|
|
541
|
-
profile, its downloads and files for agents to upload. A load takes its state as a data
|
|
581
|
+
network log as HAR, its profile, its downloads and files for agents to upload. A load takes its state as a data
|
|
582
|
+
part too."""
|
|
542
583
|
tree = IntakeDeclaration(get=[IntakeFormat(part="file", format="file-tree")],
|
|
543
584
|
add=[IntakeFormat(part="file", format="file-tree", load="replace"),
|
|
544
585
|
IntakeFormat(part="data", format="json", load="replace")])
|
|
545
586
|
return [*super().declared_extensions(), intake_extension(tree, (
|
|
546
587
|
f"data/get returns the browser's state as {data.STATE_FILE}: its cookies and local storage as Playwright's "
|
|
547
588
|
f"storageState has them, its tabs open and closed, its downloads and its clock; beside it, its log as "
|
|
548
|
-
f"{data.LOG_FILE},
|
|
589
|
+
f"{data.LOG_FILE} and, when a proxy logs for it and its network setting is on, its network log as HAR "
|
|
590
|
+
f"1.2 in {HAR_FILE}, an "
|
|
591
|
+
f"entry for each request and tunnel in the order they started, both of which data/add passes over, its "
|
|
592
|
+
f"profile "
|
|
549
593
|
f"without caches, and its finished downloads. data/add applies such a state, while the browser runs, and "
|
|
550
594
|
f"writes files by their path: its profile, restored with the browser stopped, ~/{DOWNLOADS} and "
|
|
551
595
|
f"~/{UPLOADS}. data/reset puts the profile back as installed and relaunches it at its start tabs."))]
|
|
552
596
|
|
|
553
597
|
@get_data
|
|
554
598
|
async def browser_get_data(self, write_namespace: Optional[WriteNamespaceGrant] = None) -> list:
|
|
555
|
-
"""Its state, as ``browser-state.json``, its
|
|
556
|
-
|
|
557
|
-
one,
|
|
599
|
+
"""Its state, as ``browser-state.json``, its log, its network log as HAR when it has one and its ``network``
|
|
600
|
+
setting is on, its profile without caches, copied
|
|
601
|
+
with the browser paused so its files are of one moment, and its finished downloads: each a file uploaded under
|
|
602
|
+
``write_namespace`` when there is one, else inline."""
|
|
558
603
|
home = Path.home()
|
|
559
604
|
state = BrowserState(cookies=await self.control.cookies(), local_storage=await self.control.local_storage(),
|
|
560
605
|
tabs=await self.control.tab_list(),
|
|
@@ -567,9 +612,13 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
567
612
|
root = Path(staging)
|
|
568
613
|
(root / data.STATE_FILE).write_text(json.dumps(written, indent=1), encoding="utf-8")
|
|
569
614
|
(root / data.LOG_FILE).write_text(await self.log.complete_text(), encoding="utf-8")
|
|
615
|
+
exported = [data.STATE_FILE, data.LOG_FILE]
|
|
616
|
+
if self.network is not None and self.settings.network:
|
|
617
|
+
(root / HAR_FILE).write_text(await self.network.har_text(), encoding="utf-8")
|
|
618
|
+
exported.append(HAR_FILE)
|
|
570
619
|
with self._computer_app.paused():
|
|
571
620
|
await app_data.in_thread(data.stage_profile, home, self.profile, root)
|
|
572
|
-
parts = await file_parts(root, [
|
|
621
|
+
parts = await file_parts(root, [*exported, self.profile], write_namespace)
|
|
573
622
|
return parts + await file_parts(home, data.finished_downloads(home), write_namespace)
|
|
574
623
|
|
|
575
624
|
@add_data
|
|
@@ -649,6 +698,8 @@ class WebsiteBrowserEnvironment(ComputerAppEnvironment):
|
|
|
649
698
|
return self.start_tab_launches[-1]["tabs"] if self.start_tab_launches else []
|
|
650
699
|
|
|
651
700
|
def extension_params(self, uri: str) -> dict:
|
|
701
|
+
if uri == BROWSER_RECORDING:
|
|
702
|
+
return {"max_duration_s": MAX_DURATION_S, "max_frames": MAX_FRAMES, "frames": True}
|
|
652
703
|
if uri == BROWSER:
|
|
653
704
|
params: dict[str, Any] = {"chromium": self.version, "clock": "real", "mode": _mode()}
|
|
654
705
|
if _alone():
|
|
@@ -23,7 +23,7 @@ import time
|
|
|
23
23
|
from collections.abc import Mapping
|
|
24
24
|
from datetime import datetime, timezone
|
|
25
25
|
from pathlib import Path
|
|
26
|
-
from typing import Any, Optional
|
|
26
|
+
from typing import Any, Callable, Optional
|
|
27
27
|
from urllib.parse import parse_qsl, quote, urlsplit, urlunsplit
|
|
28
28
|
|
|
29
29
|
logger = logging.getLogger(__name__)
|
|
@@ -75,9 +75,9 @@ ACTING_METHODS: dict[str, tuple[str, ...]] = {
|
|
|
75
75
|
ACTING_OPS = frozenset({"page/input", "navigate", "history", "tabs/open", "tabs/activate", "tabs/close",
|
|
76
76
|
"dialog/answer", "files/choose", "cookies/set", "cookies/delete", "local_storage/set",
|
|
77
77
|
"local_storage/clear", "sites/set"})
|
|
78
|
-
#: The ``browser/v1`` ops an agent's calls are never logged for: the
|
|
79
|
-
#: driver's calls that begin and end a tool call's own entry among them.
|
|
80
|
-
UNLOGGED_OPS = frozenset({"log", "record", "calls/begin", "calls/end"})
|
|
78
|
+
#: The ``browser/v1`` ops an agent's calls are never logged for: the logs themselves, and agentenv's own bookkeeping,
|
|
79
|
+
#: a driver's calls that begin and end a tool call's own entry among them.
|
|
80
|
+
UNLOGGED_OPS = frozenset({"log", "network", "record", "calls/begin", "calls/end"})
|
|
81
81
|
#: The CDP methods and ops whose text is typed into the page.
|
|
82
82
|
TYPING_METHODS = frozenset({"Input.insertText", "Input.dispatchKeyEvent", "Input.imeSetComposition"})
|
|
83
83
|
#: What a key event says of the key it types, all of it dropped when a password field has focus.
|
|
@@ -314,6 +314,8 @@ class BrowserLog:
|
|
|
314
314
|
self._unwritable = False
|
|
315
315
|
#: Per tab, the sequence number of the latest acting entry on it.
|
|
316
316
|
self.last_acting: dict[str, int] = {}
|
|
317
|
+
#: Each told every action as it's written, its sequence number and its fields, as a recording follows them.
|
|
318
|
+
self.watchers: list[Callable[[int, dict], None]] = []
|
|
317
319
|
|
|
318
320
|
@classmethod
|
|
319
321
|
def for_app(cls, name: str, fallback: Path) -> BrowserLog:
|
|
@@ -381,6 +383,16 @@ class BrowserLog:
|
|
|
381
383
|
self.note("outcome", {"entry": seq, **fields})
|
|
382
384
|
else:
|
|
383
385
|
self.write(seq, {"action": action}, at=begun["at"])
|
|
386
|
+
for watcher in self.watchers:
|
|
387
|
+
try:
|
|
388
|
+
watcher(seq, action)
|
|
389
|
+
except Exception:
|
|
390
|
+
logger.exception("a watcher of the browser's log failed")
|
|
391
|
+
|
|
392
|
+
@property
|
|
393
|
+
def next_seq(self) -> int:
|
|
394
|
+
"""The sequence number the next line will take."""
|
|
395
|
+
return self._seq + 1
|
|
384
396
|
|
|
385
397
|
def note(self, kind: str, body: dict) -> int:
|
|
386
398
|
"""A line of ``kind`` written now: a ``tab`` event, or a ``reset``."""
|