agentenv-framework-protocol 0.1.611__tar.gz → 0.1.615__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.611 → agentenv_framework_protocol-0.1.615}/PKG-INFO +32 -2
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/README.md +31 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/pyproject.toml +1 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/__init__.py +4 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/_atif_copy.py +3 -2
- agentenv_framework_protocol-0.1.615/src/agentenv_protocol/a2a_agent/_media_spool.py +148 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/_secrets.py +4 -2
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +7 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/extensions.py +51 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/framework.py +18 -7
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/registry.py +3 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/agent_env_environment.py +24 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/PROFILE.md +4 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/__init__.py +3 -3
- agentenv_framework_protocol-0.1.615/src/agentenv_protocol/atif/_image_size.py +75 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/builder.py +3 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/reader.py +25 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/validator.py +1 -2
- agentenv_framework_protocol-0.1.615/src/agentenv_protocol/computer/annotate.py +551 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/checks.py +143 -24
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/driver.py +23 -4
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/extensions.py +6 -4
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/manifest.py +2 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/recording.py +35 -9
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/runtime.py +28 -2
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/transfers.py +13 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/__init__.py +2 -1
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/control.py +3 -8
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/computer_fake.py +59 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/probe_fake.py +15 -1
- agentenv_framework_protocol-0.1.615/tests/test_a2a_atif_media.py +409 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_page.py +1 -58
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_recording.py +2 -1
- agentenv_framework_protocol-0.1.615/tests/test_computer_recording_annotate.py +496 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/NOTICE +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/THIRD_PARTY_NOTICES.md +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/advanced_agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/basic_agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/custom_extensions_agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/multimodal_agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/reference_model.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/streaming_agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/Dockerfile +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/Dockerfile.dockerignore +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/README.md +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/data/seed.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/env.toml +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/site.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/web/index.html +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/web/package-lock.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/web/package.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/web/src/main.js +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/web/src/style.css +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/examples/website/notes/web/vite.config.js +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/_snapshot_state.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/_turn_index.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/clock.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/control_token.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/a2a_agent/tasks/v1.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/adapter.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/coding.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/coding.stripped.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/computer_use.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/late_result.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/media/482405b002a62efa8516c36709a7a100637507670576fa73a20ad5420d55c66f.png +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/media/55c64d0fcd6f9d5f7c828093857e3fdfda68478bb4e9bd24d481ef391c7804e8.heic +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/media/67905ad3cc2dd52b1f5f6a6d2814de0396618b29b4238b9af5207aeb69936e6d.mp4 +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/media/69a8aa01fe5537076d023dd5e9cc4275b39fc0434aa6483a9f58b66ef2f3c896.png +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/media/82e60066a2de261b6653bcdda90d1cb9a7af2f474cecd82e8d371e8384d72315.png +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/media/845e91831319e89c4d656bdb80c278ac09a7230d61e5dfd2e1b1fbb436ac8917.pdf +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/multi_agent.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/odd_parts.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/subagent.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/fixtures/two_turns.json +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/kit.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/VENDORED.md +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/content.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/final_metrics.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/metrics.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/observation.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/observation_result.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/step.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/subagent_trajectory_ref.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/tool_call.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/models/trajectory.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/profile.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/runner.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/atif/served.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/client.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_declare.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_desktop.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_job.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_linux.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_load.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_macos.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_reaping.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_session_posix.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_windows.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_with_fds.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/_x11.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/app.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/app_data.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/app_runtime.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/apps.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/card.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/checks.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/clock.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/client.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/report.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/errors.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/frames.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/keys.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/launch.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/operations.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/platform.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/prefix.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/queue.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/results.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/run_install_step.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/seed.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/serve.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/serve_app.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/served.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/session.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/settings.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/skill.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/spaces.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/svc.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/computer/tools.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/errors.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/manifest.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/passthrough.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/preflight.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/types.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/clock.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/conformance.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/environment.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/errors.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/forwarding.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/readiness.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/routes.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website/session.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/cdp.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/contexts.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/data.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/devtools.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/environment.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/log.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/network.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/recording.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/scope.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/shapes.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/src/agentenv_protocol/website_browser/stream.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/atif_cases.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/conftest.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_agent.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_agent_clock.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_agent_examples.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_atif_scrubbing.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_atif_serving.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_atif_turns.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_cdp_config.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_object_transfers.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_proxy.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_staging.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_a2a_trajectory_log.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_agent_env_environment.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_builder.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_fixtures.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_kit.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_profile.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_reader.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_validator.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_atif_vendored.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_cdp.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_contexts.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_data.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_log.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_network.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_recording.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_browser_state.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_client.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_app_data.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_app_server.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_clock.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_conformance_attempts.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_conformance_checks.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_conformance_page.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_conformance_recording.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_declare.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_driver.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_driver_keys.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_extensions.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_frames.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_macos.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_queue.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_seed.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_serve.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_served.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_spaces.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_svc_forward.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_tool_prefix.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_computer_windows_driver.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_control_token.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_data_objects.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_devtools_pipe.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_errors.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_extension_methods.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_intake.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_manifest.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_preflight.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_tool_annotations.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_tool_context_fastmcp.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_tool_context_injection.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_usage.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_api.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_browser.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_environment.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_forwarding.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_live.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_mcp.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/tests/test_website_notes_example.py +0 -0
- {agentenv_framework_protocol-0.1.611 → agentenv_framework_protocol-0.1.615}/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.615
|
|
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
|
|
@@ -826,7 +826,7 @@ class MyDriver(ComputerDriverEnvironment):
|
|
|
826
826
|
of its own, the latest 8 frames wait for the encoder, and it is closed when the recording stops. A
|
|
827
827
|
driver without `@record` records by the base class polling `@capture`, with a pointer drawn at
|
|
828
828
|
`@pointer_position`: the slow path, at most 15 fps.
|
|
829
|
-
- **The methods.** `start {request_id, scope?, fps?, max_edge?, cursor?, upload?}` returns
|
|
829
|
+
- **The methods.** `start {request_id, scope?, fps?, max_edge?, cursor?, upload?, annotate?}` returns
|
|
830
830
|
`{recording_id, started_at, format}`; `end {recording_id, upload?, reason?}` closes the last segment
|
|
831
831
|
and returns the manifest; `end_all {reason?}` ends every recording not yet ended, each under the
|
|
832
832
|
grant it started with, and returns `{manifests}`, as the framework does before it resets or tears a
|
|
@@ -839,6 +839,22 @@ class MyDriver(ComputerDriverEnvironment):
|
|
|
839
839
|
`<recording_id>/<index>.mp4`, and is then deleted; `end`'s own grant uploads any that missed. With no
|
|
840
840
|
grant they stay under `~/.agentenv-recordings/`. An ended recording's manifest uploads beside its
|
|
841
841
|
segments, at `<recording_id>/manifest.json`, so a reader that didn't end it finds it there.
|
|
842
|
+
- **Annotations.** `start` with `annotate`, an object of options (`{}` for none; the card lists those a
|
|
843
|
+
driver takes under its params' `annotate.options`), draws each input over the frames captured while it
|
|
844
|
+
shows, in the colour of the role that sent it (the agent's always the same; another role's picked by its
|
|
845
|
+
name, so it's the same on every recording unless a role that acted earlier there has it): a ring where a click landed, round a
|
|
846
|
+
hollow dot that leaves the pointer's tip in sight (a square for the right button, a ring for each click
|
|
847
|
+
of a double or triple), a trail for a drag, an
|
|
848
|
+
arrow for a scroll, a cross for a move, and a chip for a key chord, typed text as it was typed, and
|
|
849
|
+
each of the driver's own or forwarded tools whose annotations don't say it only reads, by name and
|
|
850
|
+
main argument. Where the frames can't show the pointer themselves, as frames polled from captures that
|
|
851
|
+
leave it out do (cua-driver's), a pointer is drawn for each role and pointer that has acted, where its
|
|
852
|
+
last input left it, along a drag's path as it moves, after a fading line from where it jumped: the one
|
|
853
|
+
that moved last at full strength, the others fainter, each named once there are several. Every `computer_*` input is marked
|
|
854
|
+
as `act` delivers it, best effort, and shows on
|
|
855
|
+
every frame while it lasts and on the first one after it however late, as at a low fps. A segment a
|
|
856
|
+
native recorder finished is kept as it came. The manifest's `annotate` is the object the recording
|
|
857
|
+
drew with, and is left out for one that took a native recorder's segments.
|
|
842
858
|
- **The manifest** (`RecordingManifest`). Its `segments` (`ManifestSegment`) carry each one's path,
|
|
843
859
|
`started_at` and `ended_at` (its first and last frames' capture times), size, frame count, byte size,
|
|
844
860
|
SHA-256 and whether it uploaded, and `ended_by` says why the recording ended: `end`, `reset`,
|
|
@@ -1767,6 +1783,20 @@ first, and a read scrubs as it serves, so a secret learned after a step was
|
|
|
1767
1783
|
written is left out too. Native reads keep every secret byte for byte, so a
|
|
1768
1784
|
replay of the served inputs holds what the served copy redacts.
|
|
1769
1785
|
|
|
1786
|
+
A copy's media files, `media/<sha256>.<ext>` beside the document, wait on the
|
|
1787
|
+
agent's disk as the adapter names them, one file per sha256, with a PNG, JPEG,
|
|
1788
|
+
GIF or WebP image's width and height read from its header. The worker pulls
|
|
1789
|
+
them at each turn's end with the trajectory extension's `media` call, listed on
|
|
1790
|
+
the card of an agent that serves `atif/1`: `{context_id, objects: {path: write
|
|
1791
|
+
grant}}` uploads each file the context holds under its exact-object grant, up
|
|
1792
|
+
to 8 at a time, checking each upload's bytes against its name. It answers what
|
|
1793
|
+
it uploaded, the paths it holds no file for (`missing`) and the uploads that
|
|
1794
|
+
failed (`failed`). Neither stops the rest. A file uploaded leaves the agent's
|
|
1795
|
+
disk, as do a context's files when it is evicted or restored over, and the
|
|
1796
|
+
rest when the server stops. A reader takes a part path only as
|
|
1797
|
+
`media/<sha256>.<ext>` and checks the bytes it reads against that name
|
|
1798
|
+
(`agentenv_protocol.atif.media_file` and `check_media`).
|
|
1799
|
+
|
|
1770
1800
|
`enable(..., description="...")` is reserved for declarations carrying
|
|
1771
1801
|
configuration or metadata. It preserves the agent-specific extension prose
|
|
1772
1802
|
published in the Agent Card. The versioned SDK definition provides a generic
|
|
@@ -755,7 +755,7 @@ class MyDriver(ComputerDriverEnvironment):
|
|
|
755
755
|
of its own, the latest 8 frames wait for the encoder, and it is closed when the recording stops. A
|
|
756
756
|
driver without `@record` records by the base class polling `@capture`, with a pointer drawn at
|
|
757
757
|
`@pointer_position`: the slow path, at most 15 fps.
|
|
758
|
-
- **The methods.** `start {request_id, scope?, fps?, max_edge?, cursor?, upload?}` returns
|
|
758
|
+
- **The methods.** `start {request_id, scope?, fps?, max_edge?, cursor?, upload?, annotate?}` returns
|
|
759
759
|
`{recording_id, started_at, format}`; `end {recording_id, upload?, reason?}` closes the last segment
|
|
760
760
|
and returns the manifest; `end_all {reason?}` ends every recording not yet ended, each under the
|
|
761
761
|
grant it started with, and returns `{manifests}`, as the framework does before it resets or tears a
|
|
@@ -768,6 +768,22 @@ class MyDriver(ComputerDriverEnvironment):
|
|
|
768
768
|
`<recording_id>/<index>.mp4`, and is then deleted; `end`'s own grant uploads any that missed. With no
|
|
769
769
|
grant they stay under `~/.agentenv-recordings/`. An ended recording's manifest uploads beside its
|
|
770
770
|
segments, at `<recording_id>/manifest.json`, so a reader that didn't end it finds it there.
|
|
771
|
+
- **Annotations.** `start` with `annotate`, an object of options (`{}` for none; the card lists those a
|
|
772
|
+
driver takes under its params' `annotate.options`), draws each input over the frames captured while it
|
|
773
|
+
shows, in the colour of the role that sent it (the agent's always the same; another role's picked by its
|
|
774
|
+
name, so it's the same on every recording unless a role that acted earlier there has it): a ring where a click landed, round a
|
|
775
|
+
hollow dot that leaves the pointer's tip in sight (a square for the right button, a ring for each click
|
|
776
|
+
of a double or triple), a trail for a drag, an
|
|
777
|
+
arrow for a scroll, a cross for a move, and a chip for a key chord, typed text as it was typed, and
|
|
778
|
+
each of the driver's own or forwarded tools whose annotations don't say it only reads, by name and
|
|
779
|
+
main argument. Where the frames can't show the pointer themselves, as frames polled from captures that
|
|
780
|
+
leave it out do (cua-driver's), a pointer is drawn for each role and pointer that has acted, where its
|
|
781
|
+
last input left it, along a drag's path as it moves, after a fading line from where it jumped: the one
|
|
782
|
+
that moved last at full strength, the others fainter, each named once there are several. Every `computer_*` input is marked
|
|
783
|
+
as `act` delivers it, best effort, and shows on
|
|
784
|
+
every frame while it lasts and on the first one after it however late, as at a low fps. A segment a
|
|
785
|
+
native recorder finished is kept as it came. The manifest's `annotate` is the object the recording
|
|
786
|
+
drew with, and is left out for one that took a native recorder's segments.
|
|
771
787
|
- **The manifest** (`RecordingManifest`). Its `segments` (`ManifestSegment`) carry each one's path,
|
|
772
788
|
`started_at` and `ended_at` (its first and last frames' capture times), size, frame count, byte size,
|
|
773
789
|
SHA-256 and whether it uploaded, and `ended_by` says why the recording ended: `end`, `reset`,
|
|
@@ -1696,6 +1712,20 @@ first, and a read scrubs as it serves, so a secret learned after a step was
|
|
|
1696
1712
|
written is left out too. Native reads keep every secret byte for byte, so a
|
|
1697
1713
|
replay of the served inputs holds what the served copy redacts.
|
|
1698
1714
|
|
|
1715
|
+
A copy's media files, `media/<sha256>.<ext>` beside the document, wait on the
|
|
1716
|
+
agent's disk as the adapter names them, one file per sha256, with a PNG, JPEG,
|
|
1717
|
+
GIF or WebP image's width and height read from its header. The worker pulls
|
|
1718
|
+
them at each turn's end with the trajectory extension's `media` call, listed on
|
|
1719
|
+
the card of an agent that serves `atif/1`: `{context_id, objects: {path: write
|
|
1720
|
+
grant}}` uploads each file the context holds under its exact-object grant, up
|
|
1721
|
+
to 8 at a time, checking each upload's bytes against its name. It answers what
|
|
1722
|
+
it uploaded, the paths it holds no file for (`missing`) and the uploads that
|
|
1723
|
+
failed (`failed`). Neither stops the rest. A file uploaded leaves the agent's
|
|
1724
|
+
disk, as do a context's files when it is evicted or restored over, and the
|
|
1725
|
+
rest when the server stops. A reader takes a part path only as
|
|
1726
|
+
`media/<sha256>.<ext>` and checks the bytes it reads against that name
|
|
1727
|
+
(`agentenv_protocol.atif.media_file` and `check_media`).
|
|
1728
|
+
|
|
1699
1729
|
`enable(..., description="...")` is reserved for declarations carrying
|
|
1700
1730
|
configuration or metadata. It preserves the agent-specific extension prose
|
|
1701
1731
|
published in the Agent Card. The versioned SDK definition provides a generic
|
|
@@ -77,6 +77,8 @@ from .extensions import (
|
|
|
77
77
|
TaskObjectTrajectoryRequest,
|
|
78
78
|
TaskTrajectoryRequest,
|
|
79
79
|
TrajectoryEventsResponse,
|
|
80
|
+
TrajectoryMediaRequest,
|
|
81
|
+
TrajectoryMediaResponse,
|
|
80
82
|
TrajectoryObjectsResponse,
|
|
81
83
|
AtifEventsResponse,
|
|
82
84
|
AtifObjectsResponse,
|
|
@@ -256,6 +258,8 @@ __all__ = [
|
|
|
256
258
|
"AtifObjectsResponse",
|
|
257
259
|
"AtifUploadedObjects",
|
|
258
260
|
"TrajectoryLog",
|
|
261
|
+
"TrajectoryMediaRequest",
|
|
262
|
+
"TrajectoryMediaResponse",
|
|
259
263
|
"TrajectoryObjectsResponse",
|
|
260
264
|
"TrajectoryState",
|
|
261
265
|
"TrajectoryUploadedObjects",
|
|
@@ -68,8 +68,9 @@ class AtifCopy:
|
|
|
68
68
|
serves goes through ``scrub``, the agent's secrets redacted."""
|
|
69
69
|
|
|
70
70
|
def __init__(self, adapter: type[Adapter], context_id: str, *,
|
|
71
|
-
scrub: Callable[[Any], Any] = lambda served: served
|
|
72
|
-
|
|
71
|
+
scrub: Callable[[Any], Any] = lambda served: served,
|
|
72
|
+
media: Callable[[str, bytes], None] | None = None) -> None:
|
|
73
|
+
self._run = AdapterRun(adapter, media=media, trajectory_id=uuid.uuid4().hex)
|
|
73
74
|
self._adapter = adapter.__name__
|
|
74
75
|
self._context_id = context_id
|
|
75
76
|
self._scrub = scrub
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""The media files of an agent's atif/1 copies, spooled to its disk as the adapter names them: one file per sha256,
|
|
2
|
+
held by the contexts whose copies reference it, until a push uploads it for a context or that context goes. The worker
|
|
3
|
+
pulls them at each turn's end (``TRAJECTORY_V1.media``), so the bytes never wait in memory."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import asyncio
|
|
8
|
+
import itertools
|
|
9
|
+
import logging
|
|
10
|
+
import os
|
|
11
|
+
import shutil
|
|
12
|
+
import tempfile
|
|
13
|
+
import threading
|
|
14
|
+
from collections.abc import Callable, Mapping
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from ..atif import media_file
|
|
18
|
+
from ..transfers import TransferError, Uploaded, WriteObject, sha256_file, upload
|
|
19
|
+
from .extensions import TrajectoryMediaResponse
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
|
|
23
|
+
#: How many of a push's files upload at once.
|
|
24
|
+
MAX_PARALLEL_MEDIA_PUSHES = 8
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class MediaSpool:
|
|
28
|
+
"""Each context's media files on disk. Safe to fill from the agent's thread while the loop pushes them; the folder
|
|
29
|
+
is made on the first file and removed by ``close``. Each hold has its own number, so an upload that outlives its
|
|
30
|
+
context's copy (a restore, an eviction) releases only the hold it began with, never a later copy's. A file that
|
|
31
|
+
can't be written, on a full disk say, is left out: a push reports it missing, and the copy goes on."""
|
|
32
|
+
|
|
33
|
+
def __init__(self) -> None:
|
|
34
|
+
self._lock = threading.Lock()
|
|
35
|
+
self._folder: Path | None = None
|
|
36
|
+
#: Each context's held paths, ``media/<sha256>.<ext>``, each with its hold's number.
|
|
37
|
+
self._held: dict[str, dict[str, int]] = {}
|
|
38
|
+
self._holds = itertools.count(1)
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def folder(self) -> Path | None:
|
|
42
|
+
"""Where the files are, once the first one is written."""
|
|
43
|
+
return self._folder
|
|
44
|
+
|
|
45
|
+
def sink(self, context_id: str) -> Callable[[str, bytes], None]:
|
|
46
|
+
"""Where a context's copy writes each media file once, as its builder names it."""
|
|
47
|
+
|
|
48
|
+
def write(path: str, data: bytes) -> None:
|
|
49
|
+
with self._lock:
|
|
50
|
+
try:
|
|
51
|
+
file = self._file(path)
|
|
52
|
+
if not file.exists():
|
|
53
|
+
part = file.with_name(f"{file.name}.{os.getpid()}.part")
|
|
54
|
+
try:
|
|
55
|
+
part.write_bytes(data)
|
|
56
|
+
os.replace(part, file)
|
|
57
|
+
finally:
|
|
58
|
+
part.unlink(missing_ok=True)
|
|
59
|
+
except OSError as exc:
|
|
60
|
+
logger.warning("the atif/1 copy of context %s keeps no file for %s, which a push reports "
|
|
61
|
+
"missing: %s", context_id, path, exc)
|
|
62
|
+
return
|
|
63
|
+
self._held.setdefault(context_id, {}).setdefault(path, next(self._holds))
|
|
64
|
+
|
|
65
|
+
return write
|
|
66
|
+
|
|
67
|
+
def held(self, context_id: str, path: str) -> Path | None:
|
|
68
|
+
"""The file a context holds at ``path``, or None when it holds none there."""
|
|
69
|
+
hold = self._hold(context_id, path)
|
|
70
|
+
return None if hold is None else hold[0]
|
|
71
|
+
|
|
72
|
+
async def push(self, context_id: str, objects: Mapping[str, WriteObject]) -> TrajectoryMediaResponse:
|
|
73
|
+
"""Upload the files a context holds at ``objects``' paths, each under its grant, ``MAX_PARALLEL_MEDIA_PUSHES``
|
|
74
|
+
at a time. Each file's sha256 is checked against its name before its bytes leave, and the upload's after; a file
|
|
75
|
+
uploaded is the context's no longer. A path the context holds no file for is ``missing``, an upload that fails
|
|
76
|
+
is ``failed``, and neither stops the rest."""
|
|
77
|
+
uploaded: dict[str, Uploaded] = {}
|
|
78
|
+
missing: list[str] = []
|
|
79
|
+
failed: dict[str, str] = {}
|
|
80
|
+
gate = asyncio.Semaphore(MAX_PARALLEL_MEDIA_PUSHES)
|
|
81
|
+
|
|
82
|
+
async def push_one(path: str, target: WriteObject) -> None:
|
|
83
|
+
held = self._hold(context_id, path)
|
|
84
|
+
if held is None:
|
|
85
|
+
missing.append(path)
|
|
86
|
+
return
|
|
87
|
+
file, hold = held
|
|
88
|
+
async with gate:
|
|
89
|
+
try:
|
|
90
|
+
digest = await asyncio.to_thread(sha256_file, file)
|
|
91
|
+
except OSError as exc:
|
|
92
|
+
failed[path] = f"the spooled file can't be read: {exc.strerror}"
|
|
93
|
+
return
|
|
94
|
+
if digest != media_file(path):
|
|
95
|
+
failed[path] = f"the spooled file's sha256 is {digest}"
|
|
96
|
+
return
|
|
97
|
+
try:
|
|
98
|
+
done = await upload(target, file)
|
|
99
|
+
except TransferError as exc:
|
|
100
|
+
failed[path] = f"{exc.code}: {exc}"
|
|
101
|
+
return
|
|
102
|
+
if done.sha256 is not None and done.sha256 != digest:
|
|
103
|
+
failed[path] = f"the upload's sha256 is {done.sha256}"
|
|
104
|
+
return
|
|
105
|
+
uploaded[path] = done
|
|
106
|
+
self._release(context_id, path, hold)
|
|
107
|
+
|
|
108
|
+
await asyncio.gather(*(push_one(path, target) for path, target in objects.items()))
|
|
109
|
+
return TrajectoryMediaResponse(objects=uploaded, missing=sorted(missing), failed=failed)
|
|
110
|
+
|
|
111
|
+
def drop(self, context_id: str) -> None:
|
|
112
|
+
"""The context is gone, evicted or restored over: its files go, but those another context still holds."""
|
|
113
|
+
with self._lock:
|
|
114
|
+
for path in self._held.pop(context_id, {}):
|
|
115
|
+
self._remove_unheld(path)
|
|
116
|
+
|
|
117
|
+
def close(self) -> None:
|
|
118
|
+
with self._lock:
|
|
119
|
+
if self._folder is not None:
|
|
120
|
+
shutil.rmtree(self._folder, ignore_errors=True)
|
|
121
|
+
self._folder = None
|
|
122
|
+
self._held.clear()
|
|
123
|
+
|
|
124
|
+
def _hold(self, context_id: str, path: str) -> tuple[Path, int] | None:
|
|
125
|
+
with self._lock:
|
|
126
|
+
hold = self._held.get(context_id, {}).get(path)
|
|
127
|
+
return None if hold is None else (self._file(path), hold)
|
|
128
|
+
|
|
129
|
+
def _release(self, context_id: str, path: str, hold: int) -> None:
|
|
130
|
+
"""Hold ``hold`` on ``path`` is the context's no longer. A later hold stays, and the file goes once no context
|
|
131
|
+
holds it."""
|
|
132
|
+
with self._lock:
|
|
133
|
+
held = self._held.get(context_id)
|
|
134
|
+
if held is None or held.get(path) != hold:
|
|
135
|
+
return
|
|
136
|
+
del held[path]
|
|
137
|
+
if not held:
|
|
138
|
+
del self._held[context_id]
|
|
139
|
+
self._remove_unheld(path)
|
|
140
|
+
|
|
141
|
+
def _file(self, path: str) -> Path:
|
|
142
|
+
if self._folder is None:
|
|
143
|
+
self._folder = Path(tempfile.mkdtemp(prefix="agentenv-atif-media-"))
|
|
144
|
+
return self._folder / path.removeprefix("media/")
|
|
145
|
+
|
|
146
|
+
def _remove_unheld(self, path: str) -> None:
|
|
147
|
+
if self._folder is not None and not any(path in held for held in self._held.values()):
|
|
148
|
+
(self._folder / path.removeprefix("media/")).unlink(missing_ok=True)
|
|
@@ -16,6 +16,7 @@ from urllib.parse import quote, unquote_plus, urlsplit
|
|
|
16
16
|
|
|
17
17
|
from pydantic import BaseModel, SecretStr
|
|
18
18
|
|
|
19
|
+
from ..atif.reader import MEDIA_NAME
|
|
19
20
|
from ..transfers import HttpGetGrant, HttpPostPolicyGrant, HttpPutGrant
|
|
20
21
|
from .extensions import CdpAddRequest, ClockSyncTimeRequest, McpAddRequest
|
|
21
22
|
from .tasks.v1 import AgentConfig
|
|
@@ -239,13 +240,14 @@ def _grant_secrets(grant: HttpGetGrant | HttpPutGrant | HttpPostPolicyGrant) ->
|
|
|
239
240
|
def _url_secrets(url: str) -> list[str]:
|
|
240
241
|
"""The parts of a URL that carry its credential: a presigned URL's credential-like query values, else its token-like
|
|
241
242
|
path segments, as a grant server's (``/v1/grants/<token>``, with or without a plain query such as ``?download=1``),
|
|
242
|
-
and its password. Every copy of the URL, whole or as a request line, holds them, so redacting them is enough; the
|
|
243
|
+
but a media file's name, which the copies that hold the file keep, and its password. Every copy of the URL, whole or as a request line, holds them, so redacting them is enough; the
|
|
243
244
|
rest (its host, its path, ``X-Amz-Algorithm``) isn't secret, and leaving it keeps each grant's share of the match
|
|
244
245
|
to its signature: the session token and access key a role signs every grant with are each one secret."""
|
|
245
246
|
parts = urlsplit(url)
|
|
246
247
|
carried = _query_values(url)
|
|
247
248
|
if not carried:
|
|
248
|
-
carried = [segment for segment in parts.path.split("/")
|
|
249
|
+
carried = [segment for segment in parts.path.split("/")
|
|
250
|
+
if _TOKEN_SEGMENT.fullmatch(segment) and not MEDIA_NAME.fullmatch(segment)]
|
|
249
251
|
return [*carried, *([parts.password] if parts.password else [])]
|
|
250
252
|
|
|
251
253
|
|
|
@@ -10,6 +10,7 @@ from typing import Any, Callable, Sequence
|
|
|
10
10
|
|
|
11
11
|
from ..atif import Adapter
|
|
12
12
|
from ._atif_copy import AtifCopy, AtifPage, TurnStart
|
|
13
|
+
from ._media_spool import MediaSpool
|
|
13
14
|
from ._turn_index import TurnIndex
|
|
14
15
|
from .extensions import TrajectoryState
|
|
15
16
|
from .tasks.v1 import TaskError, TrajectoryLog
|
|
@@ -98,6 +99,8 @@ class TaskTrajectories:
|
|
|
98
99
|
self._turns = TurnIndex() if atif is not None else None
|
|
99
100
|
#: What every atif/1 read goes through: the agent's secrets redacted.
|
|
100
101
|
self._scrub = scrub
|
|
102
|
+
#: The copies' media files, on disk until the worker pulls them.
|
|
103
|
+
self.media = MediaSpool()
|
|
101
104
|
self._tasks: dict[str, _TaskRecord] = {}
|
|
102
105
|
self._contexts: OrderedDict[str, list[str]] = OrderedDict()
|
|
103
106
|
self._copies: dict[str, AtifCopy] = {}
|
|
@@ -133,7 +136,8 @@ class TaskTrajectories:
|
|
|
133
136
|
copy = self._copies.get(record.context_id)
|
|
134
137
|
if copy is None:
|
|
135
138
|
copy = self._copies[record.context_id] = AtifCopy(
|
|
136
|
-
self._atif, record.context_id,
|
|
139
|
+
self._atif, record.context_id, media=self.media.sink(record.context_id),
|
|
140
|
+
**({"scrub": self._scrub} if self._scrub is not None else {}),
|
|
137
141
|
)
|
|
138
142
|
copy.start(task_id, self._turns.next(record.context_id), turn)
|
|
139
143
|
record.log._atif = _CopySink(copy, task_id)
|
|
@@ -149,6 +153,7 @@ class TaskTrajectories:
|
|
|
149
153
|
new document, since the conversation is the snapshot's now; an agent that serves atif/1 only."""
|
|
150
154
|
self._turns.set(context_id, turns)
|
|
151
155
|
self._copies.pop(context_id, None)
|
|
156
|
+
self.media.drop(context_id)
|
|
152
157
|
|
|
153
158
|
def request_cancel(self, task_id: str) -> None:
|
|
154
159
|
"""Make ``canceled`` the outcome the task is sealed with, whatever ``run`` returns."""
|
|
@@ -357,6 +362,7 @@ class TaskTrajectories:
|
|
|
357
362
|
continue
|
|
358
363
|
del self._contexts[context_id]
|
|
359
364
|
self._copies.pop(context_id, None)
|
|
365
|
+
self.media.drop(context_id)
|
|
360
366
|
for task_id in task_ids:
|
|
361
367
|
del self._tasks[task_id]
|
|
362
368
|
|
|
@@ -25,7 +25,7 @@ from pydantic import (
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
from ..atif import FORMAT as ATIF_FORMAT
|
|
28
|
-
from ..atif import Adapter, AdapterSpec
|
|
28
|
+
from ..atif import Adapter, AdapterSpec, media_file
|
|
29
29
|
from ._triggers import MAX_SOLVER_MESSAGE_LENGTH
|
|
30
30
|
from .tasks.v1 import AgentConfig
|
|
31
31
|
from ..transfers import (
|
|
@@ -205,6 +205,34 @@ class TrajectoryObjectsResponse(ExtensionResponse):
|
|
|
205
205
|
format: str | None = None
|
|
206
206
|
|
|
207
207
|
|
|
208
|
+
#: The most media files one media call may name: a turn of a computer-use run holds a few hundred screenshots.
|
|
209
|
+
MAX_MEDIA_OBJECTS = 10_000
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
class TrajectoryMediaRequest(ExtensionRequest):
|
|
213
|
+
"""The media files of a context's atif/1 copy the caller wants, by their paths in it (``media/<sha256>.<ext>``),
|
|
214
|
+
each under its own exact-object write grant."""
|
|
215
|
+
|
|
216
|
+
context_id: str = Field(min_length=1)
|
|
217
|
+
objects: dict[str, WriteObject] = Field(min_length=1, max_length=MAX_MEDIA_OBJECTS)
|
|
218
|
+
|
|
219
|
+
@field_validator("objects")
|
|
220
|
+
@classmethod
|
|
221
|
+
def _media_paths(cls, objects: dict[str, WriteObject]) -> dict[str, WriteObject]:
|
|
222
|
+
for path in objects:
|
|
223
|
+
media_file(path)
|
|
224
|
+
return objects
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class TrajectoryMediaResponse(ExtensionResponse):
|
|
228
|
+
"""What a media call uploaded, by path; the paths the context holds no file for; and the uploads that failed, with
|
|
229
|
+
why. Neither of the last two stops the rest."""
|
|
230
|
+
|
|
231
|
+
objects: dict[str, Uploaded]
|
|
232
|
+
missing: list[str] = Field(default_factory=list)
|
|
233
|
+
failed: dict[str, str] = Field(default_factory=dict)
|
|
234
|
+
|
|
235
|
+
|
|
208
236
|
class AtifUploadedObjects(ExtensionResponse):
|
|
209
237
|
trajectory: Uploaded
|
|
210
238
|
aux: Uploaded | None = None
|
|
@@ -816,6 +844,9 @@ class OperationDefinition:
|
|
|
816
844
|
implementation: ImplementationOwner
|
|
817
845
|
request: RequestDefinition | type[BaseModel] | None = None
|
|
818
846
|
response: FieldSchema | type[BaseModel] | None = None
|
|
847
|
+
#: Served by the SDK alone, from state only it holds: no agent overrides it, and an agent that overrides the
|
|
848
|
+
#: extension's other SDK operations needn't override it with them.
|
|
849
|
+
sdk_only: bool = False
|
|
819
850
|
response_model: type[BaseModel] | None = field(default=None, init=False)
|
|
820
851
|
|
|
821
852
|
def __post_init__(self) -> None:
|
|
@@ -1104,6 +1135,7 @@ def _op(
|
|
|
1104
1135
|
response_required: Iterable[str] = (),
|
|
1105
1136
|
response_optional: Iterable[str] = (),
|
|
1106
1137
|
variants: Iterable[RequestVariant] = (),
|
|
1138
|
+
sdk_only: bool = False,
|
|
1107
1139
|
) -> OperationDefinition:
|
|
1108
1140
|
response_required = _tuple(response_required)
|
|
1109
1141
|
response_optional = _tuple(response_optional)
|
|
@@ -1123,6 +1155,7 @@ def _op(
|
|
|
1123
1155
|
implementation=owner,
|
|
1124
1156
|
request=request,
|
|
1125
1157
|
response=response,
|
|
1158
|
+
sdk_only=sdk_only,
|
|
1126
1159
|
)
|
|
1127
1160
|
|
|
1128
1161
|
|
|
@@ -1194,6 +1227,8 @@ def _configure_trajectory(
|
|
|
1194
1227
|
return ExtensionConfiguration(
|
|
1195
1228
|
wire_params={"formats": formats, "native": native, "default": native} if native else {},
|
|
1196
1229
|
options={"native": native, **({"atif": atif} if atif is not None else {})} if native else {},
|
|
1230
|
+
# An agent that serves atif/1 hands over its copies' media files, which the worker pulls at each turn's end.
|
|
1231
|
+
features={"media"} if atif is not None else frozenset(),
|
|
1197
1232
|
variants=(
|
|
1198
1233
|
{"get": {"task_events", "context_events", "context", "context_objects"}} if live else {}
|
|
1199
1234
|
),
|
|
@@ -1341,6 +1376,21 @@ TRAJECTORY_V1 = ExtensionDefinition(
|
|
|
1341
1376
|
),
|
|
1342
1377
|
)
|
|
1343
1378
|
},
|
|
1379
|
+
optional_features={
|
|
1380
|
+
"media": OperationGroup(
|
|
1381
|
+
operations={
|
|
1382
|
+
"media": _op(
|
|
1383
|
+
"media",
|
|
1384
|
+
"POST",
|
|
1385
|
+
"/ext/trajectory/media",
|
|
1386
|
+
SDK,
|
|
1387
|
+
request_model=TrajectoryMediaRequest,
|
|
1388
|
+
response_model=TrajectoryMediaResponse,
|
|
1389
|
+
sdk_only=True,
|
|
1390
|
+
),
|
|
1391
|
+
}
|
|
1392
|
+
)
|
|
1393
|
+
},
|
|
1344
1394
|
configuration_validator=_configure_trajectory,
|
|
1345
1395
|
)
|
|
1346
1396
|
|
|
@@ -68,6 +68,7 @@ from .extensions import (
|
|
|
68
68
|
AtifObjectsResponse,
|
|
69
69
|
AtifUploadedObjects,
|
|
70
70
|
TrajectoryEventsResponse,
|
|
71
|
+
TrajectoryMediaRequest,
|
|
71
72
|
TrajectoryObjectsResponse,
|
|
72
73
|
TrajectoryState,
|
|
73
74
|
TrajectoryUploadedObjects,
|
|
@@ -682,6 +683,7 @@ class _SdkServices:
|
|
|
682
683
|
(PEER_AGENTS_V1.uri, "list"): self.peer_agents_list,
|
|
683
684
|
(SKILL_CONFIG_V1.uri, "list"): self.skill_list,
|
|
684
685
|
(TRAJECTORY_V1.uri, "get"): self.trajectory_get,
|
|
686
|
+
(TRAJECTORY_V1.uri, "media"): self.trajectory_media,
|
|
685
687
|
(TRIGGERS_V1.uri, "register"): self.triggers_register,
|
|
686
688
|
(TRIGGERS_V1.uri, "decide"): self.triggers_decide,
|
|
687
689
|
(TRIGGERS_V1.uri, "state"): self.triggers_state,
|
|
@@ -964,6 +966,11 @@ class _SdkServices:
|
|
|
964
966
|
)
|
|
965
967
|
return AtifObjectsResponse(objects=uploaded, **versions).model_dump(mode="json", exclude_none=True)
|
|
966
968
|
|
|
969
|
+
async def trajectory_media(self, request: TrajectoryMediaRequest) -> dict[str, Any]:
|
|
970
|
+
"""Upload the media files of a context's atif/1 copy the worker asks for, from the spool (``MediaSpool.push``)."""
|
|
971
|
+
pushed = await self.task_trajectories.media.push(request.context_id, request.objects)
|
|
972
|
+
return pushed.model_dump(mode="json", exclude_none=True)
|
|
973
|
+
|
|
967
974
|
def check_trajectory_format(self, format: str | None) -> None:
|
|
968
975
|
"""Refuse a trajectory read naming a format the card doesn't offer, before any handler
|
|
969
976
|
runs, the agent's own included."""
|
|
@@ -1128,7 +1135,8 @@ def _taking_the_control_token(
|
|
|
1128
1135
|
inner: Callable[[Starlette], AbstractAsyncContextManager] | None,
|
|
1129
1136
|
) -> Callable[[Starlette], AbstractAsyncContextManager]:
|
|
1130
1137
|
"""The application's lifespan, ``inner``'s if it has one: serving starts by taking the agent's control token out of
|
|
1131
|
-
the environment, and the extension routes take it from then on
|
|
1138
|
+
the environment, and the extension routes take it from then on, and ends by removing the media spool. An
|
|
1139
|
+
application that isn't served stays open."""
|
|
1132
1140
|
|
|
1133
1141
|
@asynccontextmanager
|
|
1134
1142
|
async def lifespan(app: Starlette) -> AsyncIterator[Any]:
|
|
@@ -1136,11 +1144,14 @@ def _taking_the_control_token(
|
|
|
1136
1144
|
log_guard(application.control_token)
|
|
1137
1145
|
if application.services.secrets is not None:
|
|
1138
1146
|
application.services.secrets.add(application.control_token, source="the control token")
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1147
|
+
try:
|
|
1148
|
+
if inner is None:
|
|
1149
|
+
yield None
|
|
1150
|
+
else:
|
|
1151
|
+
async with inner(app) as state:
|
|
1152
|
+
yield state
|
|
1153
|
+
finally:
|
|
1154
|
+
application.services.task_trajectories.media.close()
|
|
1144
1155
|
|
|
1145
1156
|
return lifespan
|
|
1146
1157
|
|
|
@@ -1354,7 +1365,7 @@ class A2AAgentApplication:
|
|
|
1354
1365
|
extension_request = request_model.model_validate(payload)
|
|
1355
1366
|
if self.services.secrets is not None:
|
|
1356
1367
|
self.services.secrets.add_request(extension_request)
|
|
1357
|
-
if extension_uri == TRAJECTORY_V1.uri:
|
|
1368
|
+
if extension_uri == TRAJECTORY_V1.uri and operation.definition.name == "get":
|
|
1358
1369
|
self.services.check_trajectory_format(extension_request.format)
|
|
1359
1370
|
if extension_request.format == ATIF_FORMAT:
|
|
1360
1371
|
# The SDK serves atif/1 from its own copy, context reads an agent binds included.
|
|
@@ -304,6 +304,8 @@ def build_registry(
|
|
|
304
304
|
variant_handlers[key] = handler
|
|
305
305
|
continue
|
|
306
306
|
|
|
307
|
+
if operation.sdk_only:
|
|
308
|
+
raise ValueError(f"{uri}.{operation.name} is served by the SDK alone; an agent can't override it")
|
|
307
309
|
key = (uri, binding.operation)
|
|
308
310
|
if key in operation_handlers:
|
|
309
311
|
raise ValueError(f"multiple handlers for {uri}.{operation.name}")
|
|
@@ -424,7 +426,7 @@ def build_registry(
|
|
|
424
426
|
active_sdk_operations = {
|
|
425
427
|
name
|
|
426
428
|
for name, operation in resolved_operations.items()
|
|
427
|
-
if operation.definition.implementation is ImplementationOwner.SDK
|
|
429
|
+
if operation.definition.implementation is ImplementationOwner.SDK and not operation.definition.sdk_only
|
|
428
430
|
}
|
|
429
431
|
overridden_sdk_operations = {
|
|
430
432
|
name
|
|
@@ -1242,6 +1242,30 @@ def _discover_tools(handler: Any, environment_name: str) -> list:
|
|
|
1242
1242
|
return ordered
|
|
1243
1243
|
|
|
1244
1244
|
|
|
1245
|
+
def read_only_tools(handler: Any, environment_name: str) -> frozenset[str]:
|
|
1246
|
+
"""The ``@tool`` methods and forwarded tools ``handler`` serves whose MCP annotations say they only read
|
|
1247
|
+
(``readOnlyHint``), by the names an app mounts them under for environment ``environment_name``, before its
|
|
1248
|
+
``serve_tools_as`` renames any."""
|
|
1249
|
+
return frozenset(descriptor.name for descriptor, fn in _with_forwarded(_discover_tools(handler, environment_name),
|
|
1250
|
+
handler)
|
|
1251
|
+
if _reads_only(_annotations_of(fn)))
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
def _annotations_of(fn: Callable) -> Any:
|
|
1255
|
+
"""A tool's MCP annotations as it was given them: a forwarded tool's as its server lists them."""
|
|
1256
|
+
if (forwarded := getattr(fn, _FORWARDED_ATTR, None)) is not None:
|
|
1257
|
+
return forwarded.annotations
|
|
1258
|
+
options = getattr(fn, _TOOL_OPTIONS_ATTR, None)
|
|
1259
|
+
return options.annotations if options is not None else None
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
def _reads_only(annotations: Any) -> bool:
|
|
1263
|
+
"""Whether MCP annotations, as a dict or a ``ToolAnnotations``, say a tool only reads."""
|
|
1264
|
+
if isinstance(annotations, dict):
|
|
1265
|
+
return annotations.get("readOnlyHint") is True
|
|
1266
|
+
return getattr(annotations, "readOnlyHint", None) is True
|
|
1267
|
+
|
|
1268
|
+
|
|
1245
1269
|
def _served_extensions(handler: Any, ext_handlers: list) -> list:
|
|
1246
1270
|
"""The extension handlers the handler's ``served_extensions`` keeps, with its descriptors."""
|
|
1247
1271
|
hook = getattr(handler, "served_extensions", None)
|
|
@@ -108,7 +108,10 @@ One vocabulary, in three places:
|
|
|
108
108
|
`[video: media/<sha256>.mp4, 4.4 MB, 31 s]`. That covers video, documents, images other than JPEG, PNG, GIF and WebP
|
|
109
109
|
(such as HEIC or SVG), audio outside ATIF's eight types, and other files.
|
|
110
110
|
- Each file's details go in the `media` map of the profile of the object that holds the part (Step for a message,
|
|
111
|
-
ObservationResult for a result), keyed by its path.
|
|
111
|
+
ObservationResult for a result), keyed by its path. A PNG, JPEG, GIF or WebP image's `width` and `height` are read
|
|
112
|
+
from its header when the producer gives none.
|
|
113
|
+
- A reader takes a part path only as `media/<sha256>.<ext>` in the document's own folder, never another path or a URL,
|
|
114
|
+
and checks each file's bytes against its name (`media_file`, `check_media`).
|
|
112
115
|
|
|
113
116
|
## Fields
|
|
114
117
|
|
|
@@ -46,16 +46,16 @@ from .profile import (
|
|
|
46
46
|
read_profile,
|
|
47
47
|
)
|
|
48
48
|
from .kit import KIT_RULES, KitResult, check_adapter
|
|
49
|
-
from .reader import Task, check, is_prefix, load, media_paths, strip_profile, tasks
|
|
49
|
+
from .reader import MEDIA_PATH, Task, check, check_media, is_prefix, load, media_file, media_paths, strip_profile, tasks
|
|
50
50
|
from .runner import AdapterRun, Fed, RecordedTask, replay
|
|
51
51
|
from .served import AuxEntry, ContentItem, MediaItem, ServedData, ServedError, ServedMedia, ServedTurn
|
|
52
52
|
from .validator import RULES, Finding, Rule, errors_in, validate, validate_live
|
|
53
53
|
|
|
54
54
|
__all__ = [
|
|
55
55
|
"Adapter", "AdapterRef", "AdapterRun", "AdapterSpec", "Agent", "AgentProfile", "Arrival", "atif_adapter",
|
|
56
|
-
"AtifError", "AtifTurn", "AudioSource", "aux", "AuxEntry", "check", "check_adapter", "ContentItem", "ContentPart",
|
|
56
|
+
"AtifError", "AtifTurn", "AudioSource", "aux", "AuxEntry", "check", "check_adapter", "check_media", "ContentItem", "ContentPart",
|
|
57
57
|
"Document", "dump_profile", "errors_in", "Fed", "FinalMetrics", "FinalMetricsProfile", "Finding", "finish",
|
|
58
|
-
"FORMAT", "ImageSource", "is_prefix", "KIT_RULES", "KitResult", "load", "Media", "media_paths", "MediaInfo",
|
|
58
|
+
"FORMAT", "ImageSource", "is_prefix", "KIT_RULES", "KitResult", "load", "Media", "MEDIA_PATH", "media_file", "media_paths", "MediaInfo",
|
|
59
59
|
"MediaItem", "Metrics", "MetricsProfile", "Native", "native", "Observation", "ObservationResult",
|
|
60
60
|
"ObservationResultProfile", "PROFILE_KEY", "profile_of", "PROFILE_VERSION", "PROFILES", "RAW_ARGUMENTS",
|
|
61
61
|
"read_profile", "ReasoningBlock", "RecordedTask", "replay", "Rule", "RULES", "SCHEMA_VERSION", "Selector",
|